vendor: 4,479 bytes, lines 1-8
1var jz=Object.defineProperty;var Uz=(n,t,o)=>t in n?jz(n,t,{enumerable:!0,configurable:!0,writable:!0,value:o}):n[t]=o;var zi=(n,t,o)=>Uz(n,typeof t!="symbol"?t+"":t,o);(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const d of document.querySelectorAll('link[rel="modulepreload"]'))u(d);new MutationObserver(d=>{for(const _ of d)if(_.type==="childList")for(const x of _.addedNodes)x.tagName==="LINK"&&x.rel==="modulepreload"&&u(x)}).observe(document,{childList:!0,subtree:!0});function o(d){const _={};return d.integrity&&(_.integrity=d.integrity),d.referrerPolicy&&(_.referrerPolicy=d.referrerPolicy),d.crossOrigin==="use-credentials"?_.credentials="include":d.crossOrigin==="anonymous"?_.credentials="omit":_.credentials="same-origin",_}function u(d){if(d.ep)return;d.ep=!0;const _=o(d);fetch(d.href,_)}})();/** 2* @vue/shared v3.5.13 3* (c) 2018-present Yuxi (Evan) You and Vue contributors 4* @license MIT 5**//*! #__NO_SIDE_EFFECTS__ */function aT(n){const t=Object.create(null);for(const o of n.split(","))t[o]=1;return o=>o in t}const mr={},Xm=[],bu=()=>{},Hz=()=>!1,Vx=n=>n.charCodeAt(0)===111&&n.charCodeAt(1)===110&&(n.charCodeAt(2)>122||n.charCodeAt(2)<97),lT=n=>n.startsWith("onUpdate:"),Fo=Object.assign,cT=(n,t)=>{const o=n.indexOf(t);o>-1&&n.splice(o,1)},Gz=Object.prototype.hasOwnProperty,rr=(n,t)=>Gz.call(n,t),Pn=Array.isArray,Ym=n=>Vy(n)==="[object Map]",gg=n=>Vy(n)==="[object Set]",gC=n=>Vy(n)==="[object Date]",rs=n=>typeof n=="function",Kr=n=>typeof n=="string",zc=n=>typeof n=="symbol",gr=n=>n!==null&&typeof n=="object",aD=n=>(gr(n)||rs(n))&&rs(n.then)&&rs(n.catch),lD=Object.prototype.toString,Vy=n=>lD.call(n),Wz=n=>Vy(n).slice(8,-1),cD=n=>Vy(n)==="[object Object]",uT=n=>Kr(n)&&n!=="NaN"&&n[0]!=="-"&&""+parseInt(n,10)===n,ey=aT(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"),$x=n=>{const t=Object.create(null);return o=>t[o]||(t[o]=n(o))},qz=/-(\w)/g,ic=$x(n=>n.replace(qz,(t,o)=>o?o.toUpperCase():"")),Zz=/\B([A-Z])/g,nf=$x(n=>n.replace(Zz,"-$1").toLowerCase()),jx=$x(n=>n.charAt(0).toUpperCase()+n.slice(1)),ew=$x(n=>n?`on${jx(n)}`:""),Hd=(n,t)=>!Object.is(n,t),Zv=(n,...t)=>{for(let o=0;o<n.length;o++)n[o](...t)},uD=(n,t,o,u=!1)=>{Object.defineProperty(n,t,{configurable:!0,enumerable:!1,writable:u,value:o})},_x=n=>{const t=parseFloat(n);return isNaN(t)?n:t},Xz=n=>{const t=Kr(n)?Number(n):NaN;return isNaN(t)?n:t};let _C;const Ux=()=>_C||(_C=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{});function Nd(n){if(Pn(n)){const t={};for(let o=0;o<n.length;o++){const u=n[o],d=Kr(u)?Qz(u):Nd(u);if(d)for(const _ in d)t[_]=d[_]}return t}else if(Kr(n)||gr(n))return n}const Yz=/;(?![^(]*\))/g,Kz=/:([^]+)/,Jz=/\/\*[^]*?\*\//g;function Qz(n){const t={};return n.replace(Jz,"").split(Yz).forEach(o=>{if(o){const u=o.split(Kz);u.length>1&&(t[u[0].trim()]=u[1].trim())}}),t}function lo(n){let t="";if(Kr(n))t=n;else if(Pn(n))for(let o=0;o<n.length;o++){const u=lo(n[o]);u&&(t+=u+" ")}else if(gr(n))for(const o in n)n[o]&&(t+=o+" ");return t.trim()}const e6="itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly",t6=aT(e6);function hD(n){return!!n||n===""}function i6(n,t){if(n.length!==t.length)return!1;let o=!0;for(let u=0;o&&u<n.length;u++)o=Sp(n[u],t[u]);return o}function Sp(n,t){if(n===t)return!0;let o=gC(n),u=gC(t);if(o||u)return o&&u?n.getTime()===t.getTime():!1;if(o=zc(n),u=zc(t),o||u)return n===t;if(o=Pn(n),u=Pn(t),o||u)return o&&u?i6(n,t):!1;if(o=gr(n),u=gr(t),o||u){if(!o||!u)return!1;const d=Object.keys(n).length,_=Object.keys(t).length;if(d!==_)return!1;for(const x in n){const s=n.hasOwnProperty(x),A=t.hasOwnProperty(x);if(s&&!A||!s&&A||!Sp(n[x],t[x]))return!1}}return String(n)===String(t)}function hT(n,t){return n.findIndex(o=>Sp(o,t))}const dD=n=>!!(n&&n.__v_isRef===!0),Ut=n=>Kr(n)?n:n==null?"":Pn(n)||gr(n)&&(n.toString===lD||!rs(n.toString))?dD(n)?Ut(n.value):JSON.stringify(n,fD,2):String(n),fD=(n,t)=>dD(t)?fD(n,t.value):Ym(t)?{[`Map(${t.size})`]:[...t.entries()].reduce((o,[u,d],_)=>(o[tw(u,_)+" =>"]=d,o),{})}:gg(t)?{[`Set(${t.size})`]:[...t.values()].map(o=>tw(o))}:zc(t)?tw(t):gr(t)&&!Pn(t)&&!cD(t)?String(t):t,tw=(n,t="")=>{var o;return zc(n)?`Symbol(${(o=n.description)!=null?o:t})`:n};/** 6* @vue/reactivity v3.5.13 7* (c) 2018-present Yuxi (Evan) You and Vue contributors 8* @license MIT
vendor: 9,789 bytes, line 9
9**/let _l;class n6{constructor(t=!1){this.detached=t,this._active=!0,this.effects=[],this.cleanups=[],this._isPaused=!1,this.parent=_l,!t&&_l&&(this.index=(_l.scopes||(_l.scopes=[])).push(this)-1)}get active(){return this._active}pause(){if(this._active){this._isPaused=!0;let t,o;if(this.scopes)for(t=0,o=this.scopes.length;t<o;t++)this.scopes[t].pause();for(t=0,o=this.effects.length;t<o;t++)this.effects[t].pause()}}resume(){if(this._active&&this._isPaused){this._isPaused=!1;let t,o;if(this.scopes)for(t=0,o=this.scopes.length;t<o;t++)this.scopes[t].resume();for(t=0,o=this.effects.length;t<o;t++)this.effects[t].resume()}}run(t){if(this._active){const o=_l;try{return _l=this,t()}finally{_l=o}}}on(){_l=this}off(){_l=this.parent}stop(t){if(this._active){this._active=!1;let o,u;for(o=0,u=this.effects.length;o<u;o++)this.effects[o].stop();for(this.effects.length=0,o=0,u=this.cleanups.length;o<u;o++)this.cleanups[o]();if(this.cleanups.length=0,this.scopes){for(o=0,u=this.scopes.length;o<u;o++)this.scopes[o].stop(!0);this.scopes.length=0}if(!this.detached&&this.parent&&!t){const d=this.parent.scopes.pop();d&&d!==this&&(this.parent.scopes[this.index]=d,d.index=this.index)}this.parent=void 0}}}function s6(){return _l}let xr;const iw=new WeakSet;class pD{constructor(t){this.fn=t,this.deps=void 0,this.depsTail=void 0,this.flags=5,this.next=void 0,this.cleanup=void 0,this.scheduler=void 0,_l&&_l.active&&_l.effects.push(this)}pause(){this.flags|=64}resume(){this.flags&64&&(this.flags&=-65,iw.has(this)&&(iw.delete(this),this.trigger()))}notify(){this.flags&2&&!(this.flags&32)||this.flags&8||gD(this)}run(){if(!(this.flags&1))return this.fn();this.flags|=2,yC(this),_D(this);const t=xr,o=Rc;xr=this,Rc=!0;try{return this.fn()}finally{yD(this),xr=t,Rc=o,this.flags&=-3}}stop(){if(this.flags&1){for(let t=this.deps;t;t=t.nextDep)pT(t);this.deps=this.depsTail=void 0,yC(this),this.onStop&&this.onStop(),this.flags&=-2}}trigger(){this.flags&64?iw.add(this):this.scheduler?this.scheduler():this.runIfDirty()}runIfDirty(){i2(this)&&this.run()}get dirty(){return i2(this)}}let mD=0,ty,iy;function gD(n,t=!1){if(n.flags|=8,t){n.next=iy,iy=n;return}n.next=ty,ty=n}function dT(){mD++}function fT(){if(--mD>0)return;if(iy){let t=iy;for(iy=void 0;t;){const o=t.next;t.next=void 0,t.flags&=-9,t=o}}let n;for(;ty;){let t=ty;for(ty=void 0;t;){const o=t.next;if(t.next=void 0,t.flags&=-9,t.flags&1)try{t.trigger()}catch(u){n||(n=u)}t=o}}if(n)throw n}function _D(n){for(let t=n.deps;t;t=t.nextDep)t.version=-1,t.prevActiveLink=t.dep.activeLink,t.dep.activeLink=t}function yD(n){let t,o=n.depsTail,u=o;for(;u;){const d=u.prevDep;u.version===-1?(u===o&&(o=d),pT(u),r6(u)):t=u,u.dep.activeLink=u.prevActiveLink,u.prevActiveLink=void 0,u=d}n.deps=t,n.depsTail=o}function i2(n){for(let t=n.deps;t;t=t.nextDep)if(t.dep.version!==t.version||t.dep.computed&&(vD(t.dep.computed)||t.dep.version!==t.version))return!0;return!!n._dirty}function vD(n){if(n.flags&4&&!(n.flags&16)||(n.flags&=-17,n.globalVersion===_y))return;n.globalVersion=_y;const t=n.dep;if(n.flags|=2,t.version>0&&!n.isSSR&&n.deps&&!i2(n)){n.flags&=-3;return}const o=xr,u=Rc;xr=n,Rc=!0;try{_D(n);const d=n.fn(n._value);(t.version===0||Hd(d,n._value))&&(n._value=d,t.version++)}catch(d){throw t.version++,d}finally{xr=o,Rc=u,yD(n),n.flags&=-3}}function pT(n,t=!1){const{dep:o,prevSub:u,nextSub:d}=n;if(u&&(u.nextSub=d,n.prevSub=void 0),d&&(d.prevSub=u,n.nextSub=void 0),o.subs===n&&(o.subs=u,!u&&o.computed)){o.computed.flags&=-5;for(let _=o.computed.deps;_;_=_.nextDep)pT(_,!0)}!t&&!--o.sc&&o.map&&o.map.delete(o.key)}function r6(n){const{prevDep:t,nextDep:o}=n;t&&(t.nextDep=o,n.prevDep=void 0),o&&(o.prevDep=t,n.nextDep=void 0)}let Rc=!0;const xD=[];function sf(){xD.push(Rc),Rc=!1}function rf(){const n=xD.pop();Rc=n===void 0?!0:n}function yC(n){const{cleanup:t}=n;if(n.cleanup=void 0,t){const o=xr;xr=void 0;try{t()}finally{xr=o}}}let _y=0;class o6{constructor(t,o){this.sub=t,this.dep=o,this.version=o.version,this.nextDep=this.prevDep=this.nextSub=this.prevSub=this.prevActiveLink=void 0}}class mT{constructor(t){this.computed=t,this.version=0,this.activeLink=void 0,this.subs=void 0,this.map=void 0,this.key=void 0,this.sc=0}track(t){if(!xr||!Rc||xr===this.computed)return;let o=this.activeLink;if(o===void 0||o.sub!==xr)o=this.activeLink=new o6(xr,this),xr.deps?(o.prevDep=xr.depsTail,xr.depsTail.nextDep=o,xr.depsTail=o):xr.deps=xr.depsTail=o,bD(o);else if(o.version===-1&&(o.version=this.version,o.nextDep)){const u=o.nextDep;u.prevDep=o.prevDep,o.prevDep&&(o.prevDep.nextDep=u),o.prevDep=xr.depsTail,o.nextDep=void 0,xr.depsTail.nextDep=o,xr.depsTail=o,xr.deps===o&&(xr.deps=u)}return o}trigger(t){this.version++,_y++,this.notify(t)}notify(t){dT();try{for(let o=this.subs;o;o=o.prevSub)o.sub.notify()&&o.sub.dep.notify()}finally{fT()}}}function bD(n){if(n.dep.sc++,n.sub.flags&4){const t=n.dep.computed;if(t&&!n.dep.subs){t.flags|=20;for(let u=t.deps;u;u=u.nextDep)bD(u)}const o=n.dep.subs;o!==n&&(n.prevSub=o,o&&(o.nextSub=n)),n.dep.subs=n}}const n2=new WeakMap,vp=Symbol(""),s2=Symbol(""),yy=Symbol("");function ca(n,t,o){if(Rc&&xr){let u=n2.get(n);u||n2.set(n,u=new Map);let d=u.get(o);d||(u.set(o,d=new mT),d.map=u,d.key=o),d.track()}}function yh(n,t,o,u,d,_){const x=n2.get(n);if(!x){_y++;return}const s=A=>{A&&A.trigger()};if(dT(),t==="clear")x.forEach(s);else{const A=Pn(n),P=A&&uT(o);if(A&&o==="length"){const R=Number(u);x.forEach((V,j)=>{(j==="length"||j===yy||!zc(j)&&j>=R)&&s(V)})}else switch((o!==void 0||x.has(void 0))&&s(x.get(o)),P&&s(x.get(yy)),t){case"add":A?P&&s(x.get("length")):(s(x.get(vp)),Ym(n)&&s(x.get(s2)));break;case"delete":A||(s(x.get(vp)),Ym(n)&&s(x.get(s2)));break;case"set":Ym(n)&&s(x.get(vp));break}}fT()}function Fm(n){const t=er(n);return t===n?t:(ca(t,"iterate",yy),Jl(n)?t:t.map(ua))}function Hx(n){return ca(n=er(n),"iterate",yy),n}const a6={__proto__:null,[Symbol.iterator](){return nw(this,Symbol.iterator,ua)},concat(...n){return Fm(this).concat(...n.map(t=>Pn(t)?Fm(t):t))},entries(){return nw(this,"entries",n=>(n[1]=ua(n[1]),n))},every(n,t){return ch(this,"every",n,t,void 0,arguments)},filter(n,t){return ch(this,"filter",n,t,o=>o.map(ua),arguments)},find(n,t){return ch(this,"find",n,t,ua,arguments)},findIndex(n,t){return ch(this,"findIndex",n,t,void 0,arguments)},findLast(n,t){return ch(this,"findLast",n,t,ua,arguments)},findLastIndex(n,t){return ch(this,"findLastIndex",n,t,void 0,arguments)},forEach(n,t){return ch(this,"forEach",n,t,void 0,arguments)},includes(...n){return sw(this,"includes",n)},indexOf(...n){return sw(this,"indexOf",n)},join(n){return Fm(this).join(n)},lastIndexOf(...n){return sw(this,"lastIndexOf",n)},map(n,t){return ch(this,"map",n,t,void 0,arguments)},pop(){return R_(this,"pop")},push(...n){return R_(this,"push",n)},reduce(n,...t){return vC(this,"reduce",n,t)},reduceRight(n,...t){return vC(this,"reduceRight",n,t)},shift(){return R_(this,"shift")},some(n,t){return ch(this,"some",n,t,void 0,arguments)},splice(...n){return R_(this,"splice",n)},toReversed(){return Fm(this).toReversed()},toSorted(n){return Fm(this).toSorted(n)},toSpliced(...n){return Fm(this).toSpliced(...n)},unshift(...n){return R_(this,"unshift",n)},values(){return nw(this,"values",ua)}};function nw(n,t,o){const u=Hx(n),d=u[t]();return u!==n&&!Jl(n)&&(d._next=d.next,d.next=()=>{const _=d._next();return _.value&&(_.value=o(_.value)),_}),d}const l6=Array.prototype;function ch(n,t,o,u,d,_){const x=Hx(n),s=x!==n&&!Jl(n),A=x[t];if(A!==l6[t]){const V=A.apply(n,_);return s?ua(V):V}let P=o;x!==n&&(s?P=function(V,j){return o.call(this,ua(V),j,n)}:o.length>2&&(P=function(V,j){return o.call(this,V,j,n)}));const R=A.call(x,P,u);return s&&d?d(R):R}function vC(n,t,o,u){const d=Hx(n);let _=o;return d!==n&&(Jl(n)?o.length>3&&(_=function(x,s,A){return o.call(this,x,s,A,n)}):_=function(x,s,A){return o.call(this,x,ua(s),A,n)}),d[t](_,...u)}function sw(n,t,o){const u=er(n);ca(u,"iterate",yy);const d=u[t](...o);return(d===-1||d===!1)&&yT(o[0])?(o[0]=er(o[0]),u[t](...o)):d}function R_(n,t,o=[]){sf(),dT();const u=er(n)[t].apply(n,o);return fT(),rf(),u}const c6=aT("__proto__,__v_isRef,__isVue"),wD=new Set(Object.getOwnPropertyNames(Symbol).filter(n=>n!=="arguments"&&n!=="caller").map(n=>Symbol[n]).filter(zc));function u6(n){zc(n)||(n=String(n));const t=er(this);return ca(t,"has",n),t.hasOwnProperty(n)}class TD{constructor(t=!1,o=!1){this._isReadonly=t,this._isShallow=o}get(t,o,u){if(o==="__v_skip")return t.__v_skip;const d=this._isReadonly,_=this._isShallow;if(o==="__v_isReactive")return!d;if(o==="__v_isReadonly")return d;if(o==="__v_isShallow")return _;if(o==="__v_raw")return u===(d?_?x6:CD:_?AD:ED).get(t)||Object.getPrototypeOf(t)===Object.getPrototypeOf(u)?t:void 0;const x=Pn(t);if(!d){let A;if(x&&(A=a6[o]))return A;if(o==="hasOwnProperty")return u6}const s=Reflect.get(t,o,fa(t)?t:u);return(zc(o)?wD.has(o):c6(o))||(d||ca(t,"get",o),_)?s:fa(s)?x&&uT(o)?s:s.value:gr(s)?d?MD(s):Gx(s):s}}class SD extends TD{constructor(t=!1){super(!1,t)}set(t,o,u,d){let _=t[o];if(!this._isShallow){const A=Ep(_);if(!Jl(u)&&!Ep(u)&&(_=er(_),u=er(u)),!Pn(t)&&fa(_)&&!fa(u))return A?!1:(_.value=u,!0)}const x=Pn(t)&&uT(o)?Number(o)<t.length:rr(t,o),s=Reflect.set(t,o,u,fa(t)?t:d);return t===er(d)&&(x?Hd(u,_)&&yh(t,"set",o,u):yh(t,"add",o,u)),s}deleteProperty(t,o){const u=rr(t,o);t[o];const d=Reflect.deleteProperty(t,o);return d&&u&&yh(t,"delete",o,void 0),d}has(t,o){const u=Reflect.has(t,o);return(!zc(o)||!wD.has(o))&&ca(t,"has",o),u}ownKeys(t){return ca(t,"iterate",Pn(t)?"length":vp),Reflect.ownKeys(t)}}class h6 extends TD{constructor(t=!1){super(!0,t)}set(t,o){return!0}deleteProperty(t,o){return!0}}const d6=new SD,f6=new h6,p6=new SD(!0);const r2=n=>n,gv=n=>Reflect.getPrototypeOf(n);function m6(n,t,o){return function(...u){const d=this.__v_raw,_=er(d),x=Ym(_),s=n==="entr
9ies"||n===Symbol.iterator&&x,A=n==="keys"&&x,P=d[n](...u),R=o?r2:t?o2:ua;return!t&&ca(_,"iterate",A?s2:vp),{next(){const{value:V,done:j}=P.next();return j?{value:V,done:j}:{value:s?[R(V[0]),R(V[1])]:R(V),done:j}},[Symbol.iterator](){return this}}}}function _v(n){return function(...t){return n==="delete"?!1:n==="clear"?void 0:this}}function g6(n,t){const o={get(d){const _=this.__v_raw,x=er(_),s=er(d);n||(Hd(d,s)&&ca(x,"get",d),ca(x,"get",s));const{has:A}=gv(x),P=t?r2:n?o2:ua;if(A.call(x,d))return P(_.get(d));if(A.call(x,s))return P(_.get(s));_!==x&&_.get(d)},get size(){const d=this.__v_raw;return!n&&ca(er(d),"iterate",vp),Reflect.get(d,"size",d)},has(d){const _=this.__v_raw,x=er(_),s=er(d);return n||(Hd(d,s)&&ca(x,"has",d),ca(x,"has",s)),d===s?_.has(d):_.has(d)||_.has(s)},forEach(d,_){const x=this,s=x.__v_raw,A=er(s),P=t?r2:n?o2:ua;return!n&&ca(A,"iterate",vp),s.forEach((R,V)=>d.call(_,P(R),P(V),x))}};return Fo(o,n?{add:_v("add"),set:_v("set"),delete:_v("delete"),clear:_v("clear")}:{add(d){!t&&!Jl(d)&&!Ep(d)&&(d=er(d));const _=er(this);return gv(_).has.call(_,d)||(_.add(d),yh(_,"add",d,d)),this},set(d,_){!t&&!Jl(_)&&!Ep(_)&&(_=er(_));const x=er(this),{has:s,get:A}=gv(x);let P=s.call(x,d);P||(d=er(d),P=s.call(x,d));const R=A.call(x,d);return x.set(d,_),P?Hd(_,R)&&yh(x,"set",d,_):yh(x,"add",d,_),this},delete(d){const _=er(this),{has:x,get:s}=gv(_);let A=x.call(_,d);A||(d=er(d),A=x.call(_,d)),s&&s.call(_,d);const P=_.delete(d);return A&&yh(_,"delete",d,void 0),P},clear(){const d=er(this),_=d.size!==0,x=d.clear();return _&&yh(d,"clear",void 0,void 0),x}}),["keys","values","entries",Symbol.iterator].forEach(d=>{o[d]=m6(d,n,t)}),o}function gT(n,t){const o=g6(n,t);return(u,d,_)=>d==="__v_isReactive"?!n:d==="__v_isReadonly"?n:d==="__v_raw"?u:Reflect.get(rr(o,d)&&d in u?o:u,d,_)}const _6={get:gT(!1,!1)},y6={get:gT(!1,!0)},v6={get:gT(!0,!1)};const ED=new WeakMap,AD=new WeakMap,CD=new WeakMap,x6=new WeakMap;function b6(n){switch(n){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}function w6(n){return n.__v_skip||!Object.isExtensible(n)?0:b6(Wz(n))}function Gx(n){return Ep(n)?n:_T(n,!1,d6,_6,ED)}function ID(n){return _T(n,!1,p6,y6,AD)}function MD(n){return _T(n,!0,f6,v6,CD)}function _T(n,t,o,u,d){if(!gr(n)||n.__v_raw&&!(t&&n.__v_isReactive))return n;const _=d.get(n);if(_)return _;const x=w6(n);if(x===0)return n;const s=new Proxy(n,x===2?u:o);return d.set(n,s),s}function Km(n){return Ep(n)?Km(n.__v_raw):!!(n&&n.__v_isReactive)}function Ep(n){return!!(n&&n.__v_isReadonly)}function Jl(n){return!!(n&&n.__v_isShallow)}function yT(n){return n?!!n.__v_raw:!1}function er(n){const t=n&&n.__v_raw;return t?er(t):n}function T6(n){return!rr(n,"__v_skip")&&Object.isExtensible(n)&&uD(n,"__v_skip",!0),n}const ua=n=>gr(n)?Gx(n):n,o2=n=>gr(n)?MD(n):n;function fa(n){return n?n.__v_isRef===!0:!1}function Mi(n){return PD(n,!1)}function S6(n){return PD(n,!0)}function PD(n,t){return fa(n)?n:new E6(n,t)}class E6{constructor(t,o){this.dep=new mT,this.__v_isRef=!0,this.__v_isShallow=!1,this._rawValue=o?t:er(t),this._value=o?t:ua(t),this.__v_isShallow=o}get value(){return this.dep.track(),this._value}set value(t){const o=this._rawValue,u=this.__v_isShallow||Jl(t)||Ep(t);t=u?t:er(t),Hd(t,o)&&(this._rawValue=t,this._value=u?t:ua(t),this.dep.trigger())}}function cs(n){return fa(n)?n.value:n}const A6={get:(n,t,o)=>
vendor: 2,588 bytes, lines 9-12
9t==="__v_raw"?n:cs(Reflect.get(n,t,o)),set:(n,t,o,u)=>{const d=n[t];return fa(d)&&!fa(o)?(d.value=o,!0):Reflect.set(n,t,o,u)}};function DD(n){return Km(n)?n:new Proxy(n,A6)}class C6{constructor(t,o,u){this.fn=t,this.setter=o,this._value=void 0,this.dep=new mT(this),this.__v_isRef=!0,this.deps=void 0,this.depsTail=void 0,this.flags=16,this.globalVersion=_y-1,this.next=void 0,this.effect=this,this.__v_isReadonly=!o,this.isSSR=u}notify(){if(this.flags|=16,!(this.flags&8)&&xr!==this)return gD(this,!0),!0}get value(){const t=this.dep.track();return vD(this),t&&(t.version=this.dep.version),this._value}set value(t){this.setter&&this.setter(t)}}function I6(n,t,o=!1){let u,d;return rs(n)?u=n:(u=n.get,d=n.set),new C6(u,d,o)}const yv={},yx=new WeakMap;let up;function M6(n,t=!1,o=up){if(o){let u=yx.get(o);u||yx.set(o,u=[]),u.push(n)}}function P6(n,t,o=mr){const{immediate:u,deep:d,once:_,scheduler:x,augmentJob:s,call:A}=o,P=Ve=>d?Ve:Jl(Ve)||d===!1||d===0?vh(Ve,1):vh(Ve);let R,V,j,Q,me=!1,re=!1;if(fa(n)?(V=()=>n.value,me=Jl(n)):Km(n)?(V=()=>P(n),me=!0):Pn(n)?(re=!0,me=n.some(Ve=>Km(Ve)||Jl(Ve)),V=()=>n.map(Ve=>{if(fa(Ve))return Ve.value;if(Km(Ve))return P(Ve);if(rs(Ve))return A?A(Ve,2):Ve()})):rs(n)?t?V=A?()=>A(n,2):n:V=()=>{if(j){sf();try{j()}finally{rf()}}const Ve=up;up=R;try{return A?A(n,3,[Q]):n(Q)}finally{up=Ve}}:V=bu,t&&d){const Ve=V,Je=d===!0?1/0:d;V=()=>vh(Ve(),Je)}const be=s6(),ve=()=>{R.stop(),be&&be.active&&cT(be.effects,R)};if(_&&t){const Ve=t;t=(...Je)=>{Ve(...Je),ve()}}let Ee=re?new Array(n.length).fill(yv):yv;const je=Ve=>{if(!(!(R.flags&1)||!R.dirty&&!Ve))if(t){const Je=R.run();if(d||me||(re?Je.some((vt,_t)=>Hd(vt,Ee[_t])):Hd(Je,Ee))){j&&j();const vt=up;up=R;try{const _t=[Je,Ee===yv?void 0:re&&Ee[0]===yv?[]:Ee,Q];A?A(t,3,_t):t(..._t),Ee=Je}finally{up=vt}}}else R.run()};return s&&s(je),R=new pD(V),R.scheduler=x?()=>x(je,!1):je,Q=Ve=>M6(Ve,!1,R),j=R.onStop=()=>{const Ve=yx.get(R);if(Ve){if(A)A(Ve,4);else for(const Je of Ve)Je();yx.delete(R)}},t?u?je(!0):Ee=R.run():x?x(je.bind(null,!0),!0):R.run(),ve.pause=R.pause.bind(R),ve.resume=R.resume.bind(R),ve.stop=ve,ve}function vh(n,t=1/0,o){if(t<=0||!gr(n)||n.__v_skip||(o=o||new Set,o.has(n)))return n;if(o.add(n),t--,fa(n))vh(n.value,t,o);else if(Pn(n))for(let u=0;u<n.length;u++)vh(n[u],t,o);else if(gg(n)||Ym(n))n.forEach(u=>{vh(u,t,o)});else if(cD(n)){for(const u in n)vh(n[u],t,o);for(const u of Object.getOwnPropertySymbols(n))Object.prototype.propertyIsEnumerable.call(n,u)&&vh(n[u],t,o)}return n}/** 10* @vue/runtime-core v3.5.13 11* (c) 2018-present Yuxi (Evan) You and Vue contributors 12* @license MIT
13**/function $y(n,t,o,u){try{return u?n(...u):n()}catch(d){Wx(d,t,o)}}function Fc(n,t,o,u){if(rs(n)){const d=$y(n,t,o,u);return d&&aD(d)&&d.catch(_=>{Wx(_,t,o)}),d}if(Pn(n)){const d=[];for(let _=0;_<n.length;_++)d.push(Fc(n[_],t,o,u));return d}}function Wx(n,t,o,u=!0){const d=t?t.vnode:null,{errorHandler:_,throwUnhandledErrorInProduction:x}=t&&t.appContext.config||mr;if(t){let s=t.parent;const A=t.proxy,P=`https://vuejs.org/error-reference/#runtime-${o}`;for(;s;){const R=s.ec;if(R){for(let V=0;V<R.length;V++)if(R[V](n,A,P)===!1)return}s=s.parent}if(_){sf(),$y(_,null,10,[n,A,P]),rf();return}}D6(n,o,d,u,x)}function D6(n,t,o,u=!0,d=!1){if(d)throw n;console.error(n)}const Sa=[];let gu=-1;const Jm=[];let Od=null,jm=0;const kD=Promise.resolve();let vx=null;function qx(n){const t=vx||kD;return n?t.then(this?n.bind(this):n):t}function k6(n){let t=gu+1,o=Sa.length;for(;t<o;){const u=t+o>>>1,d=Sa[u],_=vy(d);_<n||_===n&&d.flags&2?t=u+1:o=u}return t}function vT(n){if(!(n.flags&1)){const t=vy(n),o=Sa[Sa.length-1];!o||!(n.flags&2)&&t>=vy(o)?Sa.push(n):Sa.splice(k6(t),0,n),n.flags|=1,LD()}}function LD(){vx||(vx=kD.then(OD))}function L6(n){Pn(n)?Jm.push(...n):Od&&n.id===-1?Od.splice(jm+1,0,n):n.flags&1||(Jm.push(n),n.flags|=1),LD()}function xC(n,t,o=gu+1){for(;o<Sa.length;o++){const u=Sa[o];if(u&&u.flags&2){if(n&&u.id!==n.uid)continue;Sa.splice(o,1),o--,u.flags&4&&(u.flags&=-2),u(),u.flags&4||(u.flags&=-2)}}}function RD(n){if(Jm.length){const t=[...new Set(Jm)].sort((o,u)=>vy(o)-vy(u));if(Jm.length=0,Od){Od.push(...t);return}for(Od=t,jm=0;jm<Od.length;jm++){const o=Od[jm];o.flags&4&&(o.flags&=-2),o.flags&8||o(),o.flags&=-2}Od=null,jm=0}}const vy=n=>n.id==null?n.flags&2?-1:1/0:n.id;function OD(n){try{for(gu=0;gu<Sa.length;gu++){const t=Sa[gu];t&&!(t.flags&8)&&(t.flags&4&&(t.flags&=-2),$y(t,t.i,t.i?15:14),t.flags&4||(t.flags&=-2))}}finally{for(;gu<Sa.length;gu++){const t=Sa[gu];t&&(t.flags&=-2)}gu=-1,Sa.length=0,RD(),vx=null,(Sa.length||Jm.length)&&OD()}}let Oo=null,zD=null;function xx(n){const t=Oo;return Oo=n,zD=n&&n.type.__scopeId||null,t}function vl(n,t=Oo,o){if(!t||n._n)return n;const u=(...d)=>{u._d&&RC(-1);const _=xx(t);let x;try{x=n(...d)}finally{xx(_),u._d&&RC(1)}return x};return u._n=!0,u._c=!0,u._d=!0,u}function An(n,t){if(Oo===null)return n;const o=Jx(Oo),u=n.dirs||(n.dirs=[]);for(let d=0;d<t.length;d++){let[_,x,s,A=mr]=t[d];_&&(rs(_)&&(_={mounted:_,updated:_}),_.deep&&vh(x),u.push({dir:_,instance:o,value:x,oldValue:void 0,arg:s,modifiers:A}))}return n}function ip(n,t,o,u){const d=n.dirs,_=t&&t.dirs;for(let x=0;x<d.length;x++){const s=d[x];_&&(s.oldValue=_[x].value);let A=s.dir[u];A&&(sf(),Fc(A,o,8,[n.el,s,n,t]),rf())}}const FD=Symbol("_vte"),BD=n=>n.__isTeleport,ny=n=>n&&(n.disabled||n.disabled===""),bC=n=>n&&(n.defer||n.defer===""),wC=n=>typeof SVGElement<"u"&&n instanceof SVGElement,TC=n=>typeof MathMLElement=="function"&&n instanceof MathMLElement,a2=(n,t)=>{const o=n&&n.to;return Kr(o)?t?t(o):null:o},ND={name:"Teleport",__isTeleport:!0,process(n,t,o,u,d,_,x,s,A,P){const{mc:R,pc:V,pbc:j,o:{insert:Q,querySelector:me,createText:re,createComment:be}}=P,ve=ny(t.props);let{shapeFlag:Ee,children:je,dynamicChildren:Ve}=t;if(n==null){const Je=t.el=re(""),vt=t.anchor=re("");Q(Je,o,u),Q(vt,o,u);const _t=(At,ei)=>{Ee&16&&(d&&d.isCE&&(d.ce._teleportTarget=At),R(je,At,ei,d,_,x,s,A))},Mt=()=>{const At=t.target=a2(t.props,me),ei=VD(At,t,re,Q);At&&(x!=="svg"&&wC(At)?x="svg":x!=="mathml"&&TC(At)&&(x="mathml"),ve||(_t(At,ei),Xv(t,!1)))};ve&&(_t(o,vt),Xv(t,!0)),bC(t.props)?Ta(()=>{Mt(),t.el.__isMounted=!0},_):Mt()}else{if(bC(t.props)&&!n.el.__isMounted){Ta(()=>{ND.process(n,t,o,u,d,_,x,s,A,P),delete n.el.__isMounted},_);return}t.el=n.el,t.targetStart=n.targetStart;const Je=t.anchor=n.anchor,vt=t.target=n.target,_t=t.targetAnchor=n.targetAnchor,Mt=ny(n.props),At=Mt?o:vt,ei=Mt?Je:_t;if(x==="svg"||wC(vt)?x="svg":(x==="mathml"||TC(vt))&&(x="mathml"),Ve?(j(n.dynamicChildren,Ve,At,d,_,x,s),TT(n,t,!0)):A||V(n,t,At,ei,d,_,x,s,!1),ve)Mt?t.props&&n.props&&t.props.to!==n.props.to&&(t.props.to=n.props.to):vv(t,o,Je,P,1);else if((t.props&&t.props.to)!==(n.props&&n.props.to)){const Yt=t.target=a2(t.props,me);Yt&&vv(t,Yt,null,P,0)}else Mt&&vv(t,vt,_t,P,1);Xv(t,ve)}},remove(n,t,o,{um:u,o:{remove:d}},_){const{shapeFlag:x,children:s,anchor:A,targetStart:P,targetAnchor:R,target:V,props:j}=n;if(V&&(d(P),d(R)),_&&d(A),x&16){const Q=_||!ny(j);for(let me=0;me<s.length;me++){const re=s[me];u(re,t,o,Q,!!re.dynamicChildren)}}},move:vv,hydrate:R6};function vv(n,t,o,{o:{insert:u},m:d},_=2){_===0&&u(n.targetAnchor,t,o);const{el:x,anchor:s,shapeFlag:A,children:P,props:R}
vendor: 4,188 bytes, line 13
13=n,V=_===2;if(V&&u(x,t,o),(!V||ny(R))&&A&16)for(let j=0;j<P.length;j++)d(P[j],t,o,2);V&&u(s,t,o)}function R6(n,t,o,u,d,_,{o:{nextSibling:x,parentNode:s,querySelector:A,insert:P,createText:R}},V){const j=t.target=a2(t.props,A);if(j){const Q=ny(t.props),me=j._lpa||j.firstChild;if(t.shapeFlag&16)if(Q)t.anchor=V(x(n),t,s(n),o,u,d,_),t.targetStart=me,t.targetAnchor=me&&x(me);else{t.anchor=x(n);let re=me;for(;re;){if(re&&re.nodeType===8){if(re.data==="teleport start anchor")t.targetStart=re;else if(re.data==="teleport anchor"){t.targetAnchor=re,j._lpa=t.targetAnchor&&x(t.targetAnchor);break}}re=x(re)}t.targetAnchor||VD(j,t,R,P),V(me&&x(me),t,j,o,u,d,_)}Xv(t,Q)}return t.anchor&&x(t.anchor)}const O6=ND;function Xv(n,t){const o=n.ctx;if(o&&o.ut){let u,d;for(t?(u=n.el,d=n.anchor):(u=n.targetStart,d=n.targetAnchor);u&&u!==d;)u.nodeType===1&&u.setAttribute("data-v-owner",o.uid),u=u.nextSibling;o.ut()}}function VD(n,t,o,u){const d=t.targetStart=o(""),_=t.targetAnchor=o("");return d[FD]=_,n&&(u(d,n),u(_,n)),_}const zd=Symbol("_leaveCb"),xv=Symbol("_enterCb");function z6(){const n={isMounted:!1,isLeaving:!1,isUnmounting:!1,leavingVNodes:new Map};return kh(()=>{n.isMounted=!0}),ZD(()=>{n.isUnmounting=!0}),n}const Yl=[Function,Array],$D={mode:String,appear:Boolean,persisted:Boolean,onBeforeEnter:Yl,onEnter:Yl,onAfterEnter:Yl,onEnterCancelled:Yl,onBeforeLeave:Yl,onLeave:Yl,onAfterLeave:Yl,onLeaveCancelled:Yl,onBeforeAppear:Yl,onAppear:Yl,onAfterAppear:Yl,onAppearCancelled:Yl},jD=n=>{const t=n.subTree;return t.component?jD(t.component):t},F6={name:"BaseTransition",props:$D,setup(n,{slots:t}){const o=LF(),u=z6();return()=>{const d=t.default&&GD(t.default(),!0);if(!d||!d.length)return;const _=UD(d),x=er(n),{mode:s}=x;if(u.isLeaving)return rw(_);const A=SC(_);if(!A)return rw(_);let P=l2(A,x,u,o,V=>P=V);A.type!==Ea&&xy(A,P);let R=o.subTree&&SC(o.subTree);if(R&&R.type!==Ea&&!fp(A,R)&&jD(o).type!==Ea){let V=l2(R,x,u,o);if(xy(R,V),s==="out-in"&&A.type!==Ea)return u.isLeaving=!0,V.afterLeave=()=>{u.isLeaving=!1,o.job.flags&8||o.update(),delete V.afterLeave,R=void 0},rw(_);s==="in-out"&&A.type!==Ea?V.delayLeave=(j,Q,me)=>{const re=HD(u,R);re[String(R.key)]=R,j[zd]=()=>{Q(),j[zd]=void 0,delete P.delayedLeave,R=void 0},P.delayedLeave=()=>{me(),delete P.delayedLeave,R=void 0}}:R=void 0}else R&&(R=void 0);return _}}};function UD(n){let t=n[0];if(n.length>1){for(const o of n)if(o.type!==Ea){t=o;break}}return t}const B6=F6;function HD(n,t){const{leavingVNodes:o}=n;let u=o.get(t.type);return u||(u=Object.create(null),o.set(t.type,u)),u}function l2(n,t,o,u,d){const{appear:_,mode:x,persisted:s=!1,onBeforeEnter:A,onEnter:P,onAfterEnter:R,onEnterCancelled:V,onBeforeLeave:j,onLeave:Q,onAfterLeave:me,onLeaveCancelled:re,onBeforeAppear:be,onAppear:ve,onAfterAppear:Ee,onAppearCancelled:je}=t,Ve=String(n.key),Je=HD(o,n),vt=(At,ei)=>{At&&Fc(At,u,9,ei)},_t=(At,ei)=>{const Yt=ei[1];vt(At,ei),Pn(At)?At.every(Zt=>Zt.length<=1)&&Yt():At.length<=1&&Yt()},Mt={mode:x,persisted:s,beforeEnter(At){let ei=A;if(!o.isMounted)if(_)ei=be||A;else return;At[zd]&&At[zd](!0);const Yt=Je[Ve];Yt&&fp(n,Yt)&&Yt.el[zd]&&Yt.el[zd](),vt(ei,[At])},enter(At){let ei=P,Yt=R,Zt=V;if(!o.isMounted)if(_)ei=ve||P,Yt=Ee||R,Zt=je||V;else return;let yi=!1;const Fi=At[xv]=ki=>{yi||(yi=!0,ki?vt(Zt,[At]):vt(Yt,[At]),Mt.delayedLeave&&Mt.delayedLeave(),At[xv]=void 0)};ei?_t(ei,[At,Fi]):Fi()},leave(At,ei){const Yt=String(n.key);if(At[xv]&&At[xv](!0),o.isUnmounting)return ei();vt(j,[At]);let Zt=!1;const yi=At[zd]=Fi=>{Zt||(Zt=!0,ei(),Fi?vt(re,[At]):vt(me,[At]),At[zd]=void 0,Je[Yt]===n&&delete Je[Yt])};Je[Yt]=n,Q?_t(Q,[At,yi]):yi()},clone(At){const ei=l2(At,t,o,u,d);return d&&d(ei),ei}};return Mt}function rw(n){if(Zx(n))return n=Wd(n),n.children=null,n}function SC(n){if(!Zx(n))return BD(n.type)&&n.children?UD(n.children):n;const{shapeFlag:t,children:o}=n;if(o){if(t&16)return o[0];if(t&32&&rs(o.default))return o.default()}}function xy(n,t){n.shapeFlag&6&&n.component?(n.transition=t,xy(n.component.subTree,t)):n.shapeFlag&128?(n.ssContent.transition=t.clone(n.ssContent),n.ssFallback.transition=t.clone(n.ssFallback)):n.transition=t}function GD(n,t=!1,o){let u=[],d=0;for(let _=0;_<n.length;_++){let x=n[_];
13const s=o==null?x.key:String(o)+String(x.key!=null?x.key:_);x.type===fn?(x.patchFlag&128&&d++,u=u.concat(GD(x.children,t,s))):(t||x.type!==Ea)&&u.push(s!=null?Wd(x,{key:s}):x)}if(d>1)for(let _=0;_<u.length;_++)u[_].patchFlag=-2;return u}/*! #__NO_SIDE_EFFECTS__ */function xT(n,t){return rs(n)?Fo({name:n.name},t,{setup:n}):n}function WD(n){n.ids=[n.ids[0]+n.ids[2]+++"-",0,0]}function bx(n,t,o,u,d=!1){if(Pn(n)){n.forEach((me,re)=>bx(me,t&&(Pn(t)?t[re]:t),o,u,d));return}if(Qm(u)&&!d){u.shapeFlag&512&&u.type.__asyncResolved&&u.component.subTree.component&&bx(n,t,o,u.component.subTree);return}const _=u.shapeFlag&4?Jx(u.component):u.el,x=d?null:_,{i:s,r:A}=n,P=t&&t.r,R=s.refs===mr?s.refs={}:s.refs,V=s.setupState,j=er(V),Q=V===mr?()=>!1:me=>rr(j,me);if(P!=null&&P!==A&&(Kr(P)?(R[P]=null,Q(P)&&(V[P]=null)):fa(P)&&(P.value=null)),rs(A))$y(A,s,12,[x,R]);else{const me=Kr(A),re=fa(A);if(me||re){const be=()=>{if(n.f){const ve=me?Q(A)?V[A]:R[A]:A.value;d?Pn(ve)&&cT(ve,_):Pn(ve)?ve.includes(_)||ve.push(_):me?(R[A]=[_],Q(A)&&(V[A]=R[A])):(A.value=[_],n.k&&(R[n.k]=A.value))}else me?(R[A]=x,Q(A)&&(V[A]=x)):re&&(A.value=x,n.k&&(R[n.k]=x))};x?(be.id=-1,Ta(be,o)):be()}}}Ux().requestIdleCallback;Ux().cancelIdleCallback;const Qm=n=>!!n.type.__asyncLoader,Zx=n=>n.type.__isKeepAlive;function N6(n,t){qD(n,"a",t)}function V6(n,t){qD(n,"da",t)}function qD(n,t,o=Zo){const u=n.__wdc||(n.__wdc=()=>{let d=o;for(;d;){if(d.isDeactivated)return;d=d.parent}return n()});if(Xx(t,u,o),o){let d=o.parent;for(;d&&d.parent;)Zx(d.parent.vnode)&&$6(u,t,o,d),d=d.parent}}function $6(n,t,o,u){const d=Xx(t,n,u,!0);bT(()=>{cT(u[t],d)},o)}function Xx(n,t,o=Zo,u=!1){if(o){const d=o[n]||(o[n]=[]),_=t.__weh||(t.__weh=(...x)=>{sf();const s=jy(o),A=Fc(t,o,n,x);return s(),rf(),A});return u?d.unshift(_):d.push(_),_}}const Dh=n=>(t,o=Zo)=>{(!Ty||n==="sp")&&Xx(n,(...u)=>t(...u),o)},j6=Dh("bm"),kh=Dh("m"),U6=Dh("bu"),H6=Dh("u"),ZD=Dh("bum"),bT=Dh("um"),G6=Dh("sp"),W6=Dh("rtg"),q6=Dh("rtc");function Z6(n,t=Zo){Xx("ec",n,t)}const XD="components",X6="directives";function _g(n,t){return YD(XD,n,!0,t)||n}const Y6=Symbol.for("v-ndc");function Rp(n){return YD(X6,n)}function YD(n,t,o=!0,u=!1){const d=Oo||Zo;if(d){const _=d.type;if(n===XD){const s=BF(_,!1);if(s&&(s===t||s===ic(t)||s===jx(ic(t))))return _}const x=EC(d[n]||_[n],t)||EC(d.appContext[n],t);return!x&&u?_:x}}function EC(n,t){return n&&(n[t]||n[ic(t)]||n[jx(ic(t))])}function Hn(n,t,o,u){let d;const _=o,x=Pn(n);if(x||Kr(n)){const s=x&&Km(n);let A=!1;s&&(A=!Jl(n),n=Hx(n)),d=new Array(n.length);for(let P=0,R=n.length;P<R;P++)d[P]=t(A?ua(n[P]):n[P],P,void 0,_)}else if(typeof n=="number"){d=new Array(n);for(let s=0;s<n;s++)d[s]=t(s+1,s,void 0,_)}else if(gr(n))if(n[Symbol.iterator])d=Array.from(n,(s,A)=>t(s,A,void 0,_));else{const s=Object.keys(n);d=new Array(s.length);for(let A=0,P=s.length;A<P;A++){const R=s[A];d[A]=t(n[R],R,A,_)}}else d=[];return d}function K6(n,t,o={},u,d){if(Oo.ce||Oo.parent&&Qm(Oo.parent)&&Oo.parent.ce)return Ke(),Ap(fn,null,[Dt("slot",o,u)],64);let _=n[t];_&&_._c&&(_._d=!1),Ke();const x=_&&KD(_(o)),s=o.key||x&&x.key,A=Ap(fn,{key:(s&&!zc(s)?s:`_${t}`)+""},x||[],x&&n._===1?64:-2);return _&&_._c&&(_._d=!0),A}function KD(n){return n.some(t=>wy(t)?!(t.type===Ea||t.type===fn&&!KD(t.children)):!0)?n:null}const c2=n=>n?_4(n)?Jx(n):c2(n.parent):null,sy=Fo(Object.create(null),{$:n=>n,$el:n=>n.vnode.el,$data:n=>n.data,$props:n=>n.props,$attrs:n=>n.attrs,$slots:n=>n.slots,$refs:n=>n.refs,$parent:n=>c2(n.parent),$root:n=>c2(n.root),$host:n=>n.ce,$emit:n=>n.emit,$options:n=>QD(n),$forceUpdate:n=>n.f||(n.f=()=>{vT(n.update)}),$nextTick:n=>n.n||(n.n=qx.bind(n.proxy)),$watch:n=>yF.bind(n)}),ow=(n,t)=>n!==mr&&!n.__isScriptSetup&&rr(n,t),J6={get({_:n},t){if(t==="__v_skip")return!0;const{ctx:o,setupState:u,data:d,props:_,accessCache:x,type:s,appContext:A}=n;let P;if(t[0]!=="$"){const Q=x[t];if(Q!==void 0)switch(Q){case 1:return u[t];case 2:return d[t];case 4:return o[t];case 3:return _[t]}else{if(ow(u,t))return x[t]=1,u[t];if(d!==mr&&rr(d,t))return x[t]=2,d[t];if((P=n.propsOptions[0])&&rr(P,t))return x[t]=3,_[t];if(o!==mr&&rr(o,t))return x[t]=4,o[t];u2&&(x[t]=0)}}const R=sy[t];let V,j;if(R)return t==="$attrs"&&ca(n.attrs,"get",""),R(n);if((V=s.__cssModules)&&(V=V[t]))return V;if(o!==mr&&rr(o,t))return x[t]=4,o[t];if(j=A.config.globalProperties,rr(j,t))return j[t]},set({_:n},t,o){const{data:u,setupState:d,ctx:_}=n;return ow(d,t)?(d[t]=o,!0):u!==mr&&rr(u,t)?(u[t]=o,!0):rr(n.props,t)||t[0]==="$"&&t.slice(1)in n?!1:(_[t]=o,!0)},has({_:{data:n,setupState:t,accessCache:o,ctx:u,appContext:d,propsOptions:_}},x){let s;return!!o[x]||n!==mr&&rr(n,x)||ow(t,x)||(s=_[0])&&rr(s,x)||rr(u,x)||rr(sy,x)||rr(d.config.globalProperties,x)},defineProperty(n,t,o){return o.get!=null?n._.accessCache[t]=0:rr(o,"value")&&this.set(n,t,o.value,
vendor: 28,191 bytes, line 13
13null),Reflect.defineProperty(n,t,o)}};function AC(n){return Pn(n)?n.reduce((t,o)=>(t[o]=null,t),{}):n}let u2=!0;function Q6(n){const t=QD(n),o=n.proxy,u=n.ctx;u2=!1,t.beforeCreate&&CC(t.beforeCreate,n,"bc");const{data:d,computed:_,methods:x,watch:s,provide:A,inject:P,created:R,beforeMount:V,mounted:j,beforeUpdate:Q,updated:me,activated:re,deactivated:be,beforeDestroy:ve,beforeUnmount:Ee,destroyed:je,unmounted:Ve,render:Je,renderTracked:vt,renderTriggered:_t,errorCaptured:Mt,serverPrefetch:At,expose:ei,inheritAttrs:Yt,components:Zt,directives:yi,filters:Fi}=t;if(P&&eF(P,u,null),x)for(const Li in x){const cn=x[Li];rs(cn)&&(u[Li]=cn.bind(o))}if(d){const Li=d.call(o,o);gr(Li)&&(n.data=Gx(Li))}if(u2=!0,_)for(const Li in _){const cn=_[Li],vi=rs(cn)?cn.bind(o,o):rs(cn.get)?cn.get.bind(o,o):bu,Ue=!rs(cn)&&rs(cn.set)?cn.set.bind(o):bu,Yn=bs({get:vi,set:Ue});Object.defineProperty(u,Li,{enumerable:!0,configurable:!0,get:()=>Yn.value,set:Ki=>Yn.value=Ki})}if(s)for(const Li in s)JD(s[Li],u,o,Li);if(A){const Li=rs(A)?A.call(o):A;Reflect.ownKeys(Li).forEach(cn=>{Yv(cn,Li[cn])})}R&&CC(R,n,"c");function wi(Li,cn){Pn(cn)?cn.forEach(vi=>Li(vi.bind(o))):cn&&Li(cn.bind(o))}if(wi(j6,V),wi(kh,j),wi(U6,Q),wi(H6,me),wi(N6,re),wi(V6,be),wi(Z6,Mt),wi(q6,vt),wi(W6,_t),wi(ZD,Ee),wi(bT,Ve),wi(G6,At),Pn(ei))if(ei.length){const Li=n.exposed||(n.exposed={});ei.forEach(cn=>{Object.defineProperty(Li,cn,{get:()=>o[cn],set:vi=>o[cn]=vi})})}else n.exposed||(n.exposed={});Je&&n.render===bu&&(n.render=Je),Yt!=null&&(n.inheritAttrs=Yt),Zt&&(n.components=Zt),yi&&(n.directives=yi),At&&WD(n)}function eF(n,t,o=bu){Pn(n)&&(n=h2(n));for(const u in n){const d=n[u];let _;gr(d)?"default"in d?_=wu(d.from||u,d.default,!0):_=wu(d.from||u):_=wu(d),fa(_)?Object.defineProperty(t,u,{enumerable:!0,configurable:!0,get:()=>_.value,set:x=>_.value=x}):t[u]=_}}function CC(n,t,o){Fc(Pn(n)?n.map(u=>u.bind(t.proxy)):n.bind(t.proxy),t,o)}function JD(n,t,o,u){let d=u.includes(".")?d4(o,u):()=>o[u];if(Kr(n)){const _=t[n];rs(_)&&xp(d,_)}else if(rs(n))xp(d,n.bind(o));else if(gr(n))if(Pn(n))n.forEach(_=>JD(_,t,o,u));else{const _=rs(n.handler)?n.handler.bind(o):t[n.handler];rs(_)&&xp(d,_,n)}}function QD(n){const t=n.type,{mixins:o,extends:u}=t,{mixins:d,optionsCache:_,config:{optionMergeStrategies:x}}=n.appContext,s=_.get(t);let A;return s?A=s:!d.length&&!o&&!u?A=t:(A={},d.length&&d.forEach(P=>wx(A,P,x,!0)),wx(A,t,x)),gr(t)&&_.set(t,A),A}function wx(n,t,o,u=!1){const{mixins:d,extends:_}=t;_&&wx(n,_,o,!0),d&&d.forEach(x=>wx(n,x,o,!0));for(const x in t)if(!(u&&x==="expose")){const s=tF[x]||o&&o[x];n[x]=s?s(n[x],t[x]):t[x]}return n}const tF={data:IC,props:MC,emits:MC,methods:G_,computed:G_,beforeCreate:wa,created:wa,beforeMount:wa,mounted:wa,beforeUpdate:wa,updated:wa,beforeDestroy:wa,beforeUnmount:wa,destroyed:wa,unmounted:wa,activated:wa,deactivated:wa,errorCaptured:wa,serverPrefetch:wa,components:G_,directives:G_,watch:nF,provide:IC,inject:iF};function IC(n,t){return t?n?function(){return Fo(rs(n)?n.call(this,this):n,rs(t)?t.call(this,this):t)}:t:n}function iF(n,t){return G_(h2(n),h2(t))}function h2(n){if(Pn(n)){const t={};for(let o=0;o<n.length;o++)t[n[o]]=n[o];return t}return n}function wa(n,t){return n?[...new Set([].concat(n,t))]:t}function G_(n,t){return n?Fo(Object.create(null),n,t):t}function MC(n,t){return n?Pn(n)&&Pn(t)?[...new Set([...n,...t])]:Fo(Object.create(null),AC(n),AC(t??{})):t}function nF(n,t){if(!n)return t;if(!t)return n;const o=Fo(Object.create(null),n);for(const u in t)o[u]=wa(n[u],t[u]);return o}function e4(){return{app:null,config:{isNativeTag:Hz,performance:!1,globalProperties:{},optionMergeStrategies:{},errorHandler:void 0,warnHandler:void 0,compilerOptions:{}},mixins:[],components:{},directives:{},provides:Object.create(null),optionsCache:new WeakMap,propsCache:new WeakMap,emitsCache:new WeakMap}}let sF=0;function rF(n,t){return function(u,d=null){rs(u)||(u=Fo({},u)),d!=null&&!gr(d)&&(d=null);const _=e4(),x=new WeakSet,s=[];let A=!1;const P=_.app={_uid:sF++,_component:u,_props:d,_container:null,_context:_,_instance:null,version:VF,get config(){return _.config},set config(R){},use(R,...V){return x.has(R)||(R&&rs(R.install)?(x.add(R),R.install(P,...V)):rs(R)&&(x.add(R),R(P,...V))),P},mixin(R){return _.mixins.includes(R)||_.mixins.push(R),P},component(R,V){return V?(_.components[R]=V,P):_.components[R]},directive(R,V){return V?(_.directives[R]=V,P):_.directives[R]},mount(R,V,j){if(!A){const Q=P._ceVNode||Dt(u,d);return Q.appContext=_,j===!0?j="svg":j===!1&&(j=void 0),n(Q,R,j),A=!0,P._container=R,R.__vue_app__=P,Jx(Q.component)}},onUnmount(R){s.push(R)},unmount(){A&&(Fc(s,P._instance,16),n(null,P._container),delete P._container.__vue_app__)},provide(R,V){return _.provides[R]=V,P},runWithContext(R){const V=eg;eg=P;try{return R()}finally{eg=V}}};return P}}let eg=null;function Yv(n,t){if(Zo){let o=Zo.provides;const u=Zo.parent&&Zo.parent.provides;u===o&&(o=Zo.provides=Object.create(u)),o[n]=t}}function wu(n,t,o=!1){const u=Zo||Oo;if(u||eg){const d=eg?eg._context.provides:u?u.parent==null?u.vnode.appContext&&u.vnode.appContext.provides:u.parent.provides:void 0;if(d&&n in d)return d[n];if(arguments.length>1)return o&&rs(t)?t.call(u&&u.proxy):t}}const t4={},i4=()=>Object.create(t4),n4=n=>Object.getPrototypeOf(n)===t4;function oF(n,t,o,u=!1){const d={},_=i4();n.propsDefaults=Object.create(null),s4(n,t,d,_);for(const x in n.propsOptions[0])x in d||(d[x]=void 0);o?n.props=u?d:ID(d):n.type.props?n.props=d:n.props=_,n.attrs=_}function aF(n,t,o,u){const{props:d,attrs:_,vnode:{patchFlag:x}}=n,s=er(d),[A]=n.propsOptions;let P=!1;if((u||x>0)&&!(x&16)){if(x&8){const R=n.vnode.dynamicProps;for(let V=0;V<R.length;V++){let j=R[V];if(Yx(n.emitsOptions,j))continue;const Q=t[j];if(A)if(rr(_,j))Q!==_[j]&&(_[j]=Q,P=!0);else{const me=ic(j);d[me]=d2(A,s,me,Q,n,!1)}else Q!==_[j]&&(_[j]=Q,P=!0)}}}else{s4(n,t,d,_)&&(P=!0);let R;for(const V in s)(!t||!rr(t,V)&&((R=nf(V))===V||!rr(t,R)))&&(A?o&&(o[V]!==void 0||o[R]!==void 0)&&(d[V]=d2(A,s,V,void 0,n,!0)):delete d[V]);if(_!==s)for(const V in _)(!t||!rr(t,V))&&(delete _[V],P=!0)}P&&yh(n.attrs,"set","")}function s4(n,t,o,u){const[d,_]=n.propsOptions;let x=!1,s;if(t)for(let A in t){if(ey(A))continue;const P=t[A];let R;d&&rr(d,R=ic(A))?!_||!_.includes(R)?o[R]=P:(s||(s={}))[R]=P:Yx(n.emitsOptions,A)||(!(A in u)||P!==u[A])&&(u[A]=P,x=!0)}if(_){const A=er(o),P=s||mr;for(let R=0;R<_.length;R++){const V=_[R];o[V]=d2(d,A,V,P[V],n,!rr(P,V))}}return x}function d2(n,t,o,u,d,_){const x=n[o];if(x!=null){const s=rr(x,"default");if(s&&u===void 0){const A=x.default;if(x.type!==Function&&!x.skipFactory&&rs(A)){const{propsDefaults:P}=d;if(o in P)u=P[o];else{const R=jy(d);u=P[o]=A.call(null,t),R()}}else u=A;d.ce&&d.ce._setProp(o,u)}x[0]&&(_&&!s?u=!1:x[1]&&(u===""||u===nf(o))&&(u=!0))}return u}const lF=new WeakMap;function r4(n,t,o=!1){const u=o?lF:t.propsCache,d=u.get(n);if(d)return d;const _=n.props,x={},s=[];let A=!1;if(!rs(n)){const R=V=>{A=!0;const[j,Q]=r4(V,t,!0);Fo(x,j),Q&&s.push(...Q)};!o&&t.mixins.length&&t.mixins.forEach(R),n.extends&&R(n.extends),n.mixins&&n.mixins.forEach(R)}if(!_&&!A)return gr(n)&&u.set(n,Xm),Xm;if(Pn(_))for(let R=0;R<_.length;R++){const V=ic(_[R]);PC(V)&&(x[V]=mr)}else if(_)for(const R in _){const V=ic(R);if(PC(V)){const j=_[R],Q=x[V]=Pn(j)||rs(j)?{type:j}:Fo({},j),me=Q.type;let re=!1,be=!0;if(Pn(me))for(let ve=0;ve<me.length;++ve){const Ee=me[ve],je=rs(Ee)&&Ee.name;if(je==="Boolean"){re=!0;break}else je==="String"&&(be=!1)}else re=rs(me)&&me.name==="Boolean";Q[0]=re,Q[1]=be,(re||rr(Q,"default"))&&s.push(V)}}const P=[x,s];return gr(n)&&u.set(n,P),P}function PC(n){return n[0]!=="$"&&!ey(n)}const o4=n=>n[0]==="_"||n==="$stable",wT=n=>Pn(n)?n.map(yu):[yu(n)],cF=(n,t,o)=>{if(t._n)return t;const u=vl((...d)=>wT(t(...d)),o);return u._c=!1,u},a4=(n,t,o)=>{const u=n._ctx;for(const d in n){if(o4(d))continue;const _=n[d];if(rs(_))t[d]=cF(d,_,u);else if(_!=null){const x=wT(_);t[d]=()=>x}}},l4=(n,t)=>{const o=wT(t);n.slots.default=()=>o},c4=(n,t,o)=>{for(const u in t)(o||u!=="_")&&(n[u]=t[u])},uF=(n,t,o)=>{const u=n.slots=i4();if(n.vnode.shapeFlag&32){const d=t._;d?(c4(u,t,o),o&&uD(u,"_",d,!0)):a4(t,u)}else t&&l4(n,t)},hF=(n,t,o)=>{const{vnode:u,slots:d}=n;let _=!0,x=mr;if(u.shapeFlag&32){const s=t._;s?o&&s===1?_=!1:c4(d,t,o):(_=!t.$stable,a4(t,d)),x=t}else t&&(l4(n,t),x={default:1});if(_)for(const s in d)!o4(s)&&x[s]==null&&delete d[s]},Ta=EF;function dF(n){return fF(n)}function fF(n,t){const o=Ux();o.__VUE__=!0;const{insert:u,remove:d,patchProp:_,createElement:x,createText:s,createComment:A,setText:P,setElementText:R,parentNode:V,nextSibling:j,setScopeId:Q=bu,insertStaticContent:me}=n,re=(Fe,Oe,dt,$t=null,Ft=null,Wt=null,Ti=void 0,pi=null,di=!!Oe.dynamicChildren)=>{if(Fe===Oe)return;Fe&&!fp(Fe,Oe)&&($t=Ct(Fe),Ki(Fe,Ft,Wt,!0),Fe=null),Oe.patchFlag===-2&&(di=!1,Oe.dynamicChildren=null);const{type:ai,ref:on,shapeFlag:Ci}=Oe;switch(ai){case Kx:be(Fe,Oe,dt,$t);break;case Ea:ve(Fe,Oe,dt,$t);break;case Kv:Fe==null&&Ee(Oe,dt,$t,Ti);break;case fn:Zt(Fe,Oe,dt,$t,Ft,Wt,Ti,pi,di);break;default:Ci&1?Je(Fe,Oe,dt,$t,Ft,Wt,Ti,pi,di):Ci&6?yi(Fe,Oe,dt,$t,Ft,Wt,Ti,pi,di):(Ci&64||Ci&128)&&ai.process(Fe,Oe,dt,$t,Ft,Wt,Ti,pi,di,qi)}on!=null&&Ft&&bx(on,Fe&&Fe.ref,Wt,Oe||Fe,!Oe)},be=(Fe,Oe,dt,$t)=>{if(Fe==null)u(Oe.el=s(Oe.children),dt,$t);else{const Ft=Oe.el=Fe.el;Oe.children!==Fe.children&&P(Ft,Oe.children)}},ve=(Fe,Oe,dt,$t)=>{Fe==null?u(Oe.el=A(Oe.children||""),dt,$t):Oe.el=Fe.el},Ee=(Fe,Oe,dt,$t)=>{[Fe.el,Fe.anchor]=me(Fe.children,Oe,dt,$t,Fe.el,Fe.anchor)},je=({el:Fe,anchor:Oe},dt,$t)=>{let Ft;for(;Fe&&Fe!==Oe;)Ft=j(Fe),u(Fe,dt,$t),Fe=Ft;u(Oe,dt,$t)},Ve=({el:Fe,anchor:Oe})=>{let dt;for(;Fe&&Fe!==Oe;)dt=j(Fe),d(Fe),Fe=dt;d(Oe)},Je=(Fe,Oe,dt,$t,Ft,Wt,Ti,pi,di)=>{Oe.type==="svg"?Ti="svg":Oe.type==="math"&&(Ti="mathml"),Fe==null?vt(Oe,dt,$t,Ft,Wt,Ti,pi,di):At(Fe,Oe,Ft,Wt,Ti,pi,di)},vt=(Fe,Oe,dt,$t,Ft,Wt,Ti,pi)=>{let di,ai;const{props:on,shapeFlag:Ci,transition:Bi,dirs:Gi}=Fe;if(di=Fe.el=x(Fe.type,Wt,on&&on.is,on),Ci&8?R(di,Fe.children):Ci&16&&Mt(Fe.children,di,null,$t,Ft,aw(Fe,Wt),Ti,pi),Gi&&ip(Fe,null,$t,"created"),_t(di,Fe,Fe.scopeId,Ti,$t),on){for(const Kn in on)Kn!=="value"&&!ey(Kn)&&_(di,Kn,null,on[Kn],Wt,$t);"value"in on&&_(di,"value",null,on.value,Wt),(ai=on.onVnodeBeforeMount)&&pu(ai,$t,Fe)}Gi&&ip(Fe,null,$t,"beforeMount");const Vn=pF(Ft,Bi);Vn&&Bi.beforeEnter(di),u(di,Oe,dt),((ai=on&&on.onVnodeMounted)||Vn||Gi)&&Ta(()=>{ai&&pu(ai,$t,Fe),Vn&&Bi.enter(di),Gi&&ip(Fe,null,$t,"mounted")},Ft)},_t=(Fe,Oe,dt,$t,Ft)=>{if(dt&&Q(Fe,dt),$t)for(let Wt=0;Wt<$t.length;Wt++)Q(Fe,$t[Wt]);if(Ft){let Wt=Ft.subTree;if(Oe===Wt||p4(Wt.type)&&(Wt.ssContent===Oe||Wt.ssFallback===Oe)){const Ti=Ft.vnode;_t(Fe,Ti,Ti.scopeId,Ti.slotScopeIds,Ft.parent)}}},Mt=(Fe,Oe,dt,$t,Ft,Wt,Ti,pi,di=0)=>{for(let ai=di;ai<Fe.length;ai++){const on=Fe[ai]=pi?Fd(Fe[ai]):yu(Fe[ai]);re(null,on,Oe,dt,$t,Ft,Wt,Ti,pi)}},At=(Fe,Oe,dt,$t,Ft,Wt,Ti)=>{const pi=Oe.el=Fe.el;let{patchFlag:di,dynamicChildren:ai,dirs:on}=Oe;di|=Fe.patchFlag&16;const Ci=Fe.props||mr,Bi=Oe.props||mr;let Gi;if(dt&&np(dt,!1),(Gi=Bi.onVnodeBeforeUpdate)&&pu(Gi,dt,Oe,Fe),on&&ip(Oe,Fe,dt,"beforeUpdate"),dt&&np(dt,!0),(Ci.innerHTML&&Bi.innerHTML==null||Ci.textContent&&Bi.textContent==null)&&R(pi,""),ai?ei(Fe.dynamicChildren,ai,pi,dt,$t,aw(Oe,Ft),Wt):Ti||cn(Fe,Oe,pi,null,dt,$t,aw(Oe,Ft),Wt,!1),di>0){if(di&16)Yt(pi,Ci,Bi,dt,Ft);else if(di&2&&Ci.class!==Bi.class&&_(pi,"class",null,Bi.class,Ft),di&4&&_(pi,"style",Ci.style,Bi.style,Ft),di&8){const Vn=Oe.dynamicProps;for(let Kn=0;Kn<Vn.length;Kn++){const $n=Vn[Kn],Us=Ci[$n],Qs=Bi[$n];(Qs!==Us||$n==="value")&&_(pi,$n,Us,Qs,Ft,dt)}}di&1&&Fe.children!==Oe.children&&R(pi,Oe.children)}else!Ti&&ai==null&&Yt(pi,Ci,Bi,dt,Ft);((Gi=Bi.onVnodeUpdated)||on)&&Ta(()=>{Gi&&pu(Gi,dt,Oe,Fe),on&&ip(Oe,Fe,dt,"updated")},$t)},ei=(Fe,Oe,dt,$t,Ft,Wt,Ti)=>{for(let pi=0;pi<Oe.length;pi++){const di=Fe[pi],ai=Oe[pi],on=di.el&&(di.type===fn||!fp(di,ai)||di.shapeFlag&70)?V(di.el):dt;re(di,ai,on,null,$t,Ft,Wt,Ti,!0)}},Yt=(Fe,Oe,dt,$t,Ft)=>{if(Oe!==dt){if(Oe!==mr)for(const Wt in Oe)!ey(Wt)&&!(Wt in dt)&&_(Fe,Wt,Oe[Wt],null,Ft,$t);for(const Wt in dt){if(ey(Wt))continue;const Ti=dt[Wt],pi=Oe[Wt];Ti!==pi&&Wt!=="value"&&_(Fe,Wt,pi,Ti,Ft,$t)}"value"in dt&&_(Fe,"value",Oe.value,dt.value,Ft)}},Zt=(Fe,Oe,dt,$t,Ft,Wt,Ti,pi,di)=>{const ai=Oe.el=Fe?Fe.el:s(""),on=Oe.anchor=Fe?Fe.anchor:s("");let{patchFlag:Ci,dynamicChildren:Bi,slotScopeIds:Gi}=Oe;Gi&&(pi=pi?pi.concat(Gi):Gi),Fe==null?(u(ai,dt,$t),u(on,dt,$t),Mt(Oe.children||[],dt,on,Ft,Wt,Ti,pi,di)):Ci>0&&Ci&64&&Bi&&Fe.dynamicChildren?(ei(Fe.dynamicChildren,Bi,dt,Ft,Wt,Ti,pi),(Oe.key!=null||Ft&&Oe===Ft.subTree)&&TT(Fe,Oe,!0)):cn(Fe,Oe,dt,on,Ft,Wt,Ti,pi,di)},yi=(Fe,Oe,dt,$t,Ft,Wt,Ti,pi,di)=>{Oe.slotScopeIds=pi,Fe==null?Oe.shapeFlag&512?Ft.ctx.activate(Oe,dt,$t,Ti,di):Fi(Oe,dt,$t,Ft,Wt,Ti,di):ki(Fe,Oe,di)},Fi=(Fe,Oe,dt,$t,Ft,Wt,Ti)=>{const pi=Fe.component=kF(Fe,$t,Ft);if(Zx(Fe)&&(pi.ctx.renderer=qi),RF(pi,!1,Ti),pi.asyncDep){if(Ft&&Ft.registerDep(pi,wi,Ti),!Fe.el){const di=pi.subTree=Dt(Ea);ve(null,di,Oe,dt)}}else wi(pi,Fe,Oe,dt,Ft,Wt,Ti)},ki=(Fe,Oe,dt)=>{const $t=Oe.component=Fe.component;if(TF(Fe,Oe,dt))if($t.asyncDep&&!$t.asyncResolved){Li($t,Oe,dt);return}else $t.next=Oe,$t.update();else Oe.el=Fe.el,$t.vnode=Oe},wi=(Fe,Oe,dt,$t,Ft,Wt,Ti)=>{const pi=()=>{if(Fe.isMounted){let{next:Ci,bu:Bi,u:Gi,parent:Vn,vnode:Kn}=Fe;{const Pr=u4(Fe);if(Pr){Ci&&(Ci.el=Kn.el,Li(Fe,Ci,Ti)),Pr.asyncDep.then(()=>{Fe.isUnmounted||pi()});return}}let $n=Ci,Us;np(Fe,!1),Ci?(Ci.el=Kn.el,Li(Fe,Ci,Ti)):Ci=Kn,Bi&&Zv(Bi),(Us=Ci.props&&Ci.props.onVnodeBeforeUpdate)&&pu(Us,Vn,Ci,Kn),np(Fe,!0);const Qs=kC(Fe),tr=Fe.subTree;Fe.subTree=Qs,re(tr,Qs,V(tr.el),Ct(tr),Fe,Ft,Wt),Ci.el=Qs.el,$n===null&&SF(Fe,Qs.el),Gi&&Ta(Gi,Ft),(Us=Ci.props&&Ci.props.onVnodeUpdated)&&Ta(()=>pu(Us,Vn,Ci,Kn),Ft)}else{let Ci;const{el:Bi,props:Gi}=Oe,{bm:Vn,m:Kn,parent:$n,root:Us,type:Qs}=Fe,tr=Qm(Oe);np(Fe,!1),Vn&&Zv(Vn),!tr&&(Ci=Gi&&Gi.onVnodeBeforeMount)&&pu(Ci,$n,Oe),np(Fe,!0);{Us.ce&&Us.ce._injectChildStyle(Qs);const Pr=Fe.subTree=kC(Fe);re(null,Pr,dt,$t,Fe,Ft,Wt),Oe.el=Pr.el}if(Kn&&Ta(Kn,Ft),!tr&&(Ci=Gi&&Gi.onVnodeMounted)){const Pr=Oe;Ta(()=>pu(Ci,$n,Pr),Ft)}(Oe.shapeFlag&256||$n&&Qm($n.vnode)&&$n.vnode.shapeFlag&256)&&Fe.a&&Ta(Fe.a,Ft),Fe.isMounted=!0,Oe=dt=$t=null}};Fe.scope.on();const di=Fe.effect=new pD(pi);Fe.scope.off();const ai=Fe.update=di.run.bind(di),on=Fe.job=di.runIfDirty.bind(di);on.i=Fe,on.id=Fe.uid,di.scheduler=()=>vT(on),np(Fe,!0),ai()},Li=(Fe,Oe,dt)=>{Oe.component=Fe;const $t=Fe.vnode.props;Fe.vnode=Oe,Fe.next=null,aF(Fe,Oe.props,$t,dt),hF(Fe,Oe.children,dt),sf(),xC(Fe),rf()},cn=(Fe,Oe,dt,$t,Ft,Wt,Ti,pi,di=!1)=>{const ai=Fe&&Fe.children,on=Fe?Fe.shapeFlag:0,Ci=Oe.children,{patchFlag:Bi,shapeFlag:Gi}=Oe;if(Bi>0){if(Bi&128){Ue(ai,Ci,dt,$t,Ft,Wt,Ti,pi,di);return}else if(Bi&256){vi(ai,Ci,dt,$t,Ft,Wt,Ti,pi,di);return}}Gi&8?(on&16&&Hi(ai,Ft,Wt),Ci!==ai&&R(dt,Ci)):on&16?Gi&16?Ue(ai,Ci,dt,$t,Ft,Wt,Ti,pi,di):Hi(ai,Ft,Wt,!0):(on&8&&R(dt,""),Gi&16&&Mt(Ci,dt,$t,Ft,Wt,Ti,pi,di))},vi=(Fe,Oe,dt,$t,Ft,Wt,Ti,pi,di)=>{Fe=Fe||Xm,Oe=Oe||Xm;const ai=Fe.length,on=Oe.length,Ci=Math.min(ai,on);let Bi;for(Bi=0;Bi<Ci;Bi++){const Gi=Oe[Bi]=di?Fd(Oe[Bi]):yu(Oe[Bi]);re(Fe[Bi],Gi,dt,null,Ft,Wt,Ti,pi,di)}ai>on?Hi(Fe,Ft,Wt,!0,!1,Ci):Mt(Oe,dt,$t,Ft,Wt,Ti,pi,di,Ci)},Ue=(Fe,Oe,dt,$t,Ft,Wt,Ti,pi,di)=>{let ai=0;const on=Oe.length;let Ci=Fe.length-1,Bi=on-1;for(;ai<=Ci&&ai<=Bi;){const Gi=Fe[ai],Vn=Oe[ai]=di?Fd(Oe[ai]):yu(Oe[ai]);if(fp(Gi,Vn))re(Gi,Vn,dt,null,Ft,Wt,Ti,pi,di);else break;ai++}for(;ai<=Ci&&ai<=Bi;){const Gi=Fe[Ci],Vn=Oe[Bi]=di?Fd(Oe[Bi]):yu(Oe[Bi]);if(fp(Gi,Vn))re(Gi,Vn,dt,null,Ft,Wt,Ti,pi,di);else break;Ci--,Bi--}if(ai>Ci){if(ai<=Bi){const Gi=Bi+1,Vn=Gi<on?Oe[Gi].el:$t;for(;ai<=Bi;)re(null,Oe[ai]=di?Fd(Oe[ai]):yu(Oe[ai]),dt,Vn,Ft,Wt,Ti,pi,di),ai++}}else if(ai>Bi)for(;ai<=Ci;)Ki(Fe[ai],Ft,Wt,!0),ai++;else{const Gi=ai,Vn=ai,Kn=new Map;for(ai=Vn;ai<=Bi;ai++){const wr=Oe[ai]=di?Fd(Oe[ai]):yu(Oe[ai]);wr.key!=null&&Kn.set(wr.key,ai)}let $n,Us=0;const Qs=Bi-Vn+1;let tr=!1,Pr=0;const Mo=new Array(Qs);for(ai=0;ai<Qs;ai++)Mo[ai]=0;for(ai=Gi;ai<=Ci;ai++){const wr=Fe[ai];if(Us>=Qs){Ki(wr,Ft,Wt,!0);continue}let Hr;if(wr.key!=null)Hr=Kn.get(wr.key);else for($n=Vn;$n<=Bi;$n++)if(Mo[$n-Vn]===0&&fp(wr,Oe[$n])){Hr=$n;break}Hr===void 0?Ki(wr,Ft,Wt,!0):(Mo[Hr-Vn]=ai+1,Hr>=Pr?Pr=Hr:tr=!0,re(wr,Oe[Hr],dt,null,Ft,Wt,Ti,pi,di),Us++)}const Bo=tr?mF(Mo):Xm;for($n=Bo.length-1,ai=Qs-1;ai>=0;ai--){const wr=Vn+ai,Hr=Oe[wr],El=wr+1<on?Oe[wr+1].el:$t;Mo[ai]===0?re(null,Hr,dt,El,Ft,Wt,Ti,pi,di):tr&&($n<0||ai!==Bo[$n]?Yn(Hr,dt,El,2):$n--)}}},Yn=(Fe,Oe,dt,$t,Ft=null)=>{const{el:Wt,type:Ti,transition:pi,children:di,shapeFlag:ai}=Fe;if(ai&6){Yn(Fe.component.subTree,Oe,dt,$t);return}if(ai&128){Fe.suspense.move(Oe,dt,$t);return}if(ai&64){Ti.move(Fe,Oe,dt,qi);return}if(Ti===fn){u(Wt,Oe,dt);for(let Ci=0;Ci<di.length;Ci++)Yn(di[Ci],Oe,dt,$t);u(Fe.anchor,Oe,dt);return}if(Ti===Kv){je(Fe,Oe,dt);return}if($t!==2&&ai&1&&pi)if($t===0)pi.beforeEnter(Wt),u(Wt,Oe,dt),Ta(()=>pi.enter(Wt),Ft);else{const{leave:Ci,delayLeave:Bi,afterLeave:Gi}=pi,Vn=()=>u(Wt,Oe,dt),Kn=()=>{Ci(Wt,()=>{Vn(),Gi&&Gi()})};Bi?Bi(Wt,Vn,Kn):Kn()}else u(Wt,Oe,dt)},Ki=(Fe,Oe,dt,$t=!1,Ft=!1)=>{const{type:Wt,props:Ti,ref:pi,children:di,dynamicChildren:ai,shapeFlag:on,patchFlag:Ci,dirs:Bi,cacheIndex:Gi}=Fe;if(Ci===-2&&(Ft=!1),pi!=null&&bx(pi,null,dt,Fe,!0),Gi!=null&&(Oe.renderCache[Gi]=void 0),on&256){Oe.ctx.deactivate(Fe);return}const Vn=on&1&&Bi,Kn=!Qm(Fe);let $n;if(Kn&&($n=Ti&&Ti.onVnodeBeforeUnmount)&&pu($n,Oe,Fe),on&6)hn(Fe.component,dt,$t);else{if(on&128){Fe.suspense.unmount(dt,$t);return}Vn&&ip(Fe,null,Oe,"beforeUnmount"),on&64?Fe.type.remove(Fe,Oe,dt,qi,$t):ai&&!ai.hasOnce&&(Wt!==fn||Ci>0&&Ci&64)?Hi(ai,Oe,dt,!1,!0):(Wt===fn&&Ci&384||!Ft&&on&16)&&Hi(di,Oe,dt),$t&&ps(Fe)}(Kn&&($n=Ti&&Ti.onVnodeUnmounted)||Vn)&&Ta(()=>{$n&&pu($n,Oe,Fe),Vn&&ip(Fe,null,Oe,"unmounted")},dt)},ps=Fe=>{const{type:Oe,el:dt,anchor:$t,transition:Ft}=Fe;if(Oe===fn){On(dt,$t);return}if(Oe===Kv){Ve(Fe);return}const Wt=()=>{d(dt),Ft&&!Ft.persisted&&Ft.afterLeave&&Ft.afterLeave()};if(Fe.shapeFlag&1&&Ft&&!Ft.persisted){const{leave:Ti,delayLeave:pi}=Ft,di=()=>Ti(dt,Wt);pi?pi(Fe.el,Wt,di):di()}else Wt()},On=(Fe,Oe)=>{let dt;for(;Fe!==Oe;)dt=j(Fe),d(Fe),Fe=dt;d(Oe)},hn=(Fe,Oe,dt)=>{const{bum:$t,scope:Ft,job:Wt,subTree:Ti,um:pi,m:di,a:ai}=Fe;DC(di),DC(ai),$t&&Zv($t),Ft.stop(),Wt&&(Wt.flags|=8,Ki(Ti,Fe,Oe,dt)),pi&&Ta(pi,Oe),Ta(()=>{Fe.isUnmounted=!0},Oe),Oe&&Oe.pendingBranch&&!Oe.isUnmounted&&Fe.asyncDep&&!Fe.asyncResolved&&Fe.suspenseId===Oe.pendingId&&(Oe.deps--,Oe.deps===0&&Oe.resolve())},Hi=(Fe,Oe,dt,$t=!1,Ft=!1,Wt=0)=>{for(let Ti=Wt;Ti<Fe.length;Ti++)Ki(Fe[Ti],Oe,dt,$t,Ft)},Ct=Fe=>{if(Fe.shapeFlag&6)return Ct(Fe.component.subTree);if(Fe.shapeFlag&128)return Fe.suspense.next();const Oe=j(Fe.anchor||Fe.el),dt=Oe&&Oe[FD];return dt?j(dt):Oe};let zt=!1;const ti=(Fe,Oe,dt)=>{Fe==null?Oe._vnode&&Ki(Oe._vnode,null,null,!0):re(Oe._vnode||null,Fe,Oe,null,null,null,dt),Oe._vnode=Fe,zt||(zt=!0,xC(),RD(),zt=!1)},qi={p:re,um:Ki,m:Yn,r:ps,mt:Fi,mc:Mt,pc:cn,pbc:ei,n:Ct,o:n};return{render:ti,hydrate:void 0,createApp:rF(ti)}}function aw({type:n,props:t},o){return o==="svg"&&n==="foreignObject"||o==="mathml"&&n==="annotation-xml"&&t&&t.encoding&&t.encoding.includes("html")?void 0:o}function np({effect:n,job:t},o){o?(n.flags|=32,t.flags|=4):(n.flags&=-33,t.flags&=-5)}function pF(n,t){return(!n||n&&!n.pendingBranch)&&t&&!t.persisted}function TT(n,t,o=!1){const u=n.children,d=t.children;if(Pn(u)&&Pn(d))for(let _=0;_<u.length;_++){const x=u[_];let s=d[_];s.shapeFlag&1&&!s.dynamicChildren&&((s.patchFlag<=0||s.patchFlag===32)&&(s=d[_]=Fd(d[_]),s.el=x.el),!o&&s.patchFlag!==-2&&TT(x,s)),s.type===Kx&&(s.el=x.el)}}function mF(n){const t=n.slice(),o=[0];let u,d,_,x,s;const A=n.length;for(u=0;u<A;u++){const P=n[u];if(P!==0){if(d=o[o.length-1],n[d]<P){t[u]=d,o.push(u);continue}for(_=0,x=o.length-1;_<x;)s=_+x>>1,n[o[s]]<P?_=s+1:x=s;P<n[o[_]]&&(_>0&&(t[u]=o[_-1]),o[_]=u)}}for(_=o.length,x=o[_-1];_-- >0;)o[_]=x,x=t[x];return o}function u4(n){const t=n.subTree.component;if(t)return t.asyncDep&&!t.asyncResolved?t:u4(t)}function DC(n){if(n)for(let t=0;t<n.length;t++)n[t].flags|=8}const gF=Symbol.for("v-scx"),_F=()=>wu(gF);function xp(n,t,o){return h4(n,t,o)}function h4(n,t,o=mr){const{immediate:u,deep:d,flush:_,once:x}=o,s=Fo({},o),A=t&&u||!t&&_!=="post";let P;if(Ty){if(_==="sync"){const Q=_F();P=Q.__watcherHandles||(Q.__watcherHandles=[])}else if(!A){const Q=()=>{};return Q.stop=bu,Q.resume=bu,Q.pause=bu,Q}}const R=Zo;s.call=(Q,me,re)=>Fc(Q,R,me,re);let V=!1;_==="post"?s.scheduler=Q=>{Ta(Q,R&&R.suspense)}:_!=="sync"&&(V=!0,s.scheduler=(Q,me)=>{me?Q():vT(Q)}),s.augmentJob=Q=>{t&&(Q.flags|=4),V&&(Q.flags|=2,R&&(Q.id=R.uid,Q.i=R))};const j=P6(n,t,s);return Ty&&(P?P.push(j):A&&j()),j}function yF(n,t,o){const u=this.proxy,d=Kr(n)?n.includes(".")?d4(u,n):()=>u[n]:n.bind(u,u);let _;rs(t)?_=t:(_=t.handler,o=t);const x=jy(this),s=h4(d,_.bind(u),o);return x(),s}function d4(n,t){const o=t.split(".");return()=>{let u=n;for(let d=0;d<o.length&&u;d++)u=u[o[d]];return u}}const vF=(n,t)=>t==="modelValue"||t==="model-value"?n.modelModifiers:n[`${t}Modifiers`]||n[`${ic(t)}Modifiers`]||n[`${nf(t)}Modifiers`];function xF(n,t,...o){if(n.isUnmounted)return;const u=n.vnode.props||mr;let d=o;const _=t.startsWith("update:"),x=_&&vF(u,t.slice(7));x&&(x.trim&&(d=o.map(R=>Kr(R)?R.trim():R)),x.number&&(d=o.map(_x)));let s,A=u[s=ew(t)]||u[s=ew(ic(t))];!A&&_&&(A=u[s=ew(nf(t))]),A&&Fc(A,n,6,d);const P=u[s+"Once"];if(P){if(!n.emitted)n.emitted={};else if(n.emitted[s])return;n.emitted[s]=!0,Fc(P,n,6,d)}}function f4(n,t,o=!1){const u=t.emitsCache,d=u.get(n);if(d!==void 0)return d;const _=n.emits;let x={},s=!1;if(!rs(n)){const A=P=>{const R=f4(P,t,!0);R&&(s=!0,Fo(x,R))};!o&&t.mixins.length&&t.mixins.forEach(A),n.extends&&A(n.extends),n.mixins&&n.mixins.forEach(A)}return!_&&!s?(gr(n)&&u.set(n,null),null):(Pn(_)?_.forEach(A=>x[A]=null):Fo(x,_),gr(n)&&u.set(n,x),x)}function Yx(n,t){return!n||!Vx(t)?!1:(t=t.slice(2).replace(/Once$/,""),rr(n,t[0].toLowerCase()+t.slice(1))||rr(n,nf(t))||rr(n,t))}function kC(n){const{type:t,vnode:o,proxy:u,withProxy:d,propsOptions:[_],slots:x,attrs:s,emit:A,render:P,renderCache:R,props:V,data:j,setupState:Q,ctx:me,inheritAttrs:re}=n,be=xx(n);let ve,Ee;try{if(o.shapeFlag&4){const Ve=d||u,Je=Ve;ve=yu(P.call(Je,Ve,R,V,Q,j,me)),Ee=s}else{const Ve=t;ve=yu(Ve.length>1?Ve(V,{attrs:s,slots:x,emit:A}):Ve(V,null)),Ee=t.props?s:bF(s)}}catch(Ve){ry.length=0,Wx(Ve,n,1),ve=Dt(Ea)}let je=ve;if(Ee&&re!==!1){const Ve=Object.keys(Ee),{shapeFlag:Je}=je;Ve.length&&Je&7&&(_&&Ve.some(lT)&&(Ee=wF(Ee,_)),je=Wd(je,Ee,!1,!0))}return o.dirs&&(je=Wd(je,null,!1,!0),je.dirs=je.dirs?je.dirs.concat(o.dirs):o.dirs),o.transition&&xy(je,o.transition),ve=je,xx(be),ve}const bF=n=>{let t;for(const o in n)(o==="class"||o==="style"||Vx(o))&&((t||(t={}))[o]=n[o]);return t},wF=(n,t)=>{const o={};for(const u in n)(!lT(u)||!(u.slice(9)in t))&&(o[u]=n[u]);return o};function TF(n,t,o){const{props:u,children:d,component:_}=n,{props:x,children:s,patchFlag:A}=t,P=_.emitsOptions;if(t.dirs||t.transition)return!0;if(o&&A>=0){if(A&1024)return!0;if(A&16)return u?LC(u,x,P):!!x;if(A&8){const R=t.dynamicProps;for(let V=0;V<R.length;V++){const j=R[V];if(x[j]!==u[j]&&!Yx(P,j))return!0}}}else return(d||s)&&(!s||!s.$stable)?!0:u===x?!1:u?x?LC(u,x,P):!0:!!x;return!1}function LC(n,t,o){const u=Object.keys(t);if(u.length!==Object.keys(n).length)return!0;for(let d=0;d<u.length;d++){const _=u[d];if(t[_]!==n[_]&&!Yx(o,_))return!0}return!1}function SF({vnode:n,parent:t},o){for(;t;){const u=t.subTree;if(u.suspense&&u.suspense.activeBranch===n&&(u.el=n.el),u===n)(n=t.vnode).el=o,t=t.parent;else break}}const p4=n=>n.__isSuspense;function EF(n,t){t&&t.pendingBranch?Pn(n)?t.effects.push(...n):t.effects.push(n):L6(n)}const fn=Symbol.for("v-fgt"),Kx=Symbol.for("v-txt"),Ea=Symbol.for("v-cmt"),Kv=Symbol.for("v-stc"),ry=[];let xl=null;function Ke(n=!1){ry.push(xl=n?null:[])}function AF(){ry.pop(),xl=ry[ry.length-1]||null}let by=1;function RC(n,t=!1){by+=n,n<0&&xl&&t&&(xl.hasOnce=!0)}function m4(n){return n.dynamicChildren=by>0?xl||Xm:null,AF(),by>0&&xl&&xl.push(n),n}function it(n,t,o,u,d,_){return m4(H(n,t,o,u,d,_,!0))}function Ap(n,t,o,u,d){return m4(Dt(n,t,o,u,d,!0))}function wy(n){return n?n.__v_isVNode===!0:!1}function fp(n,t){return n.type===t.type&&n.key===t.key}const g4=({key:n})=>n??null,Jv=({ref:n,ref_key:t,ref_for:o})=>(typeof n=="number"&&(n=""+n),n!=null?Kr(n)||fa(n)||rs(n)?{i:Oo,r:n,k:t,f:!!o}:n:null);function H(n,t=null,o=null,u=0,d=null,_=n===fn?0:1,x=!1,s=!1){const A={__v_isVNode:!0,__v_skip:!0,type:n,props:t,key:t&&g4(t),ref:t&&Jv(t),scopeId:zD,slotScopeIds:null,children:o,component:null,suspense:null,ssContent:null,ssFallback:null,dirs:null,transition:null,el:null,anchor:null,target:null,targetStart:null,targetAnchor:null,staticCount:0,shapeFlag:_,patchFlag:u,dynamicProps:d,dynamicChildren:null,appContext:null,ctx:Oo};return s?(ST(A,o),_&128&&n.normalize(A)):o&&(A.shapeFlag|=Kr(o)?8:16),by>0&&!x&&xl&&(A.patchFlag>0||_&6)&&A.patchFlag!==32&&xl.push(A),A}const Dt=CF;function CF(n,t=null,o=null,u=0,d=null,_=!1){if((!n||n===Y6)&&(n=Ea),wy(n)){const s=Wd(n,t,!0);return o&&ST(s,o),by>0&&!_&&xl&&(s.shapeFlag&6?xl[xl.indexOf(n)]=s:xl.push(s)),s.patchFlag=-2,s}if(NF(n)&&(n=n.__vccOpts),t){t=IF(t);let{class:s,style:A}=t;s&&!Kr(s)&&(t.class=lo(s)),gr(A)&&(yT(A)&&!Pn(A)&&(A=Fo({},A)),t.style=Nd(A))}const x=Kr(n)?1:p4(n)?128:BD(n)?64:gr(n)?4:rs(n)?2:0;return H(n,t,o,u,d,x,_,!0)}function IF(n){return n?yT(n)||n4(n)?Fo({},n):n:null}function Wd(n,t,o=!1,u=!1){const{props:d,ref:_,patchFlag:x,children:s,transition:A}=n,P=t?MF(d||{},t):d,R={__v_isVNode:!0,__v_skip:!0,type:n.type,props:P,key:P&&g4(P),ref:t&&t.ref?o&&_?Pn(_)?_.concat(Jv(t)):[_,Jv(t)]:Jv(t):_,scopeId:n.scopeId,slotScopeIds:n.slotScopeIds,children:s,target:n.target,targetStart:n.targetStart,targetAnchor:n.targetAnchor,staticCount:n.staticCount,shapeFlag:n.shapeFlag,patchFlag:t&&n.type!==fn?x===-1?16:x|16:x,dynamicProps:n.dynamicProps,dynamicChildren:n.dynamicChildren,appContext:n.appContext,dirs:n.dirs,transition:A,component:n.component,suspense:n.suspense,ssContent:n.ssContent&&Wd(n.ssContent),ssFallback:n.ssFallback&&Wd(n.ssFallback),el:n.el,anchor:n.anchor,ctx:n.ctx,ce:n.ce};return A&&u&&xy(R,A.clone(R)),R}function es(n=" ",t=0){return Dt(Kx,null,n,t)}function Xo(n,t){const o=Dt(Kv,null,n);return o.staticCount=t,o}function ha(n="",t=!1){return t?(Ke(),Ap(Ea,null,n)):Dt(Ea,null,n)}function yu(n){return n==null||typeof n=="boolean"?Dt(Ea):Pn(n)?Dt(fn,null,n.slice()):wy(n)?Fd(n):Dt(Kx,null,String(n))}function Fd(n){return n.el===null&&n.patchFlag!==-1||n.memo?n:Wd(n)}function ST(n,t){let o=0;const{shapeFlag:u}=n;if(t==null)t=null;else if(Pn(t))o=16;else if(typeof t=="object")if(u&65){const d=t.default;d&&(d._c&&(d._d=!1),ST(n,d()),d._c&&(d._d=!0));return}else{o=32;const d=t._;!d&&!n4(t)?t._ctx=Oo:d===3&&Oo&&(Oo.slots._===1?t._=1:(t._=2,n.patchFlag|=1024))}else rs(t)?(t={default:t,_ctx:Oo},o=32):(t=String(t),u&64?(o=16,t=[es(t)]):o=8);n.children=t,n.shapeFlag|=o}function MF(...n){const t={};for(let o=0;o<n.length;o++){const u=n[o];for(const d in u)if(d==="class")t.class!==u.class&&(t.class=lo([t.class,u.class]));else if(d==="style")t.style=Nd([t.style,u.style]);else if(Vx(d)){const _=t[d],x=u[d];x&&_!==x&&!(Pn(_)&&_.includes(x))&&(t[d]=_?[].concat(_,x):x)}else d!==""&&(t[d]=u[d])}return t}function pu(n,t,o,u=null){Fc(n,t,7,[o,u])}const PF=e4();let DF=0;function kF(n,t,o){const u=n.type,d=(t?t.appContext:n.appContext)||PF,_={uid:DF++,vnode:n,type:u,parent:t,appContext:d,root:null,next:null,subTree:null,effect:null,update:null,job:null,scope:new n6(!0),render:null,proxy:null,exposed:null,exposeProxy:null,withProxy:null,provides:t?t.provides:Object.create(d.provides),ids:t?t.ids:["",0,0],accessCache:null,renderCache:[],components:null,directives:null,propsOptions:r4(u,d),emitsOptions:f4(u,d),emit:null,emitted:null,propsDefaults:mr,inheritAttrs:u.inheritAttrs,ctx:mr,data:mr,props:mr,attrs:mr,slots:mr,refs:mr,setupState:mr,setupContext:null,suspense:o,suspenseId:o?o.pendingId:0,asyncDep:null,asyncResolved:!1,isMounted:!1,isUnmounted:!1,isDeactivated:!1,bc:null,c:null,bm:null,m:null,bu:null,u:null,um:null,bum:null,da:null,a:null,rtg:null,rtc:null,ec:null,
vendor: 2,018 bytes, lines 13-16
13sp:null};return _.ctx={_},_.root=t?t.root:_,_.emit=xF.bind(null,_),n.ce&&n.ce(_),_}let Zo=null;const LF=()=>Zo||Oo;let Tx,f2;{const n=Ux(),t=(o,u)=>{let d;return(d=n[o])||(d=n[o]=[]),d.push(u),_=>{d.length>1?d.forEach(x=>x(_)):d[0](_)}};Tx=t("__VUE_INSTANCE_SETTERS__",o=>Zo=o),f2=t("__VUE_SSR_SETTERS__",o=>Ty=o)}const jy=n=>{const t=Zo;return Tx(n),n.scope.on(),()=>{n.scope.off(),Tx(t)}},OC=()=>{Zo&&Zo.scope.off(),Tx(null)};function _4(n){return n.vnode.shapeFlag&4}let Ty=!1;function RF(n,t=!1,o=!1){t&&f2(t);const{props:u,children:d}=n.vnode,_=_4(n);oF(n,u,_,t),uF(n,d,o);const x=_?OF(n,t):void 0;return t&&f2(!1),x}function OF(n,t){const o=n.type;n.accessCache=Object.create(null),n.proxy=new Proxy(n.ctx,J6);const{setup:u}=o;if(u){sf();const d=n.setupContext=u.length>1?FF(n):null,_=jy(n),x=$y(u,n,0,[n.props,d]),s=aD(x);if(rf(),_(),(s||n.sp)&&!Qm(n)&&WD(n),s){if(x.then(OC,OC),t)return x.then(A=>{zC(n,A)}).catch(A=>{Wx(A,n,0)});n.asyncDep=x}else zC(n,x)}else y4(n)}function zC(n,t,o){rs(t)?n.type.__ssrInlineRender?n.ssrRender=t:n.render=t:gr(t)&&(n.setupState=DD(t)),y4(n)}function y4(n,t,o){const u=n.type;n.render||(n.render=u.render||bu);{const d=jy(n);sf();try{Q6(n)}finally{rf(),d()}}}const zF={get(n,t){return ca(n,"get",""),n[t]}};function FF(n){const t=o=>{n.exposed=o||{}};return{attrs:new Proxy(n.attrs,zF),slots:n.slots,emit:n.emit,expose:t}}function Jx(n){return n.exposed?n.exposeProxy||(n.exposeProxy=new Proxy(DD(T6(n.exposed)),{get(t,o){if(o in t)return t[o];if(o in sy)return sy[o](n)},has(t,o){return o in t||o in sy}})):n.proxy}function BF(n,t=!0){return rs(n)?n.displayName||n.name:n.name||t&&n.__name}function NF(n){return rs(n)&&"__vccOpts"in n}const bs=(n,t)=>I6(n,t,Ty);function Qx(n,t,o){const u=arguments.length;return u===2?gr(t)&&!Pn(t)?wy(t)?Dt(n,null,[t]):Dt(n,t):Dt(n,null,t):(u>3?o=Array.prototype.slice.call(arguments,2):u===3&&wy(o)&&(o=[o]),Dt(n,t,o))}const VF="3.5.13";/** 14* @vue/runtime-dom v3.5.13 15* (c) 2018-present Yuxi (Evan) You and Vue contributors 16* @license MIT
17**/let p2;const FC=typeof window<"u"&&window.trustedTypes;if(FC)try{p2=FC.createPolicy("vue",{createHTML:n=>n})}catch{}const v4=p2?n=>p2.createHTML(n):n=>n,$F="http://www.w3.org/2000/svg",jF="http://www.w3.org/1998/Math/MathML",mh=typeof document<"u"?document:null,BC=mh&&mh.createElement("template"),UF={insert:(n,t,o)=>{t.insertBefore(n,o||null)},remove:n=>{const t=n.parentNode;t&&t.removeChild(n)},createElement:(n,t,o,u)=>{const d=t==="svg"?mh.createElementNS($F,n):t==="mathml"?mh.createElementNS(jF,n):o?mh.createElement(n,{is:o}):mh.createElement(n);return n==="select"&&u&&u.multiple!=null&&d.setAttribute("multiple",u.multiple),d},createText:n=>mh.createTextNode(n),createComment:n=>mh.createComment(n),setText:(n,t)=>{n.nodeValue=t},setElementText:(n,t)=>{n.textContent=t},parentNode:n=>n.parentNode,nextSibling:n=>n.nextSibling,querySelector:n=>mh.querySelector(n),setScopeId(n,t){n.setAttribute(t,"")},insertStaticContent(n,t,o,u,d,_){const x=o?o.previousSibling:t.lastChild;if(d&&(d===_||d.nextSibling))for(;t.insertBefore(d.cloneNode(!0),o),!(d===_||!(d=d.nextSibling)););else{BC.innerHTML=v4(u==="svg"?`<svg>${n}</svg>`:u==="mathml"?`<math>${n}</math>`:n);const s=BC.content;if(u==="svg"||u==="mathml"){const A=s.firstChild;for(;A.firstChild;)s.appendChild(A.firstChild);s.removeChild(A)}t.insertBefore(s,o)}return[x?x.nextSibling:t.firstChild,o?o.previousSibling:t.lastChild]}},Pd="transition",O_="animation",Sy=Symbol("_vtc"),x4={name:String,type:String,css:{type:Boolean,default:!0},duration:[String,Number,Object],enterFromClass:String,enterActiveClass:String,enterToClass:String,appearFromClass:String,appearActiveClass:String,appearToClass:String,leaveFromClass:String,leaveActiveClass:String,leaveToClass:String},HF=Fo({},$D,x4),GF=n=>(n.displayName="Transition",n.props=HF,n),ET=GF((n,{slots:t})=>Qx(B6,WF(n),t)),sp=(n,t=[])=>{Pn(n)?n.forEach(o=>o(...t)):n&&n(...t)},NC=n=>n?Pn(n)?n.some(t=>t.length>1):n.length>1:!1;function WF(n){const t={};for(const Zt in n)Zt in x4||(t[Zt]=n[Zt]);if(n.css===!1)return t;const{name:o="v",type:u,duration:d,enterFromClass:_=`${o}-enter-from`,enterActiveClass:x=`${o}-enter-active`,enterToClass:s=`${o}-enter-to`,appearFromClass:A=_,appearActiveClass:P=x,appearToClass:R=s,leaveFromClass:V=`${o}-leave-from`,leaveActiveClass:j=`${o}-leave-active`,leaveToClass:Q=`${o}-leave-to`}=n,me=qF(d),re=me&&me[0],be=me&&me[1],{onBeforeEnter:ve,onEnter:Ee,onEnterCancelled:je,onLeave:Ve,onLeaveCancelled:Je,onBeforeAppear:vt=ve,onAppear:_t=Ee,onAppearCancelled:Mt=je}=t,At=(Zt,yi,Fi,ki)=>{Zt._enterCancelled=ki,rp(Zt,yi?R:s),rp(Zt,yi?P:x),Fi&&Fi()},ei=(Zt,yi)=>{Zt._isLeaving=!1,rp(Zt,V),rp(Zt,Q),rp(Zt,j),yi&&yi()},Yt=Zt=>(yi,Fi)=>{const ki=Zt?_t:Ee,wi=()=>At(yi,Zt,Fi);sp(ki,[yi,wi]),VC(()=>{rp(yi,Zt?A:_),uh(yi,Zt?R:s),NC(ki)||$C(yi,u,re,wi)})};return Fo(t,{onBeforeEnter(Zt){sp(ve,[Zt]),uh(Zt,_),uh(Zt,x)},onBeforeAppear(Zt){sp(vt,[Zt]),uh(Zt,A),uh(Zt,P)},onEnter:Yt(!1),onAppear:Yt(!0),onLeave(Zt,yi){Zt._isLeaving=!0;const Fi=()=>ei(Zt,yi);uh(Zt,V),Zt._enterCancelled?(uh(Zt,j),HC()):(HC(),uh(Zt,j)),VC(()=>{Zt._isLeaving&&(rp(Zt,V),uh(Zt,Q),NC(Ve)||$C(Zt,u,be,Fi))}),sp(Ve,[Zt,Fi])},onEnterCancelled(Zt){At(Zt,!1,void 0,!0),sp(je,[Zt])},onAppearCancelled(Zt){At(Zt,!0,void 0,!0),sp(Mt,[Zt])},onLeaveCancelled(Zt){ei(Zt),sp(Je,[Zt])}})}function qF(n){if(n==null)return null;if(gr(n))return[lw(n.enter),lw(n.leave)];{const t=lw(n);return[t,t]}}function lw(n){return Xz(n)}function uh(n,t){t.split(/\s+/).forEach(o=>o&&n.classList.add(o)),(n[Sy]||(n[Sy]=new Set)).add(t)}function rp(n,t){t.split(/\s+/).forEach(u=>u&&n.classList.remove(u));const o=n[Sy];o&&(o.delete(t),o.size||(n[Sy]=void 0))}function VC(n){requestAnimationFrame(()=>{requestAnimationFrame(n)})}let ZF=0;function $C(n,t,o,u){const d=n._endId=++ZF,_=()=>{d===n._endId&&u()};if(o!=null)return setTimeout(_,o);const{type:x,timeout:s,propCount:A}=XF(n,t);if(!x)return u();const P=x+"end";let R=0;const V=()=>{n.removeEventListener(P,j),_()},j=Q=>{Q.target===n&&++R>=A&&V()};setTimeout(()=>{R<A&&V()},s+1),n.addEventListener(P,j)}function XF(n,t){const o=window.getComputedStyle(n),u=me=>(o[me]||"").split(", "),d=u(`${Pd}Delay`),_=u(`${Pd}Duration`),x=jC(d,_),s=u(`${O_}Delay`),A=u(`${O_}Duration`),P=jC(s,A);let R=null,V=0,j=0;t===Pd?x>0&&(R=Pd,V=x,j=_.length):t===O_?P>0&&(R=O_,V=P,j=A.length):(V=Math.max(x,P),R=V>0?x>P?Pd:O_:null,j=R?R===Pd?_.length:A.length:0);const Q=R===Pd&&/\b(transform|all)(,|$)/.test(u(`${Pd}Property`).toString());return{type:R,timeout:V,propCount:j,hasTransform:Q}}function jC(n,t){for(;n.length<t.length;)n=n.concat(n);return Math.max(...t.map((o,u)=>UC(o)+UC(n[u])))}function UC(n){return n==="auto"?0:Number(n.slice(0,-1).replace(",","."))*1e3}function HC(){return document.body.offsetHeight}function YF(n,t,o){const u=n[Sy];u&&(t=(t?[t,...u]:[...u]).join(" ")),t==null?n.removeAttribute("class"):o?n.setAttribute("class",t):n.className=t}const GC=Symbol("_vod"),KF=Symbol("_vsh"),JF=Symbol(""),QF=/(^|;)\s*display\s*:/;function eB(n,t,o){const u=n.style,d=Kr(o);let _=!1;if(o&&!d){if(t)if(Kr(t))for(const x of t.split(";")){const s=x.slice(0,x.indexOf(":")).trim();o[s]==null&&Qv(u,s,"")}else for(const x in t)o[x]==null&&Qv(u,x,"");for(const x in o)x==="display"&&(_=!0),Qv(u,x,o[x])}else if(d){if(t!==o){const x=u[JF];x&&(o+=";"+x),u.cssText=o,_=QF.test(o)}}else t&&n.removeAttribute("style");GC in n&&(n[GC]=_?u.display:"",n[KF]&&(u.display="none"))}const WC=/\s*!important$/;
vendor: 4,215 bytes, line 17
17function Qv(n,t,o){if(Pn(o))o.forEach(u=>Qv(n,t,u));else if(o==null&&(o=""),t.startsWith("--"))n.setProperty(t,o);else{const u=tB(n,t);WC.test(o)?n.setProperty(nf(u),o.replace(WC,""),"important"):n[u]=o}}const qC=["Webkit","Moz","ms"],cw={};function tB(n,t){const o=cw[t];if(o)return o;let u=ic(t);if(u!=="filter"&&u in n)return cw[t]=u;u=jx(u);for(let d=0;d<qC.length;d++){const _=qC[d]+u;if(_ in n)return cw[t]=_}return t}const ZC="http://www.w3.org/1999/xlink";function XC(n,t,o,u,d,_=t6(t)){u&&t.startsWith("xlink:")?o==null?n.removeAttributeNS(ZC,t.slice(6,t.length)):n.setAttributeNS(ZC,t,o):o==null||_&&!hD(o)?n.removeAttribute(t):n.setAttribute(t,_?"":zc(o)?String(o):o)}function YC(n,t,o,u,d){if(t==="innerHTML"||t==="textContent"){o!=null&&(n[t]=t==="innerHTML"?v4(o):o);return}const _=n.tagName;if(t==="value"&&_!=="PROGRESS"&&!_.includes("-")){const s=_==="OPTION"?n.getAttribute("value")||"":n.value,A=o==null?n.type==="checkbox"?"on":"":String(o);(s!==A||!("_value"in n))&&(n.value=A),o==null&&n.removeAttribute(t),n._value=o;return}let x=!1;if(o===""||o==null){const s=typeof n[t];s==="boolean"?o=hD(o):o==null&&s==="string"?(o="",x=!0):s==="number"&&(o=0,x=!0)}try{n[t]=o}catch{}x&&n.removeAttribute(d||t)}function xh(n,t,o,u){n.addEventListener(t,o,u)}function iB(n,t,o,u){n.removeEventListener(t,o,u)}const KC=Symbol("_vei");function nB(n,t,o,u,d=null){const _=n[KC]||(n[KC]={}),x=_[t];if(u&&x)x.value=u;else{const[s,A]=sB(t);if(u){const P=_[t]=aB(u,d);xh(n,s,P,A)}else x&&(iB(n,s,x,A),_[t]=void 0)}}const JC=/(?:Once|Passive|Capture)$/;function sB(n){let t;if(JC.test(n)){t={};let u;for(;u=n.match(JC);)n=n.slice(0,n.length-u[0].length),t[u[0].toLowerCase()]=!0}return[n[2]===":"?n.slice(3):nf(n.slice(2)),t]}let uw=0;const rB=Promise.resolve(),oB=()=>uw||(rB.then(()=>uw=0),uw=Date.now());function aB(n,t){const o=u=>{if(!u._vts)u._vts=Date.now();else if(u._vts<=o.attached)return;Fc(lB(u,o.value),t,5,[u])};return o.value=n,o.attached=oB(),o}function lB(n,t){if(Pn(t)){const o=n.stopImmediatePropagation;return n.stopImmediatePropagation=()=>{o.call(n),n._stopped=!0},t.map(u=>d=>!d._stopped&&u&&u(d))}else return t}const QC=n=>n.charCodeAt(0)===111&&n.charCodeAt(1)===110&&n.charCodeAt(2)>96&&n.charCodeAt(2)<123,cB=(n,t,o,u,d,_)=>{const x=d==="svg";t==="class"?YF(n,u,x):t==="style"?eB(n,o,u):Vx(t)?lT(t)||nB(n,t,o,u,_):(t[0]==="."?(t=t.slice(1),!0):t[0]==="^"?(t=t.slice(1),!1):uB(n,t,u,x))?(YC(n,t,u),!n.tagName.includes("-")&&(t==="value"||t==="checked"||t==="selected")&&XC(n,t,u,x,_,t!=="value")):n._isVueCE&&(/[A-Z]/.test(t)||!Kr(u))?YC(n,ic(t),u,_,t):(t==="true-value"?n._trueValue=u:t==="false-value"&&(n._falseValue=u),XC(n,t,u,x))};function uB(n,t,o,u){if(u)return!!(t==="innerHTML"||t==="textContent"||t in n&&QC(t)&&rs(o));if(t==="spellcheck"||t==="draggable"||t==="translate"||t==="form"||t==="list"&&n.tagName==="INPUT"||t==="type"&&n.tagName==="TEXTAREA")return!1;if(t==="width"||t==="height"){const d=n.tagName;if(d==="IMG"||d==="VIDEO"||d==="CANVAS"||d==="SOURCE")return!1}return QC(t)&&Kr(o)?!1:t in n}const qd=n=>{const t=n.props["onUpdate:modelValue"]||!1;return Pn(t)?o=>Zv(t,o):t};function hB(n){n.target.composing=!0}function eI(n){const t=n.target;t.composing&&(t.composing=!1,t.dispatchEvent(new Event("input")))}const Ql=Symbol("_assign"),Ur={created(n,{modifiers:{lazy:t,trim:o,number:u}},d){n[Ql]=qd(d);const _=u||d.props&&d.props.type==="number";xh(n,t?"change":"input",x=>{if(x.target.composing)return;let s=n.value;o&&(s=s.trim()),_&&(s=_x(s)),n[Ql](s)}),o&&xh(n,"change",()=>{n.value=n.value.trim()}),t||(xh(n,"compositionstart",hB),xh(n,"compositionend",eI),xh(n,"change",eI))},mounted(n,{value:t}){n.value=t??""},beforeUpdate(n,{value:t,oldValue:o,modifiers:{lazy:u,trim:d,number:_}},x){if(n[Ql]=qd(x),n.composing)return;const s=(_||n.type==="number")&&!/^0\d/.test(n.value)?_x(n.value):n.value,A=t??"";s!==A&&(document.activeElement===n&&n.type!=="range"&&(u&&t===o||d&&n.value.trim()===A)||(n.value=A))}},AT={deep:!0,created(n,t,o){n[Ql]=qd(o),xh(n,"change",()=>{const u=n._modelValue,d=ng(n),_=n.checked,x=n[Ql];if(Pn(u)){const s=hT(u,d),A=s!==-1;if(_&&!A)x(u.concat(d));else if(!_&&A){const P=[...u];P.splice(s,1),x(P)}}else if(gg(u)){const s=new Set(u);
17_?s.add(d):s.delete(d),x(s)}else x(w4(n,_))})},mounted:tI,beforeUpdate(n,t,o){n[Ql]=qd(o),tI(n,t,o)}};function tI(n,{value:t,oldValue:o},u){n._modelValue=t;let d;if(Pn(t))d=hT(t,u.props.value)>-1;else if(gg(t))d=t.has(u.props.value);else{if(t===o)return;d=Sp(t,w4(n,!0))}n.checked!==d&&(n.checked=d)}const dB={created(n,{value:t},o){n.checked=Sp(t,o.props.value),n[Ql]=qd(o),xh(n,"change",()=>{n[Ql](ng(n))})},beforeUpdate(n,{value:t,oldValue:o},u){n[Ql]=qd(u),t!==o&&(n.checked=Sp(t,u.props.value))}},b4={deep:!0,created(n,{value:t,modifiers:{number:o}},u){const d=gg(t);xh(n,"change",()=>{const _=Array.prototype.filter.call(n.options,x=>x.selected).map(x=>o?_x(ng(x)):ng(x));n[Ql](n.multiple?d?new Set(_):_:_[0]),n._assigning=!0,qx(()=>{n._assigning=!1})}),n[Ql]=qd(u)},mounted(n,{value:t}){iI(n,t)},beforeUpdate(n,t,o){n[Ql]=qd(o)},updated(n,{value:t}){n._assigning||iI(n,t)}};function iI(n,t){const o=n.multiple,u=Pn(t);if(!(o&&!u&&!gg(t))){for(let d=0,_=n.options.length;d<_;d++){const x=n.options[d],s=ng(x);if(o)if(u){const A=typeof s;A==="string"||A==="number"?x.selected=t.some(P=>String(P)===String(s)):x.selected=hT(t,s)>-1}else x.selected=t.has(s);else if(Sp(ng(x),t)){n.selectedIndex!==d&&(n.selectedIndex=d);return}}!o&&n.selectedIndex!==-1&&(n.selectedIndex=-1)}}function ng(n){return"_value"in n?n._value:n.value}function w4(n,t){const o=t?"_trueValue":"_falseValue";return o in n?n[o]:t}const fB={created(n,t,o){bv(n,t,o,null,"created")},mounted(n,t,o){bv(n,t,o,null,"mounted")},beforeUpdate(n,t,o,u){bv(n,t,o,u,"beforeUpdate")},updated(n,t,o,u){bv(n,t,o,u,"updated")}};function pB(n,t){switch(n){case"SELECT":return b4;case"TEXTAREA":return Ur;default:switch(t){case"checkbox":return AT;case"radio":return dB;default:return Ur}}}function bv(n,t,o,u,d){const x=pB(n.tagName,o.props&&o.props.type)[d];x&&x(n,t,o,u)}const mB=["ctrl","shift","alt","meta"],gB={stop:n=>n.stopPropagation(),prevent:n=>n.preventDefault(),self:n=>n.target!==n.currentTarget,ctrl:n=>!n.ctrlKey,shift:n=>!n.shiftKey,alt:n=>!n.altKey,meta:n=>!n.metaKey,left:n=>"button"in n&&n.button!==0,middle:n=>"button"in n&&n.button!==1,right:n=>"button"in n&&n.button!==2,exact:(n,t)=>mB.some(o=>n[`${o}Key`]&&!t.includes(o))},Eh=(n,t)=>{const o=n._withMods||(n._withMods={}),u=t.join(".");return o[u]||(o[u]=(d,..._)=>{for(let x=0;x<t.length;x++){const s=gB[t[x]];if(s&&s(d,t))return}return n(d,..._)})},_B={esc:"escape",space:" ",up:"arrow-up",left:"arrow-left",right:"arrow-right",down:"arrow-down",delete:"backspace"},hw=(n,t)=>{const o=n._withKeys||(n._withKeys={}),u=t.join(".");return o[u]||(o[u]=d=>{if(!("key"in d))return;const _=nf(d.key);if(t.some(x=>x===_||_B[x]===_))return n(d)})},yB=Fo({patchProp:cB},UF);let nI;function vB(){return nI||(nI=dF(yB))}const xB=(...n)=>{const t=vB().createApp(...n),{mount:o}=t;return t.mount=u=>{const d=wB(u);if(!d)return;const _=t._component;!rs(_)&&!_.render&&!_.template&&(_.template=d.innerHTML),d.nodeType===1&&(d.textContent="");const x=o(d,!1,bB(d));return d instanceof Element&&(d.removeAttribute("v-cloak"),d.setAttribute("data-v-app","")),x},t};function bB(n){if(n instanceof SVGElement)return"svg";if(typeof MathMLElement=="function"&&n instanceof MathMLElement)return"mathml"}function wB(n){return Kr(n)?document.querySelector(n):n}const ji=(n,t)=>{const o=n.__vccOpts||n;for(const[u,d]of t)o[u]=d;return o},TB={__name:"PageTransition",setup(n){return(t,o)=>(Ke(),Ap(ET,{name:"fade",mode:"out-in"},{default:vl(()=>[K6(t.$slots,"default",{},void 0,!0)]),_:3}))}},SB=ji(TB,[["__scopeId","data-v-1114bf83"]]),EB={id:"app"},AB={key:0,class:"warning-banner"},CB={__name:"App",setup(n){const t=Mi(!0);return kh(()=>{window.$crisp=[],window.CRISP_WEBSITE_ID="db52d0b0-bc37-4e9e-be5e-c405d9e7fdfb";const o=document.createElement("script");o.src="https://client.crisp.chat/l.js",o.async=!0,document.head.appendChild(o)}),(o,u)=>{const d=_g("router-view");return Ke(),it("div",EB,[t.value?(Ke(),it("div",AB,[u[1]||(u[1]=es(" â ï¸ Warning! This is not an actual CIBC site. This is a demo clone for project purposes. ")),H("button",{class:"close-btn",onClick:u[0]||(u[0]=_=>t.value=!1)},"Ã")])):ha("",!0),Dt(SB,null,{default:vl(()=>[Dt(d)]),_:1})])}}};/*! 18 * vue-router v4.5.0 19 * (c) 2024 Eduardo San Martin Morote 20 * @license MIT 21 */const Um=typeof document<"u";function T4(n){return typeof n=="object"||"displayName"in n||"props"in n||"__vccOpts"in n}function IB(n){return n.__esModule||n[Symbol.toStringTag]==="Module"||n.default&&T4(n.default)}const sr=Object.assign;function dw(n,t){const o={};for(const u in t){const d=t[u];o[u]=Bc(d)?d.map(n):n(d)}return o}const oy=()=>{},Bc=Array.isArray,S4=/#/g,MB=/&/g,PB=/\//g,DB=/=/g,kB=/\?/g,E4=/\+/g,LB=/%5B/g,RB=/%5D/g,A4=/%5E/g,OB=/%60/g,C4=/%7B/g,zB=/%
vendor: 9,519 bytes, line 21
217C/g,I4=/%7D/g,FB=/%20/g;function CT(n){return encodeURI(""+n).replace(zB,"|").replace(LB,"[").replace(RB,"]")}function BB(n){return CT(n).replace(C4,"{").replace(I4,"}").replace(A4,"^")}function m2(n){return CT(n).replace(E4,"%2B").replace(FB,"+").replace(S4,"%23").replace(MB,"%26").replace(OB,"`").replace(C4,"{").replace(I4,"}").replace(A4,"^")}function NB(n){return m2(n).replace(DB,"%3D")}function VB(n){return CT(n).replace(S4,"%23").replace(kB,"%3F")}function $B(n){return n==null?"":VB(n).replace(PB,"%2F")}function Ey(n){try{return decodeURIComponent(""+n)}catch{}return""+n}const jB=/\/$/,UB=n=>n.replace(jB,"");function fw(n,t,o="/"){let u,d={},_="",x="";const s=t.indexOf("#");let A=t.indexOf("?");return s<A&&s>=0&&(A=-1),A>-1&&(u=t.slice(0,A),_=t.slice(A+1,s>-1?s:t.length),d=n(_)),s>-1&&(u=u||t.slice(0,s),x=t.slice(s,t.length)),u=qB(u??t,o),{fullPath:u+(_&&"?")+_+x,path:u,query:d,hash:Ey(x)}}function HB(n,t){const o=t.query?n(t.query):"";return t.path+(o&&"?")+o+(t.hash||"")}function sI(n,t){return!t||!n.toLowerCase().startsWith(t.toLowerCase())?n:n.slice(t.length)||"/"}function GB(n,t,o){const u=t.matched.length-1,d=o.matched.length-1;return u>-1&&u===d&&sg(t.matched[u],o.matched[d])&&M4(t.params,o.params)&&n(t.query)===n(o.query)&&t.hash===o.hash}function sg(n,t){return(n.aliasOf||n)===(t.aliasOf||t)}function M4(n,t){if(Object.keys(n).length!==Object.keys(t).length)return!1;for(const o in n)if(!WB(n[o],t[o]))return!1;return!0}function WB(n,t){return Bc(n)?rI(n,t):Bc(t)?rI(t,n):n===t}function rI(n,t){return Bc(t)?n.length===t.length&&n.every((o,u)=>o===t[u]):n.length===1&&n[0]===t}function qB(n,t){if(n.startsWith("/"))return n;if(!n)return t;const o=t.split("/"),u=n.split("/"),d=u[u.length-1];(d===".."||d===".")&&u.push("");let _=o.length-1,x,s;for(x=0;x<u.length;x++)if(s=u[x],s!==".")if(s==="..")_>1&&_--;else break;return o.slice(0,_).join("/")+"/"+u.slice(x).join("/")}const Dd={path:"/",name:void 0,params:{},query:{},hash:"",fullPath:"/",matched:[],meta:{},redirectedFrom:void 0};var Ay;(function(n){n.pop="pop",n.push="push"})(Ay||(Ay={}));var ay;(function(n){n.back="back",n.forward="forward",n.unknown=""})(ay||(ay={}));function ZB(n){if(!n)if(Um){const t=document.querySelector("base");n=t&&t.getAttribute("href")||"/",n=n.replace(/^\w+:\/\/[^\/]+/,"")}else n="/";return n[0]!=="/"&&n[0]!=="#"&&(n="/"+n),UB(n)}const XB=/^[^#]+#/;function YB(n,t){return n.replace(XB,"#")+t}function KB(n,t){const o=document.documentElement.getBoundingClientRect(),u=n.getBoundingClientRect();return{behavior:t.behavior,left:u.left-o.left-(t.left||0),top:u.top-o.top-(t.top||0)}}const e1=()=>({left:window.scrollX,top:window.scrollY});function JB(n){let t;if("el"in n){const o=n.el,u=typeof o=="string"&&o.startsWith("#"),d=typeof o=="string"?u?document.getElementById(o.slice(1)):document.querySelector(o):o;if(!d)return;t=KB(d,n)}else t=n;"scrollBehavior"in document.documentElement.style?window.scrollTo(t):window.scrollTo(t.left!=null?t.left:window.scrollX,t.top!=null?t.top:window.scrollY)}function oI(n,t){return(history.state?history.state.position-t:-1)+n}const g2=new Map;function QB(n,t){g2.set(n,t)}function e8(n){const t=g2.get(n);return g2.delete(n),t}let t8=()=>location.protocol+"//"+location.host;function P4(n,t){const{pathname:o,search:u,hash:d}=t,_=n.indexOf("#");if(_>-1){let s=d.includes(n.slice(_))?n.slice(_).length:1,A=d.slice(s);return A[0]!=="/"&&(A="/"+A),sI(A,"")}return sI(o,n)+u+d}function i8(n,t,o,u){let d=[],_=[],x=null;const s=({state:j})=>{const Q=P4(n,location),me=o.value,re=t.value;let be=0;if(j){if(o.value=Q,t.value=j,x&&x===me){x=null;return}be=re?j.position-re.position:0}else u(Q);d.forEach(ve=>{ve(o.value,me,{delta:be,type:Ay.pop,direction:be?be>0?ay.forward:ay.back:ay.unknown})})};function A(){x=o.value}function P(j){d.push(j);const Q=()=>{const me=d.indexOf(j);me>-1&&d.splice(me,1)};return _.push(Q),Q}function R(){const{history:j}=window;j.state&&j.replaceState(sr({},j.state,{scroll:e1()}),"")}function V(){for(const j of _)j();_=[],window.removeEventListener("popstate",s),window.removeEventListener("beforeunload",R)}return window.addEventListener("popstate",s),window.addEventListener("beforeunload",R,{passive:!0}),{pauseListeners:A,listen:P,destroy:V}}function aI(n,t,o,u=!1,d=!1){return{back:n,current:t,forward:o,replaced:u,position:window.history.length,scroll:d?e1():null}}function n8(n){const{history:t,location:o}=window,u={value:P4(n,o)},d={value:t.state};d.value||_(u.value,{back:null,current:u.value,forward:null,position:t.length-1,replaced:!0,scroll:null},!0);function _(A,P,R){const V=n.indexOf("#"),j=V>-1?(o.host&&document.querySelector("base")?n:n.slice(V))+A:t8()+n+A;try{t[R?"replaceState":"pushState"](P,"",j),d.value=P}catch(Q){console.error(Q),o[R?"replace":"assign"](j)}}function x(A,P){const R=sr({},t.state,aI(d.value.back,A,d.value.forward,!0),P,{position:d.value.position});_(A,R,!0),u.value=A}function s(A,P){const R=sr({},d.value,t.state,{forward:A,scroll:e1()});_(R.current,R,!0);const V=sr({},aI(u.value,A,null),{position:R.position+1},P);_(A,V,!1),u.value=A}return{location:u,state:d,push:s,replace:x}}function s8(n){n=ZB(n);const t=n8(n),o=i8(n,t.state,t.location,t.replace);function u(_,x=!0){x||o.pauseListeners(),history.go(_)}const d=sr({location:"",base:n,go:u,createHref:YB.bind(null,n)},t,o);return Object.defineProperty(d,"location",{enumerable:!0,get:()=>t.location.value}),Object.defineProperty(d,"state",{enumerable:!0,get:()=>t.state.value}),d}function r8(n){return typeof n=="string"||n&&typeof n=="object"}function D4(n){return typeof n=="string"||typeof n=="symbol"}const k4=Symbol("");var lI;(function(n){n[n.aborted=4]="aborted",n[n.cancelled=8]="cancelled",n[n.duplicated=16]="duplicated"})(lI||(lI={}));function rg(n,t){return sr(new Error,{type:n,[k4]:!0},t)}function hh(n,t){return n instanceof Error&&k4 in n&&(t==null||!!(n.type&t))}const cI="[^/]+?",o8={sensitive:!1,strict:!1,start:!0,end:!0},a8=/[.+*?^${}()[\]/\\]/g;function l8(n,t){const o=sr({},o8,t),u=[];let d=o.start?"^":"";const _=[];for(const P of n){const R=P.length?[]:[90];o.strict&&!P.length&&(d+="/");for(let V=0;V<P.length;V++){const j=P[V];let Q=40+(o.sensitive?.25:0);if(j.type===0)V||(d+="/"),d+=j.value.replace(a8,"\\$&"),Q+=40;else if(j.type===1){const{value:me,repeatable:re,optional:be,regexp:ve}=j;_.push({name:me,repeatable:re,optional:be});const Ee=ve||cI;if(Ee!==cI){Q+=10;try{new RegExp(`(${Ee})`)}catch(Ve){throw new Error(`Invalid custom RegExp for param "${me}" (${Ee}): `+Ve.message)}}let je=re?`((?:${Ee})(?:/(?:${Ee}))*)`:`(${Ee})`;V||(je=be&&P.length<2?`(?:/${je})`:"/"+je),be&&(je+="?"),d+=je,Q+=20,be&&(Q+=-8),re&&(Q+=-20),Ee===".*"&&(Q+=-50)}R.push(Q)}u.push(R)}if(o.strict&&o.end){const P=u.length-1;u[P][u[P].length-1]+=.7000000000000001}o.strict||(d+="/?"),o.end?d+="$":o.strict&&!d.endsWith("/")&&(d+="(?:/|$)");const x=new RegExp(d,o.sensitive?"":"i");function s(P){const R=P.match(x),V={};if(!R)return null;for(let j=1;j<R.length;j++){const Q=R[j]||"",me=_[j-1];V[me.name]=Q&&me.repeatable?Q.split("/"):Q}return V}function A(P){let R="",V=!1;for(const j of n){(!V||!R.endsWith("/"))&&(R+="/"),V=!1;for(const Q of j)if(Q.type===0)R+=Q.value;else if(Q.type===1){const{value:me,repeatable:re,optional:be}=Q,ve=me in P?P[me]:"";if(Bc(ve)&&!re)throw new Error(`Provided param "${me}" is an array but it is not repeatable (* or + modifiers)`);const Ee=Bc(ve)?ve.join("/"):ve;if(!Ee)if(be)j.length<2&&(R.endsWith("/")?R=R.slice(0,-1):V=!0);else throw new Error(`Missing required param "${me}"`);R+=Ee}}return R||"/"}return{re:x,score:u,keys:_,parse:s,stringify:A}}function c8(n,t){let o=0;for(;o<n.length&&o<t.length;){const u=t[o]-n[o];if(u)return u;o++}return n.length<t.length?n.length===1&&n[0]===80?-1:1:n.length>t.length?t.length===1&&t[0]===80?1:-1:0}function L4(n,t){let o=0;const u=n.score,d=t.score;for(;o<u.length&&o<d.length;){const _=c8(u[o],d[o]);if(_)return _;o++}if(Math.abs(d.length-u.length)===1){if(uI(u))return 1;if(uI(d))return-1}return d.length-u.length}function uI(n){const t=n[n.length-1];return n.length>0&&t[t.length-1]<0}const u8={type:0,value:""},h8=/[a-zA-Z0-9_]/;function d8(n){if(!n)return[[]];if(n==="/")return[[u8]];if(!n.startsWith("/"))throw new Error(`Invalid path "${n}"`);function t(Q){throw new Error(`ERR (${o})/"${P}": ${Q}`)}let o=0,u=o;const d=[];let _;function x(){_&&d.push(_),_=[]}let s=0,A,P="",R="";function V(){P&&(o===0?_.push({type:0,value:P}):o===1||o===2||o===3?(_.length>1&&(A==="*"||A==="+")&&t(`A repeatable param (${P}) must be alone in its segment. eg: '/:ids+.`),_.push({type:1,value:P,regexp:R,repeatable:A==="*"||A==="+",optional:A==="*"||A==="?"})):t("Invalid state to consume buffer"),P="")}function j(){P+=A}for(;s<n.length;){if(A=n[s++],A==="\\"&&o!==2){u=o,o=4;continue}switch(o){case 0:A==="/"?(P&&V(),x()):A===":"?(V(),o=1):j();break;case 4:j(),o=u;break;case 1:A==="("?o=2:h8.test(A)?j():(V(),o=0,A!=="*"&&A!=="?"&&A!=="+"&&s--);break;case 2:A===")"?R[R.length-1]=="\\"?R=R.slice(0,-1)+A:o=3:R+=A;break;case 3:V(),o=0,A!=="*"&&A!=="?"&&A!=="+"&&s--,R="";break;default:t("Unknown state");break}}return o===2&&t(`Unfinished custom RegExp for param "${P}"`),V(),x(),d}function f8(n,t,o){const u=l8(d8(n.path),o),d=sr(u,{record:n,parent:t,children:[],alias:[]});return t&&!d.record.aliasOf==!t.record.aliasOf&&t.children.push(d),d}function p8(n,t){const o=[],u=new Map;t=pI({strict:!1,end:!0,sensitive:!1},t);function d(V){return u.get(V)}function _(V,j,Q){const me=!Q,re=dI(V);re.aliasOf=Q&&Q.record;const be=pI(t,V),ve=[re];
vendor: 9,263 bytes, line 21
21if("alias"in V){const Ve=typeof V.alias=="string"?[V.alias]:V.alias;for(const Je of Ve)ve.push(dI(sr({},re,{components:Q?Q.record.components:re.components,path:Je,aliasOf:Q?Q.record:re})))}let Ee,je;for(const Ve of ve){const{path:Je}=Ve;if(j&&Je[0]!=="/"){const vt=j.record.path,_t=vt[vt.length-1]==="/"?"":"/";Ve.path=j.record.path+(Je&&_t+Je)}if(Ee=f8(Ve,j,be),Q?Q.alias.push(Ee):(je=je||Ee,je!==Ee&&je.alias.push(Ee),me&&V.name&&!fI(Ee)&&x(V.name)),R4(Ee)&&A(Ee),re.children){const vt=re.children;for(let _t=0;_t<vt.length;_t++)_(vt[_t],Ee,Q&&Q.children[_t])}Q=Q||Ee}return je?()=>{x(je)}:oy}function x(V){if(D4(V)){const j=u.get(V);j&&(u.delete(V),o.splice(o.indexOf(j),1),j.children.forEach(x),j.alias.forEach(x))}else{const j=o.indexOf(V);j>-1&&(o.splice(j,1),V.record.name&&u.delete(V.record.name),V.children.forEach(x),V.alias.forEach(x))}}function s(){return o}function A(V){const j=_8(V,o);o.splice(j,0,V),V.record.name&&!fI(V)&&u.set(V.record.name,V)}function P(V,j){let Q,me={},re,be;if("name"in V&&V.name){if(Q=u.get(V.name),!Q)throw rg(1,{location:V});be=Q.record.name,me=sr(hI(j.params,Q.keys.filter(je=>!je.optional).concat(Q.parent?Q.parent.keys.filter(je=>je.optional):[]).map(je=>je.name)),V.params&&hI(V.params,Q.keys.map(je=>je.name))),re=Q.stringify(me)}else if(V.path!=null)re=V.path,Q=o.find(je=>je.re.test(re)),Q&&(me=Q.parse(re),be=Q.record.name);else{if(Q=j.name?u.get(j.name):o.find(je=>je.re.test(j.path)),!Q)throw rg(1,{location:V,currentLocation:j});be=Q.record.name,me=sr({},j.params,V.params),re=Q.stringify(me)}const ve=[];let Ee=Q;for(;Ee;)ve.unshift(Ee.record),Ee=Ee.parent;return{name:be,path:re,params:me,matched:ve,meta:g8(ve)}}n.forEach(V=>_(V));function R(){o.length=0,u.clear()}return{addRoute:_,resolve:P,removeRoute:x,clearRoutes:R,getRoutes:s,getRecordMatcher:d}}function hI(n,t){const o={};for(const u of t)u in n&&(o[u]=n[u]);return o}function dI(n){const t={path:n.path,redirect:n.redirect,name:n.name,meta:n.meta||{},aliasOf:n.aliasOf,beforeEnter:n.beforeEnter,props:m8(n),children:n.children||[],instances:{},leaveGuards:new Set,updateGuards:new Set,enterCallbacks:{},components:"components"in n?n.components||null:n.component&&{default:n.component}};return Object.defineProperty(t,"mods",{value:{}}),t}function m8(n){const t={},o=n.props||!1;if("component"in n)t.default=o;else for(const u in n.components)t[u]=typeof o=="object"?o[u]:o;return t}function fI(n){for(;n;){if(n.record.aliasOf)return!0;n=n.parent}return!1}function g8(n){return n.reduce((t,o)=>sr(t,o.meta),{})}function pI(n,t){const o={};for(const u in n)o[u]=u in t?t[u]:n[u];return o}function _8(n,t){let o=0,u=t.length;for(;o!==u;){const _=o+u>>1;L4(n,t[_])<0?u=_:o=_+1}const d=y8(n);return d&&(u=t.lastIndexOf(d,u-1)),u}function y8(n){let t=n;for(;t=t.parent;)if(R4(t)&&L4(n,t)===0)return t}function R4({record:n}){return!!(n.name||n.components&&Object.keys(n.components).length||n.redirect)}function v8(n){const t={};if(n===""||n==="?")return t;const u=(n[0]==="?"?n.slice(1):n).split("&");for(let d=0;d<u.length;++d){const _=u[d].replace(E4," "),x=_.indexOf("="),s=Ey(x<0?_:_.slice(0,x)),A=x<0?null:Ey(_.slice(x+1));if(s in t){let P=t[s];Bc(P)||(P=t[s]=[P]),P.push(A)}else t[s]=A}return t}function mI(n){let t="";for(let o in n){const u=n[o];if(o=NB(o),u==null){u!==void 0&&(t+=(t.length?"&":"")+o);continue}(Bc(u)?u.map(_=>_&&m2(_)):[u&&m2(u)]).forEach(_=>{_!==void 0&&(t+=(t.length?"&":"")+o,_!=null&&(t+="="+_))})}return t}function x8(n){const t={};for(const o in n){const u=n[o];u!==void 0&&(t[o]=Bc(u)?u.map(d=>d==null?null:""+d):u==null?u:""+u)}return t}const b8=Symbol(""),gI=Symbol(""),t1=Symbol(""),O4=Symbol(""),_2=Symbol("");function z_(){let n=[];function t(u){return n.push(u),()=>{const d=n.indexOf(u);d>-1&&n.splice(d,1)}}function o(){n=[]}return{add:t,list:()=>n.slice(),reset:o}}function Bd(n,t,o,u,d,_=x=>x()){const x=u&&(u.enterCallbacks[d]=u.enterCallbacks[d]||[]);return()=>new Promise((s,A)=>{const P=j=>{j===!1?A(rg(4,{from:o,to:t})):j instanceof Error?A(j):r8(j)?A(rg(2,{from:t,to:j})):(x&&u.enterCallbacks[d]===x&&typeof j=="function"&&x.push(j),s())},R=_(()=>n.call(u&&u.instances[d],t,o,P));let V=Promise.resolve(R);n.length<3&&(V=V.then(P)),V.catch(j=>A(j))})}function pw(n,t,o,u,d=_=>_()){const _=[];for(const x of n)for(const s in x.components){let A=x.components[s];if(!(t!=="beforeRouteEnter"&&!x.instances[s]))if(T4(A)){const R=(A.__vccOpts||A)[t];R&&_.push(Bd(R,o,u,x,s,d))}else{let P=A();_.push(()=>P.then(R=>{if(!R)throw new Error(`Couldn't resolve component "${s}" at "${x.path}"`);const V=IB(R)?R.default:R;x.mods[s]=R,x.components[s]=V;const Q=(V.__vccOpts||V)[t];return Q&&Bd(Q,o,u,x,s,d)()}))}}return _}function _I(n){const t=wu(t1),o=wu(O4),u=bs(()=>{const A=cs(n.to);return t.resolve(A)}),d=bs(()=>{const{matched:A}=u.value,{length:P}=A,R=A[P-1],V=o.matched;if(!R||!V.length)return-1;const j=V.findIndex(sg.bind(null,R));if(j>-1)return j;const Q=yI(A[P-2]);return P>1&&yI(R)===Q&&V[V.length-1].path!==Q?V.findIndex(sg.bind(null,A[P-2])):j}),_=bs(()=>d.value>-1&&A8(o.params,u.value.params)),x=bs(()=>d.value>-1&&d.value===o.matched.length-1&&M4(o.params,u.value.params));function s(A={}){if(E8(A)){const P=t[cs(n.replace)?"replace":"push"](cs(n.to)).catch(oy);return n.viewTransition&&typeof document<"u"&&"startViewTransition"in document&&document.startViewTransition(()=>P),P}return Promise.resolve()}return{route:u,href:bs(()=>u.value.href),isActive:_,isExactActive:x,navigate:s}}function w8(n){return n.length===1?n[0]:n}const T8=xT({name:"RouterLink",compatConfig:{MODE:3},props:{to:{type:[String,Object],required:!0},replace:Boolean,activeClass:String,exactActiveClass:String,custom:Boolean,ariaCurrentValue:{type:String,default:"page"}},useLink:_I,setup(n,{slots:t}){const o=Gx(_I(n)),{options:u}=wu(t1),d=bs(()=>({[vI(n.activeClass,u.linkActiveClass,"router-link-active")]:o.isActive,[vI(n.exactActiveClass,u.linkExactActiveClass,"router-link-exact-active")]:o.isExactActive}));return()=>{const _=t.default&&w8(t.default(o));return n.custom?_:Qx("a",{"aria-current":o.isExactActive?n.ariaCurrentValue:null,href:o.href,onClick:o.navigate,class:d.value},_)}}}),S8=T8;function E8(n){if(!(n.metaKey||n.altKey||n.ctrlKey||n.shiftKey)&&!n.defaultPrevented&&!(n.button!==void 0&&n.button!==0)){if(n.currentTarget&&n.currentTarget.getAttribute){const t=n.currentTarget.getAttribute("target");if(/\b_blank\b/i.test(t))return}return n.preventDefault&&n.preventDefault(),!0}}function A8(n,t){for(const o in t){const u=t[o],d=n[o];if(typeof u=="string"){if(u!==d)return!1}else if(!Bc(d)||d.length!==u.length||u.some((_,x)=>_!==d[x]))return!1}return!0}function yI(n){return n?n.aliasOf?n.aliasOf.path:n.path:""}const vI=(n,t,o)=>n??t??o,C8=xT({name:"RouterView",inheritAttrs:!1,props:{name:{type:String,default:"default"},route:Object},compatConfig:{MODE:3},setup(n,{attrs:t,slots:o}){const u=wu(_2),d=bs(()=>n.route||u.value),_=wu(gI,0),x=bs(()=>{let P=cs(_);const{matched:R}=d.value;let V;for(;(V=R[P])&&!V.components;)P++;return P}),s=bs(()=>d.value.matched[x.value]);Yv(gI,bs(()=>x.value+1)),Yv(b8,s),Yv(_2,d);const A=Mi();return xp(()=>[A.value,s.value,n.name],([P,R,V],[j,Q,me])=>{R&&(R.instances[V]=P,Q&&Q!==R&&P&&P===j&&(R.leaveGuards.size||(R.leaveGuards=Q.leaveGuards),R.updateGuards.size||(R.updateGuards=Q.updateGuards))),P&&R&&(!Q||!sg(R,Q)||!j)&&(R.enterCallbacks[V]||[]).forEach(re=>re(P))},{flush:"post"}),()=>{const P=d.value,R=n.name,V=s.value,j=V&&V.components[R];if(!j)return xI(o.default,{Component:j,route:P});const Q=V.props[R],me=Q?Q===!0?P.params:typeof Q=="function"?Q(P):Q:null,be=Qx(j,sr({},me,t,{onVnodeUnmounted:ve=>{ve.component.isUnmounted&&(V.instances[R]=null)},ref:A}));return xI(o.default,{Component:be,route:P})||be}}});function xI(n,t){if(!n)return null;const o=n(t);return o.length===1?o[0]:o}const I8=C8;function M8(n){const t=p8(n.routes,n),o=n.parseQuery||v8,u=n.stringifyQuery||mI,d=n.history,_=z_(),x=z_(),s=z_(),A=S6(Dd);let P=Dd;Um&&n.scrollBehavior&&"scrollRestoration"in history&&(history.scrollRestoration="manual");const R=dw.bind(null,Ct=>""+Ct),V=dw.bind(null,$B),j=dw.bind(null,Ey);function Q(Ct,zt){let ti,qi;return D4(Ct)?(ti=t.getRecordMatcher(Ct),qi=zt):qi=Ct,t.addRoute(qi,ti)}function me(Ct){const zt=t.getRecordMatcher(Ct);zt&&t.removeRoute(zt)}function re(){return t.getRoutes().map(Ct=>Ct.record)}function be(Ct){return!!t.getRecordMatcher(Ct)}function ve(Ct,zt){if(zt=sr({},zt||A.value),typeof Ct=="string"){const dt=fw(o,Ct,zt.path),$t=t.resolve({path:dt.path},zt),Ft=d.createHref(dt.fullPath);return sr(dt,$t,{params:j($t.params),hash:Ey(dt.hash),redirectedFrom:void 0,href:Ft})}let ti;if(Ct.path!=null)ti=sr({},Ct,{path:fw(o,Ct.path,zt.path).path});else{const dt=sr({},Ct.params);for(const $t in dt)dt[$t]==null&&delete dt[$t];ti=sr({},Ct,{params:V(dt)}),zt.params=V(zt.params)}const qi=t.resolve(ti,zt),ts=Ct.hash||"";qi.params=R(j(qi.params));const Fe=HB(u,sr({},Ct,{hash:BB(ts),path:qi.path})),Oe=d.createHref(Fe);return sr({fullPath:Fe,hash:ts,query:u===mI?x8(Ct.query):Ct.query||{}},qi,{redirectedFrom:void 0,href:Oe})}function Ee(Ct){return typeof Ct=="string"?fw(o,Ct,A.value.path):sr({},Ct)}function je(Ct,zt){if(P!==Ct)return rg(8,{from:zt,to:Ct})}function Ve(Ct){return _t(Ct)}function Je(Ct){return Ve(sr(Ee(Ct),{replace:!0}))}
vendor: 4,835 bytes, line 21
21function vt(Ct){const zt=Ct.matched[Ct.matched.length-1];if(zt&&zt.redirect){const{redirect:ti}=zt;let qi=typeof ti=="function"?ti(Ct):ti;return typeof qi=="string"&&(qi=qi.includes("?")||qi.includes("#")?qi=Ee(qi):{path:qi},qi.params={}),sr({query:Ct.query,hash:Ct.hash,params:qi.path!=null?{}:Ct.params},qi)}}function _t(Ct,zt){const ti=P=ve(Ct),qi=A.value,ts=Ct.state,Fe=Ct.force,Oe=Ct.replace===!0,dt=vt(ti);if(dt)return _t(sr(Ee(dt),{state:typeof dt=="object"?sr({},ts,dt.state):ts,force:Fe,replace:Oe}),zt||ti);const $t=ti;$t.redirectedFrom=zt;let Ft;return!Fe&&GB(u,qi,ti)&&(Ft=rg(16,{to:$t,from:qi}),Yn(qi,qi,!0,!1)),(Ft?Promise.resolve(Ft):ei($t,qi)).catch(Wt=>hh(Wt)?hh(Wt,2)?Wt:Ue(Wt):cn(Wt,$t,qi)).then(Wt=>{if(Wt){if(hh(Wt,2))return _t(sr({replace:Oe},Ee(Wt.to),{state:typeof Wt.to=="object"?sr({},ts,Wt.to.state):ts,force:Fe}),zt||$t)}else Wt=Zt($t,qi,!0,Oe,ts);return Yt($t,qi,Wt),Wt})}function Mt(Ct,zt){const ti=je(Ct,zt);return ti?Promise.reject(ti):Promise.resolve()}function At(Ct){const zt=On.values().next().value;return zt&&typeof zt.runWithContext=="function"?zt.runWithContext(Ct):Ct()}function ei(Ct,zt){let ti;const[qi,ts,Fe]=P8(Ct,zt);ti=pw(qi.reverse(),"beforeRouteLeave",Ct,zt);for(const dt of qi)dt.leaveGuards.forEach($t=>{ti.push(Bd($t,Ct,zt))});const Oe=Mt.bind(null,Ct,zt);return ti.push(Oe),Hi(ti).then(()=>{ti=[];for(const dt of _.list())ti.push(Bd(dt,Ct,zt));return ti.push(Oe),Hi(ti)}).then(()=>{ti=pw(ts,"beforeRouteUpdate",Ct,zt);for(const dt of ts)dt.updateGuards.forEach($t=>{ti.push(Bd($t,Ct,zt))});return ti.push(Oe),Hi(ti)}).then(()=>{ti=[];for(const dt of Fe)if(dt.beforeEnter)if(Bc(dt.beforeEnter))for(const $t of dt.beforeEnter)ti.push(Bd($t,Ct,zt));else ti.push(Bd(dt.beforeEnter,Ct,zt));return ti.push(Oe),Hi(ti)}).then(()=>(Ct.matched.forEach(dt=>dt.enterCallbacks={}),ti=pw(Fe,"beforeRouteEnter",Ct,zt,At),ti.push(Oe),Hi(ti))).then(()=>{ti=[];for(const dt of x.list())ti.push(Bd(dt,Ct,zt));return ti.push(Oe),Hi(ti)}).catch(dt=>hh(dt,8)?dt:Promise.reject(dt))}function Yt(Ct,zt,ti){s.list().forEach(qi=>At(()=>qi(Ct,zt,ti)))}function Zt(Ct,zt,ti,qi,ts){const Fe=je(Ct,zt);if(Fe)return Fe;const Oe=zt===Dd,dt=Um?history.state:{};ti&&(qi||Oe?d.replace(Ct.fullPath,sr({scroll:Oe&&dt&&dt.scroll},ts)):d.push(Ct.fullPath,ts)),A.value=Ct,Yn(Ct,zt,ti,Oe),Ue()}let yi;function Fi(){yi||(yi=d.listen((Ct,zt,ti)=>{if(!hn.listening)return;const qi=ve(Ct),ts=vt(qi);if(ts){_t(sr(ts,{replace:!0,force:!0}),qi).catch(oy);return}P=qi;const Fe=A.value;Um&&QB(oI(Fe.fullPath,ti.delta),e1()),ei(qi,Fe).catch(Oe=>hh(Oe,12)?Oe:hh(Oe,2)?(_t(sr(Ee(Oe.to),{force:!0}),qi).then(dt=>{hh(dt,20)&&!ti.delta&&ti.type===Ay.pop&&d.go(-1,!1)}).catch(oy),Promise.reject()):(ti.delta&&d.go(-ti.delta,!1),cn(Oe,qi,Fe))).then(Oe=>{Oe=Oe||Zt(qi,Fe,!1),Oe&&(ti.delta&&!hh(Oe,8)?d.go(-ti.delta,!1):ti.type===Ay.pop&&hh(Oe,20)&&d.go(-1,!1)),Yt(qi,Fe,Oe)}).catch(oy)}))}let ki=z_(),wi=z_(),Li;function cn(Ct,zt,ti){Ue(Ct);const qi=wi.list();return qi.length?qi.forEach(ts=>ts(Ct,zt,ti)):console.error(Ct),Promise.reject(Ct)}function vi(){return Li&&A.value!==Dd?Promise.resolve():new Promise((Ct,zt)=>{ki.add([Ct,zt])})}function Ue(Ct){return Li||(Li=!Ct,Fi(),ki.list().forEach(([zt,ti])=>Ct?ti(Ct):zt()),ki.reset()),Ct}function Yn(Ct,zt,ti,qi){const{scrollBehavior:ts}=n;if(!Um||!ts)return Promise.resolve();const Fe=!ti&&e8(oI(Ct.fullPath,0))||(qi||!ti)&&history.state&&history.state.scroll||null;return qx().then(()=>ts(Ct,zt,Fe)).then(Oe=>Oe&&JB(Oe)).catch(Oe=>cn(Oe,Ct,zt))}const Ki=Ct=>d.go(Ct);let ps;const On=new Set,hn={currentRoute:A,listening:!0,addRoute:Q,removeRoute:me,clearRoutes:t.clearRoutes,hasRoute:be,getRoutes:re,resolve:ve,options:n,push:Ve,replace:Je,go:Ki,back:()=>Ki(-1),forward:()=>Ki(1),beforeEach:_.add,beforeResolve:x.add,afterEach:s.add,onError:wi.add,isReady:vi,install(Ct){const zt=this;Ct.component("RouterLink",S8),Ct.component("RouterView",I8),Ct.config.globalProperties.$router=zt,Object.defineProperty(Ct.config.globalProperties,"$route",{enumerable:!0,get:()=>cs(A)}),Um&&!ps&&A.value===Dd&&(ps=!0,Ve(d.location).catch(ts=>{}));const ti={};for(const ts in Dd)Object.defineProperty(ti,ts,{get:()=>A.value[ts],enumerable:!0});Ct.provide(t1,zt),Ct.provide(O4,ID(ti)),Ct.provide(_2,A);const qi=Ct.unmount;On.add(Ct),Ct.unmount=function(){On.delete(Ct),On.size<1&&(P=Dd,yi&&yi(),yi=null,A.value=Dd,ps=!1,Li=!1),qi()}}};function Hi(Ct){return Ct.reduce((zt,ti)=>zt.then(()=>At(ti)),Promise.resolve())}return hn}function P8(n,t){const o=[],u=[],d=[],_=Math.max(t.matched.length,n.matched.length);for(let x=0;x<_;x++){const s=t.matched[x];s&&(n.matched.find(P=>sg(P,s))?u.push(s):o.push(s));const A=n.matched[x];A&&(t.matched.find(P=>sg(P,A))||d.push(A))}return[o,u,d]}function IT(){return wu(t1)}const D8={class:"intro-page"},k8={class:"intro-content"},L8={class:"intro-background-elements"}
21,R8={__name:"IntroPage",setup(n){const t=IT();let o;kh(()=>{document.body.classList.add("intro-active"),u()}),bT(()=>{clearInterval(o)});const u=()=>{o=setInterval(()=>{const d=document.querySelectorAll(".intro-star"),_=Math.floor(Math.random()*11)+10,x=new Set;for(;x.size<_;){const s=Math.floor(Math.random()*d.length);x.has(s)||(d[s].style.animation="none",d[s].offsetHeight,d[s].style.animation="intro-twinkle 2s",x.add(s))}},500)};return t.beforeEach((d,_,x)=>{_.name==="Intro"&&d.name==="Home"?(document.body.classList.add("intro-transition"),setTimeout(()=>{document.body.classList.remove("intro-active","intro-transition"),x()},500)):x()}),(d,_)=>{const x=_g("router-link");return Ke(),it("div",D8,[H("div",k8,[_[1]||(_[1]=H("h1",{class:"intro-title"},"Welcome to CIBC CLONE",-1)),_[2]||(_[2]=H("p",{class:"intro-subtitle"},"Discover a world of financial possibilities",-1)),Dt(x,{to:"/home",class:"intro-get-started-btn"},{default:vl(()=>_[0]||(_[0]=[es(" Get Started "),H("span",{class:"intro-btn-arrow"},"â",-1)])),_:1})]),_[3]||(_[3]=Xo('<div class="intro-animations" data-v-990851c0><svg class="intro-circle" viewBox="0 0 100 100" data-v-990851c0><circle cx="50" cy="50" r="40" data-v-990851c0></circle></svg><svg class="intro-square" viewBox="0 0 100 100" data-v-990851c0><rect x="20" y="20" width="60" height="60" data-v-990851c0></rect></svg><svg class="intro-triangle" viewBox="0 0 100 100" data-v-990851c0><polygon points="50,15 85,85 15,85" data-v-990851c0></polygon></svg></div><div class="intro-floating-images" data-v-990851c0><img src="https://logos-world.net/wp-content/uploads/2021/05/CIBC-Emblem.png" alt="CIBC Logo" class="intro-cibc-logo" data-v-990851c0><img src="https://logos-world.net/wp-content/uploads/2021/05/CIBC-Emblem.png" alt="Credit Card" class="intro-credit-card" data-v-990851c0><img src="https://logos-world.net/wp-content/uploads/2021/05/CIBC-Emblem.png" alt="Mobile Banking" class="intro-mobile-banking" data-v-990851c0></div>',2)),H("div",L8,[(Ke(),it(fn,null,Hn(100,s=>H("div",{key:s,class:"intro-star",style:Nd({top:`${Math.random()*100}%`,left:`${Math.random()*100}%`})},null,4)),64))])])}}},O8=ji(R8,[["__scopeId","data-v-990851c0"]]),MT="/assets/cibc-iwAKSj3w.png",z8={class:"navbar navbar-expand-lg navbar-light bg-white shadow-sm"},F8={class:"container"},B8={class:"collapse navbar-collapse",id:"navbarNav"},N8={class:"navbar-nav ms-auto"},V8={class:"nav-item"},$8={class:"nav-item"},j8={class:"nav-item"},U8={key:1,class:"nav-link",href:"#"},H8={__name:"AppHeader",setup(n,{expose:t}){const o=IT(),u=["About Us"],d=Mi(!1),_=()=>{d.value=!1,o.push("/home")};return t({updateSignInStatus:s=>{d.value=s}}),(s,A)=>{const P=_g("router-link");return Ke(),it("nav",z8,[H("div",F8,[Dt(P,{class:"navbar-brand",to:"/home"},{default:vl(()=>A[0]||(A[0]=[H("img",{src:MT,alt:"CIBC Logo",height:"30"},null,-1)])),_:1}),A[5]||(A[5]=H("button",{class:"navbar-toggler",type:"button","data-bs-toggle":"collapse","data-bs-target":"#navbarNav","aria-controls":"navbarNav","aria-expanded":"false","aria-label":"Toggle navigation"},[H("span",{class:"navbar-toggler-icon"})],-1)),H("div",B8,[H("ul",N8,[H("li",V8,[Dt(P,{class:"nav-link",to:"/personal-banking"},{default:vl(()=>A[1]||(A[1]=[es("Personal Banking")])),_:1})]),H("li",$8,[Dt(P,{class:"nav-link",to:"/business-banking"},{default:vl(()=>A[2]||(A[2]=[es("Business Banking")])),_:1})]),H("li",j8,[Dt(P,{class:"nav-link",to:"/investing"},{default:vl(()=>A[3]||(A[3]=[es("Investing")])),_:1})]),(Ke(),it(fn,null,Hn(u,R=>H("li",{class:"nav-item",key:R},[R==="About Us"?(Ke(),Ap(P,{key:0,class:"nav-link",to:"/about"},{default:vl(()=>[es(Ut(R),1)]),_:2},1024)):(Ke(),it("a",U8,Ut(R),1))])),64))]),d.value?(Ke(),it("button",{key:1,onClick:_,class:"btn btn-theme ms-3"},"Sign Out")):(Ke(),Ap(P,{key:0,to:"/sign-on"},{default:vl(()=>A[4]||(A[4]=[H("button",{class:"btn btn-theme ms-3"},"Sign On",-1)])),_:1}))])])])}}},yg=ji(H8,[["__scopeId","data-v-2f7193d9"]]),G8={class:"hero-section position-relative overflow-hidden"},W8={__name:"HeroSection",emits:["open-application-modal","open-map-modal"],setup(n,{emit:t}){const o=t;kh(()=>{document.body.classList.add("animate__animated","animate__fadeIn")});const u=()=>{o("open-application-modal")},d=()=>{o("open-map-modal")};return(_,x)=>(Ke(),it("section",G8,[x[2]||(x[2]=Xo('<div class="animated-background" data-v-c8d3623c><div class="circle circle-1" data-v-c8d3623c></div><div class="circle circle-2" data-v-c8d3623c></div><div class="circle circle-3" data-v-c8d3623c></div><img src="https://logos-world.net/wp-content/uploads/2021/05/CIBC-Emblem.png" alt="CIBC Logo" class="floating-logo" data-v-c8d3623c></div>',1)),H("div",{class:"container h-100 d-flex flex-column justify-content-center"},[H("div",{class:"row"},[H("div",{class:"col-lg-6"},[x[0]||(x[0]=H("h1",{class:"display-4 fw-bold text-white mb-4 animate__animated animate__fadeInLeft"}," Get a $300 Cash Bonus ",-1)),x[1]||(x[1]=H("p",{class:"lead text-white mb-5 animate__animated animate__fadeInLeft animate__delay-1s"}," Plus, earn up to 5% cash back for the first 4 months ",-1)),H("div",{class:"animate__animated animate__fadeInUp animate__delay-2s"},[H("button",{type:"button",class:"btn btn-light btn-lg me-3 apply-now-btn",onClick:u}," Apply Now "),H("button",{type:"button",class:"btn btn-outline-light btn-lg",onClick:d}," Find a Branch ")])])])]),x[3]||(x[3]=H("div",{class:"floating-card animate__animated animate__fadeInRight animate__delay-1s"},[H("img",{src:"https://www.cibc.com/content/dam/global-assets/card-art/credit-cards/aventura-cards/cibc-aventura-visa-infinite-card/cibc-visa-aventura-infinite-en.png/_jcr_content/renditions/cq5dam.web.1280.1280.png",alt:"CIBC Dividend Visa Infinite Card",class:"img-fluid"})],-1))]))}},q8=ji(W8,[["__scopeId","data-v-c8d3623c"]]),Z8={class:"card benefits-card mb-5 animate__animated animate__fadeIn"},X8={class:"card-body"},Y8={class:"list-group list-group-flush"},K8={__name:"CardBenefits",setup(n){const t=["$300 cash bonus when you spend $3,000 in the first 4 months","Earn 5% cash back on groceries and gas for the first 4 months (up to $2,500 spent)","After the promotional period, earn up to 4% cash back on eligible purchases","Comprehensive travel insurance package","Purchase security and extended protection insurance","Earn 2% cash back on dining and transportation purchases","Access to exclusive concierge services","No annual fee for the first year"];return(o,u)=>(Ke(),it("div",Z8,[H("div",X8,[u[1]||(u[1]=H("h2",{class:"card-title mb-4"},"CIBC Dividend® Visa Infinite* Card Benefits",-1)),H("ul",Y8,[(Ke(),it
21(fn,null,Hn(t,(d,_)=>H("li",{key:_,class:"list-group-item benefit-item"},[u[0]||(u[0]=H("i",{class:"bi bi-check-circle-fill text-success me-2"},null,-1)),es(" "+Ut(d),1)])),64))])])]))}},J8=ji(K8,[["__scopeId","data-v-d70bf498"]]),Q8={class:"card cashback-calculator animate__animated animate__fadeIn"},eN={class:"card-body"},tN={class:"mb-3"},iN={class:"mb-3"},nN=["id","onUpdate:modelValue"],sN=["for"],rN={class:"result mt-4"},oN={class:"display-4 text-theme"},aN={__name:"CashbackCalculator",setup(n){const t=Mi(1e3),o=Mi([{name:"Groceries",rate:4,selected:!0},{name:"Gas",rate:4,selected:!0},{name:"Dining",rate:2,selected:!1},{name:"Other Purchases",rate:1,selected:!0}]),u=Mi(0),d=()=>{let _=0;o.value.forEach(x=>{if(x.selected){const s=t.value*x.rate/100;_+=s*12}}),u.value=_};return xp(t,d),d(),(_,x)=>(Ke(),it("div",Q8,[H("div",eN,[x[4]||(x[4]=H("h3",{class:"card-title mb-4"},"Cashback Calculator",-1)),H("div",tN,[x[1]||(x[1]=H("label",{for:"monthlySpending",class:"form-label"},"Monthly Spending",-1)),An(H("input",{type:"number",class:"form-control",id:"monthlySpending","onUpdate:modelValue":x[0]||(x[0]=s=>t.value=s),onInput:d},null,544),[[Ur,t.value]])]),H("div",iN,[x[2]||(x[2]=H("label",{class:"form-label"},"Spending Categories",-1)),(Ke(!0),it(fn,null,Hn(o.value,(s,A)=>(Ke(),it("div",{class:"form-check",key:A},[An(H("input",{class:"form-check-input",type:"checkbox",id:"category"+A,"onUpdate:modelValue":P=>s.selected=P,onChange:d},null,40,nN),[[AT,s.selected]]),H("label",{class:"form-check-label",for:"category"+A},Ut(s.name)+" ("+Ut(s.rate)+"% cashback) ",9,sN)]))),128))]),H("div",rN,[x[3]||(x[3]=H("h4",null,"Estimated Annual Cashback",-1)),H("p",oN,"$"+Ut(u.value.toFixed(2)),1)])])]))}},lN=ji(aN,[["__scopeId","data-v-b1060fe8"]]),cN={class:"how-it-works mb-5 animate__animated animate__fadeIn"},uN={class:"row"},hN={class:"card h-100 step-card"},dN={class:"card-body text-center"},fN={class:"step-number mb-3"},pN={class:"card-title"},mN={class:"card-text"},gN={__name:"HowItWorks",setup(n){const t=[{title:"Apply Online",description:"Fill out our simple online application form in just a few minutes."},{title:"Quick Approval",description:"Get a decision on your application quickly, often within 60 seconds."},{title:"Activate and Earn",description:"Once you receive your card, activate it and start earning cash back on your purchases right away."}];return(o,u)=>(Ke(),it("div",cN,[u[0]||(u[0]=H("h2",{class:"text-center section-title mb-5"},"How It Works",-1)),H("div",uN,[(Ke(),it(fn,null,Hn(t,(d,_)=>H("div",{key:_,class:"col-md-4 mb-4"},[H("div",hN,[H("div",dN,[H("div",fN,Ut(_+1),1),H("h3",pN,Ut(d.title),1),H("p",mN,Ut(d.description),1)])])])),64))])]))}},_N=ji(gN,[["__scopeId","data-v-7660aa48"]]),yN={class:"modal fade",id:"cardModal",tabindex:"-1","aria-labelledby":"cardModalLabel","aria-hidden":"true"},vN={class:"modal-dialog modal-lg"},xN={class:"modal-content"}
21,bN={class:"modal-header"},wN={class:"modal-title",id:"cardModalLabel"},TN={class:"modal-body"},SN={class:"row"},EN={class:"col-md-6"},AN=["src","alt"],CN={class:"col-md-6"},IN={__name:"CardModal",props:{card:Object},setup(n){return(t,o)=>{var u,d,_,x;return Ke(),Ap(O6,{to:"body"},[H("div",yN,[H("div",vN,[H("div",xN,[H("div",bN,[H("h5",wN,Ut((u=n.card)==null?void 0:u.name),1),o[0]||(o[0]=H("button",{type:"button",class:"btn-close","data-bs-dismiss":"modal","aria-label":"Close"},null,-1))]),H("div",TN,[H("div",SN,[H("div",EN,[H("img",{src:(d=n.card)==null?void 0:d.image,alt:(_=n.card)==null?void 0:_.name,class:"img-fluid mb-3 rounded shadow-lg"},null,8,AN)]),H("div",CN,[o[2]||(o[2]=H("h4",{class:"mb-4"},"Key Features:",-1)),H("ul",null,[(Ke(!0),it(fn,null,Hn((x=n.card)==null?void 0:x.features,(s,A)=>(Ke(),it("li",{key:A},[o[1]||(o[1]=H("i",{class:"bi bi-check-circle-fill text-success me-2"},null,-1)),es(" "+Ut(s),1)]))),128))])])])]),o[3]||(o[3]=H("div",{class:"modal-footer"},[H("button",{type:"button",class:"btn btn-secondary","data-bs-dismiss":"modal"},"Close"),H("button",{type:"button",class:"btn btn-theme"},"Apply Now")],-1))])])])])}}},MN=ji(IN,[["__scopeId","data-v-1811ff3c"]]),PN={id:"cardComparisonSection",class:"card-comparison animate__animated animate__fadeIn"},DN={class:"row"},kN={class:"card h-100 comparison-card"},LN={class:"card-header bg-theme text-white"},RN={class:"card-title"},ON={class:"card-body"},zN=["src","alt"],FN={class:"list-unstyled"},BN={class:"card-footer"},NN=["onClick"],VN={__name:"CardComparison",setup(n){const t=[{name:"CIBC Dividend® Visa Infinite* Card",image:"https://www.cibc.com/content/dam/global-assets/card-art/credit-cards/dividend-cards/cibc-dividend-visa-card/cibc-dividend-visa-card-en.png/_jcr_content/renditions/cq5dam.web.1280.1280.png",features:["Up to 4% cash back on eligible purchases","$300 welcome bonus","Comprehensive travel insurance"]},{name:"CIBC Aventura® Visa Infinite* Card",image:"https://www.cibc.com/content/dam/global-assets/card-art/credit-cards/aventura-cards/cibc-aventura-visa-infinite-card/cibc-visa-aventura-infinite-en.png/_jcr_content/renditions/cq5dam.web.1280.1280.png",features:["Earn points on all purchases","Flexible travel redemption options","Airport lounge access"]},{name:"CIBC Select Visa* Premium Card",image:"https://www.cibc.com/content/dam/global-assets/card-art/credit-cards/aventura-cards/cibc-aventura-visa-card/cibc-visa-aventura-en.png/_jcr_content/renditions/cq5dam.web.1280.1280.png",features:["Low interest rate on purchases and balance transfers","No annual fee","Purchase security and extended protection insurance"]}],o=Mi(null),u=d=>{o.value=d};return(d,_)=>(Ke(),it("div",PN,[_[1]||(_[1]=H("h2",{class:"text-center section-title mb-5"},"Compare Our Cards",-1)),H("div",DN,[(Ke(),it(fn,null,Hn(t,x=>H("div",{class:"col-md-4 mb-4",key:x.name},[H("div",kN,[H("div",LN,[H("h3",RN,Ut(x.name),1)]),H("div",ON,[H("img",{src:x.image,alt:x.name,class:"img-fluid mb-3"},null,8,zN),H("ul",FN,[(Ke(!0),it(fn,null,Hn(x.features,(s,A)=>(Ke(),it("li",{key:A,class:"mb-2"},[_[0]||(_[0]=H("i",{class:"bi bi-check-circle-fill text-theme me-2"},null,-1)),es(" "+Ut(s),1)]))),128))])]),H("div",BN,[H("button",{class:"btn btn-theme w-100",onClick:s=>u(x),"data-bs-toggle":"modal","data-bs-target":"#cardModal"}," Learn More ",8,NN)])])])),64))]),Dt(MN,{card:o.value},null,8,["card"])]))}},$N=ji(VN,[["__scopeId","data-v-62fa2e33"]]),jN={class:"faq-section mb-5 animate__animated animate__fadeIn"},UN={class:"accordion",id:"faqAccordion"},HN=["id"],GN=["data-bs-target","aria-controls"],WN=["id","aria-labelledby"],qN={class:"accordion-body"},ZN={__name:"FAQSection",setup(n){const t=[{question:"What is the annual fee for this card?",answer:"The annual fee for the CIBC Dividend® Visa Infinite* Card is $120, which is waived for the first year."},{question:"What is the minimum income requirement?",answer:"You need a minimum annual personal income of $60,000 or a minimum annual household income of $100,000 to be eligible for this card."},{question:"How do I redeem my cash back?",answer:"Your cash back is automatically credited to your account once a year in December."},{question:"Is there a limit to how much cash back I can earn?",answer:"There is no limit on the total cash back you can earn with this card."},{question:"Can I add authorized users to my account?",answer:"Yes, you can add authorized users to your account. Eac
21h additional card has an annual fee of $30."}];return(o,u)=>(Ke(),it("div",jN,[u[0]||(u[0]=H("h2",{class:"text-center mb-5"},"Frequently Asked Questions",-1)),H("div",UN,[(Ke(),it(fn,null,Hn(t,(d,_)=>H("div",{class:"accordion-item",key:_},[H("h2",{class:"accordion-header",id:"heading"+_},[H("button",{class:"accordion-button collapsed",type:"button","data-bs-toggle":"collapse","data-bs-target":"#collapse"+_,"aria-expanded":"false","aria-controls":"collapse"+_},Ut(d.question),9,GN)],8,HN),H("div",{id:"collapse"+_,class:"accordion-collapse collapse","aria-labelledby":"heading"+_,"data-bs-parent":"#faqAccordion"},[H("div",qN,Ut(d.answer),1)],8,WN)])),64))])]))}},XN=ji(ZN,[["__scopeId","data-v-5d2f9e7f"]]),YN={class:"cibc-footer"},KN={class:"container"},JN={class:"footer-content"},QN={class:"footer-section"},eV={class:"social-icons"},tV={href:"#","aria-label":"Facebook"},iV={href:"#","aria-label":"Twitter"},nV={href:"#","aria-label":"LinkedIn"},sV={href:"#","aria-label":"Instagram"},rV={__name:"AppFooter",setup(n){return(t,o)=>{const u=_g("font-awesome-icon");return Ke(),it("footer",YN,[H("div",KN,[H("div",JN,[o[1]||(o[1]=Xo('<div class="footer-section" data-v-363ecd05><h4 data-v-363ecd05>About CIBC</h4><ul data-v-363ecd05><li data-v-363ecd05><a href="#" data-v-363ecd05>Careers</a></li><li data-v-363ecd05><a href="#" data-v-363ecd05>About Us</a></li><li data-v-363ecd05><a href="#" data-v-363ecd05>Accessibility</a></li><li data-v-363ecd05><a href="#" data-v-363ecd05>Corporate Information</a></li></ul></div><div class="footer-section" data-v-363ecd05><h4 data-v-363ecd05>Support</h4><ul data-v-363ecd05><li data-v-363ecd05><a href="#" data-v-363ecd05>Contact Us</a></li><li data-v-363ecd05><a href="#" data-v-363ecd05>Find a Banking Centre</a></li><li data-v-363ecd05><a href="#" data-v-363ecd05>Security</a></li><li data-v-363ecd05><a href="#" data-v-363ecd05>Legal</a></li></ul></div><div class="footer-section" data-v-363ecd05><h4 data-v-363ecd05>Products</h4><ul data-v-363ecd05><li data-v-363ecd05><a href="#" data-v-363ecd05>Accounts</a></li><li data-v-363ecd05><a href="#" data-v-363ecd05>Credit Cards</a></li><li data-v-363ecd05><a href="#" data-v-363ecd05>Mortgages</a></li><li data-v-363ecd05><a href="#" data-v-363ecd05>Investments</a></li></ul></div>',3)),H("div",QN,[o[0]||(o[0]=H("h4",null,"Connect with Us",-1)),H("div",eV,[H("a",tV,[Dt(u,{icon:["fab","facebook-f"]})]),H("a",iV,[Dt(u,{icon:["fab","twitter"]})]),H("a",nV,[Dt(u,{icon:["fab","linkedin-in"]})]),H("a",sV,[Dt(u,{icon:["fab","instagram"]})])])])]),o[2]||(o[2]=Xo('<div class="footer-bottom" data-v-363ecd05><p data-v-363ecd05>© 2025 CIBC. All rights reserved.</p><div class="footer-links" data-v-363ecd05><a href="#" data-v-363ecd05>Privacy</a><a href="#" data-v-363ecd05>Terms of Use</a><a href="#" data-v-363ecd05>Accessibility</a></div></div>',1))])])}}},vg=ji(rV,[["__scopeId","data-v-363ecd05"]]);var Aa="top",bl="bottom",wl="right",Ca="left",i1="auto",xg=[Aa,bl,wl,Ca],Cp="start",og="end",z4="clippingParents",PT="viewport",Hm="popper",F4="reference",y2=xg.reduce(function(n,t){return n.concat([t+"-"+Cp,t+"-"+og])},[]),DT=[].concat(xg,[i1]).reduce(function(n,t){return n.concat([t,t+"-"+Cp,t+"-"+og])},[]),B4="beforeRead",N4="read",V4="afterRead",$4="beforeMain",j4="main",U4="afterMain",H4="beforeWrite",G4="write",W4="afterWrite",q4=[B4,N4,V4,$4,j4,U4,H4,G4,W4];function Au(n){return n?(n.nodeName||"").toLowerCase():null}function Tl(n){if(n==null)return window;if(n.toString()!=="[object Window]"){var t=n.ownerDocument;return t&&t.defaultView||window}return n}function Ip(n){var t=Tl(n).Element;return n instanceof t||n instanceof Element}function ec(n){var t=Tl(n).HTMLElement;return n instanceof t||n instanceof HTMLElement}function kT(n){if(typeof ShadowRoot>"u")return!1;var t=Tl(n).ShadowRoot;return n instanceof t||n instanceof ShadowRoot}function oV(n){var t=n.state;Object.keys(t.elements).forEach(function(o){var u=t.styles[o]||{},d=t.attributes[o]||{},_=t.elements[o];!ec(_)||!Au(_)||(Object.assign(_.style,u),Object.keys(d).forEach(function(x){var s=d[x];s===!1?_.removeAttribute(x):_.setAttribute(x,s===!0?"":s)}))})}function aV(n){var t=n.state,o={popper:{position:t.options.strategy,left
vendor: 19,014 bytes, line 21
21:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(t.elements.popper.style,o.popper),t.styles=o,t.elements.arrow&&Object.assign(t.elements.arrow.style,o.arrow),function(){Object.keys(t.elements).forEach(function(u){var d=t.elements[u],_=t.attributes[u]||{},x=Object.keys(t.styles.hasOwnProperty(u)?t.styles[u]:o[u]),s=x.reduce(function(A,P){return A[P]="",A},{});!ec(d)||!Au(d)||(Object.assign(d.style,s),Object.keys(_).forEach(function(A){d.removeAttribute(A)}))})}}const LT={name:"applyStyles",enabled:!0,phase:"write",fn:oV,effect:aV,requires:["computeStyles"]};function Tu(n){return n.split("-")[0]}var bp=Math.max,Sx=Math.min,ag=Math.round;function v2(){var n=navigator.userAgentData;return n!=null&&n.brands&&Array.isArray(n.brands)?n.brands.map(function(t){return t.brand+"/"+t.version}).join(" "):navigator.userAgent}function Z4(){return!/^((?!chrome|android).)*safari/i.test(v2())}function lg(n,t,o){t===void 0&&(t=!1),o===void 0&&(o=!1);var u=n.getBoundingClientRect(),d=1,_=1;t&&ec(n)&&(d=n.offsetWidth>0&&ag(u.width)/n.offsetWidth||1,_=n.offsetHeight>0&&ag(u.height)/n.offsetHeight||1);var x=Ip(n)?Tl(n):window,s=x.visualViewport,A=!Z4()&&o,P=(u.left+(A&&s?s.offsetLeft:0))/d,R=(u.top+(A&&s?s.offsetTop:0))/_,V=u.width/d,j=u.height/_;return{width:V,height:j,top:R,right:P+V,bottom:R+j,left:P,x:P,y:R}}function RT(n){var t=lg(n),o=n.offsetWidth,u=n.offsetHeight;return Math.abs(t.width-o)<=1&&(o=t.width),Math.abs(t.height-u)<=1&&(u=t.height),{x:n.offsetLeft,y:n.offsetTop,width:o,height:u}}function X4(n,t){var o=t.getRootNode&&t.getRootNode();if(n.contains(t))return!0;if(o&&kT(o)){var u=t;do{if(u&&n.isSameNode(u))return!0;u=u.parentNode||u.host}while(u)}return!1}function Ih(n){return Tl(n).getComputedStyle(n)}function lV(n){return["table","td","th"].indexOf(Au(n))>=0}function of(n){return((Ip(n)?n.ownerDocument:n.document)||window.document).documentElement}function n1(n){return Au(n)==="html"?n:n.assignedSlot||n.parentNode||(kT(n)?n.host:null)||of(n)}function bI(n){return!ec(n)||Ih(n).position==="fixed"?null:n.offsetParent}function cV(n){var t=/firefox/i.test(v2()),o=/Trident/i.test(v2());if(o&&ec(n)){var u=Ih(n);if(u.position==="fixed")return null}var d=n1(n);for(kT(d)&&(d=d.host);ec(d)&&["html","body"].indexOf(Au(d))<0;){var _=Ih(d);if(_.transform!=="none"||_.perspective!=="none"||_.contain==="paint"||["transform","perspective"].indexOf(_.willChange)!==-1||t&&_.willChange==="filter"||t&&_.filter&&_.filter!=="none")return d;d=d.parentNode}return null}function Uy(n){for(var t=Tl(n),o=bI(n);o&&lV(o)&&Ih(o).position==="static";)o=bI(o);return o&&(Au(o)==="html"||Au(o)==="body"&&Ih(o).position==="static")?t:o||cV(n)||t}function OT(n){return["top","bottom"].indexOf(n)>=0?"x":"y"}function ly(n,t,o){return bp(n,Sx(t,o))}function uV(n,t,o){var u=ly(n,t,o);return u>o?o:u}function Y4(){return{top:0,right:0,bottom:0,left:0}}function K4(n){return Object.assign({},Y4(),n)}function J4(n,t){return t.reduce(function(o,u){return o[u]=n,o},{})}var hV=function(t,o){return t=typeof t=="function"?t(Object.assign({},o.rects,{placement:o.placement})):t,K4(typeof t!="number"?t:J4(t,xg))};function dV(n){var t,o=n.state,u=n.name,d=n.options,_=o.elements.arrow,x=o.modifiersData.popperOffsets,s=Tu(o.placement),A=OT(s),P=[Ca,wl].indexOf(s)>=0,R=P?"height":"width";if(!(!_||!x)){var V=hV(d.padding,o),j=RT(_),Q=A==="y"?Aa:Ca,me=A==="y"?bl:wl,re=o.rects.reference[R]+o.rects.reference[A]-x[A]-o.rects.popper[R],be=x[A]-o.rects.reference[A],ve=Uy(_),Ee=ve?A==="y"?ve.clientHeight||0:ve.clientWidth||0:0,je=re/2-be/2,Ve=V[Q],Je=Ee-j[R]-V[me],vt=Ee/2-j[R]/2+je,_t=ly(Ve,vt,Je),Mt=A;o.modifiersData[u]=(t={},t[Mt]=_t,t.centerOffset=_t-vt,t)}}function fV(n){var t=n.state,o=n.options,u=o.element,d=u===void 0?"[data-popper-arrow]":u;d!=null&&(typeof d=="string"&&(d=t.elements.popper.querySelector(d),!d)||X4(t.elements.popper,d)&&(t.elements.arrow=d))}const Q4={name:"arrow",enabled:!0,phase:"main",fn:dV,effect:fV,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function cg(n){return n.split("-")[1]}var pV={top:"auto",right:"auto",bottom:"auto",left:"auto"};function mV(n,t){var o=n.x,u=n.y,d=t.devicePixelRatio||1;return{x:ag(o*d)/d||0,y:ag(u*d)/d||0}}function wI(n){var t,o=n.popper,u=n.popperRect,d=n.placement,_=n.variation,x=n.offsets,s=n.position,A=n.gpuAcceleration,P=n.adaptive,R=n.roundOffsets,V=n.isFixed,j=x.x,Q=j===void 0?0:j,me=x.y,re=me===void 0?0:me,be=typeof R=="function"?R({x:Q,y:re}):{x:Q,y:re};Q=be.x,re=be.y;var ve=x.hasOwnProperty("x"),Ee=x.hasOwnProperty("y"),je=Ca,Ve=Aa,Je=window;if(P){var vt=Uy(o),_t="clientHeight",Mt="clientWidth";if(vt===Tl(o)&&(vt=of(o),Ih(vt).position!=="static"&&s==="absolute"&&(_t="scrollHeight",Mt="scrollWidth")),vt=vt,d===Aa||(d===Ca||d===wl)&&_===og){Ve=bl;var At=V&&vt===Je&&Je.visualViewport?Je.visualViewport.height:vt[_t];re-=At-u.height,re*=A?1:-1}if(d===Ca||(d===Aa||d===bl)&&_===og){je=wl;var ei=V&&vt===Je&&Je.visualViewport?Je.visualViewport.width:vt[Mt];Q-=ei-u.width,Q*=A?1:-1}}var Yt=Object.assign({position:s},P&&pV),Zt=R===!0?mV({x:Q,y:re},Tl(o)):{x:Q,y:re};if(Q=Zt.x,re=Zt.y,A){var yi;return Object.assign({},Yt,(yi={},yi[Ve]=Ee?"0":"",yi[je]=ve?"0":"",yi.transform=(Je.devicePixelRatio||1)<=1?"translate("+Q+"px, "+re+"px)":"translate3d("+Q+"px, "+re+"px, 0)",yi))}return Object.assign({},Yt,(t={},t[Ve]=Ee?re+"px":"",t[je]=ve?Q+"px":"",t.transform="",t))}function gV(n){var t=n.state,o=n.options,u=o.gpuAcceleration,d=u===void 0?!0:u,_=o.adaptive,x=_===void 0?!0:_,s=o.roundOffsets,A=s===void 0?!0:s,P={placement:Tu(t.placement),variation:cg(t.placement),popper:t.elements.popper,popperRect:t.rects.popper,gpuAcceleration:d,isFixed:t.options.strategy==="fixed"};t.modifiersData.popperOffsets!=null&&(t.styles.popper=Object.assign({},t.styles.popper,wI(Object.assign({},P,{offsets:t.modifiersData.popperOffsets,position:t.options.strategy,adaptive:x,roundOffsets:A})))),t.modifiersData.arrow!=null&&(t.styles.arrow=Object.assign({},t.styles.arrow,wI(Object.assign({},P,{offsets:t.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:A})))),t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-placement":t.placement})}const zT={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:gV,data:{}};var wv={passive:!0};function _V(n){var t=n.state,o=n.instance,u=n.options,d=u.scroll,_=d===void 0?!0:d,x=u.resize,s=x===void 0?!0:x,A=Tl(t.elements.popper),P=[].concat(t.scrollParents.reference,t.scrollParents.popper);return _&&P.forEach(function(R){R.addEventListener("scroll",o.update,wv)}),s&&A.addEventListener("resize",o.update,wv),function(){_&&P.forEach(function(R){R.removeEventListener("scroll",o.update,wv)}),s&&A.removeEventListener("resize",o.update,wv)}}const FT={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:_V,data:{}};var yV={left:"right",right:"left",bottom:"top",top:"bottom"};function ex(n){return n.replace(/left|right|bottom|top/g,function(t){return yV[t]})}var vV={start:"end",end:"start"};function TI(n){return n.replace(/start|end/g,function(t){return vV[t]})}function BT(n){var t=Tl(n),o=t.pageXOffset,u=t.pageYOffset;return{scrollLeft:o,scrollTop:u}}function NT(n){return lg(of(n)).left+BT(n).scrollLeft}function xV(n,t){var o=Tl(n),u=of(n),d=o.visualViewport,_=u.clientWidth,x=u.clientHeight,s=0,A=0;if(d){_=d.width,x=d.height;var P=Z4();(P||!P&&t==="fixed")&&(s=d.offsetLeft,A=d.offsetTop)}return{width:_,height:x,x:s+NT(n),y:A}}function bV(n){var t,o=of(n),u=BT(n),d=(t=n.ownerDocument)==null?void 0:t.body,_=bp(o.scrollWidth,o.clientWidth,d?d.scrollWidth:0,d?d.clientWidth:0),x=bp(o.scrollHeight,o.clientHeight,d?d.scrollHeight:0,d?d.clientHeight:0),s=-u.scrollLeft+NT(n),A=-u.scrollTop;return Ih(d||o).direction==="rtl"&&(s+=bp(o.clientWidth,d?d.clientWidth:0)-_),{width:_,height:x,x:s,y:A}}function VT(n){var t=Ih(n),o=t.overflow,u=t.overflowX,d=t.overflowY;return/auto|scroll|overlay|hidden/.test(o+d+u)}function ek(n){return["html","body","#document"].indexOf(Au(n))>=0?n.ownerDocument.body:ec(n)&&VT(n)?n:ek(n1(n))}function cy(n,t){var o;t===void 0&&(t=[]);var u=ek(n),d=u===((o=n.ownerDocument)==null?void 0:o.body),_=Tl(u),x=d?[_].concat(_.visualViewport||[],VT(u)?u:[]):u,s=t.concat(x);return d?s:s.concat(cy(n1(x)))}function x2(n){return Object.assign({},n,{left:n.x,top:n.y,right:n.x+n.width,bottom:n.y+n.height})}function wV(n,t){var o=lg(n,!1,t==="fixed");return o.top=o.top+n.clientTop,o.left=o.left+n.clientLeft,o.bottom=o.top+n.clientHeight,o.right=o.left+n.clientWidth,o.width=n.clientWidth,o.height=n.clientHeight,o.x=o.left,o.y=o.top,o}function SI(n,t,o){return t===PT?x2(xV(n,o)):Ip(t)?wV(t,o):x2(bV(of(n)))}function TV(n){var t=cy(n1(n)),o=["absolute","fixed"].indexOf(Ih(n).position)>=0,u=o&&ec(n)?Uy(n):n;return Ip(u)?t.filter(function(d){return Ip(d)&&X4(d,u)&&Au(d)!=="body"}):[]}function SV(n,t,o,u){var d=t==="clippingParents"?TV(n):[].concat(t),_=[].concat(d,[o]),x=_[0],s=_.reduce(function(A,P){var R=SI(n,P,u);return A.top=bp(R.top,A.top),A.right=Sx(R.right,A.right),A.bottom=Sx(R.bottom,A.bottom),A.left=bp(R.left,A.left),A},SI(n,x,u));return s.width=s.right-s.left,s.height=s.bottom-s.top,s.x=s.left,s.y=s.top,s}function tk(n){var t=n.reference,o=n.element,u=n.placement,d=u?Tu(u):null,_=u?cg(u):null,x=t.x+t.width/2-o.width/2,s=t.y+t.height/2-o.height/2,A;switch(d){case Aa:A={x,y:t.y-o.height};break;case bl:A={x,y:t.y+t.height};break;case wl:A={x:t.x+t.width,y:s};break;case Ca:A={x:t.x-o.width,y:s};break;default:A={x:t.x,y:t.y}}var P=d?OT(d):null;if(P!=null){var R=P==="y"?"height":"width";switch(_){case Cp:A[P]=A[P]-(t[R]/2-o[R]/2);break;case og:A[P]=A[P]+(t[R]/2-o[R]/2);break}}return A}function ug(n,t){t===void 0&&(t={});var o=t,u=o.placement,d=u===void 0?n.placement:u,_=o.strategy,x=_===void 0?n.strategy:_,s=o.boundary,A=s===void 0?z4:s,P=o.rootBoundary,R=P===void 0?PT:P,V=o.elementContext,j=V===void 0?Hm:V,Q=o.altBoundary,me=Q===void 0?!1:Q,re=o.padding,be=re===void 0?0:re,ve=K4(typeof be!="number"?be:J4(be,xg)),Ee=j===Hm?F4:Hm,je=n.rects.popper,Ve=n.elements[me?Ee:j],Je=SV(Ip(Ve)?Ve:Ve.contextElement||of(n.elements.popper),A,R,x),vt=lg(n.elements.reference),_t=tk({reference:vt,element:je,strategy:"absolute",placement:d}),Mt=x2(Object.assign({},je,_t)),At=j===Hm?Mt:vt,ei={top:Je.top-At.top+ve.top,bottom:At.bottom-Je.bottom+ve.bottom,left:Je.left-At.left+ve.left,right:At.right-Je.right+ve.right},Yt=n.modifiersData.offset;if(j===Hm&&Yt){var Zt=Yt[d];Object.keys(ei).forEach(function(yi){var Fi=[wl,bl].indexOf(yi)>=0?1:-1,ki=[Aa,bl].indexOf(yi)>=0?"y":"x";ei[yi]+=Zt[ki]*Fi})}return ei}function EV(n,t){t===void 0&&(t={});var o=t,u=o.placement,d=o.boundary,_=o.rootBoundary,x=o.padding,s=o.flipVariations,A=o.allowedAutoPlacements,P=A===void 0?DT:A,R=cg(u),V=R?s?y2:y2.filter(function(me){return cg(me)===R}):xg,j=V.filter(function(me){return P.indexOf(me)>=0});j.length===0&&(j=V);var Q=j.reduce(function(me,re){return me[re]=ug(n,{placement:re,boundary:d,rootBoundary:_,padding:x})[Tu(re)],me},{});return Object.keys(Q).sort(function(me,re){return Q[me]-Q[re]})}function AV(n){if(Tu(n)===i1)return[];var t=ex(n);return[TI(n),t,TI(t)]}function CV(n){var t=n.state,o=n.options,u=n.name;if(!t.modifiersData[u]._skip){for(var d=o.mainAxis,_=d===void 0?!0:d,x=o.altAxis,s=x===void 0?!0:x,A=o.fallbackPlacements,P=o.padding,R=o.boundary,V=o.rootBoundary,j=o.altBoundary,Q=o.flipVariations,me=Q===void 0?!0:Q,re=o.allowedAutoPlacements,be=t.options.placement,ve=Tu(be),Ee=ve===be,je=A||(Ee||!me?[ex(be)]:AV(be)),Ve=[be].concat(je).reduce(function(On,hn){return On.concat(Tu(hn)===i1?EV(t,{placement:hn,boundary:R,rootBoundary:V,padding:P,flipVariations:me,allowedAutoPlacements:re}):hn)},[]),Je=t.rects.reference,vt=t.rects.popper,_t=new Map,Mt=!0,At=Ve[0],ei=0;ei<Ve.length;ei++){var Yt=Ve[ei],Zt=Tu(Yt),yi=cg(Yt)===Cp,Fi=[Aa,bl].indexOf(Zt)>=0,ki=Fi?"width":"height",wi=ug(t,{placement:Yt,boundary:R,rootBoundary:V,altBoundary:j,padding:P}),Li=Fi?yi?wl:Ca:yi?bl:Aa;Je[ki]>vt[ki]&&(Li=ex(Li));var cn=ex(Li),vi=[];if(_&&vi.push(wi[Zt]<=0),s&&vi.push(wi[Li]<=0,wi[cn]<=0),vi.every(function(On){return On})){At=Yt,Mt=!1;break}_t.set(Yt,vi)}if(Mt)for(var Ue=me?3:1,Yn=function(hn){var Hi=Ve.find(function(Ct){var zt=_t.get(Ct);if(zt)return zt.slice(0,hn).every(function(ti){return ti})});if(Hi)return At=Hi,"break"},Ki=Ue;Ki>0;Ki--){var ps=Yn(Ki);if(ps==="break")break}t.placement!==At&&(t.modifiersData[u]._skip=!0,t.placement=At,t.reset=!0)}}const ik={name:"flip",enabled:!0,phase:"main",fn:CV,requiresIfExists:["offset"],data:{_skip:!1}};function EI(n,t,o){return o===void 0&&(o={x:0,y:0}),{top:n.top-t.height-o.y,right:n.right-t.width+o.x,bottom:n.bottom-t.height+o.y,left:n.left-t.width-o.x}}function AI(n){return[Aa,wl,bl,Ca].some(function(t){return n[t]>=0})}function IV(n){var t=n.state,o=n.name,u=t.rects.reference,d=t.rects.popper,_=t.modifiersData.preventOverflow,x=ug(t,{elementContext:"reference"}),s=ug(t,{altBoundary:!0}),A=EI(x,u),P=EI(s,d,_),R=AI(A),V=AI(P);t.modifiersData[o]={referenceClippingOffsets:A,popperEscapeOffsets:P,isReferenceHidden:R,hasPopperEscaped:V},t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-reference-hidden":R,"data-popper-escaped":V})}const nk={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:IV};function MV(n,t,o){var u=Tu(n),d=[Ca,Aa].indexOf(u)>=0?-1:1,_=typeof o=="function"?o(Object.assign({},t,{placement:n})):o,x=_[0],s=_[1];return x=x||0,s=(s||0)*d,[Ca,wl].indexOf(u)>=0?{x:s,y:x}:{x,y:s}}function PV(n){var t=n.state,o=n.options,u=n.name,d=o.offset,_=d===void 0?[0,0]:d,x=DT.reduce(function(R,V){return R[V]=MV(V,t.rects,_),R},{}),s=x[t.placement],A=s.x,P=s.y;t.modifiersData.popperOffsets!=null&&(t.modifiersData.popperOffsets.x+=A,t.modifiersData.popperOffsets.y+=P),t.modifiersData[u]=x}const sk={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:PV};function DV(n){var t=n.state,o=n.name;t.modifiersData[o]=tk({reference:t.rects.reference,element:t.rects.popper,strategy:"absolute",placement:t.placement})}const $T={name:"popperOffsets",enabled:!0,phase:"read",fn:DV,data:{}};function kV(n){return n==="x"?"y":"x"}function LV(n){var t=n.state,o=n.options,u=n.name,d=o.mainAxis,_=d===void 0?!0:d,x=o.altAxis,s=x===void 0?!1:x,A=o.boundary,P=o.rootBoundary,R=o.altBoundary,V=o.padding,j=o.tether,Q=j===void 0?!0:j,me=o.tetherOffset,re=me===void 0?0:me,be=ug(t,{boundary:A,rootBoundary:P,padding:V,altBoundary:R}),ve=Tu(t.placement),Ee=cg(t.placement),je=!Ee,Ve=OT(ve),Je=kV(Ve),vt=t.modifiersData.popperOffsets,_t=t.rects.reference,Mt=t.rects.popper,At=typeof re=="function"?re(Object.assign({},t.rects,{placement:t.placement})):re,ei=typeof At=="number"?{mainAxis:At,altAxis:At}:Object.assign({mainAxis:0,altAxis:0},At),Yt=t.modifiersData.offset?t.modifiersData.offset[t.placement]:null,Zt={x:0,y:0};if(vt){if(_){var yi,Fi=Ve==="y"?Aa:Ca,ki=Ve==="y"?bl:wl,wi=Ve==="y"?"height":"width",Li=vt[Ve],cn=Li+be[Fi],vi=Li-be[ki],Ue=Q?-Mt[wi]/2:0,Yn=Ee===Cp?_t[wi]:Mt[wi],Ki=Ee===Cp?-Mt[wi]:-_t[wi],ps=t.elements.arrow,On=Q&&ps?RT(ps):{width:0,height:0},hn=t.modifiersData["arrow#persistent"]?t.modifiersData["arrow#persistent"].padding:Y4(),Hi=hn[Fi],Ct=hn[ki],zt=ly(0,_t[wi],On[wi]),ti=je?_t[wi]/2-Ue-zt-Hi-ei.mainAxis:Yn-zt-Hi-ei.mainAxis,qi=je?-_t[wi]/2+Ue+zt+Ct+ei.mainAxis:Ki+zt+Ct+ei.mainAxis,ts=t.elements.arrow&&Uy(t.elements.arrow),Fe=ts?Ve==="y"?ts.clientTop||0:ts.clientLeft||0:0,Oe=(yi=Yt==null?void 0:Yt[Ve])!=null?yi:0,dt=Li+ti-Oe-Fe,$t=Li+qi-Oe,Ft=ly(Q?Sx(cn,dt):cn,Li,Q?bp(vi,$t):vi);vt[Ve]=Ft,Zt[Ve]=Ft-Li}if(s){var Wt,Ti=Ve==="x"?Aa:Ca,pi=Ve==="x"?bl:wl,di=vt[Je],ai=Je==="y"?"height":"width",on=di+be[Ti],Ci=di-be[pi],Bi=[Aa,Ca].indexOf(ve)!==-1,Gi=(Wt=Yt==null?void 0:Yt[Je])!=null?Wt:0,Vn=Bi?on:di-_t[ai]-Mt[ai]-Gi+ei.altAxis,Kn=Bi?di+_t[ai]+Mt[ai]-Gi-ei.altAxis:Ci,$n=Q&&Bi?uV(Vn,di,Kn):ly(Q?Vn:on,di,Q?Kn:Ci);vt[Je]=$n,Zt[Je]=$n-di}t.modifiersData[u]=Zt}}const rk={name:"preventOverflow",enabled:!0,phase:"main",fn:LV,requiresIfExists:["offset"]};function RV(n){return{scrollLeft:n.scrollLeft,scrollTop:n.scrollTop}}function OV(n){return n===Tl(n)||!ec(n)?BT(n):RV(n)}function zV(n){var t=n.getBoundingClientRect(),o=ag(t.width)/n.offsetWidth||1,u=ag(t.height)/n.offsetHeight||1;return o!==1||u!==1}function FV(n,t,o){o===void 0&&(o=!1);var u=ec(t),d=ec(t)&&zV(t),_=of(t),x=lg(n,d,o),s={scrollLeft:0,scrollTop:0},A={x:0,y:0};return(u||!u&&!o)&&((Au(t)!=="body"||VT(_))&&(s=OV(t)),ec(t)?(A=lg(t,!0),A.x+=t.clientLeft,A.y+=t.clientTop):_&&(A.x=NT(_))),{x:x.left+s.scrollLeft-A.x,y:x.top+s.scrollTop-A.y,width:x.width,height:x.height}}function BV(n){var t=new Map,o=new Set,u=[];n.forEach(function(_){t.set(_.name,_)});function d(_){o.add(_.name);var x=[].concat(_.requires||[],_.requiresIfExists||[]);x.forEach(function(s){if(!o.has(s)){var A=t.get(s);A&&d(A)}}),u.push(_)}return n.forEach(function(_){o.has(_.name)||d(_)}),u}function NV(n){var t=BV(n);return q4.reduce(function(o,u){return o.concat(t.filter(function(d){return d.phase===u}))},[])}function VV(n){var t;return function(){return t||(t=new Promise(function(o){Promise.resolve().then(function(){t=void 0,o(n())})})),t}}function $V(n){var t=n.reduce(function(o,u){var d=o[u.name];return o[u.name]=d?Object.assign({},d,u,{options:Object.assign({},d.options,u.options),data:Object.assign({},d.data,u.data)}):u,o},{});return Object.keys(t).map(function(o){return t[o]})}var CI={placement:"bottom",modifiers:[],strategy:"absolute"};function II(){for(var n=arguments.length,t=new Array(n),o=0;o<n;o++)t[o]=arguments[o];return!t.some(function(u){return!(u&&typeof u.getBoundingClientRect=="function")})}function s1(n){n===void 0&&(n={});var t=n,o=t.defaultModifiers,u=o===void 0?[]:o,d=t.defaultOptions,_=d===void 0?CI:d;return function(s,A,P){P===void 0&&(P=_);var R={placement:"bottom",orderedModifiers:[],options:Object.assign({},CI,_),modifiersData:{},elements:{reference:s,popper:A},attributes:{},styles:{}},V=[],j=!1,Q={state:R,setOptions:function(ve){var Ee=typeof ve=="function"?ve(R.options):ve;re(),R.options=Object.assign({},_,R.options,Ee),R.scrollParents={reference:Ip(s)?cy(s):s.contextElement?cy(s.contextElement):[],popper:cy(A)};var je=NV($V([].concat(u,R.options.modifiers)));return R.orderedModifiers=je.filter(function(Ve){return Ve.enabled}),me(),Q.update()},forceUpdate:function(){if(!j){var ve=R.elements,Ee=ve.reference,je=ve.popper;if(II(Ee,je)){R.rects={reference:FV(Ee,Uy(je),R.options.strategy==="fixed"),popper:RT(je)},R.reset=!1,R.placement=R.options.placement,R.orderedModifiers.forEach(function(ei){return R.modifiersData[ei.name]=Object.assign({},ei.data)});for(var Ve=0;Ve<R.orderedModifiers.length;Ve++){if(R.reset===!0){R.reset=!1,Ve=-1;continue}var Je=R.orderedModifiers[Ve],vt=Je.fn,_t=Je.options,Mt=_t===void 0?{}:_t,At=Je.name;typeof vt=="function"&&(R=vt({state:R,options:Mt,name:At,instance:Q})||R)}}}},update:VV(function(){return new Promise(function(be){Q.forceUpdate(),be(R)})}),destroy:function(){re(),j=!0}};if(!II(s,A))return Q;Q.setOptions(P).then(function(be){!j&&P.onFirstUpdate&&P.onFirstUpdate(be)});
vendor: 4,013 bytes, lines 21-25
21function me(){R.orderedModifiers.forEach(function(be){var ve=be.name,Ee=be.options,je=Ee===void 0?{}:Ee,Ve=be.effect;if(typeof Ve=="function"){var Je=Ve({state:R,name:ve,instance:Q,options:je}),vt=function(){};V.push(Je||vt)}})}function re(){V.forEach(function(be){return be()}),V=[]}return Q}}var jV=s1(),UV=[FT,$T,zT,LT],HV=s1({defaultModifiers:UV}),GV=[FT,$T,zT,LT,sk,ik,rk,Q4,nk],jT=s1({defaultModifiers:GV});const ok=Object.freeze(Object.defineProperty({__proto__:null,afterMain:U4,afterRead:V4,afterWrite:W4,applyStyles:LT,arrow:Q4,auto:i1,basePlacements:xg,beforeMain:$4,beforeRead:B4,beforeWrite:H4,bottom:bl,clippingParents:z4,computeStyles:zT,createPopper:jT,createPopperBase:jV,createPopperLite:HV,detectOverflow:ug,end:og,eventListeners:FT,flip:ik,hide:nk,left:Ca,main:j4,modifierPhases:q4,offset:sk,placements:DT,popper:Hm,popperGenerator:s1,popperOffsets:$T,preventOverflow:rk,read:N4,reference:F4,right:wl,start:Cp,top:Aa,variationPlacements:y2,viewport:PT,write:G4},Symbol.toStringTag,{value:"Module"}));/*! 22 * Bootstrap v5.3.3 (https://getbootstrap.com/) 23 * Copyright 2011-2024 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors) 24 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) 25 */const kd=new Map,mw={set(n,t,o){kd.has(n)||kd.set(n,new Map);const u=kd.get(n);if(!u.has(t)&&u.size!==0){console.error(`Bootstrap doesn't allow more than one instance per element. Bound instance: ${Array.from(u.keys())[0]}.`);return}u.set(t,o)},get(n,t){return kd.has(n)&&kd.get(n).get(t)||null},remove(n,t){if(!kd.has(n))return;const o=kd.get(n);o.delete(t),o.size===0&&kd.delete(n)}},WV=1e6,qV=1e3,b2="transitionend",ak=n=>(n&&window.CSS&&window.CSS.escape&&(n=n.replace(/#([^\s"#']+)/g,(t,o)=>`#${CSS.escape(o)}`)),n),ZV=n=>n==null?`${n}`:Object.prototype.toString.call(n).match(/\s([a-z]+)/i)[1].toLowerCase(),XV=n=>{do n+=Math.floor(Math.random()*WV);while(document.getElementById(n));return n},YV=n=>{if(!n)return 0;let{transitionDuration:t,transitionDelay:o}=window.getComputedStyle(n);const u=Number.parseFloat(t),d=Number.parseFloat(o);return!u&&!d?0:(t=t.split(",")[0],o=o.split(",")[0],(Number.parseFloat(t)+Number.parseFloat(o))*qV)},lk=n=>{n.dispatchEvent(new Event(b2))},Ah=n=>!n||typeof n!="object"?!1:(typeof n.jquery<"u"&&(n=n[0]),typeof n.nodeType<"u"),Zd=n=>Ah(n)?n.jquery?n[0]:n:typeof n=="string"&&n.length>0?document.querySelector(ak(n)):null,bg=n=>{if(!Ah(n)||n.getClientRects().length===0)return!1;const t=getComputedStyle(n).getPropertyValue("visibility")==="visible",o=n.closest("details:not([open])");if(!o)return t;if(o!==n){const u=n.closest("summary");if(u&&u.parentNode!==o||u===null)return!1}return t},Xd=n=>!n||n.nodeType!==Node.ELEMENT_NODE||n.classList.contains("disabled")?!0:typeof n.disabled<"u"?n.disabled:n.hasAttribute("disabled")&&n.getAttribute("disabled")!=="false",ck=n=>{if(!document.documentElement.attachShadow)return null;if(typeof n.getRootNode=="function"){const t=n.getRootNode();return t instanceof ShadowRoot?t:null}return n instanceof ShadowRoot?n:n.parentNode?ck(n.parentNode):null},Ex=()=>{},Hy=n=>{n.offsetHeight},uk=()=>window.jQuery&&!document.body.hasAttribute("data-bs-no-jquery")?window.jQuery:null,gw=[],KV=n=>{document.readyState==="loading"?(gw.length||document.addEventListener("DOMContentLoaded",()=>{for(const t of gw)t()}),gw.push(n)):n()},nc=()=>document.documentElement.dir==="rtl",rc=n=>{KV(()=>{const t=uk();if(t){const o=n.NAME,u=t.fn[o];t.fn[o]=n.jQueryInterface,t.fn[o].Constructor=n,t.fn[o].noConflict=()=>(t.fn[o]=u,n.jQueryInterface)}})},Ga=(n,t=[],o=n)=>typeof n=="function"?n(...t):o,hk=(n,t,o=!0)=>{if(!o){Ga(n);return}const d=YV(t)+5;let _=!1;const x=({target:s})=>{s===t&&(_=!0,t.removeEventListener(b2,x),Ga(n))};t.addEventListener(b2,x),setTimeout(()=>{_||lk(t)},d)},UT=(n,t,o,u)=>{const d=n.length;let _=n.indexOf(t);return _===-1?!o&&u?n[d-1]:n[0]:(_+=o?1:-1,u&&(_=(_+d)%d),n[Math.max(0,Math.min(_,d-1))])},JV=/[^.]*(?=\..*)\.|.*/,QV=/\..*/,e7=/::\d+$/,_w={};let MI=1;
25const dk={mouseenter:"mouseover",mouseleave:"mouseout"},t7=new Set(["click","dblclick","mouseup","mousedown","contextmenu","mousewheel","DOMMouseScroll","mouseover","mouseout","mousemove","selectstart","selectend","keydown","keypress","keyup","orientationchange","touchstart","touchmove","touchend","touchcancel","pointerdown","pointermove","pointerup","pointerleave","pointercancel","gesturestart","gesturechange","gestureend","focus","blur","change","reset","select","submit","focusin","focusout","load","unload","beforeunload","resize","move","DOMContentLoaded","readystatechange","error","abort","scroll"]);function fk(n,t){return t&&`${t}::${MI++}`||n.uidEvent||MI++}function pk(n){const t=fk(n);return n.uidEvent=t,_w[t]=_w[t]||{},_w[t]}function i7(n,t){return function o(u){return HT(u,{delegateTarget:n}),o.oneOff&&fi.off(n,u.type,t),t.apply(n,[u])}}function n7(n,t,o){return function u(d){const _=n.querySelectorAll(t);for(let{target:x}=d;x&&x!==this;x=x.parentNode)for(const s of _)if(s===x)return HT(d,{delegateTarget:x}),u.oneOff&&fi.off(n,d.type,t,o),o.apply(x,[d])}}function mk(n,t,o=null){return Object.values(n).find(u=>u.callable===t&&u.delegationSelector===o)}function gk(n,t,o){const u=typeof t=="string",d=u?o:t||o;let _=_k(n);return t7.has(_)||(_=n),[u,d,_]}function PI(n,t,o,u,d){if(typeof t!="string"||!n)return;let[_,x,s]=gk(t,o,u);t in dk&&(x=(me=>function(re){if(!re.relatedTarget||re.relatedTarget!==re.delegateTarget&&!re.delegateTarget.contains(re.relatedTarget))return me.call(this,re)})(x));const A=pk(n),P=A[s]||(A[s]={}),R=mk(P,x,_?o:null);if(R){R.oneOff=R.oneOff&&d;return}const V=fk(x,t.replace(JV,"")),j=_?n7(n,o,x):i7(n,x);j.delegationSelector=_?o:null,j.callable=x,j.oneOff=d,j.uidEvent=V,P[V]=j,n.addEventListener(s,j,_)}function w2(n,t,o,u,d){const _=mk(t[o],u,d);_&&(n.removeEventListener(o,_,!!d),delete t[o][_.uidEvent])}function s7(n,t,o,u){const d=t[o]||{};for(const[_,x]of Object.entries(d))_.includes(u)&&w2(n,t,o,x.callable,x.delegationSelector)}function _k(n){return n=n.replace(QV,""),dk[n]||n}const fi={on(n,t,o,u){PI(n,t,o,u,!1)},one(n,t,o,u){PI(n,t,o,u,!0)},off(n,t,o,u){if(typeof t!="string"||!n)return;const[d,_,x]=gk(t,o,u),s=x!==t,A=pk(n),P=A[x]||{},R=t.startsWith(".");if(typeof _<"u"){if(!Object.keys(P).length)return;w2(n,A,x,_,d?o:null);return}if(R)for(const V of Object.keys(A))s7(n,A,V,t.slice(1));for(const[V,j]of Object.entries(P)){const Q=V.replace(e7,"");(!s||t.includes(Q))&&w2(n,A,x,j.callable,j.delegationSelector)}},trigger(n,t,o){if(typeof t!="string"||!n)return null;const u=uk(),d=_k(t),_=t!==d;let x=null,s=!0,A=!0,P=!1;_&&u&&(x=u.Event(t,o),u(n).trigger(x),s=!x.isPropagationStopped(),A=!x.isImmediatePropagationStopped(),P=x.isDefaultPrevented());const R=HT(new Event(t,{bubbles:s,cancelable:!0}),o);return P&&R.preventDefault(),A&&n.dispatchEvent(R),R.defaultPrevented&&x&&x.preventDefault(),R}};function HT(n,t={}){for(const[o,u]of Object.entries(t))try{n[o]=u}catch{Object.defineProperty(n,o,{configurable:!0,get(){return u}})}return n}function DI(n){if(n==="true")return!0;if(n==="false")return!1;if(n===Number(n).toString())return Number(n);if(n===""||n==="null")return null;if(typeof n!="string")return n;try{return JSON.parse(decodeURIComponent(n))}catch{return n}}function yw(n){return n.replace(/[A-Z]/g,t=>`-${t.toLowerCase()}`)}const Ch={setDataAttribute(n,t,o){n.setAttribute(`data-bs-${yw(t)}`,o)},removeDataAttribute(n,t){n.removeAttribute(`data-bs-${yw(t)}`)},getDataAttributes(n){if(!n)return{};const t={},o=Object.keys(n.dataset).filter(u=>u.startsWith("bs")&&!u.startsWith("bsConfig"));for(const u of o){let d=u.replace(/^bs/,"");d=d.charAt(0).toLowerCase()+d.slice(1,d.length),t[d]=DI(n.dataset[u])}return t},getDataAttribute(n,t){return DI(n.getAttribute(`data-bs-${yw(t)}`))}};let Gy=class{static get Default(){return{}}static get DefaultType(){return{}}static get NAME(){throw new Error('You have to implement the static method "NAME", for each component!')}_getConfig(t){return t=this._mergeConfigObj(t),t=this._configAfterMerge(t),this._typeCheckConfig(t),t}_configAfterMerge(t){return t}_mergeConfigObj(t,o){const u=Ah(o)?Ch.getDataAttribute(o,"config"):{};return{...this.constructor.Default,...typeof u=="object"?u:{},...Ah(o)?Ch.getDataAttributes(o):{},...typeof t=="object"?t:{}}}_typeCheckConfig(t,o=this.constructor.DefaultType){for(const[u,d]of Object.entries(o)){const _=t[u],x=Ah(_)?"element":ZV(_);if(!new RegExp(d).test(x))throw new TypeError(`${this.constructor.NAME.toUpperCase()}: Option "${u}" provided type "${x}" but expected type "${d}".`)}}};const r7="5.3.3";class Nc extends Gy{constructor(t,o){super(),t=Zd(t),t&&(this._element=t,this._config=this._getConfig(o),mw.set(this._element,this.constructor.DATA_KEY,this))}dispose(){mw.remove(this._element,this.constructor.DATA_KEY),fi.off(this._element,this.constructor.EVENT_KEY);for(const t of Object.getOwnPropertyNames(this))this[t]=null}_queueCallback(t,o,u=!0){hk(t,o,u)}_getConfig(t){return t=this._mergeConfigObj(t,this._element),t=this._configAfterMerge(t),this._typeCheckConfig(t),t}static getInstance(t){return mw.get(Zd(t),this.DATA_KEY)}static getOrCreateInstance(t,o={}){return this.getInstance(t)||new this(t,typeof o=="object"?o:null)}static get VERSION(){return r7}static get DATA_KEY(){return`bs.${this.NAME}`}static get EVENT_KEY(){return`.${this.DATA_KEY}`}static eventName(t){return`${t}${this.EVENT_KEY}`}}const vw=n=>{let t=n.getAttribute("data-bs-target");if(!t||t==="#"){let o=n.getAttribute("href");if(!o||!o.includes("#")&&!o.startsWith("."))return null;o.includes("#")&&!o.startsWith("#")&&(o=`#${o.split("#")[1]}`),t=o&&o!=="#"?o.trim():null}return t?t.split(",").map(o=>ak(o)).join(","):null},Mn={find(n,t=document.documentElement){return[].concat(...Element.prototype.querySelectorAll.call(t,n))},findOne(n,t=document.documentElement){return Element.prototype.querySelector.call(t,n)},children(n,t){return[].concat(...n.children).filter(o=>o.matches(t))},parents(n,t){const o=[];let u=n.parentNode.closest(t);for(;u;)o.push(u),u=u.parentNode.closest(t);return o},prev(n,t){let o=n.previousElementSibling;for(;o;){if(o.matches(t))return[o];o=o.previousElementSibling}return[]},next(n,t){let o=n.nextElementSibling;for(;o;){if(o.matches(t))return[o];o=o.nextElementSibling}return[]},focusableChildren(n){const t=["a","button","input","textarea","select","details","[tabindex]",'[contenteditable="true"]'].map(o=>`${o}
25:not([tabindex^="-"])`).join(",");return this.find(t,n).filter(o=>!Xd(o)&&bg(o))},getSelectorFromElement(n){const t=vw(n);return t&&Mn.findOne(t)?t:null},getElementFromSelector(n){const t=vw(n);return t?Mn.findOne(t):null},getMultipleElementsFromSelector(n){const t=vw(n);return t?Mn.find(t):[]}},r1=(n,t="hide")=>{const o=`click.dismiss${n.EVENT_KEY}`,u=n.NAME;fi.on(document,o,`[data-bs-dismiss="${u}"]`,function(d){if(["A","AREA"].includes(this.tagName)&&d.preventDefault(),Xd(this))return;const _=Mn.getElementFromSelector(this)||this.closest(`.${u}`);n.getOrCreateInstance(_)[t]()})},o7="alert",a7="bs.alert",yk=`.${a7}`,l7=`close${yk}`,c7=`closed${yk}`,u7="fade",h7="show";class o1 extends Nc{static get NAME(){return o7}close(){if(fi.trigger(this._element,l7).defaultPrevented)return;this._element.classList.remove(h7);const o=this._element.classList.contains(u7);this._queueCallback(()=>this._destroyElement(),this._element,o)}_destroyElement(){this._element.remove(),fi.trigger(this._element,c7),this.dispose()}static jQueryInterface(t){return this.each(function(){const o=o1.getOrCreateInstance(this);if(typeof t=="string"){if(o[t]===void 0||t.startsWith("_")||t==="constructor")throw new TypeError(`No method named "${t}"`);o[t](this)}})}}r1(o1,"close");rc(o1);const d7="button",f7="bs.button",p7=`.${f7}`,m7=".data-api",g7="active",kI='[data-bs-toggle="button"]',_7=`click${p7}${m7}`;class a1 extends Nc{static get NAME(){return d7}toggle(){this._element.setAttribute("aria-pressed",this._element.classList.toggle(g7))}static jQueryInterface(t){return this.each(function(){const o=a1.getOrCreateInstance(this);t==="toggle"&&o[t]()})}}fi.on(document,_7,kI,n=>{n.preventDefault();const t=n.target.closest(kI);a1.getOrCreateInstance(t).toggle()});rc(a1);const y7="swipe",wg=".bs.swipe",v7=`touchstart${wg}`,x7=`touchmove${wg}`,b7=`touchend${wg}`,w7=`pointerdown${wg}`,T7=`pointerup${wg}`,S7="touch",E7="pen",A7="pointer-event",C7=40,I7={endCallback:null,leftCallback:null,rightCallback:null},M7={endCallback:"(function|null)",leftCallback:"(function|null)",rightCallback:"(function|null)"};class Ax extends Gy{constructor(t,o){super(),this._element=t,!(!t||!Ax.isSupported())&&(this._config=this._getConfig(o),this._deltaX=0,this._supportPointerEvents=!!window.PointerEvent,this._initEvents())}static get Default(){return I7}static get DefaultType(){return M7}static get NAME(){return y7}dispose(){fi.off(this._element,wg)}_start(t){if(!this._supportPointerEvents){this._deltaX=t.touches[0].clientX;return}this._eventIsPointerPenTouch(t)&&(this._deltaX=t.clientX)}_end(t){this._eventIsPointerPenTouch(t)&&(this._deltaX=t.clientX-this._deltaX),this._handleSwipe(),Ga(this._config.endCallback)}_move(t){this._deltaX=t.touches&&t.touches.length>1?0:t.touches[0].clientX-this._deltaX}_handleSwipe(){const t=Math.abs(this._deltaX);if(t<=C7)return;const o=t/this._deltaX;this._deltaX=0,o&&Ga(o>0?this._config.rightCallback:this._config.leftCallback)}_initEvents(){this._supportPointerEvents?(fi.on(this._element,w7,t=>this._start(t)),fi.on(this._element,T7,t=>this._end(t)),this._element.classList.add(A7)):(fi.on(this._element,v7,t=>this._start(t)),fi.on(this._element,x7,t=>this._move(t)),fi.on(this._element,b7,t=>this._end(t)))}_eventIsPointerPenTouch(t){return this._supportPointerEvents&&(t.pointerType===E
vendor: 4,839 bytes, line 25
257||t.pointerType===S7)}static isSupported(){return"ontouchstart"in document.documentElement||navigator.maxTouchPoints>0}}const P7="carousel",D7="bs.carousel",af=`.${D7}`,vk=".data-api",k7="ArrowLeft",L7="ArrowRight",R7=500,F_="next",Bm="prev",Gm="left",tx="right",O7=`slide${af}`,xw=`slid${af}`,z7=`keydown${af}`,F7=`mouseenter${af}`,B7=`mouseleave${af}`,N7=`dragstart${af}`,V7=`load${af}${vk}`,$7=`click${af}${vk}`,xk="carousel",Tv="active",j7="slide",U7="carousel-item-end",H7="carousel-item-start",G7="carousel-item-next",W7="carousel-item-prev",bk=".active",wk=".carousel-item",q7=bk+wk,Z7=".carousel-item img",X7=".carousel-indicators",Y7="[data-bs-slide], [data-bs-slide-to]",K7='[data-bs-ride="carousel"]',J7={[k7]:tx,[L7]:Gm},Q7={interval:5e3,keyboard:!0,pause:"hover",ride:!1,touch:!0,wrap:!0},e9={interval:"(number|boolean)",keyboard:"boolean",pause:"(string|boolean)",ride:"(boolean|string)",touch:"boolean",wrap:"boolean"};class Wy extends Nc{constructor(t,o){super(t,o),this._interval=null,this._activeElement=null,this._isSliding=!1,this.touchTimeout=null,this._swipeHelper=null,this._indicatorsElement=Mn.findOne(X7,this._element),this._addEventListeners(),this._config.ride===xk&&this.cycle()}static get Default(){return Q7}static get DefaultType(){return e9}static get NAME(){return P7}next(){this._slide(F_)}nextWhenVisible(){!document.hidden&&bg(this._element)&&this.next()}prev(){this._slide(Bm)}pause(){this._isSliding&&lk(this._element),this._clearInterval()}cycle(){this._clearInterval(),this._updateInterval(),this._interval=setInterval(()=>this.nextWhenVisible(),this._config.interval)}_maybeEnableCycle(){if(this._config.ride){if(this._isSliding){fi.one(this._element,xw,()=>this.cycle());return}this.cycle()}}to(t){const o=this._getItems();if(t>o.length-1||t<0)return;if(this._isSliding){fi.one(this._element,xw,()=>this.to(t));return}const u=this._getItemIndex(this._getActive());if(u===t)return;const d=t>u?F_:Bm;this._slide(d,o[t])}dispose(){this._swipeHelper&&this._swipeHelper.dispose(),super.dispose()}_configAfterMerge(t){return t.defaultInterval=t.interval,t}_addEventListeners(){this._config.keyboard&&fi.on(this._element,z7,t=>this._keydown(t)),this._config.pause==="hover"&&(fi.on(this._element,F7,()=>this.pause()),fi.on(this._element,B7,()=>this._maybeEnableCycle())),this._config.touch&&Ax.isSupported()&&this._addTouchEventListeners()}_addTouchEventListeners(){for(const u of Mn.find(Z7,this._element))fi.on(u,N7,d=>d.preventDefault());const o={leftCallback:()=>this._slide(this._directionToOrder(Gm)),rightCallback:()=>this._slide(this._directionToOrder(tx)),endCallback:()=>{this._config.pause==="hover"&&(this.pause(),this.touchTimeout&&clearTimeout(this.touchTimeout),this.touchTimeout=setTimeout(()=>this._maybeEnableCycle(),R7+this._config.interval))}};this._swipeHelper=new Ax(this._element,o)}_keydown(t){if(/input|textarea/i.test(t.target.tagName))return;const o=J7[t.key];o&&(t.preventDefault(),this._slide(this._directionToOrder(o)))}_getItemIndex(t){return this._getItems().indexOf(t)}_setActiveIndicatorElement(t){if(!this._indicatorsElement)return;const o=Mn.findOne(bk,this._indicatorsElement);o.classList.remove(Tv),o.removeAttribute("aria-current");const u=Mn.findOne(`[data-bs-slide-to="${t}"]`,this._indicatorsElement);u&&(u.classList.add(Tv),u.setAttribute("aria-current","true"))}_updateInterval(){const t=this._activeElement||this._getActive();if(!t)return;const o=Number.parseInt(t.getAttribute("data-bs-interval"),10);this._config.interval=o||this._config.defaultInterval}_slide(t,o=null){if(this._isSliding)return;const u=this._getActive(),d=t===F_,_=o||UT(this._getItems(),u,d,this._config.wrap);if(_===u)return;const x=this._getItemIndex(_),s=Q=>fi.trigger(this._element,Q,{relatedTarget:_,direction:this._orderToDirection(t),from:this._getItemIndex(u),to:x});if(s(O7).defaultPrevented||!u||!_)return;const P=!!this._interval;this.pause(),this._isSliding=!0,this._setActiveIndicatorElement(x),this._activeElement=_;const R=d?H7:U7,V=d?G7:W7;_.classList.add(V),Hy(_),u.classList.add(R),_.classList.add(R);const j=()=>{_.classList.remove(R,V),_.classList.add(Tv),u.classList.remove(Tv,V,R),this._isSliding=!1,s(xw)};this._queueCallback(j,u,this._isAnimated()),P&&this.cycle()}_isAnimated(){return this._element.classList.contains(j7)}_getActive(){return Mn.findOne(q7,this._element)}_getItems(){return Mn.find(wk,this._element)}_clearInterval(){this._interval&&(clearInterval(this._interval),this._interval=null)}_directionToOrder(t){return nc()?t===Gm?Bm:F_:t===Gm?F_:Bm}_orderToDirection(t){return nc()?t===Bm?Gm:tx:t===Bm?tx:Gm}static jQueryInterface(t){return this.each(function(){const o=Wy.getOrCreateInstance(this,t);if(typeof t=="number"){o.to(t);return}if(typeof t=="string"){if(o[t]===void 0||t.startsWith("_")||t==="constructor")throw new TypeError(`No method n
25amed "${t}"`);o[t]()}})}}fi.on(document,$7,Y7,function(n){const t=Mn.getElementFromSelector(this);if(!t||!t.classList.contains(xk))return;n.preventDefault();const o=Wy.getOrCreateInstance(t),u=this.getAttribute("data-bs-slide-to");if(u){o.to(u),o._maybeEnableCycle();return}if(Ch.getDataAttribute(this,"slide")==="next"){o.next(),o._maybeEnableCycle();return}o.prev(),o._maybeEnableCycle()});fi.on(window,V7,()=>{const n=Mn.find(K7);for(const t of n)Wy.getOrCreateInstance(t)});rc(Wy);const t9="collapse",i9="bs.collapse",qy=`.${i9}`,n9=".data-api",s9=`show${qy}`,r9=`shown${qy}`,o9=`hide${qy}`,a9=`hidden${qy}`,l9=`click${qy}${n9}`,bw="show",qm="collapse",Sv="collapsing",c9="collapsed",u9=`:scope .${qm} .${qm}`,h9="collapse-horizontal",d9="width",f9="height",p9=".collapse.show, .collapse.collapsing",T2='[data-bs-toggle="collapse"]',m9={parent:null,toggle:!0},g9={parent:"(null|element)",toggle:"boolean"};class Cy extends Nc{constructor(t,o){super(t,o),this._isTransitioning=!1,this._triggerArray=[];const u=Mn.find(T2);for(const d of u){const _=Mn.getSelectorFromElement(d),x=Mn.find(_).filter(s=>s===this._element);_!==null&&x.length&&this._triggerArray.push(d)}this._initializeChildren(),this._config.parent||this._addAriaAndCollapsedClass(this._triggerArray,this._isShown()),this._config.toggle&&this.toggle()}static get Default(){return m9}static get DefaultType(){return g9}static get NAME(){return t9}toggle(){this._isShown()?this.hide():this.show()}show(){if(this._isTransitioning||this._isShown())return;let t=[];if(this._config.parent&&(t=this._getFirstLevelChildren(p9).filter(s=>s!==this._element).map(s=>Cy.getOrCreateInstance(s,{toggle:!1}))),t.length&&t[0]._isTransitioning||fi.trigger(this._element,s9).defaultPrevented)return;for(const s of t)s.hide();const u=this._getDimension();this._element.classList.remove(qm),this._element.classList.add(Sv),this._element.style[u]=0,this._addAriaAndCollapsedClass(this._triggerArray,!0),this._isTransitioning=!0;const d=()=>{this._isTransitioning=!1,this._element.classList.remove(Sv),this._element.classList.add(qm,bw),this._element.style[u]="",fi.trigger(this._element,r9)},x=`scroll${u[0].toUpperCase()+u.slice(1)}`;this._queueCallback(d,this._element,!0),this._element.style[u]=`${this._element[x]}px`}hide(){if(this._isTransitioning||!this._isShown()||fi.trigger(this._element,o9).defaultPrevented)return;const o=this._getDimension();this._element.style[o]=`${this._element.getBoundingClientRect()[o]}px`,Hy(this._element),this._element.classList.add(Sv),this._element.classList.remove(qm,bw);for(const d of this._triggerArray){const _=Mn.getElementFromSelector(d);_&&!this._isShown(_)&&this._addAriaAndCollapsedClass([d],!1)}this._isTransitioning=!0;const u=()=>{this._isTransitioning=!1,this._element.classList.remove(Sv),this._element.classList.add(qm),fi.trigger(this._element,a9)};this._element.style[o]="",this._queueCallback(u,this._element,!0)}_isShown(t=this._element){return t.classList.contains(bw)}_configAfterMerge(t){return t.toggle=!!t.toggle,t.parent=Zd(t.parent),t}_getDimension(){return this._element.classList.contains(h9)?d9:f9}_initializeChildren(){if(!this._config.parent)return;const t=this._getFirstLevelChildren(T2);for(const o of t){const u=Mn.getElementFromSelector(o);u&&this._addAriaAndCollapsedClass([o],this._isShown(u))}}_getFirstLevelChildren(t){const o=Mn.find(u9,this._config.parent);return Mn.find(t,this._config.parent).filter(u=>!o.includes(u))}_addAriaAndCollapsedClass(t,o){if(t.length)for(const u of t)u.classList.toggle(c9,!o),u.setAttribute("aria-expanded",o)}static jQueryInterface(t){const o={};return typeof t=="string"&&/show|hide/.test(t)&&(o.toggle=!1),this.each(function(){const u=Cy.getOrCreateInstance(this,o);if(typeof t=="string"){if(typeof u[t]>"u")throw new TypeError(`No method named "${t}"`);u[t]()}})}}fi.on(document,l9,T2,function(n){(n.target.tagName==="A"||n.delegateTarget&&n.delegateTarget.tagName==="A")&&n.preventDefault();for(const t of Mn.getMultipleElementsFromSelector(this))Cy.getOrCreateInstance(t,{toggle:!1}).toggle()});rc(Cy);const LI="dropdown",_9="bs.dropdown",Op=`.${_9}`,GT=".data-api",y9="Escape",RI="Tab",v9="ArrowUp",OI="ArrowDown",x9=2,b9=`hide${Op}`,w9=`hidden${Op}`,T9=`show${Op}`,S9=`shown${Op}`,Tk=`click${Op}${GT}`,Sk=`keydown${Op}${GT}`,E9=`keyup${Op}${GT}`,Wm="show",A9="dropup",C9="dropend",I9="dropstart",M9="dropup-center",P9="dropdown-center",pp='[data-bs-toggle="dropdown"]:not(.disabled):not(:disabled)',D9=`${pp}.${Wm}`,ix=".dropdown-menu",k9=".navbar",L9=".navbar-nav",R9=".dropdown-menu .dropdown-item:not(.disabled):not(:disabled)",O9=nc()?"top-end":"top-start",z9=nc()?"top-start":"top-end",F9=nc()?"bottom-end":"bottom-start",B9=nc()?"bottom-start":"bottom-end",N9=nc()?"left-start":"right-start",V9=nc()?"right-start":"left-start",$9="top",j9="bottom",U9={autoClose:!0,boundary:"clippingParents",display:"dynamic",offset:[0,2],popperConfig:null,reference:"toggle"},H9={autoClose:"(boolean|string)",boundary:"(string|element)",display:"str
25ing",offset:"(array|string|function)",popperConfig:"(null|object|function)",reference:"(string|element|object)"};class Su extends Nc{constructor(t,o){super(t,o),this._popper=null,this._parent=this._element.parentNode,this._menu=Mn.next(this._element,ix)[0]||Mn.prev(this._element,ix)[0]||Mn.findOne(ix,this._parent),this._inNavbar=this._detectNavbar()}static get Default(){return U9}static get DefaultType(){return H9}static get NAME(){return LI}toggle(){return this._isShown()?this.hide():this.show()}show(){if(Xd(this._element)||this._isShown())return;const t={relatedTarget:this._element};if(!fi.trigger(this._element,T9,t).defaultPrevented){if(this._createPopper(),"ontouchstart"in document.documentElement&&!this._parent.closest(L9))for(const u of[].concat(...document.body.children))fi.on(u,"mouseover",Ex);this._element.focus(),this._element.setAttribute("aria-expanded",!0),this._menu.classList.add(Wm),this._element.classList.add(Wm),fi.trigger(this._element,S9,t)}}hide(){if(Xd(this._element)||!this._isShown())return;const t={relatedTarget:this._element};this._completeHide(t)}dispose(){this._popper&&this._popper.destroy(),super.dispose()}update(){this._inNavbar=this._detectNavbar(),this._popper&&this._popper.update()}_completeHide(t){if(!fi.trigger(this._element,b9,t).defaultPrevented){if("ontouchstart"in document.documentElement)for(const u of[].concat(...document.body.children))fi.off(u,"mouseover",Ex);this._popper&&this._popper.destroy(),this._menu.classList.remove(Wm),this._element.classList.remove(Wm),this._element.setAttribute("aria-expanded","false"),Ch.removeDataAttribute(this._menu,"popper"),fi.trigger(this._element,w9,t)}}_getConfig(t){if(t=super._getConfig(t),typeof t.reference=="object"&&!Ah(t.reference)&&typeof t.reference.getBoundingClientRect!="function")throw new TypeError(`${LI.toUpperCase()}: Option "reference" provided type "object" without a required "getBoundingClientRect" method.`);return t}_createPopper(){if(typeof ok>"u")throw new TypeError("Bootstrap's dropdowns require Popper (https://popper.js.org)");let t=this._element;this._config.reference==="parent"?t=this._parent:Ah(this._config.reference)?t=Zd(this._config.reference):typeof this._config.reference=="object"&&(t=this._config.reference);const o=this._getPopperConfig();this._popper=jT(t,this._menu,o)}_isShown(){return this._menu.classList.contains(Wm)}_getPlacement(){const t=this._parent;if(t.classList.contains(C9))return N9;if(t.classList.contains(I9))return V9;if(t.classList.contains(M9))return $9;if(t.classList.contains(P9))return j9;const o=getComputedStyle(this._menu).getPropertyValue("--bs-position").trim()==="end";return t.classList.contains(A9)?o?z9:O9:o?B9:F9}_detectNavbar(){return this._element.closest(k9)!==null}_getOffset(){const{offset:t}=this._config;return typeof t=="string"?t.split(",").map(o=>Number.parseInt(o,10)):typeof t=="function"?o=>t(o,this._element):t}_getPopperConfig(){const t={placement:this._getPlacement(),modifiers:[{name:"preventOverflow",options:{boundary:this._config.boundary}},{name:"offset",options:{offset:this._getOffset()}}]};return(this._inNavbar||this._config.display==="static")&&(Ch.setDataAttribute(this._menu,"popper","static"),t.modifiers=[{name:"applyStyles",enabled:!1}]),{...t,...Ga(this._config.popperConfig,[t])}}_selectMenuItem({key:t,target:o}){const u=Mn.find(R9,this._menu).filter(d=>bg(d));u.length&&UT(u,o,t===OI,!u.includes(o)).focus()}static jQueryInterface(t){return this.each(function(){const o=Su.getOrCreateInstance(this,t);if(typeof t=="string"){if(typeof o[t]>"u")throw new TypeError(`No method named "${t}"`);o[t]()}})}static clearMenus(t){if(t.button===x9||t.type==="keyup"&&t.key!==RI)return;const o=Mn.find(D9);for(const u of o){const d=Su.getInstance(u);if(!d||d._config.autoClose===!1)continue;const _=t.composedPath(),x=_.includes(d._menu);if(_.includes(d._element)||d._config.autoClose==="inside"&&!x||d._config.autoClose==="outside"&&x||d._menu.contains(t.target)&&(t.type==="keyup"&&t.key===RI||/input|select|option|textarea|form/i.test(t.target.tagName)))continue;const s={relatedTarget:d._element};
vendor: 8,908 bytes, line 25
25t.type==="click"&&(s.clickEvent=t),d._completeHide(s)}}static dataApiKeydownHandler(t){const o=/input|textarea/i.test(t.target.tagName),u=t.key===y9,d=[v9,OI].includes(t.key);if(!d&&!u||o&&!u)return;t.preventDefault();const _=this.matches(pp)?this:Mn.prev(this,pp)[0]||Mn.next(this,pp)[0]||Mn.findOne(pp,t.delegateTarget.parentNode),x=Su.getOrCreateInstance(_);if(d){t.stopPropagation(),x.show(),x._selectMenuItem(t);return}x._isShown()&&(t.stopPropagation(),x.hide(),_.focus())}}fi.on(document,Sk,pp,Su.dataApiKeydownHandler);fi.on(document,Sk,ix,Su.dataApiKeydownHandler);fi.on(document,Tk,Su.clearMenus);fi.on(document,E9,Su.clearMenus);fi.on(document,Tk,pp,function(n){n.preventDefault(),Su.getOrCreateInstance(this).toggle()});rc(Su);const Ek="backdrop",G9="fade",zI="show",FI=`mousedown.bs.${Ek}`,W9={className:"modal-backdrop",clickCallback:null,isAnimated:!1,isVisible:!0,rootElement:"body"},q9={className:"string",clickCallback:"(function|null)",isAnimated:"boolean",isVisible:"boolean",rootElement:"(element|string)"};class Ak extends Gy{constructor(t){super(),this._config=this._getConfig(t),this._isAppended=!1,this._element=null}static get Default(){return W9}static get DefaultType(){return q9}static get NAME(){return Ek}show(t){if(!this._config.isVisible){Ga(t);return}this._append();const o=this._getElement();this._config.isAnimated&&Hy(o),o.classList.add(zI),this._emulateAnimation(()=>{Ga(t)})}hide(t){if(!this._config.isVisible){Ga(t);return}this._getElement().classList.remove(zI),this._emulateAnimation(()=>{this.dispose(),Ga(t)})}dispose(){this._isAppended&&(fi.off(this._element,FI),this._element.remove(),this._isAppended=!1)}_getElement(){if(!this._element){const t=document.createElement("div");t.className=this._config.className,this._config.isAnimated&&t.classList.add(G9),this._element=t}return this._element}_configAfterMerge(t){return t.rootElement=Zd(t.rootElement),t}_append(){if(this._isAppended)return;const t=this._getElement();this._config.rootElement.append(t),fi.on(t,FI,()=>{Ga(this._config.clickCallback)}),this._isAppended=!0}_emulateAnimation(t){hk(t,this._getElement(),this._config.isAnimated)}}const Z9="focustrap",X9="bs.focustrap",Cx=`.${X9}`,Y9=`focusin${Cx}`,K9=`keydown.tab${Cx}`,J9="Tab",Q9="forward",BI="backward",e$={autofocus:!0,trapElement:null},t$={autofocus:"boolean",trapElement:"element"};class Ck extends Gy{constructor(t){super(),this._config=this._getConfig(t),this._isActive=!1,this._lastTabNavDirection=null}static get Default(){return e$}static get DefaultType(){return t$}static get NAME(){return Z9}activate(){this._isActive||(this._config.autofocus&&this._config.trapElement.focus(),fi.off(document,Cx),fi.on(document,Y9,t=>this._handleFocusin(t)),fi.on(document,K9,t=>this._handleKeydown(t)),this._isActive=!0)}deactivate(){this._isActive&&(this._isActive=!1,fi.off(document,Cx))}_handleFocusin(t){const{trapElement:o}=this._config;if(t.target===document||t.target===o||o.contains(t.target))return;const u=Mn.focusableChildren(o);u.length===0?o.focus():this._lastTabNavDirection===BI?u[u.length-1].focus():u[0].focus()}_handleKeydown(t){t.key===J9&&(this._lastTabNavDirection=t.shiftKey?BI:Q9)}}const NI=".fixed-top, .fixed-bottom, .is-fixed, .sticky-top",VI=".sticky-top",Ev="padding-right",$I="margin-right";class S2{constructor(){this._element=document.body}getWidth(){const t=document.documentElement.clientWidth;return Math.abs(window.innerWidth-t)}hide(){const t=this.getWidth();this._disableOverFlow(),this._setElementAttributes(this._element,Ev,o=>o+t),this._setElementAttributes(NI,Ev,o=>o+t),this._setElementAttributes(VI,$I,o=>o-t)}reset(){this._resetElementAttributes(this._element,"overflow"),this._resetElementAttributes(this._element,Ev),this._resetElementAttributes(NI,Ev),this._resetElementAttributes(VI,$I)}isOverflowing(){return this.getWidth()>0}_disableOverFlow(){this._saveInitialAttribute(this._element,"overflow"),this._element.style.overflow="hidden"}_setElementAttributes(t,o,u){const d=this.getWidth(),_=x=>{if(x!==this._element&&window.innerWidth>x.clientWidth+d)return;this._saveInitialAttribute(x,o);const s=window.getComputedStyle(x).getPropertyValue(o);x.style.setProperty(o,`${u(Number.parseFloat(s))}px`)};this._applyManipulationCallback(t,_)}_saveInitialAttribute(t,o){const u=t.style.getPropertyValue(o);u&&Ch.setDataAttribute(t,o,u)}_resetElementAttributes(t,o){const u=d=>{const _=Ch.getDataAttribute(d,o);if(_===null){d.style.removeProperty(o);return}Ch.removeDataAttribute(d,o),d.style.setProperty(o,_)};this._applyManipulationCallback(t,u)}_applyManipulationCallback(t,o){if(Ah(t)){o(t);return}for(const u of Mn.find(t,this._element))o(u)}}const i$="modal",n$="bs.modal",sc=`.${n$}`,s$=".data-api",r$="Escape",o$=`hide${sc}`,a$=`hidePrevented${sc}`,Ik=`hidden${sc}`,Mk=`show${sc}`,l$=`shown${sc}`,c$=`resize${sc}`,u$=`click.dismiss${sc}`,h$=`mousedown.dismiss${sc}`,d$=`keydown.dismiss${sc}`,f$=`click${sc}${s$}`,jI="modal-open",p$="fade",UI="show",ww="modal-static",m$=".modal.show",g$=".modal-dialog",_$=".modal-body",y$='[data-bs-toggle="modal"]',v$={backdrop:!0,focus:!0,keyboard:!0},x$={backdrop:"(boolean|string)",focus:"boolean",keyboard:"boolean"};class Mp extends Nc{constructor(t,o){super(t,o),this._dialog=Mn.findOne(g$,this._element),this._backdrop=this._initializeBackDrop(),this._focustrap=this._initializeFocusTrap(),this._isShown=!1,this._isTransitioning=!1,this._scrollBar=new S2,this._addEventListeners()}static get Default(){return v$}static get DefaultType(){return x$}static get NAME(){return i$}toggle(t){return this._isShown?this.hide():this.show(t)}show(t){this._isShown||this._isTransitioning||fi.trigger(this._element,Mk,{relatedTarget:t}).defaultPrevented||(this._isShown=!0,this._isTransitioning=!0,this._scrollBar.hide(),document.body.classList.add(jI),this._adjustDialog(),this._backdrop.show(()=>this._showElement(t)))}hide(){!this._isShown||this._isTransitioning||fi.trigger(this._element,o$).defaultPrevented||(this._isShown=!1,this._isTransitioning=!0,this._focustrap.deactivate(),this._element.classList.remove(UI),this._queueCallback(()=>this._hideModal(),this._element,this._isAnimated()))}dispose(){fi.off(window,sc),fi.off(this._dialog,sc),this._backdrop.dispose(),this._focustrap.deactivate(),super.dispose()}handleUpdate(){this._adjustDialog()}_initializeBackDrop(){return new Ak({isVisible:!!this._config.backdrop,isAnimated:this._isAnimated()})}_initializeFocusTrap(){return new Ck({trapElement:this._element})}_showElement(t){document.body.contains(this._element)||document.body.append(this._element),this._element.style.display="block",this._element.removeAttribute("aria-hidden"),this._element.setAttribute("aria-modal",!0),this._element.setAttribute("role","dialog"),this._element.scrollTop=0;const o=Mn.findOne(_$,this._dialog);o&&(o.scrollTop=0),Hy(this._element),this._element.classList.add(UI);const u=()=>{this._config.focus&&this._focustrap.activate(),this._isTransitioning=!1,fi.trigger(this._element,l$,{relatedTarget:t})};this._queueCallback(u,this._dialog,this._isAnimated())}_addEventListeners(){fi.on(this._element,d$,t=>{if(t.key===r$){if(this._config.keyboard){this.hide();return}this._triggerBackdropTransition()}}),fi.on(window,c$,()=>{this._isShown&&!this._isTransitioning&&this._adjustDialog()}),fi.on(this._element,h$,t=>{fi.one(this._element,u$,o=>{if(!(this._element!==t.target||this._element!==o.target)){if(this._config.backdrop==="static"){this._triggerBackdropTransition();return}this._config.backdrop&&this.hide()}})})}_hideModal(){this._element.style.display="none",this._element.setAttribute("aria-hidden",!0),this._element.removeAttribute("aria-modal"),this._element.removeAttribute("role"),this._isTransitioning=!1,this._backdrop.hide(()=>{document.body.classList.remove(jI),this._resetAdjustments(),this._scrollBar.reset(),fi.trigger(this._element,Ik)})}_isAnimated(){return this._element.classList.contains(p$)}_triggerBackdropTransition(){if(fi.trigger(this._element,a$).defaultPrevented)return;const o=this._element.scrollHeight>document.documentElement.clientHeight,u=this._element.style.overflowY;u==="hidden"||this._element.classList.contains(ww)||(o||(this._element.style.overflowY="hidden"),this._element.classList.add(ww),this._queueCallback(()=>{this._element.classList.remove(ww),this._queueCallback(()=>{this._element.style.overflowY=u},this._dialog)},this._dialog),this._element.focus())}_adjustDialog(){const t=this._element.scrollHeight>document.documentElement.clientHeight,o=this._scrollBar.getWidth(),u=o>0;if(u&&!t){const d=nc()?"paddingLeft":"paddingRight";this._element.style[d]=`${o}px`}if(!u&&t){const d=nc()?"paddingRight":"paddingLeft";this._element.style[d]=`${o}px`}}_resetAdjustments(){this._element.style.paddingLeft="",this._element.style.paddingRight=""}static jQueryInterface(t,o){return this.each(function(){const u=Mp.getOrCreateInstance(this,t);if(typeof t=="string"){if(typeof u[t]>
25"u")throw new TypeError(`No method named "${t}"`);u[t](o)}})}}fi.on(document,f$,y$,function(n){const t=Mn.getElementFromSelector(this);["A","AREA"].includes(this.tagName)&&n.preventDefault(),fi.one(t,Mk,d=>{d.defaultPrevented||fi.one(t,Ik,()=>{bg(this)&&this.focus()})});const o=Mn.findOne(m$);o&&Mp.getInstance(o).hide(),Mp.getOrCreateInstance(t).toggle(this)});r1(Mp);rc(Mp);const b$="offcanvas",w$="bs.offcanvas",Lh=`.${w$}`,Pk=".data-api",T$=`load${Lh}${Pk}`,S$="Escape",HI="show",GI="showing",WI="hiding",E$="offcanvas-backdrop",Dk=".offcanvas.show",A$=`show${Lh}`,C$=`shown${Lh}`,I$=`hide${Lh}`,qI=`hidePrevented${Lh}`,kk=`hidden${Lh}`,M$=`resize${Lh}`,P$=`click${Lh}${Pk}`,D$=`keydown.dismiss${Lh}`,k$='[data-bs-toggle="offcanvas"]',L$={backdrop:!0,keyboard:!0,scroll:!1},R$={backdrop:"(boolean|string)",keyboard:"boolean",scroll:"boolean"};class Yd extends Nc{constructor(t,o){super(t,o),this._isShown=!1,this._backdrop=this._initializeBackDrop(),this._focustrap=this._initializeFocusTrap(),this._addEventListeners()}static get Default(){return L$}static get DefaultType(){return R$}static get NAME(){return b$}toggle(t){return this._isShown?this.hide():this.show(t)}show(t){if(this._isShown||fi.trigger(this._element,A$,{relatedTarget:t}).defaultPrevented)return;this._isShown=!0,this._backdrop.show(),this._config.scroll||new S2().hide(),this._element.setAttribute("aria-modal",!0),this._element.setAttribute("role","dialog"),this._element.classList.add(GI);const u=()=>{(!this._config.scroll||this._config.backdrop)&&this._focustrap.activate(),this._element.classList.add(HI),this._element.classList.remove(GI),fi.trigger(this._element,C$,{relatedTarget:t})};this._queueCallback(u,this._element,!0)}hide(){if(!this._isShown||fi.trigger(this._element,I$).defaultPrevented)return;this._focustrap.deactivate(),this._element.blur(),this._isShown=!1,this._element.classList.add(WI),this._backdrop.hide();const o=()=>{this._element.classList.remove(HI,WI),this._element.removeAttribute("aria-modal"),this._element.removeAttribute("role"),this._config.scroll||new S2().reset(),fi.trigger(this._element,kk)};this._queueCallback(o,this._element,!0)}dispose(){this._backdrop.dispose(),this._focustrap.deactivate(),super.dispose()}_initializeBackDrop(){const t=()=>{if(this._config.backdrop==="static"){fi.trigger(this._element,qI);return}this.hide()},o=!!this._config.backdrop;return new Ak({className:E$,isVisible:o,isAnimated:!0,rootElement:this._element.parentNode,clickCallback:o?t:null})}_initializeFocusTrap(){return new Ck({trapElement:this._element})}_addEventListeners(){fi.on(this._element,D$,t=>{if(t.key===S$){if(this._config.keyboard){this.hide();return}fi.trigger(this._element,qI)}})}static jQueryInterface(t){return this.each(function(){const o=Yd.getOrCreateInstance(this,t);if(typeof t=="string"){if(o[t]===void 0||t.startsWith("_")||t==="constructor")throw new TypeError(`No method named "${t}"`);o[t](this)}})}}fi.on(document,P$,k$,function(n){const t=Mn.getElementFromSelector(this);if(["A","AREA"].includes(this.tagName)&&n.preventDefault(),Xd(this))return;fi.one(t,kk,()=>{bg(this)&&this.focus()});const o=Mn.findOne(Dk);o&&o!==t&&Yd.getInstance(o).hide(),Yd.getOrCreateInstance(t).toggle(this)});fi.on(window,T$,()=>{for(const n of Mn.find(Dk))Yd.getOrCreateInstance(n).show()});fi.on(window,M$,()=>{for(const n of Mn.find("[aria-modal][class*=show][class*=offcanvas-]"))getComputedStyle(n).position!=="fixed"&&Yd.getOrCreateInstance(n).hide()});r1(Yd);rc(Yd);const O$=/^aria-[\w-]*$/i,Lk={"*":["class","dir","id","lang","role",O$],a:["target","href","title","rel"],area:[],b:[],br:[],col:[],code:[],dd:[],div:[],dl:[],dt:[],em:[],hr:[],h1:[],h2:[],h3:[],h4:[],h5:[],h6:[],i:[],img:["src","srcset","alt","title","width","height"],li:[],ol:[],p:[],pre:[],s:[],small:[],span:[],sub:[],sup:[],strong:[],u:[],ul:[]},z$=new Set(["background","cite","href","itemtype","longdesc","poster","src","xlink:href"]),F$=/^(?!javascript:)(?:[a-z0-9+.-]+:|[^&:/?#]*(?:[/?#]|$))/i,B$=(n,t)=>{const o=n.nodeName.toLowerCase();return t.includes(o)?z$.has(o)?!!F$.test(n.nodeValue):!0:t.filter(u=>u instanceof RegExp).some(u=>u.test(o))};function N$(n,t,o){if(!n.length)return n;if(o&&typeof o=="function")return o(n);const d=new window.DOMParser().parseFromString(n,"text/html"),_=[].concat(...d.body.querySelectorAll("*"));for(const x of _){const s=x.nodeName.toLowerCase();if(!Object.keys(t).includes(s)){x.remove();continue}const A=[].concat(...x.attributes),P=[].concat(t["*"]||[],t[s]||[]);for(const R of A)B$(R,P)||x.removeAttribute(R.nodeName)}return d.body.innerHTML}
vendor: 14,724 bytes, line 25
25const V$="TemplateFactory",$$={allowList:Lk,content:{},extraClass:"",html:!1,sanitize:!0,sanitizeFn:null,template:"<div></div>"},j$={allowList:"object",content:"object",extraClass:"(string|function)",html:"boolean",sanitize:"boolean",sanitizeFn:"(null|function)",template:"string"},U$={entry:"(string|element|function|null)",selector:"(string|element)"};class H$ extends Gy{constructor(t){super(),this._config=this._getConfig(t)}static get Default(){return $$}static get DefaultType(){return j$}static get NAME(){return V$}getContent(){return Object.values(this._config.content).map(t=>this._resolvePossibleFunction(t)).filter(Boolean)}hasContent(){return this.getContent().length>0}changeContent(t){return this._checkContent(t),this._config.content={...this._config.content,...t},this}toHtml(){const t=document.createElement("div");t.innerHTML=this._maybeSanitize(this._config.template);for(const[d,_]of Object.entries(this._config.content))this._setContent(t,_,d);const o=t.children[0],u=this._resolvePossibleFunction(this._config.extraClass);return u&&o.classList.add(...u.split(" ")),o}_typeCheckConfig(t){super._typeCheckConfig(t),this._checkContent(t.content)}_checkContent(t){for(const[o,u]of Object.entries(t))super._typeCheckConfig({selector:o,entry:u},U$)}_setContent(t,o,u){const d=Mn.findOne(u,t);if(d){if(o=this._resolvePossibleFunction(o),!o){d.remove();return}if(Ah(o)){this._putElementInTemplate(Zd(o),d);return}if(this._config.html){d.innerHTML=this._maybeSanitize(o);return}d.textContent=o}}_maybeSanitize(t){return this._config.sanitize?N$(t,this._config.allowList,this._config.sanitizeFn):t}_resolvePossibleFunction(t){return Ga(t,[this])}_putElementInTemplate(t,o){if(this._config.html){o.innerHTML="",o.append(t);return}o.textContent=t.textContent}}const G$="tooltip",W$=new Set(["sanitize","allowList","sanitizeFn"]),Tw="fade",q$="modal",Av="show",Z$=".tooltip-inner",ZI=`.${q$}`,XI="hide.bs.modal",B_="hover",Sw="focus",X$="click",Y$="manual",K$="hide",J$="hidden",Q$="show",ej="shown",tj="inserted",ij="click",nj="focusin",sj="focusout",rj="mouseenter",oj="mouseleave",aj={AUTO:"auto",TOP:"top",RIGHT:nc()?"left":"right",BOTTOM:"bottom",LEFT:nc()?"right":"left"},lj={allowList:Lk,animation:!0,boundary:"clippingParents",container:!1,customClass:"",delay:0,fallbackPlacements:["top","right","bottom","left"],html:!1,offset:[0,6],placement:"top",popperConfig:null,sanitize:!0,sanitizeFn:null,selector:!1,template:'<div class="tooltip" role="tooltip"><div class="tooltip-arrow"></div><div class="tooltip-inner"></div></div>',title:"",trigger:"hover focus"},cj={allowList:"object",animation:"boolean",boundary:"(string|element)",container:"(string|element|boolean)",customClass:"(string|function)",delay:"(number|object)",fallbackPlacements:"array",html:"boolean",offset:"(array|string|function)",placement:"(string|function)",popperConfig:"(null|object|function)",sanitize:"boolean",sanitizeFn:"(null|function)",selector:"(string|boolean)",template:"string",title:"(string|element|function)",trigger:"string"};let l1=class Rk extends Nc{constructor(t,o){if(typeof ok>"u")throw new TypeError("Bootstrap's tooltips require Popper (https://popper.js.org)");super(t,o),this._isEnabled=!0,this._timeout=0,this._isHovered=null,this._activeTrigger={},this._popper=null,this._templateFactory=null,this._newContent=null,this.tip=null,this._setListeners(),this._config.selector||this._fixTitle()}static get Default(){return lj}static get DefaultType(){return cj}static get NAME(){return G$}enable(){this._isEnabled=!0}disable(){this._isEnabled=!1}toggleEnabled(){this._isEnabled=!this._isEnabled}toggle(){if(this._isEnabled){if(this._activeTrigger.click=!this._activeTrigger.click,this._isShown()){this._leave();return}this._enter()}}dispose(){clearTimeout(this._timeout),fi.off(this._element.closest(ZI),XI,this._hideModalHandler),this._element.getAttribute("data-bs-original-title")&&this._element.setAttribute("title",this._element.getAttribute("data-bs-original-title")),this._disposePopper(),super.dispose()}show(){if(this._element.style.display==="none")throw new Error("Please use show on visible elements");if(!(this._isWithContent()&&this._isEnabled))return;const t=fi.trigger(this._element,this.constructor.eventName(Q$)),u=(ck(this._element)||this._element.ownerDocument.documentElement).contains(this._element);if(t.defaultPrevented||!u)return;this._disposePopper();const d=this._getTipElement();this._element.setAttribute("aria-describedby",d.getAttribute("id"));const{container:_}=this._config;if(this._element.ownerDocument.documentElement.contains(this.tip)||(_.append(d),fi.trigger(this._element,this.constructor.eventName(tj))),this._popper=this._createPopper(d),d.classList.add(Av),"ontouchstart"in document.documentElement)for(const s of[].concat(...document.body.children))fi.on(s,"mouseover",Ex);const x=()=>{fi.trigger(this._element,this.constructor.eventName(ej)),this._isHovered===!1&&this._leave(),this._isHovered=!1};this._queueCallback(x,this.tip,this._isAnimated())}hide(){if(!this._isShown()||fi.trigger(this._element,this.constructor.eventName(K$)).defaultPrevented)return;if(this._getTipElement().classList.remove(Av),"ontouchstart"in document.documentElement)for(const d of[].concat(...document.body.children))fi.off(d,"mouseover",Ex);this._activeTrigger[X$]=!1,this._activeTrigger[Sw]=!1,this._activeTrigger[B_]=!1,this._isHovered=null;const u=()=>{this._isWithActiveTrigger()||(this._isHovered||this._disposePopper(),this._element.removeAttribute("aria-describedby"),fi.trigger(this._element,this.constructor.eventName(J$)))};this._queueCallback(u,this.tip,this._isAnimated())}update(){this._popper&&this._popper.update()}_isWithContent(){return!!this._getTitle()}_getTipElement(){return this.tip||(this.tip=this._createTipElement(this._newContent||this._getContentForTemplate())),this.tip}_createTipElement(t){const o=this._getTemplateFactory(t).toHtml();if(!o)return null;o.classList.remove(Tw,Av),o.classList.add(`bs-${this.constructor.NAME}-auto`);const u=XV(this.constructor.NAME).toString();return o.setAttribute("id",u),this._isAnimated()&&o.classList.add(Tw),o}setContent(t){this._newContent=t,this._isShown()&&(this._disposePopper(),this.show())}_getTemplateFactory(t){return this._templateFactory?this._templateFactory.changeContent(t):this._templateFactory=new H$({...this._config,content:t,extraClass:this._resolvePossibleFunction(this._config.customClass)}),this._templateFactory}_getContentForTemplate(){return{[Z$]:this._getTitle()}}_getTitle(){return this._resolvePossibleFunction(this._config.title)||this._element.getAttribute("data-bs-original-title")}_initializeOnDelegatedTarget(t){return this.constructor.getOrCreateInstance(t.delegateTarget,this._getDelegateConfig())}_isAnimated(){return this._config.animation||this.tip&&this.tip.classList.contains(Tw)}_isShown(){return this.tip&&this.tip.classList.contains(Av)}_createPopper(t){const o=Ga(this._config.placement,[this,t,this._element]),u=aj[o.toUpperCase()];return jT(this._element,t,this._getPopperConfig(u))}_getOffset(){const{offset:t}=this._config;return typeof t=="string"?t.split(",").map(o=>Number.parseInt(o,10)):typeof t=="function"?o=>t(o,this._element):t}_resolvePossibleFunction(t){return Ga(t,[this._element])}_getPopperConfig(t){const o={placement:t,modifiers:[{name:"flip",options:{fallbackPlacements:this._config.fallbackPlacements}},{name:"offset",options:{offset:this._getOffset()}},{name:"preventOverflow",options:{boundary:this._config.boundary}},{name:"arrow",options:{element:`.${this.constructor.NAME}-arrow`}},{name:"preSetPlacement",enabled:!0,phase:"beforeMain",fn:u=>{this._getTipElement().setAttribute("data-popper-placement",u.state.placement)}}]};return{...o,...Ga(this._config.popperConfig,[o])}}_setListeners(){const t=this._config.trigger.split(" ");for(const o of t)if(o==="click")fi.on(this._element,this.constructor.eventName(ij),this._config.selector,u=>{this._initializeOnDelegatedTarget(u).toggle()});else if(o!==Y$){const u=o===B_?this.constructor.eventName(rj):this.constructor.eventName(nj),d=o===B_?this.constructor.eventName(oj):this.constructor.eventName(sj);fi.on(this._element,u,this._config.selector,_=>{const x=this._initializeOnDelegatedTarget(_);x._activeTrigger[_.type==="focusin"?Sw:B_]=!0,x._enter()}),fi.on(this._element,d,this._config.selector,_=>{const x=this._initializeOnDelegatedTarget(_);x._activeTrigger[_.type==="focusout"?Sw:B_]=x._element.contains(_.relatedTarget),x._leave()})}this._hideModalHandler=()=>{this._element&&this.hide()},fi.on(this._element.closest(ZI),XI,this._hideModalHandler)}_fixTitle(){const t=this._element.getAttribute("title");t&&(!this._element.getAttribute("aria-label")&&!this._element.textContent.trim()&&this._element.setAttribute("aria-label",t),this._element.setAttribute("data-bs-original-title",t),this._element.removeAttribute("title"))}_enter(){if(this._isShown()||this._isHovered){this._isHovered=!0;return}this._isHovered=!0,this._setTimeout(()=>{this._isHovered&&this.show()},this._config.delay.show)}_leave(){this._isWithActiveTrigger()||(this._isHovered=!1,this._setTimeout(()=>{this._isHovered||this.hide()},this._config.delay.hide))}_setTimeout(t,o){clearTimeout(this._timeout),this._timeout=setTimeout(t,o)}_isWithActiveTrigger(){return Object.values(this._activeTrigger).includes(!0)}_getConfig(t){const o=Ch.getDataAttributes(this._element);for(const u of Object.keys(o))W$.has(u)&&delete o[u];return t={...o,...typeof t=="object"&&t?t:{}},t=this._mergeConfigObj(t),t=this._configAfterMerge(t),this._typeCheckConfig(t),t}_configAfterMerge(t){return t.container=t.container===!1?document.body:Zd(t.container),typeof t.delay=="number"&&(t.delay={show:t.delay,hide:t.delay}),typeof t.title=="number"&&(t.title=t.title.toString()),typeof t.content=="number"&&(t.content=t.content.toString()),t}_getDelegateConfig(){const t={};for(const[o,u]of Object.entries(this._config))this.constructor.Default[o]!==u&&(t[o]=u);return t.selector=!1,t.trigger="manual",t}_disposePopper(){this._popper&&(this._popper.destroy(),this._popper=null),this.tip&&(this.tip.remove(),this.tip=null)}static jQueryInterface(t){return this.each(function(){const o=Rk.getOrCreateInstance(this,t);if(typeof t=="string"){if(typeof o[t]>"u")throw new TypeError(`No method named "${t}"`);o[t]()}})}};rc(l1);const uj="popover",hj=".popover-header",dj=".popover-body",fj={...l1.Default,content:"",offset:[0,8],placement:"right",template:'<div class="popover" role="tooltip"><div class="popover-arrow"></div><h3 class="popover-header"></h3><div class="popover-body"></div></div>',trigger:"click"},pj={...l1.DefaultType,content:"(null|string|element|function)"};class WT extends l1{static get Default(){return fj}static get DefaultType(){return pj}static get NAME(){return uj}_isWithContent(){return this._getTitle()||this._getContent()}_getContentForTemplate(){return{[hj]:this._getTitle(),[dj]:this._getContent()}}_getContent(){return this._resolvePossibleFunction(this._config.content)}static jQueryInterface(t){return this.each(function(){const o=WT.getOrCreateInstance(this,t);if(typeof t=="string"){if(typeof o[t]>"u")throw new TypeError(`No method named "${t}"`);o[t]()}})}}rc(WT);const mj="scrollspy",gj="bs.scrollspy",qT=`.${gj}`,_j=".data-api",yj=`activate${qT}`,YI=`click${qT}`,vj=`load${qT}${_j}`,xj="dropdown-item",Nm="active",bj='[data-bs-spy="scroll"]',Ew="[href]",wj=".nav, .list-group",KI=".nav-link",Tj=".nav-item",Sj=".list-group-item",Ej=`${KI}, ${Tj} > ${KI}, ${Sj}`,Aj=".dropdown",Cj=".dropdown-toggle",Ij={offset:null,rootMargin:"0px 0px -25%",smoothScroll:!1,target:null,threshold:[.1,.5,1]},Mj={offset:"(number|null)",rootMargin:"string",smoothScroll:"boolean",target:"element",threshold:"array"};class c1 extends Nc{constructor(t,o){super(t,o),this._targetLinks=new Map,this._observableSections=new Map,this._rootElement=getComputedStyle(this._element).overflowY==="visible"?null:this._element,this._activeTarget=null,this._observer=null,this._previousScrollData={visibleEntryTop:0,parentScrollTop:0},this.refresh()}static get Default(){return Ij}static get DefaultType(){return Mj}static get NAME(){return mj}refresh(){this._initializeTargetsAndObservables(),this._maybeEnableSmoothScroll(),this._observer?this._observer.disconnect():this._observer=this._getNewObserver();for(const t of this._observableSections.values())this._observer.observe(t)}dispose(){this._observer.disconnect(),super.dispose()}_configAfterMerge(t){return t.target=Zd(t.target)||document.body,t.rootMargin=t.offset?`${t.offset}px 0px -30%`:t.rootMargin,typeof t.threshold=="string"&&(t.threshold=t.threshold.split(",").map(o=>Number.parseFloat(o))),t}_maybeEnableSmoothScroll(){this._config.smoothScroll&&(fi.off(this._config.target,YI),fi.on(this._config.target,YI,Ew,t=>{const o=this._observableSections.get(t.target.hash);if(o){t.preventDefault();const u=this._rootElement||window,d=o.offsetTop-this._element.offsetTop;if(u.scrollTo){u.scrollTo({top:d,behavior:"smooth"});return}u.scrollTop=d}}))}_getNewObserver(){const t={root:this._rootElement,threshold:this._config.threshold,rootMargin:this._config.rootMargin};return new IntersectionObserver(o=>this._observerCallback(o),t)}_observerCallback(t){const o=x=>this._targetLinks.get(`#${x.target.id}`),u=x=>{this._previousScrollData.visibleEntryTop=x.target.offsetTop,this._process(o(x))},d=(this._rootElement||document.documentElement).scrollTop,_=d>=this._previousScrollData.parentScrollTop;this._previousScrollData.parentScrollTop=d;for(const x of t){if(!x.isIntersecting){this._activeTarget=null,this._clearActiveClass(o(x));continue}const s=x.target.offsetTop>=this._previousScrollData.visibleEntryTop;if(_&&s){if(u(x),!d)return;continue}!_&&!s&&u(x)}}_initializeTargetsAndObservables(){this._targetLinks=new Map,this._observableSections=new Map;const t=Mn.find(Ew,this._config.target);for(const o of t){if(!o.hash||Xd(o))continue;const u=Mn.findOne(decodeURI(o.hash),this._element);bg(u)&&(this._targetLinks.set(decodeURI(o.hash),o),this._observableSections.set(o.hash,u))}}_process(t){this._activeTarget!==t&&(this._clearActiveClass(this._config.target),this._activeTarget=t,t.classList.add(Nm),this._activateParents(t),fi.trigger(this._element,yj,{relatedTarget:t}))}_activateParents(t){if(t.classList.contains(xj)){Mn.findOne(Cj,t.closest(Aj)).classList.add(Nm);return}for(const o of Mn.parents(t,wj))for(const u of Mn.prev(o,Ej))u.classList.add(Nm)}_clearActiveClass(t){t.classList.remove(Nm);const o=Mn.find(`${Ew}.${Nm}`,t);for(const u of o)u.classList.remove(Nm)}static jQueryInterface(t){return this.each(function(){const o=c1.getOrCreateInstance(this,t);if(typeof t=="string"){if(o[t]===void 0||t.startsWith("_")||t==="constructor")throw new TypeError(`No method n
25amed "${t}"`);o[t]()}})}}fi.on(window,vj,()=>{for(const n of Mn.find(bj))c1.getOrCreateInstance(n)});rc(c1);const Pj="tab",Dj="bs.tab",zp=`.${Dj}`,kj=`hide${zp}`,Lj=`hidden${zp}`,Rj=`show${zp}`,Oj=`shown${zp}`,zj=`click${zp}`,Fj=`keydown${zp}`,Bj=`load${zp}`,Nj="ArrowLeft",JI="ArrowRight",Vj="ArrowUp",QI="ArrowDown",Aw="Home",eM="End",mp="active",tM="fade",Cw="show",$j="dropdown",Ok=".dropdown-toggle",jj=".dropdown-menu",Iw=`:not(${Ok})`,Uj='.list-group, .nav, [role="tablist"]',Hj=".nav-item, .list-group-item",Gj=`.nav-link${Iw}, .list-group-item${Iw}, [role="tab"]${Iw}`,zk='[data-bs-toggle="tab"], [data-bs-toggle="pill"], [data-bs-toggle="list"]',Mw=`${Gj}, ${zk}`,Wj=`.${mp}[data-bs-toggle="tab"], .${mp}[data-bs-toggle="pill"], .${mp}[data-bs-toggle="list"]`;class hg extends Nc{constructor(t){super(t),this._parent=this._element.closest(Uj),this._parent&&(this._setInitialAttributes(this._parent,this._getChildren()),fi.on(this._element,Fj,o=>this._keydown(o)))}static get NAME(){return Pj}show(){const t=this._element;if(this._elemIsActive(t))return;const o=this._getActiveElem(),u=o?fi.trigger(o,kj,{relatedTarget:t}):null;fi.trigger(t,Rj,{relatedTarget:o}).defaultPrevented||u&&u.defaultPrevented||(this._deactivate(o,t),this._activate(t,o))}_activate(t,o){if(!t)return;t.classList.add(mp),this._activate(Mn.getElementFromSelector(t));const u=()=>{if(t.getAttribute("role")!=="tab"){t.classList.add(Cw);return}t.removeAttribute("tabindex"),t.setAttribute("aria-selected",!0),this._toggleDropDown(t,!0),fi.trigger(t,Oj,{relatedTarget:o})};this._queueCallback(u,t,t.classList.contains(tM))}_deactivate(t,o){if(!t)return;t.classList.remove(mp),t.blur(),this._deactivate(Mn.getElementFromSelector(t));const u=()=>{if(t.getAttribute("role")!=="tab"){t.classList.remove(Cw);return}t.setAttribute("aria-selected",!1),t.setAttribute("tabindex","-1"),this._toggleDropDown(t,!1),fi.trigger(t,Lj,{relatedTarget:o})};this._queueCallback(u,t,t.classList.contains(tM))}_keydown(t){if(![Nj,JI,Vj,QI,Aw,eM].includes(t.key))return;t.stopPropagation(),t.preventDefault();const o=this._getChildren().filter(d=>!Xd(d));let u;if([Aw,eM].includes(t.key))u=o[t.key===Aw?0:o.length-1];else{const d=[JI,QI].includes(t.key);u=UT(o,t.target,d,!0)}u&&(u.focus({preventScroll:!0}),hg.getOrCreateInstance(u).show())}_getChildren(){return Mn.find(Mw,this._parent)}_getActiveElem(){return this._getChildren().find(t=>this._elemIsActive(t))||null}_setInitialAttributes(t,o){this._setAttributeIfNotExists(t,"role","tablist");for(const u of o)this._setInitialAttributesOnChild(u)}_setInitialAttributesOnChild(t){t=this._getInnerElement(t);const o=this._elemIsActive(t),u=this._getOuterElement(t);t.setAttribute("aria-selected",o),u!==t&&this._setAttributeIfNotExists(u,"role","presentation"),o||t.setAttribute("tabindex","-1"),this._setAttributeIfNotExists(t,"role","tab"),this._setInitialAttributesOnTargetPanel(t)}_setInitialAttributesOnTargetPanel(t){const o=Mn.getElementFromSelector(t);o&&(this._setAttributeIfNotExists(o,"role","tabpanel"),t.id&&this._setAttributeIfNotExists(o,"aria-labelledby",`${t.id}`))}_toggleDropDown(t,o){const u=this._getOuterElement(t);if(!u.classList.contains($j))return;const d=(_,x)=>{const s=Mn.findOne(_,u);s&&s.classList.toggle(x,o)};d(Ok,mp),d(jj,Cw),u.setAttribute("aria-expanded",o)}_setAttributeIfNotExists(t,o,u){t.hasAttribute(o)||t.setAttribute(o,u)}_elemIsActive(t){return t.classList.contains(mp)}_getInnerElement(t){return t.matches(Mw)?t:Mn.findOne(Mw,t)}_getOuterElement(t){return t.closest(Hj)||t}static jQueryInterface(t){return this.each(function(){const o=hg.getOrCreateInstance(this);if(typeof t=="string"){if(o[t]===void 0||t.startsWith("_")||t==="constructor")throw new TypeError(`No method named "${t}"`);o[t]()}})}}fi.on(document,zj,zk,function(n){["A","AREA"].includes(this.tagName)&&n.preventDefault(),!Xd(this)&&hg.getOrCreateInstance(this).show()});fi.on(window,Bj,()=>{for(const n of Mn.find(Wj))hg.getOrCreateInstance(n)});rc(hg);const qj="toast",Zj="bs.toast",lf=`.${Zj}`,Xj=`mouseover${lf}`,Yj=`mouseout${lf}`,Kj=`focusin${lf}`,Jj=`focusout${lf}`,Qj=`hide${lf}`,eU=`hidden${lf}`,tU=`show${lf}`,iU=`shown${lf}`,nU="fade",iM="hide",Cv="show",Iv="showing",sU={animation:"boolean",autohide:"boolean",delay:"number"},rU={animation:!0,autohide:!0,delay:5e3};class u1 extends Nc{constructor(t,o){super(t,o),this._timeout=null,this._hasMouseInteraction=!1,this._hasKeyboardInteraction=!1,this._setListeners()}static get Default(){return rU}static get DefaultType(){return sU}static get NAME(){return qj}show(){if(fi.trigger(this._element,tU).defaultPrevented)return;this._clearTimeout(),this._config.animation&&this._element.classList.add(nU);const o=()=>{this._element.classList.remove(Iv),fi.trigger(this._element,iU),this._maybeScheduleHide()};this._element.classList.remove(iM),Hy(this._element),this._element.classList.add(Cv,Iv),this._queueCallback(o,this._element,this._config.animation)}
25hide(){if(!this.isShown()||fi.trigger(this._element,Qj).defaultPrevented)return;const o=()=>{this._element.classList.add(iM),this._element.classList.remove(Iv,Cv),fi.trigger(this._element,eU)};this._element.classList.add(Iv),this._queueCallback(o,this._element,this._config.animation)}dispose(){this._clearTimeout(),this.isShown()&&this._element.classList.remove(Cv),super.dispose()}isShown(){return this._element.classList.contains(Cv)}_maybeScheduleHide(){this._config.autohide&&(this._hasMouseInteraction||this._hasKeyboardInteraction||(this._timeout=setTimeout(()=>{this.hide()},this._config.delay)))}_onInteraction(t,o){switch(t.type){case"mouseover":case"mouseout":{this._hasMouseInteraction=o;break}case"focusin":case"focusout":{this._hasKeyboardInteraction=o;break}}if(o){this._clearTimeout();return}const u=t.relatedTarget;this._element===u||this._element.contains(u)||this._maybeScheduleHide()}_setListeners(){fi.on(this._element,Xj,t=>this._onInteraction(t,!0)),fi.on(this._element,Yj,t=>this._onInteraction(t,!1)),fi.on(this._element,Kj,t=>this._onInteraction(t,!0)),fi.on(this._element,Jj,t=>this._onInteraction(t,!1))}_clearTimeout(){clearTimeout(this._timeout),this._timeout=null}static jQueryInterface(t){return this.each(function(){const o=u1.getOrCreateInstance(this,t);if(typeof t=="string"){if(typeof o[t]>"u")throw new TypeError(`No method named "${t}"`);o[t](this)}})}}r1(u1);rc(u1);const oU={class:"modal fade",id:"applicationModal",tabindex:"-1","aria-labelledby":"applicationModalLabel","aria-hidden":"true"},aU={class:"modal-dialog modal-lg"},lU={class:"modal-content"},cU={class:"modal-body"},uU={key:0,class:"alert alert-success text-center"},hU={key:1,class:"card-selection text-center mb-4"},dU=["onClick"],fU=["src","alt"],pU={key:2,class:"text-center"},mU={key:3,class:"selected-card-preview text-center"},gU=["src","alt"],_U={class:"mb-3"},yU={class:"mb-3"},vU={class:"mb-3"},xU={class:"mb-3"},bU={class:"mb-3"},wU={__name:"ApplicationModal",setup(n,{expose:t}){let o=null;kh(()=>{o=new Mp(document.getElementById("applicationModal"),{backdrop:"static",keyboard:!1})});const u=Mi([{name:"CIBC Dividend® Visa Infinite* Card",image:"https://www.cibc.com/content/dam/global-assets/card-art/credit-cards/dividend-cards/cibc-dividend-visa-card/cibc-dividend-visa-card-en.png/_jcr_content/renditions/cq5dam.web.1280.1280.png"},{name:"CIBC Aventura® Visa Infinite* Card",image:"https://www.cibc.com/content/dam/global-assets/card-art/credit-cards/aventura-cards/cibc-aventura-visa-infinite-card/cibc-visa-aventura-infinite-en.png/_jcr_content/renditions/cq5dam.web.1280.1280.png"},{name:"CIBC Select Visa* Premium Card",image:"https://www.cibc.com/content/dam/global-assets/card-art/credit-cards/aventura-cards/cibc-aventura-visa-card/cibc-visa-aventura-en.png/_jcr_content/renditions/cq5dam.web.1280.1280.png"}]),d=Mi(u.value[0]),_=Mi({fullName:"",email:"",phone:"",income:"",address:""}),x=Mi(""),s=R=>{d.value=R},A=()=>{console.log("Application submitted:",{..._.value,selectedCard:d.value}),x.value="Your application has been submitted successfully!",setTimeout(()=>{o.hide(),_.value={fullName:"",email:"",phone:"",income:"",address:""},x.value=""},2e3)};return t({show:()=>{o&&o.show()}}),(R,V)=>(Ke(),it("div",oU,[H("div",aU,[H("div",lU,[V[11]||(V[11]=H("div",{class:"modal-header"},[H("h5",{class:"modal-title",id:"applicationModalLabel"},"Apply for a Credit Card"),H("button",{type:"button",class:"btn-close","data-bs-dismiss":"modal","aria-label":"Close"})],-1)),H("div",cU,[x.value?(Ke(),it("div",uU,Ut(x.value),1)):ha("",!0),x.value?ha("",!0):(Ke(),it("div",hU,[(Ke(!0),it(fn,null,Hn(u.value,(j,Q)=>(Ke(),it("div",{key:Q,class:"card-option",onClick:me=>s(j)},[H("img",{src:j.image,alt:j.name,class:lo(["card-img",{selected:d.value.name===j.name}])},null,10,fU),H("p",null,Ut(j.name),1)],8,dU))),128))])),x.value?ha("",!0):(Ke(),it("h6",pU,"Selected Card:")),x.value?ha("",!0):(Ke(),it("div",mU,[d.value.image?(Ke(),it("img",{key:0,src:d.value.image,alt:d.value.name,class:"img-fluid"},null,8,gU)):ha("",!0),H("p",null,Ut(d.value.name),1)])),x.value?ha("",!0):(Ke(),it("form",{key:4,onSubmit:Eh(A,["prevent"])},[H("div",_U,[V[5]||(V[5]=H("label",{for:"fullName",class:"form-label"},"Full Name",-1)),An(H("input",{type:"text",class:"form-control",id:"fullName","onUpdate:modelValue":V[0]||(V[0]=j=>_.value.fullName=j),required:""},null,512),[[Ur,_.value.fullName]])]),H("div",yU,[V[6]||(V[6]=H("label",{for:"email",class:"form-label"},"Email",-1)),An(H("input",{type:"email",class:"form-control",id:"email","onUpdate:modelValue":V[1]||(V[1]=j=>_.value.email=j),required:""},null,512),[[Ur,_.value.email]])]),H("div",vU,[V[7]||(V[7]=H("label",{for:"phone",class:"form-label"},"Phone Number",-1)),An(H("input",{type:"tel",class:"form-control",id:"phone","onUpdate:modelValue":V[2]||(V[2]=j=>_.value.phone=j),required:""},null,512),[[Ur,_.value.phone]])]),H("div",xU,[V[8]||(V[8]=H("label",{for:"income",class:"form-label"},"Annual Income",-1)),An(H("input",{type:"number",class:"form-control",id:"income","onUpdate:modelValue":V[3]||(V[3]=j=>_.value.income=j),required:""},null,512),[[Ur,_.value.income]])]),H("div",bU,[V[9]||(V[9]=H("label",{for:"address",class:"form-label"},"Address",-1)),An(H("input",{type:"text",class:"form-control",id:"address","onUpdate:modelValue":V[4]||(V[4]=j=>_.value.address=j),required:""},null,512),[[Ur,_.value.address]])]),V[10]||(V[10]=H("div",{class:"text-center"},[H("button",{type:"submit",class:"btn btn-theme btn-lg"},"Submit Application")],-1))],32))])])])]))}},TU=ji(wU,[["__scopeId","data-v-66b7f8b2"]]),SU={class:"financial-insights animate-on-scroll"},EU={__name:"FinancialInsights",setup(n){return(t,o)=>(Ke(),it("section",SU,o[0]||(o[0]=[Xo('<h2 class="section-title" data-v-ce485dc7>Financial Insights</h2><div class="insights-content" data-v-ce485dc7><div class="insights-text" data-v-ce485dc7><h3 data-v-ce485dc7>Empowering Your Financial Decisions</h3><p data-v-ce485dc7>At CIBC, we believe in providing our clients with the knowledge and tools to make informed financial decisions. Our team of experts works tirelessly to bring you the latest insights and strategies to help you achieve your financial goals.</p><ul data-v-ce485dc7><li data-v-ce485dc7>Personalized financial advice</li><li data-v-ce485dc7>Market analysis and investment opportunities</li><li data-v-ce485dc7>Budgeting and savings strategies</li><li data-v-ce485dc7>Retirement planning guidance</li></ul></div><div class="insights-image" data-v-ce485dc7><img src="https://www.investorsedge.cibc.com/content/dam/ie-public-assets/images/lob/home/investing-screen-phone-and-laptop-en.png/_jcr_content/renditions/cq5dam.web.767.767.png" alt="CIBC Financial Insights" data-v-ce485dc7></div></div>',2)])))}},AU=ji(EU,[["__scopeId","data-v-ce485dc7"]]);/*! 26 * Font Awesome Free 6.7.2 by @fontawesome - https://fontawesome.com 27 * License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) 28 * Copyright 2024 Fonticons, Inc. 29 */function CU(n,t,o){return(t=MU(t))in n?Object.defineProperty(n,t,{value:o,enumerable:!0,configurable:!0,writable:!0}):n[t]=o,n}function nM(n,t){var o=Object.keys(n);if(Object.getOwnPropertySymbols){var u=Object.getOwnPropertySymbols(n);t&&(u=u.filter(function(d){return Object.getOwnPropertyDescriptor(n,d).enumerable})),o.push.apply(o,u)}return o}function _i(n){for(var t=1;t<arguments.length;t++){var o=arguments[t]!=null?arguments[t]:{};
vendor: 5,726 bytes, line 29
29t%2?nM(Object(o),!0).forEach(function(u){CU(n,u,o[u])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(o)):nM(Object(o)).forEach(function(u){Object.defineProperty(n,u,Object.getOwnPropertyDescriptor(o,u))})}return n}function IU(n,t){if(typeof n!="object"||!n)return n;var o=n[Symbol.toPrimitive];if(o!==void 0){var u=o.call(n,t||"default");if(typeof u!="object")return u;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(n)}function MU(n){var t=IU(n,"string");return typeof t=="symbol"?t:t+""}const sM=()=>{};let ZT={},Fk={},Bk=null,Nk={mark:sM,measure:sM};try{typeof window<"u"&&(ZT=window),typeof document<"u"&&(Fk=document),typeof MutationObserver<"u"&&(Bk=MutationObserver),typeof performance<"u"&&(Nk=performance)}catch{}const{userAgent:rM=""}=ZT.navigator||{},Kd=ZT,Cr=Fk,oM=Bk,Mv=Nk;Kd.document;const Rh=!!Cr.documentElement&&!!Cr.head&&typeof Cr.addEventListener=="function"&&typeof Cr.createElement=="function",Vk=~rM.indexOf("MSIE")||~rM.indexOf("Trident/");var PU=/fa(s|r|l|t|d|dr|dl|dt|b|k|kd|ss|sr|sl|st|sds|sdr|sdl|sdt)?[\-\ ]/,DU=/Font ?Awesome ?([56 ]*)(Solid|Regular|Light|Thin|Duotone|Brands|Free|Pro|Sharp Duotone|Sharp|Kit)?.*/i,$k={classic:{fa:"solid",fas:"solid","fa-solid":"solid",far:"regular","fa-regular":"regular",fal:"light","fa-light":"light",fat:"thin","fa-thin":"thin",fab:"brands","fa-brands":"brands"},duotone:{fa:"solid",fad:"solid","fa-solid":"solid","fa-duotone":"solid",fadr:"regular","fa-regular":"regular",fadl:"light","fa-light":"light",fadt:"thin","fa-thin":"thin"},sharp:{fa:"solid",fass:"solid","fa-solid":"solid",fasr:"regular","fa-regular":"regular",fasl:"light","fa-light":"light",fast:"thin","fa-thin":"thin"},"sharp-duotone":{fa:"solid",fasds:"solid","fa-solid":"solid",fasdr:"regular","fa-regular":"regular",fasdl:"light","fa-light":"light",fasdt:"thin","fa-thin":"thin"}},kU={GROUP:"duotone-group",SWAP_OPACITY:"swap-opacity",PRIMARY:"primary",SECONDARY:"secondary"},jk=["fa-classic","fa-duotone","fa-sharp","fa-sharp-duotone"],pa="classic",h1="duotone",LU="sharp",RU="sharp-duotone",Uk=[pa,h1,LU,RU],OU={classic:{900:"fas",400:"far",normal:"far",300:"fal",100:"fat"},duotone:{900:"fad",400:"fadr",300:"fadl",100:"fadt"},sharp:{900:"fass",400:"fasr",300:"fasl",100:"fast"},"sharp-duotone":{900:"fasds",400:"fasdr",300:"fasdl",100:"fasdt"}},zU={"Font Awesome 6 Free":{900:"fas",400:"far"},"Font Awesome 6 Pro":{900:"fas",400:"far",normal:"far",300:"fal",100:"fat"},"Font Awesome 6 Brands":{400:"fab",normal:"fab"},"Font Awesome 6 Duotone":{900:"fad",400:"fadr",normal:"fadr",300:"fadl",100:"fadt"},"Font Awesome 6 Sharp":{900:"fass",400:"fasr",normal:"fasr",300:"fasl",100:"fast"},"Font Awesome 6 Sharp Duotone":{900:"fasds",400:"fasdr",normal:"fasdr",300:"fasdl",100:"fasdt"}},FU=new Map([["classic",{defaultShortPrefixId:"fas",defaultStyleId:"solid",styleIds:["solid","regular","light","thin","brands"],futureStyleIds:[],defaultFontWeight:900}],["sharp",{defaultShortPrefixId:"fass",defaultStyleId:"solid",styleIds:["solid","regular","light","thin"],futureStyleIds:[],defaultFontWeight:900}],["duotone",{defaultShortPrefixId:"fad",defaultStyleId:"solid",styleIds:["solid","regular","light","thin"],futureStyleIds:[],defaultFontWeight:900}],["sharp-duotone",{defaultShortPrefixId:"fasds",defaultStyleId:"solid",styleIds:["solid","regular","light","thin"],futureStyleIds:[],defaultFontWeight:900}]]),BU={classic:{solid:"fas",regular:"far",light:"fal",thin:"fat",brands:"fab"},duotone:{solid:"fad",regular:"fadr",light:"fadl",thin:"fadt"},sharp:{solid:"fass",regular:"fasr",light:"fasl",thin:"fast"},"sharp-duotone":{solid:"fasds",regular:"fasdr",light:"fasdl",thin:"fasdt"}},NU=["fak","fa-kit","fakd","fa-kit-duotone"],aM={kit:{fak:"kit","fa-kit":"kit"},"kit-duotone":{fakd:"kit-duotone","fa-kit-duotone":"kit-duotone"}},VU=["kit"],$U={kit:{"fa-kit":"fak"},"kit-duotone":{"fa-kit-duotone":"fakd"}},jU=["fak","fakd"],UU={kit:{fak:"fa-kit"},"kit-duotone":{fakd:"fa-kit-duotone"}},lM={kit:{kit:"fak"},"kit-duotone":{"kit-duotone":"fakd"}},Pv={GROUP:"duotone-group",SWAP_OPACITY:"swap-opacity",PRIMARY:"primary",SECONDARY:"secondary"},HU=["fa-classic","fa-duotone","fa-sharp","fa-sharp-duotone"],GU=["fak","fa-kit","fakd","fa-kit-duotone"],WU={"Font Awesome Kit":{400:"fak",normal:"fak"},"Font Awesome Kit Duotone":{400:"fakd",normal:"fakd"}},qU={classic:{"fa-brands":"fab","fa-duotone":"fad","fa-light":"fal","fa-regular":"far","fa-solid":"fas","fa-thin":"fat"},duotone:{"fa-regular":"fadr","fa-light":"fadl","fa-thin":"fadt"},sharp:{"fa-solid":"fass","fa-regular":"fasr","fa-light":"fasl","fa-thin":"fast"},"sharp-duotone":{"fa-solid":"fasds","fa-regular":"fasdr","fa-light":"fasdl","fa-thin":"fasdt"}},ZU={classic:["fas","far","fal","fat","fad"],duotone:["fadr","fadl","fadt"],sharp:["fass","fasr","fasl","fast"],"sharp-duotone":["fasds","fasdr","fasdl","fasdt"]},E2={classic:{fab:"fa-brands",fad:"fa-duotone",fal:"fa-light",far:"fa-regular",fas:"fa-solid",fat:"fa-thin"},duotone:{fadr:"fa-regular",fadl:"fa-light",fadt:"fa-thin"},sharp:{fass:"fa-solid",fasr:"fa-regular",fasl:"fa-light",fast:"fa-thin"},"sharp-duotone":{fasds:"fa-solid",fasdr:"fa-regular",fasdl:"fa-light",fasdt:"fa-thin"}},XU=["fa-solid","fa-regular","fa-light","fa-thin","fa-duotone","fa-brands"],A2=["fa","fas","far","fal","fat","fad","fadr","fadl","fadt","fab","fass","fasr","fasl","fast","fasds","fasdr","fasdl","fasdt",...HU,...XU],YU=["solid","regular","light","thin","duotone","brands"],Hk=[1,2,3,4,5,6,7,8,9,10],KU=Hk.concat([11,12,13,14,15,16,17,18,19,20]),JU=[...Object.keys(ZU),...YU,"2xs","xs","sm","lg","xl","2xl","beat","border","fade","beat-fade","bounce","flip-both","flip-horizontal","flip-vert
29ical","flip","fw","inverse","layers-counter","layers-text","layers","li","pull-left","pull-right","pulse","rotate-180","rotate-270","rotate-90","rotate-by","shake","spin-pulse","spin-reverse","spin","stack-1x","stack-2x","stack","ul",Pv.GROUP,Pv.SWAP_OPACITY,Pv.PRIMARY,Pv.SECONDARY].concat(Hk.map(n=>"".concat(n,"x"))).concat(KU.map(n=>"w-".concat(n))),QU={"Font Awesome 5 Free":{900:"fas",400:"far"},"Font Awesome 5 Pro":{900:"fas",400:"far",normal:"far",300:"fal"},"Font Awesome 5 Brands":{400:"fab",normal:"fab"},"Font Awesome 5 Duotone":{900:"fad"}};const Mh="___FONT_AWESOME___",C2=16,Gk="fa",Wk="svg-inline--fa",Pp="data-fa-i2svg",I2="data-fa-pseudo-element",eH="data-fa-pseudo-element-pending",XT="data-prefix",YT="data-icon",cM="fontawesome-i2svg",tH="async",iH=["HTML","HEAD","STYLE","SCRIPT"],qk=(()=>{try{return!0}catch{return!1}})();function Zy(n){return new Proxy(n,{get(t,o){return o in t?t[o]:t[pa]}})}const Zk=_i({},$k);Zk[pa]=_i(_i(_i(_i({},{"fa-duotone":"duotone"}),$k[pa]),aM.kit),aM["kit-duotone"]);const nH=Zy(Zk),M2=_i({},BU);M2[pa]=_i(_i(_i(_i({},{duotone:"fad"}),M2[pa]),lM.kit),lM["kit-duotone"]);const uM=Zy(M2),P2=_i({},E2);P2[pa]=_i(_i({},P2[pa]),UU.kit);const KT=Zy(P2),D2=_i({},qU);D2[pa]=_i(_i({},D2[pa]),$U.kit);Zy(D2);const sH=PU,Xk="fa-layers-text",rH=DU,oH=_i({},OU);Zy(oH);const aH=["class","data-prefix","data-icon","data-fa-transform","data-fa-mask"],Pw=kU,lH=[...VU,...JU],uy=Kd.FontAwesomeConfig||{};function cH(n){var t=Cr.querySelector("script["+n+"]");if(t)return t.getAttribute(n)}function uH(n){return n===""?!0:n==="false"?!1:n==="true"?!0:n}Cr&&typeof Cr.querySelector=="function"&&[["data-family-prefix","familyPrefix"],["data-css-prefix","cssPrefix"],["data-family-default","familyDefault"],["data-style-default","styleDefault"],["data-replacement-class","replacementClass"],["data-auto-replace-svg","autoReplaceSvg"],["data-auto-add-css","autoAddCss"],["data-auto-a11y","autoA11y"],["data-search-pseudo-elements","searchPseudoElements"],["data-observe-mutations","observeMutations"],["data-mutate-approach","mutateApproach"],["data-keep-original-source","keepOriginalSource"],["data-measure-performance","measurePerformance"],["data-show-missing-icons","showMissingIcons"]].forEach(t=>{let[o,u]=t;const d=uH(cH(o));d!=null&&(uy[u]=d)});const Yk={styleDefault:"solid",familyDefault:pa,cssPrefix:Gk,replacementClass:Wk,autoReplaceSvg:!0,autoAddCss:!0,autoA11y:!0,searchPseudoElements:!1,observeMutations:!0,mutateApproach:"async",keepOriginalSource:!0,measurePerformance:!1,showMissingIcons:!0};uy.familyPrefix&&(uy.cssPrefix=uy.familyPrefix);const dg=_i(_i({},Yk),uy);dg.autoReplaceSvg||(dg.observeMutations=!1);const yn={};Object.keys(Yk).forEach(n=>{Object.defineProperty(yn,n,{enumerable:!0,set:function(t){dg[n]=t,hy.forEach(o=>o(yn))},get:function(){return dg[n]}})});Object.defineProperty(yn,"familyPrefix",{enumerable:!0,set:function(n){dg.cssPrefix=n,hy.forEach(t=>t(yn))},get:function(){return dg.cssPrefix}});Kd.FontAwesomeConfig=yn;const hy=[];function hH(n){return hy.push(n),()=>{hy.splice(hy.indexOf(n),1)}}const Ld=C2,vu={size:16,x:0,y:0,rotate:0,flipX:!1,flipY:!1};function dH(n){if(!n||!Rh)return;const t=Cr.createElement("style");t.setAttribute("type","text/css"),t.innerHTML=n;const o=Cr.head.childNodes;let u=null;for(let d=o.length-1;d>-1;d--){const _=o[d],x=(_.tagName||"").toUpperCase();["STYLE","LINK"].indexOf(x)>-1&&(u=_)}return Cr.head.insertBefore(t,u),n}const fH="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";function Iy(){let n=12,t="";for(;n-- >0;)t+=fH[Math.random()*62|0];return t}function Tg(n){const t=[];for(let o=(n||[]).length>>>0;o--;)t[o]=n[o];return t}function JT(n){return n.classList?Tg(n.classList):(n.getAttribute("class")||"").split(" ").filter(t=>t)}function Kk(n){return"".concat(n).replace(/&/g,"&").replace(/"/g,""").replace(/'/g,"'").replace(/</g,"<").replace(/>/g,">")}function pH(n){return Object.keys(n||{}).reduce((t,o)=>t+"".concat(o,'="').concat(Kk(n[o]),'" '),"").trim()}function d1(n){return Object.keys(n||{}).reduce((t,o)=>t+"".concat(o,": ").concat(n[o].trim(),";"),"")}function QT(n){return n.size!==vu.size||n.x!==vu.x||n.y!==vu.y||n.rotate!==vu.rotate||n.flipX||n.flipY}function mH(n){let{transform:t,containerWidth:o,iconWidth:u}=n;const d={transform:"translate(".concat(o/2," 256)")},_="translate(".concat(t.x*32,", ").concat(t.y*32,") "),x="scale(".concat(t.size/16*(t.flipX?-1:1),", ").concat(t.size/16*(t.flipY?-1:1),") "),s="rotate(".concat(t.rotate," 0 0)"),A={transform:"".concat(_," ").concat(x," ").concat(s)},P={transform:"translate(".concat(u/2*-1," -256)")};return{outer:d,inner:A,path:P}}function gH(n){let{transform:t,width:o=C2,height:u=C2,startCentered:d=!1}=n,_="";return d&&Vk?_+="translate(".concat(t.x/Ld-o/2,"em, ").concat(t.y/Ld-u/2,"em) "):d?_+="translate(calc(-50% + ".concat(t.x/Ld,"em), calc(-50% + ").concat(t.y/Ld,"em)) "):_+="translate(".concat(t.x/Ld,"em, ").concat(t.y/Ld,"em) "),_+="scale(".concat(t.size/Ld*(t.flipX?-1:1),", ").concat(t.size/Ld*(t.flipY?-1:1),") "),_+="rotate(".concat(t.rotate,"deg) "),_}var _H=
vendor: 12,335 bytes, lines 29-582
29`:root, :host { 30 --fa-font-solid: normal 900 1em/1 "Font Awesome 6 Free"; 31 --fa-font-regular: normal 400 1em/1 "Font Awesome 6 Free"; 32 --fa-font-light: normal 300 1em/1 "Font Awesome 6 Pro"; 33 --fa-font-thin: normal 100 1em/1 "Font Awesome 6 Pro"; 34 --fa-font-duotone: normal 900 1em/1 "Font Awesome 6 Duotone"; 35 --fa-font-duotone-regular: normal 400 1em/1 "Font Awesome 6 Duotone"; 36 --fa-font-duotone-light: normal 300 1em/1 "Font Awesome 6 Duotone"; 37 --fa-font-duotone-thin: normal 100 1em/1 "Font Awesome 6 Duotone"; 38 --fa-font-brands: normal 400 1em/1 "Font Awesome 6 Brands"; 39 --fa-font-sharp-solid: normal 900 1em/1 "Font Awesome 6 Sharp"; 40 --fa-font-sharp-regular: normal 400 1em/1 "Font Awesome 6 Sharp"; 41 --fa-font-sharp-light: normal 300 1em/1 "Font Awesome 6 Sharp"; 42 --fa-font-sharp-thin: normal 100 1em/1 "Font Awesome 6 Sharp"; 43 --fa-font-sharp-duotone-solid: normal 900 1em/1 "Font Awesome 6 Sharp Duotone"; 44 --fa-font-sharp-duotone-regular: normal 400 1em/1 "Font Awesome 6 Sharp Duotone"; 45 --fa-font-sharp-duotone-light: normal 300 1em/1 "Font Awesome 6 Sharp Duotone"; 46 --fa-font-sharp-duotone-thin: normal 100 1em/1 "Font Awesome 6 Sharp Duotone"; 47} 48 49svg:not(:root).svg-inline--fa, svg:not(:host).svg-inline--fa { 50 overflow: visible; 51 box-sizing: content-box; 52} 53 54.svg-inline--fa { 55 display: var(--fa-display, inline-block); 56 height: 1em; 57 overflow: visible; 58 vertical-align: -0.125em; 59} 60.svg-inline--fa.fa-2xs { 61 vertical-align: 0.1em; 62} 63.svg-inline--fa.fa-xs { 64 vertical-align: 0em; 65} 66.svg-inline--fa.fa-sm { 67 vertical-align: -0.0714285705em; 68} 69.svg-inline--fa.fa-lg { 70 vertical-align: -0.2em; 71} 72.svg-inline--fa.fa-xl { 73 vertical-align: -0.25em; 74} 75.svg-inline--fa.fa-2xl { 76 vertical-align: -0.3125em; 77} 78.svg-inline--fa.fa-pull-left { 79 margin-right: var(--fa-pull-margin, 0.3em); 80 width: auto; 81} 82.svg-inline--fa.fa-pull-right { 83 margin-left: var(--fa-pull-margin, 0.3em); 84 width: auto; 85} 86.svg-inline--fa.fa-li { 87 width: var(--fa-li-width, 2em); 88 top: 0.25em; 89} 90.svg-inline--fa.fa-fw { 91 width: var(--fa-fw-width, 1.25em); 92} 93 94.fa-layers svg.svg-inline--fa { 95 bottom: 0; 96 left: 0; 97 margin: auto; 98 position: absolute; 99 right: 0; 100 top: 0; 101} 102 103.fa-layers-counter, .fa-layers-text { 104 display: inline-block; 105 position: absolute; 106 text-align: center; 107} 108 109.fa-layers { 110 display: inline-block; 111 height: 1em; 112 position: relative; 113 text-align: center; 114 vertical-align: -0.125em; 115 width: 1em; 116} 117.fa-layers svg.svg-inline--fa { 118 transform-origin: center center; 119} 120 121.fa-layers-text { 122 left: 50%; 123 top: 50%; 124 transform: translate(-50%, -50%); 125 transform-origin: center center; 126} 127 128.fa-layers-counter { 129 background-color: var(--fa-counter-background-color, #ff253a); 130 border-radius: var(--fa-counter-border-radius, 1em); 131 box-sizing: border-box; 132 color: var(--fa-inverse, #fff); 133 line-height: var(--fa-counter-line-height, 1); 134 max-width: var(--fa-counter-max-width, 5em); 135 min-width: var(--fa-counter-min-width, 1.5em); 136 overflow: hidden; 137 padding: var(--fa-counter-padding, 0.25em 0.5em); 138 right: var(--fa-right, 0); 139 text-overflow: ellipsis; 140 top: var(--fa-top, 0); 141 transform: scale(var(--fa-counter-scale, 0.25)); 142 transform-origin: top right; 143} 144 145.fa-layers-bottom-right { 146 bottom: var(--fa-bottom, 0); 147 right: var(--fa-right, 0); 148 top: auto; 149 transform: scale(var(--fa-layers-scale, 0.25)); 150 transform-origin: bottom right; 151} 152 153.fa-layers-bottom-left { 154 bottom: var(--fa-bottom, 0); 155 left: var(--fa-left, 0); 156 right: auto; 157 top: auto; 158 transform: scale(var(--fa-layers-scale, 0.25)); 159 transform-origin: bottom left; 160} 161 162.fa-layers-top-right { 163 top: var(--fa-top, 0); 164 right: var(--fa-right, 0); 165 transform: scale(var(--fa-layers-scale, 0.25)); 166 transform-origin: top right; 167} 168 169.fa-layers-top-left { 170 left: var(--fa-left, 0); 171 right: auto; 172 top: var(--fa-top, 0); 173 transform: scale(var(--fa-layers-scale, 0.25)); 174 transform-origin: top left; 175} 176 177.fa-1x { 178 font-size: 1em; 179} 180 181.fa-2x { 182 font-size: 2em; 183} 184 185.fa-3x { 186 font-size: 3em; 187} 188 189.fa-4x { 190 font-size: 4em; 191} 192 193.fa-5x { 194 font-size: 5em; 195} 196 197.fa-6x { 198 font-size: 6em; 199} 200 201.fa-7x { 202 font-size: 7em; 203} 204 205.fa-8x { 206 font-size: 8em; 207} 208 209.fa-9x { 210 font-size: 9em; 211} 212 213.fa-10x { 214 font-size: 10em; 215} 216 217.fa-2xs { 218 font-size: 0.625em; 219 line-height: 0.1em; 220 vertical-align: 0.225em; 221} 222 223.fa-xs { 224 font-size: 0.75em; 225 line-height: 0.0833333337em; 226 vertical-align: 0.125em; 227} 228 229.fa-sm { 230 font-size: 0.875em; 231 line-height: 0.0714285718em; 232 vertical-align: 0.0535714295em; 233} 234 235.fa-lg { 236 font-size: 1.25em; 237 line-height: 0.05em; 238 vertical-align: -0.075em; 239} 240 241.fa-xl { 242 font-size: 1.5em; 243 line-height: 0.0416666682em; 244 vertical-align: -0.125em; 245} 246 247.fa-2xl { 248 font-size: 2em; 249 line-height: 0.03125em; 250 vertical-align: -0.1875em; 251} 252 253.fa-fw { 254 text-align: center; 255 width: 1.25em; 256} 257 258.fa-ul { 259 list-style-type: none; 260 margin-left: var(--fa-li-margin, 2.5em); 261 padding-left: 0; 262} 263.fa-ul > li { 264 position: relative; 265} 266 267.fa-li { 268 left: calc(-1 * var(--fa-li-width, 2em)); 269 position: absolute; 270 text-align: center; 271 width: var(--fa-li-width, 2em); 272 line-height: inherit; 273} 274 275.fa-border { 276 border-color: var(--fa-border-color, #eee); 277 border-radius: var(--fa-border-radius, 0.1em); 278 border-style: var(--fa-border-style, solid); 279 border-width: var(--fa-border-width, 0.08em); 280 padding: var(--fa-border-padding, 0.2em 0.25em 0.15em); 281} 282 283.fa-pull-left { 284 float: left; 285 margin-right: var(--fa-pull-margin, 0.3em); 286} 287 288.fa-pull-right { 289 float: right; 290 margin-left: var(--fa-pull-margin, 0.3em); 291} 292 293.fa-beat { 294 animation-name: fa-beat; 295 animation-delay: var(--fa-animation-delay, 0s); 296 animation-direction: var(--fa-animation-direction, normal); 297 animation-duration: var(--fa-animation-duration, 1s); 298 animation-iteration-count: var(--fa-animation-iteration-count, infinite); 299 animation-timing-function: var(--fa-animation-timing, ease-in-out); 300} 301 302.fa-bounce { 303 animation-name: fa-bounce; 304 animation-delay: var(--fa-animation-delay, 0s); 305 animation-direction: var(--fa-animation-direction, normal); 306 animation-duration: var(--fa-animation-duration, 1s); 307 animation-iteration-count: var(--fa-animation-iteration-count, infinite); 308 animation-timing-function: var(--fa-animation-timing, cubic-bezier(0.28, 0.84, 0.42, 1)); 309} 310 311.fa-fade { 312 animation-name: fa-fade; 313 animation-delay: var(--fa-animation-delay, 0s); 314 animation-direction: var(--fa-animation-direction, normal); 315 animation-duration: var(--fa-animation-duration, 1s); 316 animation-iteration-count: var(--fa-animation-iteration-count, infinite); 317 animation-timing-function: var(--fa-animation-timing, cubic-bezier(0.4, 0, 0.6, 1)); 318} 319 320.fa-beat-fade { 321 animation-name: fa-beat-fade; 322 animation-delay: var(--fa-animation-delay, 0s); 323 animation-direction: var(--fa-animation-direction, normal); 324 animation-duration: var(--fa-animation-duration, 1s); 325 animation-iteration-count: var(--fa-animation-iteration-count, infinite); 326 animation-timing-function: var(--fa-animation-timing, cubic-bezier(0.4, 0, 0.6, 1)); 327} 328 329.fa-flip { 330 animation-name: fa-flip; 331 animation-delay: var(--fa-animation-delay, 0s); 332 animation-direction: var(--fa-animation-direction, normal); 333 animation-duration: var(--fa-animation-duration, 1s); 334 animation-iteration-count: var(--fa-animation-iteration-count, infinite); 335 animation-timing-function: var(--fa-animation-timing, ease-in-out); 336} 337 338.fa-shake { 339 animation-name: fa-shake; 340 animation-delay: var(--fa-animation-delay, 0s); 341 animation-direction: var(--fa-animation-direction, normal); 342 animation-duration: var(--fa-animation-duration, 1s); 343 animation-iteration-count: var(--fa-animation-iteration-count, infinite); 344 animation-timing-function: var(--fa-animation-timing, linear); 345} 346 347.fa-spin { 348 animation-name: fa-spin; 349 animation-delay: var(--fa-animation-delay, 0s); 350 animation-direction: var(--fa-animation-direction, normal); 351 animation-duration: var(--fa-animation-duration, 2s); 352 animation-iteration-count: var(--fa-animation-iteration-count, infinite); 353 animation-timing-function: var(--fa-animation-timing, linear); 354} 355 356.fa-spin-reverse { 357 --fa-animation-direction: reverse; 358} 359 360.fa-pulse, 361.fa-spin-pulse { 362 animation-name: fa-spin; 363 animation-direction: var(--fa-animation-direction, normal); 364 animation-duration: var(--fa-animation-duration, 1s); 365 animation-iteration-count: var(--fa-animation-iteration-count, infinite); 366 animation-timing-function: var(--fa-animation-timing, steps(8)); 367} 368 369@media (prefers-reduced-motion: reduce) { 370 .fa-beat, 371.fa-bounce, 372.fa-fade, 373.fa-beat-fade, 374.fa-flip, 375.fa-pulse, 376.fa-shake, 377.fa-spin, 378.fa-spin-pulse { 379 animation-delay: -1ms; 380 animation-duration: 1ms; 381 animation-iteration-count: 1; 382 transition-delay: 0s; 383 transition-duration: 0s; 384 } 385} 386@keyframes fa-beat { 387 0%, 90% { 388 transform: scale(1); 389 } 390 45% { 391 transform: scale(var(--fa-beat-scale, 1.25)); 392 } 393} 394@keyframes fa-bounce { 395 0% { 396 transform: scale(1, 1) translateY(0); 397 } 398 10% { 399 transform: scale(var(--fa-bounce-start-scale-x, 1.1), var(--fa-bounce-start-scale-y, 0.9)) translateY(0); 400 } 401 30% { 402 transform: scale(var(--fa-bounce-jump-scale-x, 0.9), var(--fa-bounce-jump-scale-y, 1.1)) translateY(var(--fa-bounce-height, -0.5em)); 403 } 404 50% { 405 transform: scale(var(--fa-bounce-land-scale-x, 1.05), var(--fa-bounce-land-scale-y, 0.95)) translateY(0); 406 } 407 57% { 408 transform: scale(1, 1) translateY(var(--fa-bounce-rebound, -0.125em)); 409 } 410 64% { 411 transform: scale(1, 1) translateY(0); 412 } 413 100% { 414 transform: scale(1, 1) translateY(0); 415 } 416} 417@keyframes fa-fade { 418 50% { 419 opacity: var(--fa-fade-opacity, 0.4); 420 } 421} 422@keyframes fa-beat-fade { 423 0%, 100% { 424 opacity: var(--fa-beat-fade-opacity, 0.4); 425 transform: scale(1); 426 } 427 50% { 428 opacity: 1; 429 transform: scale(var(--fa-beat-fade-scale, 1.125)); 430 } 431} 432@keyframes fa-flip { 433 50% { 434 transform: rotate3d(var(--fa-flip-x, 0), var(--fa-flip-y, 1), var(--fa-flip-z, 0), var(--fa-flip-angle, -180deg)); 435 } 436} 437@keyframes fa-shake { 438 0% { 439 transform: rotate(-15deg); 440 } 441 4% { 442 transform: rotate(15deg); 443 } 444 8%, 24% { 445 transform: rotate(-18deg); 446 } 447 12%, 28% { 448 transform: rotate(18deg); 449 } 450 16% { 451 transform: rotate(-22deg); 452 } 453 20% { 454 transform: rotate(22deg); 455 } 456 32% { 457 transform: rotate(-12deg); 458 } 459 36% { 460 transform: rotate(12deg); 461 } 462 40%, 100% { 463 transform: rotate(0deg); 464 } 465} 466@keyframes fa-spin { 467 0% { 468 transform: rotate(0deg); 469 } 470 100% { 471 transform: rotate(360deg); 472 } 473} 474.fa-rotate-90 { 475 transform: rotate(90deg); 476} 477 478.fa-rotate-180 { 479 transform: rotate(180deg); 480} 481 482.fa-rotate-270 { 483 transform: rotate(270deg); 484} 485 486.fa-flip-horizontal { 487 transform: scale(-1, 1); 488} 489 490.fa-flip-vertical { 491 transform: scale(1, -1); 492} 493 494.fa-flip-both, 495.fa-flip-horizontal.fa-flip-vertical { 496 transform: scale(-1, -1); 497} 498 499.fa-rotate-by { 500 transform: rotate(var(--fa-rotate-angle, 0)); 501} 502 503.fa-stack { 504 display: inline-block; 505 vertical-align: middle; 506 height: 2em; 507 position: relative; 508 width: 2.5em; 509} 510 511.fa-stack-1x, 512.fa-stack-2x { 513 bottom: 0; 514 left: 0; 515 margin: auto; 516 position: absolute; 517 right: 0; 518 top: 0; 519 z-index: var(--fa-stack-z-index, auto); 520} 521 522.svg-inline--fa.fa-stack-1x { 523 height: 1em; 524 width: 1.25em; 525} 526.svg-inline--fa.fa-stack-2x { 527 height: 2em; 528 width: 2.5em; 529} 530 531.fa-inverse { 532 color: var(--fa-inverse, #fff); 533} 534 535.sr-only, 536.fa-sr-only { 537 position: absolute; 538 width: 1px; 539 height: 1px; 540 padding: 0; 541 margin: -1px; 542 overflow: hidden; 543 clip: rect(0, 0, 0, 0); 544 white-space: nowrap; 545 border-width: 0; 546} 547 548.sr-only-focusable:not(:focus), 549.fa-sr-only-focusable:not(:focus) { 550 position: absolute; 551 width: 1px; 552 height: 1px; 553 padding: 0; 554 margin: -1px; 555 overflow: hidden; 556 clip: rect(0, 0, 0, 0); 557 white-space: nowrap; 558 border-width: 0; 559} 560 561.svg-inline--fa .fa-primary { 562 fill: var(--fa-primary-color, currentColor); 563 opacity: var(--fa-primary-opacity, 1); 564} 565 566.svg-inline--fa .fa-secondary { 567 fill: var(--fa-secondary-color, currentColor); 568 opacity: var(--fa-secondary-opacity, 0.4); 569} 570 571.svg-inline--fa.fa-swap-opacity .fa-primary { 572 opacity: var(--fa-secondary-opacity, 0.4); 573} 574 575.svg-inline--fa.fa-swap-opacity .fa-secondary { 576 opacity: var(--fa-primary-opacity, 1); 577} 578 579.svg-inline--fa mask .fa-primary, 580.svg-inline--fa mask .fa-secondary { 581 fill: black; 582}`;
582function Jk(){const n=Gk,t=Wk,o=yn.cssPrefix,u=yn.replacementClass;let d=_H;if(o!==n||u!==t){const _=new RegExp("\\.".concat(n,"\\-"),"g"),x=new RegExp("\\--".concat(n,"\\-"),"g"),s=new RegExp("\\.".concat(t),"g");d=d.replace(_,".".concat(o,"-")).replace(x,"--".concat(o,"-")).replace(s,".".concat(u))}return d}let hM=!1;function Dw(){yn.autoAddCss&&!hM&&(dH(Jk()),hM=!0)}var yH={mixout(){return{dom:{css:Jk,insertCss:Dw}}},hooks(){return{beforeDOMElementCreation(){Dw()},beforeI2svg(){Dw()}}}};const Ph=Kd||{};Ph[Mh]||(Ph[Mh]={});Ph[Mh].styles||(Ph[Mh].styles={});Ph[Mh].hooks||(Ph[Mh].hooks={});Ph[Mh].shims||(Ph[Mh].shims=[]);var xu=Ph[Mh];const Qk=[],eL=function(){Cr.removeEventListener("DOMContentLoaded",eL),Ix=1,Qk.map(n=>n())};let Ix=!1;Rh&&(Ix=(Cr.documentElement.doScroll?/^loaded|^c/:/^loaded|^i|^c/).test(Cr.readyState),Ix||Cr.addEventListener("DOMContentLoaded",eL));function vH(n){Rh&&(Ix?setTimeout(n,0):Qk.push(n))}function Xy(n){const{tag:t,attributes:o={},children:u=[]}=n;return typeof n=="string"?Kk(n):"<".concat(t," ").concat(pH(o),">").concat(u.map(Xy).join(""),"</").concat(t,">")}function dM(n,t,o){if(n&&n[t]&&n[t][o])return{prefix:t,iconName:o,icon:n[t][o]}}var kw=function(t,o,u,d){var _=Object.keys(t),x=_.length,s=o,A,P,R;for(u===void 0?(A=1,R=t[_[0]]):(A=0,R=u);A<x;A++)P=_[A],R=s(R,t[P],P,t);return R};function xH(n){const t=[];let o=0;const u=n.length;for(;o<u;){const d=n.charCodeAt(o++);if(d>=55296&&d<=56319&&o<u){const _=n.charCodeAt(o++);(_&64512)==56320?t.push(((d&1023)<<10)+(_&1023)+65536):(t.push(d),o--)}else t.push(d)}return t}function k2(n){const t=xH(n);return t.length===1?t[0].toString(16):null}function bH(n,t){const o=n.length;let u=n.charCodeAt(t),d;return u>=55296&&u<=56319&&o>t+1&&(d=n.charCodeAt(t+1),d>=56320&&d<=57343)?(u-55296)*1024+d-56320+65536:u}function fM(n){return Object.keys(n).reduce((t,o)=>{const u=n[o];return!!u.icon?t[u.iconName]=u.icon:t[o]=u,t},{})}function L2(n,t){let o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};const{skipHooks:u=!1}=o,d=fM(t);typeof xu.hooks.addPack=="function"&&!u?xu.hooks.addPack(n,fM(t)):xu.styles[n]=_i(_i({},xu.styles[n]||{}),d),n==="fas"&&L2("fa",t)}const{styles:My,shims:wH}=xu,tL=Object.keys(KT),TH=tL.reduce((n,t)=>(n[t]=Object.keys(KT[t]),n),{});let eS=null,iL={},nL={},sL={},rL={},oL={};function SH(n){return~lH.indexOf(n)}function EH(n,t){const o=t.split("-"),u=o[0],d=o.slice(1).join("-");return u===n&&d!==""&&!SH(d)?d:null}const aL=()=>{const n=u=>kw(My,(d,_,x)=>(d[x]=kw(_,u,{}),d),{});iL=n((u,d,_)=>(d[3]&&(u[d[3]]=_),d[2]&&d[2].filter(s=>typeof s=="number").forEach(s=>{u[s.toString(16)]=_}),u)),nL=n((u,d,_)=>(u[_]=_,d[2]&&d[2].filter(s=>typeof s=="string").forEach(s=>{u[s]=_}),u)),oL=n((u,d,_)=>{const x=d[2];return u[_]=_,x.forEach(s=>{u[s]=_}),u});const t="far"in My||yn.autoFetchSvg,o=kw(wH,(u,d)=>{const _=d[0];let x=d[1];const s=d[2];return x==="far"&&!t&&(x="fas"),typeof _=="string"&&(u.names[_]={prefix:x,iconName:s}),typeof _=="number"&&(u.unicodes[_.toString(16)]={prefix:x,iconName:s}),u},{names:{},unicodes:{}});sL=o.names,rL=o.unicodes,eS=f1(yn.styleDefault,{family:yn.familyDefault})};hH(n=>{eS=f1(n.styleDefault,{family:yn.familyDefault})});aL();function tS(n,t){return(iL[n]||{})[t]}function AH(n,t){return(nL[n]||{})[t]}function gp(n,t){return(oL[n]||{})[t]}function lL(n){return sL[n]||{prefix:null,iconName:null}}function CH(n){const t=rL[n],o=tS("fas",n);return t||(o?{prefix:"fas",iconName:o}:null)||{prefix:null,iconName:null}}function Jd(){return eS}const cL=()=>({prefix:null,iconName:null,rest:[]}
582);function IH(n){let t=pa;const o=tL.reduce((u,d)=>(u[d]="".concat(yn.cssPrefix,"-").concat(d),u),{});return Uk.forEach(u=>{(n.includes(o[u])||n.some(d=>TH[u].includes(d)))&&(t=u)}),t}function f1(n){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const{family:o=pa}=t,u=nH[o][n];if(o===h1&&!n)return"fad";const d=uM[o][n]||uM[o][u],_=n in xu.styles?n:null;return d||_||null}function MH(n){let t=[],o=null;return n.forEach(u=>{const d=EH(yn.cssPrefix,u);d?o=d:u&&t.push(u)}),{iconName:o,rest:t}}function pM(n){return n.sort().filter((t,o,u)=>u.indexOf(t)===o)}function p1(n){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const{skipLookups:o=!1}=t;let u=null;const d=A2.concat(GU),_=pM(n.filter(V=>d.includes(V))),x=pM(n.filter(V=>!A2.includes(V))),s=_.filter(V=>(u=V,!jk.includes(V))),[A=null]=s,P=IH(_),R=_i(_i({},MH(x)),{},{prefix:f1(A,{family:P})});return _i(_i(_i({},R),LH({values:n,family:P,styles:My,config:yn,canonical:R,givenPrefix:u})),PH(o,u,R))}function PH(n,t,o){let{prefix:u,iconName:d}=o;if(n||!u||!d)return{prefix:u,iconName:d};const _=t==="fa"?lL(d):{},x=gp(u,d);return d=_.iconName||x||d,u=_.prefix||u,u==="far"&&!My.far&&My.fas&&!yn.autoFetchSvg&&(u="fas"),{prefix:u,iconName:d}}const DH=Uk.filter(n=>n!==pa||n!==h1),kH=Object.keys(E2).filter(n=>n!==pa).map(n=>Object.keys(E2[n])).flat();function LH(n){const{values:t,family:o,canonical:u,givenPrefix:d="",styles:_={},config:x={}}=n,s=o===h1,A=t.includes("fa-duotone")||t.includes("fad"),P=x.familyDefault==="duotone",R=u.prefix==="fad"||u.prefix==="fa-duotone";if(!s&&(A||P||R)&&(u.prefix="fad"),(t.includes("fa-brands")||t.includes("fab"))&&(u.prefix="fab"),!u.prefix&&DH.includes(o)&&(Object.keys(_).find(j=>kH.includes(j))||x.autoFetchSvg)){const j=FU.get(o).defaultShortPrefixId;u.prefix=j,u.iconName=gp(u.prefix,u.iconName)||u.iconName}return(u.prefix==="fa"||d==="fa")&&(u.prefix=Jd()||"fas"),u}class RH{constructor(){this.definitions={}}add(){for(var t=arguments.length,o=new Array(t),u=0;u<t;u++)o[u]=arguments[u];const d=o.reduce(this._pullDefinitions,{});Object.keys(d).forEach(_=>{this.definitions[_]=_i(_i({},this.definitions[_]||{}),d[_]),L2(_,d[_]);const x=KT[pa][_];x&&L2(x,d[_]),aL()})}reset(){this.definitions={}}_pullDefinitions(t,o){const u=o.prefix&&o.iconName&&o.icon?{0:o}:o;return Object.keys(u).map(d=>{const{prefix:_,iconName:x,icon:s}=u[d],A=s[2];t[_]||(t[_]={}),A.length>0&&A.forEach(P=>{typeof P=="string"&&(t[_][P]=s)}),t[_][x]=s}),t}}let mM=[],Zm={};const tg={},OH=Object.keys(tg);function zH(n,t){let{mixoutsTo:o}=t;return mM=n,Zm={},Object.keys(tg).forEach(u=>{OH.indexOf(u)===-1&&delete tg[u]}),mM.forEach(u=>{const d=u.mixout?u.mixout():{};if(Object.keys(d).forEach(_=>{typeof d[_]=="function"&&(o[_]=d[_]),typeof d[_]=="object"&&Object.keys(d[_]).forEach(x=>{o[_]||(o[_]={}),o[_][x]=d[_][x]})}),u.hooks){const _=u.hooks();Object.keys(_).forEach(x=>{Zm[x]||(Zm[x]=[]),Zm[x].push(_[x])})}u.provides&&u.provides(tg)}),o}function R2(n,t){for(var o=arguments.length,u=new Array(o>2?o-2:0),d=2;d<o;d++)u[d-2]=arguments[d];return(Zm[n]||[]).forEach(x=>{t=x.apply(null,[t,...u])}),t}function Dp(n){for(var t=arguments.length,o=new Array(t>1?t-1:0),u=1;u<t;u++)o[u-1]=arguments[u];(Zm[n]||[]).forEach(_=>{_.apply(null,o)})}function Qd(){const n=arguments[0],t=Array.prototype.slice.call(arguments,1);return tg[n]?tg[n].apply(null,t):void 0}function O2(n){n.prefix==="fa"&&(n.prefix="fas");let{iconName:t}=n;const o=n.prefix||Jd();if(t)return t=gp(o,t)||t,dM(uL.definitions,o,t)||dM(xu.styles,o,t)}const uL=new RH,FH=()=>{yn.autoReplaceSvg=!1,yn.observeMutations=!1,Dp("noAuto")},BH={i2svg:function(){let n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return Rh?(Dp("beforeI2svg",n),Qd("pseudoElements2svg",n),Qd("i2svg",n)):Promise.reject(new Error("Operation requires a DOM of some kind."))},watch:function(){let n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};const{autoReplaceSvgRoot:t}=n;yn.autoReplaceSvg===!1&&(yn.autoReplaceSvg=!0),yn.observeMutations=!0,vH(()=>{VH({autoReplaceSvgRoot:t}),Dp("watch",n)})}},NH={icon:n=>{if(n===null)return null;if(typeof n=="object"&&n.prefix&&n.iconName)return{prefix:n.prefix,iconName:gp(n.prefix,n.iconName)||n.iconName};if(Array.isArray(n)&&n.length===2){const t=n[1].indexOf("fa-")===0?n[1].slice(3):n[1],o=f1(n[0]);return{prefix:o,iconName:gp(o,t)||t}}if(typeof n=="string"&&(n.indexOf("".concat(yn.cssPrefix,"-"))>-1||n.match(sH))){const t=p1(n.split(" "),{skipLookups:!0});return{prefix:t.prefix||Jd(),iconName:gp(t.prefix,t.iconName)||t.iconName}}if(typeof n=="string"){const t=Jd();return{prefix:t,iconName:gp(t,n)||n}}}},Sl={noAuto:FH,config:yn,dom:BH,parse:NH,library:uL,findIconDefinition:O2,toHtml:Xy},VH=function(){let n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};const{autoReplaceSvgRoot:t=Cr}=n;(Object.keys(xu.styles).length>0||yn.autoFetchSvg)&&Rh&&yn.autoReplaceSvg&&Sl.dom.i2svg({node:t})};function m1(n,t){return Object.defineProperty(n,"abstract",{get:t}),Object.defineProperty(n,"html",{get:function(){return n.abstract.map(o=>Xy(o))}}),Object.defineProperty(n,"node",{get:function(){if(!Rh)return;const o=Cr.createElement("div");return o.innerHTML=n.html,o.children}}),n}function $H(n){let{children:t,main:o,mask:u,attributes:d,styles:_,transform:x}=n;
582if(QT(x)&&o.found&&!u.found){const{width:s,height:A}=o,P={x:s/A/2,y:.5};d.style=d1(_i(_i({},_),{},{"transform-origin":"".concat(P.x+x.x/16,"em ").concat(P.y+x.y/16,"em")}))}return[{tag:"svg",attributes:d,children:t}]}function jH(n){let{prefix:t,iconName:o,children:u,attributes:d,symbol:_}=n;const x=_===!0?"".concat(t,"-").concat(yn.cssPrefix,"-").concat(o):_;return[{tag:"svg",attributes:{style:"display: none;"},children:[{tag:"symbol",attributes:_i(_i({},d),{},{id:x}),children:u}]}]}function iS(n){const{icons:{main:t,mask:o},prefix:u,iconName:d,transform:_,symbol:x,title:s,maskId:A,titleId:P,extra:R,watchable:V=!1}=n,{width:j,height:Q}=o.found?o:t,me=jU.includes(u),re=[yn.replacementClass,d?"".concat(yn.cssPrefix,"-").concat(d):""].filter(Je=>R.classes.indexOf(Je)===-1).filter(Je=>Je!==""||!!Je).concat(R.classes).join(" ");let be={children:[],attributes:_i(_i({},R.attributes),{},{"data-prefix":u,"data-icon":d,class:re,role:R.attributes.role||"img",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 ".concat(j," ").concat(Q)})};const ve=me&&!~R.classes.indexOf("fa-fw")?{width:"".concat(j/Q*16*.0625,"em")}:{};V&&(be.attributes[Pp]=""),s&&(be.children.push({tag:"title",attributes:{id:be.attributes["aria-labelledby"]||"title-".concat(P||Iy())},children:[s]}),delete be.attributes.title);const Ee=_i(_i({},be),{},{prefix:u,iconName:d,main:t,mask:o,maskId:A,transform:_,symbol:x,styles:_i(_i({},ve),R.styles)}),{children:je,attributes:Ve}=o.found&&t.found?Qd("generateAbstractMask",Ee)||{children:[],attributes:{}}:Qd("generateAbstractIcon",Ee)||{children:[],attributes:{}};return Ee.children=je,Ee.attributes=Ve,x?jH(Ee):$H(Ee)}function gM(n){const{content:t,width:o,height:u,transform:d,title:_,extra:x,watchable:s=!1}=n,A=_i(_i(_i({},x.attributes),_?{title:_}:{}),{},{class:x.classes.join(" ")});s&&(A[Pp]="");const P=_i({},x.styles);QT(d)&&(P.transform=gH({transform:d,startCentered:!0,width:o,height:u}),P["-webkit-transform"]=P.transform);const R=d1(P);R.length>0&&(A.style=R);const V=[];return V.push({tag:"span",attributes:A,children:[t]}),_&&V.push({tag:"span",attributes:{class:"sr-only"},children:[_]}),V}function UH(n){const{content:t,title:o,extra:u}=n,d=_i(_i(_i({},u.attributes),o?{title:o}:{}),{},{class:u.classes.join(" ")}),_=d1(u.styles);_.length>0&&(d.style=_);const x=[];return x.push({tag:"span",attributes:d,children:[t]}),o&&x.push({tag:"span",attributes:{class:"sr-only"},children:[o]}),x}const{styles:Lw}=xu;function z2(n){const t=n[0],o=n[1],[u]=n.slice(4);let d=null;return Array.isArray(u)?d={tag:"g",attributes:{class:"".concat(yn.cssPrefix,"-").concat(Pw.GROUP)},children:[{tag:"path",attributes:{class:"".concat(yn.cssPrefix,"-").concat(Pw.SECONDARY),fill:"currentColor",d:u[0]}},{tag:"path",attributes:{class:"".concat(yn.cssPrefix,"-").concat(Pw.PRIMARY),fill:"currentColor",d:u[1]}}]}:d={tag:"path",attributes:{fill:"currentColor",d:u}},{found:!0,width:t,height:o,icon:d}}const HH={found:!1,width:512,height:512};function GH(n,t){!qk&&!yn.showMissingIcons&&n&&console.error('Icon with name "'.concat(n,'" and prefix "').concat(t,'" is missing.'))}function F2(n,t){let o=t;return t==="fa"&&yn.styleDefault!==null&&(t=Jd()),new Promise((u,d)=>{if(o==="fa"){const _=lL(n);n=_.iconName||n,t=_.prefix||t}if(n&&t&&Lw[t]&&Lw[t][n]){const _=Lw[t][n];return u(z2(_))}GH(n,t),u(_i(_i({},HH),{},{icon:yn.showMissingIcons&&n?Qd("missingIconAbstract")||{}:{}}))})}const _M=()=>{},B2=yn.measurePerformance&&Mv&&Mv.mark&&Mv.measure?Mv:{mark:_M,measure:_M},W_='FA "6.7.2"',WH=n=>(B2.mark("".concat(W_," ").concat(n," begins")),()=>hL(n)),hL=n=>{B2.mark("".concat(W_," ").concat(n," ends")),B2.measure("".concat(W_," ").concat(n),"".concat(W_," ").concat(n," begins"),"".concat(W_," ").concat(n," ends"))};var nS={begin:WH,end:hL};const nx=()=>{};function yM(n){return typeof(n.getAttribute?n.getAttribute(Pp):null)=="string"}function qH(n){const t=n.getAttribute?n.getAttribute(XT):null,o=n.getAttribute?n.getAttribute(YT):null;return t&&o}function ZH(n){return n&&n.classList&&n.classList.contains&&n.classList.contains(yn.replacementClass)}function XH(){return yn.autoReplaceSvg===!0?sx.replace:sx[yn.autoReplaceSvg]||sx.replace}function YH(n){return Cr.createElementNS("http://www.w3.org/2000/svg",n)}function KH(n){return Cr.createElement(n)}function dL(n){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const{ceFn:o=n.tag==="svg"?YH:KH}=t;if(typeof n=="string")return Cr.createTextNode(n);const u=o(n.tag);
582return Object.keys(n.attributes||[]).forEach(function(_){u.setAttribute(_,n.attributes[_])}),(n.children||[]).forEach(function(_){u.appendChild(dL(_,{ceFn:o}))}),u}function JH(n){let t=" ".concat(n.outerHTML," ");return t="".concat(t,"Font Awesome fontawesome.com "),t}const sx={replace:function(n){const t=n[0];if(t.parentNode)if(n[1].forEach(o=>{t.parentNode.insertBefore(dL(o),t)}),t.getAttribute(Pp)===null&&yn.keepOriginalSource){let o=Cr.createComment(JH(t));t.parentNode.replaceChild(o,t)}else t.remove()},nest:function(n){const t=n[0],o=n[1];if(~JT(t).indexOf(yn.replacementClass))return sx.replace(n);const u=new RegExp("".concat(yn.cssPrefix,"-.*"));if(delete o[0].attributes.id,o[0].attributes.class){const _=o[0].attributes.class.split(" ").reduce((x,s)=>(s===yn.replacementClass||s.match(u)?x.toSvg.push(s):x.toNode.push(s),x),{toNode:[],toSvg:[]});o[0].attributes.class=_.toSvg.join(" "),_.toNode.length===0?t.removeAttribute("class"):t.setAttribute("class",_.toNode.join(" "))}const d=o.map(_=>Xy(_)).join(` 583`);t.setAttribute(Pp,""),t.innerHTML=d}};function vM(n){n()}function fL(n,t){const o=typeof t=="function"?t:nx;if(n.length===0)o();else{let u=vM;yn.mutateApproach===tH&&(u=Kd.requestAnimationFrame||vM),u(()=>{const d=XH(),_=nS.begin("mutate");n.map(d),_(),o()})}}let sS=!1;function pL(){sS=!0}function N2(){sS=!1}let Mx=null;function xM(n){if(!oM||!yn.observeMutations)return;const{treeCallback:t=nx,nodeCallback:o=nx,pseudoElementsCallback:u=nx,observeMutationsRoot:d=Cr}=n;Mx=new oM(_=>{if(sS)return;const x=Jd();Tg(_).forEach(s=>{if(s.type==="childList"&&s.addedNodes.length>0&&!yM(s.addedNodes[0])&&(yn.searchPseudoElements&&u(s.target),t(s.target)),s.type==="attributes"&&s.target.parentNode&&yn.searchPseudoElements&&u(s.target.parentNode),s.type==="attributes"&&yM(s.target)&&~aH.indexOf(s.attributeName))if(s.attributeName==="class"&&qH(s.target)){const{prefix:A,iconName:P}=p1(JT(s.target));s.target.setAttribute(XT,A||x),P&&s.target.setAttribute(YT,P)}else ZH(s.target)&&o(s.target)})}),Rh&&Mx.observe(d,{childList:!0,attributes:!0,characterData:!0,subtree:!0})}function QH(){Mx&&Mx.disconnect()}function eG(n){const t=n.getAttribute("style");let o=[];return t&&(o=t.split(";").reduce((u,d)=>{const _=d.split(":"),x=_[0],s=_.slice(1);return x&&s.length>0&&(u[x]=s.join(":").trim()),u},{})),o}function tG(n){const t=n.getAttribute("data-prefix"),o=n.getAttribute("data-icon"),u=n.innerText!==void 0?n.innerText.trim():"";let d=p1(JT(n));return d.prefix||(d.prefix=Jd()),t&&o&&(d.prefix=t,d.iconName=o),d.iconName&&d.prefix||(d.prefix&&u.length>0&&(d.iconName=AH(d.prefix,n.innerText)||tS(d.prefix,k2(n.innerText))),!d.iconName&&yn.autoFetchSvg&&n.firstChild&&n.firstChild.nodeType===Node.TEXT_NODE&&(d.iconName=n.firstChild.data)),d}function iG(n){const t=Tg(n.attributes).reduce((d,_)=>(d.name!=="class"&&d.name!=="style"&&(d[_.name]=_.value),d),{}),o=n.getAttribute("title"),u=n.getAttribute("data-fa-title-id");return yn.autoA11y&&(o?t["aria-labelledby"]="".concat(yn.replacementClass,"-title-").concat(u||Iy()):(t["aria-hidden"]="true",t.focusable="false")),t}function nG(){return{iconName:null,title:null,titleId:null,prefix:null,transform:vu,symbol:!1,mask:{iconName:null,prefix:null,rest:[]},maskId:null,extra:{classes:[],styles:{},attributes:{}}}}function bM(n){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{styleParser:!0};const{iconName:o,prefix:u,rest:d}=tG(n),_=iG(n),x=R2("parseNodeAttributes",{},n);let s=t.styleParser?eG(n):[];return _i({iconName:o,title:n.getAttribute("title"),titleId:n.getAttribute("data-fa-title-id"),prefix:u,transform:vu,mask:{iconName:null,prefix:null,rest:[]},maskId:null,symbol:!1,extra:{classes:d,styles:s,attributes:_}},x)}const{styles:sG}=xu;function mL(n){const t=yn.autoReplaceSvg==="nest"?bM(n,{styleParser:!1}):bM(n);return~t.extra.classes.indexOf(Xk)?Qd("generateLayersText",n,t):Qd("generateSvgReplacementMutation",n,t)}function rG(){return[...NU,...A2]}function wM(n){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;if(!Rh)return Promise.resolve();const o=Cr.documentElement.classList,u=R=>o.add("".concat(cM,"-").concat(R)),d=R=>o.remove("".concat(cM,"-").concat(R)),_=yn.autoFetchSvg?rG():jk.concat(Object.keys(sG));_.includes("fa")||_.push("fa");const x=[".".concat(Xk,":not([").concat(Pp,"])")].concat(_.map(R=>".".concat(R,":not([").concat(Pp,"])"))).join(", ");
583if(x.length===0)return Promise.resolve();let s=[];try{s=Tg(n.querySelectorAll(x))}catch{}if(s.length>0)u("pending"),d("complete");else return Promise.resolve();const A=nS.begin("onTree"),P=s.reduce((R,V)=>{try{const j=mL(V);j&&R.push(j)}catch(j){qk||j.name==="MissingIcon"&&console.error(j)}return R},[]);return new Promise((R,V)=>{Promise.all(P).then(j=>{fL(j,()=>{u("active"),u("complete"),d("pending"),typeof t=="function"&&t(),A(),R()})}).catch(j=>{A(),V(j)})})}function oG(n){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;mL(n).then(o=>{o&&fL([o],t)})}function aG(n){return function(t){let o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const u=(t||{}).icon?t:O2(t||{});let{mask:d}=o;return d&&(d=(d||{}).icon?d:O2(d||{})),n(u,_i(_i({},o),{},{mask:d}))}}const lG=function(n){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const{transform:o=vu,symbol:u=!1,mask:d=null,maskId:_=null,title:x=null,titleId:s=null,classes:A=[],attributes:P={},styles:R={}}=t;if(!n)return;const{prefix:V,iconName:j,icon:Q}=n;return m1(_i({type:"icon"},n),()=>(Dp("beforeDOMElementCreation",{iconDefinition:n,params:t}),yn.autoA11y&&(x?P["aria-labelledby"]="".concat(yn.replacementClass,"-title-").concat(s||Iy()):(P["aria-hidden"]="true",P.focusable="false")),iS({icons:{main:z2(Q),mask:d?z2(d.icon):{found:!1,width:null,height:null,icon:{}}},prefix:V,iconName:j,transform:_i(_i({},vu),o),symbol:u,title:x,maskId:_,titleId:s,extra:{attributes:P,styles:R,classes:A}})))};var cG={mixout(){return{icon:aG(lG)}},hooks(){return{mutationObserverCallbacks(n){return n.treeCallback=wM,n.nodeCallback=oG,n}}},provides(n){n.i2svg=function(t){const{node:o=Cr,callback:u=()=>{}}=t;return wM(o,u)},n.generateSvgReplacementMutation=function(t,o){const{iconName:u,title:d,titleId:_,prefix:x,transform:s,symbol:A,mask:P,maskId:R,extra:V}=o;return new Promise((j,Q)=>{Promise.all([F2(u,x),P.iconName?F2(P.iconName,P.prefix):Promise.resolve({found:!1,width:512,height:512,icon:{}})]).then(me=>{let[re,be]=me;j([t,iS({icons:{main:re,mask:be},prefix:x,iconName:u,transform:s,symbol:A,maskId:R,title:d,titleId:_,extra:V,watchable:!0})])}).catch(Q)})},n.generateAbstractIcon=function(t){let{children:o,attributes:u,main:d,transform:_,styles:x}=t;const s=d1(x);s.length>0&&(u.style=s);let A;return QT(_)&&(A=Qd("generateAbstractTransformGrouping",{main:d,transform:_,containerWidth:d.width,iconWidth:d.width})),o.push(A||d.icon),{children:o,attributes:u}}}},uG={mixout(){return{layer(n){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const{classes:o=[]}=t;return m1({type:"layer"},()=>{Dp("beforeDOMElementCreation",{assembler:n,params:t});let u=[];return n(d=>{Array.isArray(d)?d.map(_=>{u=u.concat(_.abstract)}):u=u.concat(d.abstract)}),[{tag:"span",attributes:{class:["".concat(yn.cssPrefix,"-layers"),...o].join(" ")},children:u}]})}}}},hG={mixout(){return{counter(n){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const{title:o=null,classes:u=[],attributes:d={},styles:_={}}=t;return m1({type:"counter",content:n},()=>(Dp("beforeDOMElementCreation",{content:n,params:t}),UH({content:n.toString(),title:o,extra:{attributes:d,styles:_,classes:["".concat(yn.cssPrefix,"-layers-counter"),...u]}})))}}}},dG={mixout(){return{text(n){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const{transform:o=vu,title:u=null,classes:d=[],attributes:_={},styles:x={}}=t;return m1({type:"text",content:n},()=>(Dp("beforeDOMElementCreation",{content:n,params:t}),gM({content:n,transform:_i(_i({},vu),o),title:u,extra:{attributes:_,styles:x,classes:["".concat(yn.cssPrefix,"-layers-text"),...d]}})))}}},provides(n){n.generateLayersText=function(t,o){const{title:u,transform:d,extra:_}=o;let x=null,s=null;if(Vk){const A=parseInt(getComputedStyle(t).fontSize,10),P=t.getBoundingClientRect();x=P.width/A,s=P.height/A}return yn.autoA11y&&!u&&(_.attributes["aria-hidden"]="true"),Promise.resolve([t,gM({content:t.innerHTML,width:x,height:s,transform:d,title:u,extra:_,watchable:!0})])}}};const fG=new RegExp('"',"ug"),TM=[1105920,1112319],SM=_i(_i(_i(_i({},{FontAwesome:{normal:"fas",400:"fas"}}),zU),QU),WU),V2=Object.keys(SM).reduce((n,t)=>(n[t.toLowerCase()]=SM[t],n),{}),pG=Object.keys(V2).reduce((n,t)=>{const o=V2[t];return n[t]=o[900]||[...Object.entries(o)][0][1],n},{});function mG(n){const t=n.replace(fG,""),o=bH(t,0),u=o>=TM[0]&&o<=TM[1],d=t.length===2?t[0]===t[1]:!1;return{value:k2(d?t[0]:t),isSecondary:u||d}}function gG(n,t){const o=n.replace(/^['"]|['"]$/g,"").toLowerCase(),u=parseInt(t),d=isNaN(u)?"normal":u;return(V2[o]||{})[d]||pG[o]}function EM(n,t){const o="".concat(eH).concat(t.replace(":","-"));return new Promise((u,d)=>{if(n.getAttribute(o)!==null)return u();const x=Tg(n.children).filter(j=>j.getAttribute(I2)===t)[0],s=Kd.getComputedStyle(n,t),A=s.getPropertyValue("font-family"),P=A.match(rH),R=s.getPropertyValue("font-weight"),V=s.getPropertyValue("content");
583if(x&&!P)return n.removeChild(x),u();if(P&&V!=="none"&&V!==""){const j=s.getPropertyValue("content");let Q=gG(A,R);const{value:me,isSecondary:re}=mG(j),be=P[0].startsWith("FontAwesome");let ve=tS(Q,me),Ee=ve;if(be){const je=CH(me);je.iconName&&je.prefix&&(ve=je.iconName,Q=je.prefix)}if(ve&&!re&&(!x||x.getAttribute(XT)!==Q||x.getAttribute(YT)!==Ee)){n.setAttribute(o,Ee),x&&n.removeChild(x);const je=nG(),{extra:Ve}=je;Ve.attributes[I2]=t,F2(ve,Q).then(Je=>{const vt=iS(_i(_i({},je),{},{icons:{main:Je,mask:cL()},prefix:Q,iconName:Ee,extra:Ve,watchable:!0})),_t=Cr.createElementNS("http://www.w3.org/2000/svg","svg");t==="::before"?n.insertBefore(_t,n.firstChild):n.appendChild(_t),_t.outerHTML=vt.map(Mt=>Xy(Mt)).join(` 584`),n.removeAttribute(o),u()}).catch(d)}else u()}else u()})}function _G(n){return Promise.all([EM(n,"::before"),EM(n,"::after")])}function yG(n){return n.parentNode!==document.head&&!~iH.indexOf(n.tagName.toUpperCase())&&!n.getAttribute(I2)&&(!n.parentNode||n.parentNode.tagName!=="svg")}function AM(n){if(Rh)return new Promise((t,o)=>{const u=Tg(n.querySelectorAll("*")).filter(yG).map(_G),d=nS.begin("searchPseudoElements");pL(),Promise.all(u).then(()=>{d(),N2(),t()}).catch(()=>{d(),N2(),o()})})}var vG={hooks(){return{mutationObserverCallbacks(n){return n.pseudoElementsCallback=AM,n}}},provides(n){n.pseudoElements2svg=function(t){const{node:o=Cr}=t;yn.searchPseudoElements&&AM(o)}}};let CM=!1;var xG={mixout(){return{dom:{unwatch(){pL(),CM=!0}}}},hooks(){return{bootstrap(){xM(R2("mutationObserverCallbacks",{}))},noAuto(){QH()},watch(n){const{observeMutationsRoot:t}=n;CM?N2():xM(R2("mutationObserverCallbacks",{observeMutationsRoot:t}))}}}};const IM=n=>{let t={size:16,x:0,y:0,flipX:!1,flipY:!1,rotate:0};return n.toLowerCase().split(" ").reduce((o,u)=>{const d=u.toLowerCase().split("-"),_=d[0];let x=d.slice(1).join("-");if(_&&x==="h")return o.flipX=!0,o;if(_&&x==="v")return o.flipY=!0,o;if(x=parseFloat(x),isNaN(x))return o;switch(_){case"grow":o.size=o.size+x;break;case"shrink":o.size=o.size-x;break;case"left":o.x=o.x-x;break;case"right":o.x=o.x+x;break;case"up":o.y=o.y-x;break;case"down":o.y=o.y+x;break;case"rotate":o.rotate=o.rotate+x;break}return o},t)};var bG={mixout(){return{parse:{transform:n=>IM(n)}}},hooks(){return{parseNodeAttributes(n,t){const o=t.getAttribute("data-fa-transform");return o&&(n.transform=IM(o)),n}}},provides(n){n.generateAbstractTransformGrouping=function(t){let{main:o,transform:u,containerWidth:d,iconWidth:_}=t;const x={transform:"translate(".concat(d/2," 256)")},s="translate(".concat(u.x*32,", ").concat(u.y*32,") "),A="scale(".concat(u.size/16*(u.flipX?-1:1),", ").concat(u.size/16*(u.flipY?-1:1),") "),P="rotate(".concat(u.rotate," 0 0)"),R={transform:"".concat(s," ").concat(A," ").concat(P)},V={transform:"translate(".concat(_/2*-1," -256)")},j={outer:x,inner:R,path:V};return{tag:"g",attributes:_i({},j.outer),children:[{tag:"g",attributes:_i({},j.inner),children:[{tag:o.icon.tag,children:o.icon.children,attributes:_i(_i({},o.icon.attributes),j.path)}]}]}}}};const Rw={x:0,y:0,width:"100%",height:"100%"};function MM(n){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;return n.attributes&&(n.attributes.fill||t)&&(n.attributes.fill="black"),n}function wG(n){return n.tag==="g"?n.children:[n]}var TG={hooks(){return{parseNodeAttributes(n,t){const o=t.getAttribute("data-fa-mask"),u=o?p1(o.split(" ").map(d=>d.trim())):cL();return u.prefix||(u.prefix=Jd()),n.mask=u,n.maskId=t.getAttribute("data-fa-mask-id"),n}}},provides(n){n.generateAbstractMask=function(t){let{children:o,attributes:u,main:d,mask:_,maskId:x,transform:s}=t;const{width:A,icon:P}=d,{width:R,icon:V}=_,j=mH({transform:s,containerWidth:R,iconWidth:A}),Q={tag:"rect",attributes:_i(_i({},Rw),{},{fill:"white"})},me=P.children?{children:P.children.map(MM)}:{},re={tag:"g",attributes:_i({},j.inner),children:[MM(_i({tag:P.tag,attributes:_i(_i({},P.attributes),j.path)},me))]},be={tag:"g",attributes:_i({},j.outer),children:[re]},ve="mask-".concat(x||Iy()),Ee="clip-".concat(x||Iy()),je={tag:"mask",attributes:_i(_i({},Rw),{},{id:ve,maskUnits:"userSpaceOnUse",maskContentUnits:"userSpaceOnUse"}),children:[Q,be]},Ve={tag:"defs",children:[{tag:"clipPath",attributes:{id:Ee}
584,children:wG(V)},je]};return o.push(Ve,{tag:"rect",attributes:_i({fill:"currentColor","clip-path":"url(#".concat(Ee,")"),mask:"url(#".concat(ve,")")},Rw)}),{children:o,attributes:u}}}},SG={provides(n){let t=!1;Kd.matchMedia&&(t=Kd.matchMedia("(prefers-reduced-motion: reduce)").matches),n.missingIconAbstract=function(){const o=[],u={fill:"currentColor"},d={attributeType:"XML",repeatCount:"indefinite",dur:"2s"};o.push({tag:"path",attributes:_i(_i({},u),{},{d:"M156.5,447.7l-12.6,29.5c-18.7-9.5-35.9-21.2-51.5-34.9l22.7-22.7C127.6,430.5,141.5,440,156.5,447.7z M40.6,272H8.5 c1.4,21.2,5.4,41.7,11.7,61.1L50,321.2C45.1,305.5,41.8,289,40.6,272z M40.6,240c1.4-18.8,5.2-37,11.1-54.1l-29.5-12.6 C14.7,194.3,10,216.7,8.5,240H40.6z M64.3,156.5c7.8-14.9,17.2-28.8,28.1-41.5L69.7,92.3c-13.7,15.6-25.5,32.8-34.9,51.5 L64.3,156.5z M397,419.6c-13.9,12-29.4,22.3-46.1,30.4l11.9,29.8c20.7-9.9,39.8-22.6,56.9-37.6L397,419.6z M115,92.4 c13.9-12,29.4-22.3,46.1-30.4l-11.9-29.8c-20.7,9.9-39.8,22.6-56.8,37.6L115,92.4z M447.7,355.5c-7.8,14.9-17.2,28.8-28.1,41.5 l22.7,22.7c13.7-15.6,25.5-32.9,34.9-51.5L447.7,355.5z M471.4,272c-1.4,18.8-5.2,37-11.1,54.1l29.5,12.6 c7.5-21.1,12.2-43.5,13.6-66.8H471.4z M321.2,462c-15.7,5-32.2,8.2-49.2,9.4v32.1c21.2-1.4,41.7-5.4,61.1-11.7L321.2,462z M240,471.4c-18.8-1.4-37-5.2-54.1-11.1l-12.6,29.5c21.1,7.5,43.5,12.2,66.8,13.6V471.4z M462,190.8c5,15.7,8.2,32.2,9.4,49.2h32.1 c-1.4-21.2-5.4-41.7-11.7-61.1L462,190.8z M92.4,397c-12-13.9-22.3-29.4-30.4-46.1l-29.8,11.9c9.9,20.7,22.6,39.8,37.6,56.9 L92.4,397z M272,40.6c18.8,1.4,36.9,5.2,54.1,11.1l12.6-29.5C317.7,14.7,295.3,10,272,8.5V40.6z M190.8,50 c15.7-5,32.2-8.2,49.2-9.4V8.5c-21.2,1.4-41.7,5.4-61.1,11.7L190.8,50z M442.3,92.3L419.6,115c12,13.9,22.3,29.4,30.5,46.1 l29.8-11.9C470,128.5,457.3,109.4,442.3,92.3z M397,92.4l22.7-22.7c-15.6-13.7-32.8-25.5-51.5-34.9l-12.6,29.5 C370.4,72.1,384.4,81.5,397,92.4z"})});const _=_i(_i({},d),{},{attributeName:"opacity"}),x={tag:"circle",attributes:_i(_i({},u),{},{cx:"256",cy:"364",r:"28"}),children:[]};return t||x.children.push({tag:"animate",attributes:_i(_i({},d),{},{attributeName:"r",values:"28;14;28;28;14;28;"})},{tag:"animate",attributes:_i(_i({},_),{},{values:"1;0;1;1;0;1;"})}),o.push(x),o.push({tag:"path",attributes:_i(_i({},u),{},{opacity:"1",d:"M263.7,312h-16c-6.6,0-12-5.4-12-12c0-71,77.4-63.9,77.4-107.8c0-20-17.8-40.2-57.4-40.2c-29.1,0-44.3,9.6-59.2,28.7 c-3.9,5-11.1,6-16.2,2.4l-13.1-9.2c-5.6-3.9-6.9-11.8-2.6-17.2c21.2-27.2,46.4-44.7,91.2-44.7c52.3,0,97.4,29.8,97.4,80.2 c0,67.6-77.4,63.5-77.4,107.8C275.7,306.6,270.3,312,263.7,312z"}),children:t?[]:[{tag:"animate",attributes:_i(_i({},_),{},{values:"1;0;0;0;0;1;"})}]}),t||o.push({tag:"path",attributes:_i(_i({},u),{},{opacity:"0",d:"M232.5,134.5l7,168c0.3,6.4,5.6,11.5,12,11.5h9c6.4,0,11.7-5.1,12-11.5l7-168c0.3-6.8-5.2-12.5-12-12.5h-23 C237.7,122,232.2,127.7,232.5,134.5z"}),children:[{tag:"animate",attributes:_i(_i({},_),{},{values:"0;0;1;1;0;0;"})}]}),{tag:"g",attributes:{class:"missing"},children:o}}}},EG={hooks(){return{parseNodeAttributes(n,t){const o=t.getAttribute("data-fa-symbol"),u=o===null?!1:o===""?!0:o;return n.symbol=u,n}}}},AG=[yH,cG,uG,hG,dG,vG,xG,bG,TG,SG,EG];zH(AG,{mixoutsTo:Sl});Sl.noAuto;Sl.config;const oc=Sl.library;Sl.dom;const $2=Sl.parse;Sl.findIconDefinition;Sl.toHtml;const CG=Sl.icon;Sl.layer;Sl.text;Sl.counter;function PM(n,t){var o=Object.keys(n);if(Object.getOwnPropertySymbols){var u=Object.getOwnPropertySymbols(n);t&&(u=u.filter(function(d){return Object.getOwnPropertyDescriptor(n,d).enumerable})),o.push.apply(o,u)}return o}function bh(n){for(var t=1;t<arguments.length;t++){var o=arguments[t]!=null?arguments[t]:{};t%2?PM(Object(o),!0).forEach(function(u){Ha(n,u,o[u])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(o)):PM(Object(o)).forEach(function(u){Object.defineProperty(n,u,Object.getOwnPropertyDescriptor(o,u))})}return n}function IG(n,t){if(typeof n!="object"||!n)return n;var o=n[Symbol.toPrimitive];if(o!==void 0){var u=o.call(n,t||"default");if(typeof u!="object")return u;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(n)}function MG(n){var t=IG(n,"string");return typeof t=="symbol"?t:t+""}function Px(n){"@babel/helpers - typeof";return Px=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Px(n)}function Ha(n,t,o){return t=MG(t),t in n?Object.defineProperty(n,t,{value:o,enumerable:!0,configurable:!0,writable:!0}):n[t]=o,n}function PG(n,t){if(n==null)return{};var o={};for(var u in n)if(Object.prototype.hasOwnProperty.call(n,u)){if(t.indexOf(u)>=0)continue;o[u]=n[u]}return o}function DG(n,t){if(n==null)return{};var o=PG(n,t),u,d;if(Object.getOwnPropertySymbols){var _=Object.getOwnPropertySymbols(n);for(d=0;d<_.length;d++)u=_[d],!(t.indexOf(u)>=0)&&Object.prototype.propertyIsEnumerable.call(n,u)&&(o[u]=n[u])}return o}var kG=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},gL={exports:{}};(function(n){(function(t){var o=function(ve,Ee,je){if(!P(Ee)||V(Ee)||j(Ee)||Q(Ee)||A(Ee))return Ee;var Ve,Je=0,vt=0;if(R(Ee))for(Ve=[],vt=Ee.length;Je<vt;Je++)Ve.push(o(ve,Ee[Je],je));else{Ve={};for(var _t in Ee)Object.prototype.hasOwnProperty.call(Ee,_t)&&(Ve[ve(_t,je)]=o(ve,Ee[_t],je))}return Ve},u=function(ve,Ee){Ee=Ee||{};var je=Ee.separator||"_",Ve=Ee.split||/(?=[A-Z])/;return ve.split(Ve).join(je)},d=function(ve){return me(ve)?ve:(ve=ve.replace(/[\-_\s]+(.)?/g,function(Ee,je){return je?je.toUpperCase():""}),ve.substr(0,1).toLowerCase()+ve.substr(1))},_=function(ve){var Ee=d(ve);return Ee.substr(0,1).toUpperCase()+Ee.substr(1)},x=function(ve,Ee){return u(ve,Ee).toLowerCase()},s=Object.prototype.toString,A=function(ve){return typeof ve=="function"},P=function(ve){return ve===Object(ve)},R=function(ve){return s.call(ve)=="[object Array]"},V=function(ve){return s.call(ve)=="[object Date]"},j=function(ve){return s.call(ve)=="[object RegExp]"},Q=function(ve){return s.call(ve)=="[object Boolean]"},me=function(ve){return ve=ve-0,ve===ve},re=function(ve,Ee){var je=Ee&&"process"in Ee?Ee.process:Ee;return typeof je!="function"?ve:function(Ve,Je){return je(Ve,ve,Je)}},be={camelize:d,decamelize:x,pascalize:_,depascalize:x,camelizeKeys:function(ve,Ee){return o(re(d,Ee),ve)},decamelizeKeys:function(ve,Ee){return o(re(x,Ee),ve,Ee)},pascalizeKeys:function(ve,Ee){return o(re(_,Ee),ve)},depascalizeKeys:function(){return this.decamelizeKeys.apply(this,arguments)}};n.exports?n.exports=be:t.humps=be})(kG)})(gL);var LG=gL.exports,RG=["class","style"];function OG(n){return n.split(";").map(function(t){return t.trim()}).filter(function(t){return t}).reduce(function(t,o){var u=o.indexOf(":"),d=LG.camelize(o.slice(0,u)),_=o.slice(u+1).trim();return t[d]=_,t},{})}function zG(n){return n.split(/\s+/).reduce(function(t,o){return t[o]=!0,t},{})}function _L(n){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};if(typeof n=="string")return n;var u=(n.children||[]).map(function(A){return _L(A)}),d=Object.keys(n.attributes||{}).reduce(function(A,P){var R=n.attributes[P];
584switch(P){case"class":A.class=zG(R);break;case"style":A.style=OG(R);break;default:A.attrs[P]=R}return A},{attrs:{},class:{},style:{}});o.class;var _=o.style,x=_===void 0?{}:_,s=DG(o,RG);return Qx(n.tag,bh(bh(bh({},t),{},{class:d.class,style:bh(bh({},d.style),x)},d.attrs),s),u)}var yL=!1;try{yL=!0}catch{}function FG(){if(!yL&&console&&typeof console.error=="function"){var n;(n=console).error.apply(n,arguments)}}function Ow(n,t){return Array.isArray(t)&&t.length>0||!Array.isArray(t)&&t?Ha({},n,t):{}}function BG(n){var t,o=(t={"fa-spin":n.spin,"fa-pulse":n.pulse,"fa-fw":n.fixedWidth,"fa-border":n.border,"fa-li":n.listItem,"fa-inverse":n.inverse,"fa-flip":n.flip===!0,"fa-flip-horizontal":n.flip==="horizontal"||n.flip==="both","fa-flip-vertical":n.flip==="vertical"||n.flip==="both"},Ha(Ha(Ha(Ha(Ha(Ha(Ha(Ha(Ha(Ha(t,"fa-".concat(n.size),n.size!==null),"fa-rotate-".concat(n.rotation),n.rotation!==null),"fa-pull-".concat(n.pull),n.pull!==null),"fa-swap-opacity",n.swapOpacity),"fa-bounce",n.bounce),"fa-shake",n.shake),"fa-beat",n.beat),"fa-fade",n.fade),"fa-beat-fade",n.beatFade),"fa-flash",n.flash),Ha(Ha(t,"fa-spin-pulse",n.spinPulse),"fa-spin-reverse",n.spinReverse));return Object.keys(o).map(function(u){return o[u]?u:null}).filter(function(u){return u})}function DM(n){if(n&&Px(n)==="object"&&n.prefix&&n.iconName&&n.icon)return n;if($2.icon)return $2.icon(n);if(n===null)return null;if(Px(n)==="object"&&n.prefix&&n.iconName)return n;if(Array.isArray(n)&&n.length===2)return{prefix:n[0],iconName:n[1]};if(typeof n=="string")return{prefix:"fas",iconName:n}}var Fs=xT({name:"FontAwesomeIcon",props:{border:{type:Boolean,default:!1},fixedWidth:{type:Boolean,default:!1},flip:{type:[Boolean,String],default:!1,validator:function(t){return[!0,!1,"horizontal","vertical","both"].indexOf(t)>-1}},icon:{type:[Object,Array,String],required:!0},mask:{type:[Object,Array,String],default:null},maskId:{type:String,default:null},listItem:{type:Boolean,default:!1},pull:{type:String,default:null,validator:function(t){return["right","left"].indexOf(t)>-1}},pulse:{type:Boolean,default:!1},rotation:{type:[String,Number],default:null,validator:function(t){return[90,180,270].indexOf(Number.parseInt(t,10))>-1}},swapOpacity:{type:Boolean,default:!1},size:{type:String,default:null,validator:function(t){return["2xs","xs","sm","lg","xl","2xl","1x","2x","3x","4x","5x","6x","7x","8x","9x","10x"].indexOf(t)>-1}},spin:{type:Boolean,default:!1},transform:{type:[String,Object],default:null},symbol:{type:[Boolean,String],default:!1},title:{type:String,default:null},titleId:{type:String,default:null},inverse:{type:Boolean,default:!1},bounce:{type:Boolean,default:!1},shake:{type:Boolean,default:!1},beat:{type:Boolean,default:!1},fade:{type:Boolean,default:!1},beatFade:{type:Boolean,default:!1},flash:{type:Boolean,default:!1},spinPulse:{type:Boolean,default:!1},spinReverse:{type:Boolean,default:!1}},setup:function(t,o){var u=o.attrs,d=bs(function(){return DM(t.icon)}),_=bs(function(){return Ow("classes",BG(t))}),x=bs(function(){return Ow("transform",typeof t.transform=="string"?$2.transform(t.transform):t.transform)}),s=bs(function(){return Ow("mask",DM(t.mask))}),A=bs(function(){return CG(d.value,bh(bh(bh(bh({},_.value),x.value),s.value),{},{symbol:t.symbol,title:t.title,titleId:t.titleId,maskId:t.maskId}))});xp(A,function(R){if(!R)return FG("Could not find one or more icon(s)",d.value,s.value)},{immediate:!0});var P=bs(function(){return A.value?_L(A.value.abstract[0],{},u):null});return function(){return P.value}}});/*! 585 * Font Awesome Free 6.7.2 by @fontawesome - https://fontawesome.com 586 * License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) 587 * Copyright 2024 Fonticons, Inc. 588 */const NG={prefix:"fas",iconName:"file-lines",icon:[384,512,[128441,128462,61686,"file-alt","file-text"],"f15c","M64 0C28.7 0 0 28.7 0 64L0 448c0 35.3 28.7 64 64 64l256 0c35.3 0 64-28.7 64-64l0-288-128 0c-17.7 0-32-14.3-32-32L224 0 64 0zM256 0l0 128 128 0L256 0zM112 256l160 0c8.8 0 16 7.2 16 16s-7.2 16-16 16l-160 0c-8.8 0-16-7.2-16-16s7.2-16 16-16zm0 64l160 0c8.8 0 16 7.2 16 16s-7.2 16-16 16l-160 0c-8.8 0-16-7.2-16-16s7.2-16 16-16zm0 64l160 0c8.8 0 16 7.2 16 16s-7.2 16-16 16l-160 0c-8.8 0-16-7.2-16-16s7.2-16 16-16z"]}
vendor: 5,716 bytes, line 588
588,VG=NG,$G={prefix:"fas",iconName:"calendar-days",icon:[448,512,["calendar-alt"],"f073","M128 0c17.7 0 32 14.3 32 32l0 32 128 0 0-32c0-17.7 14.3-32 32-32s32 14.3 32 32l0 32 48 0c26.5 0 48 21.5 48 48l0 48L0 160l0-48C0 85.5 21.5 64 48 64l48 0 0-32c0-17.7 14.3-32 32-32zM0 192l448 0 0 272c0 26.5-21.5 48-48 48L48 512c-26.5 0-48-21.5-48-48L0 192zm64 80l0 32c0 8.8 7.2 16 16 16l32 0c8.8 0 16-7.2 16-16l0-32c0-8.8-7.2-16-16-16l-32 0c-8.8 0-16 7.2-16 16zm128 0l0 32c0 8.8 7.2 16 16 16l32 0c8.8 0 16-7.2 16-16l0-32c0-8.8-7.2-16-16-16l-32 0c-8.8 0-16 7.2-16 16zm144-16c-8.8 0-16 7.2-16 16l0 32c0 8.8 7.2 16 16 16l32 0c8.8 0 16-7.2 16-16l0-32c0-8.8-7.2-16-16-16l-32 0zM64 400l0 32c0 8.8 7.2 16 16 16l32 0c8.8 0 16-7.2 16-16l0-32c0-8.8-7.2-16-16-16l-32 0c-8.8 0-16 7.2-16 16zm144-16c-8.8 0-16 7.2-16 16l0 32c0 8.8 7.2 16 16 16l32 0c8.8 0 16-7.2 16-16l0-32c0-8.8-7.2-16-16-16l-32 0zm112 16l0 32c0 8.8 7.2 16 16 16l32 0c8.8 0 16-7.2 16-16l0-32c0-8.8-7.2-16-16-16l-32 0c-8.8 0-16 7.2-16 16z"]},jG=$G,UG={prefix:"fas",iconName:"laptop",icon:[640,512,[128187],"f109","M128 32C92.7 32 64 60.7 64 96l0 256 64 0 0-256 384 0 0 256 64 0 0-256c0-35.3-28.7-64-64-64L128 32zM19.2 384C8.6 384 0 392.6 0 403.2C0 445.6 34.4 480 76.8 480l486.4 0c42.4 0 76.8-34.4 76.8-76.8c0-10.6-8.6-19.2-19.2-19.2L19.2 384z"]},HG={prefix:"fas",iconName:"comments",icon:[640,512,[128490,61670],"f086","M208 352c114.9 0 208-78.8 208-176S322.9 0 208 0S0 78.8 0 176c0 38.6 14.7 74.3 39.6 103.4c-3.5 9.4-8.7 17.7-14.2 24.7c-4.8 6.2-9.7 11-13.3 14.3c-1.8 1.6-3.3 2.9-4.3 3.7c-.5 .4-.9 .7-1.1 .8l-.2 .2s0 0 0 0s0 0 0 0C1 327.2-1.4 334.4 .8 340.9S9.1 352 16 352c21.8 0 43.8-5.6 62.1-12.5c9.2-3.5 17.8-7.4 25.2-11.4C134.1 343.3 169.8 352 208 352zM448 176c0 112.3-99.1 196.9-216.5 207C255.8 457.4 336.4 512 432 512c38.2 0 73.9-8.7 104.7-23.9c7.5 4 16 7.9 25.2 11.4c18.3 6.9 40.3 12.5 62.1 12.5c6.9 0 13.1-4.5 15.2-11.1c2.1-6.6-.2-13.8-5.8-17.9c0 0 0 0 0 0s0 0 0 0l-.2-.2c-.2-.2-.6-.4-1.1-.8c-1-.8-2.5-2-4.3-3.7c-3.6-3.3-8.5-8.1-13.3-14.3c-5.5-7-10.7-15.4-14.2-24.7c24.9-29 39.6-64.7 39.6-103.4c0-92.8-84.9-168.9-192.6-175.5c.4 5.1 .6 10.3 .6 15.5z"]},GG={prefix:"fas",iconName:"bars",icon:[448,512,["navicon"],"f0c9","M0 96C0 78.3 14.3 64 32 64l384 0c17.7 0 32 14.3 32 32s-14.3 32-32 32L32 128C14.3 128 0 113.7 0 96zM0 256c0-17.7 14.3-32 32-32l384 0c17.7 0 32 14.3 32 32s-14.3 32-32 32L32 288c-17.7 0-32-14.3-32-32zM448 416c0 17.7-14.3 32-32 32L32 448c-17.7 0-32-14.3-32-32s14.3-32 32-32l384 0c17.7 0 32 14.3 32 32z"]},WG={prefix:"fas",iconName:"lightbulb",icon:[384,512,[128161],"f0eb","M272 384c9.6-31.9 29.5-59.1 49.2-86.2c0 0 0 0 0 0c5.2-7.1 10.4-14.2 15.4-21.4c19.8-28.5 31.4-63 31.4-100.3C368 78.8 289.2 0 192 0S16 78.8 16 176c0 37.3 11.6 71.9 31.4 100.3c5 7.2 10.2 14.3 15.4 21.4c0 0 0 0 0 0c19.8 27.1 39.7 54.4 49.2 86.2l160 0zM192 512c44.2 0 80-35.8 80-80l0-16-160 0 0 16c0 44.2 35.8 80 80 80zM112 176c0 8.8-7.2 16-16 16s-16-7.2-16-16c0-61.9 50.1-112 112-112c8.8 0 16 7.2 16 16s-7.2 16-16 16c-44.2 0-80 35.8-80 80z"]},qG={prefix:"fas",iconName:"square-check",icon:[448,512,[9745,9989,61510,"check-square"],"f14a","M64 32C28.7 32 0 60.7 0 96L0 416c0 35.3 28.7 64 64 64l320 0c35.3 0 64-28.7 64-64l0-320c0-35.3-28.7-64-64-64L64 32zM337 209L209 337c-9.4 9.4-24.6 9.4-33.9 0l-64-64c-9.4-9.4-9.4-24.6 0-33.9s24.6-9.4 33.9 0l47 47L303 175c9.4-9.4 24.6-9.4 33.9 0s9.4 24.6 0 33.9z"]},ZG=qG,rS={prefix:"fas",iconName:"lock",icon:[448,512,[128274],"f023","M144 144l0 48 160 0 0-48c0-44.2-35.8-80-80-80s-80 35.8-80 80zM80 192l0-48C80 64.5 144.5 0 224 0s144 64.5 144 144l0 48 16 0c35.3 0 64 28.7 64 64l0 192c0 35.3-28.7 64-64 64L64 512c-35.3 0-64-28.7-64-64L0 256c0-35.3 28.7-64 64-64l16 0z"]},XG={prefix:"fas",iconName:"pen-to-square",icon:[512,512,["edit"],"f044","M471.6 21.7c-21.9-21.9-57.3-21.9-79.2 0L362.3 51.7l97.9 97.9 30.1-30.1c21.9-21.9 21.9-57.3 0-79.2L471.6 21.7zm-299.2 220c-6.1 6.1-10.8 13.6-13.5 21.9l-29.6 88.8c-2.9 8.6-.6 18.1 5.8 24.6s15.9 8.7 24.6 5.8l88.8-29.6c8.2-2.7 15.7-7.4 21.9-13.5L437.7 172.3 339.7 74.3 172.4 241.7zM96 64C43 64 0 107 0 160L0 416c0 53 43 96 96 96l256 0c53 0 96-43 96-96l0-96c0-17.7-14.3-32-32-32s-32 14.3-32 32l0 96c0 17.7-14.3 32-32 32L96 448c-17.7 0-32-14.3-32-32l0-256c0-17.7 14.3-32 32-32l96 0c17.7 0 32-14.3 32-32s-14.3-32-32-32L96 64z"]},YG=XG,KG={prefix:"fas",iconName:"users",icon:[640,512,[],"f0c0","M144 0a80 80 0 1 1 0 160A80 80 0 1 1 144 0zM512 0a80 80 0 1 1 0 160A80 80 0 1 1 512 0zM0 298.7C0 239.8 47.8 192 106.7 192l42.7 0c15.9 0 31 3.5 44.6 9.7c-1.3 7.2-1.9 14.7-1.9 22.3c0 38.2 16.8 72.5 43.3 96c-.2 0-.4 0-.7 0L21.3 320C9.6 320 0 310.4 0 298.7zM405.3 320c-.2 0-.4 0-.7 0c26.6-23.5 43.3-57.8 43.3-96c0-7.6-.7-15-1.9-22.3c13.6-6.3 28.7-9.7 44.6-9.7l42.7 0C592.2 192 640 239.8 640 298.7c0 11.8-9.6 21.3-21.3 21.3l-213.3 0zM224 224a96 96 0 1 1 192 0 96 96 0 1 1 -192 0zM128 485.3C128 411.7 187.7 352 261.3 352l117.3 0C452.3 352 512 411.7 512 485.3c0 14.7-11.9 26.7-26.7 26.7l-330.7 0c-14.7 0-26.7-11.9-26.7-26.7z"]},vL={prefix:"fas",iconName:"file-invoice-dollar",icon:[384,512,[],"f571","M64 0C28.7 0 0 28.7 0 64L0 448c0 35.3 28.7 64 64 64l256 0c35.3 0 64-28.7 64-64l0-288-128 0c-17.7 0-32-14.3-32-32L224 0 64 0zM256 0l0 128 128 0L256 0zM64 80c0-8.8 7.2-16 16-16l64 0c8.8 0 16 7.2 16 16s-7.2 16-16 16L80 96c-8.8 0-16-7.2-16-16zm0 64c0-8.8 7.2-16 16-16l64 0c8.8 0 16 7.2 16 16s-7.2 16-16 16l-64 0c-8.8 0-16-7.2-16-16zm128 72c8.8 0 16 7.2 16 16l0 17.3c8.5 1.2 16.7 3.1 24.1 5.1c8.5 2.3 13.6 11 11.3 19.6s-11 13.6-19.6 11.3c-11.1-3-22-5.2-32.1-5.3c-8.4-.1-17.4 1.8-23.6 5.5c-5.7 3.4-8.1 7.3-8.1 12.8c0 3.7 1.3 6.5 7.3 10.1c6.9 4.1 16.6 7.1 29.2 10.9l.5 .1s0 0 0 0s0 0 0 0c11.3 3.4 25.3 7.6 36.3 14.6c12.1 7.6 22.4 19.7 22.7 38.2c.3 19.3-9.6 33.3-22.9 41.6c-7.7 4.8-16.4 7.6-25.1 9.1l0 17.1c0 8.8-7.2 16-16 16s-16-7.2
588-16-16l0-17.8c-11.2-2.1-21.7-5.7-30.9-8.9c0 0 0 0 0 0c-2.1-.7-4.2-1.4-6.2-2.1c-8.4-2.8-12.9-11.9-10.1-20.2s11.9-12.9 20.2-10.1c2.5 .8 4.8 1.6 7.1 2.4c0 0 0 0 0 0s0 0 0 0s0 0 0 0c13.6 4.6 24.6 8.4 36.3 8.7c9.1 .3 17.9-1.7 23.7-5.3c5.1-3.2 7.9-7.3 7.8-14c-.1-4.6-1.8-7.8-7.7-11.6c-6.8-4.3-16.5-7.4-29-11.2l-1.6-.5s0 0 0 0c-11-3.3-24.3-7.3-34.8-13.7c-12-7.2-22.6-18.9-22.7-37.3c-.1-19.4 10.8-32.8 23.8-40.5c7.5-4.4 15.8-7.2 24.1-8.7l0-17.3c0-8.8 7.2-16 16-16z"]},xL={prefix:"fas",iconName:"chart-bar",icon:[512,512,["bar-chart"],"f080","M32 32c17.7 0 32 14.3 32 32l0 336c0 8.8 7.2 16 16 16l400 0c17.7 0 32 14.3 32 32s-14.3 32-32 32L80 480c-44.2 0-80-35.8-80-80L0 64C0 46.3 14.3 32 32 32zm96 96c0-17.7 14.3-32 32-32l192 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-192 0c-17.7 0-32-14.3-32-32zm32 64l128 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-128 0c-17.7 0-32-14.3-32-32s14.3-32 32-32zm0 96l256 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-256 0c-17.7 0-32-14.3-32-32s14.3-32 32-32z"]},JG={prefix:"fas",iconName:"handshake",icon:[640,512,[],"f2b5","M323.4 85.2l-96.8 78.4c-16.1 13-19.2 36.4-7 53.1c12.9 17.8 38 21.3 55.3 7.8l99.3-77.2c7-5.4 17-4.2 22.5 2.8s4.2 17-2.8 22.5l-20.9 16.2L512 316.8 512 128l-.7 0-3.9-2.5L434.8 79c-15.3-9.8-33.2-15-51.4-15c-21.8 0-43 7.5-60 21.2zm22.8 124.4l-51.7 40.2C263 274.4 217.3 268 193.7 235.6c-22.2-30.5-16.6-73.1 12.7-96.8l83.2-67.3c-11.6-4.9-24.1-7.4-36.8-7.4C234 64 215.7 69.6 200 80l-72 48 0 224 28.2 0 91.4 83.4c19.6 17.9 49.9 16.5 67.8-3.1c5.5-6.1 9.2-13.2 11.1-20.6l17 15.6c19.5 17.9 49.9 16.6 67.8-2.9c4.5-4.9 7.8-10.6 9.9-16.5c19.4 13 45.8 10.3 62.1-7.5c17.9-19.5 16.6-49.9-2.9-67.8l-134.2-123zM16 128c-8.8 0-16 7.2-16 16L0 352c0 17.7 14.3 32 32 32l32 0c17.7 0 32-14.3 32-32l0-224-80 0zM48 320a16 16 0 1 1 0 32 16 16 0 1 1 0-32zM544 128l0 224c0 17.7 14.3 32 32 32l32 0c17.7 0 32-14.3 32-32l0-208c0-8.8-7.2-16-16-16l-80 0zm32 208a16 16 0 1 1 32 0 16 16 0 1 1 -32 0z"]},QG={prefix:"fas",iconName:"circle-check",icon:[512,512,[61533,"check-circle"],"f058","M256 512A256 256 0 1 0 256 0a256 256 0 1 0 0 512zM369 209L241 337c-9.4 9.4-24.6 9.4-33.9 0l-64-64c-9.4-9.4-9.4-24.6 0-33.9s24.6-9.4 33.9 0l47 47L335 175c9.4-9.4 24.6-9.4 33.9 0s9.4 24.6 0 33.9z"]},eW=QG,tW={prefix:"fas",iconName:"arrow-down-wide-short",icon:[576,512,["sort-amount-asc","sort-amount-down"],"f160","M151.6 469.6C145.5 476.2 137 480 128 480s-17.5-3.8-23.6-10.4l-88-96c-11.9-13-11.1-33.3 2-45.2s33.3-11.1 45.2 2L96 365.7 96 64c0-17.7 14.3-32 32-32s32 14.3 32 32l0 301.7 32.4-35.4c11.9-13 32.2-13.9 45.2-2s13.9 32.2 2 45.2l-88 96zM320 480c-17.7 0-32-14.3-32-32s14.3-32 32-32l32 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-32 0zm0-128c-17.7 0-32-14.3-32-32s14.3-32 32-32l96 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-96 0zm0-128c-17.7 0-32-14.3-32-32s14.3-32 32-32l160 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-160 0zm0-128c-17.7 0-32-14.3-32-32s14.3-32 32-32l224 0c17.7 0 32 14.3 32 32s-14.3 32-32 32L320 96z"]},iW=tW,nW={prefix:"fas",iconName:"arrows-rotate",icon:[512,512,[128472,"refresh","sync"],"f021","M105.1 202.6c7.7-21.8 20.2-42.3 37.8-59.8c62.5-62.5 163.8-62.5 226.3 0L386.3 160 352 160c-17.7 0-32 14.3-32 32s14.3 32 32 32l111.5 0c0 0 0 0 0 0l.4 0c17.7 0 32-14.3 32-32l0-112c0-17.7-14.3-32-32-32s-32 14.3-32 32l0 35.2L414.4 97.6c-87.5-87.5-229.3-87.5-316.8 0C73.2 122 55.6 150.7 44.8 181.4c-5.9 16.7 2.9 34.9 19.5 40.8s34.9-2.9 40.8-19.5zM39 289.3c-5 1.5-9.8 4.2-13.7 8.2c-4 4-6.7 8.8-8.1 14c-.3 1.2-.6 2.5-.8 3.8c-.3 1.7-.4 3.4-.4 5.1L16 432c0 17.7 14.3 32 32 32s32-14.3 32-32l0-35.1 17.6 17.5c0 0 0 0 0 0c87.5 87.4 229.3 87.4 316.7 0c24.4-24.4 42.1-53.1 52.9-83.8c5.9-16.7-2.9-34.9-19.5-40.8s-34.9 2.9-40.8 19.5c-7.7 21.8-20.2 42.3-37.8 59.8c-62.5 62.5-163.8 62.5-226.3 0l-.1-.1L125.6 352l34.4 0c17.7 0 32-14.3 32-32s-14.3-32-32-32L48.4 288c-1.6 0-3.2 .1-4.8 .3s-3.1 .5-4.6 1z"]},sW=nW,rW={prefix:"fas",iconName:"shield-halved",icon:[512,512,["shield-alt"],"f3ed","M256 0c4.6 0 9.2 1 13.4 2.9L457.7 82.8c22 9.3 38.4 31 38.3 57.2c-.5 99.2-41.3 280.7-213.6 363.2c-16.7 8-36.1 8-52.8 0C57.3 420.7 16.5 239.2 16 140c-.1-26.2 16.3-47.9 38.3-57.2L242.7 2.9C246.8 1 251.4 0 256 0zm0 66.8l0 378.1C394 378 431.1 230.1 432 141.4L256 66.8s0 0 0 0z"]},bL=rW,oW={prefix:"fas",iconName:"newspaper",icon:[512,512,[128240],"f1ea","M96 96c0-35.3 28.7-64 64-64l288 0c35.3 0 64 28.7 64 64l0 320c0 35.3-28.7 64-64 64L80 480c-44.2 0-80-35.8-80-80L0 128c0-17.7 14.3-32 32-32s32 14.3 32 32l0 272c0 8.8 7.2 16 16 16s16-
5887.2 16-16L96 96zm64 24l0 80c0 13.3 10.7 24 24 24l112 0c13.3 0 24-10.7 24-24l0-80c0-13.3-10.7-24-24-24L184 96c-13.3 0-24 10.7-24 24zm208-8c0 8.8 7.2 16 16 16l48 0c8.8 0 16-7.2 16-16s-7.2-16-16-16l-48 0c-8.8 0-16 7.2-16 16zm0 96c0 8.8 7.2 16 16 16l48 0c8.8 0 16-7.2 16-16s-7.2-16-16-16l-48 0c-8.8 0-16 7.2-16 16zM160 304c0 8.8 7.2 16 16 16l256 0c8.8 0 16-7.2 16-16s-7.2-16-16-16l-256 0c-8.8 0-16 7.2-16 16zm0 96c0 8.8 7.2 16 16 16l256 0c8.8 0 16-7.2 16-16s-7.2-16-16-16l-256 0c-8.8 0-16 7.2-16 16z"]},aW={prefix:"fas",iconName:"chart-pie",icon:[576,512,["pie-chart"],"f200","M304 240l0-223.4c0-9 7-16.6 16-16.6C443.7 0 544 100.3 544 224c0 9-7.6 16-16.6 16L304 240zM32 272C32 150.7 122.1 50.3 239 34.3c9.2-1.3 17 6.1 17 15.4L256 288 412.5 444.5c6.7 6.7 6.2 17.7-1.5 23.1C371.8 495.6 323.8 512 272 512C139.5 512 32 404.6 32 272zm526.4 16c9.3 0 16.6 7.8 15.4 17c-7.7 55.9-34.6 105.6-73.9 142.3c-6 5.6-15.4 5.2-21.2-.7L320 288l238.4 0z"]},Yy={prefix:"fas",iconName:"chart-line",icon:[512,512,["line-chart"],"f201","M64 64c0-17.7-14.3-32-32-32S0 46.3 0 64L0 400c0 44.2 35.8 80 80 80l400 0c17.7 0 32-14.3 32-32s-14.3-32-32-32L80 416c-8.8 0-16-7.2-16-16L64 64zm406.6 86.6c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0L320 210.7l-57.4-57.4c-12.5-12.5-32.8-12.5-45.3 0l-112 112c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0L240 221.3l57.4 57.4c12.5 12.5 32.8 12.5 45.3 0l128-128z"]},lW={prefix:"fas",iconName:"heart",icon:[512,512,[128153,128154,128155,128156,128420,129293,129294,129505,9829,10084,61578],"f004","M47.6 300.4L228.3 469.1c7.5 7 17.4 10.9 27.7 10.9s20.2-3.9 27.7-10.9L464.4 300.4c30.4-28.3 47.6-68 47.6-109.5v-5.8c0-69.9-50.5-129.5-119.4-141C347 36.5 300.6 51.4 268 84L256 96 244 84c-32.6-32.6-79-47.5-124.6-39.9C50.5 55.6 0 115.2 0 185.1v5.8c0 41.5 17.2 81.2 47.6 109.5z"]},cW={prefix:"fas",iconName:"mobile-screen-button",icon:[384,512,["mobile-alt"],"f3cd","M16 64C16 28.7 44.7 0 80 0L304 0c35.3 0 64 28.7 64 64l0 384c0 35.3-28.7 64-64 64L80 512c-35.3 0-64-28.7-64-64L16 64zM224 448a32 32 0 1 0 -64 0 32 32 0 1 0 64 0zM304 64L80 64l0 320 224 0 0-320z"]},g1=cW,uW={prefix:"fas",iconName:"phone",icon:[512,512,[128222,128379],"f095","M164.9 24.6c-7.7-18.6-28-28.5-47.4-23.2l-88 24C12.1 30.2 0 46 0 64C0 311.4 200.6 512 448 512c18 0 33.8-12.1 38.6-29.5l24-88c5.3-19.4-4.6-39.7-23.2-47.4l-96-40c-16.3-6.8-35.2-2.1-46.3 11.6L304.7 368C234.3 334.7 177.3 277.7 144 207.3L193.3 167c13.7-11.2 18.4-30 11.6-46.3l-40-96z"]},hW={prefix:"fas",iconName:"user-gear",icon:[640,512,["user-cog"],"f4fe","M224 0a128 128 0 1 1 0 256A128 128 0 1 1 224 0zM178.3 304l91.4 0c11.8 0 23.4 1.2 34.5 3.3c-2.1 18.5 7.4 35.6 21.8 44.8c-16.6 10.6-26.7 31.6-20 53.3c4 12.9 9.4 25.5 16.4 37.6s15.2 23.1 24.4 33c15.7 16.9 39.6 18.4 57.2 8.7l0 .9c0 9.2 2.7 18.5 7.9 26.3L29.7 512C13.3 512 0 498.7 0 482.3C0 383.8 79.8 304 178.3 304zM436 218.2c0-7 4.5-13.3 11.3-14.8c10.5-2.4 21.5-3.7 32.7-3.7s22.2 1.3 32.7 3.7c6.8 1.5 11.3 7.8 11.3 14.8l0 30.6c7.9 3.4 15.4 7.7 22.3 12.8l24.9-14.3c6.1-3.5 13.7-2.7 18.5 2.4c7.6 8.1 14.3 17.2 20.1 27.2s10.3 20.4 13.5 31c2.1 6.7-1.1 13.7-7.2 17.2l-25 14.4c.4 4 .7 8.1 .7 12.3s-.2 8.2-.7 12.3l25 14.4c6.1 3.5 9.2 10.5 7.2 17.2c-3.3 10.6-7.8 21-13.5 31s-12.5 19.1-20.1 27.2c-4.8 5.1-12.5 5.9-18.5 2.4l-24.9-14.3c-6.9 5.1-14.3 9.4-22.3 12.8l0 30.6c0 7-4.5 13.3-11.3 14.8c-10.5 2.4-21.5 3.7-32.7 3.7s-22.2-1.3-32.7-3.7c-6.8-1.5-11.3-7.8-11.3-14.8l0-30.5c-8-3.4-15.6-7.7-22.5-12.9l-24.7 14.3c-6.1 3.5-13.7 2.7-18.5-2.4c-7.6-8.1-14.3-17.2-20.1-27.2s-10.3-20.4-13.5-31c-2.1-6.7 1.1-13.7 7.2-17.2l24.8-14.3c-.4-4.1-.7-8.2-.7-12.4s.2-8.3 .7-12.4L343.8 325c-6.1-3.5-9.2-10.5-7.2-17.2c3.3-10.6 7.7-21 13.5-31s12.5-19.1 20.1-27.2c4.8-5.1 12.4-5.9 18.5-2.4l24.8 14.3c6.9-5.1 14.5-9.4 22.5-12.9l0-30.5zm92.1 133.5a48.1 48.1 0 1 0 -96.1 0 48.1 48.1 0 1 0 96.1 0z"]},dW=hW,fW={prefix:"fas",iconName:"trash",icon:[448,512,[],"f1f8","M135.2 17.7L128 32 32 32C14.3 32 0 46.3 0 64S14.3 96 32 96l384 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-96 0-7.2-14.3C307.4 6.8 296.3 0 284.2 0L163.8 0c-12.1 0-23.2 6.8-28.6 17.7zM416 128L32 128 53.2 467c1.6 25.3 22.6 45 47.9 45l245.8 0c25.3 0 46.3-19.7 47.9-45L416 128z"]},pW={prefix:"fas",iconName:"user-secret",icon:[448,512,[128373],"f21b","M224
58816c-6.7 0-10.8-2.8-15.5-6.1C201.9 5.4 194 0 176 0c-30.5 0-52 43.7-66 89.4C62.7 98.1 32 112.2 32 128c0 14.3 25 27.1 64.6 35.9c-.4 4-.6 8-.6 12.1c0 17 3.3 33.2 9.3 48l-59.9 0C38 224 32 230 32 237.4c0 1.7 .3 3.4 1 5l38.8 96.9C28.2 371.8 0 423.8 0 482.3C0 498.7 13.3 512 29.7 512l388.6 0c16.4 0 29.7-13.3 29.7-29.7c0-58.5-28.2-110.4-71.7-143L415 242.4c.6-1.6 1-3.3 1-5c0-7.4-6-13.4-13.4-13.4l-59.9 0c6-14.8 9.3-31 9.3-48c0-4.1-.2-8.1-.6-12.1C391 155.1 416 142.3 416 128c0-15.8-30.7-29.9-78-38.6C324 43.7 302.5 0 272 0c-18 0-25.9 5.4-32.5 9.9c-4.8 3.3-8.8 6.1-15.5 6.1zm56 208l-12.4 0c-16.5 0-31.1-10.6-36.3-26.2c-2.3-7-12.2-7-14.5 0c-5.2 15.6-19.9 26.2-36.3 26.2L168 224c-22.1 0-40-17.9-40-40l0-14.4c28.2 4.1 61 6.4 96 6.4s67.8-2.3 96-6.4l0 14.4c0 22.1-17.9 40-40 40zm-88 96l16 32L176 480 128 288l64 32zm128-32L272 480 240 352l16-32 64-32z"]},mW={prefix:"fas",iconName:"envelope",icon:[512,512,[128386,9993,61443],"f0e0","M48 64C21.5 64 0 85.5 0 112c0 15.1 7.1 29.3 19.2 38.4L236.8 313.6c11.4 8.5 27 8.5 38.4 0L492.8 150.4c12.1-9.1 19.2-23.3 19.2-38.4c0-26.5-21.5-48-48-48L48 64zM0 176L0 384c0 35.3 28.7 64 64 64l384 0c35.3 0 64-28.7 64-64l0-208L294.4 339.2c-22.8 17.1-54 17.1-76.8 0L0 176z"]},gW={prefix:"fas",iconName:"plane-arrival",icon:[640,512,[128748],"f5af","M.3 166.9L0 68C0 57.7 9.5 50.1 19.5 52.3l35.6 7.9c10.6 2.3 19.2 9.9 23 20L96 128l127.3 37.6L181.8 20.4C178.9 10.2 186.6 0 197.2 0l40.1 0c11.6 0 22.2 6.2 27.9 16.3l109 193.8 107.2 31.7c15.9 4.7 30.8 12.5 43.7 22.8l34.4 27.6c24 19.2 18.1 57.3-10.7 68.2c-41.2 15.6-86.2 18.1-128.8 7L121.7 289.8c-11.1-2.9-21.2-8.7-29.3-16.9L9.5 189.4c-5.9-6-9.3-14.1-9.3-22.5zM32 448l576 0c17.7 0 32 14.3 32 32s-14.3 32-32 32L32 512c-17.7 0-32-14.3-32-32s14.3-32 32-32zm96-80a32 32 0 1 1 64 0 32 32 0 1 1 -64 0zm128-16a32 32 0 1 1 0 64 32 32 0 1 1 0-64z"]},_W={prefix:"fas",iconName:"piggy-bank",icon:[576,512,[],"f4d3","M400 96l0 .7c-5.3-.4-10.6-.7-16-.7L256 96c-16.5 0-32.5 2.1-47.8 6c-.1-2-.2-4-.2-6c0-53 43-96 96-96s96 43 96 96zm-16 32c3.5 0 7 .1 10.4 .3c4.2 .3 8.4 .7 12.6 1.3C424.6 109.1 450.8 96 480 96l11.5 0c10.4 0 18 9.8 15.5 19.9l-13.8 55.2c15.8 14.8 28.7 32.8 37.5 52.9l13.3 0c17.7 0 32 14.3 32 32l0 96c0 17.7-14.3 32-32 32l-32 0c-9.1 12.1-19.9 22.9-32 32l0 64c0 17.7-14.3 32-32 32l-32 0c-17.7 0-32-14.3-32-32l0-32-128 0 0 32c0 17.7-14.3 32-32 32l-32 0c-17.7 0-32-14.3-32-32l0-64c-34.9-26.2-58.7-66.3-63.2-112L68 304c-37.6 0-68-30.4-68-68s30.4-68 68-68l4 0c13.3 0 24 10.7 24 24s-10.7 24-24 24l-4 0c-11 0-20 9-20 20s9 20 20 20l31.2 0c12.1-59.8 57.7-107.5 116.3-122.8c12.9-3.4 26.5-5.2 40.5-5.2l128 0zm64 136a24 24 0 1 0 -48 0 24 24 0 1 0 48 0z"]},yW={prefix:"fas",iconName:"coins",icon:[512,512,[],"f51e","M512 80c0 18-14.3 34.6-38.4 48c-29.1 16.1-72.5 27.5-122.3 30.9c-3.7-1.8-7.4-3.5-11.3-5C300.6 137.4 248.2 128 192 128c-8.3 0-16.4 .2-24.5 .6l-1.1-.6C142.3 114.6 128 98 128 80c0-44.2 86-80 192-80S512 35.8 512 80zM160.7 161.1c10.2-.7 20.7-1.1 31.3-1.1c62.2 0 117.4 12.3 152.5 31.4C369.3 204.9 384 221.7 384 240c0 4-.7 7.9-2.1 11.7c-4.6 13.2-17 25.3-35 35.5c0 0 0 0 0 0c-.1 .1-.3 .1-.4 .2c0 0 0 0 0 0s0 0 0 0c-.3 .2-.6 .3-.9 .5c-35 19.4-90.8 32-153.6 32c-59.6 0-112.9-11.3-148.2-29.1c-1.9-.9-3.7-1.9-5.5-2.9C14.3 274.6 0 258 0 240c0-34.8 53.4-64.5 128-75.4c10.5-1.5 21.4-2.7 32.7-3.5zM416 240c0-21.9-10.6-39.9-24.1-53.4c28.3-4.4 54.2-11.4 76.2-20.5c16.3-6.8 31.5-15.2 43.9-25.5l0 35.4c0 19.3-16.5 37.1-43.8 50.9c-14.6 7.4-32.4 13.7-52.4 18.5c.1-1.8 .2-3.5 .2-5.3zm-32 96c0 18-14.3 34.6-38.4 48c-1.8 1-3.6 1.9-5.5 2.9C304.9 404.7 251.6 416 192 416c-62.8 0-118.6-12.6-153.6-32C14.3 370.6 0 354 0 336l0-35.4c12.5 10.3 27.6 18.7 43.9 25.5C83.4 342.6 135.8 352 192 352s108.6-9.4 148.1-25.9c7.8-3.2 15.3-6.9 22.4-10.9c6.1-3.4 11.8-7.2 17.2-11.2c1.5-1.1 2.9-2.3 4.3-3.4l0 3.4 0 5.7 0 26.3zm32 0l0-32 0-25.9c19-4.2 36.5-9.5 52.1-16c16.3-6.8 31.5-15.2 43.9-25.5l0 35.4c0 10.5-5 21-14.9 30.9c-16.3 16.3-45 29.7-81.3 38.4c.1-1.7 .2-3.5 .2-5.3zM192 448c56.2 0 108.6-9.4 148.1-25.9c16.3-6.8 31.5-15.2 43.9-25.5l0 35.4c0 44.2-86 80-192 80S0 476.2 0 432l0-35.4c12.5 10.3 27.6 18.7 43.9 25.5C83.4 438.6 135.8 448 192 448z"]},vW={prefix:"fas",iconName:"download",icon:[512,512,[],"f019","M288 32c0-17.7-14.3-32-32-32s-32 14.3-32 32l0 242.7-73.4-73.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3l128 128c12.5 12.5 32.8 12.5 45.3 0l128-128c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0L288 274.7 288 32zM64 352c-35.3 0-64 28.7-64 64l0 32c0 35.3 28.7 64 64 64l384 0c35.3 0 64-28.7 64-64l0-32c0-35.3-28.7-64-64-64l-101.5 0-45.3 45.3c-25 25-6
5885.5 25-90.5 0L165.5 352 64 352zm368 56a24 24 0 1 1 0 48 24 24 0 1 1 0-48z"]},xW={prefix:"fas",iconName:"house",icon:[576,512,[127968,63498,63500,"home","home-alt","home-lg-alt"],"f015","M575.8 255.5c0 18-15 32.1-32 32.1l-32 0 .7 160.2c0 2.7-.2 5.4-.5 8.1l0 16.2c0 22.1-17.9 40-40 40l-16 0c-1.1 0-2.2 0-3.3-.1c-1.4 .1-2.8 .1-4.2 .1L416 512l-24 0c-22.1 0-40-17.9-40-40l0-24 0-64c0-17.7-14.3-32-32-32l-64 0c-17.7 0-32 14.3-32 32l0 64 0 24c0 22.1-17.9 40-40 40l-24 0-31.9 0c-1.5 0-3-.1-4.5-.2c-1.2 .1-2.4 .2-3.6 .2l-16 0c-22.1 0-40-17.9-40-40l0-112c0-.9 0-1.9 .1-2.8l0-69.7-32 0c-18 0-32-14-32-32.1c0-9 3-17 10-24L266.4 8c7-7 15-8 22-8s15 2 21 7L564.8 231.5c8 7 12 15 11 24z"]},bW=xW,oS={prefix:"fas",iconName:"credit-card",icon:[576,512,[128179,62083,"credit-card-alt"],"f09d","M64 32C28.7 32 0 60.7 0 96l0 32 576 0 0-32c0-35.3-28.7-64-64-64L64 32zM576 224L0 224 0 416c0 35.3 28.7 64 64 64l448 0c35.3 0 64-28.7 64-64l0-192zM112 352l64 0c8.8 0 16 7.2 16 16s-7.2 16-16 16l-64 0c-8.8 0-16-7.2-16-16s7.2-16 16-16zm112 16c0-8.8 7.2-16 16-16l128 0c8.8 0 16 7.2 16 16s-7.2 16-16 16l-128 0c-8.8 0-16-7.2-16-16z"]},wL={prefix:"fas",iconName:"bell",icon:[448,512,[128276,61602],"f0f3","M224 0c-17.7 0-32 14.3-32 32l0 19.2C119 66 64 130.6 64 208l0 18.8c0 47-17.3 92.4-48.5 127.6l-7.4 8.3c-8.4 9.4-10.4 22.9-5.3 34.4S19.4 416 32 416l384 0c12.6 0 24-7.4 29.2-18.9s3.1-25-5.3-34.4l-7.4-8.3C401.3 319.2 384 273.9 384 226.8l0-18.8c0-77.4-55-142-128-156.8L256 32c0-17.7-14.3-32-32-32zm45.3 493.3c12-12 18.7-28.3 18.7-45.3l-64 0-64 0c0 17 6.7 33.3 18.7 45.3s28.3 18.7 45.3 18.7s33.3-6.7 45.3-18.7z"]},wW={prefix:"fas",iconName:"location-dot",icon:[384,512,["map-marker-alt"],"f3c5","M215.7 499.2C267 435 384 279.4 384 192C384 86 298 0 192 0S0 86 0 192c0 87.4 117 243 168.3 307.2c12.3 15.3 35.1 15.3 47.4 0zM192 128a64 64 0 1 1 0 128 64 64 0 1 1 0-128z"]},TW=wW,SW={prefix:"fas",iconName:"arrow-down",icon:[384,512,[8595],"f063","M169.4 470.6c12.5 12.5 32.8 12.5 45.3 0l160-160c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0L224 370.8 224 64c0-17.7-14.3-32-32-32s-32 14.3-32 32l0 306.7L54.6 265.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3l160 160z"]},EW={prefix:"fas",iconName:"earth-americas",icon:[512,512,[127758,"earth","earth-america","globe-americas"],"f57d","M57.7 193l9.4 16.4c8.3 14.5 21.9 25.2 38 29.8L163 255.7c17.2 4.9 29 20.6 29 38.5l0 39.9c0 11 6.2 21 16 25.9s16 14.9 16 25.9l0 39c0 15.6 14.9 26.9 29.9 22.6c16.1-4.6 28.6-17.5 32.7-33.8l2.8-11.2c4.2-16.9 15.2-31.4 30.3-40l8.1-4.6c15-8.5 24.2-24.5 24.2-41.7l0-8.3c0-12.7-5.1-24.9-14.1-33.9l-3.9-3.9c-9-9-21.2-14.1-33.9-14.1L257 256c-11.1 0-22.1-2.9-31.8-8.4l-34.5-19.7c-4.3-2.5-7.6-6.5-9.2-11.2c-3.2-9.6 1.1-20 10.2-24.5l5.9-3c6.6-3.3 14.3-3.9 21.3-1.5l23.2 7.7c8.2 2.7 17.2-.4 21.9-7.5c4.7-7 4.2-16.3-1.2-22.8l-13.6-16.3c-10-12-9.9-29.5 .3-41.3l15.7-18.3c8.8-10.3 10.2-25 3.5-36.7l-2.4-4.2c-3.5-.2-6.9-.3-10.4-.3C163.1 48 84.4 108.9 57.7 193zM464 256c0-36.8-9.6-71.4-26.4-101.5L412 164.8c-15.7 6.3-23.8 23.8-18.5 39.8l16.9 50.7c3.5 10.4 12 18.3 22.6 20.9l29.1 7.3c1.2-9 1.8-18.2 1.8-27.5zM0 256a256 256 0 1 1 512 0A256 256 0 1 1 0 256z"]},AW=EW,CW={prefix:"fas",iconName:"gauge-high",icon:[512,512,[62461,"tachometer-alt","tachometer-alt-fast"],"f625","M0 256a256 256 0 1 1 512 0A256 256 0 1 1 0 256zM288 96a32 32 0 1 0 -64 0 32 32 0 1 0 64 0zM256 416c35.3 0 64-28.7 64-64c0-17.4-6.9-33.1-18.1-44.6L366 161.7c5.3-12.1-.2-26.3-12.3-31.6s-26.3 .2-31.6 12.3L257.9 288c-.6 0-1.3 0-1.9 0c-35.3 0-64 28.7-64 64s28.7 64 64 64zM176 144a32 32 0 1 0 -64 0 32 32 0 1 0 64 0zM96 288a32 32 0 1 0 0-64 32 32 0 1 0 0 64zm352-32a32 32 0 1 0 -64 0 32 32 0 1 0 64 0z"]},IW=CW,MW={prefix:"fas",iconName:"magnifying-glass",icon:[512,512,[128269,"search"],"f002","M416 208c0 45.9-14.9 88.3-40 122.7L502.6 457.4c12.5 12.5 12.5 32.8 0 45.3s-32.8 12.5-45.3 0L330.7 376c-34.4 25.2-76.8 40-122.7 40C93.1 416 0 322.9 0 208S93.1 0 208 0S416 93.1 416 208zM208 352a144 144 0 1 0 0-288 144 144 0 1 0 0 288z"]},TL=MW,PW={prefix:"fas",iconName:"arrow-up",icon:[384,512,[8593],"f062","M214.6 41.4c-12.5-12.5-32.8-12.5-45.3 0l-160 160c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0L160 141.2 160 448c0 17.7 14.3 32 32 32s32-14.3 32-32l0-306.7L329.4 246.6c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3l-160-160z"]},DW={prefix:"fas",iconName:"user-graduate",icon:[448,512,[],"f501","M219.3 .5c3.1-.6 6.3-.6 9.4 0l200 40C439.9 42.7 448 52.6 448 64s-8.1 21.3-19.3 23.5L352 102.9l0 57.1c0 70.7-57.3 128-128 128s-128-57.3-128-128l0-57.1L48 93.3l0 65.1 15.7 78.4c.9 4.7-.3 9.6-3.3 13.3s-7.6 5.9-12.4 5.9l-32 0c-4.8 0-9.3-2.1-12.4-5.9s-4.3-8.6-3.3-13.3L16 158.4l0-71.8C6.5 83.3 0 74.3 0 64C0 52.6 8.1 42.7 19.3 40.5l200-40zM111.9 327.7c10.5-3.4 21.8 .4 29.4 8.5l71 75.5c6.3 6.7 17 6.7 23.3 0l71-75.5c7.6-8.1 18.9-11.9 29.4-8.5C401 348.6 448 409.4 448 481.3c0 17-13.8 30.7-30.7 30.7L30.7 512C13.8 512 0 498.2 0 481.3c0-71.9 47-132.7 111.9-153.6z"]},kW={prefix:"fas",iconName:"plus",icon:[448,512,[10133,61543,"add"],"2b","M256 80c0-17.7-14.3-32-32-32s-32 14.3-32 32l0 144L48 224c-17.7 0-32 14.3-32 32s14.3 32 32 32l144 0 0 144c0 17.7 14.3 32 32 32s32-14.3 32-32l0-144 144 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-144 0 0-144z"]},LW={prefix:"fas",iconName:"xmark",icon:[384,512,[128473,10005,10006,10060,215,"close","multiply","remove","times"],"f00d","M342.6 150.6c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0L192 210.7 86.6 105.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3L146.7 256 41.4 361.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0L192 301.3 297.4 406.6c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3L237.3 256 342.6 150.6z"]},RW=LW,OW={prefix:"fas",iconName:"rocket",icon:[512,512,[],"f135","M156.6 384.9L125.7 354c-8.5-8.5-11.5-20.8-7.7-32.2c3-8.9 7-20.5 11.8-33.8L24 288c-8.6 0-16.6-4.6-20.9-12.1s-4.2-16.7 .2-24.1l52.5-88.5c13-21.9 36.5-35.3 61.9-35.3l82.3 0c2.4-4 4.8-7.7 7.2-11.3C289.1-4.1 411.1-8.1 483.9 5.3c11.6 2.1 20.6 11.2 22.8 22.8c13.4 72.9 9.3 194.8-111.4 276.7c-3.5 2.4-7.3 4.8-11.3 7.2l0 82.3c0 25.4-13.4 49-35.3 61.9l-88.5 52.5c-7.4 4.4-16.6 4.5-24.1 .2s-12.1-12.2-12.1-20.9l0-107.2c-14.1 4.9-26.4 8.9-35.7 11.9c-11.2 3.6-23.4 .5-31.8-7.8zM384 168a40 40 0 1 0 0-80 40 40 0 1 0 0 80z"]},zW={prefix:"fas",iconName:"store",icon:[576,512,[],"f54e","M547.6 103.8L490.3 13.1C485.2 5 476.1 0 466.4 0L109.6 0C99.9 0 90.8 5 85.7 13.1L28.3 103.8c-29.6 46.8-3.4 111.9 51.9 119.4c4 .5 8.1 .8 12.1 .8c26.1 0 49.3-11.4 65.2-29c15.9 17.6 39.1 29 65.2 29c26.1 0 49.3-11.4 65.2-29c15.9 17.6 39.1 29 65.2 29c26.2 0 49.3-11.4 65.2-29c16 17.6 39.1 29 65.2 29c4.1 0 8.1-.3 12.1-.8c55.5-7.4 81.8-72.5 52.1-119.4zM499.7 254.9c0 0 0 0-.1 0c-5.3 .7-10.7 1.1-16.2 1.1c-12.4
5880-24.3-1.9-35.4-5.3L448 384l-320 0 0-133.4c-11.2 3.5-23.2 5.4-35.6 5.4c-5.5 0-11-.4-16.3-1.1l-.1 0c-4.1-.6-8.1-1.3-12-2.3L64 384l0 64c0 35.3 28.7 64 64 64l320 0c35.3 0 64-28.7 64-64l0-64 0-131.4c-4 1-8 1.8-12.3 2.3z"]},_1={prefix:"fas",iconName:"chevron-left",icon:[320,512,[9001],"f053","M9.4 233.4c-12.5 12.5-12.5 32.8 0 45.3l192 192c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3L77.3 256 246.6 86.6c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0l-192 192z"]},y1={prefix:"fas",iconName:"chevron-right",icon:[320,512,[9002],"f054","M310.6 233.4c12.5 12.5 12.5 32.8 0 45.3l-192 192c-12.5 12.5-32.8 12.5-45.3 0s-12.5-32.8 0-45.3L242.7 256 73.4 86.6c-12.5-12.5-12.5-32.8 0-45.3s32.8-12.5 45.3 0l192 192z"]},FW={prefix:"fas",iconName:"percent",icon:[384,512,[62101,62785,"percentage"],"25","M374.6 118.6c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0l-320 320c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0l320-320zM128 128A64 64 0 1 0 0 128a64 64 0 1 0 128 0zM384 384a64 64 0 1 0 -128 0 64 64 0 1 0 128 0z"]},BW=FW,NW={prefix:"fas",iconName:"building",icon:[384,512,[127970,61687],"f1ad","M48 0C21.5 0 0 21.5 0 48L0 464c0 26.5 21.5 48 48 48l96 0 0-80c0-26.5 21.5-48 48-48s48 21.5 48 48l0 80 96 0c26.5 0 48-21.5 48-48l0-416c0-26.5-21.5-48-48-48L48 0zM64 240c0-8.8 7.2-16 16-16l32 0c8.8 0 16 7.2 16 16l0 32c0 8.8-7.2 16-16 16l-32 0c-8.8 0-16-7.2-16-16l0-32zm112-16l32 0c8.8 0 16 7.2 16 16l0 32c0 8.8-7.2 16-16 16l-32 0c-8.8 0-16-7.2-16-16l0-32c0-8.8 7.2-16 16-16zm80 16c0-8.8 7.2-16 16-16l32 0c8.8 0 16 7.2 16 16l0 32c0 8.8-7.2 16-16 16l-32 0c-8.8 0-16-7.2-16-16l0-32zM80 96l32 0c8.8 0 16 7.2 16 16l0 32c0 8.8-7.2 16-16 16l-32 0c-8.8 0-16-7.2-16-16l0-32c0-8.8 7.2-16 16-16zm80 16c0-8.8 7.2-16 16-16l32 0c8.8 0 16 7.2 16 16l0 32c0 8.8-7.2 16-16 16l-32 0c-8.8 0-16-7.2-16-16l0-32zM272 96l32 0c8.8 0 16 7.2 16 16l0 32c0 8.8-7.2 16-16 16l-32 0c-8.8 0-16-7.2-16-16l0-32c0-8.8 7.2-16 16-16z"]},VW={prefix:"fas",iconName:"triangle-exclamation",icon:[512,512,[9888,"exclamation-triangle","warning"],"f071","M256 32c14.2 0 27.3 7.5 34.5 19.8l216 368c7.3 12.4 7.3 27.7 .2 40.1S486.3 480 472 480L40 480c-14.3 0-27.6-7.7-34.7-20.1s-7-27.8 .2-40.1l216-368C228.7 39.5 241.8 32 256 32zm0 128c-13.3 0-24 10.7-24 24l0 112c0 13.3 10.7 24 24 24s24-10.7 24-24l0-112c0-13.3-10.7-24-24-24zm32 224a32 32 0 1 0 -64 0 32 32 0 1 0 64 0z"]},$W=VW,jW={prefix:"fas",iconName:"right-left",icon:[512,512,["exchange-alt"],"f362","M32 96l320 0 0-64c0-12.9 7.8-24.6 19.8-29.6s25.7-2.2 34.9 6.9l96 96c6 6 9.4 14.1 9.4 22.6s-3.4 16.6-9.4 22.6l-96 96c-9.2 9.2-22.9 11.9-34.9 6.9s-19.8-16.6-19.8-29.6l0-64L32 160c-17.7 0-32-14.3-32-32s14.3-32 32-32zM480 352c17.7 0 32 14.3 32 32s-14.3 32-32 32l-320 0 0 64c0 12.9-7.8 24.6-19.8 29.6s-25.7 2.2-34.9-6.9l-96-96c-6-6-9.4-14.1-9.4-22.6s3.4-16.6 9.4-22.6l96-96c9.2-9.2 22.9-11.9 34.9-6.9s19.8 16.6 19.8 29.6l0 64 320 0z"]},v1=jW,UW={prefix:"fas",iconName:"circle-xmark",icon:[512,512,[61532,"times-circle","xmark-circle"],"f057","M256 512A256 256 0 1 0 256 0a256 256 0 1 0 0 512zM175 175c9.4-9.4 24.6-9.4 33.9 0l47 47 47-47c9.4-9.4 24.6-9.4 33.9 0s9.4 24.6 0 33.9l-47 47 47 47c9.4 9.4 9.4 24.6 0 33.9s-24.6 9.4-33.9 0l-47-47-47 47c-9.4 9.4-24.6 9.4-33.9 0s-9.4-24.6 0-33.9l47-47-47-47c-9.4-9.4-9.4-24.6 0-33.9z"]},HW=UW,GW={prefix:"fas",iconName:"dollar-sign",icon:[320,512,[128178,61781,"dollar","usd"],"24","M160 0c17.7 0 32 14.3 32 32l0 35.7c1.6 .2 3.1 .4 4.7 .7c.4 .1 .7 .1 1.1 .2l48 8.8c17.4 3.2 28.9 19.9 25.7 37.2s-19.9 28.9-37.2 25.7l-47.5-8.7c-31.3-4.6-58.9-1.5-78.3 6.2s-27.2 18.3-29 28.1c-2 10.7-.5 16.7 1.2 20.4c1.8 3.9 5.5 8.3 12.8 13.2c16.3 10.7 41.3 17.7 73.7 26.3l2.9 .8c28.6 7.6 63.6 16.8 89.6 33.8c14.2 9.3 27.6 21.9 35.9 39.5c8.5 17.9 10.3 37.9 6.4 59.2c-6.9 38-33.1 63.4-65.6 76.7c-13.7 5.6-28.6 9.2-44.4 11l0 33.4c0 17.7-14.3 32-32 32s-32-14.3-32-32l0-34.9c-.4-.1-.9-.1-1.3-.2l-.2 0s0 0 0 0c-24.4-3.8-64.5-14.3-91.5-26.3c-16.1-7.2-23.4-26.1-16.2-42.2s26.1-23.4 42.2-16.2c20.9 9.3 55.3 18.5 75.2 21.6c31.9 4.7 58.2 2 76-5.3c16.9-6.9 24.6-16.9 26.8-28.9c1.9-10.6 .4-16.7-1.3-20.4c-1.9-4-5.6-8.4-13-13.3c-16.4-10.7-41.5-17.7-74-26.3l-2.8-.7s0 0 0 0C119.4 279.3 84.4 270 58.4 253c-14.2-9.3-27.5-22-35.8-39.6c-8.4-17.9-10.1-37.9-6.1-59.2C23.7 116 52.3 91.2 84.8 78.3c13.3-5.3 27.9-8.9 43.2-11L128 32c0-17.7 14.3-32 32-32z"]},WW={prefix:"fas",iconName:"magnifying-glass-dollar",icon:[512,512,["search-dollar"],"f688","M416 208c0 45.9-14.9 88.3-40 122.7L502.6 457.4c12.5 12.5 12.5 32.8 0 45.3s-32.8 12.5-45.3 0L330.7 376c-34.4 25.2-76.8 40-122.7 40C93.1 416 0 322.9 0 208S93.1 0 208 0S416 93.1 416 208zM228 104c0-11-9-20-20-20s-20 9-20 20l0 14c-7.6 1.7-15.2 4.4-22.2 8.5c-13.9 8.3-25.9 22.8-25.8 43.9c.1 20.3 12 33.1 24.7 40.7c11 6.6 24.7 10.8 35.6 14l1.7 .5c12.6 3.8 21.8 6.8 28 10.7c5.1 3.2 5.8 5.4 5.9 8.2c.1 5-1.8 8-5.9 10.5c-5 3.1-12.9 5-21.4 4.7c-11.1-.4-21.5-3.9-35.1-8.5c-2.3-.8-4.7-1.6-7.2-2.4c-10.5-3.5-21.8 2.2-25.3 12.6s2.2 21.8 12.6 25.3c1.9 .6 4 1.3 6.1 2.1c0 0 0 0 0 0s0 0 0 0c8.3 2.9 17.9 6.2 28.2 8.4l
5880 14.6c0 11 9 20 20 20s20-9 20-20l0-13.8c8-1.7 16-4.5 23.2-9c14.3-8.9 25.1-24.1 24.8-45c-.3-20.3-11.7-33.4-24.6-41.6c-11.5-7.2-25.9-11.6-37.1-15l-.7-.2c-12.8-3.9-21.9-6.7-28.3-10.5c-5.2-3.1-5.3-4.9-5.3-6.7c0-3.7 1.4-6.5 6.2-9.3c5.4-3.2 13.6-5.1 21.5-5c9.6 .1 20.2 2.2 31.2 5.2c10.7 2.8 21.6-3.5 24.5-14.2s-3.5-21.6-14.2-24.5c-6.5-1.7-13.7-3.4-21.1-4.7l0-13.9z"]},qW=WW,ZW={prefix:"fas",iconName:"building-columns",icon:[512,512,["bank","institution","museum","university"],"f19c","M243.4 2.6l-224 96c-14 6-21.8 21-18.7 35.8S16.8 160 32 160l0 8c0 13.3 10.7 24 24 24l400 0c13.3 0 24-10.7 24-24l0-8c15.2 0 28.3-10.7 31.3-25.6s-4.8-29.9-18.7-35.8l-224-96c-8-3.4-17.2-3.4-25.2 0zM128 224l-64 0 0 196.3c-.6 .3-1.2 .7-1.8 1.1l-48 32c-11.7 7.8-17 22.4-12.9 35.9S17.9 512 32 512l448 0c14.1 0 26.5-9.2 30.6-22.7s-1.1-28.1-12.9-35.9l-48-32c-.6-.4-1.2-.7-1.8-1.1L448 224l-64 0 0 192-40 0 0-192-64 0 0 192-48 0 0-192-64 0 0 192-40 0 0-192zM256 64a32 32 0 1 1 0 64 32 32 0 1 1 0-64z"]},SL=ZW,XW={prefix:"fas",iconName:"video",icon:[576,512,["video-camera"],"f03d","M0 128C0 92.7 28.7 64 64 64l256 0c35.3 0 64 28.7 64 64l0 256c0 35.3-28.7 64-64 64L64 448c-35.3 0-64-28.7-64-64L0 128zM559.1 99.8c10.4 5.6 16.9 16.4 16.9 28.2l0 256c0 11.8-6.5 22.6-16.9 28.2s-23 5-32.9-1.6l-96-64L416 337.1l0-17.1 0-128 0-17.1 14.2-9.5 96-64c9.8-6.5 22.4-7.2 32.9-1.6z"]},YW={prefix:"fas",iconName:"graduation-cap",icon:[640,512,[127891,"mortar-board"],"f19d","M320 32c-8.1 0-16.1 1.4-23.7 4.1L15.8 137.4C6.3 140.9 0 149.9 0 160s6.3 19.1 15.8 22.6l57.9 20.9C57.3 229.3 48 259.8 48 291.9l0 28.1c0 28.4-10.8 57.7-22.3 80.8c-6.5 13-13.9 25.8-22.5 37.6C0 442.7-.9 448.3 .9 453.4s6 8.9 11.2 10.2l64 16c4.2 1.1 8.7 .3 12.4-2s6.3-6.1 7.1-10.4c8.6-42.8 4.3-81.2-2.1-108.7C90.3 344.3 86 329.8 80 316.5l0-24.6c0-30.2 10.2-58.7 27.9-81.5c12.9-15.5 29.6-28 49.2-35.7l157-61.7c8.2-3.2 17.5 .8 20.7 9s-.8 17.5-9 20.7l-157 61.7c-12.4 4.9-23.3 12.4-32.2 21.6l159.6 57.6c7.6 2.7 15.6 4.1 23.7 4.1s16.1-1.4 23.7-4.1L624.2 182.6c9.5-3.4 15.8-12.5 15.8-22.6s-6.3-19.1-15.8-22.6L343.7 36.1C336.1 33.4 328.1 32 320 32zM128 408c0 35.3 86 72 192 72s192-36.7 192-72L496.7 262.6 354.5 314c-11.1 4-22.8 6-34.5 6s-23.5-2-34.5-6L143.3 262.6 128 408z"]},KW={class:"digital-banking animate-on-scroll"},JW={class:"digital-banking-content"},QW={class:"feature-grid"},eq={class:"feature-icon"},tq={__name:"DigitalBanking",setup(n){const t=Mi([{icon:g1,title:"Mobile Banking",description:"Access your accounts, make transfers, and pay bills from anywhere, anytime."},{icon:rS,title:"Secure Online Banking",description:"Bank with confidence knowing your information is protected by state-of-the-art security measures."},{icon:Yy,title:"Financial Insights",description:"Get personalized insights and recommendations to help you manage your money better."},{icon:oS,title:"Digital Wallet",description:"Make secure payments with your smartphone using our digital wallet solutions."}]);return(o,u)=>(Ke(),it("section",KW,[u[0]||(u[0]=H("h2",{class:"section-title"},"Digital Banking Solutions",-1)),H("div",JW,[H("div",QW,[(Ke(!0),it(fn,null,Hn(t.value,d=>(Ke(),it("div",{class:"feature",key:d.title},[H("div",eq,[Dt(cs(Fs),{icon:d.icon},null,8,["icon"])]),H("h3",null,Ut(d.title),1),H("p",null,Ut(d.description),1)]))),128))])])]))}},iq=ji(tq,[["__scopeId","data-v-cdabd141"]]),nq={class:"customer-testimonials animate-on-scroll"},sq={class:"testimonials-slider"},rq={class:"testimonial-content"},oq={class:"quote"},aq={class:"author"},lq=["src","alt"],cq={class:"author-info"},uq={__name:"CustomerTestimonial",setup(n){const t=Mi([{id:1,quote:"CIBC's digital banking solutions have made managing my finances so much easier. I love the convenience and security they provide.",name:"Sarah Johnson",title:"Small Business Owner",avatar:"https://images.unsplash.com/photo-1531746020798-e6953c6e8e04?q=80&w=2550&auto=format&fit=crop&ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D"},{id:2,quote:"The personalized financial advice I received from CIBC has been invaluable. It's helped me make better decisions for my future.",name:"Michael Chen",title:"Software Engineer",avatar:"https://images.unsplash.com/photo-1564564321837-a57b7070ac4f?q=80&w=2976&auto=format&fit=crop&ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D"},{id:3,quote:"I've been a CIBC customer for over 20 years, and their commitment to innovation and customer service never ceases to impress me.",name:"Emily Rodriguez",title:"Marketing Executive",avatar:"https://images.unsplash.com/photo-1517212160285-e9fbf358c905?q=80&w=3174&auto=format&fit=crop&ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D"}]);return(o,u)=>(Ke(),it("section",nq,[u[0]||(u[0]=H("h2",{class:"section-title"},"What Our Customers Say",-1)),H("div",sq,[(Ke(!0),it(fn,null,Hn(t.value,d=>(Ke(),it("div",{class:"testimonial",key:d.id},[H("div",rq,[H("p",oq,'"'+Ut(d.quote)+'"',1),H("div",aq,[H("img",{src:d.avatar,alt:d.name,class:"avatar"},null,8,lq),H("div",cq,[H("h4",null,Ut(d.name),1),H("p",null,Ut(d.title),1)])])])]))),128))])]))}},hq=ji(uq,[["__scopeId","data-v-0ec46263"]]),dq={class:"question-search"},fq={class:"container"},pq={key:0,class:"suggestions"},mq=["onClick"],gq={__name:"QuestionSearch",setup(n){oc.add(TL);const t=Mi(""),o=Mi(!1),u=["How do I open a new account?","What are the current mortgage rates?","How can I report a lost credit card?","What are the benefits of online banking?"],d=bs(()=>o.value&&t.value.length===0),_=()=>{console.log("Searching for:",t.value)},x=s=>{t.value=s,_()};return(s,A)=>(Ke(),it("div",dq,[H("div",fq,[A[4]||(A[4]=H("h3",null,"Have a Question?",
588-1)),H("div",{class:lo(["search-box",{active:o.value}])},[An(H("input",{type:"text","onUpdate:modelValue":A[0]||(A[0]=P=>t.value=P),placeholder:"Type your question here...",onFocus:A[1]||(A[1]=P=>o.value=!0),onBlur:A[2]||(A[2]=P=>o.value=!1)},null,544),[[Ur,t.value]]),H("button",{onClick:_,class:"search-button"},[Dt(cs(Fs),{icon:["fas","search"]})])],2),Dt(ET,{name:"fade"},{default:vl(()=>[d.value?(Ke(),it("div",pq,[A[3]||(A[3]=H("p",null,"Popular questions:",-1)),H("ul",null,[(Ke(),it(fn,null,Hn(u,(P,R)=>H("li",{key:R},[H("a",{href:"#",onClick:Eh(V=>x(P),["prevent"])},Ut(P),9,mq)])),64))])])):ha("",!0)]),_:1})])]))}},EL=ji(gq,[["__scopeId","data-v-e2e91a48"]]);function _q(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var rx={exports:{}},yq=rx.exports,kM;function vq(){return kM||(kM=1,function(n,t){(function(o,u){n.exports=u()})(yq,function(){var o,u,d;function _(s,A){if(!o)o=A;else if(!u)u=A;else{var P="self.onerror = function() { console.error('An error occurred while parsing the WebWorker bundle. This is most likely due to improper transpilation by Babel; please see https://docs.mapbox.com/mapbox-gl-js/guides/install/#transpiling'); }; var sharedChunk = {}; ("+o+")(sharedChunk); ("+u+")(sharedChunk); self.onerror = null;",R={};o(R),d=A(R),typeof window<"u"&&window&&window.URL&&window.URL.createObjectURL&&(d.workerUrl=window.URL.createObjectURL(new Blob([P],{type:"text/javascript"})))}}_(["exports"],function(s){var A=1e-6,P=typeof Float32Array<"u"?Float32Array:Array;function R(a,e){var r=e[0],c=e[1],h=e[2],m=e[3],g=r*m-h*c;return g?(a[0]=m*(g=1/g),a[1]=-c*g,a[2]=-h*g,a[3]=r*g,a):null}function V(){var a=new P(9);return P!=Float32Array&&(a[1]=0,a[2]=0,a[3]=0,a[5]=0,a[6]=0,a[7]=0),a[0]=1,a[4]=1,a[8]=1,a}function j(a,e){var r=e[0],c=e[1],h=e[2],m=e[3],g=e[4],b=e[5],T=e[6],E=e[7],I=e[8];return a[0]=g*I-b*E,a[1]=h*E-c*I,a[2]=c*b-h*g,a[3]=b*T-m*I,a[4]=r*I-h*T,a[5]=h*m-r*b,a[6]=m*E-g*T,a[7]=c*T-r*E,a[8]=r*g-c*m,a}function Q(a,e,r){var c=e[0],h=e[1],m=e[2],g=e[3],b=e[4],T=e[5],E=e[6],I=e[7],M=e[8],k=r[0],B=r[1],N=r[2],U=r[3],Y=r[4],J=r[5],ae=r[6],ne=r[7],G=r[8];return a[0]=k*c+B*g+N*E,a[1]=k*h+B*b+N*I,a[2]=k*m+B*T+N*M,a[3]=U*c+Y*g+J*E,a[4]=U*h+Y*b+J*I,a[5]=U*m+Y*T+J*M,a[6]=ae*c+ne*g+G*E,a[7]=ae*h+ne*b+G*I,a[8]=ae*m+ne*T+G*M,a}function me(){var a=new P(16);return P!=Float32Array&&(a[1]=0,a[2]=0,a[3]=0,a[4]=0,a[6]=0,a[7]=0,a[8]=0,a[9]=0,a[11]=0,a[12]=0,a[13]=0,a[14]=0),a[0]=1,a[5]=1,a[10]=1,a[15]=1,a}function re(a){return a[0]=1,a[1]=0,a[2]=0,a[3]=0,a[4]=0,a[5]=1,a[6]=0,a[7]=0,a[8]=0,a[9]=0,a[10]=1,a[11]=0,a[12]=0,a[13]=0,a[14]=0,a[15]=1,a}function be(a,e){var r=e[0],c=e[1],h=e[2],m=e[3],g=e[4],b=e[5],T=e[6],E=e[7],I=e[8],M=e[9],k=e[10],B=e[11],N=e[12],U=e[13],Y=e[14],J=e[15],ae=r*b-c*g,ne=r*T-h*g,G=r*E-m*g,te=c*T-h*b,oe=c*E-m*b,he=h*E-m*T,Te=I*U-M*N,Me=I*Y-k*N,Pe=I*J-B*N,ze=M*Y-k*U,tt=M*J-B*U,mt=k*J-B*Y,ut=ae*mt-ne*tt+G*ze+te*Pe-oe*Me+he*Te;return ut?(a[0]=(b*mt-T*tt+E*ze)*(ut=1/ut),a[1]=(h*tt-c*mt-m*ze)*ut,a[2]=(U*he-Y*oe+J*te)*ut,a[3]=(k*oe-M*he-B*te)*ut,a[4]=(T*Pe-g*mt-E*Me)*ut,a[5]=(r*mt-h*Pe+m*Me)*ut,a[6]=(Y*G-N*he-J*ne)*ut,a[7]=(I*he-k*G+B*ne)*ut,a[8]=(g*tt-b*Pe+E*Te)*ut,a[9]=(c*Pe-r*tt-m*Te)*ut,a[10]=(N*oe-U*G+J*ae)*ut,a[11]=(M*G-I*oe-B*ae)*ut,a[12]=(b*Me-g*ze-T*Te)*ut,a[13]=(r*ze-c*Me+h*Te)*ut,a[14]=(U*ne-N*te-Y*ae)*ut,a[15]=(I*te-M*ne+k*ae)*ut,a):null}function ve(a,e,r){var c=e[0],h=e[1],m=e[2],g=e[3],b=e[4],T=e[5],E=e[6],I=e[7],M=e[8],k=e[9],B=e[10],N=e[11],U=e[12],Y=e[13],J=e[14],ae=e[15],ne=r[0],G=r[1],te=r[2],oe=r[3];return a[0]=ne*c+G*b+te*M+oe*U,a[1]=ne*h+G*T+te*k+oe*Y,a[2]=ne*m+G*E+te*B+oe*J,a[3]=ne*g+G*I+te*N+oe*ae,a[4]=(ne=r[4])*c+(G=r[5])*b+(te=r[6])*M+(oe=r[7])*U,a[5]=ne*h+G*T+te*k+oe*Y,a[6]=ne*m+G*E+te*B+oe*J,a[7]=ne*g+G*I+te*N+oe*ae,a[8]=(ne=r[8])*c+(G=r[9])*b+(te=r[10])*M+(oe=r[11])*U,a[9]=ne*h+G*T+te*k+oe*Y,a[10]=ne*m+G*E+te*B+oe*J,a[11]=ne*g+G*I+te*N+oe*ae,a[12]=(ne=r[12])*c+(G=r[13])*b+(te=r[14])*M+(oe=r[15])*U,a[13]=ne*h+G*T+te*k+oe*Y,a[14]=ne*m+G*E+te*B+oe*J,a[15]=ne*g+G*I+te*N+oe*ae,a}function Ee(a,e,r){var c,h,m,g,b,T,E,I,M,k,B,N,U=r[0],Y=r[1],J=r[2];return e===a?(a[12]=e[0]*U+e[4]*Y+e[8]*J+e[12],a[13]=e[1]*U+e[5]*Y+e[9]*J+e[13],a[14]=e[2]*U+e[6]*Y+e[10]*J+e[14],a[15]=e[3]*U+e[7]*Y+e[11]*J+e[15]):(h=e[1],m=e[2],g=e[3],b=e[4],T=e[5],E=e[6],I=e[7],M=e[8],k=e[9],B=e[10],N=e[11],a[0]=c=e[0],a[1]=h,a[2]=m,a[3]=g,a[4]=b,a[5]=T,a[6]=E,a[7]=I,a[8]=M,a[9]=k,a[10]=B,a[11]=N,a[12]=c*U+b*Y+M*J+e[12],a[13]=h*U+T*Y+k*J+e[13],a[14]=m*U+E*Y+B*J+e[14],a[15]=g*U+I*Y+N*J+e[15]),a}function je(a,e,r){var c=r[0],h=r[1],m=r[2];return a[0]=e[0]*c,a[1]=e[1]*c,a[2]=e[2]*c,a[3]=e[3]*c,a[4]=e[4]*h,a[5]=e[5]*h,a[6]=e[6]*h,a[7]=e[7]*h,a[8]=e[8]*m,a[9]=e[9]*m,a[10]=e[10]*m,a[11]=e[11]*m,a[12]=e[12],a[13]=e[13],a[14]=e[14],a[15]=e[15],a}function Ve(a,e,r){var c=Math.sin(r),h=Math.cos(r),m=e[4],g=e[5],b=e[6],T=e[7],E=e[8],I=e[9],M=e[10],k=e[11];return e!==a&&(a[0]=e[0],a[1]=e[1],a[2]=e[2],a[3]=e[3],a[12]=e[12],a[13]=e[13],a[14]=e[14],a[15]=e[15]),a[4]=m*h+E*c,a[5]=g*h+I*c,a[6]=b*h+M*c,a[7]=T*h+k*c,a[8]=E*h-m*c,a[9]=I*h-g*c,a[10]=M*h-b*c,a[11]=k*h-T*c,a}
588function Je(a,e,r){var c=Math.sin(r),h=Math.cos(r),m=e[0],g=e[1],b=e[2],T=e[3],E=e[8],I=e[9],M=e[10],k=e[11];return e!==a&&(a[4]=e[4],a[5]=e[5],a[6]=e[6],a[7]=e[7],a[12]=e[12],a[13]=e[13],a[14]=e[14],a[15]=e[15]),a[0]=m*h-E*c,a[1]=g*h-I*c,a[2]=b*h-M*c,a[3]=T*h-k*c,a[8]=m*c+E*h,a[9]=g*c+I*h,a[10]=b*c+M*h,a[11]=T*c+k*h,a}function vt(a,e,r){var c=Math.sin(r),h=Math.cos(r),m=e[0],g=e[1],b=e[2],T=e[3],E=e[4],I=e[5],M=e[6],k=e[7];return e!==a&&(a[8]=e[8],a[9]=e[9],a[10]=e[10],a[11]=e[11],a[12]=e[12],a[13]=e[13],a[14]=e[14],a[15]=e[15]),a[0]=m*h+E*c,a[1]=g*h+I*c,a[2]=b*h+M*c,a[3]=T*h+k*c,a[4]=E*h-m*c,a[5]=I*h-g*c,a[6]=M*h-b*c,a[7]=k*h-T*c,a}function _t(a,e){return a[0]=e[0],a[1]=0,a[2]=0,a[3]=0,a[4]=0,a[5]=e[1],a[6]=0,a[7]=0,a[8]=0,a[9]=0,a[10]=e[2],a[11]=0,a[12]=0,a[13]=0,a[14]=0,a[15]=1,a}function Mt(a,e,r){var c,h,m,g=r[0],b=r[1],T=r[2],E=Math.hypot(g,b,T);return E<A?null:(g*=E=1/E,b*=E,T*=E,c=Math.sin(e),h=Math.cos(e),a[0]=g*g*(m=1-h)+h,a[1]=b*g*m+T*c,a[2]=T*g*m-b*c,a[3]=0,a[4]=g*b*m-T*c,a[5]=b*b*m+h,a[6]=T*b*m+g*c,a[7]=0,a[8]=g*T*m+b*c,a[9]=b*T*m-g*c,a[10]=T*T*m+h,a[11]=0,a[12]=0,a[13]=0,a[14]=0,a[15]=1,a)}function At(a,e){var r=e[0],c=e[1],h=e[2],m=e[3],g=r+r,b=c+c,T=h+h,E=r*g,I=c*g,M=c*b,k=h*g,B=h*b,N=h*T,U=m*g,Y=m*b,J=m*T;return a[0]=1-M-N,a[1]=I+J,a[2]=k-Y,a[3]=0,a[4]=I-J,a[5]=1-E-N,a[6]=B+U,a[7]=0,a[8]=k+Y,a[9]=B-U,a[10]=1-E-M,a[11]=0,a[12]=0,a[13]=0,a[14]=0,a[15]=1,a}Math.hypot||(Math.hypot=function(){for(var a=0,e=arguments.length;e--;)a+=arguments[e]*arguments[e];return Math.sqrt(a)});var ei=ve;function Yt(){var a=new P(3);return P!=Float32Array&&(a[0]=0,a[1]=0,a[2]=0),a}function Zt(a){var e=new P(3);return e[0]=a[0],e[1]=a[1],e[2]=a[2],e}function yi(a){return Math.hypot(a[0],a[1],a[2])}function Fi(a,e,r){var c=new P(3);return c[0]=a,c[1]=e,c[2]=r,c}function ki(a,e,r){return a[0]=e[0]+r[0],a[1]=e[1]+r[1],a[2]=e[2]+r[2],a}function wi(a,e,r){return a[0]=e[0]-r[0],a[1]=e[1]-r[1],a[2]=e[2]-r[2],a}function Li(a,e,r){return a[0]=e[0]*r[0],a[1]=e[1]*r[1],a[2]=e[2]*r[2],a}function cn(a,e,r){return a[0]=Math.min(e[0],r[0]),a[1]=Math.min(e[1],r[1]),a[2]=Math.min(e[2],r[2]),a}function vi(a,e,r){return a[0]=Math.max(e[0],r[0]),a[1]=Math.max(e[1],r[1]),a[2]=Math.max(e[2],r[2]),a}function Ue(a,e,r){return a[0]=e[0]*r,a[1]=e[1]*r,a[2]=e[2]*r,a}function Yn(a,e,r,c){return a[0]=e[0]+r[0]*c,a[1]=e[1]+r[1]*c,a[2]=e[2]+r[2]*c,a}function Ki(a,e){var r=e[0]-a[0],c=e[1]-a[1],h=e[2]-a[2];return r*r+c*c+h*h}function ps(a){var e=a[0],r=a[1],c=a[2];return e*e+r*r+c*c}function On(a,e){return a[0]=-e[0],a[1]=-e[1],a[2]=-e[2],a}function hn(a,e){var r=e[0],c=e[1],h=e[2],m=r*r+c*c+h*h;return m>0&&(m=1/Math.sqrt(m)),a[0]=e[0]*m,a[1]=e[1]*m,a[2]=e[2]*m,a}function Hi(a,e){return a[0]*e[0]+a[1]*e[1]+a[2]*e[2]}function Ct(a,e,r){var c=e[0],h=e[1],m=e[2],g=r[0],b=r[1],T=r[2];return a[0]=h*T-m*b,a[1]=m*g-c*T,a[2]=c*b-h*g,a}function zt(a,e,r,c){var h=e[0],m=e[1],g=e[2];return a[0]=h+c*(r[0]-h),a[1]=m+c*(r[1]-m),a[2]=g+c*(r[2]-g),a}function ti(a,e,r){var c=e[0],h=e[1],m=e[2],g=r[3]*c+r[7]*h+r[11]*m+r[15];return a[0]=(r[0]*c+r[4]*h+r[8]*m+r[12])/(g=g||1),a[1]=(r[1]*c+r[5]*h+r[9]*m+r[13])/g,a[2]=(r[2]*c+r[6]*h+r[10]*m+r[14])/g,a}function qi(a,e,r){var c=e[0],h=e[1],m=e[2];return a[0]=c*r[0]+h*r[3]+m*r[6],a[1]=c*r[1]+h*r[4]+m*r[7],a[2]=c*r[2]+h*r[5]+m*r[8],a}function ts(a,e,r){var c=r[0],h=r[1],m=r[2],g=e[0],b=e[1],T=e[2],E=h*T-m*b,I=m*g-c*T,M=c*b-h*g,k=h*M-m*I,B=m*E-c*M,N=c*I-h*E,U=2*r[3];return I*=U,M*=U,B*=2,N*=2,a[0]=g+(E*=U)+(k*=2),a[1]=b+I+B,a[2]=T+M+N,a}function Fe(a,e){return a[0]===e[0]&&a[1]===e[1]&&a[2]===e[2]}var Oe=wi,dt=Li,$t=yi;function Ft(){var a=new P(4);return P!=Float32Array&&(a[0]=0,a[1]=0,a[2]=0,a[3]=0),a}function Wt(a,e,r){return a[0]=e[0]*r,a[1]=e[1]*r,a[2]=e[2]*r,a[3]=e[3]*r,a}function Ti(a,e){var r=e[0],c=e[1],h=e[2],m=e[3],g=r*r+c*c+h*h+m*m;return g>0&&(g=1/Math.sqrt(g)),a[0]=r*g,a[1]=c*g,a[2]=h*g,a[3]=m*g,a}function pi(a,e,r){var c=e[0],h=e[1],m=e[2],g=e[3];return a[0]=r[0]*c+r[4]*h+r[8]*m+r[12]*g,a[1]=r[1]*c+r[5]*h+r[9]*m+r[13]*g,a[2]=r[2]*c+r[6]*h+r[10]*m+r[14]*g,a[3]=r[3]*c+r[7]*h+r[11]*m+r[15]*g,a}function di(){var a=new P(4);return P!=Float32Array&&(a[0]=0,a[1]=0,a[2]=0),a[3]=1,a}function ai(a){return a[0]=0,a[1]=0,a[2]=0,a[3]=1,a}function on(a,e,r){r*=.5;var c=e[0],h=e[1],m=e[2],g=e[3],b=Math.sin(r),T=Math.cos(r);return a[0]=c*T+g*b,a[1]=h*T+m*b,a[2]=m*T-h*b,a[3]=g*T-c*b,a}function Ci(a,e,r){r*=.5;var c=e[0],h=e[1],m=e[2],g=e[3],b=Math.sin(r),T=Math.cos(r);return a[0]=c*T-m*b,a[1]=h*T+g*b,a[2]=m*T+c*b,a[3]=g*T-h*b,a}Yt(),Ft();var Bi,Gi,Vn,Kn,$n,Us=Ti,Qs=(Bi=Yt(),Gi=Fi(1,0,0),Vn=Fi(0,1,0),function(a,e,r){var c=Hi(e,r);return c<-.999999?(Ct(Bi,Gi,e),$t(Bi)<1e-6&&Ct(Bi,Vn,e),hn(Bi,Bi),function(h,m,g){g*=.5;var b=Math.sin(g);h[0]=b*m[0],h[1]=b*m[1],h[2]=b*m[2],h[3]=Math.cos(g)}(a,Bi,Math.PI),a):c>.999999?(a[0]=0,a[1]=0,a[2]=0,a[3]=1,a):(Ct(Bi,e,r),a[0]=Bi[0],a[1]=Bi[1],a[2]=Bi[2],a[3]=1+c,Us(a,a))});function tr(){var a=new P(2);return P!=Float32Array&&(a[0]=0,a[1]=0),a}function Pr(a,e){var r=new P(2);return r[0]=a,r[1]=e,r}function Mo(a,e,r){return a[0]=e[0]+r[0],a[1]=e[1]+r[1],a}function Bo(a,e,r){return a[0]=e[0]-r[0],a[1]=e[1]-r[1],a}function wr(a,e,r){return a[0]=e[0]*r,a[1]=e[1]*r,a}function Hr(a){return Math.hypot(a[0],a[1])}function El(a,e){var r=e[0],c=e[1],h=r*r+c*c;return h>0&&(h=1/Math.sqrt(h)),a[0]=e[0]*h,a[1]=e[1]*h,a}function Ss(a,e){return a[0]*e[0]+a[1]*e[1]}function ga(a){return a&&a.__esModule&&Object.prototype.hasOwnProperty.call(a,"default")?a.default:a}di(),di(),V(),tr();var qa,No,Vc=function(){if($n)return Kn;function a(e,r,c,h){this.cx=3*e,this.bx=3*(c-e)-this.cx,this.ax=1-this.cx-this.bx,this.cy=3*r,this.by=3*(h-r)-this.cy,this.ay=1-this.cy-this.by,this.p1x=e,this.p1y=r,this.p2x=c,this.p2y=h}return $n=1,Kn=a,a.prototype={sampleCurveX:function(e){return((this.ax*e+this.bx)*e+this.cx)*e},sampleCurveY:function(e){return((this.ay*e+this.by)*e+this.cy)*e},sampleCurveDerivativeX:function(e){return(3*this.ax*e+2*this.bx)*e+this.cx},solveCurveX:function(e,r){if(r===void 0&&(r=1e-6),e<0)return 0;if(e>1)return 1;for(var c=e,h=0;h<8;h++){var m=this.sampleCurveX(c)-e;if(Math.abs(m)<r)return c;var g=this.sampleCurveDerivativeX(c);if(Math.abs(g)<1e-6)break;c-=m/g}var b=0,T=1;for(c=e,h=0;h<20&&(m=this.sampleCurveX(c),!(Math.abs(m-e)<r));h++)e>m?b=c:T=c,c=.5*(T-b)+b;return c}
588,solve:function(e,r){return this.sampleCurveY(this.solveCurveX(e,r))}},Kn}(),zh=ga(Vc);function Cu(){if(No)return qa;function a(e,r){this.x=e,this.y=r}return No=1,qa=a,a.prototype={clone:function(){return new a(this.x,this.y)},add:function(e){return this.clone()._add(e)},sub:function(e){return this.clone()._sub(e)},multByPoint:function(e){return this.clone()._multByPoint(e)},divByPoint:function(e){return this.clone()._divByPoint(e)},mult:function(e){return this.clone()._mult(e)},div:function(e){return this.clone()._div(e)},rotate:function(e){return this.clone()._rotate(e)},rotateAround:function(e,r){return this.clone()._rotateAround(e,r)},matMult:function(e){return this.clone()._matMult(e)},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(e){return this.x===e.x&&this.y===e.y},dist:function(e){return Math.sqrt(this.distSqr(e))},distSqr:function(e){var r=e.x-this.x,c=e.y-this.y;return r*r+c*c},angle:function(){return Math.atan2(this.y,this.x)},angleTo:function(e){return Math.atan2(this.y-e.y,this.x-e.x)},angleWith:function(e){return this.angleWithSep(e.x,e.y)},angleWithSep:function(e,r){return Math.atan2(this.x*r-this.y*e,this.x*e+this.y*r)},_matMult:function(e){var r=e[2]*this.x+e[3]*this.y;return this.x=e[0]*this.x+e[1]*this.y,this.y=r,this},_add:function(e){return this.x+=e.x,this.y+=e.y,this},_sub:function(e){return this.x-=e.x,this.y-=e.y,this},_mult:function(e){return this.x*=e,this.y*=e,this},_div:function(e){return this.x/=e,this.y/=e,this},_multByPoint:function(e){return this.x*=e.x,this.y*=e.y,this},_divByPoint:function(e){return this.x/=e.x,this.y/=e.y,this},_unit:function(){return this._div(this.mag()),this},_perp:function(){var e=this.y;return this.y=this.x,this.x=-e,this},_rotate:function(e){var r=Math.cos(e),c=Math.sin(e),h=c*this.x+r*this.y;return this.x=r*this.x-c*this.y,this.y=h,this},_rotateAround:function(e,r){var c=Math.cos(e),h=Math.sin(e),m=r.y+h*(this.x-r.x)+c*(this.y-r.y);return this.x=r.x+c*(this.x-r.x)-h*(this.y-r.y),this.y=m,this},_round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}},a.convert=function(e){return e instanceof a?e:Array.isArray(e)?new a(e[0],e[1]):e},qa}var kt=ga(Cu());function Za(a,e){if(Array.isArray(a)){if(!Array.isArray(e)||a.length!==e.length)return!1;for(let r=0;r<a.length;r++)if(!Za(a[r],e[r]))return!1;return!0}if(typeof a=="object"&&a!==null&&e!==null){if(typeof e!="object"||Object.keys(a).length!==Object.keys(e).length)return!1;for(const r in a)if(!Za(a[r],e[r]))return!1;return!0}return a===e}const Xa=Math.PI/180,Qe=180/Math.PI;function X(a){return a*Xa}function ie(a){return a*Qe}const ge=[[0,0],[1,0],[1,1],[0,1]];function Ie(a){if(a<=0)return 0;if(a>=1)return 1;const e=a*a,r=e*a;return 4*(a<.5?r:3*(a-e)+r-.75)}function Ce(a,e,r,c){const h=new zh(a,e,r,c);return function(m){return h.solve(m)}}const De=Ce(.25,.1,.25,1);function ke(a,e,r){return Math.min(r,Math.max(e,a))}function Le(a,e,r){return(r=ke((r-a)/(e-a),0,1))*r*(3-2*r)}function Ze(a,e,r){const c=r-e,h=((a-e)%c+c)%c+e;return h===e?r:h}function rt(a,e,r){if(!a.length)return r(null,[]);let c=a.length;const h=new Array(a.length);let m=null;a.forEach((g,b)=>{e(g,(T,E)=>{T&&(m=T),h[b]=E,--c==0&&r(m,h)})})}function He(a,...e){for(const r of e)for(const c in r)a[c]=r[c];return a}let Lt=1;function Ht(){return Lt++}function qt(a){return a<=1?1:Math.pow(2,Math.ceil(Math.log(a)/Math.LN2))}function xi(a,e){a.forEach(r=>{e[r]&&(e[r]=e[r].bind(e))})}function Pi(a,e,r){const c={};for(const h in a)c[h]=e.call(this,a[h],h,a);return c}function Ri(a,e,r){const c={};for(const h in a)e.call(this,a[h],h,a)&&(c[h]=a[h]);return c}function Qi(a){return Array.isArray(a)?a.map(Qi):typeof a=="object"&&a?Pi(a,Qi):a}const hs={};function Yi(a){hs[a]||(typeof console<"u"&&console.warn(a),hs[a]=!0)}function jn(a,e,r){return(r.y-a.y)*(e.x-a.x)>(e.y-a.y)*(r.x-a.x)}function Tn(a){let e=0;for(let r,c,h=0,m=a.length,g=m-1;h<m;g=h++)r=a[h],c=a[g],e+=(c.x-r.x)*(r.y+c.y);return e}function Jn([a,e,r]){const c=X(e+90),h=X(r);return{x:a*Math.cos(c)*Math.sin(h),y:a*Math.sin(c)*Math.sin(h),z:a*Math.cos(h),azimuthal:e,polar:r}}function Gn(a){return(typeof self<"u"||a!==void 0)&&typeof WorkerGlobalScope<"u"&&(a!==void 0?a:self)instanceof WorkerGlobalScope}function Hs(a){const e={};if(a.replace(/(?:^|(?:\s*\,\s*))([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)(?:\=(?:([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)|(?:\"((?:[^"\\]|\\.)*)\")))?/g,(r,c,h,m)=>{const g=h||m;return e[c]=!g||g.toLowerCase(),""}),e["max-age"]){const r=parseInt(e["max-age"],10);isNaN(r)?delete e["max-age"]:e["max-age"]=r}return e}let ir=null;function hr(a,e){return[a[4*e],a[4*e+1],a[4*e+2],a[4*e+3]]}function Dr(a,e,r,c){for(;e<r;){const h=e+r>>1;a[h]<c?e=h+1:r=h}return e}function Ia(a,e,r,c){for(;e<r;){const h=e+r>>1;a[h]<=c?e=h+1:r=h}return e}function Gr(a){return a>0?1/(1.001-a):1+a}function Wr(a){return a>0?1-1/(1.001-a):-a}function Tr(a,e,r){return(a-e.min)*(r.max-r.min)/(e.max-e.min)+r.min}const Fr={API_URL:"https://api.mapbox.com",get API_URL_REGEX(){return/^((https?:)?\/\/)?([^\/]+\.)?mapbox\.c(n|om)(\/|\?|$)/i},get API_TILEJSON_REGEX(){return/^((https?:)?\/\/)?([^\/]+\.)?mapbox\.c(n|om)(\/v[0-9]*\/.*\.json.*$)/i},get API_SPRITE_REGEX(){return/^((https?:)?\/\/)?([^\/]+\.)?mapbox\.c(n|om)(\/styles\/v[0-9]*\/)(.*\/sprite.*\..*$)/i},get API_FONTS_REGEX(){return/^((https?:)?\/\/)?([^\/]+\.)?mapbox\.c(n|om)(\/fonts\/v[0-9]*\/)(.*\.pbf.*$)/i},get API_STYLE_REGEX(){return/^((https?:)?\/\/)?([^\/]+\.)?mapbox\.c(n|om)(\/styles\/v[0-9]*\/)(.*$)/i},get API_CDN_URL_REGEX(){return/^((https?:)?\/\/)?api\.mapbox\.c(n|om)(\/mapbox-gl-js\/)(.*$)/i},get EVENTS_URL(){if(!Fr.API_URL)return null;try{const a=new URL(Fr.API_URL);return a.hostname==="api.mapbox.cn"?"https://events.mapbox.cn/events/v2":a.hostname==="api.mapbox.com"?"https://events.mapbox.com/events/v2":null}catch{return null}},SESSION_PATH:"/map-sessions/v1",FEEDBACK_URL:"https://apps.mapbox.com/feedback",TILE_URL_VERSION:"v4",RASTER_URL_PREFIX:"raster/v1",RASTERARRAYS_URL_PREFIX:"rasterarrays/v1",REQUIRE_ACCESS_TOKEN:!0,ACCESS_TOKEN:null,DEFAULT_STYLE:"mapbox://styles/mapbox/standard",MAX_PARALLEL_IMAGE_REQUESTS:16,DRACO_URL:"https://api.mapbox.com/mapbox-gl-js/draco_decoder_gltf_v1.5.6.wasm",MES
588HOPT_URL:"https://api.mapbox.com/mapbox-gl-js/meshopt_base_v0.20.wasm",MESHOPT_SIMD_URL:"https://api.mapbox.com/mapbox-gl-js/meshopt_simd_v0.20.wasm",GLYPHS_URL:"mapbox://fonts/mapbox/{fontstack}/{range}.pbf",TILES3D_URL_PREFIX:"3dtiles/v1"};function _a(a){return Fr.API_URL_REGEX.test(a)}function Al(a){return Fr.API_SPRITE_REGEX.test(a)}let $c,ac,Vo,Jr,$o,co;function Iu(){return $c==null&&($c=self.OffscreenCanvas&&new OffscreenCanvas(1,1).getContext("2d")&&typeof self.createImageBitmap=="function"),$c}const jo={now:()=>Jr!==void 0?Jr:performance.now(),setNow(a){Jr=a},restoreNow(){Jr=void 0},frame(a){const e=requestAnimationFrame(a);return{cancel:()=>cancelAnimationFrame(e)}},getImageData(a,e=0){const{width:r,height:c}=a;$o||($o=document.createElement("canvas"));const h=$o.getContext("2d",{willReadFrequently:!0});if(!h)throw new Error("failed to create canvas 2d context");return(r>$o.width||c>$o.height)&&($o.width=r,$o.height=c),h.clearRect(-e,-e,r+2*e,c+2*e),h.drawImage(a,0,0,r,c),h.getImageData(-e,-e,r+2*e,c+2*e)},resolveURL:a=>(ac||(ac=document.createElement("a")),ac.href=a,ac.href),get devicePixelRatio(){return window.devicePixelRatio},get prefersReducedMotion(){return!!window.matchMedia&&(Vo==null&&(Vo=window.matchMedia("(prefers-reduced-motion: reduce)")),Vo.matches)},hasCanvasFingerprintNoise(){if(co!==void 0)return co;if(!Iu())return co=!1,!1;const a=new OffscreenCanvas(85,1),e=a.getContext("2d",{willReadFrequently:!0});let r=0;for(let h=0;h<a.width;++h)e.fillStyle=`rgba(${r++},${r++},${r++}, 255)`,e.fillRect(h,0,1,1);const c=e.getImageData(0,0,a.width,a.height);r=0;for(let h=0;h<c.data.length;++h)if(h%4!=3&&r++!==c.data[h])return co=!0,!0;return co=!1,!1}};function Yo(a,e){const r=a.indexOf("?");if(r<0)return`${a}?${new URLSearchParams(e).toString()}`;const c=new URLSearchParams(a.slice(r));for(const h in e)c.set(h,e[h]);return`${a.slice(0,r)}?${c.toString()}`}
588function kr(a,e={persistentParams:[]}){const r=a.indexOf("?");if(r<0)return a;const c=new URLSearchParams,h=new URLSearchParams(a.slice(r));for(const g of e.persistentParams){const b=h.get(g);b&&c.set(g,b)}const m=c.toString();return`${a.slice(0,r)}${m.length>0?`?${m}`:""}`}const Po="mapbox-tiles";let Do=500,Uo=50;const Ma=["language","worldview","jobid"];let Qr,lc;function Fh(){try{return caches}catch{}}function eo(){const a=Fh();a&&Qr==null&&(Qr=a.open(Po))}let Mu=1/0;const Pa={supported:!1,testSupport:function(a){!Il&&to&&(jc?hf(a):Cl=a)}};let Cl,to,Il=!1,jc=!1;const Da=typeof self<"u"?self:{};function hf(a){const e=a.createTexture();a.bindTexture(a.TEXTURE_2D,e);try{if(a.texImage2D(a.TEXTURE_2D,0,a.RGBA,a.RGBA,a.UNSIGNED_BYTE,to),a.isContextLost())return;Pa.supported=!0}catch{}a.deleteTexture(e),Il=!0}Da.document&&(to=Da.document.createElement("img"),to.onload=function(){Cl&&hf(Cl),Cl=null,jc=!0},to.onerror=function(){Il=!0,Cl=null},to.src="data:image/webp;base64,UklGRh4AAABXRUJQVlA4TBEAAAAvAQAAAAfQ//73v/+BiOh/AAA=");const Pu={Unknown:"Unknown",Style:"Style",Source:"Source",Tile:"Tile",Glyphs:"Glyphs",SpriteImage:"SpriteImage",SpriteJSON:"SpriteJSON",Iconset:"Iconset",Image:"Image",Model:"Model"};typeof Object.freeze=="function"&&Object.freeze(Pu);class Du extends Error{constructor(e,r,c){r===401&&_a(c)&&(e+=": you may have provided an invalid Mapbox access token. See https://docs.mapbox.com/api/overview/#access-tokens-and-token-scopes"),super(e),this.status=r,this.url=c}toString(){return`${this.name}: ${this.message} (${this.status}): ${this.url}`}}const _n=Gn()?()=>self.worker.referrer:()=>(location.protocol==="blob:"?parent:self).location.href,Uc=function(a,e){if(!(/^file:/.test(r=a.url)||/^file:/.test(_n())&&!/^\w+:/.test(r))){if(self.fetch&&self.Request&&self.AbortController&&Request.prototype.hasOwnProperty("signal"))return function(c,h){const m=new AbortController,g=new Request(c.url,{method:c.method||"GET",body:c.body,credentials:c.credentials,headers:c.headers,referrer:_n(),referrerPolicy:c.referrerPolicy,signal:m.signal});let b=!1,T=!1;const E=(I=g.url).indexOf("sku=")>0&&_a(I);var I;c.type==="json"&&g.headers.set("Accept","application/json");const M=(B,N,U)=>{if(T)return;if(B&&B.message!=="SecurityError"&&Yi(B.toString()),N&&U)return k(N);const Y=Date.now();fetch(g).then(J=>{if(J.ok){const ae=E?J.clone():null;return k(J,ae,Y)}return h(new Du(J.statusText,J.status,c.url))}).catch(J=>{J.name!=="AbortError"&&h(new Error(`${J.message} ${c.url}`))})},k=(B,N,U)=>{(c.type==="arrayBuffer"?B.arrayBuffer():c.type==="json"?B.json():B.text()).then(Y=>{T||(N&&U&&function(J,ae,ne){if(eo(),Qr==null)return;const G=Hs(ae.headers.get("Cache-Control")||"");if(G["no-store"])return;const te={status:ae.status,statusText:ae.statusText,headers:new Headers};ae.headers.forEach((Te,Me)=>te.headers.set(Me,Te)),G["max-age"]&&te.headers.set("Expires",new Date(ne+1e3*G["max-age"]).toUTCString());const oe=te.headers.get("Expires");if(!oe||new Date(oe).getTime()-ne<42e4)return;
588let he=kr(J.url,{persistentParams:Ma});if(ae.status===206){const Te=J.headers.get("Range");if(!Te)return;te.status=200,he=Yo(he,{range:Te})}(function(Te,Me){if(lc===void 0)try{new Response(new ReadableStream),lc=!0}catch{lc=!1}lc?Me(Te.body):Te.blob().then(Me).catch(Pe=>Yi(Pe.message))})(ae,Te=>{const Me=new Response((Pe=ae.status)!==200&&Pe!==404&&[101,103,204,205,304].includes(Pe)?null:Te,te);var Pe;eo(),Qr!=null&&Qr.then(ze=>ze.put(he,Me)).catch(ze=>Yi(ze.message))})}(g,N,U),b=!0,h(null,Y,B.headers.get("Cache-Control"),B.headers.get("Expires")))}).catch(Y=>{T||h(new Error(Y.message))})};return E?function(B,N){if(eo(),Qr==null)return N(null);Qr.then(U=>{let Y=kr(B.url,{persistentParams:Ma});const J=B.headers.get("Range");J&&(Y=Yo(Y,{range:J})),U.match(Y).then(ae=>{const ne=function(G){if(!G)return!1;const te=new Date(G.headers.get("Expires")||0),oe=Hs(G.headers.get("Cache-Control")||"");return Number(te)>Date.now()&&!oe["no-cache"]}(ae);U.delete(Y).catch(N),ne&&U.put(Y,ae.clone()).catch(N),N(null,ae,ne)}).catch(N)}).catch(N)}(g,M):M(null,null),{cancel:()=>{T=!0,b||m.abort()}}}(a,e);if(Gn(self)&&self.worker.actor)return self.worker.actor.send("getResource",a,e,void 0,!0)}var r;return function(c,h){const m=new XMLHttpRequest;m.open(c.method||"GET",c.url,!0),c.type==="arrayBuffer"&&(m.responseType="arraybuffer");for(const g in c.headers)m.setRequestHeader(g,c.headers[g]);return c.type==="json"&&(m.responseType="text",m.setRequestHeader("Accept","application/json")),m.withCredentials=c.credentials==="include",m.onerror=()=>{h(new Error(m.statusText))},m.onload=()=>{if((m.status>=200&&m.status<300||m.status===0)&&m.response!==null){let g=m.response;if(c.type==="json")try{g=JSON.parse(m.response)}catch(b){return h(b)}h(null,g,m.getResponseHeader("Cache-Control"),m.getResponseHeader("Expires"))}else h(new Du(m.statusText,m.status,c.url))},m.send(c.body),{cancel:()=>m.abort()}}(a,e)},cc=function(a,e){return Uc(He(a,{type:"arrayBuffer"}),e)};function df(a){const e=document.createElement("a");return e.href=a,e.protocol===location.protocol&&e.host===location.host}const ku="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAC0lEQVQYV2NgAAIAAAUAAarVyFEAAAAASUVORK5CYII=";let Ya,Ml;Ya=[],Ml=0;const Ka=function(a,e){if(Pa.supported&&(a.headers||(a.headers={}),a.headers.accept="image/webp,*/*"),Ml>=Fr.MAX_PARALLEL_IMAGE_REQUESTS){const m={requestParameters:a,callback:e,cancelled:!1,cancel(){this.cancelled=!0}};return Ya.push(m),m}Ml++;let r=!1;const c=()=>{if(!r)for(r=!0,Ml--;Ya.length&&Ml<Fr.MAX_PARALLEL_IMAGE_REQUESTS;){const m=Ya.shift(),{requestParameters:g,callback:b,cancelled:T}=m;T||(m.cancel=Ka(g,b).cancel)}},h=cc(a,(m,g,b,T)=>{c(),m?e(m):g&&(self.createImageBitmap?function(E,I){const M=new Blob([new Uint8Array(E)],{type:"image/png"});createImageBitmap(M).then(k=>{I(null,k)}).catch(k=>{I(new Error(`Could not load image because of ${k.message}. Please make sure to use a supported image type such as PNG or JPEG. Note that SVGs are not supported.`))})}(g,(E,I)=>e(E,I,b,T)):function(E,I){const M=new Image;M.onload=()=>{I(null,M),URL.revokeObjectURL(M.src),M.onload=null,requestAnimationFrame(()=>{M.src=ku})},M.onerror=()=>I(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."));const k=new Blob([new Uint8Array(E)],{type:"image/png"});M.src=E.byteLength?URL.createObjectURL(k):ku}(g,(E,I)=>e(E,I,b,T)))});return{cancel:()=>{h.cancel(),c()}}};var Bp,Bh,Ja,uc={exports:{}},Pl={exports:{}},Lu={exports:{}},hc=function(){if(Ja)return uc.exports;Ja=1;var a=(Bp||(Bp=1,Pl.exports=function(r,c){var h,m,g,b,T,E,I,M;for(m=r.length-(h=3&r.length),g=c,T=3432918353,E=461845907,M=0;M<m;)I=255&r.charCodeAt(M)|(255&r.charCodeAt(++M))<<8|(255&r.charCodeAt(++M))<<16|(255&r.charCodeAt(++M))<<24,++M,g=27492+(65535&(b=5*(65535&(g=(g^=I=(65535&(I=(I=(65535&I)*T+(((I>>>16)*T&65535)<<16)&4294967295)<<15|I>>>17))*E+(((I>>>16)*E&65535)<<16)&4294967295)<<13|g>>>19))+((5*(g>>>16)&65535)<<16)&4294967295))+((58964+(b>>>16)&65535)<<16);switch(I=0,h){case 3:I^=(255&r.charCodeAt(M+2))<<16;case 2:I^=(255&r.charCodeAt(M+1))<<8;case 1:g^=I=(65535&(I=(I=(65535&(I^=255&r.charCodeAt(M)))*T+(((I>>>16)*T&65535)<<16)&4294967295)<<15|I>>>17))*E+(((I>>>16)*E&65535)<<16)&4294967295}
588return g^=r.length,g=2246822507*(65535&(g^=g>>>16))+((2246822507*(g>>>16)&65535)<<16)&4294967295,g=3266489909*(65535&(g^=g>>>13))+((3266489909*(g>>>16)&65535)<<16)&4294967295,(g^=g>>>16)>>>0}),Pl.exports),e=(Bh||(Bh=1,Lu.exports=function(r,c){for(var h,m=r.length,g=c^m,b=0;m>=4;)h=1540483477*(65535&(h=255&r.charCodeAt(b)|(255&r.charCodeAt(++b))<<8|(255&r.charCodeAt(++b))<<16|(255&r.charCodeAt(++b))<<24))+((1540483477*(h>>>16)&65535)<<16),g=1540483477*(65535&g)+((1540483477*(g>>>16)&65535)<<16)^(h=1540483477*(65535&(h^=h>>>24))+((1540483477*(h>>>16)&65535)<<16)),m-=4,++b;switch(m){case 3:g^=(255&r.charCodeAt(b+2))<<16;case 2:g^=(255&r.charCodeAt(b+1))<<8;case 1:g=1540483477*(65535&(g^=255&r.charCodeAt(b)))+((1540483477*(g>>>16)&65535)<<16)}return g=1540483477*(65535&(g^=g>>>13))+((1540483477*(g>>>16)&65535)<<16),(g^=g>>>15)>>>0}),Lu.exports);return uc.exports=a,uc.exports.murmur3=a,uc.exports.murmur2=e,uc.exports}(),uo=ga(hc);class Qa{constructor(e,...r){He(this,r[0]||{}),this.type=e}}class Nh extends Qa{constructor(e,r={}){super("error",He({error:e},r))}}function Dl(a,e,r){r[a]&&r[a].indexOf(e)!==-1||(r[a]=r[a]||[],r[a].push(e))}function Vh(a,e,r){if(r&&r[a]){const c=r[a].indexOf(e);c!==-1&&r[a].splice(c,1)}}class kl{on(e,r){return this._listeners=this._listeners||{},Dl(e,r,this._listeners),this}off(e,r){return Vh(e,r,this._listeners),Vh(e,r,this._oneTimeListeners),this}once(e,r){return r?(this._oneTimeListeners=this._oneTimeListeners||{},Dl(e,r,this._oneTimeListeners),this):new Promise(c=>{this.once(e,c)})}fire(e,r){const c=typeof e=="string"?new Qa(e,r):e,h=c.type;if(this.listens(h)){c.target=this;const m=this._listeners&&this._listeners[h]?this._listeners[h].slice():[];for(const T of m)T.call(this,c);const g=this._oneTimeListeners&&this._oneTimeListeners[h]?this._oneTimeListeners[h].slice():[];for(const T of g)Vh(h,T,this._oneTimeListeners),T.call(this,c);const b=this._eventedParent;b&&(He(c,typeof this._eventedParentData=="function"?this._eventedParentData():this._eventedParentData),b.fire(c))}else c instanceof Nh&&console.error(c.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,r){return this._eventedParent=e,this._eventedParentData=r,this}}class To{constructor(e){typeof e=="string"?this.name=e:(this.name=e.name,this.iconsetId=e.iconsetId)}static from(e){return new To(e)}static toString(e){return e.iconsetId?`${e.name}�${e.iconsetId}`:e.name}static parse(e){const[r,c]=e.split("�");return new To({name:r,iconsetId:c})}static isEqual(e,r){return e.name===r.name&&e.iconsetId===r.iconsetId}toString(){return To.toString(this)}serialize(){return{name:this.name,iconsetId:this.iconsetId}}}var $h,Ru={},Hc=function(){if($h)return Ru;$h=1;var a={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 e(m){return(m=Math.round(m))<0?0:m>255?255:m}function r(m){return e(m[m.length-1]==="%"?parseFloat(m)/100*255:parseInt(m))}function c(m){return(g=m[m.length-1]==="%"?parseFloat(m)/100:parseFloat(m))<0?0:g>1?1:g;var g}function h(m,g,b){return b<0?b+=1:b>1&&(b-=1),6*b<1?m+(g-m)*b*6:2*b<1?g:3*b<2?m+(g-m)*(2/3-b)*6:m}try{Ru.parseCSSColor=function(m){var g,b=m.replace(/ /g,"").toLowerCase();if(b in a)return a[b].slice();if(b[0]==="#")return b.length===4?(g=parseInt(b.substr(1),16))>=0&&g<=4095?[(3840&g)>>4|(3840&g)>>8,240&g|(240&g)>>4,15&g|(15&g)<<4,1]:null:b.length===7&&(g=parseInt(b.substr(1),16))>=0&&g<=16777215?[(16711680&g)>>16,(65280&g)>>8,255&g,1]:null;var T=b.indexOf("("),E=b.indexOf(")");if(T!==-1&&E+1===b.length){var I=b.substr(0,T),M=b.substr(T+1,E-(T+1)).split(","),k=1;switch(I){case"rgba":if(M.length!==4)return null;
588k=c(M.pop());case"rgb":return M.length!==3?null:[r(M[0]),r(M[1]),r(M[2]),k];case"hsla":if(M.length!==4)return null;k=c(M.pop());case"hsl":if(M.length!==3)return null;var B=(parseFloat(M[0])%360+360)%360/360,N=c(M[1]),U=c(M[2]),Y=U<=.5?U*(N+1):U+N-U*N,J=2*U-Y;return[e(255*h(J,Y,B+1/3)),e(255*h(J,Y,B)),e(255*h(J,Y,B-1/3)),k];default:return null}}return null}}catch{}return Ru}();class Cn{constructor(e,r,c,h=1){this.r=e,this.g=r,this.b=c,this.a=h}static parse(e){if(!e)return;if(e instanceof Cn)return e;if(typeof e!="string")return;const r=Hc.parseCSSColor(e);return r?new Cn(r[0]/255*r[3],r[1]/255*r[3],r[2]/255*r[3],r[3]):void 0}toStringPremultipliedAlpha(){const[e,r,c,h]=this.a===0?[0,0,0,0]:[255*this.r/this.a,255*this.g/this.a,255*this.b/this.a,this.a];return`rgba(${Math.round(e)},${Math.round(r)},${Math.round(c)},${h})`}toString(){const[e,r,c,h]=[this.r,this.g,this.b,this.a];return`rgba(${Math.round(255*e)},${Math.round(255*r)},${Math.round(255*c)},${h})`}toRenderColor(e){const{r,g:c,b:h,a:m}=this;return new ff(e,r,c,h,m)}clone(){return new Cn(this.r,this.g,this.b,this.a)}}class ff{constructor(e,r,c,h,m){if(e){const g=e.image.height,b=g*g;r=m===0?0:r/m*(g-1),c=m===0?0:c/m*(g-1),h=m===0?0:h/m*(g-1);const T=Math.floor(r),E=Math.floor(c),I=Math.floor(h),M=Math.ceil(r),k=Math.ceil(c),B=Math.ceil(h),N=r-T,U=c-E,Y=h-I,J=e.image.data,ae=4*(T+E*b+I*g),ne=4*(T+E*b+B*g),G=4*(T+k*b+I*g),te=4*(T+k*b+B*g),oe=4*(M+E*b+I*g),he=4*(M+E*b+B*g),Te=4*(M+k*b+I*g),Me=4*(M+k*b+B*g);if(ae<0||Me>=J.length)throw new Error("out of range");this.r=gi(gi(gi(J[ae],J[ne],Y),gi(J[G],J[te],Y),U),gi(gi(J[oe],J[he],Y),gi(J[Te],J[Me],Y),U),N)/255*m,this.g=gi(gi(gi(J[ae+1],J[ne+1],Y),gi(J[G+1],J[te+1],Y),U),gi(gi(J[oe+1],J[he+1],Y),gi(J[Te+1],J[Me+1],Y),U),N)/255*m,this.b=gi(gi(gi(J[ae+2],J[ne+2],Y),gi(J[G+2],J[te+2],Y),U),gi(gi(J[oe+2],J[he+2],Y),gi(J[Te+2],J[Me+2],Y),U),N)/255*m,this.a=m}else this.r=r,this.g=c,this.b=h,this.a=m}toArray(){const{r:e,g:r,b:c,a:h}=this;return h===0?[0,0,0,0]:[255*e/h,255*r/h,255*c/h,h]}toHslaArray(){if(this.a===0)return[0,0,0,0];const{r:e,g:r,b:c,a:h}=this,m=Math.min(Math.max(e/h,0),1),g=Math.min(Math.max(r/h,0),1),b=Math.min(Math.max(c/h,0),1),T=Math.min(m,g,b),E=Math.max(m,g,b),I=(T+E)/2;if(T===E)return[0,0,100*I,h];const M=E-T,k=I>.5?M/(2-E-T):M/(E+T);let B=0;return E===m?B=(g-b)/M+(g<b?6:0):E===g?B=(b-m)/M+2:E===b&&(B=(m-g)/M+4),B*=60,[Math.min(Math.max(B,0),360),Math.min(Math.max(100*k,0),100),Math.min(Math.max(100*I,0),100),h]}toArray01(){const{r:e,g:r,b:c,a:h}=this;return h===0?[0,0,0,0]:[e/h,r/h,c/h,h]}toArray01Scaled(e){const{r,g:c,b:h,a:m}=this;return m===0?[0,0,0]:[r/m*e,c/m*e,h/m*e]}toArray01PremultipliedAlpha(){const{r:e,g:r,b:c,a:h}=this;return[e,r,c,h]}toArray01Linear(){const{r:e,g:r,b:c,a:h}=this;return h===0?[0,0,0,0]:[Math.pow(e/h,2.2),Math.pow(r/h,2.2),Math.pow(c/h,2.2),h]}}function gi(a,e,r){return a*(1-r)+e*r}function Np(a,e,r){return a.map((c,h)=>gi(c,e[h],r))}function Ou(a){return a*a*a*a*a}Cn.black=new Cn(0,0,0,1),Cn.white=new Cn(1,1,1,1),Cn.transparent=new Cn(0,0,0,0),Cn.red=new Cn(1,0,0,1),Cn.blue=new Cn(0,0,1,1);var zu=Object.freeze({__proto__:null,array:Np,color:function(a,e,r){return new Cn(gi(a.r,e.r,r),gi(a.g,e.g,r),gi(a.b,e.b,r),gi(a.a,e.a,r))},easeIn:Ou,number:gi});function Ll(a,...e){for(const r of e)for(const c in r)a[c]=r[c];return a}class Ko extends Error{constructor(e,r){super(r),this.message=r,this.key=e}}class dc{constructor(e,r=[]){this.parent=e,this.bindings={};for(const[c,h]of r)this.bindings[c]=h}concat(e){return new dc(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)}}const ka={kind:"null"},ui={kind:"number"},qn={kind:"string"},Sn={kind:"boolean"},io={kind:"color"},Rl={kind:"object"},zn={kind:"value"},fc={kind:"collator"},Fu={kind:"formatted"},Bu={kind:"resolvedImage"};function ho(a,e){return{kind:"array",itemType:a,N:e}}function or(a){if(a.kind==="array"){const e=or(a.itemType);return typeof a.N=="number"?`array<${e}, ${a.N}>`:a.itemType.kind==="value"?"array":`array<${e}>`}return a.kind}const Vp=[ka,ui,qn,Sn,io,Fu,Rl,ho(zn),Bu];function Nu(a,e){if(e.kind==="error")return null;if(a.kind==="array"){if(e.kind==="array"&&(e.N===0&&e.itemType.kind==="value"||!Nu(a.itemType,e.itemType))&&(typeof a.N!="number"||a.N===e.N))return null}else{if(a.kind===e.kind)return null;if(a.kind==="value"){for(const r of Vp)if(!Nu(r,e))return null}}return`Expected ${or(a)} but found ${or(e)} instead.`}function Ol(a,e){return e.some(r=>r.kind===a.kind)}function Jo(a,e){return e.some(r=>r==="null"?a===null:r==="array"?Array.isArray(a):r==="object"?a&&!Array.isArray(a)&&typeof a=="object":r===typeof a)}class zl{constructor(e,r,c){this.sensitivity=e?r?"variant":"case":r?"accent":"base",this.locale=c,this.collator=new Intl.Collator(this.locale?this.locale:[],{sensitivity:this.sensitivity,usage:"search"})}compare(e,r){return this.collator.compare(e,r)}resolvedLocale(){return new Intl.Collator(this.locale?this.locale:[]).resolvedOptions().locale}}class pc{constructor(e,r,c,h,m){this.text=e.normalize?e.normalize():e,this.image=r,this.scale=c,this.fontStack=h,this.textColor=m}}class fo{constructor(e){this.sections=e}static fromString(e){return new fo([new pc(e,null,null,null,null)])}isEmpty(){return this.sections.length===0||!this.sections.some(e=>e.text.length!==0||!!e.image&&e.image.hasPrimary())}static factory(e){return e instanceof fo?e:fo.fromString(e)}toString(){return this.sections.length===0?"":this.sections.map(e=>e.text).join("")}serialize(){const e=["format"];for(const r of this.sections){if(r.image){const h=r.image.getPrimary().id.toString();e.push(["image",h]);continue}e.push(r.text);const c={};r.fontStack&&(c["text-font"]=["literal",r.fontStack.split(",")]),r.scale&&(c["font-scale"]=r.scale),r.textColor&&(c["text-color"]=["rgba"].concat(r.textColor.toRenderColor(null).toArray())),e.push(c)}return e}}class ya{constructor(e,r={}){if(this.id=To.from(e),this.options=Object.assign({},r),r.transform){const{a:c,b:h,c:m,d:g,e:b,f:T}=r.transform;this.options.transform=new DOMMatrix([c,h,m,g,b,T])}else this.options.transform=new DOMMatrix([1,0,0,1,0,0])}toString(){const{a:e,b:r,c,d:h,e:m,f:g}=this.options.transform;return JSON.stringify({name:this.id.name,iconsetId:this.id.iconsetId,params:this.options.params,transform:{a:e,b:r,c,d:h,e:m,f:g}})}static parse(e){let r,c,h,m;
588try{({name:r,iconsetId:c,params:h,transform:m}=JSON.parse(e)||{})}catch{return null}if(!r)return null;const{a:g,b,c:T,d:E,e:I,f:M}=m||{};return new ya({name:r,iconsetId:c},{params:h,transform:new DOMMatrix([g,b,T,E,I,M])})}scaleSelf(e,r){return this.options.transform.scaleSelf(e,r),this}}class So{constructor(e,r,c,h,m=!1){this.primaryId=To.from(e),this.primaryOptions=r,c&&(this.secondaryId=To.from(c)),this.secondaryOptions=h,this.available=m}toString(){return this.primaryId&&this.secondaryId?`[${this.primaryId.name},${this.secondaryId.name}]`:this.primaryId.name}hasPrimary(){return!!this.primaryId}getPrimary(){return new ya(this.primaryId,this.primaryOptions)}hasSecondary(){return!!this.secondaryId}getSecondary(){return this.secondaryId?new ya(this.secondaryId,this.secondaryOptions):null}static from(e){return typeof e=="string"?So.build({name:e}):e}static build(e,r,c,h){return!e||typeof e=="object"&&!("name"in e)?null:new So(e,c,r,h)}}function $p(a,e,r,c){return typeof a=="number"&&a>=0&&a<=255&&typeof e=="number"&&e>=0&&e<=255&&typeof r=="number"&&r>=0&&r<=255?c===void 0||typeof c=="number"&&c>=0&&c<=1?null:`Invalid rgba value [${[a,e,r,c].join(", ")}]: 'a' must be between 0 and 1.`:`Invalid rgba value [${(typeof c=="number"?[a,e,r,c]:[a,e,r]).join(", ")}]: 'r', 'g', and 'b' must be between 0 and 255.`}function Gc(a){if(a===null||typeof a=="string"||typeof a=="boolean"||typeof a=="number"||a instanceof Cn||a instanceof zl||a instanceof fo||a instanceof So)return!0;if(Array.isArray(a)){for(const e of a)if(!Gc(e))return!1;return!0}if(typeof a=="object"){for(const e in a)if(!Gc(a[e]))return!1;return!0}return!1}function _r(a){if(a===null)return ka;if(typeof a=="string")return qn;if(typeof a=="boolean")return Sn;if(typeof a=="number")return ui;if(a instanceof Cn)return io;if(a instanceof zl)return fc;if(a instanceof fo)return Fu;if(a instanceof So)return Bu;if(Array.isArray(a)){const e=a.length;let r;for(const c of a){const h=_r(c);if(r){if(r===h)continue;r=zn;break}r=h}return ho(r||zn,e)}return Rl}function po(a){const e=typeof a;return a===null?"":e==="string"||e==="number"||e==="boolean"?String(a):a instanceof Cn?a.toStringPremultipliedAlpha():a instanceof fo||a instanceof So?a.toString():JSON.stringify(a)}class en{constructor(e,r){this.type=e,this.value=r}static parse(e,r){if(e.length!==2)return r.error(`'literal' expression requires exactly one argument, but found ${e.length-1} instead.`);if(!Gc(e[1]))return r.error("invalid value");const c=e[1];let h=_r(c);const m=r.expectedType;return h.kind!=="array"||h.N!==0||!m||m.kind!=="array"||typeof m.N=="number"&&m.N!==0||(h=m),new en(h,c)}evaluate(){return this.value}eachChild(){}outputDefined(){return!0}serialize(){return this.type.kind==="array"||this.type.kind==="object"?["literal",this.value]:this.value instanceof Cn?["rgba"].concat(this.value.toRenderColor(null).toArray()):this.value instanceof fo?this.value.serialize():this.value}}class Gt{constructor(e){this.name="ExpressionEvaluationError",this.message=e}toJSON(){return this.message}}const Wc={string:qn,number:ui,boolean:Sn,object:Rl};class Ii{constructor(e,r){this.type=e,this.args=r}static parse(e,r){if(e.length<2)return r.error("Expected at least one argument.");let c,h=1;const m=e[0];if(m==="array"){let b,T;if(e.length>2){const E=e[1];if(typeof E!="string"||!(E in Wc)||E==="object")return r.error('The item type argument of "array" must be one of string, number, boolean',1);b=Wc[E],h++}else b=zn;if(e.length>3){if(e[2]!==null&&(typeof e[2]!="number"||e[2]<0||e[2]!==Math.floor(e[2])))return r.error('The length argument to "array" must be a positive integer literal',2);T=e[2],h++}c=ho(b,T)}else c=Wc[m];const g=[];for(;h<e.length;h++){const b=r.parse(e[h],h,zn);if(!b)return null;g.push(b)}return new Ii(c,g)}evaluate(e){for(let r=0;r<this.args.length;r++){const c=this.args[r].evaluate(e);if(!Nu(this.type,_r(c)))return c;if(r===this.args.length-1)throw new Gt(`The expression ${JSON.stringify(this.args[r].serialize())} evaluated to ${or(_r(c))} but was expected to be of type ${or(this.type)}.`)}return null}
vendor: 13,211 bytes, line 588
588eachChild(e){this.args.forEach(e)}outputDefined(){return this.args.every(e=>e.outputDefined())}serialize(){const e=this.type,r=[e.kind];if(e.kind==="array"){const c=e.itemType;if(c.kind==="string"||c.kind==="number"||c.kind==="boolean"){r.push(c.kind);const h=e.N;(typeof h=="number"||this.args.length>1)&&r.push(h)}}return r.concat(this.args.map(c=>c.serialize()))}}class Fl{constructor(e){this.type=Fu,this.sections=e}static parse(e,r){if(e.length<2)return r.error("Expected at least one argument.");const c=e[1];if(!Array.isArray(c)&&typeof c=="object")return r.error("First argument must be an image or text section.");const h=[];let m=!1;for(let g=1;g<=e.length-1;++g){const b=e[g];if(m&&typeof b=="object"&&!Array.isArray(b)){m=!1;let T=null;if(b["font-scale"]&&(T=r.parseObjectValue(b["font-scale"],g,"font-scale",ui),!T))return null;let E=null;if(b["text-font"]&&(E=r.parseObjectValue(b["text-font"],g,"text-font",ho(qn)),!E))return null;let I=null;if(b["text-color"]&&(I=r.parseObjectValue(b["text-color"],g,"text-color",io),!I))return null;const M=h[h.length-1];M.scale=T,M.font=E,M.textColor=I}else{const T=r.parse(e[g],g,zn);if(!T)return null;const E=T.type.kind;if(E!=="string"&&E!=="value"&&E!=="null"&&E!=="resolvedImage")return r.error("Formatted text type must be 'string', 'value', 'image' or 'null'.");m=!0,h.push({content:T,scale:null,font:null,textColor:null})}}return new Fl(h)}evaluate(e){return new fo(this.sections.map(r=>{const c=r.content.evaluate(e);return _r(c)===Bu?new pc("",c,null,null,null):new pc(po(c),null,r.scale?r.scale.evaluate(e):null,r.font?r.font.evaluate(e).join(","):null,r.textColor?r.textColor.evaluate(e):null)}))}eachChild(e){for(const r of this.sections)e(r.content),r.scale&&e(r.scale),r.font&&e(r.font),r.textColor&&e(r.textColor)}outputDefined(){return!1}serialize(){const e=["format"];for(const r of this.sections){e.push(r.content.serialize());const c={};r.scale&&(c["font-scale"]=r.scale.serialize()),r.font&&(c["text-font"]=r.font.serialize()),r.textColor&&(c["text-color"]=r.textColor.serialize()),e.push(c)}return e}}class qc{constructor(e,r,c,h){this._imageWarnHistory={},this.type=Bu,this.namePrimary=e,this.nameSecondary=r,c&&(this.paramsPrimary=c.params,this.iconsetIdPrimary=c.iconset?c.iconset.id:void 0),h&&(this.paramsSecondary=h.params,this.iconsetIdSecondary=h.iconset?h.iconset.id:void 0)}static parse(e,r){if(e.length<2)return r.error("Expected two or more arguments.");let c=1;const h=[];function m(){if(c<e.length){const b=r.parse(e[c],c++,qn);return b?(h.push({image:b,options:{}}),!0):(r.error(h.length?"Secondary image variant is not a string.":"No image name provided."),!1)}return!0}function g(){if(c<e.length){const T=e[c];if((b=T)===null||typeof b!="object"||Array.isArray(b))return!0;const E=T.params,I=T.iconset,M=r.concat(c);if(!E&&!I)return c++,!0;if(E){if(typeof E!="object"||E.constructor!==Object)return M.error('Image options "params" should be an object'),!1;const k={},B=M.concat(void 0,"params");for(const N in E){if(!N)return B.error("Image parameter name should be non-empty"),!1;const U=B.concat(void 0,N).parse(E[N],void 0,io,void 0,{typeAnnotation:"coerce"});if(!U)return!1;k[N]=U}h[h.length-1].options.params=k}if(I){if(typeof I!="object"||I.constructor!==Object)return M.error('Image options "iconset" should be an object'),!1;if(!I.id)return M.error('Image options "iconset" should have an "id" property'),!1;h[h.length-1].options.iconset=I}return c++,!0}var b;return!0}for(let b=0;b<2;b++)if(!m()||!g())return;return new qc(h[0].image,h[1]?h[1].image:void 0,h[0].options,h[1]?h[1].options:void 0)}evaluateParams(e,r){const c={};if(r){for(const h in r)if(r[h])try{c[h]=r[h].evaluate(e)}catch{continue}if(Object.keys(c).length!==0)return{params:c}}}evaluate(e){const r={name:this.namePrimary.evaluate(e),iconsetId:this.iconsetIdPrimary},c=this.nameSecondary?{name:this.nameSecondary.evaluate(e),iconsetId:this.iconsetIdSecondary}:void 0,h=So.build(r,c,this.paramsPrimary?this.evaluateParams(e,this.paramsPrimary):void 0,this.paramsSecondary?this.evaluateParams(e,this.paramsSecondary):void 0);if(h&&e.availableImages){const m=h.getPrimary().id;if(h.available=e.availableImages.some(g=>To.isEqual(g,m)),h.available){const g=h.getSecondary()?h.getSecondary().id:null;g&&(h.available=e.availableImages.some(b=>To.isEqual(b,g)))}}return h}eachChild(e){if(e(this.namePrimary),this.paramsPrimary)for(const r in this.paramsPrimary)this.paramsPrimary[r]&&e(this.paramsPrimary[r]);if(this.nameSecondary&&(e(this.nameSecondary),this.paramsSecondary))for(const r in this.paramsSecondary)this.paramsSecondary[r]&&e(this.paramsSecondary[r])}outputDefined(){return!1}serializeOptions(e,r){const c={};if(r&&(c.iconset={id:r}),e){c.params={};for(const h in e)e[h]&&(c.params[h]=e[h].serialize())}return Object.keys(c).length>0?c:void 0}serialize(){const e=["image",this.namePrimary.serialize()];if(this.paramsPrimary||this.iconsetIdPrimary){const r=this.serializeOptions(this.paramsPrimary,this.iconsetIdPrimary);r&&e.push(r)}if(this.nameSecondary&&(e.push(this.nameSecondary.serialize()),this.paramsSecondary||this.iconsetIdSecondary)){const r=this.serializeOptions(this.paramsSecondary,this.iconsetIdSecondary);r&&e.push(r)}return e}}function Di(a){return a instanceof Number?"number":a instanceof String?"string":a instanceof Boolean?"boolean":Array.isArray(a)?"array":a===null?"null":typeof a}const pf={"to-boolean":Sn,"to-color":io,"to-number":ui,"to-string":qn};class ko{constructor(e,r){this.type=e,this.args=r}static parse(e,r){if(e.length<2)return r.error("Expected at least one argument.");const c=e[0],h=[];let m=ka;if(c==="to-array"){if(!Array.isArray(e[1]))return null;const g=e[1].length;if(r.expectedType){if(r.expectedType.kind!=="array")return r.error(`Expected ${r.expectedType.kind} but found array.`);m=ho(r.expectedType.itemType,g)}else{if(!(g>0&&Gc(e[1][0])))return null;m=ho(_r(e[1][0]),g)}for(let b=0;b<g;b++){const T=e[1][b];let E;if(Di(T)==="array")E=r.parse(T,void 0,m.itemType);else{const I=Di(T);if(I!==m.itemType.kind)return r.error(`Expected ${m.itemType.kind} but found ${I}.`);E=r.registry.literal.parse(["literal",T===void 0?null:T],r)}if(!E)return null;h.push(E)}}else{if((c==="to-boolean"||c==="to-string")&&e.length!==2)return r.error("Expected one argument.");m=pf[c];for(let g=1;g<e.length;g++){const b=r.parse(e[g],g,zn);if(!b)return null;h.push(b)}}return new ko(m,h)}evaluate(e){if(this.type.kind==="boolean")return!!this.args[0].evaluate(e);if(this.type.kind==="color"){let r,c;for(const h of this.args){if(r=h.evaluate(e),c=null,r instanceof Cn)return r;if(typeof r=="string"){const m=e.parseColor(r);if(m)return m}else if(Array.isArray(r)&&(c=r.length<3||r.length>4?`Invalid rbga value ${JSON.stringify(r)}: expected an array containing either three or four numeric values.`:$p(r[0],r[1],r[2],r[3]),!c))return new Cn(r[0]/255,r[1]/255,r[2]/255,r[3])}throw new Gt(c||`Could not parse color from value '${typeof r=="string"?r:String(JSON.stringify(r))}'`)}if(this.type.kind==="number"){let r=null;for(const c of this.args){if(r=c.evaluate(e),r===null)return 0;const h=Number(r);if(!isNaN(h))return h}throw new Gt(`Could not convert ${JSON.stringify(r)} to number.`)}return this.type.kind==="formatted"?fo.fromString(po(this.args[0].evaluate(e))):this.type.kind==="resolvedImage"?So.build(po(this.args[0].evaluate(e))):this.type.kind==="array"?this.args.map(r=>r.evaluate(e)):po(this.args[0].evaluate(e))}eachChild(e){this.args.forEach(e)}outputDefined(){return this.args.every(e=>e.outputDefined())}serialize(){if(this.type.kind==="formatted")return new Fl([{content:this.args[0],scale:null,font:null,textColor:null}]).serialize();if(this.type.kind==="resolvedImage")return new qc(this.args[0]).serialize();const e=this.type.kind==="array"?[]:[`to-${this.type.kind}`];return this.eachChild(r=>{e.push(r.serialize())}),e}}const jp=["Unknown","Point","LineString","Polygon"];class jh{constructor(e,r){this.globals=null,this.feature=null,this.featureState=null,this.formattedSection=null,this._parseColorCache={},this.availableImages=null,this.canonical=null,this.featureTileCoord=null,this.featureDistanceData=null,this.scope=e,this.options=r}id(){return this.feature&&this.feature.id!==void 0?this.feature.id:null}geometryType(){return this.feature?typeof this.feature.type=="number"?jp[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||{}}measureLight(e){return this.globals.brightness||0}distanceFromCenter(){if(this.featureTileCoord&&this.featureDistanceData){const e=this.featureDistanceData.center,r=this.featureDistanceData.scale,{x:c,y:h}=this.featureTileCoord;return this.featureDistanceData.bearing[0]*(c*r-e[0])+this.featureDistanceData.bearing[1]*(h*r-e[1])}return 0}parseColor(e){let r=this._parseColorCache[e];return r||(r=this._parseColorCache[e]=Cn.parse(e)),r}getConfig(e){return this.options?this.options.get(e):null}}class qr{constructor(e,r,c,h,m){this.name=e,this.type=r,this._evaluate=c,this.args=h,this._overloadIndex=m}evaluate(e){if(!this._evaluate){const r=qr.definitions[this.name];this._evaluate=Array.isArray(r)?r[2]:r.overloads[this._overloadIndex][1]}return this._evaluate(e,this.args)}eachChild(e){this.args.forEach(e)}outputDefined(){return!1}serialize(){return[this.name].concat(this.args.map(e=>e.serialize()))}static parse(e,r){const c=e[0],h=qr.definitions[c];if(!h)return r.error(`Unknown expression "${c}". If you wanted a literal array, use ["literal", [...]].`,0);const m=Array.isArray(h)?h[0]:h.type,g=Array.isArray(h)?[[h[1],h[2]]]:h.overloads,b=[];let T=null,E=-1;for(const[I,M]of g){if(Array.isArray(I)&&I.length!==e.length-1)continue;b.push(I),E++,T=new Jp(r.registry,r.path,null,r.scope,void 0,r._scope,r.options);const k=[];let B=!1;for(let N=1;N<e.length;N++){const U=e[N],Y=Array.isArray(I)?I[N-1]:I.type,J=T.parse(U,1+k.length,Y);if(!J){B=!0;break}k.push(J)}if(!B)if(Array.isArray(I)&&I.length!==k.length)T.error(`Expected ${I.length} arguments, but found ${k.length} instead.`);else{for(let N=0;N<k.length;N++){const U=Array.isArray(I)?I[N]:I.type,Y=k[N];T.concat(N+1).checkSubtype(U,Y.type)}if(T.errors.length===0)return new qr(c,m,M,k,E)}}if(b.length===1)r.errors.push(...T.errors);else{const I=(b.length?b:g.map(([k])=>k)).map(mo).join(" | "),M=[];for(let k=1;k<e.length;k++){const B=r.parse(e[k],1+M.length);if(!B)return null;M.push(or(B.type))}r.error(`Expected arguments of type ${I}, but found (${M.join(", ")}) instead.`)}return null}static register(e,r){qr.definitions=r;for(const c in r)e[c]=qr}}function mo(a){return Array.isArray(a)?`(${a.map(or).join(", ")})`:`(${or(a.type)}...)`}class Zc{constructor(e,r,c){this.type=fc,this.locale=c,this.caseSensitive=e,this.diacriticSensitive=r}static parse(e,r){if(e.length!==2)return r.error("Expected one argument.");const c=e[1];if(typeof c!="object"||Array.isArray(c))return r.error("Collator options argument must be an object.");const h=c["case-sensitive"]===void 0?r.parse(!1,1,Sn):r.parseObjectValue(c["case-sensitive"],1,"case-sensitive",Sn);if(!h)return null;const m=c["diacritic-sensitive"]===void 0?r.parse(!1,1,Sn):r.parseObjectValue(c["diacritic-sensitive"],1,"diacritic-sensitive",Sn);if(!m)return null;let g=null;return c.locale&&(g=r.parseObjectValue(c.locale,1,"locale",qn),!g)?null:new Zc(h,m,g)}evaluate(e){return new zl(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}serialize(){const e={};return e["case-sensitive"]=this.caseSensitive.serialize(),e["diacritic-sensitive"]=this.diacriticSensitive.serialize(),this.locale&&(e.locale=this.locale.serialize()),["collator",e]}}function el(a,e,r=0,c=a.length-1,h=Nl){for(;c>r;){if(c-r>600){const T=c-r+1,E=e-r+1,I=Math.log(T),M=.5*Math.exp(2*I/3),k=.5*Math.sqrt(I*M*(T-M)/T)*(E-T/2<0?-1:1);el(a,e,Math.max(r,Math.floor(e-E*M/T+k)),Math.min(c,Math.floor(e+(T-E)*M/T+k)),h)}const m=a[e];let g=r,b=c;for(Bl(a,r,e),h(a[c],m)>0&&Bl(a,r,c);g<b;){for(Bl(a,g,b),g++,b--;h(a[g],m)<0;)g++;for(;h(a[b],m)>0;)b--}h(a[r],m)===0?Bl(a,r,b):(b++,Bl(a,b,c)),b<=e&&(r=b+1),e<=b&&(c=b-1)}}function Bl(a,e,r){const c=a[e];a[e]=a[r],a[r]=c}function Nl(a,e){return a<e?-1:a>e?1:0}function Br(a){let e=0;for(let r,c,h=0,m=a.length,g=m-1;h<m;g=h++)r=a[h],c=a[g],e+=(c.x-r.x)*(r.y+c.y);return e}function Xc(a,e){a[0]=Math.min(a[0],e[0]),a[1]=Math.min(a[1],e[1]),a[2]=Math.max(a[2],e[0]),a[3]=Math.max(a[3],e[1])}function mc(a,e){return!(a[0]<=e[0]||a[2]>=e[2]||a[1]<=e[1]||a[3]>=e[3])}function Qo(a,e,r){const c=a[0]-e[0],h=a[1]-e[1],m=a[0]-r[0],g=a[1]-r[1];return c*g-m*h==0&&c*m<=0&&h*g<=0}function tl(a,e,r=!1){let c=!1;for(let b=0,T=e.length;b<T;b++){const E=e[b];for(let I=0,M=E.length,k=M-1;I<M;k=I++){const B=E[k],N=E[I];if(Qo(a,B,N))return r;(m=B)[1]>(h=a)[1]!=(g=N)[1]>h[1]&&h[0]<(g[0]-m[0])*(h[1]-m[1])/(g[1]-m[1])+m[0]&&(c=!c)}}var h,m,g;return c}function mf(a,e,r,c){const h=c[0]-r[0],m=c[1]-r[1],g=(a[0]-r[0])*m-h*(a[1]-r[1]),b=(e[0]-r[0])*m-h*(e[1]-r[1]);return g>0&&b<0||g<0&&b>0}
588function va(a,e,r,c){return(h=[c[0]-r[0],c[1]-r[1]])[0]*(m=[e[0]-a[0],e[1]-a[1]])[1]-h[1]*m[0]!=0&&!(!mf(a,e,r,c)||!mf(r,c,a,e));var h,m}function Uh(a){const e=new kt(Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY),r=new kt(Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY);for(const c of a[0])e.x>c.x&&(e.x=c.x),e.y>c.y&&(e.y=c.y),r.x<c.x&&(r.x=c.x),r.y<c.y&&(r.y=c.y);return{min:e,max:r}}const Vl=8192;function Eg(a,e){const r=(180+a[0])/360,c=(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+a[1]*Math.PI/360)))/360,h=Math.pow(2,e.z);return[Math.round(r*h*Vl),Math.round(c*h*Vl)]}function Ag(a,e){for(let r=0;r<e.length;r++)if(tl(a,e[r]))return!0;return!1}function Up(a,e,r){for(const c of r)for(let h=0,m=c.length,g=m-1;h<m;g=h++)if(va(a,e,c[g],c[h]))return!0;return!1}function Hp(a,e){for(let r=0;r<a.length;++r)if(!tl(a[r],e))return!1;for(let r=0;r<a.length-1;++r)if(Up(a[r],a[r+1],e))return!1;return!0}function Cg(a,e){for(let r=0;r<e.length;r++)if(Hp(a,e[r]))return!0;return!1}function Vu(a,e,r){const c=[];for(let h=0;h<a.length;h++){const m=[];for(let g=0;g<a[h].length;g++){const b=Eg(a[h][g],r);Xc(e,b),m.push(b)}c.push(m)}return c}function gf(a,e,r){const c=[];for(let h=0;h<a.length;h++){const m=Vu(a[h],e,r);c.push(m)}return c}function La(a,e,r,c){if(a[0]<r[0]||a[0]>r[2]){const h=.5*c;let m=a[0]-r[0]>h?-c:r[0]-a[0]>h?c:0;m===0&&(m=a[0]-r[2]>h?-c:r[2]-a[0]>h?c:0),a[0]+=m}Xc(e,a)}function Gp(a,e,r,c){const h=Math.pow(2,c.z)*Vl,m=[c.x*Vl,c.y*Vl],g=[];if(!a)return g;for(const b of a)for(const T of b){const E=[T.x+m[0],T.y+m[1]];La(E,e,r,h),g.push(E)}return g}function Wp(a,e,r,c){const h=Math.pow(2,c.z)*Vl,m=[c.x*Vl,c.y*Vl],g=[];if(!a)return g;for(const T of a){const E=[];for(const I of T){const M=[I.x+m[0],I.y+m[1]];Xc(e,M),E.push(M)}g.push(E)}if(e[2]-e[0]<=h/2){(b=e)[0]=b[1]=1/0,b[2]=b[3]=-1/0;for(const T of g)for(const E of T)La(E,e,r,h)}var b;return g}class Eo{constructor(e,r){this.type=Sn,this.geojson=e,this.geometries=r}static parse(e,r){if(e.length!==2)return r.error(`'within' expression requires exactly one argument, but found ${e.length-1} instead.`);if(Gc(e[1])){const c=e[1];if(c.type==="FeatureCollection")for(let h=0;h<c.features.length;++h){const m=c.features[h].geometry.type;if(m==="Polygon"||m==="MultiPolygon")return new Eo(c,c.features[h].geometry)}else if(c.type==="Feature"){const h=c.geometry.type;if(h==="Polygon"||h==="MultiPolygon")return new Eo(c,c.geometry)}else if(c.type==="Polygon"||c.type==="MultiPolygon")return new Eo(c,c)}return r.error("'within' expression requires valid geojson object that contains polygon geometry type.")}evaluate(e){if(e.geometry()!=null&&e.canonicalID()!=null){if(e.geometryType()==="Point")return function(r,c){const h=[1/0,1/0,-1/0,-1/0],m=[1/0,1/0,-1/0,-1/0],g=r.canonicalID();if(!g)return!1;if(c.type==="Polygon"){const b=Vu(c.coordinates,m,g),T=Gp(r.geometry(),h,m,g);if(!mc(h,m))return!1;for(const E of T)if(!tl(E,b))return!1}if(c.type==="MultiPolygon"){const b=gf(c.coordinates,m,g),T=Gp(r.geometry(),h,m,g);if(!mc(h,m))return!1;for(const E of T)if(!Ag(E,b))return!1}return!0}(e,this.geometries);if(e.geometryType()==="LineString")return function(r,c){const h=[1/0,1/0,-1/0,-1/0],m=[1/0,1/0,-1/0,-1/0],g=r.canonicalID();if(!g)return!1;if(c.type==="Polygon"){const b=Vu(c.coordinates,m,g),T=Wp(r.geometry(),h,m,g);if(!mc(h,m))return!1;for(const E of T)if(!Hp(E,b))return!1}if(c.type==="MultiPolygon"){const b=gf(c.coordinates,m,g),T=Wp(r.geometry(),h,m,g);if(!mc(h,m))return!1;for(const E of T)if(!Cg(E,b))return!1}return!0}(e,this.geometries)}return!1}eachChild(){}outputDefined(){return!0}serialize(){return["within",this.geojson]}}const Ho={kilometers:1,miles:1e3/1609.344,nauticalmiles:1e3/1852,meters:1e3,metres:1e3,yards:1e3/.9144,feet:1e3/.3048,inches:1e3/.0254},Hh=1/298.257223563,ea=Hh*(2-Hh),gc=Math.PI/180;class _c{static fromTile(e,r,c){const h=Math.PI*(1-2*(e+.5)/Math.pow(2,r)),m=Math.atan(.5*(Math.exp(h)-Math.exp(-h)))/gc;return new _c(m,c)}static get units(){return Ho}constructor(e,r){if(e===void 0)throw new Error("No latitude given.");if(r&&!Ho[r])throw new Error(`Unknown unit ${r}
588. Use one of: ${Object.keys(Ho).join(", ")}`);const c=6378.137*gc*(r?Ho[r]:1),h=Math.cos(e*gc),m=1/(1-ea*(1-h*h)),g=Math.sqrt(m);this.kx=c*g*h,this.ky=c*g*m*(1-ea)}distance(e,r){const c=Go(e[0]-r[0])*this.kx,h=(e[1]-r[1])*this.ky;return Math.sqrt(c*c+h*h)}bearing(e,r){const c=Go(r[0]-e[0])*this.kx;return Math.atan2(c,(r[1]-e[1])*this.ky)/gc}destination(e,r,c){const h=c*gc;return this.offset(e,Math.sin(h)*r,Math.cos(h)*r)}offset(e,r,c){return[e[0]+r/this.kx,e[1]+c/this.ky]}lineDistance(e){let r=0;for(let c=0;c<e.length-1;c++)r+=this.distance(e[c],e[c+1]);return r}area(e){let r=0;for(let c=0;c<e.length;c++){const h=e[c];for(let m=0,g=h.length,b=g-1;m<g;b=m++)r+=Go(h[m][0]-h[b][0])*(h[m][1]+h[b][1])*(c?-1:1)}return Math.abs(r)/2*this.kx*this.ky}along(e,r){let c=0;if(r<=0)return e[0];for(let h=0;h<e.length-1;h++){const m=e[h],g=e[h+1],b=this.distance(m,g);if(c+=b,c>r)return $u(m,g,(r-(c-b))/b)}return e[e.length-1]}pointToSegmentDistance(e,r,c){let[h,m]=r,g=Go(c[0]-h)*this.kx,b=(c[1]-m)*this.ky;if(g!==0||b!==0){const T=(Go(e[0]-h)*this.kx*g+(e[1]-m)*this.ky*b)/(g*g+b*b);T>1?(h=c[0],m=c[1]):T>0&&(h+=g/this.kx*T,m+=b/this.ky*T)}return g=Go(e[0]-h)*this.kx,b=(e[1]-m)*this.ky,Math.sqrt(g*g+b*b)}pointOnLine(e,r){let c=1/0,h=e[0][0],m=e[0][1],g=0,b=0;for(let T=0;T<e.length-1;T++){let E=e[T][0],I=e[T][1],M=Go(e[T+1][0]-E)*this.kx,k=(e[T+1][1]-I)*this.ky,B=0;M===0&&k===0||(B=(Go(r[0]-E)*this.kx*M+(r[1]-I)*this.ky*k)/(M*M+k*k),B>1?(E=e[T+1][0],I=e[T+1][1]):B>0&&(E+=M/this.kx*B,I+=k/this.ky*B)),M=Go(r[0]-E)*this.kx,k=(r[1]-I)*this.ky;const N=M*M+k*k;N<c&&(c=N,h=E,m=I,g=T,b=B)}return{point:[h,m],index:g,t:Math.max(0,Math.min(1,b))}}lineSlice(e,r,c){let h=this.pointOnLine(c,e),m=this.pointOnLine(c,r);if(h.index>m.index||h.index===m.index&&h.t>m.t){const E=h;h=m,m=E}const g=[h.point],b=h.index+1,T=m.index;!Gh(c[b],g[0])&&b<=T&&g.push(c[b]);for(let E=b+1;E<=T;E++)g.push(c[E]);return Gh(c[T],m.point)||g.push(m.point),g}lineSliceAlong(e,r,c){let h=0;const m=[];for(let g=0;g<c.length-1;g++){const b=c[g],T=c[g+1],E=this.distance(b,T);if(h+=E,h>e&&m.length===0&&m.push($u(b,T,(e-(h-E))/E)),h>=r)return m.push($u(b,T,(r-(h-E))/E)),m;h>e&&m.push(T)}return m}bufferPoint(e,r){const c=r/this.ky,h=r/this.kx;return[e[0]-h,e[1]-c,e[0]+h,e[1]+c]}bufferBBox(e,r){const c=r/this.ky,h=r/this.kx;return[e[0]-h,e[1]-c,e[2]+h,e[3]+c]}insideBBox(e,r){return Go(e[0]-r[0])>=0&&Go(e[0]-r[2])<=0&&e[1]>=r[1]&&e[1]<=r[3]}}function Gh(a,e){return a[0]===e[0]&&a[1]===e[1]}function $u(a,e,r){const c=Go(e[0]-a[0]);return[a[0]+c*r,a[1]+(e[1]-a[1])*r]}function Go(a){for(;a<-180;)a+=360;for(;a>180;)a-=360;return a}class Wh{constructor(e=[],r=(c,h)=>c<h?-1:c>h?1:0){if(this.data=e,this.length=this.data.length,this.compare=r,this.length>0)for(let c=(this.length>>1)-1;c>=0;c--)this._down(c)}push(e){this.data.push(e),this._up(this.length++)}pop(){if(this.length===0)return;const e=this.data[0],r=this.data.pop();return--this.length>0&&(this.data[0]=r,this._down(0)),e}peek(){return this.data[0]}_up(e){const{data:r,compare:c}=this,h=r[e];for(;e>0;){const m=e-1>>1,g=r[m];if(c(h,g)>=0)break;r[e]=g,e=m}r[e]=h}_down(e){const{data:r,compare:c}=this,h=this.length>>1,m=r[e];for(;e<h;){let g=1+(e<<1);const b=g+1;if(b<this.length&&c(r[b],r[g])<0&&(g=b),c(r[g],m)>=0)break;r[e]=r[g],e=g}r[e]=m}}var Rt=8192;function qh(a,e){return e.dist-a.dist}const ju=100,Zh=50;function _f(a){const e=[1/0,1/0,-1/0,-1/0];if(e.length!==a.length)return!1;for(let r=0;r<e.length;r++)if(e[r]!==a[r])return!1;return!0}function yc(a){return a[1]-a[0]+1}function ta(a,e){const r=a[1]>=a[0]&&a[1]<e;return r||console.warn("Distance Expression: Index is out of range"),r}function Yc(a,e){if(a[0]>a[1])return[null,null];const r=yc(a);if(e){if(r===2)return[a,null];const c=Math.floor(r/2);return[[a[0],a[0]+c],[a[0]+c,a[1]]]}{if(r===1)return[a,null];const c=Math.floor(r/2)-1;return[[a[0],a[0]+c],[a[0]+c+1,a[1]]]}}function go(a,e){const r=[1/0,1/0,-1/0,-1/0];if(!ta(e,a.length))return r;for(let c=e[0];c<=e[1];++c)Xc(r,a[c]);return r}function Kc(a){const e=[1/0,1/0,-1/0,-1/0];for(let r=0;r<a.length;++r)for(let c=0;c<a[r].length;++c)Xc(e,a[r][c]);return e}function vc(a,e,r){if(_f(a)||_f(e))return NaN;let c=0,h=0;return a[2]<e[0]&&(c=e[0]-a[2]),a[0]>e[2]&&(c=a[0]-e[2]),a[1]>e[3]&&(h=a[1]-e[3]),a[3]<e[1]&&(h=e[1]-a[3]),r.distance([0,0],[c,h])}
588function Jc(a){return 360*a-180}function vn(a){return 360/Math.PI*Math.atan(Math.exp((180-360*a)*Math.PI/180))-90}function yf(a,e){const r=Math.pow(2,e.z),c=(a.y/Rt+e.y)/r;return[Jc((a.x/Rt+e.x)/r),vn(c)]}function Ig(a,e){const r=[];for(let c=0;c<a.length;++c)r.push(yf(a[c],e));return r}function qp(a,e,r){const c=r.pointOnLine(e,a).point;return r.distance(a,c)}function vf(a,e,r,c,h){const m=r.slice(c[0],c[1]+1);let g=1/0;for(let b=e[0];b<=e[1];++b)if((g=Math.min(g,qp(a[b],m,h)))===0)return 0;return g}function xf(a,e,r,c,h){const m=Math.min(h.pointToSegmentDistance(a,r,c),h.pointToSegmentDistance(e,r,c)),g=Math.min(h.pointToSegmentDistance(r,a,e),h.pointToSegmentDistance(c,a,e));return Math.min(m,g)}function Es(a,e,r,c,h){if(!ta(e,a.length)||!ta(c,r.length))return NaN;let m=1/0;for(let g=e[0];g<e[1];++g)for(let b=c[0];b<c[1];++b){if(va(a[g],a[g+1],r[b],r[b+1]))return 0;m=Math.min(m,xf(a[g],a[g+1],r[b],r[b+1],h))}return m}function Xh(a,e,r,c,h){if(!ta(e,a.length)||!ta(c,r.length))return NaN;let m=1/0;for(let g=e[0];g<=e[1];++g)for(let b=c[0];b<=c[1];++b)if((m=Math.min(m,h.distance(a[g],r[b])))===0)return m;return m}function Zp(a,e,r){if(tl(a,e,!0))return 0;let c=1/0;for(const h of e){const m=h.length;if(m<2)return console.warn("Distance Expression: Invalid polygon!"),NaN;if(h[0]!==h[m-1]&&(c=Math.min(c,r.pointToSegmentDistance(a,h[m-1],h[0])))===0||(c=Math.min(c,qp(a,h,r)))===0)return c}return c}function Xp(a,e,r,c){if(!ta(e,a.length))return NaN;for(let m=e[0];m<=e[1];++m)if(tl(a[m],r,!0))return 0;let h=1/0;for(let m=e[0];m<e[1];++m)for(const g of r)for(let b=0,T=g.length,E=T-1;b<T;E=b++){if(va(a[m],a[m+1],g[E],g[b]))return 0;h=Math.min(h,xf(a[m],a[m+1],g[E],g[b],c))}return h}function Qc(a,e){for(const r of a)for(let c=0;c<=r.length-1;++c)if(tl(r[c],e,!0))return!0;return!1}function bf(a,e,r,c=1/0){const h=Kc(a),m=Kc(e);if(c!==1/0&&vc(h,m,r)>=c)return c;if(mc(h,m)){if(Qc(a,e))return 0}else if(Qc(e,a))return 0;let g=c;for(const b of a)for(let T=0,E=b.length,I=E-1;T<E;I=T++)for(const M of e)for(let k=0,B=M.length,N=B-1;k<B;N=k++){if(va(b[I],b[T],M[N],M[k]))return 0;g=Math.min(g,xf(b[I],b[T],M[N],M[k],r))}return g}function Yh(a,e,r,c,h,m,g){if(m===null||g===null)return;const b=vc(go(c,m),go(h,g),r);b<e&&a.push({dist:b,range1:m,range2:g})}function Mg(a,e,r,c,h=1/0){let m=Math.min(c.distance(a[0],r[0][0]),h);if(m===0)return m;const g=new Wh([{dist:0,range1:[0,a.length-1],range2:[0,0]}],qh),b=e?Zh:ju,T=Kc(r);for(;g.length;){const E=g.pop();if(E.dist>=m)continue;const I=E.range1;if(yc(I)<=b){if(!ta(I,a.length))return NaN;if(e){const M=Xp(a,I,r,c);if((m=Math.min(m,M))===0)return m}else for(let M=I[0];M<=I[1];++M){const k=Zp(a[M],r,c);if((m=Math.min(m,k))===0)return m}}else{const M=Yc(I,e);if(M[0]!==null){const k=vc(go(a,M[0]),T,c);k<m&&g.push({dist:k,range1:M[0],range2:[0,0]})}if(M[1]!==null){const k=vc(go(a,M[1]),T,c);k<m&&g.push({dist:k,range1:M[1],range2:[0,0]})}}}return m}function Yp(a,e,r,c,h,m=1/0){let g=Math.min(m,h.distance(a[0],r[0]));if(g===0)return g;const b=new Wh([{dist:0,range1:[0,a.length-1],range2:[0,r.length-1]}],qh),T=e?Zh:ju,E=c?Zh:ju;for(;b.length;){const I=b.pop();if(I.dist>=g)continue;const M=I.range1,k=I.range2;if(yc(M)<=T&&yc(k)<=E){if(!ta(M,a.length)||!ta(k,r.length))return NaN;if(e&&c?g=Math.min(g,Es(a,M,r,k,h)):e||c?e&&!c?g=Math.min(g,vf(r,k,a,M,h)):!e&&c&&(g=Math.min(g,vf(a,M,r,k,h))):g=Math.min(g,Xh(a,M,r,k,h)),g===0)return g}else{const B=Yc(M,e),N=Yc(k,c);Yh(b,g,h,a,r,B[0],N[0]),Yh(b,g,h,a,r,B[0],N[1]),Yh(b,g,h,a,r,B[1],N[0]),Yh(b,g,h,a,r,B[1],N[1])}}return g}function il(a,e,r,c,h=1/0){let m=h;const g=go(a,[0,a.length-1]);for(const b of r)if(!(m!==1/0&&vc(g,go(b,[0,b.length-1]),c)>=m)&&(m=Math.min(m,Yp(a,e,b,!0,c,m)),m===0))return m;return m}function Kh(a,e,r,c,h=1/0){let m=h;const g=go(a,[0,a.length-1]);for(const b of r){if(m!==1/0&&vc(g,Kc(b),c)>=m)continue;const T=Mg(a,e,b,c,m);if(isNaN(T))return T;if((m=Math.min(m,T))===0)return m}return m}function wf(a){return a==="Point"||a==="MultiPoint"||a==="LineString"||a==="MultiLineString"||a==="Polygon"||a==="MultiPolygon"}class Ra{constructor(e,r){this.type=ui,this.geojson=e,this.geometries=r}static parse(e,r){if(e.length!==2)return r.error(`'distance' expression requires either one argument, but found ' ${e.length-1} instead.`);if(Gc(e[1])){const c=e[1];if(c.type==="FeatureCollection"){for(let h=0;h<c.features.length;
588++h)if(wf(c.features[h].geometry.type))return new Ra(c,c.features[h].geometry)}else if(c.type==="Feature"){if(wf(c.geometry.type))return new Ra(c,c.geometry)}else if(wf(c.type))return new Ra(c,c)}return r.error("'distance' expression needs to be an array with format ['Distance', GeoJSONObj].")}evaluate(e){const r=e.geometry(),c=e.canonicalID();if(r!=null&&c!=null){if(e.geometryType()==="Point")return function(h,m,g){const b=[];for(const E of h)for(const I of E)b.push(yf(I,m));const T=new _c(b[0][1],"meters");return g.type==="Point"||g.type==="MultiPoint"||g.type==="LineString"?Yp(b,!1,g.type==="Point"?[g.coordinates]:g.coordinates,g.type==="LineString",T):g.type==="MultiLineString"?il(b,!1,g.coordinates,T):g.type==="Polygon"||g.type==="MultiPolygon"?Kh(b,!1,g.type==="Polygon"?[g.coordinates]:g.coordinates,T):null}(r,c,this.geometries);if(e.geometryType()==="LineString")return function(h,m,g){const b=[];for(const E of h){const I=[];for(const M of E)I.push(yf(M,m));b.push(I)}const T=new _c(b[0][0][1],"meters");if(g.type==="Point"||g.type==="MultiPoint"||g.type==="LineString")return il(g.type==="Point"?[g.coordinates]:g.coordinates,g.type==="LineString",b,T);if(g.type==="MultiLineString"){let E=1/0;for(let I=0;I<g.coordinates.length;I++){const M=il(g.coordinates[I],!0,b,T,E);if(isNaN(M))return M;if((E=Math.min(E,M))===0)return E}return E}if(g.type==="Polygon"||g.type==="MultiPolygon"){let E=1/0;for(let I=0;I<b.length;I++){const M=Kh(b[I],!0,g.type==="Polygon"?[g.coordinates]:g.coordinates,T,E);if(isNaN(M))return M;if((E=Math.min(E,M))===0)return E}return E}return null}(r,c,this.geometries);if(e.geometryType()==="Polygon")return function(h,m,g){const b=[];for(const E of function(I,M){const k=I.length;if(k<=1)return[I];const B=[];let N,U;for(let Y=0;Y<k;Y++){const J=Br(I[Y]);J!==0&&(I[Y].area=Math.abs(J),U===void 0&&(U=J<0),U===J<0?(N&&B.push(N),N=[I[Y]]):N.push(I[Y]))}return N&&B.push(N),B}(h)){const I=[];for(let M=0;M<E.length;++M)I.push(Ig(E[M],m));b.push(I)}const T=new _c(b[0][0][0][1],"meters");if(g.type==="Point"||g.type==="MultiPoint"||g.type==="LineString")return Kh(g.type==="Point"?[g.coordinates]:g.coordinates,g.type==="LineString",b,T);if(g.type==="MultiLineString"){let E=1/0;for(let I=0;I<g.coordinates.length;I++){const M=Kh(g.coordinates[I],!0,b,T,E);if(isNaN(M))return M;if((E=Math.min(E,M))===0)return E}return E}return g.type==="Polygon"||g.type==="MultiPolygon"?function(E,I,M){let k=1/0;for(const B of E)for(const N of I){const U=bf(B,N,M,k);if(isNaN(U))return U;if((k=Math.min(k,U))===0)return k}return k}(g.type==="Polygon"?[g.coordinates]:g.coordinates,b,T):null}(r,c,this.geometries);console.warn("Distance Expression: currently only evaluates valid Point/LineString/Polygon geometries.")}else console.warn("Distance Expression: requirs valid feature and canonical information.");return null}eachChild(){}outputDefined(){return!0}serialize(){return["distance",this.geojson]}}function Uu(a,e){switch(a){case"string":return po(e);case"number":return+e;case"boolean":return!!e;case"color":return Cn.parse(e);case"formatted":return fo.fromString(po(e));case"resolvedImage":return So.build(po(e))}return e}function Kp(a,e,r,c){return c!==void 0&&(a=c*Math.round(a/c)),e!==void 0&&a<e&&(a=e),r!==void 0&&a>r&&(a=r),a}class xc{constructor(e,r,c){this.type=e,this.key=r,this.scope=c}static parse(e,r){let c=r.expectedType;if(c==null&&(c=zn),e.length<2||e.length>3)return r.error("Invalid number of arguments for 'config' expression.");const h=r.parse(e[1],1);if(!(h instanceof en))return r.error("Key name of 'config' expression must be a string literal.");if(e.length>=3){const m=r.parse(e[2],2);return m instanceof en?new xc(c,po(h.value),po(m.value)):r.error("Scope of 'config' expression must be a string literal.")}return new xc(c,po(h.value))}evaluate(e){const r=[this.key,this.scope,e.scope].filter(Boolean).join("�"),c=e.getConfig(r);if(!c)return null;const{type:h,value:m,values:g,minValue:b,maxValue:T,stepValue:E}=c,I=c.default.evaluate(e);let M=I;if(m){const k=e.scope;e.scope=(k||"").split("�").slice(1).join("�"),M=m.evaluate(e),e.scope=k}return h&&(M=Uu(h,M)),M===void 0||b===void 0&&T===void 0&&E===void 0||(typeof M=="number"?M=Kp(M,b,T,E):Array.isArray(M)&&(M=M.map(k=>typeof k=="number"?Kp(k,b,T,E):k))),m!==void 0&&M!==void 0&&g&&!g.includes(M)&&(M=I,h&&(M=Uu(h,M))),(h&&h!==this.type||M!==void 0&&_r(M)!==this.type)&&(M=Uu(this.type.kind,M)),M}eachChild(){}outputDefined(){return!1}serialize(){const e=["config",this.key];return this.scope&&e.concat(this.key),e}}function Hu(a){if(a instanceof qr&&(a.name==="get"&&a.args.length===1||a.name==="feature-state"||a.name==="has"&&a.args.length===1||a.name==="properties"||a.name==="geometry-type"||a.name==="id"||/^filter-/.test(a.name))||a instanceof Eo||a instanceof Ra)return!1;let e=!0;return a.eachChild(r=>{e&&!Hu(r)&&(e=!1)}),e}function nl(a){if(a instanceof qr&&a.name==="feature-state")return!1;let e=!0;return a.eachChild(r=>{e&&!nl(r)&&(e=!1)}),e}function eu(a){if(a instanceof xc)return new Set([a.key]);let e=new Set;return a.eachChild(r=>
588{e=new Set([...e,...eu(r)])}),e}function bc(a,e){if(a instanceof qr&&e.indexOf(a.name)>=0)return!1;let r=!0;return a.eachChild(c=>{r&&!bc(c,e)&&(r=!1)}),r}class Jh{constructor(e,r){this.type=r.type,this.name=e,this.boundExpression=r}static parse(e,r){if(e.length!==2||typeof e[1]!="string")return r.error("'var' expression requires exactly one string literal argument.");const c=e[1];return r.scope.has(c)?new Jh(c,r.scope.get(c)):r.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}serialize(){return["var",this.name]}}class Tf{constructor(e,r=[],c,h=new dc,m=[],g,b){this.registry=e,this.path=r,this.key=r.map(T=>typeof T=="string"?`['${T}']`:`[${T}]`).join(""),this.scope=h,this.errors=m,this.expectedType=c,this._scope=g,this.options=b}parse(e,r,c,h,m={}){return r||c?this.concat(r,null,c,h)._parse(e,m):this._parse(e,m)}parseObjectValue(e,r,c,h,m,g={}){return this.concat(r,c,h,m)._parse(e,g)}_parse(e,r){function c(h,m,g){return g==="assert"?new Ii(m,[h]):g==="coerce"?new ko(m,[h]):h}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", []].');const h=typeof e[0]=="string"?this.registry[e[0]]:void 0;if(h){let m=h.parse(e,this);if(!m)return null;if(this.expectedType){const g=this.expectedType,b=m.type;if(g.kind!=="string"&&g.kind!=="number"&&g.kind!=="boolean"&&g.kind!=="object"&&g.kind!=="array"||b.kind!=="value")if(g.kind!=="color"&&g.kind!=="formatted"&&g.kind!=="resolvedImage"||b.kind!=="value"&&b.kind!=="string"){if(this.checkSubtype(g,b))return null}else m=c(m,g,r.typeAnnotation||"coerce");else m=c(m,g,r.typeAnnotation||"assert")}if(!(m instanceof en)&&m.type.kind!=="resolvedImage"&&wc(m)){const g=new jh(this._scope,this.options);try{m=new en(m.type,m.evaluate(g))}catch(b){return this.error(b.message),null}}return m}return ko.parse(["to-array",e],this)}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,r,c,h){let m=typeof e=="number"?this.path.concat(e):this.path;m=typeof r=="string"?m.concat(r):m;const g=h?this.scope.concat(h):this.scope;return new Tf(this.registry,m,c||null,g,this.errors,this._scope,this.options)}error(e,...r){const c=`${this.key}${r.map(h=>`[${h}]`).join("")}`;this.errors.push(new Ko(c,e))}checkSubtype(e,r){const c=Nu(e,r);return c&&this.error(c),c}}var Jp=Tf;function wc(a){if(a instanceof Jh)return wc(a.boundExpression);if(a instanceof qr&&a.name==="error"||a instanceof Zc||a instanceof Eo||a instanceof Ra||a instanceof xc)return!1;const e=a instanceof ko||a instanceof Ii;let r=!0;return a.eachChild(c=>{r=e?r&&wc(c):r&&c instanceof en}),!!r&&Hu(a)&&bc(a,["zoom","heatmap-density","line-progress","raster-value","sky-radial-progress","accumulated","is-supported-script","pitch","distance-from-center","measure-light","raster-particle-speed"])}function Oa(a,e){const r=a.length-1;let c,h,m=0,g=r,b=0;for(;m<=g;)if(b=Math.floor((m+g)/2),c=a[b],h=a[b+1],c<=e){if(b===r||e<h)return b;m=b+1}else{if(!(c>e))throw new Gt("Input is not a number.");g=b-1}return 0}class Gu{constructor(e,r,c){this.type=e,this.input=r,this.labels=[],this.outputs=[];for(const[h,m]of c)this.labels.push(h),this.outputs.push(m)}static parse(e,r){if(e.length-1<4)return r.error(`Expected at least 4 arguments, but found only ${e.length-1}.`);if((e.length-1)%2!=0)return r.error("Expected an even number of arguments.");const c=r.parse(e[1],1,ui);if(!c)return null;const h=[];let m=null;r.expectedType&&r.expectedType.kind!=="value"&&(m=r.expectedType);for(let g=1;g<e.length;g+=2){const b=g===1?-1/0:e[g],T=e[g+1],E=g,I=g+1;if(typeof b!="number")return r.error('Input/output pairs for "step" expressions must be defined using literal numeric values (not computed expressions) for the input values.',E
vendor: 6,071 bytes, line 588
588);if(h.length&&h[h.length-1][0]>=b)return r.error('Input/output pairs for "step" expressions must be arranged with input values in strictly ascending order.',E);const M=r.parse(T,I,m);if(!M)return null;m=m||M.type,h.push([b,M])}return new Gu(m,c,h)}evaluate(e){const r=this.labels,c=this.outputs;if(r.length===1)return c[0].evaluate(e);const h=this.input.evaluate(e);if(h<=r[0])return c[0].evaluate(e);const m=r.length;return h>=r[m-1]?c[m-1].evaluate(e):c[Oa(r,h)].evaluate(e)}eachChild(e){e(this.input);for(const r of this.outputs)e(r)}outputDefined(){return this.outputs.every(e=>e.outputDefined())}serialize(){const e=["step",this.input.serialize()];for(let r=0;r<this.labels.length;r++)r>0&&e.push(this.labels[r]),e.push(this.outputs[r].serialize());return e}}const Qp=.95047,em=1.08883,tm=4/29,tu=6/29,im=3*tu*tu,Pg=tu*tu*tu,Sf=Math.PI/180,nm=180/Math.PI;function Qh(a){return a>Pg?Math.pow(a,1/3):a/im+tm}function ed(a){return a>tu?a*a*a:im*(a-tm)}function Wu(a){return 255*(a<=.0031308?12.92*a:1.055*Math.pow(a,1/2.4)-.055)}function td(a){return(a/=255)<=.04045?a/12.92:Math.pow((a+.055)/1.055,2.4)}function sl(a){const e=td(a.r),r=td(a.g),c=td(a.b),h=Qh((.4124564*e+.3575761*r+.1804375*c)/Qp),m=Qh((.2126729*e+.7151522*r+.072175*c)/1);return{l:116*m-16,a:500*(h-m),b:200*(m-Qh((.0193339*e+.119192*r+.9503041*c)/em)),alpha:a.a}}function id(a){let e=(a.l+16)/116,r=isNaN(a.a)?e:e+a.a/500,c=isNaN(a.b)?e:e-a.b/200;return e=1*ed(e),r=Qp*ed(r),c=em*ed(c),new Cn(Wu(3.2404542*r-1.5371385*e-.4985314*c),Wu(-.969266*r+1.8760108*e+.041556*c),Wu(.0556434*r-.2040259*e+1.0572252*c),a.alpha)}function $l(a,e,r){const c=e-a;return a+r*(c>180||c<-180?c-360*Math.round(c/360):c)}const Tc={forward:sl,reverse:id,interpolate:function(a,e,r){return{l:gi(a.l,e.l,r),a:gi(a.a,e.a,r),b:gi(a.b,e.b,r),alpha:gi(a.alpha,e.alpha,r)}}},jl={forward:function(a){const{l:e,a:r,b:c}=sl(a),h=Math.atan2(c,r)*nm;return{h:h<0?h+360:h,c:Math.sqrt(r*r+c*c),l:e,alpha:a.a}},reverse:function(a){const e=a.h*Sf,r=a.c;return id({l:a.l,a:Math.cos(e)*r,b:Math.sin(e)*r,alpha:a.alpha})},interpolate:function(a,e,r){return{h:$l(a.h,e.h,r),c:gi(a.c,e.c,r),l:gi(a.l,e.l,r),alpha:gi(a.alpha,e.alpha,r)}}};var Ef=Object.freeze({__proto__:null,hcl:jl,lab:Tc});class no{constructor(e,r,c,h,m){this.type=e,this.operator=r,this.interpolation=c,this.input=h,this.labels=[],this.outputs=[];for(const[g,b]of m)this.labels.push(g),this.outputs.push(b)}static interpolationFactor(e,r,c,h){let m=0;if(e.name==="exponential")m=qu(r,e.base,c,h);else if(e.name==="linear")m=qu(r,1,c,h);else if(e.name==="cubic-bezier"){const g=e.controlPoints;m=new zh(g[0],g[1],g[2],g[3]).solve(qu(r,1,c,h))}return m}static parse(e,r){let[c,h,m,...g]=e;if(!Array.isArray(h)||h.length===0)return r.error("Expected an interpolation type expression.",1);if(h[0]==="linear")h={name:"linear"};else if(h[0]==="exponential"){const E=h[1];if(typeof E!="number")return r.error("Exponential interpolation requires a numeric base.",1,1);h={name:"exponential",base:E}}else{if(h[0]!=="cubic-bezier")return r.error(`Unknown interpolation type ${String(h[0])}`,1,0);{const E=h.slice(1);if(E.length!==4||E.some(I=>typeof I!="number"||I<0||I>1))return r.error("Cubic bezier interpolation requires four numeric arguments with values between 0 and 1.",1);h={name:"cubic-bezier",controlPoints:E}}}if(e.length-1<4)return r.error(`Expected at least 4 arguments, but found only ${e.length-1}.`);if(e.length-1>3&&(e.length-1)%2!=0)return r.error("Expected an even number of arguments.");if(m=r.parse(m,2,ui),!m)return null;const b=[];let T=null;c==="interpolate-hcl"||c==="interpolate-lab"?T=io:r.expectedType&&r.expectedType.kind!=="value"&&(T=r.expectedType);for(let E=0;E<g.length;E+=2){const I=g[E],M=g[E+1],k=E+3,B=E+4;if(typeof I!="number")return r.error('Input/output pairs for "interpolate" expressions must be defined using literal numeric values (not computed expressions) for the input values.',k);if(b.length&&b[b.length-1][0]>=I)return r.error('Input/output pairs for "interpolate" expressions must be arranged with input values in strictly ascending order.',k);const N=r.parse(M,B,T);if(!N)return null;T=T||N.type,b.push([I,N])}return T.kind==="number"||T.kind==="color"||T.kind==="array"&&T.itemType.kind==="number"&&typeof T.N=="number"?new no(T,c,h,m,b):r.error(`Type ${or(T)} is not interpolatable.`)}evaluate(e){const r=this.labels,c=this.outputs;if(r.length===1)return c[0].evaluate(e);const h=this.input.evaluate(e);if(h<=r[0])return c[0].evaluate(e);const m=r.length;if(h>=r[m-1])return c[m-1].evaluate(e);const g=Oa(r,h),b=no.interpolationFactor(this.interpolation,h,r[g],r[g+1]),T=c[g].evaluate(e),E=c[g+1].evaluate(e);return this.operator==="interpolate"?zu[this.type.kind.toLowerCase()](T,E,b):this.operator==="interpolate-hcl"?jl.reverse(jl.interpolate(jl.forward(T),jl.forward(E),b)):Tc.reverse(Tc.interpolate(Tc.forward(T),Tc.forward(E),b))}eachChild(e){e(this.input);for(const r of this.outputs)e(r)}outputDefined(){return this.outputs.every(e=>e.outputDefined())}serialize(){let e;e=this.interpolation.name==="linear"?["linear"]:this.interpolation.name==="exponential"?this.interpolation.base===1?["linear"]:["exponential",this.interpolation.base]:["cubic-bezier",...this.interpolation.controlPoints];const r=[this.operator,e,this.input.serialize()];for(let c=0;c<this.labels.length;c++)r.push(this.labels[c],this.outputs[c].serialize());return r}}function qu(a,e,r,c){const h=c-r,m=a-r;return h===0?0:e===1?m/h:(Math.pow(e,m)-1)/(Math.pow(e,h)-1)}class za{constructor(e,r){this.type=e,this.args=r}static parse(e,r){if(e.length<2)return r.error("Expectected at least one argument.");let c=null;const h=r.expectedType;h&&h.kind!=="value"&&(c=h);const m=[];for(const b of e.slice(1)){const T=r.parse(b,1+m.length,c,void 0,{typeAnnotation:"omit"});if(!T)return null;c=c||T.type,m.push(T)}const g=h&&m.some(b=>Nu(h,b.type));return new za(g?zn:c,m)}evaluate(e){let r,c=null,h=0;for(const m of this.args){if(h++,c=m.evaluate(e),c&&c instanceof So&&!c.available&&(r||(r=c),c=null,h===this.args.length))return r;if(c!==null)break}return c}
vendor: 1,306 bytes, line 588
588eachChild(e){this.args.forEach(e)}outputDefined(){return this.args.every(e=>e.outputDefined())}serialize(){const e=["coalesce"];return this.eachChild(r=>{e.push(r.serialize())}),e}}class xa{constructor(e,r){this.type=r.type,this.bindings=[].concat(e),this.result=r}evaluate(e){return this.result.evaluate(e)}eachChild(e){for(const r of this.bindings)e(r[1]);e(this.result)}static parse(e,r){if(e.length<4)return r.error(`Expected at least 3 arguments, but found ${e.length-1} instead.`);const c=[];for(let m=1;m<e.length-1;m+=2){const g=e[m];if(typeof g!="string")return r.error(`Expected string, but found ${typeof g} instead.`,m);if(/[^a-zA-Z0-9_]/.test(g))return r.error("Variable names must contain only alphanumeric characters or '_'.",m);const b=r.parse(e[m+1],m+1);if(!b)return null;c.push([g,b])}const h=r.parse(e[e.length-1],e.length-1,r.expectedType,c);return h?new xa(c,h):null}outputDefined(){return this.result.outputDefined()}serialize(){const e=["let"];for(const[r,c]of this.bindings)e.push(r,c.serialize());return e.push(this.result.serialize()),e}}class nd{constructor(e,r,c){this.type=e,this.index=r,this.input=c}static parse(e,r){if(e.length!==3)return r.error(`Expected 2 arguments, but found ${e.length-1} instead.`);const c=r.parse(e[1],1,ui),h=r.parse(e[2],2,ho(r.expectedType||zn));
588return c&&h?new nd(h.type.itemType,c,h):null}evaluate(e){const r=this.index.evaluate(e),c=this.input.evaluate(e);if(r<0)throw new Gt(`Array index out of bounds: ${r} < 0.`);if(r>=c.length)throw new Gt(`Array index out of bounds: ${r} > ${c.length-1}.`);if(r!==Math.floor(r))throw new Gt(`Array index must be an integer, but found ${r} instead. Use at-interpolated to retrieve interpolated result with a fractional index.`);return c[r]}eachChild(e){e(this.index),e(this.input)}outputDefined(){return!1}serialize(){return["at",this.index.serialize(),this.input.serialize()]}}class sd{constructor(e,r,c){this.type=e,this.index=r,this.input=c}static parse(e,r){if(e.length!==3)return r.error(`Expected 2 arguments, but found ${e.length-1} instead.`);const c=r.parse(e[1],1,ui),h=r.parse(e[2],2,ho(r.expectedType||zn));return c&&h?new sd(h.type.itemType,c,h):null}evaluate(e){const r=this.index.evaluate(e),c=this.input.evaluate(e);if(r<0)throw new Gt(`Array index out of bounds: ${r} < 0.`);if(r>c.length-1)throw new Gt(`Array index out of bounds: ${r} > ${c.length-1}.`);if(r===Math.floor(r))return c[r];const h=Math.floor(r),m=Math.ceil(r),g=c[h],b=c[m];if(typeof g!="number"||typeof b!="number")throw new Gt(`Cannot interpolate between non-number values at index ${r}.`);const T=r-h;return g*(1-T)+b*T}eachChild(e){e(this.index),e(this.input)}outputDefined(){return!1}serialize(){return["at-interpolated",this.index.serialize(),this.input.serialize()]}}class Af{constructor(e,r){this.type=Sn,this.needle=e,this.haystack=r}static parse(e,r){if(e.length!==3)return r.error(`Expected 2 arguments, but found ${e.length-1} instead.`);const c=r.parse(e[1],1,zn),h=r.parse(e[2],2,zn);return c&&h?Ol(c.type,[Sn,qn,ui,ka,zn])?new Af(c,h):r.error(`Expected first argument to be of type boolean, string, number or null, but found ${or(c.type)} instead`):null}evaluate(e){const r=this.needle.evaluate(e),c=this.haystack.evaluate(e);if(c==null)return!1;if(!Jo(r,["boolean","string","number","null"]))throw new Gt(`Expected first argument to be of type boolean, string, number or null, but found ${or(_r(r))} instead.`);if(!Jo(c,["string","array"]))throw new Gt(`Expected second argument to be of type array or string, but found ${or(_r(c))} instead.`);return c.indexOf(r)>=0}eachChild(e){e(this.needle),e(this.haystack)}outputDefined(){return!0}serialize(){return["in",this.needle.serialize(),this.haystack.serialize()]}}class rd{constructor(e,r,c){this.type=ui,this.needle=e,this.haystack=r,this.fromIndex=c}static parse(e,r){if(e.length<=2||e.length>=5)return r.error(`Expected 3 or 4 arguments, but found ${e.length-1} instead.`);const c=r.parse(e[1],1,zn),h=r.parse(e[2],2,zn);if(!c||!h)return null;if(!Ol(c.type,[Sn,qn,ui,ka,zn]))return r.error(`Expected first argument to be of type boolean, string, number or null, but found ${or(c.type)} instead`);if(e.length===4){const m=r.parse(e[3],3,ui);return m?new rd(c,h,m):null}return new rd(c,h)}evaluate(e){const r=this.needle.evaluate(e),c=this.haystack.evaluate(e);if(!Jo(r,["boolean","string","number","null"]))throw new Gt(`Expected first argument to be of type boolean, string, number or null, but found ${or(_r(r))} instead.`);if(!Jo(c,["string","array"]))throw new Gt(`Expected second argument to be of type array or string, but found ${or(_r(c))} instead.`);if(this.fromIndex){const h=this.fromIndex.evaluate(e);return c.indexOf(r,h)}return c.indexOf(r)}eachChild(e){e(this.needle),e(this.haystack),this.fromIndex&&e(this.fromIndex)}outputDefined(){return!1}serialize(){if(this.fromIndex!=null&&this.fromIndex!==void 0){const e=this.fromIndex.serialize();return["index-of",this.needle.serialize(),this.haystack.serialize(),e]}return["index-of",this.needle.serialize(),this.haystack.serialize()]}}class Cf{constructor(e,r,c,h,m,g){this.inputType=e,this.type=r,this.input=c,this.cases=h,this.outputs=m,this.otherwise=g}static parse(e,r){if(e.length<5)return r.error(`Expected at least 4 arguments, but found only ${e.length-1}.`);if(e.length%2!=1)return r.error("Expected an even number of arguments.");let c,h;r.expectedType&&r.expectedType.kind!=="value"&&(h=r.expectedType);const m={},g=[];for(let E=2;E<e.length-1;E+=2){let I=e[E];const M=e[E+1];Array.isArray(I)||(I=[I]);const k=r.concat(E);if(I.length===0)return k.error("Expected at least one branch label.");
vendor: 16,384 bytes, line 588
588for(const N of I){if(typeof N!="number"&&typeof N!="string")return k.error("Branch labels must be numbers or strings.");if(typeof N=="number"&&Math.abs(N)>Number.MAX_SAFE_INTEGER)return k.error(`Branch labels must be integers no larger than ${Number.MAX_SAFE_INTEGER}.`);if(typeof N=="number"&&Math.floor(N)!==N)return k.error("Numeric branch labels must be integer values.");if(c){if(k.checkSubtype(c,_r(N)))return null}else c=_r(N);if(m[String(N)]!==void 0)return k.error("Branch labels must be unique.");m[String(N)]=g.length}const B=r.parse(M,E,h);if(!B)return null;h=h||B.type,g.push(B)}const b=r.parse(e[1],1,zn);if(!b)return null;const T=r.parse(e[e.length-1],e.length-1,h);return T?b.type.kind!=="value"&&r.concat(1).checkSubtype(c,b.type)?null:new Cf(c,h,b,m,g,T):null}evaluate(e){const r=this.input.evaluate(e);return(_r(r)===this.inputType&&this.outputs[this.cases[r]]||this.otherwise).evaluate(e)}eachChild(e){e(this.input),this.outputs.forEach(e),e(this.otherwise)}outputDefined(){return this.outputs.every(e=>e.outputDefined())&&this.otherwise.outputDefined()}serialize(){const e=["match",this.input.serialize()],r=Object.keys(this.cases).sort(),c=[],h={};for(const g of r){const b=h[this.cases[g]];b===void 0?(h[this.cases[g]]=c.length,c.push([this.cases[g],[g]])):c[b][1].push(g)}const m=g=>this.inputType.kind==="number"?Number(g):g;for(const[g,b]of c)e.push(b.length===1?m(b[0]):b.map(m)),e.push(this.outputs[g].serialize());return e.push(this.otherwise.serialize()),e}}class od{constructor(e,r,c){this.type=e,this.branches=r,this.otherwise=c}static parse(e,r){if(e.length<4)return r.error(`Expected at least 3 arguments, but found only ${e.length-1}.`);if(e.length%2!=0)return r.error("Expected an odd number of arguments.");let c;r.expectedType&&r.expectedType.kind!=="value"&&(c=r.expectedType);const h=[];for(let g=1;g<e.length-1;g+=2){const b=r.parse(e[g],g,Sn);if(!b)return null;const T=r.parse(e[g+1],g+1,c);if(!T)return null;h.push([b,T]),c=c||T.type}const m=r.parse(e[e.length-1],e.length-1,c);return m?new od(c,h,m):null}evaluate(e){for(const[r,c]of this.branches)if(r.evaluate(e))return c.evaluate(e);return this.otherwise.evaluate(e)}eachChild(e){for(const[r,c]of this.branches)e(r),e(c);e(this.otherwise)}outputDefined(){return this.branches.every(([e,r])=>r.outputDefined())&&this.otherwise.outputDefined()}serialize(){const e=["case"];return this.eachChild(r=>{e.push(r.serialize())}),e}}class Zu{constructor(e,r,c,h){this.type=e,this.input=r,this.beginIndex=c,this.endIndex=h}static parse(e,r){if(e.length<=2||e.length>=5)return r.error(`Expected 3 or 4 arguments, but found ${e.length-1} instead.`);const c=r.parse(e[1],1,zn),h=r.parse(e[2],2,ui);if(!c||!h)return null;if(!Ol(c.type,[ho(zn),qn,zn]))return r.error(`Expected first argument to be of type array or string, but found ${or(c.type)} instead`);if(e.length===4){const m=r.parse(e[3],3,ui);return m?new Zu(c.type,c,h,m):null}return new Zu(c.type,c,h)}evaluate(e){const r=this.input.evaluate(e),c=this.beginIndex.evaluate(e);if(!Jo(r,["string","array"]))throw new Gt(`Expected first argument to be of type array or string, but found ${or(_r(r))} instead.`);if(this.endIndex){const h=this.endIndex.evaluate(e);return r.slice(c,h)}return r.slice(c)}eachChild(e){e(this.input),e(this.beginIndex),this.endIndex&&e(this.endIndex)}outputDefined(){return!1}serialize(){if(this.endIndex!=null&&this.endIndex!==void 0){const e=this.endIndex.serialize();return["slice",this.input.serialize(),this.beginIndex.serialize(),e]}return["slice",this.input.serialize(),this.beginIndex.serialize()]}}function Xu(a,e){return a==="=="||a==="!="?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 If(a,e,r,c){return c.compare(e,r)===0}function Fa(a,e,r){const c=a!=="=="&&a!=="!=";return class AL{constructor(m,g,b){this.type=Sn,this.lhs=m,this.rhs=g,this.collator=b,this.hasUntypedArgument=m.type.kind==="value"||g.type.kind==="value"}static parse(m,g){if(m.length!==3&&m.length!==4)return g.error("Expected two or three arguments.");const b=m[0];let T=g.parse(m[1],1,zn);if(!T)return null;if(!Xu(b,T.type))return g.concat(1).error(`"${b}" comparisons are not supported for type '${or(T.type)}'.`);let E=g.parse(m[2],2,zn);if(!E)return null;if(!Xu(b,E.type))return g.concat(2).error(`"${b}" comparisons are not supported for type '${or(E.type)}'.`);if(T.type.kind!==E.type.kind&&T.type.kind!=="value"&&E.type.kind!=="value")return g.error(`Cannot compare types '${or(T.type)}' and '${or(E.type)}'.`);c&&(T.type.kind==="value"&&E.type.kind!=="value"?T=new Ii(E.type,[T]):T.type.kind!=="value"&&E.type.kind==="value"&&(E=new Ii(T.type,[E])));let I=null;if(m.length===4){if(T.type.kind!=="string"&&E.type.kind!=="string"&&T.type.kind!=="value"&&E.type.kind!=="value")return g.error("Cannot use collator to compare non-string types.");if(I=g.parse(m[3],3,fc),!I)return null}return new AL(T,E,I)}evaluate(m){const g=this.lhs.evaluate(m),b=this.rhs.evaluate(m);if(c&&this.hasUntypedArgument){const T=_r(g),E=_r(b);if(T.kind!==E.kind||T.kind!=="string"&&T.kind!=="number")throw new Gt(`Expected arguments for "${a}" to be (string, string) or (number, number), but found (${T.kind}, ${E.kind}) instead.`)}if(this.collator&&!c&&this.hasUntypedArgument){const T=_r(g),E=_r(b);if(T.kind!=="string"||E.kind!=="string")return e(m,g,b)}return this.collator?r(m,g,b,this.collator.evaluate(m)):e(m,g,b)}eachChild(m){m(this.lhs),m(this.rhs),this.collator&&m(this.collator)}outputDefined(){return!0}serialize(){const m=[a];return this.eachChild(g=>{m.push(g.serialize())}),m}}}const ad=Fa("==",function(a,e,r){return e===r},If),Dg=Fa("!=",function(a,e,r){return e!==r},function(a,e,r,c){return!If(0,e,r,c)}),sm=Fa("<",function(a,e,r){return e<r},function(a,e,r,c){return c.compare(e,r)<0}),iu=Fa(">",function(a,e,r){return e>r},function(a,e,r,c){return c.compare(e,r)>0}),ce=Fa("<=",function(a,e,r){return e<=r},function(a,e,r,c){return c.compare(e,r)<=0}),z=Fa(">=",function(a,e,r){return e>=r},function(a,e,r,c){return c.compare(e,r)>=0});class ee{constructor(e,r,c,h,m,g){this.type=qn,this.number=e,this.locale=r,this.currency=c,this.unit=h,this.minFractionDigits=m,this.maxFractionDigits=g}static parse(e,r){if(e.length!==3)return r.error("Expected two arguments.");const c=r.parse(e[1],1,ui);if(!c)return null;const h=e[2];if(typeof h!="object"||Array.isArray(h))return r.error("NumberFormat options argument must be an object.");let m=null;if(h.locale&&(m=r.parseObjectValue(h.locale,2,"locale",qn),!m))return null;let g=null;if(h.currency&&(g=r.parseObjectValue(h.currency,2,"currency",qn),!g))return null;let b=null;if(h.unit&&(b=r.parseObjectValue(h.unit,2,"unit",qn),!b))return null;let T=null;if(h["min-fraction-digits"]&&(T=r.parseObjectValue(h["min-fraction-digits"],2,"min-fraction-digits",ui),!T))return null;let E=null;return h["max-fraction-digits"]&&(E=r.parseObjectValue(h["max-fraction-digits"],2,"max-fraction-digits",ui),!E)?null:new ee(c,m,g,b,T,E)}evaluate(e){return new Intl.NumberFormat(this.locale?this.locale.evaluate(e):[],{style:(this.currency?"currency":this.unit&&"unit")||"decimal",currency:this.currency?this.currency.evaluate(e):void 0,unit:this.unit?this.unit.evaluate(e):void 0,minimumFractionDigits:this.minFractionDigits?this.minFractionDigits.evaluate(e):void 0,maximumFractionDigits:this.maxFractionDigits?this.maxFractionDigits.evaluate(e):void 0}).format(this.number.evaluate(e))}eachChild(e){e(this.number),this.locale&&e(this.locale),this.currency&&e(this.currency),this.unit&&e(this.unit),this.minFractionDigits&&e(this.minFractionDigits),this.maxFractionDigits&&e(this.maxFractionDigits)}outputDefined(){return!1}serialize(){const e={};return this.locale&&(e.locale=this.locale.serialize()),this.currency&&(e.currency=this.currency.serialize()),this.unit&&(e.unit=this.unit.serialize()),this.minFractionDigits&&(e["min-fraction-digits"]=this.minFractionDigits.serialize()),this.maxFractionDigits&&(e["max-fraction-digits"]=this.maxFractionDigits.serialize()),["number-format",this.number.serialize(),e]}}class we{constructor(e){this.type=ui,this.input=e}static parse(e,r){if(e.length!==2)return r.error(`Expected 1 argument, but found ${e.length-1} instead.`);const c=r.parse(e[1],1);return c?c.type.kind!=="array"&&c.type.kind!=="string"&&c.type.kind!=="value"?r.error(`Expected argument of type string or array, but found ${or(c.type)} instead.`):new we(c):null}evaluate(e){const r=this.input.evaluate(e);if(typeof r=="string"||Array.isArray(r))return r.length;throw new Gt(`Expected value to be of type string or array, but found ${or(_r(r))} instead.`)}eachChild(e){e(this.input)}outputDefined(){return!1}serialize(){const e=["length"];return this.eachChild(r=>{e.push(r.serialize())}),e}}function ot(a){return function(){a=1831565813+(a|=0)|0;let e=Math.imul(a^a>>>15,1|a);return e=e+Math.imul(e^e>>>7,61|e)^e,((e^e>>>14)>>>0)/4294967296}}const at={"==":ad,"!=":Dg,">":iu,"<":sm,">=":z,"<=":ce,array:Ii,at:nd,"at-interpolated":sd,boolean:Ii,case:od,coalesce:za,collator:Zc,format:Fl,image:qc,in:Af,"index-of":rd,interpolate:no,"interpolate-hcl":no,"interpolate-lab":no,length:we,let:xa,literal:en,match:Cf,number:Ii,"number-format":ee,object:Ii,slice:Zu,step:Gu,string:Ii,"to-boolean":ko,"to-color":ko,"to-number":ko,"to-string":ko,var:Jh,within:Eo,distance:Ra,config:xc};function Ot(a,[e,r,c,h]){e=e.evaluate(a),r=r.evaluate(a),c=c.evaluate(a);const m=h?h.evaluate(a):1,g=$p(e,r,c,m);if(g)throw new Gt(g);return new Cn(e/255*m,r/255*m,c/255*m,m)}function ii(a,[e,r,c,h]){e=e.evaluate(a),r=r.evaluate(a),c=c.evaluate(a);const m=h?h.evaluate(a):1,g=function(E,I,M,k){return typeof E=="number"&&E>=0&&E<=360?typeof I=="number"&&I>=0&&I<=100&&typeof M=="number"&&M>=0&&M<=100?k===void 0||typeof k=="number"&&k>=0&&k<=1?null:`Invalid hsla value [${[E,I,M,k].join(", ")}]: 'a' must be between 0 and 1.`:`Invalid hsla value [${(typeof k=="number"?[E,I,M,k]:[E,I,M]).join(", ")}]: 's', and 'l' must be between 0 and 100.`:`Invalid hsla value [${(typeof k=="number"?[E,I,M,k]:[E,I,M]).join(", ")}]: 'h' must be between 0 and 360.`}(e,r,c,m);if(g)throw new Gt(g);const b=`hsla(${e}, ${r}%, ${c}%, ${m})`,T=Cn.parse(b);if(!T)throw new Gt(`Failed to parse HSLA color: ${b}`);return T}function Si(a,e){return a in e}function Wi(a,e){const r=e[a];return r===void 0?null:r}function Ui(a){return{type:a}}function $i(a){return{result:"success",value:a}}function xn(a){return{result:"error",value:a}}function wn(a,e){return!!a&&!!a.parameters&&a.parameters.indexOf(e)>-1}function kn(a){return a["property-type"]==="data-driven"}function Ln(a){return wn(a.expression,"measure-light")}function Fn(a){return wn(a.expression,"zoom")}function Ns(a){return!!a.expression&&a.expression.interpolated}function Gs(a){return typeof a=="object"&&a!==null&&!Array.isArray(a)}function os(a){return a}function As(a,e){const r=e.type==="color",c=a.stops&&typeof a.stops[0][0]=="object",h=c||!(c||a.property!==void 0),m=a.type||(Ns(e)?"exponential":"interval");if(r&&((a=Ll({},a)).stops&&(a.stops=a.stops.map(E=>[E[0],Cn.parse(E[1])])),a.default=Cn.parse(a.default?a.default:e.default)),a.colorSpace&&a.colorSpace!=="rgb"&&!Ef[a.colorSpace])throw new Error(`Unknown color space: ${a.colorSpace}`);let g,b,T;if(m==="exponential")g=gs;else if(m==="interval")g=Ws;else if(m==="categorical"){g=ms,b=Object.create(null);for(const E of a.stops)b[E[0]]=E[1];T=typeof a.stops[0][0]}else{if(m!=="identity")throw new Error(`Unknown function type "${m}"`);g=qs}if(c){const E={},I=[];for(let B=0;B<a.stops.length;B++){const N=a.stops[B],U=N[0].zoom;E[U]===void 0&&(E[U]={zoom:U,type:a.type,property:a.property,default:a.default,stops:[]},I.push(U)),E[U].stops.push([N[0].value,N[1]])}const M=[];for(const B of I)M.push([E[B].zoom,As(E[B],e)]);const k={name:"linear"};return{kind:"composite",interpolationType:k,interpolationFactor:no.interpolationFactor.bind(void 0,k),zoomStops:M.map(B=>B[0]),evaluate:({zoom:B},N)=>gs({stops:M,base:a.base},e,B).evaluate(B,N)}}if(h){const E=m==="exponential"?{name:"exponential",base:a.base!==void 0?a.base:1}:null;return{kind:"camera",interpolationType:E,interpolationFactor:no.interpolationFactor.bind(void 0,E),zoomStops:a.stops.map(I=>I[0]),evaluate:({zoom:I})=>g(a,e,I,b,T)}}return{kind:"source",evaluate(E,I){const M=I&&I.properties?I.properties[a.property]:void 0;return M===void 0?Bn(a.default,e.default):g(a,e,M,b,T)}}}function Bn(a,e,r){return a!==void 0?a:e!==void 0?e:r!==void 0?r:void 0}function ms(a,e,r,c,h){return Bn(typeof r===h?c[r]:void 0,a.default,e.default)}function Ws(a,e,r){if(Di(r)!=="number")return Bn(a.default,e.default);const c=a.stops.length;if(c===1||r<=a.stops[0][0])return a.stops[0][1];if(r>=a.stops[c-1][0])return a.stops[c-1][1];const h=Oa(a.stops.map(m=>m[0]),r);return a.stops[h][1]}function gs(a,e,r){const c=a.base!==void 0?a.base:1;if(Di(r)!=="number")return Bn(a.default,e.default);const h=a.stops.length;if(h===1||r<=a.stops[0][0])return a.stops[0][1];if(r>=a.stops[h-1][0])return a.stops[h-1][1];const m=Oa(a.stops.map(I=>I[0]),r),g=function(I,M,k,B){const N=B-k,U=I-k;return N===0?0:M===1?U/N:(Math.pow(M,U)-1)/(Math.pow(M,N)-1)}(r,c,a.stops[m][0],a.stops[m+1][0]),b=a.stops[m][1],T=a.stops[m+1][1];let E=zu[e.type]||os;if(a.colorSpace&&a.colorSpace!=="rgb"){const I=Ef[a.colorSpace];E=(M,k)=>I.reverse(I.interpolate(I.forward(M),I.forward(k),g))}return typeof b.evaluate=="function"?{evaluate(...I){const M=b.evaluate.apply(void 0,I),k=T.evaluate.apply(void 0,I);if(M!==void 0&&k!==void 0)return E(M,k,g)}}:E(b,T,g)}function qs(a,e,r){return e.type==="color"?r=Cn.parse(r):e.type==="formatted"?r=fo.fromString(r.toString()):e.type==="resolvedImage"?r=So.build(r.toString()):Di(r)===e.type||e.type==="enum"&&e.values[r]||(r=void 0),Bn(r,a.default,e.default)}qr.register(at,{error:[{kind:"error"},[qn],(a,[e])=>{throw new Gt(e.evaluate(a))}],typeof:[qn,[zn],(a,[e])=>or(_r(e.evaluate(a)))],"to-rgba":[ho(ui,4),[io],(a,[e])=>e.evaluate(a).toRenderColor(null).toArray()],"to-hsla":[ho(ui,4),[io],(a,[e])=>e.evaluate(a).toRenderColor(null).toHslaArray()],rgb:[io,[ui,ui,ui],Ot],rgba:[io,[ui,ui,ui,ui],Ot],hsl:[io,[ui,ui,ui],ii],hsla:[io,[ui,ui,ui,ui],ii],has:{type:Sn,overloads:[[[qn],(a,[e])=>Si(e.evaluate(a),a.properties())],[[qn,Rl],(a,[e,r])=>Si(e.evaluate(a),r.evaluate(a))]]},get:{type:zn,overloads:[[[qn],(a,[e])=>Wi(e.evaluate(a),a.properties())],[[qn,Rl],(a,[e,r])=>Wi(e.evaluate(a),r.evaluate(a))]]},"feature-state":[zn,[qn],(a,[e])=>Wi(e.evaluate(a),a.featureState||{})],properties:[Rl,[],a=>a.properties()],"geometry-type":[qn,[],a=>a.geometryType()],id:[zn,[],a=>a.id()],zoom:[ui,[],a=>a.globals.zoom],pitch:[ui,[],a=>a.globals.pitch||0],"distance-from-center":[ui,[],a=>a.distanceFromCenter()],"measure-light":[ui,[qn],(a,[e])=>a.measureLight(e.evaluate(a))],"heatmap-density":[ui,[],a=>a.globals.heatmapDensity||0],"line-progress":[ui,[],a=>a.globals.lineProgress||0],"raster-value":[ui,[],a=>a.globals.rasterValue||0],"raster-particle-speed":[ui,[],a=>a.globals.rasterParticleSpeed||0],"sky-radial-progress":[ui,[],a=>a.globals.skyRadialProgress||0],accumulated:[zn,[],a=>a.globals.accumulated===void 0?null:a.globals.accumulated],"+":[ui,Ui(ui),(a,e)=>{let r=0;for(const c of e)r+=c.evaluate(a);return r}],"*":[ui,Ui(ui),(a,e)=>{let r=1;for(const c of e)r*=c.evaluate(a);return r}],"-":{type:ui,overloads:[[[ui,ui],(a,[e,r])=>e.evaluate(a)-r.evaluate(a)],[[ui],(a,[e])=>-e.evaluate(a)]]},"/":[ui,[ui,ui],(a,[e,r])=>e.evaluate(a)/r.evaluate(a)],"%":[ui,[ui,ui],(a,[e,r])=>e.evaluate(a)%r.evaluate(a)],ln2:[ui,[],()=>Math.LN2],pi:[ui,[],()=>Math.PI],e:[ui,[],()=>Math.E],"^":[ui,[ui,ui],(a,[e,r])=>Math.pow(e.evaluate(a),r.evaluate(a))],sqrt:[ui,[ui],(a,[e])=>Math.sqrt(e.evaluate(a))],log10:[ui,[ui],(a,[e])=>Math.log(e.evaluate(a))/Math.LN10],ln:[ui,[ui],(a,[e])=>Math.log(e.evaluate(a))],log2:[ui,[ui],(a,[e])=>Math.log(e.evaluate(a))/Math.LN2],sin:[ui,[ui],(a,[e])=>Math.sin(e.evaluate(a))],cos:[ui,[ui],(a,[e])=>Math.cos(e.evaluate(a))],tan:[ui,[ui],(a,[e])=>Math.tan(e.evaluate(a))],asin:[ui,[ui],(a,[e])=>Math.asin(e.evaluate(a))],acos:[ui,[ui],(a,[e])=>Math.acos(e.evaluate(a))],atan:[ui,[ui],(a,[e])=>Math.atan(e.evaluate(a))],min:[ui,Ui(ui),(a,e)=>Math.min(...e.map(r=>r.evaluate(a)))],max:[ui,Ui(ui),(a,e)=>Math.max(...e.map(r=>r.evaluate(a)))],abs:[ui,[ui],(a,[e])=>Math.abs(e.evaluate(a))],round:[ui,[ui],(a,[e])=>{
588const r=e.evaluate(a);return r<0?-Math.round(-r):Math.round(r)}],floor:[ui,[ui],(a,[e])=>Math.floor(e.evaluate(a))],ceil:[ui,[ui],(a,[e])=>Math.ceil(e.evaluate(a))],"filter-==":[Sn,[qn,zn],(a,[e,r])=>a.properties()[e.value]===r.value],"filter-id-==":[Sn,[zn],(a,[e])=>a.id()===e.value],"filter-type-==":[Sn,[qn],(a,[e])=>a.geometryType()===e.value],"filter-<":[Sn,[qn,zn],(a,[e,r])=>{const c=a.properties()[e.value],h=r.value;return typeof c==typeof h&&c<h}],"filter-id-<":[Sn,[zn],(a,[e])=>{const r=a.id(),c=e.value;return typeof r==typeof c&&r<c}],"filter->":[Sn,[qn,zn],(a,[e,r])=>{const c=a.properties()[e.value],h=r.value;return typeof c==typeof h&&c>h}],"filter-id->":[Sn,[zn],(a,[e])=>{const r=a.id(),c=e.value;return typeof r==typeof c&&r>c}],"filter-<=":[Sn,[qn,zn],(a,[e,r])=>{const c=a.properties()[e.value],h=r.value;return typeof c==typeof h&&c<=h}],"filter-id-<=":[Sn,[zn],(a,[e])=>{const r=a.id(),c=e.value;return typeof r==typeof c&&r<=c}],"filter->=":[Sn,[qn,zn],(a,[e,r])=>{const c=a.properties()[e.value],h=r.value;return typeof c==typeof h&&c>=h}],"filter-id->=":[Sn,[zn],(a,[e])=>{const r=a.id(),c=e.value;return typeof r==typeof c&&r>=c}],"filter-has":[Sn,[zn],(a,[e])=>e.value in a.properties()],"filter-has-id":[Sn,[],a=>a.id()!==null&&a.id()!==void 0],"filter-type-in":[Sn,[ho(qn)],(a,[e])=>e.value.indexOf(a.geometryType())>=0],"filter-id-in":[Sn,[ho(zn)],(a,[e])=>e.value.indexOf(a.id())>=0],"filter-in-small":[Sn,[qn,ho(zn)],(a,[e,r])=>r.value.indexOf(a.properties()[e.value])>=0],"filter-in-large":[Sn,[qn,ho(zn)],(a,[e,r])=>function(c,h,m,g){for(;m<=g;){const b=m+g>>1;if(h[b]===c)return!0;h[b]>c?g=b-1:m=b+1}return!1}(a.properties()[e.value],r.value,0,r.value.length-1)],all:{type:Sn,overloads:[[[Sn,Sn],(a,[e,r])=>e.evaluate(a)&&r.evaluate(a)],[Ui(Sn),(a,e)=>{for(const r of e)if(!r.evaluate(a))return!1;return!0}]]},any:{type:Sn,overloads:[[[Sn,Sn],(a,[e,r])=>e.evaluate(a)||r.evaluate(a)],[Ui(Sn),(a,e)=>{for(const r of e)if(r.evaluate(a))return!0;return!1}]]},"!":[Sn,[Sn],(a,[e])=>!e.evaluate(a)],"is-supported-script":[Sn,[qn],(a,[e])=>{const r=a.globals&&a.globals.isSupportedScript;return!r||r(e.evaluate(a))}],upcase:[qn,[qn],(a,[e])=>e.evaluate(a).toUpperCase()],downcase:[qn,[qn],(a,[e])=>e.evaluate(a).toLowerCase()],concat:[qn,Ui(zn),(a,e)=>e.map(r=>po(r.evaluate(a))).join("")],"resolved-locale":[qn,[fc],(a,[e])=>e.evaluate(a).resolvedLocale()],random:[ui,[ui,ui,zn],(a,e)=>{const[r,c,h]=e.map(g=>g.evaluate(a));if(r>c||r===c)return r;let m;if(typeof h=="string")m=function(g){let b=0;if(g.length===0)return b;for(let T=0;T<g.length;T++)b=(b<<5)-b+g.charCodeAt(T),b|=0;return b}(h);else{if(typeof h!="number")throw new Gt(`Invalid seed input: ${h}`);m=h}return r+ot(m)()*(c-r)}]});class dr{constructor(e,r,c,h){this.expression=e,this._warningHistory={},this._evaluator=new jh(c,h),this._defaultValue=r?function(m){return m.type==="color"&&(Gs(m.default)||Array.isArray(m.default))?new Cn(0,0,0,0):m.type==="color"?Cn.parse(m.default)||null:m.default===void 0?null:m.default}(r):null,this._enumValues=r&&r.type==="enum"?r.values:null,this.configDependencies=eu(e)}evaluateWithoutErrorHandling(e,r,c,h,m,g,b,T){return this._evaluator.globals=e,this._evaluator.feature=r,this._evaluator.featureState=c,this._evaluator.canonical=h||null,this._evaluator.availableImages=m||null,this._evaluator.formattedSection=g,this._evaluator.featureTileCoord=b||null,this._evaluator.featureDistanceData=T||null,this.expression.evaluate(this._evaluator)}evaluate(e,r,c,h,m,g,b,T){this._evaluator.globals=e,this._evaluator.feature=r||null,this._evaluator.featureState=c||null,this._evaluator.canonical=h||null,this._evaluator.availableImages=m||null,this._evaluator.formattedSection=g||null,this._evaluator.featureTileCoord=b||null,this._evaluator.featureDistanceData=T||null;try{const E=this.expression.evaluate(this._evaluator);if(E==null||typeof E=="number"&&E!=E)return this._defaultValue;if(this._enumValues&&!(E in this._enumValues))throw new Gt(`Expected value to be one of ${Object.keys(this._enumValues).map(I=>JSON.stringify(I)).join(", ")}, but found ${JSON.stringify(E)} instead.`);return E}catch(E){return this._warningHistory[E.message]||(this._warningHistory[E.message]=!0,typeof console<"u"&&console.warn(`Failed to evaluate expression "${JSON.stringify(this.expression.serialize())}". ${E.message}`)),this._defaultValue}}}function _o(a){return Array.isArray(a)&&a.length>0&&typeof a[0]=="string"&&a[0]in at}function yo(a,e,r,c){const h=new Jp(at,[],e?function(g){const b={color:io,string:qn,number:ui,enum:qn,boolean:Sn,formatted:Fu,resolvedImage:Bu};return g.type==="array"?ho(b[g.value]||zn,g.length):b[g.type]}(e):void 0,void 0,void 0,r,c),m=h.parse(a,void 0,void 0,void 0,e&&e.type==="string"?{typeAnnotation:"coerce"}:void 0);return m?$i(new dr(m,e,r,c)):xn(h.errors)}class Sr{constructor(e,r,c,h){this.kind=e,this._styleExpression=r,this.isLightConstant=c,this.isLineProgressConstant=h,this.isStateDependent=e!=="constant"&&!nl(r.expression),this.configDependencies=eu(r.expression)}evaluateWithoutErrorHandling(e,r,c,h,m,g){return this._styleExpression.evaluateWithoutErrorHandling(e,r,c,h,m,g)}evaluate(e,r,c,h,m,g){return this._styleExpression.evaluate(e,r,c,h,m,g)}}class so{constructor(e,r,c,h,m,g){this.kind=e,this.zoomStops=c,this._styleExpression=r,this.isStateDependent=e!=="camera"&&!nl(r.expression),this.isLightConstant=m,this.isLineProgressConstant=g,this.configDependencies=eu(r.expression),this.interpolationType=h}evaluateWithoutErrorHandling(e,r,c,h,m,g){return this._styleExpression.evaluateWithoutErrorHandling(e,r,c,h,m,g)}evaluate(e,r,c,h,m,g){return this._styleExpression.evaluate(e,r,c,h,m,g)}interpolationFactor(e,r,c){return this.interpolationType?no.interpolationFactor(this.interpolationType,e,r,c):0}}function vo(a,e,r,c){if((a=yo(a,e,r,c)).result==="error")return a;const h=a.value.expression,m=Hu(h);if(!m&&!kn(e))return xn([new Ko("","data expressions not supported")]);const g=bc(h,["zoom","pitch","distance-from-center"]);if(!g&&!Fn(e))return xn([new Ko("","zoom expressions not supported")]);const b=bc(h,["measure-light"]);if(!b&&!Ln(e))return xn([new Ko("","measure-light expression not supported")]);const T=bc(h,["line-progress"]);if(!T&&!function(M){return wn(M.expression,"line-progress")}(e))return xn([new Ko("","line-progress expression not supported")]);
588const E=e.expression&&e.expression.relaxZoomRestriction,I=Wo(h);return I||g||E?I instanceof Ko?xn([I]):I instanceof no&&!Ns(e)?xn([new Ko("",'"interpolate" expressions cannot be used with this property')]):$i(I?new so(m&&T?"camera":"composite",a.value,I.labels,I instanceof no?I.interpolation:void 0,b,T):new Sr(m&&T?"constant":"source",a.value,b,T)):xn([new Ko("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression, or in the properties of atmosphere.')])}class nr{constructor(e,r){this._parameters=e,this._specification=r,Ll(this,As(this._parameters,this._specification))}static deserialize(e){return new nr(e._parameters,e._specification)}static serialize(e){return{_parameters:e._parameters,_specification:e._specification}}}function Wo(a){let e=null;if(a instanceof xa)e=Wo(a.result);else if(a instanceof za){for(const r of a.args)if(e=Wo(r),e)break}else(a instanceof Gu||a instanceof no)&&a.input instanceof qr&&a.input.name==="zoom"&&(e=a);return e instanceof Ko||a.eachChild(r=>{const c=Wo(r);c instanceof Ko?e=c:e&&c&&e!==c&&(e=new Ko("",'Only one zoom-based "step" or "interpolate" subexpression may be used in an expression.'))}),e}var ia,rl,Lr=function(){if(rl)return ia;rl=1,ia=e;var a=3;function e(r,c,h){var m=this.cells=[];if(r instanceof ArrayBuffer){this.arrayBuffer=r;var g=new Int32Array(this.arrayBuffer);r=g[0],this.d=(c=g[1])+2*(h=g[2]);for(var b=0;b<this.d*this.d;b++){var T=g[a+b],E=g[a+b+1];m.push(T===E?null:g.subarray(T,E))}var I=g[a+m.length+1];this.keys=g.subarray(g[a+m.length],I),this.bboxes=g.subarray(I),this.insert=this._insertReadonly}else{this.d=c+2*h;for(var M=0;M<this.d*this.d;M++)m.push([]);this.keys=[],this.bboxes=[]}this.n=c,this.extent=r,this.padding=h,this.scale=c/r,this.uid=0;var k=h/c*r;this.min=-k,this.max=r+k}return e.prototype.insert=function(r,c,h,m,g){this._forEachCell(c,h,m,g,this._insertCell,this.uid++),this.keys.push(r),this.bboxes.push(c),this.bboxes.push(h),this.bboxes.push(m),this.bboxes.push(g)},e.prototype._insertReadonly=function(){throw"Cannot insert into a GridIndex created from an ArrayBuffer."},e.prototype._insertCell=function(r,c,h,m,g,b){this.cells[g].push(b)},e.prototype.query=function(r,c,h,m,g){var b=this.min,T=this.max;if(r<=b&&c<=b&&T<=h&&T<=m&&!g)return Array.prototype.slice.call(this.keys);var E=[];return this._forEachCell(r,c,h,m,this._queryCell,E,{},g),E},e.prototype._queryCell=function(r,c,h,m,g,b,T,E){var I=this.cells[g];if(I!==null)for(var M=this.keys,k=this.bboxes,B=0;B<I.length;B++){var N=I[B];if(T[N]===void 0){var U=4*N;(E?E(k[U+0],k[U+1],k[U+2],k[U+3]):r<=k[U+2]&&c<=k[U+3]&&h>=k[U+0]&&m>=k[U+1])?(T[N]=!0,b.push(M[N])):T[N]=!1}}},e.prototype._forEachCell=function(r,c,h,m,g,b,T,E){for(var I=this._convertToCellCoord(r),M=this._convertToCellCoord(c),k=this._convertToCellCoord(h),B=this._convertToCellCoord(m),N=I;N<=k;N++)for(var U=M;U<=B;U++){var Y=this.d*U+N;if((!E||E(this._convertFromCellCoord(N),this._convertFromCellCoord(U),this._convertFromCellCoord(N+1),this._convertFromCellCoord(U+1)))&&g.call(this,r,c,h,m,Y,b,T,E))return}},e.prototype._convertFromCellCoord=function(r){return(r-this.padding)/this.scale},e.prototype._convertToCellCoord=function(r){return Math.max(0,Math.min(this.d-1,Math.floor(r*this.scale)+this.padding))},e.prototype.toArrayBuffer=function(){if(this.arrayBuffer)return this.arrayBuffer;for(var r=this.cells,c=a+this.cells.length+1+1,h=0,m=0;m<this.cells.length;m++)h+=this.cells[m].length;var g=new Int32Array(c+h+this.keys.length+this.bboxes.length);g[0]=this.extent,g[1]=this.n,g[2]=this.padding;for(var b=c,T=0;T<r.length;T++){var E=r[T];g[a+T]=b,g.set(E,b),b+=E.length}return g[a+r.length]=b,g.set(this.keys,b),g[a+r.length+1]=b+=this.keys.length,g.set(this.bboxes,b),b+=this.bboxes.length,g.buffer},ia}(),Os=ga(Lr);const Nr={};function Vt(a,e,r={}){Object.defineProperty(a,"_classRegistryKey",{value:e,writable:!1}),Nr[e]={klass:a,omit:r.omit||[]}}Vt(Object,"Object"),Os.serialize=function(a,e){const r=a.toArrayBuffer();return e&&e.add(r),{buffer:r}},Os.deserialize=function(a){return new Os(a.buffer)},Object.defineProperty(Os,"name",{value:"Grid"}),Vt(Os,"Grid"),typeof DOMMatrix<"u"&&Vt(DOMMatrix,"DOMMatrix"),Vt(Cn,"Color"),Vt(Error,"Error"),Vt(fo,"Formatted"),Vt(pc,"FormattedSection"),Vt(Du,"AJAXError"),Vt(So,"ResolvedImage"),Vt(nr,"StylePropertyFunction"),Vt(dr,"StyleExpression",{omit:["_evaluator"]}),Vt(To,"ImageId"),Vt(ya,"ImageVariant"),Vt(so,"ZoomDependentExpression"),Vt(Sr,"ZoomConstantExpression"),Vt(qr,"CompoundExpression",{omit:["_evaluate"]});for(const a in at)Nr[at[a]._classRegistryKey]||Vt(at[a],`Expression${a}`);function na(a){return a&&typeof ArrayBuffer<"u"&&(a instanceof ArrayBuffer||a.constructor&&a.constructor.name==="ArrayBuffer")}function Ba(a){return self.ImageBitmap&&a instanceof ImageBitmap}function ol(a,e){if(a==null||typeof a=="boolean"||typeof a=="number"||typeof a=="str
588ing"||a instanceof Boolean||a instanceof Number||a instanceof String||a instanceof Date||a instanceof RegExp)return a;if(na(a)||Ba(a))return e&&e.add(a),a;if(ArrayBuffer.isView(a))return e&&e.add(a.buffer),a;if(a instanceof ImageData)return e&&e.add(a.data.buffer),a;if(Array.isArray(a)){const r=[];for(const c of a)r.push(ol(c,e));return r}if(a instanceof Map){const r={$name:"Map",entries:[]};for(const[c,h]of a.entries())r.entries.push(ol(c),ol(h,e));return r}if(a instanceof Set){const r={$name:"Set"};let c=0;for(const h of a.values())r[++c]=ol(h);return r}if(a instanceof DOMMatrix){const r={$name:"DOMMatrix"},c=["is2D","m11","m12","m13","m14","m21","m22","m23","m24","m31","m32","m33","m34","m41","m42","m43","m44","a","b","c","d","e","f"];for(const h of c)r[h]=a[h];return r}if(typeof a=="bigint")return{$name:"BigInt",value:a.toString()};if(typeof a=="object"){const r=a.constructor,c=r._classRegistryKey;if(!c)throw new Error(`Can't serialize object of unregistered class "${r.name}".`);const h=r.serialize?r.serialize(a,e):{};if(!r.serialize){for(const m in a)a.hasOwnProperty(m)&&(Nr[c].omit.indexOf(m)>=0||(h[m]=ol(a[m],e)));a instanceof Error&&(h.message=a.message)}if(h.$name)throw new Error("$name property is reserved for worker serialization logic.");return c!=="Object"&&(h.$name=c),h}throw new Error("can't serialize object of type "+typeof a)}function al(a){if(a==null||typeof a=="boolean"||typeof a=="number"||typeof a=="string"||a instanceof Boolean||a instanceof Number||a instanceof String||a instanceof Date||a instanceof RegExp||na(a)||Ba(a)||ArrayBuffer.isView(a)||a instanceof ImageData)return a;if(Array.isArray(a))return a.map(al);if(typeof a=="object"){const e=a.$name||"Object";if(e==="Map"){const h=a.entries||[],m=new Map;for(let g=0;g<h.length;g+=2)m.set(al(h[g]),al(h[g+1]));return m}if(e==="Set"){const h=new Set;for(const m of Object.keys(a))m!=="$name"&&h.add(al(a[m]));return h}if(e==="DOMMatrix"){let h;return h=a.is2D?[a.a,a.b,a.c,a.d,a.e,a.f]:[a.m11,a.m12,a.m13,a.m14,a.m21,a.m22,a.m23,a.m24,a.m31,a.m32,a.m33,a.m34,a.m41,a.m42,a.m43,a.m44],new DOMMatrix(h)}if(e==="BigInt")return BigInt(a.value);const{klass:r}=Nr[e];if(!r)throw new Error(`Can't deserialize unregistered class "${e}".`);if(r.deserialize)return r.deserialize(a);const c=Object.create(r.prototype);for(const h of Object.keys(a))h!=="$name"&&(c[h]=al(a[h]));return c}throw new Error("can't deserialize object of type "+typeof a)}const mi={"Latin-1 Supplement":a=>a>=128&&a<=255,Arabic:a=>a>=1536&&a<=1791,"Arabic Supplement":a=>a>=1872&&a<=1919,"Arabic Extended-A":a=>a>=2208&&a<=2303,"Hangul Jamo":a=>a>=4352&&a<=4607,"Unified Canadian Aboriginal Syllabics":a=>a>=5120&&a<=5759,Khmer:a=>a>=6016&&a<=6143,"Unified Canadian Aboriginal Syllabics Extended":a=>a>=6320&&a<=6399,"General Punctuation":a=>a>=8192&&a<=8303,"Letterlike Symbols":a=>a>=8448&&a<=8527,"Number Forms":a=>a>=8528&&a<=8591,"Miscellaneous Technical":a=>a>=8960&&a<=9215,"Control Pictures":a=>a>=9216&&a<=9279,"Optical Character Recognition":a=>a>=9280&&a<=9311,"Enclosed Alphanumerics":a=>a>=9312&&a<=9471,"Geometric Shapes":a=>a>=9632&&a<=9727,"Miscellaneous Symbols":a=>a>=9728&&a<=9983,"Miscellaneous Symbols and Arrows":a=>a>=11008&&a<=11263,"CJK Radicals Supplement":a=>a>=11904&&a<=12031,"Kangxi Radicals":a=>a>=12032&&a<=12255,"Ideographic Description Characters":a=>a>=12272&&a<=12287,"CJK Symbols and Punctuation":a=>a>=12288&&a<=12351,Hiragana:a=>a>=12352&&a<=12447,Katakana:a=>a>=12448&&a<=12543,Bopomofo:a=>a>=12544&&a<=12591,"Hangul Compatibility Jamo":a=>a>=12592&&a<=12687,Kanbun:a=>a>=12688&&a<=12703,"Bopomofo Extended":a=>a>=12704&&a<=12735,"CJK Strokes":a=>a>=12736&&a<=12783,"Katakana Phonetic Extensions":a=>a>=12784&&a<=12799,"Enclosed CJK Letters and Months":a=>a>=12800&&a<=13055,"CJK Compatibility":a=>a>=13056&&a<=13311,"CJK Unified Ideographs Extension A":a=>a>=13312&&a<=19903,"Yijing Hexagram Symbols":a=>a>=19904&&a<=19967,"CJK Unified Ideographs":a=>a>=19968&&a<=40959,"Yi Syllables":a=>a>=40960&&a<=42127,"Yi Radicals":a=>a>=42128&&a<=42191,"Hangul Jamo Extended-A":a=>a>=43360&&a<=43391,"Hangul Syllables":a=>
588a>=44032&&a<=55215,"Hangul Jamo Extended-B":a=>a>=55216&&a<=55295,"Private Use Area":a=>a>=57344&&a<=63743,"CJK Compatibility Ideographs":a=>a>=63744&&a<=64255,"Arabic Presentation Forms-A":a=>a>=64336&&a<=65023,"Vertical Forms":a=>a>=65040&&a<=65055,"CJK Compatibility Forms":a=>a>=65072&&a<=65103,"Small Form Variants":a=>a>=65104&&a<=65135,"Arabic Presentation Forms-B":a=>a>=65136&&a<=65279,"Halfwidth and Fullwidth Forms":a=>a>=65280&&a<=65519,Osage:a=>a>=66736&&a<=66815,"CJK Unified Ideographs Extension B":a=>a>=131072&&a<=173791};function Mf(a){for(const e of a)if(Yu(e.charCodeAt(0)))return!0;return!1}function kg(a){for(const e of a)if(!ld(e.charCodeAt(0)))return!1;return!0}function ld(a){return!(mi.Arabic(a)||mi["Arabic Supplement"](a)||mi["Arabic Extended-A"](a)||mi["Arabic Presentation Forms-A"](a)||mi["Arabic Presentation Forms-B"](a))}function Yu(a){return!(a!==746&&a!==747&&(a<4352||!(mi["Bopomofo Extended"](a)||mi.Bopomofo(a)||mi["CJK Compatibility Forms"](a)&&!(a>=65097&&a<=65103)||mi["CJK Compatibility Ideographs"](a)||mi["CJK Compatibility"](a)||mi["CJK Radicals Supplement"](a)||mi["CJK Strokes"](a)||!(!mi["CJK Symbols and Punctuation"](a)||a>=12296&&a<=12305||a>=12308&&a<=12319||a===12336)||mi["CJK Unified Ideographs Extension A"](a)||mi["CJK Unified Ideographs"](a)||mi["Enclosed CJK Letters and Months"](a)||mi["Hangul Compatibility Jamo"](a)||mi["Hangul Jamo Extended-A"](a)||mi["Hangul Jamo Extended-B"](a)||mi["Hangul Jamo"](a)||mi["Hangul Syllables"](a)||mi.Hiragana(a)||mi["Ideographic Description Characters"](a)||mi.Kanbun(a)||mi["Kangxi Radicals"](a)||mi["Katakana Phonetic Extensions"](a)||mi.Katakana(a)&&a!==12540||!(!mi["Halfwidth and Fullwidth Forms"](a)||a===65288||a===65289||a===65293||a>=65306&&a<=65310||a===65339||a===65341||a===65343||a>=65371&&a<=65503||a===65507||a>=65512&&a<=65519)||!(!mi["Small Form Variants"](a)||a>=65112&&a<=65118||a>=65123&&a<=65126)||mi["Unified Canadian Aboriginal Syllabics"](a)||mi["Unified Canadian Aboriginal Syllabics Extended"](a)||mi["Vertical Forms"](a)||mi["Yijing Hexagram Symbols"](a)||mi["Yi Syllables"](a)||mi["Yi Radicals"](a))))}function Pf(a){return!(Yu(a)||function(e){return!!(mi["Latin-1 Supplement"](e)&&(e===167||e===169||e===174||e===177||e===188||e===189||e===190||e===215||e===247)||mi["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)||mi["Letterlike Symbols"](e)||mi["Number Forms"](e)||mi["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)||mi["Control Pictures"](e)&&e!==9251||mi["Optical Character Recognition"](e)||mi["Enclosed Alphanumerics"](e)||mi["Geometric Shapes"](e)||mi["Miscellaneous Symbols"](e)&&!(e>=9754&&e<=9759)||mi["Miscellaneous Symbols and Arrows"](e)&&(e>=11026&&e<=11055||e>=11088&&e<=11097||e>=11192&&e<=11243)||mi["CJK Symbols and Punctuation"](e)||mi.Katakana(e)||mi["Private Use Area"](e)||mi["CJK Compatibility Forms"](e)||mi["Small Form Variants"](e)||mi["Halfwidth and Fullwidth Forms"](e)||e===8734||e===8756||e===8757||e>=9984&&e<=10087||e>=10102&&e<=10131||e===65532||e===65533)}(a))}function Lg(a){return mi.Arabic(a)||mi["Arabic Supplement"](a)||mi["Arabic Extended-A"](a)||mi["Arabic Presentation Forms-A"](a)||mi["Arabic Presentation Forms-B"](a)}function Df(a){return a>=1424&&a<=2303||mi["Arabic Presentation Forms-A"](a)||mi["Arabic Presentation Forms-B"](a)}function rm(a,e){return!(!e&&Df(a)||a>=2304&&a<=3583||a>=3840&&a<=4255||mi.Khmer(a))}function Rg(a){for(const e of a)if(Df(e.charCodeAt(0)))return!0;return!1}const kf="deferred",ll="loading",nu="loaded";let cd=null,Ao="unavailable",Na=null;const Ul=function(a){a&&typeof a=="string"&&a.indexOf("NetworkError")>-1&&(Ao="error"),cd&&cd(a)};function Ku(){Ju.fire(new Qa("pluginStateChange",{pluginStatus:Ao,pluginURL:Na}))}const Ju=new kl,Sc=function(){return Ao},om=function(){if(Ao!==kf||!Na)throw new Error("rtl-text-plugin cannot be downloaded unless a pluginURL is specified");Ao=ll,Ku(),Na&&cc({url:Na},a=>{a?Ul(a):(Ao=nu,Ku())})},sa={applyArabicShaping:null,processBidirectionalText:null,processStyledBidirectionalText:null,isLoaded:()=>Ao===nu||sa.applyArabicShaping!=null,isLoading:()=>Ao===ll,setState(a){Ao=a.pluginStatus,Na=a.pluginURL},isParsed:()=>sa.applyArabicShaping!=null&&sa.processBidirectionalText!=null&&sa.processStyledBidirectionalText!=null,getPluginURL:()=>Na};class Un{constructor(e,r){this.zoom=e,r?(this.now=r.now,this.fadeDuration=r.fadeDuration,this.transition=r.transition,this.pitch=r.pitch,this.brightness=r.brightness):(this.now=0,this.fadeDuration=0,this.transition={},this.pitch=0,this.brightness=0)}isSupportedScript(e){return function(r,c){for(const h of r)if(!rm(h.charCo
588deAt(0),c))return!1;return!0}(e,sa.isLoaded())}}class su{constructor(e,r,c,h){this.property=e,this.value=r,this.expression=function(m,g,b,T){if(Gs(m))return new nr(m,g);if(_o(m)||Array.isArray(m)&&m.length>0){const E=vo(m,g,b,T);if(E.result==="error")throw new Error(E.value.map(I=>`${I.key}: ${I.message}`).join(", "));return E.value}{let E=m;return typeof m=="string"&&g.type==="color"&&(E=Cn.parse(m)),{kind:"constant",configDependencies:new Set,evaluate:()=>E}}}(r===void 0?e.specification.default:r,e.specification,c,h)}isDataDriven(){return this.expression.kind==="source"||this.expression.kind==="composite"}possiblyEvaluate(e,r,c){return this.property.possiblyEvaluate(this,e,r,c)}}class ru{constructor(e,r,c){this.property=e,this.value=new su(e,void 0,r,c)}transitioned(e,r){return new t0(this.property,this.value,r,He({},e.transition,this.transition),e.now)}untransitioned(){return new t0(this.property,this.value,null,{},0)}}class e0{constructor(e,r,c){this._properties=e,this._values=Object.create(e.defaultTransitionablePropertyValues),this._scope=r,this._options=c,this.configDependencies=new Set}getValue(e){return Qi(this._values[e].value.value)}setValue(e,r){this._values.hasOwnProperty(e)||(this._values[e]=new ru(this._values[e].property,this._scope,this._options)),this._values[e].value=new su(this._values[e].property,r===null?void 0:Qi(r),this._scope,this._options),this._values[e].value.expression.configDependencies&&(this.configDependencies=new Set([...this.configDependencies,...this._values[e].value.expression.configDependencies]))}setTransitionOrValue(e,r){r&&(this._options=r);const c=this._properties.properties;if(e)for(const h in e){const m=e[h];if(h.endsWith("-transition")){const g=h.slice(0,-11);c[g]&&this.setTransition(g,m)}else c.hasOwnProperty(h)&&this.setValue(h,m)}}getTransition(e){return Qi(this._values[e].transition)}setTransition(e,r){this._values.hasOwnProperty(e)||(this._values[e]=new ru(this._values[e].property)),this._values[e].transition=Qi(r)||void 0}serialize(){const e={};for(const r of Object.keys(this._values)){const c=this.getValue(r);c!==void 0&&(e[r]=c);const h=this.getTransition(r);h!==void 0&&(e[`${r}-transition`]=h)}return e}transitioned(e,r){const c=new i0(this._properties);for(const h of Object.keys(this._values))c._values[h]=this._values[h].transitioned(e,r._values[h]);return c}untransitioned(){const e=new i0(this._properties);for(const r of Object.keys(this._values))e._values[r]=this._values[r].untransitioned();return e}}class t0{constructor(e,r,c,h,m){const g=h.delay||0,b=h.duration||0;m=m||0,this.property=e,this.value=r,this.begin=m+g,this.end=this.begin+b,e.specification.transition&&(h.delay||h.duration)&&(this.prior=c)}possiblyEvaluate(e,r,c){const h=e.now||0,m=this.value.possiblyEvaluate(e,r,c),g=this.prior;if(g){if(h>this.end)return this.prior=null,m;if(this.value.isDataDriven())return this.prior=null,m;if(h<this.begin)return g.possiblyEvaluate(e,r,c);{const b=(h-this.begin)/(this.end-this.begin);return this.property.interpolate(g.possiblyEvaluate(e,r,c),m,Ie(b))}}return m}}class i0{constructor(e){this._properties=e,this._values=Object.create(e.defaultTransitioningPropertyValues)}possiblyEvaluate(e,r,c){const h=new Qu(this._properties);for(const m of Object.keys(this._values))h._values[m]=this._values[m].possiblyEvaluate(e,r,c);return h}hasTransition(){for(const e of Object.keys(this._values))if(this._values[e].prior)return!0;return!1}}class A1{constructor(e,r,c){this._properties=e,this._values=Object.create(e.defaultPropertyValues),this._scope=r,this._options=c,this.configDependencies=new Set}getValue(e){return Qi(this._values[e].value)}setValue(e,r){this._values[e]=new su(this._values[e].property,r===null?void 0:Qi(r),this._scope,this._options),this._values[e].expression.configDependencies&&(this.configDependencies=new Set([...this.configDependencies,...this._values[e].expression.configDependencies]))}serialize(){const e={};for(const r of Object.keys(this._values)){const c=this.getValue(r);c!==void 0&&(e[r]=c)}return e}possiblyEvaluate(e,r,c){const h=new Qu(this._properties);for(const m of Object.keys(this._values))h._values[m]=this._values[m].possiblyEvaluate(e,r,c);return h}}class ud{constructor(e,r,c){this.property=e,this.value=r,this.parameters=c}isConstant(){return this.value.kind==="constant"}constantOr(e){return this.value.kind==="constant"?this.value.value:e}evaluate(e,r,c,h){return this.property.evaluate(this.value,this.parameters,e,r,c,h)}}class Qu{constructor(e){this._properties=e,this._values=Object.create(e.defaultPossiblyEvaluatedValues)}get(e){return this._values[e]}}class It{constructor(e){this.specification=e}
vendor: 5,621 bytes, line 588
588possiblyEvaluate(e,r){return e.expression.evaluate(r)}interpolate(e,r,c){const h=zu[this.specification.type];return h?h(e,r,c):e}}class Xt{constructor(e,r){this.specification=e,this.overrides=r}possiblyEvaluate(e,r,c,h){return new ud(this,e.expression.kind==="constant"||e.expression.kind==="camera"?{kind:"constant",value:e.expression.evaluate(r,null,{},c,h)}:e.expression,r)}interpolate(e,r,c){if(e.value.kind!=="constant"||r.value.kind!=="constant")return e;if(e.value.value===void 0||r.value.value===void 0)return new ud(this,{kind:"constant",value:void 0},e.parameters);const h=zu[this.specification.type];return h?new ud(this,{kind:"constant",value:h(e.value.value,r.value.value,c)},e.parameters):e}evaluate(e,r,c,h,m,g){return e.kind==="constant"?e.value:e.evaluate(r,c,h,m,g)}}class eh{constructor(e){this.specification=e}possiblyEvaluate(e,r,c,h){return!!e.expression.evaluate(r,null,{},c,h)}interpolate(){return!1}}class Ys{constructor(e){this.properties=e,this.defaultPropertyValues={},this.defaultTransitionablePropertyValues={},this.defaultTransitioningPropertyValues={},this.defaultPossiblyEvaluatedValues={},this.overridableProperties=[];const r=new Un(0,{});for(const c in e){const h=e[c];h.specification.overridable&&this.overridableProperties.push(c);const m=this.defaultPropertyValues[c]=new su(h,void 0),g=this.defaultTransitionablePropertyValues[c]=new ru(h);this.defaultTransitioningPropertyValues[c]=g.untransitioned(),this.defaultPossiblyEvaluatedValues[c]=m.possiblyEvaluate(r)}}}Vt(Xt,"DataDrivenProperty"),Vt(It,"DataConstantProperty"),Vt(eh,"ColorRampProperty");var $e=JSON.parse('{"$version":8,"$root":{"version":{"type":"enum","values":[8]},"fragment":{"type":"boolean"},"name":{"type":"string"},"metadata":{"type":"*"},"center":{"type":"array","value":"number"},"zoom":{"type":"number"},"bearing":{"type":"number","default":0,"period":360},"pitch":{"type":"number","default":0},"light":{"type":"light"},"lights":{"type":"array","value":"light-3d"},"terrain":{"type":"terrain","optional":true},"fog":{"type":"fog"},"snow":{"type":"snow"},"rain":{"type":"rain"},"camera":{"type":"camera"},"color-theme":{"type":"colorTheme"},"indoor":{"type":"indoor"},"imports":{"type":"array","value":"import"},"iconsets":{"type":"iconsets"},"schema":{"type":"schema"},"sources":{"type":"sources"},"sprite":{"type":"string"},"glyphs":{"type":"string","default":"mapbox://fonts/mapbox/{fontstack}/{range}.pbf"},"transition":{"type":"transition"},"projection":{"type":"projection"},"layers":{"type":"array","value":"layer"},"models":{"type":"models"},"featuresets":{"type":"featuresets"}},"featuresets":{"*":{"type":"featureset"}},"featureset":{"metadata":{"type":"*"},"selectors":{"type":"array","value":"selector"}},"selector":{"layer":{"type":"string"},"properties":{"type":"selectorProperty"},"featureNamespace":{"type":"string"},"_uniqueFeatureID":{"type":"boolean"}},"selectorProperty":{"*":{"type":"*"}},"model":{"type":"string"},"import":{"id":{"type":"string"},"url":{"type":"string"},"config":{"type":"config"},"data":{"type":"$root"},"color-theme":{"type":"colorTheme","optional":true}},"config":{"*":{"type":"*"}},"schema":{"*":{"type":"option"}},"option":{"default":{"type":"*","expression":{}},"type":{"type":"enum","values":{"string":1,"number":1,"boolean":1,"color":1}},"array":{"type":"boolean"},"minValue":{"type":"number"},"maxValue":{"type":"number"},"stepValue":{"type":"number"},"values":{"type":"array","value":"*"},"metadata":{"type":"*"}},"models":{"*":{"type":"model"}},"light-3d":{"id":{"type":"string"},"properties":{"type":"properties"},"type":{"type":"enum","values":{"ambient":{},"directional":{},"flat":{}}}},"properties":["properties_light_directional","properties_light_ambient","properties_light_flat"],"properties_light_directional":{"direction":{"type":"array","default":[210,30],"minimum":[0,0],"maximum":[360,90],"length":2,"value":"number","transition":true,"expression":{"interpolated":true,"parameters":["zoom"]}},"color":{"type":"color","default":"#ffffff","expression":{"interpolated":true,"parameters":["zoom"]},"transition":true},"intensity":{"type":"number","default":0.5,"minimum":0,"maximum":1,"expression":{"interpolated":true,"parameters":["zoom"]},"transition":true},"cast-shadows":{"type":"boolean","default":false},"shadow-quality":{"type":"number","default":1,"minimum":0,"maximum":1,"expression":{"parameters":["zoom"]}},"shadow-intensity":{"type":"number","default":1,"minimum":0,"maximum":1,"expression":{"interpolated":true,"parameters":["zoom"]},"transition":true}},"properties_light_ambient":{"color":{"type":"color","default":"#ffffff","expression":{"interpolated":true,"parameters":["zoom"]},"transition":true},"intensity":{"type":"number","default":0.5,"minimum":0,"maximum":1,"expression":{"interpolated":true,"parameters":["zoom"]},"transition":true}},"properties_light_flat":{"anchor":{"type":"enum","default":"viewport","values":{"map":1,"viewport":1},"expression":{"parameters":["zoom"]}},"position":{"type":"array","default":[1.15,210,30],"length":3,"value":"number","transition":true,"expression":{"interpolated":true,"parameters":["zoom"]}},"color":{"type":"color","default":"#ffffff","expression":{"interpolated":true,"parameters":["zoom"]},"transition":true},"intensity":{"type":"number","default":0.5,"minimum":0,"maximum":1,"expression":{"interpolated":true,"parameters":["zoom"]},"transition":true}},"iconsets":{"*":{"type":"iconset"}},"iconset":["iconset_sprite","iconset_source"],"iconset_sprite":{"type":{"type":"enum","values":{"sprite":1}},"url":{"type":"string"}},"iconset_source":{"type":{"type":"enum","values":{"source":1}}
588,"source":{"type":"string"}},"sources":{"*":{"type":"source"}},"source":["source_vector","source_raster","source_raster_dem","source_raster_array","source_geojson","source_video","source_image","source_model"],"source_vector":{"type":{"type":"enum","values":{"vector":1}},"url":{"type":"string"},"tiles":{"type":"array","value":"string"},"bounds":{"type":"array","value":"number","length":4,"default":[-180,-85.051129,180,85.051129]},"extra_bounds":{"type":"array","value":{"type":"array","value":"number","length":4}},"scheme":{"type":"enum","values":{"xyz":1,"tms":1},"default":"xyz"},"minzoom":{"type":"number","default":0},"maxzoom":{"type":"number","default":22},"attribution":{"type":"string"},"promoteId":{"type":"promoteId"},"volatile":{"type":"boolean","default":false},"*":{"type":"*"}},"source_raster":{"type":{"type":"enum","values":{"raster":1}},"url":{"type":"string"},"tiles":{"type":"array","value":"string"},"bounds":{"type":"array","value":"number","length":4,"default":[-180,-85.051129,180,85.051129]},"extra_bounds":{"type":"array","value":{"type":"array","value":"number","length":4}},"minzoom":{"type":"number","default":0},"maxzoom":{"type":"number","default":22},"tileSize":{"type":"number","default":512},"scheme":{"type":"enum","values":{"xyz":1,"tms":1},"default":"xyz"},"attribution":{"type":"string"},"volatile":{"type":"boolean","default":false},"*":{"type":"*"}},"source_raster_dem":{"type":{"type":"enum","values":{"raster-dem":1}},"url":{"type":"string"},"tiles":{"type":"array","value":"string"},"bounds":{"type":"array","value":"number","length":4,"default":[-180,-85.051129,180,85.051129]},"extra_bounds":{"type":"array","value":{"type":"array","value":"number","length":4}},"minzoom":{"type":"number","default":0},"maxzoom":{"type":"number","default":22},"tileSize":{"type":"number","default":512},"attribution":{"type":"string"},"encoding":{"type":"enum","values":{"terrarium":1,"mapbox":1},"default":"mapbox"},"volatile":{"type":"boolean","default":false},"*":{"type":"*"}},"source_raster_array":{"type":{"type":"enum","values":{"raster-array":1}},"url":{"type":"string"},"tiles":{"type":"array","value":"string"},"bounds":{"type":"array","value":"number","length":4,"default":[-180,-85.051129,180,85.051129]},"extra_bounds":{"type":"array","value":{"type":"array","value":"number","length":4}},"minzoom":{"type":"number","default":0},"maxzoom":{"type":"number","default":22},"tileSize":{"type":"number","default":512},"attribution":{"type":"string"},"rasterLayers":{"type":"*"},"volatile":{"type":"boolean","default":false},"*":{"type":"*"}},"source_geojson":{"type":{"type":"enum","values":{"geojson":1}},"data":{"type":"*"},"maxzoom":{"type":"number","default":18},"minzoom":{"type":"number","default":0},"attribution":{"type":"string"},"buffer":{"type":"number","default":128,"maximum":512,"minimum":0},"filter":{"type":"*"},"tolerance":{"type":"number","default":0.375},"cluster":{"type":"boolean","default":false},"clusterRadius":{"type":"number","default":50,"minimum":0},"clusterMaxZoom":{"type":"number"},"clusterMinPoints":{"type":"number"},"clusterProperties":{"type":"*"},"lineMetrics":{"type":"boolean","default":false},"generateId":{"type":"boolean","default":false},"promoteId":{"type":"promoteId"},"dynamic":{"type":"boolean","default":false}},"source_video":{"type":{"type":"enum","values":{"video":1}},"urls":{"type":"array","value":"string"},"coordinates":{"type":"array","length":4,"value":{"type":"array","length":2,"value":"number"}}},"source_image":{"type":{"type":"enum","values":{"image":1}},"url":{"type":"string"},"coordinates":{"type":"array","length":4,"value":{"type":"array","length":2,"value":"number"}}},"source_model":{"type":{"type":"enum","values":{"model":1,"batched-model":1}},"maxzoom":{"type":"number","default":18},"minzoom":{"type":"number","default":0},"tiles":{"type":"array","value":"string"}},"layer":{"id":{"type":"string"},"type":{"type":"enum","values":{"fill":{},"line":{},"symbol":{},"circle":{},"heatmap":{},"fill-extrusion":{},"building":{},"raster":{},"raster-particle":{},"hillshade":{},"model":{},"background":{},"sky":{},"slot":{},"clip":{}}},"metadata":{"type":"*"},"source":{"type":"string"},"source-layer":{"type":"string"},"slot":{"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_clip","layout_fill","layout_line","layout_circle","layout_heatmap","layout_fill-extrusion","layout_building","layout_symbol","layout_raster","layout_raster-particle","layout_hillshade","layout_background","layout_sky","layout_model"],"layout_background":{"visibility":{"type":"enum","values":{"visible":1,"none":1},"default":"visible","expression":{}}},"layout_sky":{"visibility":{"type":"enum","values":{"visible":1,"none":1},"default":"visible","expression":{}}},"layout_model":{"visibility":{"type":"enum","values":{"visible":1,"none":1},"default":"visible","expression":{}},"model-id":{"type":"string","default":"","property-type":"data-driven","expression":{"parameters":["zoom","feature"]}}},"layout_clip":{"clip-layer-types":{"type":"array","value":"enum","values":{"model":1,"symbol":1},"default":[],"expression":{}},"clip-layer-scope":{"type":"array","value":"string","default":[],"expression":{}}},"layout_fill":{"fill-sort-key":{"type":"number","expression":{"parameters":["zoom","feature"]},"property-type":"data-driven"},"visibility":{"type":"enum","values":{"visible":1,"none":1},"default":"visible","expression":{}},"fill-elevation-reference":{"type":"enum","values":{"none":1,"hd-road-base":1,"hd-road-markup":1},"default":"none","expression":{}},"fill-construct-bridge-guard-rail":{"type":"boolean","default":"true","expression":{"parameters":["zoom","feature"]},"property-type":"data-driven"}},"layout_circle":{"circle-sort-key":{"type":"number","expression":{"parameters":["zoom","feature"]},"property-type":"data-driven"},"circle-elevation-reference":{"type":"enum","values":{"none":1,"hd-road-markup":1},"default":"none","expression":{}},"visibility":{"type":"enum","values":{"visible":1,"none":1},"default":"visible","expression":{}}},"layout_heatmap":{"visibility":{"type":"enum","values":{"visible":1,"none":1},"default":"visible","expression":{}}},"layout_fill-extrusion":{"visibility":{"type":"enum","values":{"visible":1,"none":1},"default":"visible","expression":{}},"fill-extrusion-edge-radius":{"type":"number","default":0,"minimum":0,"maximum":1,"expression":{}}},"layout_building":{"visibility":{"type":"enum","values":{"visible":1,"none":1},"default":"visible","expression":{}},"building-roof-shape":{"type":"enum","values":{"flat":1,"hipped":1,"gabled":1,"parapet":1,"mansard":1,"skillion":1,"pyramidal":1},"default":"flat","expression":{"parameters":["feature"]},"property-type":"data-driven"},"building-height":{"type":"number","default":0,"minimum":0,"transition":true,"expression":{},"property-type":"data-driven"},"building-base":{"type":"number","default":0,"minimum":0,"transition":true,"expression":{},"property-type":"data-driven"}},"layout_line":{"line-cap":{"type":"enum","values":{"butt":1,"round":1,"square":1},"default":"butt","expression":{"parameters":["zoom","feature"]},"property-type":"data-driven"},"line-join":{"type":"enum","values":{"bevel":1,"round":1,"miter":1,"none":1},"default":"miter","expression":{"parameters":["zoom","feature"]},"property-type":"data-driven"},"line-miter-limit":{"type":"number","default":2,"expression":{"interpolated":true,"parameters":["zoom"]}},"line-round-limit":{"type":"number","default":1.05,"expression":{"interpolated":true,"parameters":["zoom"]}},"line-sort-key":{"type":"number","expression":{"parameters":["zoom","feature"]},"property-type":"data-driven"},"line-z-offset":{"type":"number","default":0,"expression":{"parameters":["zoom","feature","line-progress"]},"property-type":"data-driven"},"line-elevation-reference":{"type":"enum","values":{"none":1,"sea":1,"ground":1,"hd-road-markup":1},"default":"none","expression":{}},"line-cross-slope":{"type":"number","expression":{}},"visibility":{"type":"enum","values":{"visible":1,"none":1},"default":"visible","expression":{}},"line-width-unit":{"type":"enum","values":{"pixels":1,"meters":1},"default":"pixels","expression":{"parameters":["zoom"]}}},"layout_symbol":{"symbol-placement":{"type":"enum","values":{"point":1,"line":1,"line-center":1},"default":"point","expression":{"parameters":["zoom"]}},"symbol-spacing":{"type":"number","default":250,"minimum":1,"expression":{"interpolated":true,"parameters":["zoom"]}},"symbol-avoid-edges":{"type":"boolean","default":false,"expression":{"parameters":["zoom"]}},"symbol-sort-key":{"type":"number","expression":{"parameters":["zoom","feature"]},"property-type":"data-driven"},"symbol-z-order":{"type":"enum","values":{"auto":1,"viewport-y":1,"source":1},"default":"auto","expression":{"parameters":["zoom"]}},"symbol-z-elevate":{"type":"boolean","default":false,"expression":{"parameters":["zoom"]}},"symbol-elevation-reference":{"type":"enum","values":{"sea":1,"ground":1,"hd-road-markup":1},"default":"ground","expression":{"parameters":["zoom"]}},"icon-allow-overlap":{"type":"boolean","default":false,"expression":{"parameters":["zoom"]}},"icon-ignore-placement":{"type":"boolean","default":false,"expression":{"parameters":["zoom"]}},"icon-optional":{"type":"boolean","default":false,"expression":{"parameters":["zoom"]}},"icon-rotation-alignment":{"type":"enum","values":{"map":1,"viewport":1,"auto":1},"default":"auto","expression":{"parameters":["zoom"]}},"icon-size":{"type":"number","default":1,"minimum":0,"expression":{"interpolated":true,"parameters":["zoom","feature"]},"property-type":"data-driven"},"icon-size-scale-range":{"type":"array","value":"number","length":2,"default":[0.8,2],"minimum":0.1,"maximum":10,"expression":{}},"icon-text-fit":{"type":"enum","values":{"none":1,"width":1,"height":1,"both":1},"default":"none","expression":{"parameters":["zoom","feature"]},"property-type":"data-driven"},"icon-text-fit-padding":{"type":"array","value":"number","length":4,"default":[0,0,0,0],"expression":{"interpolated":true,"parameters":["zoom","feature"]},"property-type":"data-driven"},"icon-image":{"type":"resolvedImage","tokens":true,"expression":{"parameters":["zoom","feature"]},"property-type":"data-driven"},"icon-rotate":{"type":"number","default":0,"period":360,"expression":{"interpolated":true,"parameters":["zoom","feature"]},"property-type":"data-driven"},"icon-padding":{"type":"number","default":2,"minimum":0,"expression":{"interpolated":true,"parameters":["zoom"]}},"icon-keep-upright":{"type":"boolean","default":false,"expression":{"parameters":["zoom"]}},"icon-offset":{"type":"array","value":"number","length":2,"default":[0,0],"expression":{"interpolated":true,"parameters":["zoom","feature"]},"property-type":"data-driven"}
588,"icon-anchor":{"type":"enum","values":{"center":1,"left":1,"right":1,"top":1,"bottom":1,"top-left":1,"top-right":1,"bottom-left":1,"bottom-right":1},"default":"center","expression":{"parameters":["zoom","feature"]},"property-type":"data-driven"},"icon-pitch-alignment":{"type":"enum","values":{"map":1,"viewport":1,"auto":1},"default":"auto","expression":{"parameters":["zoom"]}},"text-pitch-alignment":{"type":"enum","values":{"map":1,"viewport":1,"auto":1},"default":"auto","expression":{"parameters":["zoom"]}},"text-rotation-alignment":{"type":"enum","values":{"map":1,"viewport":1,"auto":1},"default":"auto","expression":{"parameters":["zoom"]}},"text-field":{"type":"formatted","default":"","tokens":true,"expression":{"parameters":["zoom","feature"]},"property-type":"data-driven"},"text-font":{"type":"array","value":"string","default":["Open Sans Regular","Arial Unicode MS Regular"],"expression":{"parameters":["zoom","feature"]},"property-type":"data-driven"},"text-size":{"type":"number","default":16,"minimum":0,"expression":{"interpolated":true,"parameters":["zoom","feature"]},"property-type":"data-driven"},"text-size-scale-range":{"type":"array","value":"number","length":2,"default":[0.8,2],"minimum":0.1,"maximum":10,"expression":{}},"text-max-width":{"type":"number","default":10,"minimum":0,"expression":{"interpolated":true,"parameters":["zoom","feature"]},"property-type":"data-driven"},"text-line-height":{"type":"number","default":1.2,"expression":{"interpolated":true,"parameters":["zoom","feature"]},"property-type":"data-driven"},"text-letter-spacing":{"type":"number","default":0,"expression":{"interpolated":true,"parameters":["zoom","feature"]},"property-type":"data-driven"},"text-justify":{"type":"enum","values":{"auto":1,"left":1,"center":1,"right":1},"default":"center","expression":{"parameters":["zoom","feature"]},"property-type":"data-driven"},"text-radial-offset":{"type":"number","default":0,"property-type":"data-driven","expression":{"interpolated":true,"parameters":["zoom","feature"]}},"text-variable-anchor":{"type":"array","value":"enum","values":{"center":1,"left":1,"right":1,"top":1,"bottom":1,"top-left":1,"top-right":1,"bottom-left":1,"bottom-right":1},"expression":{"parameters":["zoom"]}},"text-anchor":{"type":"enum","values":{"center":1,"left":1,"right":1,"top":1,"bottom":1,"top-left":1,"top-right":1,"bottom-left":1,"bottom-right":1},"default":"center","expression":{"parameters":["zoom","feature"]},"property-type":"data-driven"},"text-max-angle":{"type":"number","default":45,"expression":{"interpolated":true,"parameters":["zoom"]}},"text-writing-mode":{"type":"array","value":"enum","values":{"horizontal":1,"vertical":1},"expression":{"parameters":["zoom"]}},"text-rotate":{"type":"number","default":0,"period":360,"expression":{"interpolated":true,"parameters":["zoom","feature"]},"property-type":"data-driven"},"text-padding":{"type":"number","default":2,"minimum":0,"expression":{"interpolated":true,"parameters":["zoom"]}},"text-keep-upright":{"type":"boolean","default":true,"expression":{"parameters":["zoom"]}},"text-transform":{"type":"enum","values":{"none":1,"uppercase":1,"lowercase":1},"default":"none","expression":{"parameters":["zoom","feature"]},"property-type":"data-driven"},"text-offset":{"type":"array","value":"number","length":2,"default":[0,0],"expression":{"interpolated":true,"parameters":["zoom","feature"]},"property-type":"data-driven"},"text-allow-overlap":{"type":"boolean","default":false,"expression":{"parameters":["zoom"]}},"text-ignore-placement":{"type":"boolean","default":false,"expression":{"parameters":["zoom"]}},"text-optional":{"type":"boolean","default":false,"expression":{"parameters":["zoom"]}},"visibility":{"type":"enum","values":{"visible":1,"none":1},"default":"visible","expression":{}}},"layout_raster":{"visibility":{"type":"enum","values":{"visible":1,"none":1},"default":"visible","expression":{}}},"layout_raster-particle":{"visibility":{"type":"enum","values":{"visible":1,"none":1},"default":"visible","expression":{}}},"layout_hillshade":{"visibility":{"type":"enum","values":{"visible":1,"none":1},"default":"visible","expression":{}}},"filter":{"type":"array","value":"*"},"filter_symbol":{"type":"boolean","default":false,"property-type":"data-driven","expression":{"parameters":["zoom","feature","pitch","distance-from-center"]}},"filter_fill":{"type":"boolean","default":false,"property-type":"data-driven","expression":{"parameters":["zoom","feature"]}},"filter_hillshade":{"type":"boolean","default":false,"property-type":"data-driven","expression":{"parameters":["zoom","feature"]}},"filter_raster":{"type":"boolean","default":false,"property-type":"data-driven","expression":{"parameters":["zoom","feature"]}},"filter_raster-particle":{"type":"boolean","default":false,"property-type":"data-driven","expression":{"parameters":["zoom","feature"]}},"filter_clip":{"type":"boolean","default":false,"property-type":"data-driven","expression":{"parameters":["zoom","feature"]}},"filter_model":{"type":"boolean","default":false,"property-type":"data-driven","expression":{"parameters":["zoom","feature"]}},"filter_line":{"type":"boolean","default":false,"property-type":"data-driven","expression":{"parameters":["zoom","feature"]}},"filter_circle":{"type":"boolean","default":false,"property-type":"data-driven","expression":{"parameters":["zoom","feature"]}},"filter_fill-extrusion":{"type":"boolean","default":false,"property-type":"data-driven","expression":{"parameters":["zoom","feature"]}},"filter_building":{"type":"boolean","default":false,"property-type":"data-driven","expression":{"parameters":["zoom","feature"]}},"filter_heatmap":{"type":"boolean","default":false,"property-type":"data-driven","expression":{"parameters":["zoom","feature"]}},"filter_operator":{"type":"enum","values":{"==":1,"!=":1,">":1,">=":1,"<":1,"<=":1,"in":1,"!in":1,"all":1,"any":1,"none":1,"has":1,"!has":1}},"geometry_type":{"type":"enum","values":{"Point":1,"LineString":1,"Polygon":1}},"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":1,"exponential":1,"interval":1,"categorical":1},"default":"exponential"},"colorSpace":{"type":"enum","values":{"rgb":1,"lab":1,"hcl":1},"default":"rgb"},"default":{"type":"*"}},"function_stop":{"type":"array","minimum":0,"maximum":24,"value":["number","color"],"length":2},"expression":{"type":"array","value":"*","minimum":1},"fog":{"range":{"type":"array","default":[0.5,10],"minimum":-20,"maximum":20,"length":2,"value":"number","transition":true,"expression":{"interpolated":true,"parameters":["zoom","measure-light"],"relaxZoomRestriction":true}},"color":{"type":"color","default":"#ffffff","expression":{"interpolated":true,"parameters":["zoom","measure-light"],"relaxZoomRestriction":true},"transition":true},"high-color":{"type":"color","default":"#245cdf","expression":{"interpolated":true,"parameters":["zoom","measure-light"],"relaxZoomRestriction":true},"transition":true},"space-color":{"type":"color","default":["interpolate",["linear"],["zoom"],4,"#010b19",7,"#367ab9"],"expression":{"interpolated":true,"parameters":["zoom","measure-light"],"relaxZoomRestriction":true},"transition":true},"horizon-blend":{"type":"number","default":["interpolate",["linear"],["zoom"],4,0.2,7,0.1],"minimum":0,"maximum":1,"expression":{"interpolated":true,"parameters":["zoom","measure-light"],"relaxZoomRestriction":true},"transition":true},"star-intensity":{"type":"number","default":["interpolate",["linear"],["zoom"],5,0.35,6,0],"minimum":0,"maximum":1,"expression":{"interpolated":true,"parameters":["zoom","measure-light"],"relaxZoomRestriction":true},"transition":true},"vertical-range":{"type":"array","default":[0,0],"minimum":0,"length":2,"value":"number","transition":true,"expression":{"interpolated":true,"parameters":["zoom","measure-light"],"relaxZoomRestriction":true}}},"snow":{"density":{"type":"number","default":["interpolate",["linear"],["zoom"],11,0,13,0.85],"minimum":0,"maximum":1,"expression":{"interpolated":true,"parameters":["zoom","measure-light"],"relaxZoomRestriction":true},"transition":true},"intensity":{"type":"number","default":1,"minimum":0,"maximum":1,"expression":{"interpolated":true,"parameters":["zoom","measure-light"],"relaxZoomRestriction":true},"transition":true},"color":{"type":"color","default":"#ffffff","expression":{"interpolated":true,"parameters":["zoom","measure-light"],"relaxZoomRestriction":true},"transition":true},"opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"expression":{"interpolated":true,"parameters":["zoom","measure-light"],"relaxZoomRestriction":true},"transition":true},"vignette":{"type":"number","default":["interpolate",["linear"],["zoom"],11,0,13,0.3],"minimum":0,"maximum":1,"expression":{"interpolated":true,"parameters":["zoom","measure-light"],"relaxZoomRestriction":true},"transition":true},"vignette-color":{"type":"color","default":"#ffffff","expression":{"interpolated":true,"parameters":["zoom","measure-light"],"relaxZoomRestriction":true},"transition":true},"center-thinning":{"type":"number","default":0.4,"minimum":0,"maximum":1,"expression":{"interpolated":true,"parameters":["zoom","measure-light"],"relaxZoomRestriction":true},"transition":true},"direction":{"type":"array","default":[0,50],"minimum":0,"maximum":360,"length":2,"value":"number","transition":true,"expression":{"interpolated":true,"parameters":["zoom","measure-light"],"relaxZoomRestriction":true}},"flake-size":{"type":"number","default":0.71,"minimum":0,"maximum":5,"expression":{"interpolated":true,"parameters":["zoom","measure-light"],"relaxZoomRestriction":true},"transition":true}},"rain":{"density":{"type":"number","default":["interpolate",["linear"],["zoom"],11,0,13,0.5],"minimum":0,"maximum":1,"expression":{"interpolated":true,"parameters":["zoom","measure-light"],"relaxZoomRestriction":true},"transition":true},"intensity":{"type":"number","default":1,"minimum":0,"maximum":1,"expression":{"interpolated":true,"parameters":["zoom","measure-light"],"relaxZoomRestriction":true},"transition":true},"color":{"type":"color","default":["interpolate",["linear"],["measure-light","brightness"],0,"#03113d",0.3,"#a8adbc"],"expression":{"interpolated":true,"parameters":["zoom","measure-light"],"relaxZoomRestriction":true},"transition":true},"opacity":{"type":"number","default":["interpolate",["linear"],["measure-light","brightness"],0,0.88,1,0.7],"minimum":0,"maximum":1,"expression":{"interpolated":true,"parameters":["zoom","measure-light"],"relaxZoomRestriction":true},"transition":true},"vignette":{"type":"number","default":["interpolate",["linear"],["zoom"],11,0,13,1],"minimum":0,"maximum":1,"expression":{"interpolated":true,"parameters":["zoom","measure-light"],"relaxZoomRestriction":true},"transition":true},"vignette-color":{"type":"color","default":["interpolate",["linear"],["measure-light","brightness"],0,"#001736",0.3,"#464646"],"expression":{"interpolated":true,"parameters":["zoom","measure-light"],"relaxZoomRestriction":true},"transition":true},"center-thinning":{"type":"number","default":0.57,"minimum":0,"maximum":1,"expression":{"interpolated":true,"parameters":["zoom","measure-light"],"relaxZoomRestriction":true},"transition":true},"direction":{"type":"array","default":[0,80],"minimum":0,"maximum":360,"length":2,"value":"number","transition":true,"expression":{"interpolated":true,"parameters":["zoom","measure-light"],"relaxZoomRestriction":true}},"droplet-size":{"type":"array","default":[2.6,18.2],"minimum":0,"maximum":50,"length":2,"value":"number","transition":true,"expression":{"interpolated":true,"parameters":["zoom","measure-light"],"relaxZoomRestriction":true}},"distortion-strength":{"type":"number","default":0.7,"minimum":0,"maximum":1,"expression":{"interpolated":true,"parameters":["zoom","measure-light"],"relaxZoomRestriction":true},"transition":true}},"camera":{"camera-projection":{"type":"enum","values":{"perspective":1,"orthographic":1},"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"default":"perspective"}},"colorTheme":{"data":{"type":"string","expression":{}}},"indoor":{"floorplanFeaturesetId":{"type":"string","expression":{}},"buildingFeaturesetId":{"type":"string","expression":{}}},"light":{"anchor":{"type":"enum","default":"viewport","values":{"map":1,"viewport":1},"expression":{"parameters":["zoom"]}},"position":{"type":"array","default":[1.15,210,30],"length":3,"value":"number","transition":true,"expression":{"interpolated":true,"parameters":["zoom"]}},"color":{"type":"color","default":"#ffffff","expression":{"interpolated":true,"parameters":["zoom"]},"transition":true},"intensity":{"type":"number","default":0.5,"minimum":0,"maximum":1,"expression":{"interpolated":true,"parameters":["zoom"]},"transition":true}},"projection":{"name":{"type":"enum","values":{"albers":1,"equalEarth":1,"equirectangular":1,"lambertConformalConic":1,"mercator":1,"naturalEarth":1,"winkelTripel":1,"globe":1},"default":"mercator"},"center":{"type":"array","length":2,"value":"number","minimum":[-180,-90],"maximum":[180,90]},"parallels":{"type":"array","length":2,"value":"number","minimum":[-90,-90],"maximum":[90,90]}},"terrain":{"source":{"type":"string"},"exaggeration":{"type":"number","default":1,"minimum":0,"maximum":1000,"expression":{"interpolated":true,"parameters":["zoom"]},"transition":true}},"paint":["paint_fill","paint_line","paint_circle","paint_heatmap","paint_fill-extrusion","paint_building","paint_symbol","paint_raster","paint_raster-particle","paint_hillshade","paint_background","paint_sky","paint_model"],"paint_fill":{"fill-antialias":{"type":"boolean","default":true,"expression":{"parameters":["zoom"]}},"fill-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"fill-color":{"type":"color","default":"#000000","transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"fill-outline-color":{"type":"color","transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"fill-translate":{"type":"array","value":"number","length":2,"default":[0,0],"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]}},"fill-translate-anchor":{"type":"enum","values":{"map":1,"viewport":1},"default":"map","expression":{"parameters":["zoom"]}},"fill-pattern":{"type":"resolvedImage","expression":{"parameters":["zoom","feature"]},"property-type":"data-driven"},"fill-pattern-cross-fade":{"type":"number","default":0,"minimum":0,"maximum":1,"expression":{"interpolated":true,"parameters":["zoom","measure-light"]},"transition":true},"fill-emissive-strength":{"type":"number","default":0,"minimum":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","measure-light"]}},"fill-z-offset":{"type":"number","default":0,"minimum":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature"]},"property-type":"data-driven"},"fill-bridge-guard-rail-color":{"type":"color","default":"rgba(241, 236, 225, 255)","transition":true,"expression":{"interpolated":true,"parameters":["zoom","measure-light","feature"]},"property-type":"data-driven"},"fill-tunnel-structure-color":{"type":"color","default":"rgba(241, 236, 225, 255)","transition":true,"expression":{"interpolated":true,"parameters":["zoom","measure-light","feature"]},"property-type":"data-driven"}},"paint_fill-extrusion":{"fill-extrusion-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]}},"fill-extrusion-color":{"type":"color","default":"#000000","transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"fill-extrusion-translate":{"type":"array","value":"number","length":2,"default":[0,0],"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]}},"fill-extrusion-translate-anchor":{"type":"enum","values":{"map":1,"vie
588wport":1},"default":"map","expression":{"parameters":["zoom"]}},"fill-extrusion-pattern":{"type":"resolvedImage","expression":{"parameters":["zoom","feature"]},"property-type":"data-driven"},"fill-extrusion-pattern-cross-fade":{"type":"number","default":0,"minimum":0,"maximum":1,"expression":{"interpolated":true,"parameters":["zoom","measure-light"]},"transition":true},"fill-extrusion-height":{"type":"number","default":0,"minimum":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-base":{"type":"number","default":0,"minimum":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-height-alignment":{"type":"enum","values":{"terrain":1,"flat":1},"default":"flat"},"fill-extrusion-base-alignment":{"type":"enum","values":{"terrain":1,"flat":1},"default":"terrain"},"fill-extrusion-vertical-gradient":{"type":"boolean","default":true,"expression":{"parameters":["zoom"]}},"fill-extrusion-ambient-occlusion-intensity":{"type":"number","default":0,"minimum":0,"maximum":1,"expression":{"interpolated":true,"parameters":["zoom"]},"transition":true},"fill-extrusion-ambient-occlusion-radius":{"type":"number","default":3,"minimum":0,"expression":{"interpolated":true,"parameters":["zoom"]},"transition":true},"fill-extrusion-ambient-occlusion-wall-radius":{"type":"number","default":3,"minimum":0,"expression":{"interpolated":true,"parameters":["zoom"]},"transition":true},"fill-extrusion-ambient-occlusion-ground-radius":{"type":"number","default":3,"minimum":0,"expression":{"interpolated":true,"parameters":["zoom"]},"transition":true},"fill-extrusion-ambient-occlusion-ground-attenuation":{"type":"number","default":0.69,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]}},"fill-extrusion-flood-light-color":{"type":"color","default":"#ffffff","transition":true,"expression":{"interpolated":true,"parameters":["zoom","measure-light"]}},"fill-extrusion-flood-light-intensity":{"type":"number","default":0,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","measure-light"]}},"fill-extrusion-flood-light-wall-radius":{"property-type":"data-driven","type":"number","default":0,"minimum":0,"transition":true,"expression":{"interpolated":true,"parameters":["feature","feature-state"]}},"fill-extrusion-flood-light-ground-radius":{"property-type":"data-driven","type":"number","default":0,"transition":true,"expression":{"interpolated":true,"parameters":["feature","feature-state"]}},"fill-extrusion-flood-light-ground-attenuation":{"type":"number","default":0.69,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]}},"fill-extrusion-vertical-scale":{"type":"number","default":1,"minimum":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]}},"fill-extrusion-rounded-roof":{"type":"boolean","default":true,"expression":{"parameters":["zoom"]}},"fill-extrusion-cutoff-fade-range":{"type":"number","default":0,"minimum":0,"maximum":1,"expression":{}},"fill-extrusion-emissive-strength":{"type":"number","default":0,"minimum":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","measure-light","feature-state"]},"property-type":"data-driven"},"fill-extrusion-line-width":{"type":"number","default":0,"minimum":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"fill-extrusion-cast-shadows":{"type":"boolean","default":true}},"paint_building":{"building-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]}},"building-ambient-occlusion-wall-intensity":{"type":"number","default":0,"minimum":0,"maximum":1,"expression":{"interpolated":true,"parameters":["zoom"]},"transition":true},"building-ambient-occlusion-ground-intensity":{"type":"number","default":0,"minimum":0,"maximum":1,"expression":{"interpolated":true,"parameters":["zoom"]},"transition":true},"building-ambient-occlusion-ground-radius":{"type":"number","default":3,"minimum":0,"expression":{"interpolated":true,"parameters":["zoom"]},"transition":true},"building-ambient-occlusion-ground-attenuation":{"type":"number","default":0.69,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]}},"building-vertical-scale":{"type":"number","default":1,"minimum":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]}},"building-cast-shadows":{"type":"boolean","default":true},"building-color":{"type":"color","default":"rgba(193, 154, 127, 1)","expression":{"interpolated":true,"parameters":["feature","feature-state"]},"property-type":"data-driven"},"building-emissive-strength":{"type":"number","default":0,"minimum":0,"expression":{"interpolated":true,"parameters":["feature","feature-state","measure-light"]},"property-type":"data-driven"}},"paint_line":{"line-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"line-color":{"type":"color","default":"#000000","transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"line-translate":{"type":"array","value":"number","length":2,"default":[0,0],"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]}},"line-translate-anchor":{"type":"enum","values":{"map":1,"viewport":1},"default":"map","expression":{"parameters":["zoom"]}},"line-width":{"type":"number","default":1,"minimum":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light","line-progress"]},"property-type":"data-driven"},"line-gap-width":{"type":"number","default":0,"minimum":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"line-offset":{"type":"number","default":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"}
588,"line-blur":{"type":"number","default":0,"minimum":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"line-dasharray":{"type":"array","value":"number","minimum":0,"expression":{"parameters":["zoom","feature"]},"property-type":"data-driven"},"line-pattern":{"type":"resolvedImage","expression":{"parameters":["zoom","feature"]},"property-type":"data-driven"},"line-pattern-cross-fade":{"type":"number","default":0,"minimum":0,"maximum":1,"expression":{"interpolated":true,"parameters":["zoom","measure-light"]},"transition":true},"line-gradient":{"type":"color","expression":{"interpolated":true,"parameters":["line-progress"]}},"line-trim-offset":{"type":"array","value":"number","length":2,"default":[0,0],"minimum":[0,0],"maximum":[1,1]},"line-trim-fade-range":{"type":"array","value":"number","length":2,"default":[0,0],"minimum":[0,0],"maximum":[1,1],"expression":{"interpolated":true,"parameters":["zoom","measure-light"]}},"line-trim-color":{"type":"color","default":"transparent","transition":true,"expression":{"interpolated":true,"parameters":["zoom","measure-light"]}},"line-emissive-strength":{"type":"number","default":0,"minimum":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","measure-light"]}},"line-border-width":{"type":"number","default":0,"minimum":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-border-color":{"type":"color","default":"rgba(0, 0, 0, 0)","transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-occlusion-opacity":{"type":"number","default":0,"minimum":0,"maximum":1,"expression":{"interpolated":true,"parameters":["zoom"]},"transition":true}},"paint_circle":{"circle-radius":{"type":"number","default":5,"minimum":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"circle-color":{"type":"color","default":"#000000","transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"circle-blur":{"type":"number","default":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"circle-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"circle-translate":{"type":"array","value":"number","length":2,"default":[0,0],"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]}},"circle-translate-anchor":{"type":"enum","values":{"map":1,"viewport":1},"default":"map","expression":{"parameters":["zoom"]}},"circle-pitch-scale":{"type":"enum","values":{"map":1,"viewport":1},"default":"map","expression":{"parameters":["zoom"]}},"circle-pitch-alignment":{"type":"enum","values":{"map":1,"viewport":1},"default":"viewport","expression":{"parameters":["zoom"]}},"circle-stroke-width":{"type":"number","default":0,"minimum":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"circle-stroke-color":{"type":"color","default":"#000000","transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"circle-stroke-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"circle-emissive-strength":{"type":"number","default":0,"minimum":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","measure-light"]}}},"paint_heatmap":{"heatmap-radius":{"type":"number","default":30,"minimum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"heatmap-weight":{"type":"number","default":1,"minimum":0,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"heatmap-intensity":{"type":"number","default":1,"minimum":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]}},"heatmap-color":{"type":"color","default":["interpolate",["linear"],["heatmap-density"],0,"rgba(0, 0, 255, 0)",0.1,"royalblue",0.3,"cyan",0.5,"lime",0.7,"yellow",1,"red"],"expression":{"interpolated":true,"parameters":["heatmap-density"]}},"heatmap-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]}}},"paint_symbol":{"icon-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"icon-occlusion-opacity":{"type":"number","minimum":0,"maximum":1,"default":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"icon-emissive-strength":{"type":"number","default":1,"minimum":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","measure-light","feature-state"]},"property-type":"data-driven"},"text-emissive-strength":{"type":"number","default":1,"minimum":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","measure-light","feature-state"]},"property-type":"data-driven"},"icon-color":{"type":"color","default":"#000000","transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"icon-halo-color":{"type":"color","default":"rgba(0, 0, 0, 0)","transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"icon-halo-width":{"type":"number","default":0,"minimum":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"icon-halo-blur":{"type":"number","default":0,"minimum":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"icon-translate":{"type":"array","value":"number","length":2,"default":[0,0],"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]}},"icon-translate-anchor":{"type":"enum","values":{"map":1,"viewport":1},"default":"map","expression":{"parameters":["zoom"]}},"icon-image-cross-fade":{"type":"number","default":0,"minimum":0,"maximum":1,"expression":{"interpolated":true,"parameters":["zoom","measure-light"]},"transition":true},"text-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"text-occlusion-opacity":{"type":"number","minimum":0,"maximum":1,"default":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"text-color":{"type":"color","default":"#000000","transition":true,"overridable":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"text-halo-color":{"type":"color","default":"rgba(0, 0, 0, 0)","transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"text-halo-width":{"type":"number","default":0,"minimum":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"text-halo-blur":{"type":"number","default":0,"minimum":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"text-translate":{"type":"array","value":"number","length":2,"default":[0,0],"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]}},"text-translate-anchor":{"type":"enum","values":{"map":1,"viewport":1},"default":"map","expression":{"parameters":["zoom"]}},"icon-color-saturation":{"type":"number","default":0,"minimum":-1,"maximum":1,"expression":{}},"icon-color-contrast":{"type":"number","default":0,"minimum":-1,"maximum":1,"expression":{}},"icon-color-brightness-min":{"type":"number","default":0,"minimum":0,"maximum":1,"expression":{}},"icon-color-brightness-max":{"type":"number","default":1,"minimum":0,"maximum":1,"expression":{}},"symbol-z-offset":{"type":"number","default":0,"minimum":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature"]},"property-type":"data-driven"}},"paint_raster":{"raster-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]}},"raster-color":{"type":"color","expression":{"interpolated":true,"parameters":["raster-value"]}},"raster-color-mix":{"type":"array","default":[0.2126,0.7152,0.0722,0],"length":4,"value":"number","transition":true,"expression":{"interpolated":true,"parameters":["zoom"]}},"raster-color-range":{"type":"array","length":2,"value":"number","transition":true,"expression":{"interpolated":true,"parameters":["zoom"]}},"raster-hue-rotate":{"type":"number","default":0,"period":360,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]}},"raster-brightness-min":{"type":"number","default":0,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]}},"raster-brightness-max":{"type":"number","default":1,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]}},"raster-saturation":{"type":"number","default":0,"minimum":-1,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]}},"raster-contrast":{"type":"number","default":0,"minimum":-1,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]}},"raster-resampling":{"type":"enum","values":{"linear":1,"nearest":1},"default":"linear","expression":{"parameters":["zoom"]}},"raster-fade-duration":{"type":"number","default":300,"minimum":0,"expression":{"interpolated":true,"parameters":["zoom"]}},"raster-emissive-strength":{"type":"number","default":0,"minimum":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","measure-light"]}},"raster-array-band":{"type":"string"},"raster-elevation":{"type":"number","default":0,"minimum":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]}}},"paint_raster-particle":{"raster-particle-array-band":{"type":"string"},"raster-particle-count":{"type":"number","default":512,"minimum":1},"raster-particle-color":{"type":"color","expression":{"interpolated":true,"parameters":["raster-particle-speed"]}},"raster-particle-max-speed":{"type":"number","default":1,"minimum":1},"raster-particle-speed-factor":{"type":"number","default":0.2,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]}},"raster-particle-fade-opacity-factor":{"type":"number","default":0.98,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]}},"raster-particle-reset-rate-factor":{"type":"number","default":0.8,"minimum":0,"maximum":1},"raster-particle-elevation":{"type":"number","default":0,"minimum":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]}}},"paint_hillshade":{"hillshade-illumination-direction":{"type":"number","default":335,"minimum":0,"maximum":359,"expression":{"interpolated":true,"parameters":["zoom"]}},"hillshade-illumination-anchor":{"type":"enum","values":{"map":1,"viewport":1},"default":"viewport","expression":{"parameters":["zoom"]}},"hillshade-exaggeration":{"type":"number","default":0.5,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]}},"hillshade-shadow-color":{"type":"color","default":"#000000","transition":true,"expression":{"interpolated":true,"parameters":["zoom","measure-light"]}},"hillshade-highlight-color":{"type":"color","default":"#FFFFFF","transition":true,"expression":{"interpolated":true,"parameters":["zoom","measure-light"]}},"hillshade-accent-color":{"type":"color","default":"#000000","transition":true,"expression":{"interpolated":true,"parameters":["zoom","measure-light"]}},"hillshade-emissive-strength":{"type":"number","default":0,"minimum":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","measure-light"]}}},"paint_background":{"background-pitch-alignment":{"type":"enum","values":{"map":1,"viewport":1},"default":"map","expression":{"parameters":[]}},"background-color":{"type":"color","default":"#000000","transition":true,"expression":{"interpolated":true,"parameters":["zoom"]}},"background-pattern":{"type":"resolvedImage","expression":{"parameters":["zoom"]}},"background-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]}},"background-emissive-strength":{"type":"number","default":0,"minimum":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","measure-light"]}}},"paint_sky":{"sky-type":{"type":"enum","values":{"gradient":1,"atmosphere":1},"default":"atmosphere","expression":{"parameters":["zoom"]}},"sky-atmosphere-sun":{"type":"array","value":"number","length":2,"minimum":[0,0],"maximum":[360,180],"expression":{"parameters":["zoom"]}},"sky-atmosphere-sun-intensity":{"type":"number","default":10,"minimum":0,"maximum":100},"sky-gradient-center":{"type":"array","value":"number","default":[0,0],"length":2,"minimum":[0,0],"maximum":[360,180],"expression":{"parameters":["zoom"]}},"sky-gradient-radius":{"type":"number","default":90,"minimum":0,"maximum":180,"expression":{"parameters":["zoom"]}},"sky-gradient":{"type":"color","default":["interpolate",["linear"],["sky-radial-progress"],0.8,"#87ceeb",1,"white"],"expression":{"interpolated":true,"parameters":["sky-radial-progress"]}},"sky-atmosphere-halo-color":{"type":"color","default":"white"},"sky-atmosphere-color":{"type":"color","default":"white"},"sky-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]}}},"paint_model":{"model-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["feature","feature-state","zoom"]},"property-type":"data-driven"},"model-rotation":{"type":"array","value":"number","length":3,"default":[0,0,0],"period":360,"property-type":"data-driven","expression":{"interpolated":true,"parameters":["feature","feature-state","zoom"]},"transition":true},"model-scale":{"type":"array","value":"number","length":3,"default":[1,1,1],"property-type":"data-driven","expression":{"interpolated":true,"parameters":["feature","feature-state","zoom"]},"transition":true},"model-translation":{"type":"array","value":"number","length":3,"default":[0,0,0],"property-type":"data-driven","expression":{"interpolated":true,"parameters":["feature","feature-state","zoom"]},"transition":true},"model-color":{"type":"color","default":"#ffffff","property-type":"data-driven","expression":{"interpolated":true,"parameters":["feature","feature-state","measure-light","zoom"]},"transition":true},"model-color-mix-intensity":{"type":"number","property-type":"data-driven","default":0,"minimum":0,"maximum":1,"expression":{"interpolated":true,"parameters":["feature","feature-state","measure-light"]},"transition":true},"model-type":{"type":"enum","values":{"common-3d":1,"location-indicator":1},"default":"common-3d"},"model-cast-shadows":{"type":"boolean","default":true},"model-receive-shadows":{"type":"boolean","default":true}
588,"model-ambient-occlusion-intensity":{"type":"number","default":1,"minimum":0,"maximum":1,"expression":{"interpolated":true,"parameters":["zoom"]},"transition":true},"model-emissive-strength":{"type":"number","property-type":"data-driven","default":0,"minimum":0,"maximum":5,"expression":{"interpolated":true,"parameters":["feature","feature-state","measure-light"]},"transition":true},"model-roughness":{"type":"number","default":1,"minimum":0,"maximum":1,"property-type":"data-driven","expression":{"interpolated":true,"parameters":["feature","feature-state"]},"transition":true},"model-height-based-emissive-strength-multiplier":{"type":"array","default":[1,1,1,1,0],"length":5,"value":"number","property-type":"data-driven","expression":{"interpolated":true,"parameters":["feature","feature-state","measure-light"]},"transition":true},"model-cutoff-fade-range":{"type":"number","default":0,"minimum":0,"maximum":1,"expression":{}},"model-front-cutoff":{"type":"array","value":"number","expression":{"interpolated":true,"parameters":["zoom"]},"length":3,"default":[0,0,1],"minimum":[0,0,0],"maximum":[1,1,1]}},"transition":{"duration":{"type":"number","default":300,"minimum":0},"delay":{"type":"number","default":0,"minimum":0}},"promoteId":{"*":{"type":"*"}}}');function cl(a){return a instanceof Number||a instanceof String||a instanceof Boolean?a.valueOf():a}function am(a){if(Array.isArray(a))return a.map(am);if(a instanceof Object&&!(a instanceof Number||a instanceof String||a instanceof Boolean)){const e={};for(const r in a)e[r]=am(a[r]);return e}return cl(a)}function lm(a){if(a===!0||a===!1)return!0;if(!Array.isArray(a)||a.length===0)return!1;switch(a[0]){case"has":return a.length>=2&&a[1]!=="$id"&&a[1]!=="$type";case"in":return a.length>
588=3&&(typeof a[1]!="string"||Array.isArray(a[2]));case"!in":case"!has":case"none":return!1;case"==":case"!=":case">":case">=":case"<":case"<=":return a.length!==3||Array.isArray(a[1])||Array.isArray(a[2]);case"any":case"all":for(const e of a.slice(1))if(!lm(e)&&typeof e!="boolean")return!1;return!0;default:return!0}}function Og(a,e="",r=null,c="fill"){if(a==null)return{filter:()=>!0,needGeometry:!1,needFeature:!1};lm(a)||(a=cm(a));const h=a;let m=!0;try{m=function(I){if(!hd(I))return I;let M=am(I);return s0(M),M=n0(M),M}(h)}catch{console.warn(`Failed to extract static filter. Filter will continue working, but at higher memory usage and slower framerate. 589This is most likely a bug, please report this via https://github.com/mapbox/mapbox-gl-js/issues/new?assignees=&labels=&template=Bug_report.md 590and paste the contents of this message in the report. 591Thank you! 592Filter Expression: 593${JSON.stringify(h,null,2)} 594 `)}let g=null,b=null;if(c!=="background"&&c!=="sky"&&c!=="slot"){b=$e[`filter_${c}`];const I=yo(m,b,e,r);if(I.result==="error")throw new Error(I.value.map(M=>`${M.key}: ${M.message}`).join(", "));g=(M,k,B)=>I.value.evaluate(M,k,{},B)}let T=null,E=null;if(m!==h){const I=yo(h,b,e,r);if(I.result==="error")throw new Error(I.value.map(M=>`${M.key}: ${M.message}`).join(", "));T=(M,k,B,N,U)=>I.value.evaluate(M,k,{},B,void 0,void 0,N,U),E=!Hu(I.value.expression)}return{filter:g,dynamicFilter:T||void 0,needGeometry:r0(m),needFeature:!!E}}function n0(a){if(!Array.isArray(a))return a;const e=function(r){if(C1.has(r[0])){for(let c=1;c<r.length;c++)if(hd(r[c]))return!0}return r}(a);return e===!0?e:e.map(r=>n0(r))}function s0(a){let e=!1;const r=[];if(a[0]==="case"){for(let c=1;c<a.length-1;c+=2)e=e||hd(a[c]),r.push(a[c+1]);r.push(a[a.length-1])}else if(a[0]==="match"){e=e||hd(a[1]);for(let c=2;c<a.length-1;c+=2)r.push(a[c+1]);r.push(a[a.length-1])}else if(a[0]==="step"){e=e||hd(a[1]);for(let c=1;c<a.length-1;c+=2)r.push(a[c+1])}e&&(a.length=0,a.push("any",...r));for(let c=1;c<a.length;c++)s0(a[c])}function hd(a){if(!Array.isArray(a))return!1;if((e=a[0])==="pitch"||e==="distance-from-center")return!0;var e;for(let r=1;r<a.length;r++)if(hd(a[r]))return!0;return!1}const C1=new Set(["in","==","!=",">",">=","<","<=","to-boolean"]);function I1(a,e){return a<e?-1:a>e?1:0}function r0(a){if(!Array.isArray(a))return!1;if(a[0]==="within"||a[0]==="distance")return!0;for(let e=1;e<a.length;e++)if(r0(a[e]))return!0;return!1}function cm(a){if(!a)return!0;const e=a[0];return a.length<=1?e!=="any":e==="=="?zg(a[1],a[2],"=="):e==="!="?um(zg(a[1],a[2],"==")):e==="<"||e===">"||e==="<="||e===">="?zg(a[1],a[2],e):e==="any"?(r=a.slice(1),["any"].concat(r.map(cm))):e==="all"?["all"].concat(a.slice(1).map(cm)):e==="none"?["all"].concat(a.slice(1).map(cm).map(um)):e==="in"?Fg(a[1],a.slice(2)):e==="!in"?um(Fg(a[1],a.slice(2))):e==="has"?o0(a[1]):e!=="!has"||um(o0(a[1]));var r}function zg(a,e,r){switch(a){case"$type":return[`filter-type-${r}`,e];case"$id":return[`filter-id-${r}`,e];default:return[`filter-${r}`,a,e]}}function Fg(a,e){if(e.length===0)return!1;switch(a){case"$type":return["filter-type-in",["literal",e]];case"$id":return["filter-id-in",["literal",e]];default:return e.length>200&&!e.some(r=>typeof r!=typeof e[0])?["filter-in-large",a,["literal",e.sort(I1)]]:["filter-in-small",a,["literal",e]]}}function o0(a){switch(a){case"$type":return!0;case"$id":return["filter-has-id"];default:return["filter-has",a]}}function um(a){return["!",a]}const Lf="�";function th(a,e){return e?`${a}${Lf}${e}`:a}const Bg="-transition",ou=new Set(["fill","line","background","hillshade","raster"]);class Lo extends kl{constructor(e,r,c,h,m){if(super(),this.id=e.id,this.fqid=th(this.id,c),this.type=e.type,this.scope=c,this.lut=h,this.options=m,this._featureFilter={filter:()=>!0,needGeometry:!1,needFeature:!1},this._filterCompiled=!1,this.configDependencies=new Set,e.type!=="custom"){if(this.metadata=e.metadata,this.minzoom=e.minzoom,this.maxzoom=e.maxzoom,e.type&&e.type!=="background"&&e.type!=="sky"&&e.type!=="slot"){this.source=e.source,this.sourceLayer=e["source-layer"],this.filter=e.filter;const g=yo(this.filter,$e[`filter_${e.type}`]);g.result!=="error"&&(this.configDependencies=new Set([...this.configDependencies,...g.value.configDependencies]))}if(e.slot&&(this.slot=e.slot),r.layout&&(this._unevaluatedLayout=new A1(r.layout,this.scope,m),this.configDependencies=new Set([...this.configDependencies,...this._unevaluatedLayout.configDependencies])),r.paint){this._transitionablePaint=new e0(r.paint,this.scope,m);for(const g in e.paint)this.setPaintProperty(g,e.paint[g]);for(const g in e.layout)this.setLayoutProperty(g,e.layout[g]);this.configDependencies=new Set([...this.configDependencies,...this._transitionablePaint.configDependencies]),this._transitioningPaint=this._transitionablePaint.untransitioned(),this.paint=new Qu(r.paint)}}}onAdd(e){}onRemove(e){}isDraped(e){return!this.is3D(!0)&&ou.has(this.type)}getLayoutProperty(e){return e==="visibility"?this.visibility:this._unevaluatedLayout.getValue(e)}
594setLayoutProperty(e,r){if(this.type==="custom"&&e==="visibility")return void(this.visibility=r);const c=this._unevaluatedLayout;c._properties.properties[e]&&(c.setValue(e,r),this.configDependencies=new Set([...this.configDependencies,...c.configDependencies]),e==="visibility"&&this.possiblyEvaluateVisibility())}possiblyEvaluateVisibility(){this._unevaluatedLayout._values.visibility&&(this.visibility=this._unevaluatedLayout._values.visibility.possiblyEvaluate({zoom:0}))}getPaintProperty(e){return e.endsWith(Bg)?this._transitionablePaint.getTransition(e.slice(0,-11)):this._transitionablePaint.getValue(e)}setPaintProperty(e,r){const c=this._transitionablePaint,h=c._properties.properties;if(e.endsWith(Bg)){const M=e.slice(0,-11);return h[M]&&c.setTransition(M,r||void 0),!1}if(!h[e])return!1;const m=c._values[e],g=m.value.isDataDriven(),b=m.value;c.setValue(e,r),this.configDependencies=new Set([...this.configDependencies,...c.configDependencies]),this._handleSpecialPaintPropertyUpdate(e);const T=c._values[e].value,E=T.isDataDriven(),I=e.endsWith("pattern")||e==="line-dasharray";return E||g||I||this._handleOverridablePaintPropertyUpdate(e,b,T)}_handleSpecialPaintPropertyUpdate(e){}getProgramIds(){return null}getDefaultProgramParams(e,r,c){return null}_handleOverridablePaintPropertyUpdate(e,r,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,r){this._unevaluatedLayout&&(this.layout=this._unevaluatedLayout.possiblyEvaluate(e,void 0,r)),this.paint=this._transitioningPaint.possiblyEvaluate(e,void 0,r)}
594serialize(){return Ri({id:this.id,type:this.type,slot:this.slot,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()},(e,r)=>!(e===void 0||r==="layout"&&!Object.keys(e).length||r==="paint"&&!Object.keys(e).length))}is3D(e){return!1}hasElevation(){return!1}isSky(){return!1}isTileClipped(){return!1}hasOffscreenPass(){return!1}hasShadowPass(){return!1}canCastShadows(){return!1}hasLightBeamPass(){return!1}cutoffRange(){return 0}tileCoverLift(){return 0}resize(){}isStateDependent(){for(const e in this.paint._values){const r=this.paint.get(e);if(r instanceof ud&&kn(r.property.specification)&&(r.value.kind==="source"||r.value.kind==="composite")&&r.value.isStateDependent)return!0}return!1}compileFilter(e){this._filterCompiled||(this._featureFilter=Og(this.filter,this.scope,e),this._filterCompiled=!0)}invalidateCompiledFilter(){this._filterCompiled=!1}dynamicFilter(){return this._featureFilter.dynamicFilter}dynamicFilterNeedsFeature(){return this._featureFilter.needFeature}getLayerRenderingStats(){return this._stats}resetLayerRenderingStats(e){this._stats&&(e.renderPass==="shadow"?this._stats.numRenderedVerticesInShadowPass=0:this._stats.numRenderedVerticesInTransparentPass=0)}queryRadius(e){}queryIntersectsFeature(e,r,c,h,m,g,b,T,E){}}const M1={Int8:Int8Array,Uint8:Uint8Array,Int16:Int16Array,Uint16:Uint16Array,Int32:Int32Array,Uint32:Uint32Array,Float32:Float32Array};class Rf{constructor(e,r){this._structArray=e,this._pos1=r*this.size,this._pos2=this._pos1/2,this._pos4=this._pos1/4,this._pos8=this._pos1/8}}class Ds{constructor(){this.isTransferred=!1,this.capacity=-1,this.resize(0)}static serialize(e,r){return e._trim(),r&&(e.isTransferred=!0,r.add(e.arrayBuffer)),{length:e.length,arrayBuffer:e.arrayBuffer}}static deserialize(e){const r=Object.create(this.prototype);return r.arrayBuffer=e.arrayBuffer,r.length=e.length,r.capacity=e.arrayBuffer.byteLength/r.bytesPerElement,r._refreshViews(),r}_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);const r=this.uint8;this._refreshViews(),r&&this.uint8.set(r)}}_refreshViews(){throw new Error("StructArray#_refreshViews() must be implemented by each concrete StructArray layout")}emplace(...e){throw new Error("StructArray#emplace() must be implemented by each concrete StructArray layout")}emplaceBack(...e){throw new Error("StructArray#emplaceBack() must be implemented by each concrete StructArray layout")}destroy(){this.int8=this.uint8=this.int16=this.uint16=this.int32=this.uint32=this.float32=null,this.arrayBuffer=null}}function Rn(a,e=1){let r=0,c=0;return{members:a.map(h=>{const m=M1[h.type].BYTES_PER_ELEMENT,g=r=Ng(r,Math.max(e,m)),b=h.components||1;return c=Math.max(c,m),r+=m*b,{name:h.name,type:h.type,components:b,offset:g}}),size:Ng(r,Math.max(c,e)),alignment:e}}function Ng(a,e){return Math.ceil(a/e)*e}class Ec extends Ds{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,r){const c=this.length;return this.resize(c+1),this.emplace(c,e,r)}emplace(e,r,c){const h=2*e;return this.int16[h+0]=r,this.int16[h+1]=c,e}}Ec.prototype.bytesPerElement=4,Vt(Ec,"StructArrayLayout2i4");class hm extends Ds{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,r,c){const h=this.length;return this.resize(h+1),this.emplace(h,e,r,c)}emplace(e,r,c,h){const m=3*e;return this.int16[m+0]=r,this.int16[m+1]=c,this.int16[m+2]=h,e}}hm.prototype.bytesPerElement=6,Vt(hm,"StructArrayLayout3i6");class ih extends Ds{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,r,c,h){const m=this.length;return this.resize(m+1),this.emplace(m,e,r,c,h)}emplace(e,r,c,h,m){const g=4*e;return this.int16[g+0]=r,this.int16[g+1]=c,this.int16[g+2]=h,this.int16[g+3]=m,e}}ih.prototype.bytesPerElement=8,Vt(ih,"StructArrayLayout4i8");class dd extends Ds{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e){const r=this.length;return this.resize(r+1),this.emplace(r,e)}emplace(e,r){return this.float32[1*e+0]=r,e}}dd.prototype.bytesPerElement=4,Vt(dd,"StructArrayLayout1f4");class dm extends Ds{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,r,c){const h=this.length;return this.resize(h+1),this.emplace(h,e,r,c)}emplace(e,r,c,h){const m=4*e,g=2*e;return this.int16[m+0]=r,this.int16[m+1]=c,this.float32[g+1]=h,e}}dm.prototype.bytesPerElement=8,Vt(dm,"StructArrayLayout2i1f8");class fd extends Ds{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,r,c){const h=this.length;return this.resize(h+1),this.emplace(h,e,r,c)}emplace(e,r,c,h){const m=4*e;return this.int16[m+0]=r,this.int16[m+1]=c,this.int16[m+2]=h,e}}fd.prototype.bytesPerElement=8,Vt(fd,"StructArrayLayout3i8");class Vg extends Ds{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,r,c,h,m){const g=this.length;return this.resize(g+1),this.emplace(g,e,r,c,h,m)}emplace(e,r,c,h,m,g){const b=5*e;return this.int16[b+0]=r,this.int16[b+1]=c,this.int16[b+2]=h,this.int16[b+3]=m,this.int16[b+4]=g,e}}Vg.prototype.bytesPerElement=10,Vt(Vg,"StructArrayLayout5i10");class $g extends Ds{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,r,c,h,m,g,b){const T=this.length;return this.resize(T+1),this.emplace(T,e,r,c,h,m,g,b)}emplace(e,r,c,h,m,g,b,T){const E=6*e,I=12*e,M=3*e;return this.int16[E+0]=r,this.int16[E+1]=c,this.uint8[I+4]=h,this.uint8[I+5]=m,this.uint8[I+6]=g,this.uint8[I+7]=b,this.float32[M+2]=T,e}}$g.prototype.bytesPerElement=12,Vt($g,"StructArrayLayout2i4ub1f12");class Hl extends Ds{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,r,c){const h=this.length;return this.resize(h+1),this.emplace(h,e,r,c)}emplace(e,r,c,h){const m=3*e;return this.float32[m+0]=r,this.float32[m+1]=c,this.float32[m+2]=h,e}}Hl.prototype.bytesPerElement=12,Vt(Hl,"StructArrayLayout3f12");class Ac extends Ds{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,r,c,h,m){const g=this.length;return this.resize(g+1),this.emplace(g,e,r,c,h,m)}emplace(e,r,c,h,m,g){const b=6*e,T=3*e;return this.uint16[b+0]=r,this.uint16[b+1]=c,this.uint16[b+2]=h,this.uint16[b+3]=m,this.float32[T+2]=g,e}}Ac.prototype.bytesPerElement=12,Vt(Ac,"StructArrayLayout4ui1f12");class fm extends Ds{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e,r,c,h){const m=this.length;return this.resize(m+1),this.emplace(m,e,r,c,h)}emplace(e,r,c,h,m){const g=4*e;return this.uint16[g+0]=r,this.uint16[g+1]=c,this.uint16[g+2]=h,this.uint16[g+3]=m,e}}fm.prototype.bytesPerElement=8,Vt(fm,"StructArrayLayout4ui8");class nh extends Ds{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,r,c,h,m,g){const b=this.length;return this.resize(b+1),this.emplace(b,e,r,c,h,m,g)}emplace(e,r,c,h,m,g,b){const T=6*e;return this.int16[T+0]=r,this.int16[T+1]=c,this.int16[T+2]=h,this.int16[T+3]=m,this.int16[T+4]=g,this.int16[T+5]=b,e}}nh.prototype.bytesPerElement=12,Vt(nh,"StructArrayLayout6i12");class pd extends Ds{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e,r,c,h,m,g,b,T,E,I,M,k){const B=this.length;return this.resize(B+1),this.emplace(B,e,r,c,h,m,g,b,T,E,I,M,k)}emplace(e,r,c,h,m,g,b,T,E,I,M,k,B){const N=12*e;return this.int16[N+0]=r,this.int16[N+1]=c,this.int16[N+2]=h,this.int16[N+3]=m,this.uint16[N+4]=g,this.uint16[N+5]=b,this.uint16[N+6]=T,this.uint16[N+7]=E,this.int16[N+8]=I,this.int16[N+9]=M,this.int16[N+10]=k,this.int16[N+11]=B,e}}pd.prototype.bytesPerElement=24,Vt(pd,"StructArrayLayout4i4ui4i24");class qo extends Ds{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,r,c,h,m,g){const b=this.length;return this.resize(b+1),this.emplace(b,e,r,c,h,m,g)}emplace(e,r,c,h,m,g,b){const T=10*e,E=5*e;return this.int16[T+0]=r,this.int16[T+1]=c,this.int16[T+2]=h,this.float32[E+2]=m,this.float32[E+3]=g,this.float32[E+4]=b,e}}qo.prototype.bytesPerElement=20,Vt(qo,"StructArrayLayout3i3f20");class Gl extends Ds{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,r,c,h){const m=this.length;return this.resize(m+1),this.emplace(m,e,r,c,h)}emplace(e,r,c,h,m){const g=4*e;return this.float32[g+0]=r,this.float32[g+1]=c,this.float32[g+2]=h,this.float32[g+3]=m,e}}Gl.prototype.bytesPerElement=16,Vt(Gl,"StructArrayLayout4f16");class jg extends Ds{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer)}emplaceBack(e){const r=this.length;return this.resize(r+1),this.emplace(r,e)}emplace(e,r){return this.uint32[1*e+0]=r,e}}jg.prototype.bytesPerElement=4,Vt(jg,"StructArrayLayout1ul4");class au extends Ds{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e,r){const c=this.length;return this.resize(c+1),this.emplace(c,e,r)}emplace(e,r,c){const h=2*e;return this.uint16[h+0]=r,this.uint16[h+1]=c,e}}au.prototype.bytesPerElement=4,Vt(au,"StructArrayLayout2ui4");class Ug extends Ds{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e,r,c,h,m,g,b,T,E,I,M,k,B){const N=this.length;return this.resize(N+1),this.emplace(N,e,r,c,h,m,g,b,T,E,I,M,k,B)}emplace(e,r,c,h,m,g,b,T,E,I,M,k,B,N){const U=20*e,Y=10*e;return this.int16[U+0]=r,this.int16[U+1]=c,this.int16[U+2]=h,this.int16[U+3]=m,this.int16[U+4]=g,this.float32[Y+3]=b,this.float32[Y+4]=T,this.float32[Y+5]=E,this.float32[Y+6]=I,this.int16[U+14]=M,this.uint32[Y+8]=k,this.uint16[U+18]=B,this.uint16[U+19]=N,e}}Ug.prototype.bytesPerElement=40,Vt(Ug,"StructArrayLayout5i4f1i1ul2ui40");class pm extends Ds{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,r,c,h,m,g,b){const T=this.length;return this.resize(T+1),this.emplace(T,e,r,c,h,m,g,b)}emplace(e,r,c,h,m,g,b,T){const E=8*e;return this.int16[E+0]=r,this.int16[E+1]=c,this.int16[E+2]=h,this.int16[E+4]=m,this.int16[E+5]=g,this.int16[E+6]=b,this.int16[E+7]=T,e}}pm.prototype.bytesPerElement=16,Vt(pm,"StructArrayLayout3i2i2i16");class Of extends Ds{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,r,c,h,m){const g=this.length;return this.resize(g+1),this.emplace(g,e,r,c,h,m)}emplace(e,r,c,h,m,g){const b=4*e,T=8*e;return this.float32[b+0]=r,this.float32[b+1]=c,this.float32[b+2]=h,this.int16[T+6]=m,this.int16[T+7]=g,e}}Of.prototype.bytesPerElement=16,Vt(Of,"StructArrayLayout2f1f2i16");class Hg extends Ds{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,r,c,h,m,g){const b=this.length;return this.resize(b+1),this.emplace(b,e,r,c,h,m,g)}emplace(e,r,c,h,m,g,b){const T=20*e,E=5*e;return this.uint8[T+0]=r,this.uint8[T+1]=c,this.float32[E+1]=h,this.float32[E+2]=m,this.float32[E+3]=g,this.float32[E+4]=b,e}}Hg.prototype.bytesPerElement=20,Vt(Hg,"StructArrayLayout2ub4f20");class Vr extends Ds{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e,r,c){const h=this.length;return this.resize(h+1),this.emplace(h,e,r,c)}emplace(e,r,c,h){const m=3*e;return this.uint16[m+0]=r,this.uint16[m+1]=c,this.uint16[m+2]=h,e}}Vr.prototype.bytesPerElement=6,Vt(Vr,"StructArrayLayout3ui6");class Gg extends Ds{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer)}emplaceBack(e,r,c,h,m,g,b,T,E,I,M,k,B,N,U,Y,J,ae,ne,G,te){const oe=this.length;return this.resize(oe+1),this.emplace(oe,e,r,c,h,m,g,b,T,E,I,M,k,B,N,U,Y,J,ae,ne,G,te)}emplace(e,r,c,h,m,g,b,T,E,I,M,k,B,N,U,Y,J,ae,ne,G,te,oe){const he=30*e,Te=15*e,Me=60*e;return this.int16[he+0]=r,this.int16[he+1]=c,this.int16[he+2]=h,this.float32[Te+2]=m,this.float32[Te+3]=g,this.uint16[he+8]=b,this.uint16[he+9]=T,this.uint32[Te+5]=E,this.uint32[Te+6]=I,this.uint32[Te+7]=M,this.uint16[he+16]=k,this.uint16[he+17]=B,this.uint16[he+18]=N,this.float32[Te+10]=U,this.float32[Te+11]=Y,this.uint8[Me+48]=J,this.uint8[Me+49]=ae,this.uint8[Me+50]=ne,this.uint32[Te+13]=G,this.int16[he+28]=te,this.uint8[Me+58]=oe,e}}Gg.prototype.bytesPerElement=60,Vt(Gg,"StructArrayLayout3i2f2ui3ul3ui2f3ub1ul1i1ub60");class Wg extends Ds{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer)}emplaceBack(e,r,c,h,m,g,b,T,E,I,M,k,B,N,U,Y,J,ae,ne,G,te,oe,he,Te,Me,Pe,ze,tt,mt,ut,pt,bt,Ye){const ft
vendor: 12,682 bytes, line 594
594=this.length;return this.resize(ft+1),this.emplace(ft,e,r,c,h,m,g,b,T,E,I,M,k,B,N,U,Y,J,ae,ne,G,te,oe,he,Te,Me,Pe,ze,tt,mt,ut,pt,bt,Ye)}emplace(e,r,c,h,m,g,b,T,E,I,M,k,B,N,U,Y,J,ae,ne,G,te,oe,he,Te,Me,Pe,ze,tt,mt,ut,pt,bt,Ye,ft){const qe=20*e,et=40*e,Tt=80*e;return this.float32[qe+0]=r,this.float32[qe+1]=c,this.int16[et+4]=h,this.int16[et+5]=m,this.int16[et+6]=g,this.int16[et+7]=b,this.int16[et+8]=T,this.int16[et+9]=E,this.int16[et+10]=I,this.int16[et+11]=M,this.int16[et+12]=k,this.uint16[et+13]=B,this.uint16[et+14]=N,this.uint16[et+15]=U,this.uint16[et+16]=Y,this.uint16[et+17]=J,this.uint16[et+18]=ae,this.uint16[et+19]=ne,this.uint16[et+20]=G,this.uint16[et+21]=te,this.uint16[et+22]=oe,this.uint16[et+23]=he,this.uint16[et+24]=Te,this.uint16[et+25]=Me,this.uint16[et+26]=Pe,this.uint16[et+27]=ze,this.uint32[qe+14]=tt,this.float32[qe+15]=mt,this.float32[qe+16]=ut,this.float32[qe+17]=pt,this.float32[qe+18]=bt,this.uint8[Tt+76]=Ye,this.uint16[et+39]=ft,e}}Wg.prototype.bytesPerElement=80,Vt(Wg,"StructArrayLayout2f9i15ui1ul4f1ub1ui80");class lu extends Ds{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,r,c,h,m){const g=this.length;return this.resize(g+1),this.emplace(g,e,r,c,h,m)}emplace(e,r,c,h,m,g){const b=5*e;return this.float32[b+0]=r,this.float32[b+1]=c,this.float32[b+2]=h,this.float32[b+3]=m,this.float32[b+4]=g,e}}lu.prototype.bytesPerElement=20,Vt(lu,"StructArrayLayout5f20");class zf extends Ds{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,r,c,h,m,g,b){const T=this.length;return this.resize(T+1),this.emplace(T,e,r,c,h,m,g,b)}emplace(e,r,c,h,m,g,b,T){const E=7*e;return this.float32[E+0]=r,this.float32[E+1]=c,this.float32[E+2]=h,this.float32[E+3]=m,this.float32[E+4]=g,this.float32[E+5]=b,this.float32[E+6]=T,e}}zf.prototype.bytesPerElement=28,Vt(zf,"StructArrayLayout7f28");class qg extends Ds{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,r,c,h,m,g,b,T,E,I,M){const k=this.length;return this.resize(k+1),this.emplace(k,e,r,c,h,m,g,b,T,E,I,M)}emplace(e,r,c,h,m,g,b,T,E,I,M,k){const B=11*e;return this.float32[B+0]=r,this.float32[B+1]=c,this.float32[B+2]=h,this.float32[B+3]=m,this.float32[B+4]=g,this.float32[B+5]=b,this.float32[B+6]=T,this.float32[B+7]=E,this.float32[B+8]=I,this.float32[B+9]=M,this.float32[B+10]=k,e}}qg.prototype.bytesPerElement=44,Vt(qg,"StructArrayLayout11f44");class mm extends Ds{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,r,c,h,m,g,b,T,E){const I=this.length;return this.resize(I+1),this.emplace(I,e,r,c,h,m,g,b,T,E)}emplace(e,r,c,h,m,g,b,T,E,I){const M=9*e;return this.float32[M+0]=r,this.float32[M+1]=c,this.float32[M+2]=h,this.float32[M+3]=m,this.float32[M+4]=g,this.float32[M+5]=b,this.float32[M+6]=T,this.float32[M+7]=E,this.float32[M+8]=I,e}}mm.prototype.bytesPerElement=36,Vt(mm,"StructArrayLayout9f36");class sh extends Ds{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,r){const c=this.length;return this.resize(c+1),this.emplace(c,e,r)}emplace(e,r,c){const h=2*e;return this.float32[h+0]=r,this.float32[h+1]=c,e}}sh.prototype.bytesPerElement=8,Vt(sh,"StructArrayLayout2f8");class Zg extends Ds{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e,r,c,h){const m=this.length;return this.resize(m+1),this.emplace(m,e,r,c,h)}emplace(e,r,c,h,m){const g=6*e;return this.uint32[3*e+0]=r,this.uint16[g+2]=c,this.uint16[g+3]=h,this.uint16[g+4]=m,e}}Zg.prototype.bytesPerElement=12,Vt(Zg,"StructArrayLayout1ul3ui12");class Ff extends Ds{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e){const r=this.length;return this.resize(r+1),this.emplace(r,e)}emplace(e,r){return this.uint16[1*e+0]=r,e}}Ff.prototype.bytesPerElement=2,Vt(Ff,"StructArrayLayout1ui2");class md extends Ds{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,r,c,h,m,g,b,T,E,I,M,k,B,N,U,Y){const J=this.length;return this.resize(J+1),this.emplace(J,e,r,c,h,m,g,b,T,E,I,M,k,B,N,U,Y)}emplace(e,r,c,h,m,g,b,T,E,I,M,k,B,N,U,Y,J){const ae=16*e;return this.float32[ae+0]=r,this.float32[ae+1]=c,this.float32[ae+2]=h,this.float32[ae+3]=m,this.float32[ae+4]=g,this.float32[ae+5]=b,this.float32[ae+6]=T,this.float32[ae+7]=E,this.float32[ae+8]=I,this.float32[ae+9]=M,this.float32[ae+10]=k,this.float32[ae+11]=B,this.float32[ae+12]=N,this.float32[ae+13]=U,this.float32[ae+14]=Y,this.float32[ae+15]=J,e}}md.prototype.bytesPerElement=64,Vt(md,"StructArrayLayout16f64");class Bf extends Ds{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,r,c,h,m,g,b){const T=this.length;return this.resize(T+1),this.emplace(T,e,r,c,h,m,g,b)}emplace(e,r,c,h,m,g,b,T){const E=10*e,I=5*e;return this.uint16[E+0]=r,this.uint16[E+1]=c,this.uint16[E+2]=h,this.uint16[E+3]=m,this.float32[I+2]=g,this.float32[I+3]=b,this.float32[I+4]=T,e}}Bf.prototype.bytesPerElement=20,Vt(Bf,"StructArrayLayout4ui3f20");class Xg extends Ds{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e){const r=this.length;return this.resize(r+1),this.emplace(r,e)}emplace(e,r){return this.int16[1*e+0]=r,e}}Xg.prototype.bytesPerElement=2,Vt(Xg,"StructArrayLayout1i2");class gm extends Ds{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer)}emplaceBack(e){const r=this.length;return this.resize(r+1),this.emplace(r,e)}emplace(e,r){return this.uint8[1*e+0]=r,e}}gm.prototype.bytesPerElement=1,Vt(gm,"StructArrayLayout1ub1");class a0 extends Rf{get projectedAnchorX(){return this._structArray.int16[this._pos2+0]}get projectedAnchorY(){return this._structArray.int16[this._pos2+1]}get projectedAnchorZ(){return this._structArray.int16[this._pos2+2]}get tileAnchorX(){return this._structArray.int16[this._pos2+3]}get tileAnchorY(){return this._structArray.int16[this._pos2+4]}get x1(){return this._structArray.float32[this._pos4+3]}get y1(){return this._structArray.float32[this._pos4+4]}get x2(){return this._structArray.float32[this._pos4+5]}get y2(){return this._structArray.float32[this._pos4+6]}get padding(){return this._structArray.int16[this._pos2+14]}get featureIndex(){return this._structArray.uint32[this._pos4+8]}get sourceLayerIndex(){return this._structArray.uint16[this._pos2+18]}get bucketIndex(){return this._structArray.uint16[this._pos2+19]}}a0.prototype.size=40;class _m extends Ug{get(e){return new a0(this,e)}}Vt(_m,"CollisionBoxArray");class l0 extends Rf{get projectedAnchorX(){return this._structArray.int16[this._pos2+0]}get projectedAnchorY(){return this._structArray.int16[this._pos2+1]}get projectedAnchorZ(){return this._structArray.int16[this._pos2+2]}get tileAnchorX(){return this._structArray.float32[this._pos4+2]}get tileAnchorY(){return this._structArray.float32[this._pos4+3]}get glyphStartIndex(){return this._structArray.uint16[this._pos2+8]}get numGlyphs(){return this._structArray.uint16[this._pos2+9]}get vertexStartIndex(){return this._structArray.uint32[this._pos4+5]}get lineStartIndex(){return this._structArray.uint32[this._pos4+6]}get lineLength(){return this._structArray.uint32[this._pos4+7]}get segment(){return this._structArray.uint16[this._pos2+16]}get lowerSize(){return this._structArray.uint16[this._pos2+17]}get upperSize(){return this._structArray.uint16[this._pos2+18]}get lineOffsetX(){return this._structArray.float32[this._pos4+10]}get lineOffsetY(){return this._structArray.float32[this._pos4+11]}get writingMode(){return this._structArray.uint8[this._pos1+48]}get placedOrientation(){return this._structArray.uint8[this._pos1+49]}set placedOrientation(e){this._structArray.uint8[this._pos1+49]=e}get hidden(){return this._structArray.uint8[this._pos1+50]}set hidden(e){this._structArray.uint8[this._pos1+50]=e}get crossTileID(){return this._structArray.uint32[this._pos4+13]}set crossTileID(e){this._structArray.uint32[this._pos4+13]=e}get associatedIconIndex(){return this._structArray.int16[this._pos2+28]}get flipState(){return this._structArray.uint8[this._pos1+58]}set flipState(e){this._structArray.uint8[this._pos1+58]=e}}l0.prototype.size=60;class c0 extends Gg{get(e){return new l0(this,e)}}Vt(c0,"PlacedSymbolArray");class u0 extends Rf{get tileAnchorX(){return this._structArray.float32[this._pos4+0]}get tileAnchorY(){return this._structArray.float32[this._pos4+1]}get projectedAnchorX(){return this._structArray.int16[this._pos2+4]}get projectedAnchorY(){return this._structArray.int16[this._pos2+5]}get projectedAnchorZ(){return this._structArray.int16[this._pos2+6]}get rightJustifiedTextSymbolIndex(){return this._structArray.int16[this._pos2+7]}get centerJustifiedTextSymbolIndex(){return this._structArray.int16[this._pos2+8]}get leftJustifiedTextSymbolIndex(){return this._structArray.int16[this._pos2+9]}get verticalPlacedTextSymbolIndex(){return this._structArray.int16[this._pos2+10]}get placedIconSymbolIndex(){return this._structArray.int16[this._pos2+11]}get verticalPlacedIconSymbolIndex(){return this._structArray.int16[this._pos2+12]}get key(){return this._structArray.uint16[this._pos2+13]}get textBoxStartIndex(){return this._structArray.uint16[this._pos2+14]}get textBoxEndIndex(){return this._structArray.uint16[this._pos2+15]}get verticalTextBoxStartIndex(){return this._structArray.uint16[this._pos2+16]}get verticalTextBoxEndIndex(){return this._structArray.uint16[this._pos2+17]}get iconBoxStartIndex(){return this._structArray.uint16[this._pos2+18]}get iconBoxEndIndex(){return this._structArray.uint16[this._pos2+19]}get verticalIconBoxStartIndex(){return this._structArray.uint16[this._pos2+20]}get verticalIconBoxEndIndex(){return this._structArray.uint16[this._pos2+21]}get featureIndex(){return this._structArray.uint16[this._pos2+22]}get numHorizontalGlyphVertices(){return this._structArray.uint16[this._pos2+23]}get numVerticalGlyphVertices(){return this._structArray.uint16[this._pos2+24]}get numIconVertices(){return this._structArray.uint16[this._pos2+25]}get numVerticalIconVertices(){return this._structArray.uint16[this._pos2+26]}get useRuntimeCollisionCircles(){return this._structArray.uint16[this._pos2+27]}get crossTileID(){return this._structArray.uint32[this._pos4+14]}set crossTileID(e){this._structArray.uint32[this._pos4+14]=e}get textOffset0(){return this._structArray.float32[this._pos4+15]}get textOffset1(){return this._structArray.float32[this._pos4+16]}get collisionCircleDiameter(){return this._structArray.float32[this._pos4+17]}get zOffset(){return this._structArray.float32[this._pos4+18]}set zOffset(e){this._structArray.float32[this._pos4+18]=e}get hasIconTextFit(){return this._structArray.uint8[this._pos1+76]}get elevationFeatureIndex(){return this._structArray.uint16[this._pos2+39]}}u0.prototype.size=80;class h0 extends Wg{get(e){return new u0(this,e)}}Vt(h0,"SymbolInstanceArray");class Yg extends dd{getoffsetX(e){return this.float32[1*e+0]}}Vt(Yg,"GlyphOffsetArray");class d0 extends Ec{getx(e){return this.int16[2*e+0]}gety(e){return this.int16[2*e+1]}}Vt(d0,"SymbolLineVertexArray");class f0 extends Rf{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]}get layoutVertexArrayOffset(){return this._structArray.uint16[this._pos2+4]}}f0.prototype.size=12;class p0 extends Zg{get(e){return new f0(this,e)}}Vt(p0,"FeatureIndexArray");class m0 extends au{geta_centroid_pos0(e){return this.uint16[2*e+0]}geta_centroid_pos1(e){return this.uint16[2*e+1]}}Vt(m0,"FillExtrusionCentroidArray");class g0 extends Rf{get a_join_normal_inside0(){return this._structArray.int16[this._pos2+0]}get a_join_normal_inside1(){return this._structArray.int16[this._pos2+1]}get a_join_normal_inside2(){return this._structArray.int16[this._pos2+2]}}g0.prototype.size=6;class _0 extends hm{get(e){return new g0(this,e)}}Vt(_0,"FillExtrusionWallArray");const P1=Rn([{name:"a_pos",components:2,type:"Int16"}],4),D1=Rn([{name:"a_pos_3",components:3,type:"Int16"},{name:"a_pos_normal_3",components:3,type:"Int16"}]);class Vs{constructor(e=[]){this.segments=e}_prepareSegment(e,r,c,h){let m=this.segments[this.segments.length-1];return e>
594Vs.MAX_VERTEX_ARRAY_LENGTH&&Yi(`Max vertices per segment is ${Vs.MAX_VERTEX_ARRAY_LENGTH}: bucket requested ${e}`),(!m||m.vertexLength+e>Vs.MAX_VERTEX_ARRAY_LENGTH||m.sortKey!==h)&&(m={vertexOffset:r,primitiveOffset:c,vertexLength:0,primitiveLength:0},h!==void 0&&(m.sortKey=h),this.segments.push(m)),m}prepareSegment(e,r,c,h){return this._prepareSegment(e,r.length,c.length,h)}get(){return this.segments}destroy(){for(const e of this.segments)for(const r in e.vaos)e.vaos[r].destroy()}static simpleSegment(e,r,c,h){return new Vs([{vertexOffset:e,primitiveOffset:r,vertexLength:c,primitiveLength:h,vaos:{},sortKey:0}])}}function y0(a,e){return 256*(a=ke(Math.floor(a),0,255))+ke(Math.floor(e),0,255)}Vs.MAX_VERTEX_ARRAY_LENGTH=Math.pow(2,16)-1,Vt(Vs,"SegmentVector");const k1=Rn([{name:"a_pattern",components:4,type:"Uint16"},{name:"a_pixel_ratio",components:1,type:"Float32"}]),gd=Rn([{name:"a_pattern_b",components:4,type:"Uint16"},{name:"a_pixel_ratio",components:1,type:"Float32"}]),L1=Rn([{name:"a_dash",components:4,type:"Uint16"}]);class _d{constructor(){this.ids=[],this.uniqueIds=[],this.positions=[],this.indexed=!1}add(e,r,c,h){this.ids.push(v0(e)),this.positions.push(r,c,h)}eachPosition(e,r){const c=v0(e);let h=0,m=this.ids.length-1;for(;h<m;){const g=h+m>>1;this.ids[g]>=c?m=g:h=g+1}for(;this.ids[h]===c;)r(this.positions[3*h],this.positions[3*h+1],this.positions[3*h+2]),h++}static serialize(e,r){const c=new Float64Array(e.ids),h=new Uint32Array(e.positions);return ym(c,h,0,c.length-1),r&&(r.add(c.buffer),r.add(h.buffer)),{ids:c,positions:h}}static deserialize(e){const r=new _d;let c;r.ids=e.ids,r.positions=e.positions;for(const h of r.ids)h!==c&&r.uniqueIds.push(h),c=h;return r.indexed=!0,r}}function v0(a){const e=+a;return!isNaN(e)&&Number.MIN_SAFE_INTEGER<=e&&e<=Number.MAX_SAFE_INTEGER?e:uo(String(a))}function ym(a,e,r,c){for(;r<c;){const h=a[r+c>>1];let m=r-1,g=c+1;for(;;){do m++;while(a[m]<h);do g--;while(a[g]>h);if(m>=g)break;Nf(a,m,g),Nf(e,3*m,3*g),Nf(e,3*m+1,3*g+1),Nf(e,3*m+2,3*g+2)}g-r<c-g?(ym(a,e,r,g),r=g+1):(ym(a,e,g+1,c),c=g)}}function Nf(a,e,r){const c=a[e];a[e]=a[r],a[r]=c}Vt(_d,"FeaturePositionMap");class Wl{constructor(e){this.gl=e.gl,this.initialized=!1}fetchUniformLocation(e,r){return this.location||this.initialized||(this.location=this.gl.getUniformLocation(e,r),this.initialized=!0),!!this.location}set(e,r,c){throw new Error("Uniform#set() must be implemented by each concrete Uniform")}}class vm extends Wl{constructor(e){super(e),this.current=0}set(e,r,c){this.fetchUniformLocation(e,r)&&this.current!==c&&(this.current=c,this.gl.uniform1i(this.location,c))}}class cr extends Wl{constructor(e){super(e),this.current=0}set(e,r,c){this.fetchUniformLocation(e,r)&&this.current!==c&&(this.current=c,this.gl.uniform1f(this.location,c))}}class ul extends Wl{constructor(e){super(e),this.current=[0,0]}set(e,r,c){this.fetchUniformLocation(e,r)&&(c[0]===this.current[0]&&c[1]===this.current[1]||(this.current=c,this.gl.uniform2f(this.location,c[0],c[1])))}}class Vf extends Wl{constructor(e){super(e),this.current=[0,0,0]}set(e,r,c){this.fetchUniformLocation(e,r)&&(c[0]===this.current[0]&&c[1]===this.current[1]&&c[2]===this.current[2]||(this.current=c,this.gl.uniform3f(this.location,c[0],c[1],c[2])))}}class xm extends Wl{constructor(e){super(e),this.current=[0,0,0,0]}set(e,r,c){this.fetchUniformLocation(e,r)&&(c[0]===this.current[0]&&c[1]===this.current[1]&&c[2]===this.current[2]&&c[3]===this.current[3]||(this.current=c,this.gl.uniform4f(this.location,c[0],c[1],c[2],c[3])))}}class x0 extends Wl{constructor(e){super(e),this.current=Cn.transparent.toRenderColor(null)}set(e,r,c){this.fetchUniformLocation(e,r)&&(c.r===this.current.r&&c.g===this.current.g&&c.b===this.current.b&&c.a===this.current.a||(this.current=c,this.gl.uniform4f(this.location,c.r,c.g,c.b,c.a)))}}const R1=new Float32Array(16);class $f extends Wl{constructor(e){super(e),this.current=R1}set(e,r,c){if(this.fetchUniformLocation(e,r)){if(c[12]!==this.current[12]||c[0]!==this.current[0])return this.current=c,void this.gl.uniformMatrix4fv(this.location,!1,c);for(let h=1;h<16;h++)if(c[h]!==this.current[h]){this.current=c,this.gl.uniformMatrix4fv(this.location,!1,c);break}}}}const b0=new Float32Array(9),Kg=new Float32Array(4);class Va extends Wl{constructor(e){super(e),this.current=Kg}set(e,r,c){if(this.fetchUniformLocation(e,r)){for(let h=0;h<4;h++)if(c[h]!==this.current[h]){this.current=c,this.gl.uniformMatrix2fv(this.location,!1,c);break}}}}function jf(a){return[y0(255*a.r,255*a.g),y0(255*a.b,255*a.a)]}class Uf{constructor(e,r,c,h){this.value=e,this.uniformNames=r.map(m=>`u_${m}`),this.type=c,this.context=h}setUniform(e,r,c,h,m){const g=h.constantOr(this.value);r.set(e,m,g instanceof Cn?g.toRenderColor(this.lutExpression&&this.lutExpression.value==="none"?null:this.context.lut):g)}getBinding(e,r){return this.type==="color"?new x0(e):new cr(e)}}class yd{constructor(e,r){this.uniformNames=r.map(c=>`u_${c}`),this.pattern=null,this.patternTransition=null,this.pixelRatio=1}setConstantPatternPositions(e,r){this.pixelRatio=e.pixelRatio||1,this.pattern=e.tl.concat(e.br),this.patternTransition=r?r.tl.concat(r.br):this.pattern}setUniform(e,r,c,h,m){let g=null;m!=="u_pattern"&&m!=="u_dash"||(g=this.pattern),m==="u_pattern_b"&&(g=this.patternTransition),m==="u_pixel_ratio"&&(g=this.pixelRatio),g&&r.set(e,m,g)}getBinding(e,r){return r==="u_pattern"||r==="u_pattern_b"||r==="u_dash"?new xm(e):new cr(e)}}class Cc{constructor(e,r,c,h){this.expression=e,this.type=c,this.maxValue=0,this.paintVertexAttributes=r.map(m=>({name:`a_${m}`,type:"Float32",components:c==="color"?2:1,offset:0})),this.paintVertexArray=new h}populatePaintArray(e,r,c,h,m,g,b){const T=this.paintVertexArray.length,E=this.expression.kind==="composite"||this.expression.kind==="source"?this.expression.evaluate(new Un(0,{brightness:g}),r,{},m,h,b):this.expression.kind==="constant"&&this.expression.value,I=!!this.lutExpression&&(this.lutExpression.kind==="composite"||this.lutExpression.kind==="source"?this.lutExpression.evaluate(new Un(0,{brightness:g}),r,{},m,h,b):this.lutExpression.value)==="none";this.paintVertexArray.resize(e),this._setPaintValue(T,e,E,I?null:this.context.lut)}updatePaintArray(e,r,c,h,m,g,b){const T=this.expression.kind==="composite"||this.expression.kind==="source"?this.expression.evaluate({zoom:0,brightness:b},c,h,void 0,m):this.expression.kind==="constant"&&this.expression.value,E=!!this.lutExpression&&(this.lutExpression.kind==="composite"||this.lutExpression.kind==="source"?this.lutExpression.evaluate(new Un(0,{brightness:b}),c,h,void 0,m):this.lutExpression.value)==="none";this._setPaintValue(e,r,T,E?null:this.context.lut)}
594_setPaintValue(e,r,c,h){if(this.type==="color"){const m=jf(c.toRenderColor(h));for(let g=e;g<r;g++)this.paintVertexArray.emplace(g,m[0],m[1])}else{for(let m=e;m<r;m++)this.paintVertexArray.emplace(m,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.lutExpression&&this.lutExpression.kind!=="constant"&&(this.lutExpression.isStateDependent||!this.lutExpression.isLightConstant)||this.expression.kind!=="constant"&&(this.expression.isStateDependent||!this.expression.isLightConstant)))}destroy(){this.paintVertexBuffer&&this.paintVertexBuffer.destroy()}}class hl{constructor(e,r,c,h,m,g){this.expression=e,this.uniformNames=r.map(b=>`u_${b}_t`),this.type=c,this.useIntegerZoom=h,this.context=m,this.maxValue=0,this.paintVertexAttributes=r.map(b=>({name:`a_${b}`,type:"Float32",components:c==="color"?4:2,offset:0})),this.paintVertexArray=new g}populatePaintArray(e,r,c,h,m,g,b){const T=this.expression.evaluate(new Un(this.context.zoom,{brightness:g}),r,{},m,h,b),E=this.expression.evaluate(new Un(this.context.zoom+1,{brightness:g}),r,{},m,h,b),I=!!this.lutExpression&&(this.lutExpression.kind==="composite"||this.lutExpression.kind==="source"?this.lutExpression.evaluate(new Un(0,{brightness:g}),r,{},m,h,b):this.lutExpression.value)==="none",M=this.paintVertexArray.length;this.paintVertexArray.resize(e),this._setPaintValue(M,e,T,E,I?null:this.context.lut)}updatePaintArray(e,r,c,h,m,g,b){const T=this.expression.evaluate({zoom:this.context.zoom,brightness:b},c,h,void 0,m),E=this.expression.evaluate({zoom:this.context.zoom+1,brightness:b},c,h,void 0,m),I=!!this.lutExpression&&(this.lutExpression.kind==="composite"||this.lutExpression.kind==="source"?this.lutExpression.evaluate(new Un(0,{brightness:b}),c,h,void 0,m):this.lutExpression.value)==="none";this._setPaintValue(e,r,T,E,I?null:this.context.lut)}_setPaintValue(e,r,c,h,m){if(this.type==="color"){const g=jf(c.toRenderColor(m)),b=jf(c.toRenderColor(m));for(let T=e;T<r;T++)this.paintVertexArray.emplace(T,g[0],g[1],b[0],b[1])}else{for(let g=e;g<r;g++)this.paintVertexArray.emplace(g,c,h);this.maxValue=Math.max(this.maxValue,Math.abs(c),Math.abs(h))}}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||!this.expression.isLightConstant))}destroy(){this.paintVertexBuffer&&this.paintVertexBuffer.destroy()}setUniform(e,r,c,h,m){const g=this.useIntegerZoom?Math.floor(c.zoom):c.zoom,b=ke(this.expression.interpolationFactor(g,this.context.zoom,this.context.zoom+1),0,1);r.set(e,m,b)}getBinding(e,r){return new cr(e)}}class dl{constructor(e,r,c,h,m){this.expression=e,this.layerId=m,this.paintVertexAttributes=(c==="array"?L1:k1).members;for(let g=0;g<r.length;++g);this.paintVertexArray=new h,this.paintTransitionVertexArray=new Ac}populatePaintArray(e,r,c,h){const m=this.paintVertexArray.length;this.paintVertexArray.resize(e),this._setPaintValues(m,e,r.patterns&&r.patterns[this.layerId],c)}updatePaintArray(e,r,c,h,m,g,b){this._setPaintValues(e,r,c.patterns&&c.patterns[this.layerId],g)}_setPaintValues(e,r,c,h){if(!h||!c)return;const m=h[c[0]],g=h[c[1]];if(m){if(m){const{tl:b,br:T,pixelRatio:E}=m;for(let I=e;I<r;I++)this.paintVertexArray.emplace(I,b[0],b[1],T[0],T[1],E)}if(g){this.paintTransitionVertexArray.resize(this.paintVertexArray.length);const{tl:b,br:T,pixelRatio:E}=g;for(let I=e;I<r;I++)this.paintTransitionVertexArray.emplace(I,b[0],b[1],T[0],T[1],E)}}}upload(e){const r=this.expression.isStateDependent||!this.expression.isLightConstant;this.paintVertexArray&&this.paintVertexArray.arrayBuffer&&(this.paintVertexBuffer=e.createVertexBuffer(this.paintVertexArray,this.paintVertexAttributes,r)),this.paintTransitionVertexArray&&this.paintTransitionVertexArray.length&&(this.paintTransitionVertexBuffer=e.createVertexBuffer(this.paintTransitionVertexArray,gd.members,r))}destroy(){this.paintVertexBuffer&&this.paintVertexBuffer.destroy(),this.paintTransitionVertexBuffer&&this.paintTransitionVertexBuffer.destroy()}}class cu{constructor(e,r,c=()=>!0){this.binders={},this._buffers=[],this.context=r;const h=[];for(const m in e.paint._values){const g=e.paint.get(m);
vendor: 5,327 bytes, line 594
594if(m.endsWith("-use-theme")||!c(m)||!(g instanceof ud&&kn(g.property.specification)))continue;const b=i(m,e.type),T=g.value,E=g.property.specification.type,I=!!g.property.useIntegerZoom,M=m==="line-dasharray"||m.endsWith("pattern"),k=e.paint.get(`${m}-use-theme`),B=m==="line-dasharray"&&e.layout.get("line-cap").value.kind!=="constant"||k&&k.value.kind!=="constant";if(T.kind!=="constant"||B)if(T.kind==="source"||B||M){const N=y(m,E,"source");this.binders[m]=M?new dl(T,b,E,N,e.id):new Cc(T,b,E,N),h.push(`/a_${m}`)}else{const N=y(m,E,"composite");this.binders[m]=new hl(T,b,E,I,r,N),h.push(`/z_${m}`)}else this.binders[m]=M?new yd(T.value,b):new Uf(T.value,b,E,r),h.push(`/u_${m}`);k&&(this.binders[m].lutExpression=k.value)}this.cacheKey=h.sort().join("")}getMaxValue(e){const r=this.binders[e];return r instanceof Cc||r instanceof hl?r.maxValue:0}populatePaintArrays(e,r,c,h,m,g,b){for(const T in this.binders){const E=this.binders[T];E.context=this.context,(E instanceof Cc||E instanceof hl||E instanceof dl)&&E.populatePaintArray(e,r,c,h,m,g,b)}}setConstantPatternPositions(e,r){for(const c in this.binders){const h=this.binders[c];h instanceof yd&&h.setConstantPatternPositions(e,r)}}getPatternTransitionVertexBuffer(e){const r=this.binders[e];return r instanceof dl?r.paintTransitionVertexBuffer:null}updatePaintArrays(e,r,c,h,m,g,b,T,E){let I=!1;const M=Object.keys(e),k=M.length!==0&&!T,B=k?M:r.uniqueIds;this.context.lut=m.lut;for(const N in this.binders){const U=this.binders[N];if(U.context=this.context,(U instanceof Cc||U instanceof hl||U instanceof dl)&&U.expression&&U.expression.kind&&U.expression.kind!=="constant"&&(U.expression.isStateDependent===!0||U.expression.isLightConstant===!1)){const Y=m.paint.get(N);U.expression=Y.value;for(const J of B){const ae=e[J.toString()];r.eachPosition(J,(ne,G,te)=>{const oe=h.feature(ne);U.updatePaintArray(G,te,oe,ae,g,b,E)})}if(!k)for(const J of c.uniqueIds){const ae=e[J.toString()];c.eachPosition(J,(ne,G,te)=>{const oe=h.feature(ne);U.updatePaintArray(G,te,oe,ae,g,b,E)})}I=!0}}return I}defines(){const e=[];for(const r in this.binders){const c=this.binders[r];(c instanceof Uf||c instanceof yd)&&e.push(...c.uniformNames.map(h=>`#define HAS_UNIFORM_${h}`))}return e}getBinderAttributes(){const e=[];for(const r in this.binders){const c=this.binders[r];if(c instanceof Cc||c instanceof hl||c instanceof dl)for(let h=0;h<c.paintVertexAttributes.length;h++)e.push(c.paintVertexAttributes[h].name);if(c instanceof dl)for(let h=0;h<gd.members.length;h++)e.push(gd.members[h].name)}return e}getBinderUniforms(){const e=[];for(const r in this.binders){const c=this.binders[r];if(c instanceof Uf||c instanceof yd||c instanceof hl)for(const h of c.uniformNames)e.push(h)}return e}getPaintVertexBuffers(){return this._buffers}getUniforms(e){const r=[];for(const c in this.binders){const h=this.binders[c];if(h instanceof Uf||h instanceof yd||h instanceof hl)for(const m of h.uniformNames)r.push({name:m,property:c,binding:h.getBinding(e,m)})}return r}setUniforms(e,r,c,h,m){for(const{name:g,property:b,binding:T}of c)this.binders[b].setUniform(e,T,m,h.get(b),g)}updatePaintBuffers(){this._buffers=[];for(const e in this.binders){const r=this.binders[e];(r instanceof Cc||r instanceof hl||r instanceof dl)&&r.paintVertexBuffer&&this._buffers.push(r.paintVertexBuffer),r instanceof dl&&r.paintTransitionVertexBuffer&&this._buffers.push(r.paintTransitionVertexBuffer)}}upload(e){for(const r in this.binders){const c=this.binders[r];(c instanceof Cc||c instanceof hl||c instanceof dl)&&c.upload(e)}this.updatePaintBuffers()}destroy(){for(const e in this.binders){const r=this.binders[e];(r instanceof Cc||r instanceof hl||r instanceof dl)&&r.destroy()}}}class rh{constructor(e,r,c=()=>!0){this.programConfigurations={};for(const h of e)this.programConfigurations[h.id]=new cu(h,r,c);this.needsUpload=!1,this._featureMap=new _d,this._featureMapWithoutIds=new _d,this._bufferOffset=0,this._idlessCounter=0}populatePaintArrays(e,r,c,h,m,g,b,T){for(const E in this.programConfigurations)this.programConfigurations[E].populatePaintArrays(e,r,h,m,g,b,T);r.id!==void 0?this._featureMap.add(r.id,c,this._bufferOffset,e):(this._featureMapWithoutIds.add(this._idlessCounter,c,this._bufferOffset,e),this._idlessCounter+=1),this._bufferOffset=e,this.needsUpload=!0}updatePaintArrays(e,r,c,h,m,g,b){for(const T of c)this.needsUpload=this.programConfigurations[T.id].updatePaintArrays(e,this._featureMap,this._featureMapWithoutIds,r,T,h,m,g,b||0)||this.needsUpload}get(e){return this.programConfigurations[e]}upload(e){if(this.needsUpload){for(const r in this.programConfigurations)this.programConfigurations[r].upload(e);this.needsUpload=!1}}destroy(){for(const e in this.programConfigurations)this.programConfigurations[e].destroy()}}const f={"text-opacity":["opacity"],"icon-opacity":["opacity"],"text-occlusion-opacity":["occlusion_opacity"],"icon-occlusion-opacity":["occlusion_opacity"],"text-color":["fill_color"],"icon-color":["fill_color"],"text-emissive-strength":["emissive_strength"],"icon-emissive-strength":["emissive_strength"],"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"],"symbol-z-offset":["z_offset"],"line-gap-width":["ga
594pwidth"],"line-pattern":["pattern","pixel_ratio","pattern_b"],"fill-pattern":["pattern","pixel_ratio","pattern_b"],"fill-extrusion-pattern":["pattern","pixel_ratio","pattern_b"],"line-dasharray":["dash"]};function i(a,e){return f[a]||[a.replace(`${e}-`,"").replace(/-/g,"_")]}const l={"line-pattern":{source:Ac,composite:Ac},"fill-pattern":{source:Ac,composite:Ac},"fill-extrusion-pattern":{source:Ac,composite:Ac},"line-dasharray":{source:fm,composite:fm}},p={color:{source:sh,composite:Gl},number:{source:dd,composite:sh}};function y(a,e,r){const c=l[a];return c&&c[r]||p[e][r]}Vt(Uf,"ConstantBinder"),Vt(yd,"PatternConstantBinder"),Vt(Cc,"SourceExpressionBinder"),Vt(dl,"PatternCompositeBinder"),Vt(hl,"CompositeExpressionBinder"),Vt(cu,"ProgramConfiguration",{omit:["_buffers"]}),Vt(rh,"ProgramConfigurationSet");const v=Rt/Math.PI/2,w=5,S=6,C=16383,D=64,L=[D,32,16],F=-v,O=v;function $(a,e,r,c=v){return r=X(r),[a*Math.sin(r)*c,-e*c,a*Math.cos(r)*c]}function q(a,e,r){return $(Math.cos(X(a)),Math.sin(X(a)),e,r)}const W=63710088e-1,K=2*Math.PI*W;class Z{constructor(e,r){if(isNaN(e)||isNaN(r))throw new Error(`Invalid LngLat object: (${e}, ${r})`);if(this.lng=+e,this.lat=+r,this.lat>90||this.lat<-90)throw new Error("Invalid LngLat latitude value: must be between -90 and 90")}wrap(){return new Z(Ze(this.lng,-180,180),this.lat)}toArray(){return[this.lng,this.lat]}toString(){return`LngLat(${this.lng}, ${this.lat})`}distanceTo(e){const r=Math.PI/180,c=this.lat*r,h=e.lat*r,m=Math.sin(c)*Math.sin(h)+Math.cos(c)*Math.cos(h)*Math.cos((e.lng-this.lng)*r);return W*Math.acos(Math.min(m,1))}toBounds(e=0){const r=360*e/40075017,c=r/Math.cos(Math.PI/180*this.lat);return new se({lng:this.lng-c,lat:this.lat-r},{lng:this.lng+c,lat:this.lat+r})}toEcef(e){return q(this.lat,this.lng,v+e*v/W)}static convert(e){if(e instanceof Z)return e;if(Array.isArray(e)&&(e.length===2||e.length===3))return new Z(Number(e[0]),Number(e[1]));if(!Array.isArray(e)&&typeof e=="object"&&e!==null)return new Z(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 se{constructor(e,r){if(e)if(r)this.setSouthWest(e).setNorthEast(r);else if(e.length===4){const c=e;this.setSouthWest([c[0],c[1]]).setNorthEast([c[2],c[3]])}else{const c=e;this.setSouthWest(c[0]).setNorthEast(c[1])}}setNorthEast(e){return this._ne=e instanceof Z?new Z(e.lng,e.lat):Z.convert(e),this}setSouthWest(e){return this._sw=e instanceof Z?new Z(e.lng,e.lat):Z.convert(e),this}extend(e){const r=this._sw,c=this._ne;let h,m;if(e instanceof Z)h=e,m=e;else{if(!(e instanceof se))return Array.isArray(e)?e.length===4||e.every(Array.isArray)?this.extend(se.convert(e)):this.extend(Z.convert(e)):typeof e=="object"&&e!==null&&e.hasOwnProperty("lat")&&(e.hasOwnProperty("lon")||e.hasOwnProperty("lng"))?this.extend(Z.convert(e)):this;if(h=e._sw,m=e._ne,!h||!m)return this}return r||c?(r.lng=Math.min(h.lng,r.lng),r.lat=Math.min(h.lat,r.lat),c.lng=Math.max(m.lng,c.lng),c.lat=Math.max(m.lat,c.lat)):(this._sw=new Z(h.lng,h.lat),this._ne=new Z(m.lng,m.lat)),this}getCenter(){return new Z((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 Z(this.getWest(),this.getNorth())}getSouthEast(){return new Z(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){const{lng:r,lat:c}=Z.convert(e);let h=this._sw.lng<=r&&r<=this._ne.lng;return this._sw.lng>this._ne.lng&&(h=this._sw.lng>=r&&r>=this._ne.lng),this._sw.lat<=c&&c<=this._ne.lat&&h}static convert(e){if(e)return e instanceof se?e:new se(e)}}const ue=0,fe=25.5;function xe(a){return K*Math.cos(a*Math.PI/180)}function _e(a){return(180+a)/360}function ye(a){return(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+a*Math.PI/360)))/360}function pe(a,e){return a/xe(e)}function Se(a){return 360*a-180}function Ae(a){return 360/Math.PI*Math.atan(Math.exp((180-360*a)*Math.PI/180)
vendor: 32,194 bytes, line 594
594)-90}function Ge(a,e){return a*xe(Ae(e))}const Ne=85.051129;function lt(a){return Math.cos(X(ke(a,-85.051129,Ne)))}function st(a,e){const r=ke(e,ue,fe),c=Math.pow(2,r);return lt(a)*K/(512*c)}function Et(a){return 1/Math.cos(a*Math.PI/180)}function Be(a,e=0){const r=Math.exp(Math.PI*(1-(a.y+e/Rt)/(1<<a.z)*2));return 80150034*r/(r*r+1)/Rt/(1<<a.z)}class We{constructor(e,r,c=0){this.x=+e,this.y=+r,this.z=+c}static fromLngLat(e,r=0){const c=Z.convert(e);return new We(_e(c.lng),ye(c.lat),pe(r,c.lat))}toLngLat(){return new Z(Se(this.x),Ae(this.y))}toAltitude(){return Ge(this.z,this.y)}meterInMercatorCoordinateUnits(){return 1/K*Et(Ae(this.y))}}function Re(a,e,r,c,h,m,g,b,T){const E=(e+c)/2,I=(r+h)/2,M=new kt(E,I);b(M),function(k,B,N,U,Y,J){const ae=N-Y,ne=U-J;return Math.abs((U-B)*ae-(N-k)*ne)/Math.hypot(ae,ne)}(M.x,M.y,m.x,m.y,g.x,g.y)>=T?(Re(a,e,r,E,I,m,M,b,T),Re(a,E,I,c,h,M,g,b,T)):a.push(g)}function ht(a,e,r){let c=a[0],h=c.x,m=c.y;e(c);const g=[c];for(let b=1;b<a.length;b++){const T=a[b],{x:E,y:I}=T;e(T),Re(g,h,m,E,I,c,T,e,r),h=E,m=I,c=T}return g}function Xe(a,e,r,c){if(c(e,r)){const h=e.add(r)._mult(.5);Xe(a,e,h,c),Xe(a,h,r,c)}else a.push(r)}function gt(a,e){let r=a[0];const c=[r];for(let h=1;h<a.length;h++){const m=a[h];Xe(c,r,m,e),r=m}return c}const ct=Math.pow(2,14)-1,yt=-ct-1;function xt(a,e){const r=Math.round(a.x*e),c=Math.round(a.y*e);return a.x=ke(r,yt,ct),a.y=ke(c,yt,ct),(r<a.x||r>a.x+1||c<a.y||c>a.y+1)&&Yi("Geometry exceeds allowed extent, reduce your vector tile buffer size"),a}function Qt(a,e,r){const c=a.loadGeometry(),h=a.extent,m=Rt/h;if(e&&r&&r.projection.isReprojectedInTileSpace){const g=1<<e.z,{scale:b,x:T,y:E,projection:I}=r,M=k=>{const B=Se((e.x+k.x/h)/g),N=Ae((e.y+k.y/h)/g),U=I.project(B,N);k.x=(U.x*b-T)*h,k.y=(U.y*b-E)*h};for(let k=0;k<c.length;k++)if(a.type!==1)c[k]=ht(c[k],M,1);else{const B=[];for(const N of c[k])N.x<0||N.x>=h||N.y<0||N.y>=h||(M(N),B.push(N));c[k]=B}}for(const g of c)for(const b of g)xt(b,m);return c}function ci(a,e){return{type:a.type,id:a.id,properties:a.properties,geometry:e?Qt(a):[]}}function Kt(a,e,r,c,h){a.emplaceBack(2*e+(c+1)/2,2*r+(h+1)/2)}function hi(a,e,r){a.emplaceBack(e.x,e.y,e.z,r[0]*16384,r[1]*16384,r[2]*16384)}class ni{constructor(e){this.zoom=e.zoom,this.overscaling=e.overscaling,this.layers=e.layers,this.layerIds=this.layers.map(r=>r.fqid),this.index=e.index,this.hasPattern=!1,this.projection=e.projection,this.layoutVertexArray=new Ec,this.indexArray=new Vr,this.segments=new Vs,this.programConfigurations=new rh(e.layers,{zoom:e.zoom,lut:e.lut}),this.stateDependentLayerIds=this.layers.filter(r=>r.isStateDependent()).map(r=>r.id)}updateFootprints(e,r){}populate(e,r,c,h){const m=this.layers[0],g=[];let b=null;m.type==="circle"&&(b=m.layout.get("circle-sort-key"));for(const{feature:E,id:I,index:M,sourceLayerIndex:k}of e){const B=this.layers[0]._featureFilter.needGeometry,N=ci(E,B);if(!this.layers[0]._featureFilter.filter(new Un(this.zoom),N,c))continue;const U=b?b.evaluate(N,{},c):void 0,Y={id:I,properties:E.properties,type:E.type,sourceLayerIndex:k,index:M,geometry:B?N.geometry:Qt(E,c,h),patterns:{},sortKey:U};g.push(Y)}b&&g.sort((E,I)=>E.sortKey-I.sortKey);let T=null;h.projection.name==="globe"&&(this.globeExtVertexArray=new nh,T=h.projection);for(const E of g){const{geometry:I,index:M,sourceLayerIndex:k}=E,B=e[M].feature;this.addFeature(E,I,M,r.availableImages,c,T,r.brightness),r.featureIndex.insert(B,I,M,k,this.index)}}update(e,r,c,h,m,g,b){this.programConfigurations.updatePaintArrays(e,r,m,c,h,g,b)}isEmpty(){return this.layoutVertexArray.length===0}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(e){this.uploaded||(this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,P1.members),this.indexBuffer=e.createIndexBuffer(this.indexArray),this.globeExtVertexArray&&(this.globeExtVertexBuffer=e.createVertexBuffer(this.globeExtVertexArray,D1.members))),this.programConfigurations.upload(e),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.globeExtVertexBuffer&&this.globeExtVertexBuffer.destroy())}addFeature(e,r,c,h,m,g,b){for(const T of r)for(const E of T){const I=E.x,M=E.y;if(I<0||I>=Rt||M<0||M>=Rt)continue;if(g){const N=g.projectTilePoint(I,M,m),U=g.upVector(m,I,M),Y=this.globeExtVertexArray;hi(Y,N,U),hi(Y,N,U),hi(Y,N,U),hi(Y,N,U)}const k=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray,e.sortKey),B=k.vertexLength;Kt(this.layoutVertexArray,I,M,-1,-1),Kt(this.layoutVertexArray,I,M,1,-1),Kt(this.layoutVertexArray,I,M,1,1),Kt(this.layoutVertexArray,I,M,-1,1),this.indexArray.emplaceBack(B,B+1,B+2),this.indexArray.emplaceBack(B,B+2,B+3),k.vertexLength+=4,k.primitiveLength+=2}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,e,c,{},h,m,b)}}function bi(a,e){for(let r=0;r<a.length;r++)if(ns(e,a[r]))return!0;for(let r=0;r<e.length;r++)if(ns(a,e[r]))return!0;return!!Zn(a,e)}function Vi(a,e,r){return!!ns(a,e)||!!Zi(e,a,r)}function un(a,e){if(a.length===1)return Dn(e,a[0]);for(let r=0;r<e.length;r++){const c=e[r];for(let h=0;h<c.length;h++)if(ns(a,c[h]))return!0}for(let r=0;r<a.length;r++)if(Dn(e,a[r]))return!0;for(let r=0;r<e.length;r++)if(Zn(a,e[r]))return!0;return!1}function is(a,e,r){if(a.length>1){if(Zn(a,e))return!0;for(let c=0;c<e.length;c++)if(Zi(e[c],a,r))return!0}for(let c=0;c<a.length;c++)if(Zi(a[c],e,r))return!0;return!1}function Zn(a,e){if(a.length===0||e.length===0)return!1;for(let r=0;r<a.length-1;r++){const c=a[r],h=a[r+1];for(let m=0;m<e.length-1;m++)if(dn(c,h,e[m],e[m+1]))return!0}return!1}function dn(a,e,r,c){return jn(a,r,c)!==jn(e,r,c)&&jn(a,e,r)!==jn(a,e,c)}function Zs(a,e,r){return(a.x-r.x)*(e.y-r.y)-(a.y-r.y)*(e.x-r.x)}function zs(a,e,r,c){const h=Zs(a,e,c),m=Zs(a,e,r);if(Math.sign(h)===Math.sign(m))return;const g=Zs(r,c,a),b=g+m-h;return Math.sign(g)!==Math.sign(b)?[g/(g-b),m/(m-h)]:void 0}function Zi(a,e,r){const c=r*r;if(e.length===1)return a.distSqr(e[0])<c;for(let h=1;h<e.length;h++)if(bn(a,e[h-1],e[h])<c)return!0;return!1}function bn(a,e,r){const c=e.distSqr(r);if(c===0)return a.distSqr(e);const h=((a.x-e.x)*(r.x-e.x)+(a.y-e.y)*(r.y-e.y))/c;return a.distSqr(h<0?e:h>1?r:r.sub(e)._mult(h)._add(e))}function Dn(a,e){let r,c,h,m=!1;for(let g=0;g<a.length;g++){r=a[g];for(let b=0,T=r.length-1;b<r.length;T=b++)c=r[b],h=r[T],c.y>e.y!=h.y>e.y&&e.x<(h.x-c.x)*(e.y-c.y)/(h.y-c.y)+c.x&&(m=!m)}return m}function ns(a,e){let r=!1;for(let c=0,h=a.length-1;c<a.length;h=c++){const m=a[c],g=a[h];m.y>e.y!=g.y>e.y&&e.x<(g.x-m.x)*(e.y-m.y)/(g.y-m.y)+m.x&&(r=!r)}return r}function fr(a,e,r,c,h){for(const g of a)if(e<=g.x&&r<=g.y&&c>=g.x&&h>=g.y)return!0;const m=[new kt(e,r),new kt(e,h),new kt(c,h),new kt(c,r)];if(a.length>2){for(const g of m)if(ns(a,g))return!0}for(let g=0;g<a.length-1;g++)if(Ks(a[g],a[g+1],m))return!0;return!1}function Ks(a,e,r){const c=r[0],h=r[2];if(a.x<c.x&&e.x<c.x||a.x>h.x&&e.x>h.x||a.y<c.y&&e.y<c.y||a.y>h.y&&e.y>h.y)return!1;const m=jn(a,e,r[0]);return m!==jn(a,e,r[1])||m!==jn(a,e,r[2])||m!==jn(a,e,r[3])}function ur(a,e,r,c,h,m){let g=e.y-a.y,b=a.x-e.x;if(m=m||0){const T=g*g+b*b;if(T===0)return!0;const E=Math.sqrt(T);g/=E,b/=E}return!((r.x-a.x)*g+(r.y-a.y)*b-m<0||(c.x-a.x)*g+(c.y-a.y)*b-m<0||(h.x-a.x)*g+(h.y-a.y)*b-m<0)}function ks(a,e,r,c,h,m,g){return!(ur(a,e,c,h,m,g)||ur(e,r,c,h,m,g)||ur(r,a,c,h,m,g)||ur(c,h,a,e,r,g)||ur(h,m,a,e,r,g)||ur(m,c,a,e,r,g))}function tn(a,e,r){const c=e.paint.get(a).value;return c.kind==="constant"?c.value:r.programConfigurations.get(e.id).getMaxValue(a)}function Cs(a){return Math.sqrt(a[0]*a[0]+a[1]*a[1])}function In(a,e,r,c,h){if(!e[0]&&!e[1])return a;const m=kt.convert(e)._mult(h);r==="viewport"&&m._rotate(-c);const g=[];for(let b=0;b<a.length;b++)g.push(a[b].sub(m));return g}function Is(a,e,r,c){const h=kt.convert(a)._mult(c);return e==="viewport"&&h._rotate(-r),h}let Nn,Ls;function $r(a,e,r){var c=2*Math.PI*6378137/256/Math.pow(2,r);return[a*c-2*Math.PI*6378137/2,e*c-2*Math.PI*6378137/2]}Vt(ni,"CircleBucket",{omit:["layers"]});class _s{constructor(e,r,c){this.z=e,this.x=r,this.y=c,this.key=ro(0,e,e,r,c)}equals(e){return this.z===e.z&&this.x===e.x&&this.y===e.y}url(e,r){const c=function(m,g,b){var T=$r(256*m,256*(g=Math.pow(2,b)-g-1),b),E=$r(256*(m+1),256*(g+1),b);return T[0]+","+T[1]+","+E[0]+","+E[1]}(this.x,this.y,this.z),h=function(m,g,b){let T,E="";for(let I=m;I>0;I--)T=1<<I-1,E+=(g&T?1:0)+(b&T?2:0);return E}(this.z,this.x,this.y);return e[(this.x+this.y)%e.length].replace("{prefix}",(this.x%16).toString(16)+(this.y%16).toString(16)).replace(/{z}/g,String(this.z)).replace(/{x}/g,String(this.x)).replace(/{y}/g,String(r==="tms"?Math.pow(2,this.z)-this.y-1:this.y)).replace("{quadkey}",h).replace("{bbox-epsg-3857}",c)}toString(){return`${this.z}/${this.x}/${this.y}`}}class Zr{constructor(e,r){this.wrap=e,this.canonical=r,this.key=ro(e,r.z,r.z,r.x,r.y)}}class ar{constructor(e,r,c,h,m){this.overscaledZ=e,this.wrap=r,this.canonical=new _s(c,+h,+m),this.key=r===0&&e===c?this.canonical.key:ro(r,e,c,h,m)}equals(e){return this.overscaledZ===e.overscaledZ&&this.wrap===e.wrap&&this.canonical.equals(e.canonical)}scaledTo(e){const r=this.canonical.z-e;return e>this.canonical.z?new ar(e,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y):new ar(e,this.wrap,e,this.canonical.x>>r,this.canonical.y>>r)}calculateScaledKey(e,r=!0){if(this.overscaledZ===e&&r)return this.key;if(e>this.canonical.z)return ro(this.wrap*+r,e,this.canonical.z,this.canonical.x,this.canonical.y);{const c=this.canonical.z-e;return ro(this.wrap*+r,e,e,this.canonical.x>>c,this.canonical.y>>c)}}isChildOf(e){if(e.wrap!==this.wrap)return!1;const r=this.canonical.z-e.canonical.z;return e.overscaledZ===0||e.overscaledZ<this.overscaledZ&&e.canonical.z<this.canonical.z&&e.canonical.x===this.canonical.x>>r&&e.canonical.y===this.canonical.y>>r}children(e){if(this.overscaledZ>=e)return[new ar(this.overscaledZ+1,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y)];const r=this.canonical.z+1,c=2*this.canonical.x,h=2*this.canonical.y;return[new ar(r,this.wrap,r,c,h),new ar(r,this.wrap,r,c+1,h),new ar(r,this.wrap,r,c,h+1),new ar(r,this.wrap,r,c+1,h+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 ar(this.overscaledZ,0,this.canonical.z,this.canonical.x,this.canonical.y)}unwrapTo(e){return new ar(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 Zr(this.wrap,this.canonical)}toString(){return`${this.overscaledZ}/${this.canonical.x}/${this.canonical.y}`}}function ro(a,e,r,c,h){const m=1<<Math.min(r,22);let g=m*(h%m)+c%m;return a&&r<22&&(g+=m*m*((a<0?-2*a-1:2*a)%(1<<2*(22-r)))),16*(32*g+r)+(e-r)}const fl=[a=>{let e=a.canonical.x-1,r=a.wrap;return e<0&&(e=(1<<a.canonical.z)-1,r--),new ar(a.overscaledZ,r,a.canonical.z,e,a.canonical.y)},a=>{let e=a.canonical.x+1,r=a.wrap;return e===1<<a.canonical.z&&(e=0,r++),new ar(a.overscaledZ,r,a.canonical.z,e,a.canonical.y)},a=>new ar(a.overscaledZ,a.wrap,a.canonical.z,a.canonical.x,(a.canonical.y===0?1<<a.canonical.z:a.canonical.y)-1),a=>new ar(a.overscaledZ,a.wrap,a.canonical.z,a.canonical.x,a.canonical.y===(1<<a.canonical.z)-1?0:a.canonical.y+1)];Vt(_s,"CanonicalTileID"),Vt(ar,"OverscaledTileID",{omit:["projMatrix","expandedProjMatrix"]});const Ic=Rn([{type:"Float32",name:"a_globe_pos",components:3},{type:"Float32",name:"a_uv",components:2}]),{members:ra}=Ic,$a=Rn([{name:"a_pos_3",components:3,type:"Int16"}]);var ql=Rn([{name:"a_pos",type:"Int16",components:2}]);class Zl{constructor(e,r){this.pos=e,this.dir=r}intersectsPlane(e,r,c){const h=Ss(r,this.dir);if(Math.abs(h)<1e-6)return!1;const m=((e[0]-this.pos[0])*r[0]+(e[1]-this.pos[1])*r[1])/h;return c[0]=this.pos[0]+this.dir[0]*m,c[1]=this.pos[1]+this.dir[1]*m,!0}}class pl{constructor(e,r){this.pos=e,this.dir=r}intersectsPlane(e,r,c){const h=Hi(r,this.dir);if(Math.abs(h)<1e-6)return!1;const m=((e[0]-this.pos[0])*r[0]+(e[1]-this.pos[1])*r[1]+(e[2]-this.pos[2])*r[2])/h;return c[0]=this.pos[0]+this.dir[0]*m,c[1]=this.pos[1]+this.dir[1]*m,c[2]=this.pos[2]+this.dir[2]*m,!0}closestPointOnSphere(e,r,c){if(function(B,N){var U=B[0],Y=B[1],J=B[2],ae=N[0],ne=N[1],G=N[2];return Math.abs(U-ae)<=A*Math.max(1,Math.abs(U),Math.abs(ae))&&Math.abs(Y-ne)<=A*Math.max(1,Math.abs(Y),Math.abs(ne))&&Math.abs(J-G)<=A*Math.max(1,Math.abs(J),Math.abs(G))}(this.pos,e)||r===0)return c[0]=c[1]=c[2]=0,!1;const[h,m,g]=this.dir,b=this.pos[0]-e[0],T=this.pos[1]-e[1],E=this.pos[2]-e[2],I=h*h+m*m+g*g,M=2*(b*h+T*m+E*g),k=M*M-4*I*(b*b+T*T+E*E-r*r);if(k<0){const B=Math.max(-M/2,0),N=b+h*B,U=T+m*B,Y=E+g*B,J=Math.hypot(N,U,Y);return c[0]=N*r/J,c[1]=U*r/J,c[2]=Y*r/J,!1}{const B=(-M-Math.sqrt(k))/(2*I);if(B<0){const N=Math.hypot(b,T,E);return c[0]=b*r/N,c[1]=T*r/N,c[2]=E*r/N,!1}return c[0]=b+h*B,c[1]=T+m*B,c[2]=E+g*B,!0}}}class vd{constructor(e,r,c,h,m){this.TL=e,this.TR=r,this.BR=c,this.BL=h,this.horizon=m}static fromInvProjectionMatrix(e,r,c){const h=[-1,1,1],m=[1,1,1],g=[1,-1,1],b=[-1,-1,1],T=ti(h,h,e),E=ti(m,m,e),I=ti(g,g,e),M=ti(b,b,e);return new vd(T,E,I,M,r/c)}}function oh(a,e,r){let c=1/0,h=-1/0;const m=[];for(const g of a){Oe(m,g,e);const b=Hi(m,r);c=Math.min(c,b),h=Math.max(h,b)}return[c,h]}function bm(a,e){let r=!0;for(let c=0;c<a.planes.length;c++){const h=a.planes[c];let m=0;for(let g=0;g<e.length;g++)m+=Hi(h,e[g])+h[3]>=0;if(m===0)return 0;m!==e.length&&(r=!1)}return r?2:1}function wm(a,e){for(const r of a.projections){const c=oh(e,a.points[0],r.axis);if(r.projection[1]<c[0]||r.projection[0]>c[1])return 0}return 1}function Tm(a,e){let r=0;const c=[0,0,0,0];for(let g=0;g<a.length;g++)c[0]=a[g][0],c[1]=a[g][1],c[2]=a[g][2],c[3]=1,(h=c)[0]*(m=e)[0]+h[1]*m[1]+h[2]*m[2]+h[3]*m[3]>=0&&r++;var h,m;return r}class Hf{constructor(e,r){this.points=e||new Array(8).fill([0,0,0]),this.planes=r||new Array(6).fill([0,0,0,0]),this.bounds=Ms.fromPoints(this.points),this.projections=[],this.frustumEdges=[Oe([],this.points[2],this.points[3]),Oe([],this.points[0],this.points[3]),Oe([],this.points[4],this.points[0]),Oe([],this.points[5],this.points[1]),Oe([],this.points[6],this.points[2]),Oe([],this.points[7],this.points[3])];for(const c of this.frustumEdges){const h=[0,-c[2],c[1]],m=[c[2],0,-c[0]];this.projections.push({axis:h,projection:oh(this.points,this.points[0],h)}),this.projections.push({axis:m,projection:oh(this.points,this.points[0],m)})}}static fromInvProjectionMatrix(e,r,c,h){const m=Math.pow(2,c),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=>{const I=pi([],E,e),M=1/I[3]/r*m;return(k=I)[0]=(B=I)[0]*(N=[M,M,h?1/I[3]:M,M])[0],k[1]=B[1]*N[1],k[2]=B[2]*N[2],k[3]=B[3]*N[3],k;var k,B,N}),b=[[0,1,2],[6,5,4],[0,3,7],[2,1,5],[3,2,6],[0,4,5]].map(E=>{const I=hn([],Ct([],Oe([],g[E[0]],g[E[1]]),Oe([],g[E[2]],g[E[1]]))),M=-Hi(I,g[E[1]]);return I.concat(M)}),T=[];for(let E=0;E<g.length;E++)T.push([g[E][0],g[E][1],g[E][2]]);return new Hf(T,b)}intersectsPrecise(e,r,c){for(let h=0;h<r.length;h++)if(!Tm(e,r[h]))return 0;for(let h=0;h<this.planes.length;h++)if(!Tm(e,this.planes[h]))return 0;for(const h of c)for(const m of this.frustumEdges){const g=Ct([],h,m),b=yi(g);if(b===0)continue;Ue(g,g,1/b);const T=oh(this.points,this.points[0],g),E=oh(e,this.points[0],g);if(T[0]>E[1]||E[0]>T[1])return 0}return 1}containsPoint(e){for(const r of this.planes){const c=r[3];if(Hi([r[0],r[1],r[2]],e)+c<0)return!1}return!0}}class Ms{static fromPoints(e){const r=[1/0,1/0,1/0],c=[-1/0,-1/0,-1/0];for(const h of e)cn(r,r,h),vi(c,c,h);return new Ms(r,c)}static fromTileIdAndHeight(e,r,c){const h=1<<e.canonical.z,m=e.canonical.x,g=e.canonical.y;return new Ms([m/h,g/h,r],[(m+1)/h,(g+1)/h,c])}static applyTransform(e,r){const c=e.getCorners();for(let h=0;h<c.length;++h)ti(c[h],c[h],r);return Ms.fromPoints(c)}static applyTransformFast(e,r){const c=[r[12],r[13],r[14]],h=[...c];for(let m=0;m<3;m++)for(let g=0;g<3;g++){const b=r[4*g+m],T=b*e.min[g],E=b*e.max[g];c[m]+=Math.min(T,E),h[m]+=Math.max(T,E)}return new Ms(c,h)}static projectAabbCorners(e,r){const c=e.getCorners();for(let h=0;h<c.length;++h)ti(c[h],c[h],r);return c}constructor(e,r){this.min=e,this.max=r,this.center=Ue([],ki([],this.min,this.max),.5)}quadrant(e){const r=[e%2==0,e<2],c=Zt(this.min),h=Zt(this.max);for(let m=0;m<r.length;m++)c[m]=r[m]?this.min[m]:this.center[m],h[m]=r[m]?this.center[m]:this.max[m];return h[2]=this.max[2],new Ms(c,h)}distanceX(e){return Math.max(Math.min(this.max[0],e[0]),this.min[0])-e[0]}distanceY(e){return Math.max(Math.min(this.max[1],e[1]),this.min[1])-e[1]}distanceZ(e){return Math.max(Math.min(this.max[2],e[2]),this.min[2])-e[2]}getCorners(){const e=this.min,r=this.max;return[[e[0],e[1],e[2]],[r[0],e[1],e[2]],[r[0],r[1],e[2]],[e[0],r[1],e[2]],[e[0],e[1],r[2]],[r[0],e[1],r[2]],[r[0],r[1],r[2]],[e[0],r[1],r[2]]]}intersects(e){return this.intersectsAabb(e.bounds)?bm(e,this.getCorners()):0}intersectsFlat(e){return this.intersectsAabb(e.bounds)?bm(e,[[this.min[0],this.min[1],0],[this.max[0],this.min[1],0],[this.max[0],this.max[1],0],[this.min[0],this.max[1],0]]):0}intersectsPrecise(e,r){return r||this.intersects(e)?wm(e,this.getCorners()):0}intersectsPreciseFlat(e,r){return r||this.intersectsFlat(e)?wm(e,[[this.min[0],this.min[1],0],[this.max[0],this.min[1],0],[this.max[0],this.max[1],0],[this.min[0],this.max[1],0]]):0}intersectsAabb(e){for(let r=0;r<3;++r)if(this.min[r]>e.max[r]||e.min[r]>this.max[r])return!1;return!0}intersectsAabbXY(e){return!(this.min[0]>e.max[0]||e.min[0]>this.max[0]||this.min[1]>e.max[1]||e.min[1]>this.max[1])}encapsulate(e){for(let r=0;r<3;r++)this.min[r]=Math.min(this.min[r],e.min[r]),this.max[r]=Math.max(this.max[r],e.max[r])}encapsulatePoint(e){for(let r=0;r<3;r++)this.min[r]=Math.min(this.min[r],e[r]),this.max[r]=Math.max(this.max[r],e[r])}closestPoint(e){return[Math.max(Math.min(this.max[0],e[0]),this.min[0]),Math.max(Math.min(this.max[1],e[1]),this.min[1]),Math.max(Math.min(this.max[2],e[2]),this.min[2])]}}function xd(a){return a*v/W}Vt(Ms,"Aabb");const Jg=[new Ms([F,F,F],[O,O,O]),new Ms([F,F,F],[0,0,O]),new Ms([0,F,F],[O,0,O]),new Ms([F,0,F],[0,O,O]),new Ms([0,0,F],[O,O,O])];function ES(a,e,r,c=!0){const h=Ue([],a._camera.position,a.worldSize),m=[e,r,1,1];pi(m,m,a.pixelMatrixInverse),Wt(m,m,1/m[3]);const g=hn([],Oe([],m,h)),b=a.globeMatrix,T=[b[12],b[13],b[14]],E=Oe([],T,h),I=yi(E),M=hn([],E),k=a.worldSize/(2*Math.PI),B=Hi(M,g),N=Math.asin(k/I);if(N<Math.acos(B)){if(!c)return null;const Pe=[],ze=[];Ue(Pe,g,I/B),hn(ze,Oe(ze,Pe,E)),hn(g,ki(g,E,Ue(g,ze,Math.tan(N)*I)))}const U=[];new pl(h,g).closestPointOnSphere(T,k,U);const Y=hn([],hr(b,0)),J=hn([],hr(b,1)),ae=hn([],hr(b,2)),ne=Hi(Y,U),G=Hi(J,U),te=Hi(ae,U),oe=ie(Math.asin(-G/k));let he=ie(Math.atan2(ne,te));he=a.center.lng+function(Pe,ze){const tt=(ze-Pe+180)%360-180;return tt<-180?tt+360:tt}(a.center.lng,he);const Te=_e(he),Me=ke(ye(oe),0,1);return new We(Te,Me)}class DR{constructor(e,r,c){this.a=Oe([],e,c),this.b=Oe([],r,c),this.center=c;const h=hn([],this.a),m=hn([],this.b);this.angle=Math.acos(Hi(h,m))}}function O1(a,e){if(a.angle===0)return null;let r;return r=a.a[e]===0?1/a.angle*.5*Math.PI:1/a.angle*Math.atan(a.b[e]/a.a[e]/Math.sin(a.angle)-1/Math.tan(a.angle)),r<0||r>1?null:function(c,h,m,g){const b=Math.sin(m);return c*(Math.sin((1-g)*m)/b)+h*(Math.sin(g*m)/b)}(a.a[e],a.b[e],a.angle,ke(r,0,1))+a.center[e]}function uu(a){if(a.z<=1)return Jg[a.z+2*a.y+a.x];const e=z1(w0(a));return Ms.fromPoints(e)}function ah(a,e,r){return Ue(a,a,1-r),Yn(a,a,e,r)}function AS(a,e,r){for(const c of a)ti(c,c,e),Ue(c,c,r)}function CS(a,e,r,c){const h=e/a.worldSize,m=a.globeMatrix;if(r.z<=1){const Me=uu(r).getCorners();return AS(Me,m,h),Ms.fromPoints(Me)}const g=w0(r,c),b=z1(g,v+xd(a._tileCoverLift));AS(b,m,h);const T=Number.MAX_VALUE,E=[-T,-T,-T],I=[T,T,T];if(g.contains(a.center)){for(const ze of b)cn(I,I,ze),vi(E,E,ze);E[2]=0;const Me=a.point,Pe=[Me.x*h,Me.y*h,0];return cn(I,I,Pe),vi(E,E,Pe),new Ms(I,E)}if(a._tileCoverLift>0){for(const Me of b)cn(I,I,Me),vi(E,E,Me);return new Ms(I,E)}const M=[m[12]*h,m[13]*h,m[14]*h],k=g.getCenter(),B=ke(a.center.lat,-85.051129,Ne),N=ke(k.lat,-85.051129,Ne),U=_e(a.center.lng),Y=ye(B);let J=U-_e(k.lng);const ae=Y-ye(N);J>.5?J-=1:J<-.5&&(J+=1);let ne=0;Math.abs(J)>Math.abs(ae)?ne=J>=0?1:3:(ne=ae>=0?0:2,Yn(M,M,[m[4]*h,m[5]*h,m[6]*h],-Math.sin(X(ae>=0?g.getSouth():g.getNorth()))*v));const G=b[ne],te=b[(ne+1)%4],oe=new DR(G,te,M),he=[O1(oe,0)||G[0],O1(oe,1)||G[1],O1(oe,2)||G[2]],Te=bd(a.zoom);if(Te>0){const Me=function({x:ze,y:tt,z:mt},ut,pt,bt,Ye){const ft=1/(1<<mt);let qe=ze*ft,et=qe+ft,Tt=tt*ft,St=Tt+ft,li=0;const Jt=(qe+et)/2-bt;return Jt>.5?li=-1:Jt<-.5&&(li=1),qe=((qe+li)*ut-(bt*=ut))*pt+bt,et=((et+li)*ut-bt)*pt+bt,Tt=(Tt*ut-(Ye*=ut))*pt+Ye,St=(St*ut-Ye)*pt+Ye,[[qe,St,0],[et,St,0],[et,Tt,0],[qe,Tt,0]]}(r,e,a._pixelsPerMercatorPixel,U,Y);for(let ze=0;ze<b.length;ze++)ah(b[ze],Me[ze],Te);const Pe=ki([],Me[ne],Me[(ne+1)%4]);Ue(Pe,Pe,.5),ah(he,Pe,Te)}for(const Me of b)cn(I,I,Me),vi(E,E,Me);return I[2]=Math.min(G[2],te[2]),cn(I,I,he),vi(E,E,he),new Ms(I,E)}function w0({x:a,y:e,z:r},c=!1){const h=1/(1<<r),m=new Z(Se(a*h),e===(1<<r)-1&&c?-90:Ae((e+1)*h)),g=new Z(Se((a+1)*h),e===0&&c?90:Ae(e*h));return new se(m,g)}function z1(a,e=v){const r=X(a.getNorth()),c=X(a.getSouth()),h=Math.cos(r),m=Math.cos(c),g=Math.sin(r),b=Math.sin(c),T=a.getWest(),E=a.getEast();return[$(m,b,T,e),$(m,b,E,e),$(h,g,E,e),$(h,g,T,e)]}function Qg(a,e,r,c){const h=1<<r.z,m=(a/Rt+r.x)/h;return q(Ae((e/Rt+r.y)/h),Se(m),c)}function T0({min:a,max:e}){return C/Math.max(e[0]-a[0],e[1]-a[1],e[2]-a[2])}const IS=new Float64Array(16);function S0(a){const e=T0(a),r=_t(IS,[e,e,e]);return Ee(r,r,On([],a.min))}function F1(a){const e=(c=a.min,(r=IS)[0]=1,r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[5]=1,r[6]=0,r[7]=0,r[8]=0,r[9]=0,r[10]=1,r[11]=0,r[12]=c[0],r[13]=c[1],r[14]=c[2],r[15]=1,r);var r,c;const h=1/T0(a);return je(e,e,[h,h,h])}function B1(a){const e=Rt/(2*Math.PI);return a/(2*Math.PI)/e}function MS(a,e){return Rt/(512*Math.pow(2,a))*T0(uu(e))}function PS(a,e,r,c,h){const m=B1(r),g=[a,e,-r/(2*Math.PI)],b=re(new Float64Array(16));return Ee(b,b,g),je(b,b,[m,m,m]),Ve(b,b,X(-h)),Je(b,b,X(-c)),b}function bd(a){return Le(w,S,a)}function DS(a,e){const r=q(e.lat,e.lng),c=function(N){const U=q(N._center.lat,N._center.lng);let Y=Ct([],Fi(0,1,0),U);const J=Mt([],-N.angle,U);Y=ti(Y,Y,J),Mt(J,-N._pitch,Y);const ae=hn([],U);return Ue(ae,ae,xd(N.cameraToCenterDistance/N.pixelsPerMeter)),ti(ae,ae,J),ki([],U,ae)}(a);return g=(h=wi([],c,r))[0],b=h[1],T=h[2],E=(m=r)[0],I=m[1],M=m[2],B=(k=Math.sqrt(g*g+b*b+T*T)*Math.sqrt(E*E+I*I+M*M))&&Hi(h,m)/k,Math.acos(Math.min(Math.max(B,-1),1));var h,m,g,b,T,E,I,M,k,B}function N1(a,e){return DS(a,e)>Math.PI/2*1.01}const kS=X(85),kR=Math.cos(kS),LR=Math.sin(kS),RR=me(),LS=a=>{const e=[];return a.paint.get("circle-pitch-alignment")==="map"&&e.push("PITCH_WITH_MAP"),a.paint.get("circle-pitch-scale")==="map"&&e.push("SCALE_WITH_MAP"),e};function RS(a,e,r,c,h,m,g,b,T){if(m&&a.queryGeometry.isAboveHorizon)return!1;m&&(T*=a.pixelToTileUnitsFactor);const E=a.tileID.canonical,I=r.projection.upVectorScale(E,r.center.lat,r.worldSize).metersToTile;for(const M of e)for(const k of M){const B=k.add(b),N=h&&r.elevation?r.elevation.exaggeration()*h.getElevationAt(B.x,B.y,!0):0,U=r.projection.projectTilePoint(B.x,B.y,E);if(N>0){const ne=r.projection.upVector(E,B.x,B.y);U.x+=ne[0]*I*N,U.y+=ne[1]*I*N,U.z+=ne[2]*I*N}const Y=m?B:OR(U.x,U.y,U.z,c),J=m?a.tilespaceRays.map(ne=>FR(ne,N)):a.queryGeometry.screenGeometry,ae=pi([],[U.x,U.y,U.z,1],c);if(!g&&m?T*=ae[3]/r.cameraToCenterDistance:g&&!m&&(T*=r.cameraToCenterDistance/ae[3]),m){const ne=Ae((k.y/Rt+E.y)/(1<<E.z));T/=r.projection.pixelsPerMeter(ne,1)/pe(1,ne)}if(Vi(J,Y,T))return!0}return!1}function OR(a,e,r,c){const h=pi([],[a,e,r,1],c);return new kt(h[0]/h[3],h[1]/h[3])}const OS=Fi(0,0,0),zR=Fi(0,0,1);function FR(a,e){const r=Yt();return OS[2]=e,a.intersectsPlane(OS,zR,r),new kt(r[0],r[1])}class zS extends ni{}let FS,BS,NS,VS;function $S(a,{width:e,height:r},c,h){if(h){if(h instanceof Uint8ClampedArray)h=new Uint8Array(h.buffer);else if(h.length!==e*r*c)throw new RangeError("mismatched image size")}else h=new Uint8Array(e*r*c);return a.width=e,a.height=r,a.data=h,a}function jS(a,e,r){const{width:c,height:h}=e;c===a.width&&h===a.height||(V1(a,e,{x:0,y:0},{x:0,y:0},{width:Math.min(a.width,c),height:Math.min(a.height,h)},r,null),a.width=c,a.height=h,a.data=e.data)}function V1(a,e,r,c,h,m,g,b){if(h.width===0||h.height===0)return e;if(h.width>a.width||h.height>a.height||r.x>a.width-h.width||r.y>a.height-h.height)throw new RangeError("out of range source coordinates for image copy");if(h.width>e.width||h.height>e.height||c.x>e.width-h.width||c.y>e.height-h.height)throw new RangeError("out of range destination coordinates for image copy");const T=a.data,E=e.data,I=m===4&&b;for(let M=0;M<h.height;M++){const k=((r.y+M)*a.width+r.x)*m,B=((c.y+M)*e.width+c.x)*m;if(I)for(let N=0;N<h.width;N++){const U=k+N*m+3,Y=B+N*m;E[Y+0]=255,E[Y+1]=255,E[Y+2]=255,E[Y+3]=T[U]}else if(g)for(let N=0;N<h.width;N++){const U=k+N*m,Y=B+N*m,J=T[U+3],ae=new Cn(T[U+0]/255*J,T[U+1]/255*J,T[U+2]/255*J,J).toRenderColor(g).toArray();E[Y+0]=ae[0],E[Y+1]=ae[1],E[Y+2]=ae[2],E[Y+3]=ae[3]}else for(let N=0;N<h.width*m;N++)E[B+N]=T[k+N]}return e}Vt(zS,"HeatmapBucket",{omit:["layers"]});class wd{constructor(e,r){$S(this,e,1,r)}resize(e){jS(this,new wd(e),1)}clone(){return new wd({width:this.width,height:this.height},new Uint8Array(this.data))}static copy(e,r,c,h,m){V1(e,r,c,h,m,1,null)}}class xo{constructor(e,r){$S(this,e,4,r)}resize(e){jS(this,new xo(e),4)}replace(e,r){r?this.data.set(e):this.data=e instanceof Uint8ClampedArray?new Uint8Array(e.buffer):e}clone(){return new xo({width:this.width,height:this.height},new Uint8Array(this.data))}static copy(e,r,c,h,m,g,b){V1(e,r,c,h,m,4,g,b)}}class US{constructor(e,r){this.width=e.width,this.height=e.height,this.data=r instanceof Uint8Array?new Float32Array(r.buffer):r}}function e_(a){const e={},r=a.resolution||256,c=a.clips?a.clips.length:1,h=a.image||new xo({width:r,height:c}),m=(g,b,T)=>{e[a.evaluationKey]=T;const E=a.expression.evaluate(e);E&&(h.data[g+b+0]=Math.floor(255*E.r/E.a),h.data[g+b+1]=Math.floor(255*E.g/E.a),h.data[g+b+2]=Math.floor(255*E.b/E.a),h.data[g+b+3]=Math.floor(255*E.a))};if(a.clips)for(let g=0,b=0;g<c;++g,b+=4*r)for(let T=0,E=0;T<r;T++,E+=4){const I=T/(r-1),{start:M,end:k}=a.clips[g];m(b,E,M*(1-I)+k*I)}else for(let g=0,b=0;g<r;g++,b+=4)m(0,b,g/(r-1));return h}Vt(wd,"AlphaImage"),Vt(xo,"RGBAImage");const BR=Rn([{name:"a_pos",components:2,type:"Int16"}],4),NR=Rn([{name:"a_road_z_offset",components:1,type:"Float32"}],4),VR=Rn([{name:"a_pos",components:2,type:"Int16"},{name:"a_height",components:1,type:"Float32"}],4),$R=Rn([{name:"a_pos_normal_3",components:3,type:"Int16"}],4);function t_(a,e,r=2){const c=e&&e.length,h=c?e[0]*r:a.length;let m=HS(a,0,h,r,!0);const g=[];if(!m||m.next===m.prev)return g;let b,T,E;if(c&&(m=function(I,M,k,B){const N=[];for(let U=0,Y=M.length;U<Y;U++){const J=HS(I,M[U]*B,U<Y-1?M[U+1]*B:I.length,B,!1);J===J.next&&(J.steiner=!0),N.push(XR(J))}N.sort(WR);for(let U=0;U<N.length;U++)k=qR(N[U],k);return k}(a,e,m,r)),a.length>80*r){b=1/0,T=1/0;let I=-1/0,M=-1/0;for(let k=r;k<h;k+=r){const B=a[k],N=a[k+1];B<b&&(b=B),N<T&&(T=N),B>I&&(I=B),N>M&&(M=N)}E=Math.max(I-b,M-T),E=E!==0?32767/E:0}return i_(m,g,r,b,T,E,0),g}function HS(a,e,r,c,h){let m;if(h===function(g,b,T,E){let I=0;for(let M=b,k=T-E;M<T;M+=E)I+=(g[k]-g[M])*(g[M+1]+g[k+1]),k=M;return I}(a,e,r,c)>0)for(let g=e;g<r;g+=c)m=ZS(g/c|0,a[g],a[g+1],m);else for(let g=r-c;g>=e;g-=c)m=ZS(g/c|0,a[g],a[g+1],m);return m&&Sm(m,m.next)&&(r_(m),m=m.next),m}function Gf(a,e){if(!a)return a;e||(e=a);let r,c=a;do if(r=!1,c.steiner||!Sm(c,c.next)&&jr(c.prev,c,c.next)!==0)c=c.next;else{if(r_(c),c=e=c.prev,c===c.next)break;r=!0}while(r||c!==e);return e}function i_(a,e,r,c,h,m,g){if(!a)return;!g&&m&&function(T,E,I,M){let k=T;do k.z===0&&(k.z=$1(k.x,k.y,E,I,M)),k.prevZ=k.prev,k.nextZ=k.next,k=k.next;while(k!==T);k.prevZ.nextZ=null,k.prevZ=null,function(B){let N,U=1;do{let Y,J=B;B=null;let ae=null;for(N=0;J;){N++;let ne=J,G=0;for(let oe=0;oe<U&&(G++,ne=ne.nextZ,ne);oe++);let te=U;for(;G>0||te>0&≠)G!==0&&(te===0||!ne||J.z<=ne.z)?(Y=J,J=J.nextZ,G--):(Y=ne,ne=ne.nextZ,te--),ae?ae.nextZ=Y:B=Y,Y.prevZ=ae,ae=Y;J=ne}ae.nextZ=null,U*=2}while(N>1)}(k)}(a,c,h,m);let b=a;for(;a.prev!==a.next;){const T=a.prev,E=a.next;if(m?UR(a,c,h,m):jR(a))e.push(T.i,a.i,E.i),r_(a),a=E.next,b=E.next;else if((a=E)===b){g?g===1?i_(a=HR(Gf(a),e),e,r,c,h,m,2):g===2&&GR(a,e,r,c,h,m):i_(Gf(a),e,r,c,h,m,1);break}}}function jR(a){const e=a.prev,r=a,c=a.next;if(jr(e,r,c)>=0)return!1;const h=e.x,m=r.x,g=c.x,b=e.y,T=r.y,E=c.y,I=Math.min(h,m,g),M=Math.min(b,T,E),k=Math.max(h,m,g),B=Math.max(b,T,E);let N=c.next;for(;N!==e;){if(N.x>=I&&N.x<=k&&N.y>=M&&N.y<=B&&n_(h,b,m,T,g,E,N.x,N.y)&&jr(N.prev,N,N.next)>=0)return!1;N=N.next}return!0}function UR(a,e,r,c){const h=a.prev,m=a,g=a.next;if(jr(h,m,g)>=0)return!1;const b=h.x,T=m.x,E=g.x,I=h.y,M=m.y,k=g.y,B=Math.min(b,T,E),N=Math.min(I,M,k),U=Math.max(b,T,E),Y=Math.max(I,M,k),J=$1(B,N,e,r,c),ae=$1(U,Y,e,r,c);let ne=a.prevZ,G=a.nextZ;for(;ne&&ne.z>=J&&G&&G.z<=ae;){if(ne.x>=B&&ne.x<=U&&ne.y>=N&&ne.y<=Y&&ne!==h&&ne!==g&&n_(b,I,T,M,E,k,ne.x,ne.y)&&jr(ne.prev,ne,ne.next)>=0||(ne=ne.prevZ,G.x>=B&&G.x<=U&&G.y>=N&&G.y<=Y&&G!==h&&G!==g&&n_(b,I,T,M,E,k,G.x,G.y)&&jr(G.prev,G,G.next)>=0))return!1;G=G.nextZ}for(;ne&&ne.z>=J;){if(ne.x>=B&&ne.x<=U&&ne.y>=N&&ne.y<=Y&&ne!==h&&ne!==g&&n_(b,I,T,M,E,k,ne.x,ne.y)&&jr(ne.prev,ne,ne.next)>=0)return!1;ne=ne.prevZ}for(;G&&G.z<=ae;){if(G.x>=B&&G.x<=U&&G.y>=N&&G.y<=Y&&G!==h&&G!==g&&n_(b,I,T,M,E,k,G.x,G.y)&&jr(G.prev,G,G.next)>=0)return!1;G=G.nextZ}return!0}function HR(a,e){let r=a;do{const c=r.prev,h=r.next.next;!Sm(c,h)&&WS(c,r,r.next,h)&&s_(c,h)&&s_(h,c)&&(e.push(c.i,r.i,h.i),r_(r),r_(r.next),r=a=h),r=r.next}while(r!==a);return Gf(r)}function GR(a,e,r,c,h,m){let g=a;do{let b=g.next.next;for(;b!==g.prev;){if(g.i!==b.i&&YR(g,b)){let T=qS(g,b);return g=Gf(g,g.next),T=Gf(T,T.next),i_(g,e,r,c,h,m,0),void i_(T,e,r,c,h,m,0)}b=b.next}g=g.next}while(g!==a)}function WR(a,e){let r=a.x-e.x;return r===0&&(r=a.y-e.y,r===0)&&(r=(a.next.y-a.y)/(a.next.x-a.x)-(e.next.y-e.y)/(e.next.x-e.x)),r}function qR(a,e){const r=function(h,m){let g=m;const b=h.x,T=h.y;let E,I=-1/0;if(Sm(h,g))return g;do{if(Sm(h,g.next))return g.next;if(T<=g.y&&T>=g.next.y&&g.next.y!==g.y){const U=g.x+(T-g.y)*(g.next.x-g.x)/(g.next.y-g.y);if(U<=b&&U>I&&(I=U,E=g.x<g.next.x?g:g.next,U===b))return E}g=g.next}while(g!==m);if(!E)return null;const M=E,k=E.x,B=E.y;let N=1/0;g=E;do{if(b>=g.x&&g.x>=k&&b!==g.x&&GS(T<B?b:I,T,k,B,T<B?I:b,T,g.x,g.y)){const U=Math.abs(T-g.y)/(b-g.x);s_(g,h)&&(U<N||U===N&&(g.x>E.x||g.x===E.x&&ZR(E,g)))&&(E=g,N=U)}g=g.next}while(g!==M);return E}(a,e);if(!r)return e;const c=qS(r,a);return Gf(c,c.next),Gf(r,r.next)}function ZR(a,e){return jr(a.prev,a,e.prev)<0&&jr(e.next,a,a.next)<0}function $1(a,e,r,c,h){return(a=1431655765&((a=858993459&((a=252645135&((a=16711935&((a=(a-r)*h|0)|a<<8))|a<<4))|a<<2))|a<<1))|(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=(e-c)*h|0)|e<<8))|e<<4))|e<<2))|e<<1))<<1}function XR(a){let e=a,r=a;do(e.x<r.x||e.x===r.x&&e.y<r.y)&&(r=e),e=e.next;while(e!==a);return r}function GS(a,e,r,c,h,m,g,b){return(h-g)*(e-b)>=(a-g)*(m-b)&&(a-g)*(c-b)>=(r-g)*(e-b)&&(r-g)*(m-b)>=(h-g)*(c-b)}function n_(a,e,r,c,h,m,g,b){return!(a===g&&e===b)&&GS(a,e,r,c,h,m,g,b)}function YR(a,e){return a.next.i!==e.i&&a.prev.i!==e.i&&!function(r,c){let h=r;do{if(h.i!==r.i&&h.next.i!==r.i&&h.i!==c.i&&h.next.i!==c.i&&WS(h,h.next,r,c))return!0;h=h.next}while(h!==r);return!1}(a,e)&&(s_(a,e)&&s_(e,a)&&function(r,c){let h=r,m=!1;const g=(r.x+c.x)/2,b=(r.y+c.y)/2;do h.y>b!=h.next.y>b&&h.next.y!==h.y&&g<(h.next.x-h.x)*(b-h.y)/(h.next.y-h.y)+h.x&&(m=!m),h=h.next;while(h!==r);return m}(a,e)&&(jr(a.prev,a,e.prev)||jr(a,e.prev,e))||Sm(a,e)&&jr(a.prev,a,a.next)>0&&jr(e.prev,e,e.next)>0)}
594function jr(a,e,r){return(e.y-a.y)*(r.x-e.x)-(e.x-a.x)*(r.y-e.y)}function Sm(a,e){return a.x===e.x&&a.y===e.y}function WS(a,e,r,c){const h=A0(jr(a,e,r)),m=A0(jr(a,e,c)),g=A0(jr(r,c,a)),b=A0(jr(r,c,e));return h!==m&&g!==b||!(h!==0||!E0(a,r,e))||!(m!==0||!E0(a,c,e))||!(g!==0||!E0(r,a,c))||!(b!==0||!E0(r,e,c))}function E0(a,e,r){return e.x<=Math.max(a.x,r.x)&&e.x>=Math.min(a.x,r.x)&&e.y<=Math.max(a.y,r.y)&&e.y>=Math.min(a.y,r.y)}function A0(a){return a>0?1:a<0?-1:0}function s_(a,e){return jr(a.prev,a,a.next)<0?jr(a,e,a.next)>=0&&jr(a,a.prev,e)>=0:jr(a,e,a.prev)<0||jr(a,a.next,e)<0}function qS(a,e){const r=j1(a.i,a.x,a.y),c=j1(e.i,e.x,e.y),h=a.next,m=e.prev;return a.next=e,e.prev=a,r.next=h,h.prev=r,c.next=r,r.prev=c,m.next=c,c.prev=m,c}function ZS(a,e,r,c){const h=j1(a,e,r);return c?(h.next=c.next,h.prev=c,c.next.prev=h,c.next=h):(h.prev=h,h.next=h),h}function r_(a){a.next.prev=a.prev,a.prev.next=a.next,a.prevZ&&(a.prevZ.nextZ=a.nextZ),a.nextZ&&(a.nextZ.prevZ=a.prevZ)}function j1(a,e,r){return{i:a,x:e,y:r,prev:null,next:null,z:0,prevZ:null,nextZ:null,steiner:!1}}function C0(a,e){const r=a.length;if(r<=1)return[a];const c=[];let h,m;for(let g=0;g<r;g++){const b=Tn(a[g]);b!==0&&(a[g].area=Math.abs(b),m===void 0&&(m=b<0),m===b<0?(h&&c.push(h),h=[a[g]]):h.push(a[g]))}if(h&&c.push(h),e>1)for(let g=0;g<c.length;g++)c[g].length<=e||(el(c[g],e,1,c[g].length-1,KR),c[g]=c[g].slice(0,e));return c}function KR(a,e){return e.area-a.area}function XS(a,e,r=1){if(!a)return null;const c=typeof a=="string"?So.from(a).getPrimary():a.getPrimary(),h=typeof a=="string"?null:a.getSecondary();for(const m of[c,h]){if(!m)continue;const g=m.id.toString();e.has(g)||e.set(g,[]),m.scaleSelf(r),e.get(g).push(m)}return{primary:c.toString(),secondary:h?h.toString():null}}function U1(a,e,r,c){const h=c.patternDependencies;let m=!1;for(const g of e){const b=g.paint.get(`${a}-pattern`);b.isConstant()||(m=!0),XS(b.constantOr(null),h,r)&&(m=!0)}return m}function H1(a,e,r,c,h,m){const g=m.patternDependencies;for(const b of e){const T=b.paint.get(`${a}-pattern`).value;if(T.kind!=="constant"){let E=T.evaluate({zoom:c},r,{},m.availableImages);E=E&&E.name?E.name:E;const I=XS(E,g,h);if(!I)continue;const{primary:M,secondary:k}=I;M&&(r.patterns[b.id]=[M,k].filter(Boolean))}}return r}var G1,YS,W1,KS,q1,JS,QS,I0={};function eE(){if(YS)return G1;YS=1;var a=Cu();function e(h,m,g,b,T){this.properties={},this.extent=g,this.type=0,this._pbf=h,this._geometry=-1,this._keys=b,this._values=T,h.readFields(r,this,m)}function r(h,m,g){h==1?m.id=g.readVarint():h==2?function(b,T){for(var E=b.readVarint()+b.pos;b.pos<E;){var I=T._keys[b.readVarint()],M=T._values[b.readVarint()];T.properties[I]=M}}(g,m):h==3?m.type=g.readVarint():h==4&&(m._geometry=g.pos)}function c(h){for(var m,g,b=0,T=0,E=h.length,I=E-1;T<E;I=T++)b+=((g=h[I]).x-(m=h[T]).x)*(m.y+g.y);return b}return G1=e,e.types=["Unknown","Point","LineString","Polygon"],e.prototype.loadGeometry=function(){var h=this._pbf;h.pos=this._geometry;for(var m,g=h.readVarint()+h.pos,b=1,T=0,E=0,I=0,M=[];h.pos<g;){if(T<=0){var k=h.readVarint();b=7&k,T=k>>3}if(T--,b===1||b===2)E+=h.readSVarint(),I+=h.readSVarint(),b===1&&(m&&M.push(m),m=[]),m.push(new a(E,I));else{if(b!==7)throw new Error("unknown command "+b);m&&m.push(m[0].clone())}}return m&&M.push(m),M},e.prototype.bbox=function(){var h=this._pbf;h.pos=this._geometry;for(var m=h.readVarint()+h.pos,g=1,b=0,T=0,E=0,I=1/0,M=-1/0,k=1/0,B=-1/0;h.pos<m;){if(b<=0){var N=h.readVarint();g=7&N,b=N>>3}if(b--,g===1||g===2)(T+=h.readSVarint())<I&&(I=T),T>M&&(M=T),(E+=h.readSVarint())<k&&(k=E),E>B&&(B=E);else if(g!==7)throw new Error("unknown command "+g)}return[I,k,M,B]},e.prototype.toGeoJSON=function(h,m,g){var b,T,E=this.extent*Math.pow(2,g),I=this.extent*h,M=this.extent*m,k=this.loadGeometry(),B=e.types[this.type];function N(J){for(var ae=0;ae<J.length;ae++){var ne=J[ae];J[ae]=[360*(ne.x+I)/E-180,360/Math.PI*Math.atan(Math.exp((180-360*(ne.y+M)/E)*Math.PI/180))-90]}}switch(this.type){case 1:var U=[];for(b=0;b<k.length;b++)U[b]=k[b][0];N(k=U);break;case 2:for(b=0;b<k.length;b++)N(k[b]);break;case 3:for(k=function(J){var ae=J.length;if(ae<=1)return[J];for(var ne,G,te=[],oe=0;oe<ae;oe++){var he=c(J[oe]);he!==0&&(G===void 0&&(G=he<0),G===he<0?(ne&&te.push(ne),ne=[J[oe]]):ne.push(J[oe]))}return ne&&te.push(ne),te}(k),b=0;b<k.length;b++)for(T=0;T<k[b].length;T++)N(k[b][T])}k.length===1?k=k[0]:B="Multi"+B;var Y={type:"Feature",geometry:{type:B,coordinates:k},properties:this.properties};return"id"in this&&(Y.id=this.id),Y},G1}function tE(){if(KS)return W1;KS=1;var a=eE();function e(c,h){this.version=1,this.name=null,this.extent=4096,this.length=0,this._pbf=c,this._keys=[],this._values=[],this._features=[],c.readFields(r,this,h),this.length=this._features.length}function r(c,h,m){c===15?h.version=m.readVarint():c===1?h.name=m.readString():c===5?h.extent=m.readVarint():c===2?h._features.push(m.pos):c===3?h._keys.push(m.readString()):c===4&&h._values.push(function(g){for(var b=null,T=g.readVarint()+g.pos;g.pos<T;){var E=g.readVarint()>>3;b=E===1?g.readString():E===2?g.readFloat():E===3?g.readDouble():E===4?g.readVarint64():E===5?g.readVarint():E===6?g.readSVarint():E===
5947?g.readBoolean():null}return b}(m))}return W1=e,e.prototype.feature=function(c){if(c<0||c>=this._features.length)throw new Error("feature index out of bounds");this._pbf.pos=this._features[c];var h=this._pbf.readVarint()+this._pbf.pos;return new a(this._pbf,h,this.extent,this._keys,this._values)},W1}function iE(){return QS||(QS=1,I0.VectorTile=function(){if(JS)return q1;JS=1;var a=tE();function e(r,c,h){if(r===3){var m=new a(h,h.readVarint()+h.pos);m.length&&(c[m.name]=m)}}return q1=function(r,c){this.layers=r.readFields(e,{},c)},q1}(),I0.VectorTileFeature=eE(),I0.VectorTileLayer=tE()),I0}var Td=iE();const Wf="3d_elevation_id",nE="level";class JR{constructor(){this._valid=!1}reset(e){return this.feature=e,this._valid=!0,this._geometry=e.loadGeometry(),this._geometry.length!==0&&this._geometry[0].length!==0||(this._valid=!1),this}geometry(e,r){return this._valid&&e(r(this._geometry)),this}require(e,r,c){return this.get(e,!0,r,c)}optional(e,r,c){return this.get(e,!1,r,c)}success(){return this._valid}get(e,r,c,h){const m=this.feature.properties.hasOwnProperty(e)?+this.feature.properties[e]:void 0;return this._valid&&m!==void 0&&!Number.isNaN(m)?c(h?h(m):m):r&&(this._valid=!1),this}}class sE{constructor(e,r){this.featureFunc=e,this.vertexFunc=r}parseFeature(e,r,c){return this.featureFunc(e,r,c)}parseVertex(e,r,c){return this.vertexFunc(e,r,c)}}const QR=new sE((a,e,r)=>a.reset(e).require(Wf,c=>{r.id=c}).optional("fixed_height_relative",c=>{r.constantHeight=c},qf.decodeRelativeHeight).geometry(c=>{r.bounds=c},Uh).success(),(a,e,r)=>a.reset(e).require(Wf,c=>{r.id=c}).require("elevation_idx",c=>{r.idx=c}).require("extent",c=>{r.extent=c}).require("height_relative",c=>{r.height=c},qf.decodeRelativeHeight).geometry(c=>{r.position=c},qf.getPoint).success()),eO=new sE((a,e,r)=>a.reset(e).require(Wf,c=>{r.id=c}).optional("fixed_height",c=>{r.constantHeight=c},qf.decodeMetricHeight).geometry(c=>{r.bounds=c},Uh).success(),(a,e,r)=>a.reset(e).require(Wf,c=>{r.id=c}).require("elevation_idx",c=>{r.idx=c}).require("extent",c=>{r.extent=c}).require("height",c=>{r.height=c},qf.decodeMetricHeight).geometry(c=>{r.position=c},qf.getPoint).success());class qf{static getPoint(e){return Pr(e[0][0].x,e[0][0].y)}static decodeRelativeHeight(e){return 1e-4*e*5}static decodeMetricHeight(e){return 1e-4*e}static parse(e){const r=[],c=[],h=e.length,m=new JR;for(let b=0;b<h;b++){const T=e.feature(b),E=T.properties.hasOwnProperty("version")?String(T.properties.version):void 0,I=(g=E)?g==="1.0.1"?eO:void 0:QR;if(I===void 0){Yi(`Unknown elevation feature version number ${E||"(unknown)"}`);continue}const M=T.properties.hasOwnProperty("type")?T.properties.type:void 0;if(M){if(Td.VectorTileFeature.types[T.type]==="Point"&&M==="curve_point"){const k={};I.parseVertex(m,T,k)&&r.push(k)}else if(Td.VectorTileFeature.types[T.type]==="Polygon"&&M==="curve_meta"){const k={};I.parseFeature(m,T,k)&&c.push(k)}}}var g;return{vertices:r,features:c}}}class rE{constructor(e,r){this.feature=e,this.metersToTile=r,this.index=0}get(){const e=this.feature.vertices[this.index],r=this.feature.vertexProps[this.index].dir,c=r[1],h=-r[0],m=(e.extent+1)*this.metersToTile;return[new kt(Math.trunc(e.position[0]+c*m),Math.trunc(e.position[1]+h*m)),new kt(Math.trunc(e.position[0]-c*m),Math.trunc(e.position[1]-h*m))]}next(){this.index++}valid(){return this.index<this.feature.vertices.length}}class Z1{constructor(e,r,c,h,m,g){if(this.vertices=new Array,this.vertexProps=new Array,this.edges=new Array,this.edgeProps=new Array,this.id=e,this.heightRange={min:c,max:c},this.safeArea=r,this.constantHeight=c,this.constantHeight==null&&(this.constantHeight!=null||h.length!==0)){this.vertices=h,this.edges=m,this.edges=this.edges.filter(b=>{return b.a<this.vertices.length&&b.b<this.vertices.length&&!((T=this.vertices[b.a].position)[0]===(E=this.vertices[b.b].position)[0]&&T[1]===E[1]);var T,E}),this.heightRange={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY};for(const b of this.vertices)this.vertexProps.push({dir:Pr(0,0)}),this.heightRange.min=Math.min(this.heightRange.min,b.height),this.heightRange.max=Math.max(this.heightRange.max,b.height);for(const b of this.edges){const T=this.vertices[b.a].position,E=this.vertices[b.b].position,I=Bo(tr(),E,T),M=Hr(I),k=wr(tr(),I,1/M);this.edgeProps.push({vec:I,dir:k,len:M});const B=this.vertexProps[b.a].dir,N=this.vertexProps[b.b].dir;Mo(B,B,k),Mo(N,N,k)}for(const b of this.vertexProps)b.dir[0]===0&&b.dir[1]===0||El(b.dir,b.dir);this.tessellate(g)}}pointElevation(e){if(this.constantHeight!=null)return this.constantHeight;const r=this.getClosestEdge(e);if(r==null)return 0;const[c,h]=r;return((m,g,b)=>(1-b)*m+b*g)(this.vertices[this.edges[c].a].height,this.vertices[this.edges[c].b].height,h)}getSafeArea(){return this.safeArea}isTunnel(){return this.heightRange.max<=-5}getClosestEdge(e){if(this.edges.length===0)return;let r=0,c=Number.POSITIVE_INFINITY,h=0;const m=Pr(e.x,e.y);for(let g=0;g<this.edges.length;g++){const b=this.edges[g],T=this.edgeProps[g].dir,E=new Zl(m,this.edgeProps[g].dir),I=this.vertices[b.a].position,M=this.vertices[b.b].position,k=tr(),B=tr(),N=E.intersectsPlane(I,this.vertexProps[b.a].dir,k),U=E.intersectsPlane(M,this.vertexProps[b.b].dir,B);if(!N||!U)continue;const Y=Bo(tr(),B,k),J=Bo(tr(),m,k),ae=Ss(Y,Y),ne=ae>0?Ss(J,Y)/ae:0,G=ke(ne,0,1),te=Math.abs((ne-G)*this.edgeProps[g].len),oe=Bo(tr(),m,I),he=te+Math.abs(Ss(oe,Pr(T[1],-T[0])));he<c&&(r=g,c=he,h=G)}return[r,h]}tessellate(e){for(let r=this.edges.length-1;r>=0;--r){const c=this.edges[r].a,h=this.edges[r].b,{position:m,height:g,extent:b}=this.vertices[c],{position:T,height:E,extent:I}=this.vertices[h],M=this.vertexProps[c].dir,k=this.vertexProps[h].dir,B=Fi(m[0]/e,m[1]/e,g),N=Fi(T[0]/e,T[1]/e,E),U=Fi(M[1],-M[
5940],0);Ue(U,U,b);const Y=Fi(k[1],-k[0],0);if(Ue(Y,Y,I),this.distSqLines(Fi(B[0]+.5*U[0],B[1]+.5*U[1],B[2]+.5*U[2]),Fi(N[0]-.5*Y[0],N[1]-.5*Y[1],N[2]-.5*Y[2]),Fi(B[0]-.5*U[0],B[1]-.5*U[1],B[2]-.5*U[2]),Fi(N[0]+.5*Y[0],N[1]+.5*Y[1],N[2]+.5*Y[2]))<=.0025000000000000005)continue;const J=this.vertices.length,ae=Mo(tr(),m,T);this.vertices.push({position:wr(ae,ae,.5),height:.5*(g+E),extent:.5*(b+I)});const ne=Mo(tr(),M,k);this.vertexProps.push({dir:El(ne,ne)}),this.edges.splice(r,1),this.edgeProps.splice(r,1),this.edges.push({a:c,b:J}),this.edges.push({a:J,b:h});const G=Bo(tr(),this.vertices[J].position,m),te=Hr(G),oe={vec:G,dir:wr(tr(),G,1/te),len:te};this.edgeProps.push(oe),this.edgeProps.push(oe)}}distSqLines(e,r,c,h){const m=wi(Yt(),r,e),g=wi(Yt(),h,c),b=wi(Yt(),e,c),T=Hi(m,m),E=Hi(m,g),I=Hi(m,b),M=Hi(g,g),k=Hi(g,b),B=T*M-E*E;if(B===0){const Y=Hi(b,g)/Hi(g,g);return Ki(zt(Yt(),c,h,Y),e)}const N=(E*k-I*M)/B,U=(T*k-E*I)/B;return Ki(zt(Yt(),e,r,N),zt(Yt(),c,h,U))}}class X1{static parseFrom(e,r){const c=qf.parse(e);if(!c)return[];let{vertices:h,features:m}=c;const g=1/Be(r);m.sort((I,M)=>I.id-M.id),h.sort((I,M)=>I.id-M.id||I.idx-M.idx),h=h.filter((I,M,k)=>M===k.findIndex(B=>B.id===I.id&&B.idx===I.idx));const b=new Array;let T=0;const E=h.length;for(const I of m){if(I.constantHeight){b.push(new Z1(I.id,I.bounds,I.constantHeight));continue}for(;T!==E&&h[T].id<I.id;)T++;if(T===E||h[T].id!==I.id)continue;const M=new Array,k=new Array,B=T;for(;T!==E&&h[T].id===I.id;){const N=h[T];if(M.push({position:N.position,height:N.height,extent:N.extent}),T!==B&&h[T-1].idx===N.idx-1){const U=T-B;k.push({a:U-1,b:U})}T++}b.push(new Z1(I.id,I.bounds,void 0,M,k,g))}return b}static getElevationFeature(e,r){if(!r)return;const c=+e.properties[Wf];return Number.isNaN(c)?void 0:r.find(h=>h.id===c)}}class oE{constructor(e,r){this.zScale=1,this.xOffset=0,this.yOffset=0,e.equals(r)||(this.zScale=Math.pow(2,r.z-e.z),this.xOffset=(e.x*this.zScale-r.x)*Rt,this.yOffset=(e.y*this.zScale-r.y)*Rt)}constantElevation(e,r){if(e.constantHeight!=null)return this.computeBiasedHeight(e.constantHeight,r)}pointElevation(e,r,c){const h=this.constantElevation(r,c);return h??(e.x=e.x*this.zScale+this.xOffset,e.y=e.y*this.zScale+this.yOffset,this.computeBiasedHeight(r.pointElevation(e),c))}computeBiasedHeight(e,r){return r<=0?e:e+r*Le(0,r,e>=0?e:Math.abs(.5*e))}}Vt(Z1,"ElevationFeature");class aE{constructor(){this.polygons=new Map}add(e,...r){this.polygons.has(e)?this.polygons.get(e).push(...r):this.polygons.set(e,r)}merge(e){for(const[r,c]of e.polygons)this.add(r,...c)}}class Zf{constructor(){this.portals=[]}static evaluate(e){if(e.length===0)return new Zf;let r=[];for(const E of e)r.push(...E.portals);if(r.length===0)return new Zf;const c=(E,I)=>E<=0&&I<=0||E>=Rt&&I>=Rt;for(const E of r){const I=E.va,M=E.vb;(c(I.x,M.x)||c(I.y,M.y))&&(E.type="border")}const h=r.filter(E=>E.type!=="unevaluated"),m=r.filter(E=>E.type==="unevaluated");if(m.length===0)return new Zf;m.sort((E,I)=>E.hash===I.hash?E.isTunnel===I.isTunnel?0:E.isTunnel?-1:1:E.hash<I.hash?1:-1),r=h.concat(m);let g=h.length,b=g,T=g;do if(b++,b===r.length||r[g].hash!==r[b].hash){if(b-g==2){T<g&&(r[T]=r[g],r[g]=null);const E=r[T],I=r[b-1];E.type=E.isTunnel!==I.isTunnel?"tunnel":"polygon",E.connection={a:E.connection.a,b:I.connection.a},T++}g=b}while(g!==r.length);return r.splice(T),r.sort((E,I)=>E.hash<I.hash?1:-1),{portals:r}}}Vt(Zf,"ElevationPortalGraph"),Vt(aE,"ElevationPolygons");class tO{constructor(e,r,c){this.outPositions=e,this.outNormals=r,this.outIndices=c,this.vertexLookup=new Map,this.buffer=new ArrayBuffer(4),this.view=new DataView(this.buffer)}addVertex(e,r,c){let h=e[2];c!=null&&(h*=c);const m=this.getVec3Bits(e)<<96n|this.getVec3Bits(r),g=this.vertexLookup.get(m);if(g!=null)return g;const b=this.outPositions.length;this.vertexLookup.set(m,b);const T=Math.trunc(16384*r[0]),E=Math.trunc(16384*r[1]),I=Math.trunc(16384*r[2]);return this.outPositions.emplaceBack(e[0],e[1],h),this.outNormals.emplaceBack(T,E,I),b}addVertices(e,r,...c){const h=[];for(const m of c){const g=this.addVertex(m,e,r);h.push(g)}return h}addTriangles(e,r,c){if(r&&c){const h=c.length===1,m=Fi(0,0,0);for(let g=0;g<e.length;g+=3){const b=r[e[g+0]],T=r[e[g+1]],E=r[e[g+2]],I=h?c[0]:c[e[g+1]],M=h?c[0]:c[e[g+2]],k=this.addVertex(Fi(b.x,b.y,h?c[0]:c[e[g+0]]),m),B=this.addVertex(Fi(T.x,T.y,I),m),N=this.addVertex(Fi(E.x,E.y,M),m);this.outIndices.emplaceBack(k,B,N)}}else for(let h=0;h<e.length;h+=3)this.outIndices.emplaceBack(e[h+0],e[h+1],e[h+2])}addQuad(e,r){const c=this.addVertices(r,void 0,...e.map(T=>Fi(T.coord.x,T.coord.y,T.height))),[h,m,g,b]=c;this.addTriangles([h,m,g,g,b,h])}getBits(e){return this.view.setFloat32(0,e),BigInt(this.view.getUint32(0))}getVec3Bits(e){return this.getBits(e[0])<<64n|this.getBits(e[1])<<32n|this.getBits(e[2])}}class ja{constructor(e){this.unevaluatedPortals=new Zf,this.portalPolygons=new aE,this.vertexHashLookup=new Map,this.unevalVertices=[],this.unevalHeights=[],this.unevalTriangles=[],this.unevalTunnelTriangles=[],this.unevalEdges=[],this.vertexPositions=new dm,this.vertexNormals=new fd,this.indexArray=new Vr,this.tileToMeters=Be(e)}addVertices(e,r){const c=this.unevalVertices.length;for(let h=0;h<e.length;h++)this.unevalVertices.push(e[h]),this.unevalHeights.push(r[h]);return c}addTriangles(e,r,c){const h=c?this.unevalTunnelTriangles:this.unevalTriangles;for(const m of e)h.push(m+r)}
594addRenderableRing(e,r,c,h,m){const g=[new kt(m.min.x,m.min.y),new kt(m.max.x,m.min.y),new kt(m.max.x,m.max.y),new kt(m.min.x,m.max.y)];for(let b=0;b<c-1;b++){const T=r+b,E=T+1,I=this.unevalVertices[T],M=this.unevalVertices[E];if(!(I.x>=m.min.x&&I.x<=m.max.x&&I.y>=m.min.y&&I.y<=m.max.y||M.x>=m.min.x&&M.x<=m.max.x&&M.y>=m.min.y&&M.y<=m.max.y||Ks(I,M,g))||this.isOnBorder(I.x,M.x)||this.isOnBorder(I.y,M.y))continue;const k=ja.computeEdgeHash(this.unevalVertices[T],this.unevalVertices[E]);let B,N=this.vertexHashLookup.get(ja.computePosHash(I));N!=null?B=N.next:(N=this.vertexHashLookup.get(ja.computePosHash(M)),B=N!=null?N.prev:k),this.unevalEdges.push({polygonIdx:e,a:T,b:E,hash:k,portalHash:B,isTunnel:h,type:"unevaluated"})}}addPortalCandidates(e,r,c,h,m){if(r.length===0)return;this.portalPolygons.add(e,{geometry:r,zLevel:m});const g=r[0];this.vertexHashLookup.clear();let b=ja.computeEdgeHash(g[g.length-2],g[g.length-1]);for(let T=0;T<g.length-1;T++){const E=g[T+0],I=g[T+1],M=Pr(I.x-E.x,I.y-E.y),k=Hr(M);if(k===0)continue;let B="unevaluated";const N=h.pointElevation(E),U=h.pointElevation(I);Math.abs(N)<.01&&Math.abs(U)<.01?B="entrance":(this.isOnBorder(E.x,I.x)||this.isOnBorder(E.y,I.y))&&(B="border");const Y=ja.computeEdgeHash(E,I);this.unevaluatedPortals.portals.push({connection:{a:e,b:void 0},va:E,vb:I,vab:M,length:k,hash:Y,isTunnel:c,type:B});const J=ja.computePosHash(E);this.vertexHashLookup.set(J,{prev:b,next:Y}),b=Y}}construct(e){if(this.unevalVertices.length===0)return;const r=()=>({vertexOffset:0,primitiveOffset:this.indexArray.length}),c=M=>{M.primitiveLength=this.indexArray.length-M.primitiveOffset},h=new tO(this.vertexPositions,this.vertexNormals,this.indexArray);this.prepareEdges(e.portals,this.unevalEdges);const m=r(),g=r(),b=r(),T=(M,k)=>{M.sort((N,U)=>N.type===k&&U.type!==k?-1:N.type!==k&&U.type===k?1:0);const B=M.findIndex(N=>N.type!==k);return B>=0?B:M.length};let E=0;this.unevalEdges.length>0&&(E=T(this.unevalEdges,"none"),this.constructBridgeStructures(h,this.unevalVertices,this.unevalHeights,this.unevalEdges,{min:0,max:E},this.tileToMeters));const I=r();if(this.unevalEdges.length>0){const M=this.unevalEdges.splice(E),k=T(M,"tunnel")+E;this.unevalEdges.push(...M),this.constructTunnelStructures(h,this.unevalVertices,this.unevalHeights,this.unevalEdges,{min:0,max:E},{min:E,max:k})}c(b),h.addTriangles(this.unevalTriangles,this.unevalVertices,this.unevalHeights),c(I),h.addTriangles(this.unevalTunnelTriangles,this.unevalVertices,this.unevalHeights),c(g),h.addTriangles(this.unevalTunnelTriangles,this.unevalVertices,[-.1]),c(m),this.maskSegments=Vs.simpleSegment(0,I.primitiveOffset,0,I.primitiveLength),this.depthSegments=Vs.simpleSegment(0,g.primitiveOffset,0,g.primitiveLength),this.renderableSegments=Vs.simpleSegment(0,b.primitiveOffset,0,b.primitiveLength),this.shadowCasterSegments=Vs.simpleSegment(0,m.primitiveOffset,0,m.primitiveLength)}upload(e){this.vertexBuffer||this.vertexPositions.length===0||this.vertexNormals.length===0||this.indexArray.length===0||(this.vertexBuffer=e.createVertexBuffer(this.vertexPositions,VR.members),this.vertexBufferNormal=e.createVertexBuffer(this.vertexNormals,$R.members),this.indexBuffer=e.createIndexBuffer(this.indexArray))}destroy(){this.vertexBuffer&&(this.vertexBuffer.destroy(),this.vertexBufferNormal.destroy(),this.indexBuffer.destroy()),this.maskSegments&&(this.maskSegments.destroy(),this.depthSegments.destroy(),this.renderableSegments.destroy(),this.shadowCasterSegments.destroy())}computeVertexConnections(e,r,c,h,m){const g=new Map;for(let b=h;b<m;b++){const T=c[b],E=T.a,I=T.b,M=ja.computePosHash(e[E]),k=ja.computePosHash(e[I]);g.has(M)||g.set(M,{}),g.has(k)||g.set(k,{});const B=g.get(M),N=g.get(k);r[E]<=0&&r[I]<=0||(B.to=I,N.from=E)}return g}constructBridgeStructures(e,r,c,h,m,g){const b=this.computeVertexConnections(r,c,h,m.min,m.max),T=1/g,E=.5*T,I=k=>Fi(r[k].x,r[k].y,c[k]*T),M=k=>{const B=b.get(ja.computePosHash(r[k])),N=B.from,U=B.to;if(!N||!U)return;const Y=I(N),J=I(k),ae=I(U),ne=Fi(0,0,0);if(!Fe(Y,J)){const te=Oe(Yt(),J,Y);ki(ne,ne,hn(te,te))}if(!Fe(ae,J)){const te=Oe(Yt(),ae,J);ki(ne,ne,hn(te,te))}const G=$t(ne);return G>0?Ue(ne,ne,1/G):void 0};for(let k=m.min;k<m.max;k++){const B=h[k],N=this.prepareEdgePoints(r,c,B,(wt,Ni)=>wt>Ni);if(N==null)continue;const U=N[0],Y=N[1],J=Fi(U.coord.x,U.coord.y,T*U.height),ae=Fi(Y.coord.x,Y.coord.y,T*Y.height);if(Fe(J,ae))continue;const ne=Oe(Yt(),ae,J);hn(ne,ne);const G=wt=>hn(wt,wt),te=M(B.a)||ne,oe=M(B.b)||ne,he=G(Fi(te[1],-te[0],0)),Te=G
594(Fi(oe[1],-oe[0],0)),Me=G(Ct(Yt(),he,te)),Pe=G(Ct(Yt(),Te,oe)),ze=Yt(),tt=[ki(Yt(),J,Ue(ze,Oe(ze,he,Me),E)),ki(Yt(),J,Ue(ze,ki(ze,he,Me),E)),ki(Yt(),J,Ue(ze,Me,E)),J],mt=[ki(Yt(),ae,Ue(ze,Oe(ze,Te,Pe),E)),ki(Yt(),ae,Ue(ze,ki(ze,Te,Pe),E)),ki(Yt(),ae,Ue(ze,Pe,E)),ae],[ut,pt]=e.addVertices(he,g,tt[0],tt[1]),[bt,Ye]=e.addVertices(Te,g,mt[0],mt[1]);e.addTriangles([ut,pt,bt,pt,Ye,bt]);const[ft,qe]=e.addVertices(Me,g,tt[1],tt[2]),[et,Tt]=e.addVertices(Pe,g,mt[1],mt[2]);e.addTriangles([ft,qe,et,qe,Tt,et]);const[St,li]=e.addVertices(On(he,he),g,tt[2],tt[3]),[Jt,Bt]=e.addVertices(On(Te,Te),g,mt[2],mt[3]);e.addTriangles([St,li,Jt,li,Bt,Jt])}}constructTunnelStructures(e,r,c,h,m,g){const b=T=>hn(T,T);for(let T=m.min;T<m.max;T++){const E=this.prepareEdgePoints(r,c,h[T],(B,N)=>B<N);if(E==null)continue;const[I,M]=E,k=b(Fi(M.coord.y-I.coord.y,-(M.coord.x-I.coord.x),0));e.addQuad([I,M,{coord:M.coord,height:h[T].isTunnel?-.1:0},{coord:I.coord,height:h[T].isTunnel?-.1:0}],k)}for(let T=g.min;T<g.max;T++){const E=h[T],I=r[E.a],M=r[E.b],k=b(Fi(M.y-I.y,-(M.x-I.x),0));e.addQuad([{coord:M,height:0},{coord:I,height:0},{coord:I,height:c[E.a]+4},{coord:M,height:c[E.b]+4}],k),e.addQuad([{coord:I,height:0},{coord:M,height:0},{coord:M,height:c[E.b]+4},{coord:I,height:c[E.a]+4}],k)}}prepareEdgePoints(e,r,c,h){let m=r[c.a],g=r[c.b];const b=h(m,0),T=h(g,0);if(b&&T)return[{coord:e[c.a],height:m},{coord:e[c.b],height:g}];if(!b&&!T)return;const E=e[c.a].clone(),I=e[c.b].clone();if(b){if(!T){const M=g/(g-m);I.x=gi(I.x,E.x,M),I.y=gi(I.y,E.y,M),g=gi(g,m,M)}}else{const M=m/(m-g);E.x=gi(E.x,I.x,M),E.y=gi(E.y,I.y,M),m=gi(m,g,M)}return[{coord:E,height:m},{coord:I,height:g}]}prepareEdges(e,r){if(r.length===0)return;r.sort((b,T)=>b.hash===T.hash?T.polygonIdx-b.polygonIdx:T.hash>b.hash?1:-1);let c=0,h=0,m=0,g=r[c].polygonIdx;do h++,(h===r.length||r[c].hash!==r[h].hash)&&((h-c==1||r[h-1].polygonIdx!==g)&&(m<c&&(r[m]=r[c],r[c]=null),r[m].type="none",m++),c=h,c!==r.length&&(g=r[c].polygonIdx));while(c!==r.length);if(r.splice(m),r.length!==0&&e.length!==0){r.sort((E,I)=>E.portalHash<I.portalHash?1:-1);let b=0,T=0;for(;b!==r.length&&T!==e.length;){const E=r[b],I=e[T];E.portalHash>I.hash?b++:I.hash>E.portalHash?T++:(E.type=I.type,b++)}}}isOnBorder(e,r){return e<=0&&r<=0||e>=Rt&&r>=Rt}static computeEdgeHash(e,r){return(e.y===r.y&&e.x>r.x||e.y>r.y)&&([e,r]=[r,e]),BigInt(ja.computePosHash(e))<<32n|BigInt(ja.computePosHash(r))}static computePosHash(e){return((65535&e.x)<<16|65535&e.y)>>>0}}var lE,cE={exports:{}},uE=(lE||(lE=1,function(a,e){(function(r){function c(le,de){return le>de?1:le<de?-1:0}var h=function(le,de){le===void 0&&(le=c),de===void 0&&(de=!1),this._compare=le,this._root=null,this._size=0,this._noDuplicates=!!de},m={size:{configurable:!0}};function g(le,de,nt,Pt,jt){var Nt=jt-Pt;if(Nt>0){var oi=Pt+Math.floor(Nt/2),Ai={key:de[oi],data:nt[oi],parent:le};return Ai.left=g(Ai,de,nt,Pt,oi),Ai.right=g(Ai,de,nt,oi+1,jt),Ai}return null}function b(le,de,nt,Pt,jt){if(!(nt>=Pt)){for(var Nt=le[nt+Pt>>1],oi=nt-1,Ai=Pt+1;;){do oi++;while(jt(le[oi],Nt)<0);do Ai--;while(jt(le[Ai],Nt)>0);if(oi>=Ai)break;var pn=le[oi];le[oi]=le[Ai],le[Ai]=pn,pn=de[oi],de[oi]=de[Ai],de[Ai]=pn}b(le,de,nt,Ai,jt),b(le,de,Ai+1,Pt,jt)}}h.prototype.rotateLeft=function(le){var de=le.right;de&&(le.right=de.left,de.left&&(de.left.parent=le),de.parent=le.parent),le.parent?le===le.parent.left?le.parent.left=de:le.parent.right=de:this._root=de,de&&(de.left=le),le.parent=de},h.prototype.rotateRight=function(le){var de=le.left;de&&(le.left=de.right,de.right&&(de.right.parent=le),de.parent=le.parent),le.parent?le===le.parent.left?le.parent.left=de:le.parent.right=de:this._root=de,de&&(de.right=le),le.parent=de},h.prototype._splay=function(le){for(;le.parent;){var de=le.parent;de.parent?de.left===le&&de.parent.left===de?(this.rotateRight(de.parent),this.rotateRight(de)):de.right===le&&de.parent.right===de?(this.rotateLeft(de.parent),this.rotateLeft(de)):de.left===le&&de.parent.right===de?(this.rotateRight(de),this.rotateLeft(de)):(this.rotateLeft(de),this.rotateRight(de)):de.left===le?this.rotateRight(de):this.rotateLeft(de)}},h.prototype.splay=function(le){for(var de,nt,Pt,jt,Nt;le.parent;
594)(nt=(de=le.parent).parent)&&nt.parent?((Pt=nt.parent).left===nt?Pt.left=le:Pt.right=le,le.parent=Pt):(le.parent=null,this._root=le),jt=le.left,Nt=le.right,le===de.left?(nt&&(nt.left===de?(de.right?(nt.left=de.right,nt.left.parent=nt):nt.left=null,de.right=nt,nt.parent=de):(jt?(nt.right=jt,jt.parent=nt):nt.right=null,le.left=nt,nt.parent=le)),Nt?(de.left=Nt,Nt.parent=de):de.left=null,le.right=de,de.parent=le):(nt&&(nt.right===de?(de.left?(nt.right=de.left,nt.right.parent=nt):nt.right=null,de.left=nt,nt.parent=de):(Nt?(nt.left=Nt,Nt.parent=nt):nt.left=null,le.right=nt,nt.parent=le)),jt?(de.right=jt,jt.parent=de):de.right=null,le.left=de,de.parent=le)},h.prototype.replace=function(le,de){le.parent?le===le.parent.left?le.parent.left=de:le.parent.right=de:this._root=de,de&&(de.parent=le.parent)},h.prototype.minNode=function(le){if(le===void 0&&(le=this._root),le)for(;le.left;)le=le.left;return le},h.prototype.maxNode=function(le){if(le===void 0&&(le=this._root),le)for(;le.right;)le=le.right;return le},h.prototype.insert=function(le,de){var nt=this._root,Pt=null,jt=this._compare;if(this._noDuplicates)for(;nt;){if(Pt=nt,jt(nt.key,le)===0)return;nt=jt(nt.key,le)<0?nt.right:nt.left}else for(;nt;)Pt=nt,nt=jt(nt.key,le)<0?nt.right:nt.left;return nt={key:le,data:de,left:null,right:null,parent:Pt},Pt?jt(Pt.key,nt.key)<0?Pt.right=nt:Pt.left=nt:this._root=nt,this.splay(nt),this._size++,nt},h.prototype.find=function(le){for(var de=this._root,nt=this._compare;de;){var Pt=nt(de.key,le);if(Pt<0)de=de.right;else{if(!(Pt>0))return de;de=de.left}}return null},h.prototype.contains=function(le){for(var de=this._root,nt=this._compare;de;){var Pt=nt(le,de.key);if(Pt===0)return!0;de=Pt<0?de.left:de.right}return!1},h.prototype.remove=function(le){var de=this.find(le);if(!de)return!1;if(this.splay(de),de.left)if(de.right){var nt=this.minNode(de.right);nt.parent!==de&&(this.replace(nt,nt.right),nt.right=de.right,nt.right.parent=nt),this.replace(de,nt),nt.left=de.left,nt.left.parent=nt}else this.replace(de,de.left);else this.replace(de,de.right);return this._size--,!0},h.prototype.removeNode=function(le){if(!le)return!1;if(this.splay(le),le.left)if(le.right){var de=this.minNode(le.right);de.parent!==le&&(this.replace(de,de.right),de.right=le.right,de.right.parent=de),this.replace(le,de),de.left=le.left,de.left.parent=de}else this.replace(le,le.left);else this.replace(le,le.right);return this._size--,!0},h.prototype.erase=function(le){var de=this.find(le);if(de){this.splay(de);var nt=de.left,Pt=de.right,jt=null;nt&&(nt.parent=null,jt=this.maxNode(nt),this.splay(jt),this._root=jt),Pt&&(nt?jt.right=Pt:this._root=Pt,Pt.parent=jt),this._size--}},h.prototype.pop=function(){var le=this._root,de=null;if(le){for(;le.left;)le=le.left;de={key:le.key,data:le.data},this.remove(le.key)}return de},h.prototype.next=function(le){var de=le;if(de)if(de.right)for(de=de.right;de&&de.left;)de=de.left;else for(de=le.parent;de&&de.right===le;)le=de,de=de.parent;return de},h.prototype.prev=function(le){var de=le;if(de)if(de.left)for(de=de.left;de&&de.right;)de=de.right;else for(de=le.parent;de&&de.left===le;)le=de,de=de.parent;return de},h.prototype.forEach=function(le){for(var de=this._root,nt=[],Pt=!1,jt=0;!Pt;)de?(nt.push(de),de=de.left):nt.length>0?(le(de=nt.pop(),jt++),de=de.right):Pt=!0;return this},h.prototype.range=function(le,de,nt,Pt){for(var jt=[],Nt=this._compare,oi=this._root;jt.length!==0||oi;)if(oi)jt.push(oi),oi=oi.left;else{if(Nt((oi=jt.pop()).key,de)>0)break;if(Nt(oi.key,le)>=0&&nt.call(Pt,oi))return this;oi=oi.right}return this},h.prototype.keys=function(){for(var le=this._root,de=[],nt=[],Pt=!1;!Pt;)le?(de.push(le),le=le.left):de.length>0?(le=de.pop(),nt.push(le.key),le=le.right):Pt=!0;return nt},h.prototype.values=function(){for(var le=this._root,de=[],nt=[],Pt=!1;!Pt;)le?(de.push(le),le=le.left):de.length>0?(le=de.pop(),nt.push(le.data),le=le.right):Pt=!0;return nt},h.prototype.at=function(le){for(var de=this._root,nt=[],Pt=!1,jt=0;!Pt;)if(de)nt.push(de),de=de.left;else if(nt.length>0){if(de=nt.pop(),jt===le)return de;jt++,de=de.right}else Pt=!0;return null},h.prototype.load=function(le,de,nt){if(le===void 0&&(le=[]),de===void 0&&(de=[]),nt===void 0&&(nt=!1),this._size!==0)throw new Error("bulk-load: tree is not empty");var Pt=le.length;return nt&&b(le,de,0,Pt-1,this._compare),this._root=g(null,le,de,0,Pt),this._size=Pt,this},h.prototype.min=function(){var le=this.minNode(this._root);return le?le.key:null},h.prototype.max=function(){var le=this.maxNode(this._root);return le?le.key:null},h.prototype.isEmpty=function(){return this._root===null},m.size.get=function(){return this._size},h.createTree=function(le,de,nt,Pt,jt){return new h(nt,jt).load(le,de,Pt)},Object.defineProperties(h.prototype,m);var T=0,E=1,I=2,M=3,k=0,B=1,N=2,U=3;function Y(le,de,nt){de===null?(le.inOut=!1,le.otherInOut=!0):(le.isSubject===de.isSubject?(le.inOut=!de.inOut,le.otherInOut=de.otherInOut):(le.inOut=!de.otherInOut,le.otherInOut=de.isVertical()?!de.inOut:de.inOut),de&&(le.prevInResult=!J(de,nt)||de.isVertical()?de.prevInResult:de));var Pt=J(le,nt);le.resultTransition=Pt?function(jt,Nt){var oi,Ai=!jt.inOut,pn=!jt.otherInOut;switch(Nt){case k:oi=Ai&&pn;break;case B:oi=Ai||pn;break;case U:oi=Ai^pn;break;case N:oi=jt.isSubject?Ai&&!pn:pn&&!Ai}return oi?1:-1}(le,nt):0}function J(le,de){switch(le.type){case T:switch(de){case k:return!le.otherInOut;case B:return le.otherInOut;case N:return le.isSubject&&le.otherInOut||!le.isSubject&&!le.otherInOut;case U:return!0}break;case I:return de===k||de===B;case M:return de===N;case E:return!1}return!1}var ae=function(le,de,nt,Pt,jt){this.left=de,this.point=le,this.otherEvent=nt,this.isSubject=Pt,this.type=jt||T,this.inOut=!1,this.otherInOut=!1,this.prevInResult=null,this.resultTransition=0,this.otherPos=-1,this.outputContourId=-1,this.isExteriorRing=!0},ne={inResult:{configurable:!0}};function G(le,de){return le[0]===de[0]&&le[1]===de[1]}
594ae.prototype.isBelow=function(le){var de=this.point,nt=this.otherEvent.point;return this.left?(de[0]-le[0])*(nt[1]-le[1])-(nt[0]-le[0])*(de[1]-le[1])>0:(nt[0]-le[0])*(de[1]-le[1])-(de[0]-le[0])*(nt[1]-le[1])>0},ae.prototype.isAbove=function(le){return!this.isBelow(le)},ae.prototype.isVertical=function(){return this.point[0]===this.otherEvent.point[0]},ne.inResult.get=function(){return this.resultTransition!==0},ae.prototype.clone=function(){var le=new ae(this.point,this.left,this.otherEvent,this.isSubject,this.type);return le.contourId=this.contourId,le.resultTransition=this.resultTransition,le.prevInResult=this.prevInResult,le.isExteriorRing=this.isExteriorRing,le.inOut=this.inOut,le.otherInOut=this.otherInOut,le},Object.defineProperties(ae.prototype,ne);var te=11102230246251565e-32,oe=134217729,he=(3+8*te)*te;function Te(le,de,nt,Pt,jt){var Nt,oi,Ai,pn,mn=de[0],sn=Pt[0],Xn=0,ds=0;sn>mn==sn>-mn?(Nt=mn,mn=de[++Xn]):(Nt=sn,sn=Pt[++ds]);var gn=0;if(Xn<le&&ds<nt)for(sn>mn==sn>-mn?(Ai=Nt-((oi=mn+Nt)-mn),mn=de[++Xn]):(Ai=Nt-((oi=sn+Nt)-sn),sn=Pt[++ds]),Nt=oi,Ai!==0&&(jt[gn++]=Ai);Xn<le&&ds<nt;)sn>mn==sn>-mn?(Ai=Nt-((oi=Nt+mn)-(pn=oi-Nt))+(mn-pn),mn=de[++Xn]):(Ai=Nt-((oi=Nt+sn)-(pn=oi-Nt))+(sn-pn),sn=Pt[++ds]),Nt=oi,Ai!==0&&(jt[gn++]=Ai);for(;Xn<le;)Ai=Nt-((oi=Nt+mn)-(pn=oi-Nt))+(mn-pn),mn=de[++Xn],Nt=oi,Ai!==0&&(jt[gn++]=Ai);for(;ds<nt;)Ai=Nt-((oi=Nt+sn)-(pn=oi-Nt))+(sn-pn),sn=Pt[++ds],Nt=oi,Ai!==0&&(jt[gn++]=Ai);return Nt===0&&gn!==0||(jt[gn++]=Nt),gn}function Me(le){return new Float64Array(le)}var Pe=33306690738754716e-32,ze=22204460492503146e-32,tt=11093356479670487e-47,mt=Me(4),ut=Me(8),pt=Me(12),bt=Me(16),Ye=Me(4);function ft(le,de,nt){var Pt=function(jt,Nt,oi,Ai,pn,mn){var sn=(Nt-mn)*(oi-pn),Xn=(jt-pn)*(Ai-mn),ds=sn-Xn;if(sn===0||Xn===0||sn>0!=Xn>0)return ds;var gn=Math.abs(sn+Xn);return Math.abs(ds)>=Pe*gn?ds:-function($s,vs,Wn,Js,ws,fs,xs){var Qn,an,ss,js,Ei,En,Ts,Xs,Ps,yr,ls,pr,oa,bo,oo,aa,fu,vr,Rr=$s-ws,wo=Wn-ws,Ro=vs-fs,Co=Js-fs;mt[0]=(oo=(Xs=Rr-(Ts=(En=oe*Rr)-(En-Rr)))*(yr=Co-(Ps=(En=oe*Co)-(En-Co)))-((bo=Rr*Co)-Ts*Ps-Xs*Ps-Ts*yr))-((ls=oo-(fu=(Xs=Ro-(Ts=(En=oe*Ro)-(En-Ro)))*(yr=wo-(Ps=(En=oe*wo)-(En-wo)))-((aa=Ro*wo)-Ts*Ps-Xs*Ps-Ts*yr)))+(Ei=oo-ls))+(Ei-fu),mt[1]=(oa=bo-((pr=bo+ls)-(Ei=pr-bo))+(ls-Ei))-((ls=oa-aa)+(Ei=oa-ls))+(Ei-aa),mt[2]=pr-((vr=pr+ls)-(Ei=vr-pr))+(ls-Ei),mt[3]=vr;var Md=function(yae,pC){for(var mC=pC[0],Qb=1;Qb<4;Qb++)mC+=pC[Qb];return mC}(0,mt),L_=ze*xs;if(Md>=L_||-Md>=L_||(Qn=$s-(Rr+(Ei=$s-Rr))+(Ei-ws),ss=Wn-(wo+(Ei=Wn-wo))+(Ei-ws),an=vs-(Ro+(Ei=vs-Ro))+(Ei-fs),js=Js-(Co+(Ei=Js-Co))+(Ei-fs),Qn===0&&an===0&&ss===0&&js===0)||(L_=tt*xs+he*Math.abs(Md),(Md+=Rr*js+Co*Qn-(Ro*ss+wo*an))>=L_||-Md>=L_))return Md;Ye[0]=(oo=(Xs=Qn-(Ts=(En=oe*Qn)-(En-Qn)))*(yr=Co-(Ps=(En=oe*Co)-(En-Co)))-((bo=Qn*Co)-Ts*Ps-Xs*Ps-Ts*yr))-((ls=oo-(fu=(Xs=an-(Ts=(En=oe*an)-(En-an)))*(yr=wo-(Ps=(En=oe*wo)-(En-wo)))-((aa=an*wo)-Ts*Ps-Xs*Ps-Ts*yr)))+(Ei=oo-ls))+(Ei-fu),Ye[1]=(oa=bo-((pr=bo+ls)-(Ei=pr-bo))+(ls-Ei))-((ls=oa-aa)+(Ei=oa-ls))+(Ei-aa),Ye[2]=pr-((vr=pr+ls)-(Ei=vr-pr))+(ls-Ei),Ye[3]=vr;var Nz=Te(4,mt,4,Ye,ut);Ye[0]=(oo=(Xs=Rr-(Ts=(En=oe*Rr)-(En-Rr)))*(yr=js-(Ps=(En=oe*js)-(En-js)))-((bo=Rr*js)-Ts*Ps-Xs*Ps-Ts*yr))-((ls=oo-(fu=(Xs=Ro-(Ts=(En=oe*Ro)-(En-Ro)))*(yr=ss-(Ps=(En=oe*ss)-(En-ss)))-((aa=Ro*ss)-Ts*Ps-Xs*Ps-Ts*yr)))+(Ei=oo-ls))+(Ei-fu),Ye[1]=(oa=bo-((pr=bo+ls)-(Ei=pr-bo))+(ls-Ei))-((ls=oa-aa)+(Ei=oa-ls))+(Ei-aa),Ye[2]=pr-((vr=pr+ls)-(Ei=vr-pr))+(ls-Ei),Ye[3]=vr;var Vz=Te(Nz,ut,4,Ye,pt);Ye[0]=(oo=(Xs=Qn-(Ts=(En=oe*Qn)-(En-Qn)))*(yr=js-(Ps=(En=oe*js)-(En-js)))-((bo=Qn*js)-Ts*Ps-Xs*Ps-Ts*yr))-((ls=oo-(fu=(Xs=an-(Ts=(En=oe*an)-(En-an)))*(yr=ss-(Ps=(En=oe*ss)-(En-ss)))-((aa=an*ss)-Ts*Ps-Xs*Ps-Ts*yr)))+(Ei=oo-ls))+(Ei-fu),Ye[1]=(oa=bo-((pr=bo+ls)-(Ei=pr-bo))+(ls-Ei))-((ls=oa-aa)+(Ei=oa-ls))+(Ei-aa),Ye[2]=pr-((vr=pr+ls)-(Ei=vr-pr))+(ls-Ei),Ye[3]=vr;var $z=Te(Vz,pt,4,Ye,bt);return bt[$z-1]}(jt,Nt,oi,Ai,pn,mn,gn)}(le[0],le[1],de[0],de[1],nt[0],nt[1]);return Pt>0?-1:Pt<0?1:0}function qe(le,de){var nt=le.point,Pt=de.point;return nt[0]>Pt[0]?1:nt[0]<Pt[0]?-1:nt[1]!==Pt[1]?nt[1]>Pt[1]?1:-1:function(jt,Nt,oi,Ai){return jt.left!==Nt.left?jt.left?1:-1:ft(oi,jt.otherEvent.point,Nt.otherEvent.point)!==0?jt.isBelow(Nt.otherEvent.point)?-1:1:!jt.isSubject&&Nt.isSubject?1:-1}(le,de,nt)}function et(le,de,nt){var Pt=new ae(de,!1,le,le.isSubject),jt=ne
594w ae(de,!0,le.otherEvent,le.isSubject);return G(le.point,le.otherEvent.point)&&console.warn("what is that, a collapsed segment?",le),Pt.contourId=jt.contourId=le.contourId,qe(jt,le.otherEvent)>0&&(le.otherEvent.left=!0,jt.left=!1),le.otherEvent.otherEvent=jt,le.otherEvent=Pt,nt.push(jt),nt.push(Pt),nt}function Tt(le,de){return le[0]*de[1]-le[1]*de[0]}function St(le,de){return le[0]*de[0]+le[1]*de[1]}function li(le,de,nt){var Pt=function(pn,mn,sn,Xn,ds){var gn=[mn[0]-pn[0],mn[1]-pn[1]],$s=[Xn[0]-sn[0],Xn[1]-sn[1]];function vs(En,Ts,Xs){return[En[0]+Ts*Xs[0],En[1]+Ts*Xs[1]]}var Wn=[sn[0]-pn[0],sn[1]-pn[1]],Js=Tt(gn,$s),ws=Js*Js,fs=St(gn,gn);if(ws>0){var xs=Tt(Wn,$s)/Js;if(xs<0||xs>1)return null;var Qn=Tt(Wn,gn)/Js;return Qn<0||Qn>1?null:xs===0||xs===1?[vs(pn,xs,gn)]:Qn===0||Qn===1?[vs(sn,Qn,$s)]:[vs(pn,xs,gn)]}if((ws=(Js=Tt(Wn,gn))*Js)>0)return null;var an=St(gn,Wn)/fs,ss=an+St(gn,$s)/fs,js=Math.min(an,ss),Ei=Math.max(an,ss);return js<=1&&Ei>=0?js===1?[vs(pn,js>0?js:0,gn)]:Ei===0?[vs(pn,Ei<1?Ei:1,gn)]:[vs(pn,js>0?js:0,gn),vs(pn,Ei<1?Ei:1,gn)]:null}(le.point,le.otherEvent.point,de.point,de.otherEvent.point),jt=Pt?Pt.length:0;if(jt===0||jt===1&&(G(le.point,de.point)||G(le.otherEvent.point,de.otherEvent.point))||jt===2&&le.isSubject===de.isSubject)return 0;if(jt===1)return G(le.point,Pt[0])||G(le.otherEvent.point,Pt[0])||et(le,Pt[0],nt),G(de.point,Pt[0])||G(de.otherEvent.point,Pt[0])||et(de,Pt[0],nt),1;var Nt=[],oi=!1,Ai=!1;return G(le.point,de.point)?oi=!0:qe(le,de)===1?Nt.push(de,le):Nt.push(le,de),G(le.otherEvent.point,de.otherEvent.point)?Ai=!0:qe(le.otherEvent,de.otherEvent)===1?Nt.push(de.otherEvent,le.otherEvent):Nt.push(le.otherEvent,de.otherEvent),oi&&Ai||oi?(de.type=E,le.type=de.inOut===le.inOut?I:M,oi&&!Ai&&et(Nt[1].otherEvent,Nt[0].point,nt),2):Ai?(et(Nt[0],Nt[1].point,nt),3):Nt[0]!==Nt[3].otherEvent?(et(Nt[0],Nt[1].point,nt),et(Nt[1],Nt[2].point,nt),3):(et(Nt[0],Nt[1].point,nt),et(Nt[3].otherEvent,Nt[2].point,nt),3)}function Jt(le,de){if(le===de)return 0;if(ft(le.point,le.otherEvent.point,de.point)!==0||ft(le.point,le.otherEvent.point,de.otherEvent.point)!==0)return G(le.point,de.point)?le.isBelow(de.otherEvent.point)?-1:1:le.point[0]===de.point[0]?le.point[1]<de.point[1]?-1:1:qe(le,de)===1?de.isAbove(le.point)?-1:1:le.isBelow(de.point)?-1:1;if(le.isSubject!==de.isSubject)return le.isSubject?-1:1;var nt=le.point,Pt=de.point;return nt[0]===Pt[0]&&nt[1]===Pt[1]?(nt=le.otherEvent.point)[0]===(Pt=de.otherEvent.point)[0]&&nt[1]===Pt[1]?0:le.contourId>de.contourId?1:-1:qe(le,de)===1?1:-1}var Bt=function(){this.points=[],this.holeIds=[],this.holeOf=null,this.depth=null};function wt(le,de,nt,Pt){var jt,Nt=le+1,oi=de[le].point,Ai=de.length;for(Nt<Ai&&(jt=de[Nt].point);Nt<Ai&&jt[0]===oi[0]&&jt[1]===oi[1];){if(!nt[Nt])return Nt;++Nt<Ai&&(jt=de[Nt].point)}for(Nt=le-1;nt[Nt]&&Nt>Pt;)Nt--;return Nt}Bt.prototype.isExterior=function(){return this.holeOf==null};var Ni=ri,si=ri;function ri(le,de){if(!(this instanceof ri))return new ri(le,de);if(this.data=le||[],this.length=this.data.length,this.compare=de||Oi,this.length>0)for(var nt=(this.length>>1)-1;nt>=0;nt--)this._down(nt)}function Oi(le,de){return le<de?-1:le>de?1:0}ri.prototype={push:function(le){this.data.push(le),this.length++,this._up(this.length-1)},pop:function(){if(this.length!==0){var le=this.data[0];return this.length--,this.length>0&&(this.data[0]=this.data[this.length],this._down(0)),this.data.pop(),le}},peek:function(){return this.data[0]},_up:function(le){for(var de=this.data,nt=this.compare,Pt=de[le];le>0;){var jt=le-1>>1,Nt=de[jt];if(nt(Pt,Nt)>=0)break;de[le]=Nt,le=jt}de[le]=Pt},_down:function(le){for(var de=this.data,nt=this.compare,Pt=this.length>>1,jt=de[le];le<Pt;){var Nt=1+(le<<1),oi=Nt+1,Ai=de[Nt];if(oi<this.length&&nt(de[oi],Ai)<0&&(Nt=oi,Ai=de[oi]),nt(Ai,jt)>=0)break;de[le]=Ai,le=Nt}de[le]=jt}},Ni.default=si;var Xi=Math.max,Ji=Math.min,ln=0;function rn(le,de,nt,Pt,jt,Nt){var oi,Ai,pn,mn,sn,Xn;for(oi=0,Ai=le.length-1;oi<Ai;oi++)if(mn=le[oi+1],sn=new ae(pn=le[oi],!1,void 0,de),Xn=new ae(mn,!1,sn,de),sn.otherEvent=Xn,pn[0]!==mn[0]||pn[1]!==mn[1]){sn.contourId=Xn.contourId=nt,Nt||(sn.isExteriorRing=!1,Xn.isExteriorRing=!1),qe(sn,Xn)>0?Xn.left=!0:sn.left=!0;var ds=pn[0],gn=pn[1];jt[0]=Ji(jt[0],ds),jt[1]=Ji(jt[1],gn),jt[2]=Xi(jt[2],ds),jt[3]=Xi(jt[3],gn),Pt.push(sn),Pt.push(Xn)}}var nn=[];function as(le,de,nt){typeof le[0][0][0]=="number"&&(le=[le]),typeof de[0][0][0]=="number"&&(de=[de]);var Pt=function(gn,$s,vs){var Wn=null;return gn.length*$s.length==0&&(vs===k?Wn=nn:vs===N?Wn=gn:vs!==B&&vs!==U||(Wn=gn.length===0?$s:gn)),Wn}(le,de,nt);if(Pt)return Pt===nn?null:Pt;var jt=[1/0,1/0,-1/0,-1/0],Nt=[1/0,1/0,-1/0,-1/0],oi=function(gn,$s,vs,Wn,Js){var ws,fs,xs,Qn,an,ss,js=new Ni(null,qe);for(xs=0,Qn=gn.length;xs<Qn;xs++)for(an=0,ss=(ws=gn[xs]).length;an<ss;an++)(fs=an===0)&&ln++,rn(ws[an],!0,ln,js,vs,fs);for(xs=0,Qn=$s.length;xs<Qn;xs++)for(an=0,ss=(ws=$s[xs]).length;an<ss;an++)fs=an===0,Js===N&&(fs=!1),fs&&ln++,rn(ws[an],!1,ln,js,Wn,fs);return js}(le,de,jt,Nt,nt);if(Pt=function(gn,$s,vs,Wn,Js){var ws=null;return(vs[0]>Wn[2]||Wn[0]>vs[2]||vs[1]>
594Wn[3]||Wn[1]>vs[3])&&(Js===k?ws=nn:Js===N?ws=gn:Js!==B&&Js!==U||(ws=gn.concat($s))),ws}(le,de,jt,Nt,nt))return Pt===nn?null:Pt;for(var Ai=function(gn){var $s,vs,Wn=function(xs){var Qn,an,ss,js,Ei=[];for(an=0,ss=xs.length;an<ss;an++)((Qn=xs[an]).left&&Qn.inResult||!Qn.left&&Qn.otherEvent.inResult)&&Ei.push(Qn);for(var En=!1;!En;)for(En=!0,an=0,ss=Ei.length;an<ss;an++)an+1<ss&&qe(Ei[an],Ei[an+1])===1&&(js=Ei[an],Ei[an]=Ei[an+1],Ei[an+1]=js,En=!1);for(an=0,ss=Ei.length;an<ss;an++)(Qn=Ei[an]).otherPos=an;for(an=0,ss=Ei.length;an<ss;an++)(Qn=Ei[an]).left||(js=Qn.otherPos,Qn.otherPos=Qn.otherEvent.otherPos,Qn.otherEvent.otherPos=js);return Ei}(gn),Js={},ws=[],fs=function(){if(!Js[$s]){var xs=ws.length,Qn=function(Ei,En,Ts){var Xs=new Bt;if(Ei.prevInResult!=null){var Ps=Ei.prevInResult,yr=Ps.outputContourId;if(Ps.resultTransition>0){var ls=En[yr];if(ls.holeOf!=null){var pr=ls.holeOf;En[pr].holeIds.push(Ts),Xs.holeOf=pr,Xs.depth=En[yr].depth}else En[yr].holeIds.push(Ts),Xs.holeOf=yr,Xs.depth=En[yr].depth+1}else Xs.holeOf=null,Xs.depth=En[yr].depth}else Xs.holeOf=null,Xs.depth=0;return Xs}(Wn[$s],ws,xs),an=function(Ei){Js[Ei]=!0,Ei<Wn.length&&Wn[Ei]&&(Wn[Ei].outputContourId=xs)},ss=$s,js=$s;for(Qn.points.push(Wn[$s].point);an(ss),an(ss=Wn[ss].otherPos),Qn.points.push(Wn[ss].point),!((ss=wt(ss,Wn,Js,js))==js||ss>=Wn.length)&&Wn[ss];);ws.push(Qn)}};for($s=0,vs=Wn.length;$s<vs;$s++)fs();return ws}(function(gn,$s,vs,Wn,Js,ws){for(var fs,xs,Qn,an=new h(Jt),ss=[],js=Math.min(Wn[2],Js[2]);gn.length!==0;){var Ei=gn.pop();if(ss.push(Ei),ws===k&&Ei.point[0]>js||ws===N&&Ei.point[0]>Wn[2])break;if(Ei.left){xs=fs=an.insert(Ei),fs=fs!==(Qn=an.minNode())?an.prev(fs):null,xs=an.next(xs);var En=fs?fs.key:null;if(Y(Ei,En,ws),xs&&li(Ei,xs.key,gn)===2&&(Y(Ei,En,ws),Y(xs.key,Ei,ws)),fs&&li(fs.key,Ei,gn)===2){var Ts=fs;Y(En,(Ts=Ts!==Qn?an.prev(Ts):null)?Ts.key:null,ws),Y(Ei,En,ws)}}else xs=fs=an.find(Ei=Ei.otherEvent),fs&&xs&&(fs=fs!==Qn?an.prev(fs):null,xs=an.next(xs),an.remove(Ei),xs&&fs&&li(fs.key,xs.key,gn))}return ss}(oi,0,0,jt,Nt,nt)),pn=[],mn=0;mn<Ai.length;mn++){var sn=Ai[mn];if(sn.isExterior()){for(var Xn=[sn.points],ds=0;ds<sn.holeIds.length;ds++)Xn.push(Ai[sn.holeIds[ds]].points);pn.push(Xn)}}return pn}var ys={UNION:B,DIFFERENCE:N,INTERSECTION:k,XOR:U};r.diff=function(le,de){return as(le,de,N)},r.intersection=function(le,de){return as(le,de,k)},r.operations=ys,r.union=function(le,de){return as(le,de,B)},r.xor=function(le,de){return as(le,de,U)},Object.defineProperty(r,"__esModule",{value:!0})})(e)}(0,cE.exports)),cE.exports);/** 595 * martinez v0.7.4 596 * Martinez polygon clipping algorithm, does boolean operation on polygons (multipolygons, polygons with holes etc): intersection, union, difference, xor 597 * 598 * @author Alex Milevski <[email protected]> 599 * @license MIT 600 * @preserve 601 */function M0(a,e,r,c){const h=[],m=c===0?(g,b,T,E,I,M)=>{g.push(new kt(M,T+(M-b)/(E-b)*(I-T)))}:(g,b,T,E,I,M)=>{g.push(new kt(b+(M-T)/(I-T)*(E-b),M))};for(const g of a){const b=[];for(const T of g){if(T.length<=2)continue;const E=[];for(let k=0;k<T.length-1;k++){const B=T[k].x,N=T[k].y,U=T[k+1].x,Y=T[k+1].y,J=c===0?B:N,ae=c===0?U:Y;J<e?ae>e&&m(E,B,N,U,Y,e):J>r?ae<r&&m(E,B,N,U,Y,r):E.push(T[k]),ae<e&&J>=e&&m(E,B,N,U,Y,e),ae>r&&J<=r&&m(E,B,N,U,Y,r)}let I=T[T.length-1];const M=c===0?I.x:I.y;M>=e&&M<=r&&E.push(I),E.length&&(I=E[E.length-1],E[0].x===I.x&&E[0].y===I.y||E.push(E[0]),b.push(E))}b.length&&h.push(b)}return h}function iO(a,e){const r=Y1(a),c=Y1([e]),h=uE.intersection(r,c);return h==null?[]:hE(h)}function nO(a,e){let c=Y1(a,65536);for(;e.valid();e.next()){const[h,m]=e.get(),g=h.x*65536,b=h.y*65536,T=m.x*65536,E=m.y*65536,I=T-g,M=E-b,k=Math.hypot(I,M),B=Math.trunc(M/k*3),N=-Math.trunc(I/k*3);c=uE.diff(c,[[[g,b],[T,E],[T+B,E+N],[g+B,b+N],[g,b]]])}return hE(c,1/65536)}function Y1(a,e=1){return[a.map(r=>r.map(c=>[c.x*e,c.y*e]))]}function hE(a,e=1){return a.map(r=>r.map((c,h)=>{const m=c.map(g=>new kt(g[0]*e,g[1]*e).round());return h>0&&m.reverse(),m}))}class K1{constructor(e,r){this.layoutVertexArray=new Ec,this.indexArray=new Vr,this.lineIndexArray=new au,this.triangleSegments=new Vs,this.lineSegments=new Vs,this.programConfigurations=new rh(e.layers,{zoom:e.zoom,lut:e.lut}),this.uploaded=!1,r&&(this.elevatedLayoutVertexArray=new dd)}update(e,r,c,h,m,g,b){this.programConfigurations.updatePaintArrays(e,r,m,c,h,g,b)}isEmpty(){return this.layoutVertexArray.length===0}needsUpload(){return this.programConfigurations.needsUpload}upload(e){this.uploaded||(this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,BR.members),this.indexBuffer=e.createIndexBuffer(this.indexArray),this.lineIndexBuffer=e.createIndexBuffer(this.lineIndexArray),this.elevatedLayoutVertexArray&&this.elevatedLayoutVertexArray.length>0&&(this.elevatedLayoutVertexBuffer=e.createVertexBuffer(this.elevatedLayoutVertexArray,NR.members))),this.programConfigurations.upload(e),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.elevatedLayoutVertexBuffer&&this.elevatedLayoutVertexBuffer.destroy(),this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.lineIndexBuffer.destroy(),this.programConfigurations.destroy(),this.triangleSegments.destroy(),this.lineSegments.destroy())}populatePaintArrays(e,r,c,h,m,g){this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,e,r,c,h,m,g)}}class J1{constructor(e){this.zoom=e.zoom,this.pixelRatio=e.pixelRatio,this.overscaling=e.overscaling,this.layers=e.layers,this.layerIds=this.layers.map(r=>r.fqid),this.index=e.index,this.hasPattern=!1,this.patternFeatures=[],this.bufferData=new K1(e,!1),this.elevationBufferData=new K1(e,!0),this.stateDependentLayerIds=this.layers.filter(r=>r.isStateDependent()).map(r=>r.id),this.projection=e.projection,this.elevationMode=this.layers[0].layout.get("fill-elevation-reference")}updateFootprints(e,r){}populate(e,r,c,h){this.hasPattern=U1("fill",this.layers,this.pixelRatio,r);const m=this.layers[0].layout.get("fill-sort-key"),g=[];for(const{feature:b,id:T,index:E,sourceLayerIndex:I}of e){const M=this.layers[0]._featureFilter.needGeometry,k=ci(b,M);if(!this.layers[0]._featureFilter.filter(new Un(this.zoom),k,c))continue;const B=m?m.evaluate(k,{},c,r.availableImages):void 0,N={id:T,properties:b.properties,type:b.type,sourceLayerIndex:I,index:E,geometry:M?k.geometry:Qt(b,c,h),patterns:{},sortKey:B};g.push(N)}m&&g.sort((b,T)=>b.sortKey-T.sortKey);for(const b of g){const{geometry:T,index:E,sourceLayerIndex:I}=b;if(this.hasPattern){const M=H1("fill",this.layers,b,this.zoom,this.pixelRatio,r);this.patternFeatures.push(M)}else this.addFeature(b,T,E,c,{},r.availableImages,r.brightness,r.elevationFeatures);r.featureIndex.insert(e[E].feature,T,E,I,this.index)}}update(e,r,c,h,m,g,b){this.bufferData.update(e,r,c,h,m,g,b),this.elevationBufferData.update(e,r,c,h,m,g,b)}addFeatures(e,r,c,h,m,g){for(const b of this.patternFeatures)this.addFeature(b,b.geometry,b.index,r,c,h,g,e.elevationFeatures)}isEmpty(){return this.bufferData.isEmpty()&&this.elevationBufferData.isEmpty()}uploadPending(){return!this.uploaded||this.bufferData.needsUpload()||this.elevationBufferData.needsUpload()}upload(e){this.bufferData.upload(e),this.elevationBufferData.upload(e),this.elevatedStructures&&this.elevatedStructures.upload(e)}destroy(){this.bufferData.destroy(),this.elevationBufferData.destroy(),this.elevatedStructures&&this.elevatedStructures.destroy()}
601addFeature(e,r,c,h,m,g=[],b,T){const E=C0(r,500);this.elevationMode!=="none"?this.addElevatedRoadFeature(e,E,h,c,T):this.addGeometry(E,this.bufferData),this.bufferData.populatePaintArrays(e,c,m,g,h,b),this.elevationBufferData.populatePaintArrays(e,c,m,g,h,b)}getUnevaluatedPortalGraph(){return this.elevatedStructures?this.elevatedStructures.unevaluatedPortals:void 0}getElevationPolygons(){return this.elevatedStructures?this.elevatedStructures.portalPolygons:void 0}setEvaluatedPortalGraph(e){this.elevatedStructures&&this.elevatedStructures.construct(e)}addElevatedRoadFeature(e,r,c,h,m){const g=new Array,b=X1.getElevationFeature(e,m);if(b){{const T=this.clipPolygonsToTile(r,1);T.length>0&&g.push({polygons:T,elevationFeature:b,elevationTileID:c})}for(const T of g)if(T.elevationFeature){if(this.elevationMode==="hd-road-base"){this.elevatedStructures||(this.elevatedStructures=new ja(T.elevationTileID));const I=T.elevationFeature.isTunnel();let M=0;e.properties.hasOwnProperty(nE)&&(M=+e.properties[nE]);for(const k of T.polygons)this.elevatedStructures.addPortalCandidates(T.elevationFeature.id,k,I,T.elevationFeature,M)}T.elevationFeature.constantHeight==null&&(T.polygons=this.prepareElevatedPolygons(T.polygons,T.elevationFeature,T.elevationTileID));const E=new oE(c,T.elevationTileID);this.addElevatedGeometry(T.polygons,E,T.elevationFeature,this.elevationMode==="hd-road-base"?0:.05,h)}}else this.addGeometry(r,this.bufferData)}addElevatedGeometry(e,r,c,h,m){const g={elevation:c,elevationSampler:r,bias:h,index:m},[b,T]=this.addGeometry(e,this.elevationBufferData,g);this.elevationBufferData.heightRange==null?this.elevationBufferData.heightRange={min:b,max:T}:(this.elevationBufferData.heightRange.min=Math.min(this.elevationBufferData.heightRange.min,b),this.elevationBufferData.heightRange.max=Math.max(this.elevationBufferData.heightRange.max,T))}addGeometry(e,r,c){let h=Number.POSITIVE_INFINITY,m=Number.NEGATIVE_INFINITY,g=null;c&&(g=c.elevationSampler.constantElevation(c.elevation,c.bias),g!=null&&(h=g,m=g));const b=(T,E,I)=>
vendor: 18,909 bytes, line 601
601{if(c!=null)if(E.push(T),g!=null)r.elevatedLayoutVertexArray.emplaceBack(g),I.push(g);else{const M=c.elevationSampler.pointElevation(T,c.elevation,c.bias);r.elevatedLayoutVertexArray.emplaceBack(M),I.push(M),h=Math.min(h,M),m=Math.max(m,M)}};for(const T of e){let E=0;for(const ne of T)E+=ne.length;const I=r.triangleSegments.prepareSegment(E,r.layoutVertexArray,r.indexArray),M=I.vertexLength,k=[],B=[],N=[],U=[],Y=[],J=r.layoutVertexArray.length;for(const ne of T){if(ne.length===0)continue;ne!==T[0]&&B.push(k.length/2);const G=r.lineSegments.prepareSegment(ne.length,r.layoutVertexArray,r.lineIndexArray),te=G.vertexLength;c&&Y.push(r.layoutVertexArray.length-J),b(ne[0],N,U),r.layoutVertexArray.emplaceBack(ne[0].x,ne[0].y),r.lineIndexArray.emplaceBack(te+ne.length-1,te),k.push(ne[0].x),k.push(ne[0].y);for(let oe=1;oe<ne.length;oe++)b(ne[oe],N,U),r.layoutVertexArray.emplaceBack(ne[oe].x,ne[oe].y),r.lineIndexArray.emplaceBack(te+oe-1,te+oe),k.push(ne[oe].x),k.push(ne[oe].y);G.vertexLength+=ne.length,G.primitiveLength+=ne.length}const ae=t_(k,B);for(let ne=0;ne<ae.length;ne+=3)r.indexArray.emplaceBack(M+ae[ne],M+ae[ne+1],M+ae[ne+2]);if(ae.length>0&&c&&this.elevationMode==="hd-road-base"){const ne=c.elevation.isTunnel(),G=c.elevation.safeArea,te=this.elevatedStructures.addVertices(N,U);this.elevatedStructures.addTriangles(ae,te,ne);const oe=Y.length;if(oe>0){for(let he=0;he<oe-1;he++)this.elevatedStructures.addRenderableRing(c.index,Y[he]+te,Y[he+1]-Y[he],ne,G);this.elevatedStructures.addRenderableRing(c.index,Y[oe-1]+te,N.length-Y[oe-1],ne,G)}}I.vertexLength+=E,I.primitiveLength+=ae.length/3}return[h,m]}prepareElevatedPolygons(e,r,c){const h=1/Be(c),m=[];for(const g of e){const b=nO(g,new rE(r,h));m.push(...b)}return m}clipPolygonsToTile(e,r){const c=-r,h=-r,m=Rt+r,g=Rt+r;let b=0;const T=[],E=[];for(;b<e.length;b++){const k=e[b],B=Uh(k);(B.min.x>=c&&B.max.x<=m&&B.min.y>=h&&B.max.y<=g?T:E).push(k)}if(T.length===e.length)return e;const I=[new kt(c,h),new kt(m,h),new kt(m,g),new kt(c,g),new kt(c,h)],M=T;for(const k of E)M.push(...iO(k,I));return M}}let dE,fE,pE,mE;Vt(J1,"FillBucket",{omit:["layers","patternFeatures"]}),Vt(K1,"FillBufferData"),Vt(ja,"ElevatedStructures");class Q1{constructor(e,r,c,h){if(this.triangleCount=r.length/3,this.min=new kt(0,0),this.max=new kt(0,0),this.xScale=0,this.yScale=0,this.cellsX=0,this.cellsY=0,this.cells=[],this.payload=[],this.triangleCount===0||e.length===0)return;const[m,g]=[e[0].clone(),e[0].clone()];for(let M=1;M<e.length;++M){const k=e[M];m.x=Math.min(m.x,k.x),m.y=Math.min(m.y,k.y),g.x=Math.max(g.x,k.x),g.y=Math.max(g.y,k.y)}if(h){const M=Math.ceil(Math.max(g.x-m.x,g.y-m.y)/h);c=Math.max(c,M)}if(c===0)return;this.min=m,this.max=g;const b=this.max.sub(this.min);b.x=Math.max(b.x,1),b.y=Math.max(b.y,1);const T=Math.max(b.x,b.y)/c;this.cellsX=Math.max(1,Math.ceil(b.x/T)),this.cellsY=Math.max(1,Math.ceil(b.y/T)),this.xScale=1/T,this.yScale=1/T;const E=[];for(let M=0;M<this.triangleCount;M++){const k=e[r[3*M+0]].sub(this.min),B=e[r[3*M+1]].sub(this.min),N=e[r[3*M+2]].sub(this.min),U=hu(Math.floor(Math.min(k.x,B.x,N.x)),this.xScale,this.cellsX),Y=hu(Math.floor(Math.max(k.x,B.x,N.x)),this.xScale,this.cellsX),J=hu(Math.floor(Math.min(k.y,B.y,N.y)),this.yScale,this.cellsY),ae=hu(Math.floor(Math.max(k.y,B.y,N.y)),this.yScale,this.cellsY),ne=new kt(0,0),G=new kt(0,0),te=new kt(0,0),oe=new kt(0,0);for(let he=J;he<=ae;++he){ne.y=G.y=he*T,te.y=oe.y=(he+1)*T;for(let Te=U;Te<=Y;++Te)ne.x=te.x=Te*T,G.x=oe.x=(Te+1)*T,(ks(k,B,N,ne,G,oe)||ks(k,B,N,ne,oe,te))&&E.push({cellIdx:he*this.cellsX+Te,triIdx:M})}}if(E.length===0)return;E.sort((M,k)=>M.cellIdx-k.cellIdx||M.triIdx-k.triIdx);let I=0;for(;I<E.length;){const M=E[I].cellIdx,k={start:this.payload.length,len:0};for(;I<E.length&&E[I].cellIdx===M;)++k.len,this.payload.push(E[I++].triIdx);this.cells[M]=k}}_lazyInitLookup(){this.lookup||(this.lookup=new Uint8Array(Math.ceil(this.triangleCount/8))),this.lookup.fill(0)}queryPoint(e,r){if(this.triangleCount===0||this.cells.length===0||e.x>this.max.x||this.min.x>e.x||e.y>this.max.y||this.min.y>e.y)return;const c=hu(e.x-this.min.x,this.xScale,this.cellsX),h=hu(e.y-this.min.y,this.yScale,this.cellsY),m=this.cells[h*this.cellsX+c];if(m){this._lazyInitLookup();for(let g=0;g<m.len;g++){const b=this.payload[m.start+g],T=Math.floor(b/8),E=1<<b%8;if(!(this.lookup[T]&E)&&(this.lookup[T]|=E,r.push(b),r.length===this.triangleCount))return}}}query(e,r,c){if(this.triangleCount===0||this.cells.length===0||e.x>this.max.x||this.min.x>r.x||e.y>this.max.y||this.min.y>r.y)return;this._lazyInitLookup();const h=hu(e.x-this.min.x,this.xScale,this.cellsX),m=hu(r.x-this.min.x,this.xScale,this.cellsX),g=hu(e.y-this.min.y,this.yScale,this.cellsY),b=hu(r.y-this.min.y,this.yScale,this.cellsY);for(let T=g;T<=b;T++)for(let E=h;E<=m;E++){const I=this.cells[T*this.cellsX+E];if(I)for(let M=0;M<I.len;M++){const k=this.payload[I.start+M],B=Math.floor(k/8),N=1<<k%8;if(!(this.lookup[B]&N)&&(this.lookup[B]|=N,c.push(k),c.length===this.triangleCount))return}}}}function hu(a,e,r){return Math.max(0,Math.min(r-1,Math.floor(a*e)))}Vt(Q1,"TriangleGridIndex");class gE{constructor(e){this.zoom=e.zoom,this.layers=e.layers,this.layerIds=this.layers.map(r=>r.fqid),this.index=e.index,this.hasPattern=!1,this.stateDependentLayerIds=this.layers.filter(r=>r.isStateDependent()).map(r=>r.id),this.footprints=[]}updateFootprints(e,r){for(const c of this.footprints)r.push({footprint:c,id:e})}populate(e,r,c,h){const m=[];for(const{feature:g,id:b,index:T,sourceLayerIndex:E}of e){const I=this.layers[0]._featureFilter.needGeometry,M=ci(g,I);if(!this.layers[0]._featureFilter.filter(new Un(this.zoom),M,c))continue;const k={id:b,properties:g.properties,type:g.type,sourceLayerIndex:E,index:T,geometry:I?M.geometry:Qt(g,c,h),patterns:{}};m.push(k)}for(const g of m){const{geometry:b,index:T,sourceLayerIndex:E}=g;this.addFeature(g,b,T,c,{},r.availableImages,r.brightness),r.featureIndex.insert(e[T].feature,b,T,E,this.index)}}isEmpty(){return this.footprints.length===0}uploadPending(){return!1}upload(e){}update(e,r,c,h,m,g,b){}destroy(){}addFeature(e,r,c,h,m,g=[],b){for(const T of C0(r,2)){const E=[],I=[],M=[],k=new kt(1/0,1/0),B=new kt(-1/0,-1/0);for(const Y of T)if(Y.length!==0){Y!==T[0]&&M.push(I.length/2);for(let J=0;J<Y.length;J++)I.push(Y[J].x),I.push(Y[J].y),E.push(Y[J]),k.x=Math.min(k.x,Y[J].x),k.y=Math.min(k.y,Y[J].y),B.x=Math.max(B.x,Y[J].x),B.y=Math.max(B.y,Y[J].y)}const N=t_(I,M),U=new Q1(E,N,8,256);this.footprints.push({vertices:E,indices:N,grid:U,min:k,max:B})}}}Vt(gE,"ClipBucket",{omit:["layers"]});const sO=Rn([{name:"a_pos_normal_ed",components:4,type:"Int16"}]),rO=Rn([{name:"a_pos_end",components:4,type:"Int16"},{name:"a_angular_offset_factor",components:1,type:"Int16"}]),oO=Rn([{name:"a_centroid_pos",components:2,type:"Uint16"}]),aO=Rn([{name:"a_join_normal_inside",components:3,type:"Int16"}]),lO=Rn([{name:"a_hidden_by_landmark",components:1,type:"Uint8"}]),cO=Rn([{name:"a_pos_3",components:3,type:"Int16"},{name:"a_pos_normal_3",components:3,type:"Int16"}]),{members:uO}=sO,P0=Number.MAX_SAFE_INTEGER;function _E(a,e,r,c){return a.order<e||a.order===P0||!(a.clipMask&r)||function(h,m){return m.length!==0&&m.find(g=>g===h)===void 0}(c,a.clipScope)}function D0(a,e){return a.x-e.x||a.y-e.y}function yE(a,e){return D0(a.min,e.min)===0&&D0(a.max,e.max)===0}function eb(a,e){return!(a.min.x>e.max.x||a.max.x<e.min.x||a.min.y>e.max.y||a.max.y<e.min.y)}function tb(a,e){if(a.length!==e.length)return!1;for(let r=0;r<a.length;r++)if(a[r].sourceId!==e[r].sourceId||!yE(a[r],e[r])||a[r].order!==e[r].order||a[r].clipMask!==e[r].clipMask||!Za(a[r].clipScope,e[r].clipScope))return!1;return!0}function vE(a,e,r){const c=1/Rt,h=1/(1<<r.canonical.z),m=(e.x*c+r.canonical.x)*h+r.wrap,g=(e.y*c+r.canonical.y)*h;return{min:new kt((a.x*c+r.canonical.x)*h+r.wrap,(a.y*c+r.canonical.y)*h),max:new kt(m,g)}}function hO(a,e,r){const c=1<<r.canonical.z,h=((e.x-r.wrap)*c-r.canonical.x)*Rt,m=(e.y*c-r.canonical.y)*Rt;return{min:new kt(((a.x-r.wrap)*c-r.canonical.x)*Rt,(a.y*c-r.canonical.y)*Rt),max:new kt(h,m)}}function xE(a,e,r,c,h,m,g){const b=a.indices,T=a.vertices,E=[];for(let I=c;I<c+h;I+=3){const M=e[r[I+0]+m],k=e[r[I+1]+m],B=e[r[I+2]+m],N=Math.min(M.x,k.x,B.x),U=Math.max(M.x,k.x,B.x),Y=Math.min(M.y,k.y,B.y),J=Math.max(M.y,k.y,B.y);E.length=0,a.grid.query(new kt(N,Y),new kt(U,J),E);for(let ae=0;ae<E.length;ae++){const ne=E[ae];if(ks(T[b[3*ne+0]],T[b[3*ne+1]],T[b[3*ne+2]],M,k,B,g))return!0}}return!1}function bE(a,e,r,c){if(!a||!r)return!1;let h=a.vertices;if(!e.canonical.equals(c.canonical)||e.wrap!==c.wrap){if(r.vertices.length<a.vertices.length)return bE(r,c,a,e);const m=e.canonical,g=c.canonical,b=Math.pow(2,g.z-m.z);h=a.vertices.map(T=>new kt((T.x+m.x*Rt)*b-g.x*Rt,(T.y+m.y*Rt)*b-g.y*Rt))}return xE(r,h,a.indices,0,a.indices.length,0,0)}function wE(a,e,r,c){const h=Math.pow(2,c.z-r.z);return new kt((a+r.x*Rt)*h-c.x*Rt,(e+r.y*Rt)*h-c.y*Rt)}function TE(a,e){const r=[];e.grid.queryPoint(a,r);const c=e.indices,h=e.vertices;for(let m=0;m<r.length;m++){const g=r[m];if(ns([h[c[3*g+0]],h[c[3*g+1]],h[c[3*g+2]]],a))return!0}return!1}const ib=[new kt(0,0),new kt(Rt,0),new kt(Rt,Rt),new kt(0,Rt)];function SE(a,e){const r=[];let c=[];if(!e||a.length<2)return[a];if(a.length===2)return Ks(a[0],a[1],ib)?[a]:[];for(let h=0;h<a.length+2;h++){const m=a[h%a.length],g=a[(h+1)%a.length],b=Ks(h===0?a[a.length-1]:a[(h-1)%a.length],m,ib),T=Ks(m,g,ib),E=b||T;E&&c.push(m),E&&T||c.length>0&&(c.length>1&&r.push(c),c=[])}return c.length>1&&r.push(c),r}const nb=Td.VectorTileFeature.types,dO=["fill-extrusion-base","fill-extrusion-height","fill-extrusion-color","fill-extrusion-pattern","fill-extrusion-flood-light-wall-radius","fill-extrusion-line-width","fill-extrusion-emissive-strength"],fO=["fill-extrusion-flood-light-ground-radius"],pO=Math.pow(2,13),mO=Math.pow(2,15)-1,EE=new kt(0,1),Sd=2147483648;function o_(a,e,r,c,h,m,g,b){a.emplaceBack((e<<1)+g,(r<<1)+m,(Math.floor(c*pO)<<1)+h,Math.round(b))}function a_(a,e,r){a.emplaceBack(e.x*Rt,e.y*Rt,r?1:0)}function k0(a,e,r,c,h,m){a.emplaceBack(e.x,e.y,(r.x<<1)+c,(r.y<<1)+h,m)}function l_(a,e,r){a.emplaceBack(e.x,e.y,e.z,r[0]*16384,r[1]*16384,r[2]*16384)}class AE{constructor(){this.vertexOffset=0,this.vertexCount=0,this.indexOffset=0,this.indexCount=0}}class CE{constructor(){this.centroidXY=new kt(0,0),this.vertexArrayOffset=0,this.vertexCount=0,this.groundVertexArrayOffset=0,this.groundVertexCount=0,this.flags=0,this.footprintSegIdx=-1,this.footprintSegLen=0,this.polygonSegIdx=-1,this.polygonSegLen=0,this.min=new kt(Number.MAX_VALUE,Number.MAX_VALUE),this.max=new kt(-Number.MAX_VALUE,-Number.MAX_VALUE),this.height=0}span(){return new kt(this.max.x-this.min.x,this.max.y-this.min.y)}}class IE{constructor(){this.acc=new kt(0,0),this.accCount=0,this.centroidDataIndex=0}startRing(e,r){e.min.x===Number.MAX_VALUE&&(e.min.x=e.max.x=r.x,e.min.y=e.max.y=r.y)}appendEdge(e,r,c){this.accCount++,this.acc._add(r);let h=!!this.borders;r.x<e.min.x?(e.min.x=r.x,h=!0):r.x>e.max.x&&(e.max.x=r.x,h=!0),r.y<e.min.y?(e.min.y=r.y,h=!0):r.y>e.max.y&&(e.max.y=r.y,h=!0),((r.x===0||r.x===Rt)&&r.x===c.x)!=((r.y===0||r.y===Rt)&&r.y===c.y)&&this.processBorderOverlap(r,c),h&&this.checkBorderIntersection(r,c)}checkBorderIntersection(e,r){r.x<0!=e.x<0&&this.addBorderIntersection(0,gi(r.y,e.y,(0-r.x)/(e.x-r.x))),r.x>Rt!=e.x>Rt&&this.addBorderIntersection(1,gi(r.y,e.y,(Rt-r.x)/(e.x-r.x))),r.y<0!=e.y<0&&this.addBorderIntersection(2,gi(r.x,e.x,(0-r.y)/(e.y-r.y))),r.y>Rt!=e.y>Rt&&this.addBorderIntersection(3,gi(r.x,e.x,(Rt-r.y)/(e.y-r.y)))}addBorderIntersection(e,r){this.borders||(this.borders=[[Number.MAX_VALUE,-Number.MAX_VALUE],[Number.MAX_VALUE,-Number.MAX_VALUE],[Number.MAX_VALUE,-Number.MAX_VALUE],[Number.MAX_VALUE,-Number.MAX_VALUE]]);const c=this.borders[e];r<c[0]&&(c[0]=r),r>c[1]&&(c[1]=r)}processBorderOverlap(e,r){if(e.x===r.x){if(e.y===r.y)return;const c=e.x===0?0:1;this.addBorderIntersection(c,r.y),this.addBorderIntersection(c,e.y)}else{const c=e.y===0?2:3;this.addBorderIntersection(c,r.x),this.addBorderIntersection(c,e.x)}}centroid(){return this.accCount===0?new kt(0,0):new kt(Math.floor(Math.max(0,this.acc.x)/this.accCount),Math.floor(Math.max(0,this.acc.y)/this.accCount))}intersectsCount(){return this.borders?this.borders.reduce((e,r)=>e+ +(r[0]!==Number.MAX_VALUE),0):0}}function ME(a,e){const r=a.add(e)._unit(),c=ke(a.x*r.x+a.y*r.y,-1,1);var h,m,g;return h=Math.acos(c),Math.min(4,Math.max(-4,Math.tan(h)))/4*mO*((m=a).x*(g=e).y-m.y*g.x<0?-1:1)}const gO=[a=>a.x<0,a=>a.x>Rt,a=>a.y<0,a=>a.y>Rt];function _O(a,e,r,c){const h=[4];if(c===0)return h;r._mult(c);const m=a.sub(r),g=e.sub(r),b=[a,e,m,g];for(let T=0;T<4;T++)for(const E of b)if(gO[T](E)){h.push(T);break}return h}class PE{constructor(e){this.vertexArray=new Vg,this.indexArray=new Vr,this.programConfigurations=new rh(e.layers,{zoom:e.zoom,lut:e.lut},r=>fO.includes(r)),this._segments=new Vs,this.hiddenByLandmarkVertexArray=new gm,this._segmentToGroundQuads={},this._segmentToGroundQuads[0]=[],this._segmentToRegionTriCounts={},this._segmentToRegionTriCounts[0]=[0,0,0,0,0],this.regionSegments={},this.regionSegments[4]=new Vs}getDefaultSegment(){return this.regionSegments[4]}hasData(){return this.vertexArray.length!==0}addData(e,r,c,h=!1){const m=e.length;if(m>2){let g=Math.max(0,this._segments.get().length-1);const b=this._segments._prepareSegment(4*m,this.vertexArray.length,2*this._segmentToGroundQuads[g].length);let T;g!==this._segments.get().length-1&&(g++,this._segmentToGroundQuads[g]=[],this._segmentToRegionTriCounts[g]=[0,0,0,0,0]);{const E=e[0],I=e[1];T=ME(E.sub(e[m-1])._perp()._unit(),I.sub(E)._perp()._unit())}for(let E=0;E<m;E++){const I=E===m-1?0:E+1,M=e[E],k=e[I],B=e[I===m-1?0:I+1],N=k.sub(M)._perp()._unit(),U=ME(N,B.sub(k)._perp()._unit()),Y=T,J=U;if(sb(M,k,r)||h&&LE(M,r)&&LE(k,r)){T=U;continue}const ae=b.vertexLength;k0(this.vertexArray,M,k,1,1,Y),k0(this.vertexArray,M,k,1,0,Y),k0(this.vertexArray,M,k,0,1,J),k0(this.vertexArray,M,k,0,0,J),b.vertexLength+=4;const ne=_O(M,k,N,c);for(const G of ne)this._segmentToGroundQuads[g].push({id:ae,region:G}),this._segmentToRegionTriCounts[g][G]+=2,b.primitiveLength+=2;T=U}}}prepareBorderSegments(){if(!this.hasData())return;const e=this._segments.get(),r=e.length;for(let c=0;c<r;c++)this._segmentToGroundQuads[c].sort((h,m)=>h.region-m.region);for(let c=0;c<r;c++){const h=this._segmentToGroundQuads[c],m=e[c],g=this._segmentToRegionTriCounts[c];g.reduce((T,E)=>T+E,0);let b=0;for(let T=0;T<=4;T++){const E=g[T];if(E!==0){let I=this.regionSegments[T];I||(I=this.regionSegments[T]=new Vs);const M={vertexOffset:m.vertexOffset,primitiveOffset:m.primitiveOffset+b,vertexLength:m.vertexLength,primitiveLength:E};I.get().push(M)}b+=E}for(let T=0;T<h.length;T++){const E=h[T].id;this.indexArray.emplaceBack(E,E+1,E+3),this.indexArray.emplaceBack(E,E+3,E+2)}}this._segmentToGroundQuads=null,this._segmentToRegionTriCounts=null,this._segments.destroy(),this._segments=null}addPaintPropertiesData(e,r,c,h,m,g){this.hasData()&&this.programConfigurations.populatePaintArrays(this.vertexArray.length,e,r,c,h,m,g)}upload(e){this.hasData()&&(this.vertexBuffer=e.createVertexBuffer(this.vertexArray,rO.members),this.indexBuffer=e.createIndexBuffer(this.indexArray))}uploadPaintProperties(e){this.hasData()&&this.programConfigurations.upload(e)}update(e,r,c,h,m,g,b){this.hasData()&&this.programConfigurations.updatePaintArrays(e,r,c,h,m,g,b)}updateHiddenByLandmark(e){if(!this.hasData())return;const r=e.groundVertexCount+e.groundVertexArrayOffset;if(e.groundVertexCount===0)return;const c=e.flags&Sd?1:0;for(let h=e.groundVertexArrayOffset;h<r;++h)this.hiddenByLandmarkVertexArray.emplace(h,c);this._needsHiddenByLandmarkUpdate=!0}uploadHiddenByLandmark(e){this.hasData()&&this._needsHiddenByLandmarkUpdate&&(!this.hiddenByLandmarkVertexBuffer&&this.hiddenByLandmarkVertexArray.length>0?this.hiddenByLandmarkVertexBuffer=e.createVertexBuffer(this.hiddenByLandmarkVertexArray,lO.members,!0):this.hiddenByLandmarkVertexBuffer&&this.hiddenByLandmarkVertexBuffer.updateData(this.hiddenByLandmarkVertexArray),this._needsHiddenByLandmarkUpdate=!1)}destroy(){if(this.vertexBuffer){this.vertexBuffer.destroy(),this.indexBuffer.destroy(),this.hiddenByLandmarkVertexBuffer&&this.hiddenByLandmarkVertexBuffer.destroy(),this._segments&&this._segments.destroy(),this.programConfigurations.destroy();for(let e=0;e<=4;e++){const r=this.regionSegments[e];r&&r.destroy()}}}}class L0{constructor(e){this.zoom=e.zoom,this.canonical=e.canonical,this.overscaling=e.overscaling,this.layers=e.layers,this.pixelRatio=e.pixelRatio,this.layerIds=this.layers.map(r=>r.fqid),this.index=e.index,this.hasPattern=!1,this.edgeRadius=0,this.projection=e.projection,this.activeReplacements=[],this.replacementUpdateTime=0,this.centroidData=[],this.footprintIndices=new Vr,this.footprintVertices=new Ec,this.footprintSegments=[],this.layoutVertexArray=new ih,this.centroidVertexArray=new m0,this.wallVertexArray=new _0,this.indexArray=new Vr,this.programConfigurations=new rh(e.layers,{zoom:e.zoom,lut:e.lut},r=>dO.includes(r)),this.segments=new Vs,this.stateDependentLayerIds=this.layers.filter(r=>r.isStateDependent()).map(r=>r.id),this.groundEffect=new PE(e),this.maxHeight=0,this.partLookup={},this.triangleSubSegments=[],this.polygonSegments=[]}updateFootprints(e,r){}populate(e,r,c,h){this.features=[],this.hasPattern=U1("fill-extrusion",this.layers,this.pixelRatio,r),this.featuresOnBorder=[],this.borderFeatureIndices=[[],[],[],[]],this.borderDoneWithNeighborZ=[-1,-1,-1,-1],this.selfDEMTileTimestamp=Number.MAX_VALUE,this.borderDEMTileTimestamp=[Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE],this.tileToMeter=Be(c),this.edgeRadius=this.layers[0].layout.get("fill-extrusion-edge-radius")/this.tileToMeter,this.wallMode=this.layers[0].paint.get("fill-extrusion-line-width").constantOr(1)!==0;for(const{feature:m,id:g,index:b,sourceLayerIndex:T}of e){const E=this.layers[0]._featureFilter.needGeometry,I=ci(m,E);if(!this.layers[0]._featureFilter.filter(new Un(this.zoom),I,c))continue;const M={id:g,sourceLayerIndex:T,index:b,geometry:E?I.geometry:Qt(m,c,h),properties:m.properties,type:m.type,patterns:{}},k=this.layoutVertexArray.length,B=nb[M.type]==="Polygon";if(this.hasPattern)this.features.push(H1("fill-extrusion",this.layers,M,this.zoom,this.pixelRatio,r));else if(this.wallMode)for(const N of M.geometry)for(const U of SE(N,B))this.addFeature(M,[U],b,c,{},r.availableImages,h,r.brightness);else this.addFeature(M,M.geometry,b,c,{},r.availableImages,h,r.brightness);r.featureIndex.insert(m,M.geometry,b,T,this.index,k)}this.sortBorders(),this.projection.name==="mercator"&&this.splitToSubtiles(),this.groundEffect.prepareBorderSegments(),this.polygonSegments.length=0}addFeatures(e,r,c,h,m,g){for(const b of this.features){const T=nb[b.type]==="Polygon",{geometry:E}=b;if(this.wallMode)for(const I of E)for(const M of SE(I,T))this.addFeature(b,[M
601],b.index,r,c,h,m,g);else this.addFeature(b,E,b.index,r,c,h,m,g)}this.sortBorders(),this.projection.name==="mercator"&&this.splitToSubtiles()}update(e,r,c,h,m,g,b){this.programConfigurations.updatePaintArrays(e,r,m,c,h,g,b),this.groundEffect.update(e,r,m,c,h,g,b)}isEmpty(){return this.layoutVertexArray.length===0}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload||this.groundEffect.programConfigurations.needsUpload}upload(e){this.uploaded||(this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,uO),this.indexBuffer=e.createIndexBuffer(this.indexArray),this.wallVertexBuffer=e.createVertexBuffer(this.wallVertexArray,aO.members),this.layoutVertexExtArray&&(this.layoutVertexExtBuffer=e.createVertexBuffer(this.layoutVertexExtArray,cO.members,!0)),this.groundEffect.upload(e)),this.groundEffect.uploadPaintProperties(e),this.programConfigurations.upload(e),this.uploaded=!0}uploadCentroid(e){this.groundEffect.uploadHiddenByLandmark(e),this.needsCentroidUpdate&&(!this.centroidVertexBuffer&&this.centroidVertexArray.length>0?this.centroidVertexBuffer=e.createVertexBuffer(this.centroidVertexArray,oO.members,!0):this.centroidVertexBuffer&&this.centroidVertexBuffer.updateData(this.centroidVertexArray),this.needsCentroidUpdate=!1)}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.centroidVertexBuffer&&this.centroidVertexBuffer.destroy(),this.layoutVertexExtBuffer&&this.layoutVertexExtBuffer.destroy(),this.groundEffect.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())}addFeature(e,r,c,h,m,g,b,T){const E=this.layers[0].paint.get("fill-extrusion-flood-light-ground-radius").evaluate(e,{})/this.tileToMeter,I=[new kt(0,0),new kt(Rt,Rt)],M=b.projection,k=M.name==="globe",B=this.wallMode||nb[e.type]==="Polygon",N=new IE;N.centroidDataIndex=this.centroidData.length;const U=new CE,Y=this.layers[0].paint.get("fill-extrusion-base").evaluate(e,{},h)<=0,J=this.layers[0].paint.get("fill-extrusion-height").evaluate(e,{},h);let ae;if(U.height=J,U.vertexArrayOffset=this.layoutVertexArray.length,U.groundVertexArrayOffset=this.groundEffect.vertexArray.length,k&&!this.layoutVertexExtArray&&(this.layoutVertexExtArray=new nh),this.wallMode){if(k)return void Yi("Non zero fill-extrusion-line-width is not yet supported on globe.");if(r.length!==1)return;ae=function(Pe){const ze=Pe[0].x===Pe[Pe.length-1].x&&Pe[0].y===Pe[Pe.length-1].y;(function(Bt){let wt=0;const Ni=Bt.length;for(let si=0;si<Ni;si++)wt+=(Bt[(si+1)%Ni].x-Bt[si].x)*(Bt[(si+1)%Ni].y+Bt[si].y);return wt>=0})(Pe)||(Pe=Pe.reverse());const mt={geometry:[],joinNormals:[],indices:[]},ut=[],pt=[],bt=[];let Ye=Pe.length;for(;Ye>=2&&Pe[Ye-1].equals(Pe[Ye-2]);)Ye--;if(Ye<(ze?3:2))return mt;let ft,qe,et,Tt,St,li=0;for(;li<Ye-1&&Pe[li].equals(Pe[li+1]);)li++;ze&&(ft=Pe[Ye-2],St=Pe[li].sub(ft)._unit()._perp());for(let Bt=li;Bt<Ye;Bt++){if(et=Bt===Ye-1?ze?Pe[li+1]:void 0:Pe[Bt+1],et&&Pe[Bt].equals(et))continue;St&&(Tt=St),ft&&(qe=ft),ft=Pe[Bt],St=et?et.sub(ft)._unit()._perp():Tt,Tt=Tt||St;let wt=Tt.add(St);wt.x===0&&wt.y===0||wt._unit();const Ni=wt.x*St.x+wt.y*St.y,si=Ni!==0?1/Ni:1/0,ri=Tt.x*St.y-Tt.y*St.x>0;let Oi="miter";const Xi=2;Oi==="miter"&&si>Xi&&(Oi="bevel"),Oi==="bevel"&&(si>100&&(Oi="flipbevel"),si<Xi&&(Oi="miter"));const Ji=(ln,rn,nn,as)=>{const ys=new kt(ln.x,ln.y),le=new kt(ln.x,ln.y);ys.x+=rn.x*as,ys.y+=rn.y*as,le.x-=rn.x*Math.max(nn,1),le.y-=rn.y*Math.max(nn,1),bt.push(rn),ut.push(ys),pt.push(le)};if(Oi==="miter")wt._mult(si),Ji(ft,wt,0,0);else if(Oi==="flipbevel")wt=St.mult(-1),Ji(ft,wt,0,0),Ji(ft,wt.mult(-1),0,0);else{const ln=-Math.sqrt(si*si-1),rn=ri?ln:0,nn=ri?0:ln;qe&&Ji(ft,Tt,rn,nn),et&&Ji(ft,St,rn,nn)}}mt.geometry=[...ut,...pt.reverse(),ut[0]],mt.joinNormals=[...bt,...bt.reverse(),bt[bt.length-1]];const Jt=mt.geometry.length-1;for(let Bt=0;Bt<Jt/2;Bt++)if(Bt+1<Jt/2){let wt=Bt,Ni=Bt+1,si=Jt-1-Bt,ri=Jt-2-Bt;wt=wt===0?Jt-1:wt-1,Ni=Ni===0?Jt-1:Ni-1,si=si===0?Jt-1:si-1,ri=ri===0?Jt-1:ri-1,mt.indices.push(si),mt.indices.push(Ni),mt.indices.push(wt),mt.indices.push(si),mt.indices.push(ri),mt.indices.push(Ni)}return mt}(r[0]),r=[ae.geometry]}const ne=(Pe,ze)=>Pe<(ze.length-1)/2||Pe===ze.length-1,G=this.wallMode?[r]:C0(r,500);for(let Pe=G.length-1;Pe>=0;Pe--){const ze=G[Pe];(ze.length===0||(te=ze[0]).every(tt=>tt.x<=0)||te.every(tt=>tt.x>=Rt)||te.every(tt=>tt.y<=0)||te.every(tt=>tt.y>=Rt))&&G.splice(Pe,1)}var te;let oe;if(k)oe=FE(G,I,h);else{oe=[];
vendor: 14,902 bytes, line 601
601for(const Pe of G)oe.push({polygon:Pe,bounds:I})}const he=B?this.edgeRadius:0,Te=he>0&&this.zoom<17,Me=(Pe,ze)=>{if(Pe.length===0)return!1;const tt=Pe[Pe.length-1];return ze.x===tt.x&&ze.y===tt.y};for(const{polygon:Pe,bounds:ze}of oe){let tt=0,mt=0;for(const Ye of Pe)B&&!Ye[0].equals(Ye[Ye.length-1])&&Ye.push(Ye[0]),mt+=B?Ye.length-1:Ye.length;const ut=this.segments.prepareSegment((B?5:4)*mt,this.layoutVertexArray,this.indexArray);U.footprintSegIdx<0&&(U.footprintSegIdx=this.footprintSegments.length),U.polygonSegIdx<0&&(U.polygonSegIdx=this.polygonSegments.length);const pt={triangleArrayOffset:this.indexArray.length,triangleCount:0,triangleSegIdx:this.segments.segments.length-1},bt=new AE;if(bt.vertexOffset=this.footprintVertices.length,bt.indexOffset=3*this.footprintIndices.length,bt.ringIndices=[],B){const Ye=[],ft=[];tt=ut.vertexLength;for(let et=0;et<Pe.length;et++){const Tt=Pe[et];Tt.length&&et!==0&&ft.push(Ye.length/2);const St=[];let li,Jt;li=Tt[1].sub(Tt[0])._perp()._unit(),bt.ringIndices.push(Tt.length-1);for(let Bt=1;Bt<Tt.length;Bt++){const wt=Tt[Bt],Ni=Tt[Bt===Tt.length-1?1:Bt+1],si=wt.clone();if(he){Jt=Ni.sub(wt)._perp()._unit();const ri=li.add(Jt)._unit(),Oi=he*Math.min(4,1/(li.x*ri.x+li.y*ri.y));si.x+=Oi*ri.x,si.y+=Oi*ri.y,si.x=Math.round(si.x),si.y=Math.round(si.y),li=Jt}if(!Y||he!==0&&!Te||Me(St,si)||St.push(si),o_(this.layoutVertexArray,si.x,si.y,0,0,1,1,0),this.wallMode){const ri=ne(Bt,Tt);a_(this.wallVertexArray,ae.joinNormals[Bt],!ri)}ut.vertexLength++,this.footprintVertices.emplaceBack(wt.x,wt.y),Ye.push(wt.x,wt.y),k&&l_(this.layoutVertexExtArray,M.projectTilePoint(si.x,si.y,h),M.upVector(h,si.x,si.y))}Y&&(he===0||Te)&&(St.length!==0&&Me(St,St[0])&&St.pop(),this.groundEffect.addData(St,ze,E))}const qe=this.wallMode?ae.indices:t_(Ye,ft);for(let et=0;et<qe.length;et+=3)this.footprintIndices.emplaceBack(bt.vertexOffset+qe[et+0],bt.vertexOffset+qe[et+1],bt.vertexOffset+qe[et+2]),this.indexArray.emplaceBack(tt+qe[et],tt+qe[et+2],tt+qe[et+1]),ut.primitiveLength++;bt.indexCount+=qe.length,bt.vertexCount+=this.footprintVertices.length-bt.vertexOffset}for(let Ye=0;Ye<Pe.length;Ye++){const ft=Pe[Ye];N.startRing(U,ft[0]);let qe=ft.length>4&&RE(ft[ft.length-2],ft[0],ft[1]),et=he?yO(ft[ft.length-2],ft[0],ft[1],he):0;const Tt=[];let St,li,Jt;li=ft[1].sub(ft[0])._perp()._unit();let Bt=!0;for(let wt=1,Ni=0;wt<ft.length;wt++){let si=ft[wt-1],ri=ft[wt];const Oi=ft[wt===ft.length-1?1:wt+1];if(N.appendEdge(U,ri,si),sb(ri,si,ze)){he&&(li=Oi.sub(ri)._perp()._unit(),Bt=!Bt);continue}const Xi=ri.sub(si)._perp(),Ji=Xi.x/(Math.abs(Xi.x)+Math.abs(Xi.y)),ln=Xi.y>0?1:0,rn=si.dist(ri);if(Ni+rn>32768&&(Ni=0),he){Jt=Oi.sub(ri)._perp()._unit();let le=kE(si,ri,Oi,DE(li,Jt),he);isNaN(le)&&(le=0);const de=ri.sub(si)._unit();si=si.add(de.mult(et))._round(),ri=ri.add(de.mult(-le))._round(),et=le,li=Jt,Y&&this.zoom>=17&&(Me(Tt,si)||Tt.push(si),Me(Tt,ri)||Tt.push(ri))}const nn=ut.vertexLength,as=ft.length>4&&RE(si,ri,Oi);let ys=OE(Ni,qe,Bt);if(o_(this.layoutVertexArray,si.x,si.y,Ji,ln,0,0,ys),o_(this.layoutVertexArray,si.x,si.y,Ji,ln,0,1,ys),this.wallMode){const le=ne(wt-1,ft),de=ae.joinNormals[wt-1];a_(this.wallVertexArray,de,le),a_(this.wallVertexArray,de,le)}if(Ni+=rn,ys=OE(Ni,as,!Bt),qe=as,o_(this.layoutVertexArray,ri.x,ri.y,Ji,ln,0,0,ys),o_(this.layoutVertexArray,ri.x,ri.y,Ji,ln,0,1,ys),this.wallMode){const le=ne(wt,ft),de=ae.joinNormals[wt];a_(this.wallVertexArray,de,le),a_(this.wallVertexArray,de,le)}if(ut.vertexLength+=4,this.indexArray.emplaceBack(nn+0,nn+1,nn+2),this.indexArray.emplaceBack(nn+1,nn+3,nn+2),ut.primitiveLength+=2,he){const le=tt+(wt===1?ft.length-2:wt-2),de=wt===1?tt:le+1;if(this.indexArray.emplaceBack(nn+1,le,nn+3),this.indexArray.emplaceBack(le,de,nn+3),ut.primitiveLength+=2,St===void 0&&(St=nn),!sb(Oi,ft[wt],ze)){const nt=wt===ft.length-1?St:ut.vertexLength;this.indexArray.emplaceBack(nn+2,nn+3,nt),this.indexArray.emplaceBack(nn+3,nt+1,nt),this.indexArray.emplaceBack(nn+3,de,nt+1),ut.primitiveLength+=3}Bt=!Bt}if(k){const le=this.layoutVertexExtArray,de=M.projectTilePoint(si.x,si.y,h),nt=M.projectTilePoint(ri.x,ri.y,h),Pt=M.upVector(h,si.x,si.y),jt=M.upVector(h,ri.x,ri.y);l_(le,de,Pt),l_(le,de,Pt),l_(le,nt,jt),l_(le,nt,jt)}}B&&(tt+=ft.length-1),Y&&he&&this.zoom>=17&&(Tt.length!==0&&Me(Tt,Tt[0])&&Tt.pop(),this.groundEffect.addData(Tt,ze,E,he>0))}this.footprintSegments.push(bt),pt.triangleCount=this.indexArray.length-pt.triangleArrayOffset,this.polygonSegments.push(pt),++U.footprintSegLen,++U.polygonSegLen}if(U.vertexCount=this.layoutVertexArray.length-U.vertexArrayOffset,U.groundVertexCount=this.groundEffect.vertexArray.length-U.groundVertexArrayOffset,U.vertexCount!==0){if(U.centroidXY=N.borders?EE:this.encodeCentroid(N,U),this.centroidData.push(U),N.borders){this.featuresOnBorder.push(N);const Pe=this.featuresOnBorder.length-1;for(let ze=0;ze<N.borders.length;ze++)N.borders[ze][0]!==Number.MAX_VALUE&&this.borderFeatureIndices[ze].push(Pe)}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,e,c,m,g,h,T),this.groundEffect.addPaintPropertiesData(e,c,m,g,h,T),this.maxHeight=Math.max(this.maxHeight,J)}}sortBorders(){for(let e=0;e<this.borderFeatureIndices.length;e++)this.borderFeatureIndices[e].sort((r,c)=>this.featuresOnBorder[r].borders[e][0]-this.featuresOnBorder[c].borders[e][0])}splitToSubtiles(){const e=[];for(let b=0;b<this.centroidData.length;b++){const T=this.centroidData[b],E=+(T.min.y+T.max.y>Rt),I=2*E+(+(T.min.x+T.max.x>Rt)^E);for(let M=0;M<T.polygonSegLen;M++){const k=T.polygonSegIdx+M;e.push({centroidIdx:b,subtile:I,polygonSegmentIdx:k,triangleSegmentIdx:this.polygonSegments[k].triangleSegIdx})}}const r=new Vr;e.sort((b,T)=>b.triangleSegmentIdx===T.triangleSegmentIdx?b.subtile-T.subtile:b.triangleSegmentIdx-T.triangleSegmentIdx);let c=0,h=0,m=0;for(const b of e){if(b.triangleSegmentIdx!==c)break;m++}const g=e.length;for(;h!==e.length;){c=e[h].triangleSegmentIdx;let b=0,T=h,E=h;for(let I=T;I<m&&e[I].subtile===b;I++)E++;for(;T!==m;){const I=e[T];b=I.subtile;const M=this.centroidData[I.centroidIdx].min.clone(),k=this.centroidData[I.centroidIdx].max.clone(),B={vertexOffset:this.segments.segments[c].vertexOffset,primitiveOffset:r.length,vertexLength:this.segments.segments[c].vertexLength,primitiveLength:0,sortKey:void 0,vaos:{}};for(let N=T;N<E;N++){const U=e[N],Y=this.polygonSegments[U.polygonSegmentIdx],J=this.centroidData[U.centroidIdx].min,ae=this.centroidData[U.centroidIdx].max,ne=this.indexArray.uint16;for(let G=Y.triangleArrayOffset;G<Y.triangleArrayOffset+Y.triangleCount;G++)r.emplaceBack(ne[3*G],ne[3*G+1],ne[3*G+2]);B.primitiveLength+=Y.triangleCount,M.x=Math.min(M.x,J.x),M.y=Math.min(M.y,J.y),k.x=Math.max(k.x,ae.x),k.y=Math.max(k.y,ae.y)}B.primitiveLength>0&&this.triangleSubSegments.push({segment:B,min:M,max:k}),T=E;for(let N=T;N<m&&e[N].subtile===e[T].subtile;N++)E++}h=m;for(let I=h;I<g&&e[I].triangleSegmentIdx===e[h].triangleSegmentIdx;I++)m++}r._trim(),this.indexArray=r}getVisibleSegments(e,r,c){const h=new Vs;if(this.wallMode){for(const U of this.triangleSubSegments)h.segments.push(U.segment);return h}let m=0,g=0;const b=1<<e.canonical.z;if(r){const U=r.getMinMaxForTile(e);U&&(m=U.min,g=U.max)}g+=this.maxHeight;const T=e.toUnwrapped();let E;const I=[T.canonical.x/b+T.wrap,T.canonical.y/b],M=[(T.canonical.x+1)/b+T.wrap,(T.canonical.y+1)/b],k=(U,Y,J)=>[U[0]*(1-J[0])+Y[0]*J[0],U[1]*(1-J[1])+Y[1]*J[1]],B=[],N=[];for(const U of this.triangleSubSegments){B[0]=U.min.x/Rt,B[1]=U.min.y/Rt,N[0]=U.max.x/Rt,N[1]=U.max.y/Rt;const Y=k(I,M,B),J=k(I,M,N);if(new Ms([Y[0],Y[1],m],[J[0],J[1],g]).intersectsPrecise(c)===0){E&&(h.segments.push(E),E=void 0);continue}const ae=U.segment;E&&E.vertexOffset!==ae.vertexOffset&&(h.segments.push(E),E=void 0),E?(E.vertexLength+=ae.vertexLength,E.primitiveLength+=ae.primitiveLength):E={vertexOffset:ae.vertexOffset,primitiveLength:ae.primitiveLength,vertexLength:ae.vertexLength,primitiveOffset:ae.primitiveOffset,sortKey:void 0,vaos:{}}}return E&&h.segments.push(E),h}encodeCentroid(e,r){const c=e.centroid(),h=r.span(),m=Math.min(7,Math.round(h.x*this.tileToMeter/10)),g=Math.min(7,Math.round(h.y*this.tileToMeter/10));return new kt(ke(c.x,1,Rt-1)<<3|m,ke(c.y,1,Rt-1)<<3|g)}encodeBorderCentroid(e){if(!e.borders)return new kt(0,0);const r=e.borders,c=Number.MAX_VALUE;if(r[0][0]!==c||r[1][0]!==c){const h=r[0][0]!==c?0:1;return new kt(6|(r[0][0]!==c?0:65528),(r[h][0]+r[h][1])/2<<3|6)}{const h=r[2][0]!==c?2:3;return new kt((r[h][0]+r[h][1])/2<<3|6,6|(r[2][0]!==c?0:65528))}}showCentroid(e){const r=this.centroidData[e.centroidDataIndex];r.flags&=Sd,r.centroidXY.x=0,r.centroidXY.y=0,this.writeCentroidToBuffer(r)}writeCentroidToBuffer(e){this.groundEffect.updateHiddenByLandmark(e);const r=e.vertexArrayOffset,c=e.vertexCount+e.vertexArrayOffset,h=e.flags&Sd?EE:e.centroidXY,m=this.centroidVertexArray.geta_centroid_pos0(r);if(this.centroidVertexArray.geta_centroid_pos1(r)!==h.y||m!==h.x){for(let g=r;g<c;++g)this.centroidVertexArray.emplace(g,h.x,h.y);this.needsCentroidUpdate=!0}}createCentroidsBuffer(){this.centroidVertexArray.resize(this.layoutVertexArray.length),this.groundEffect.hiddenByLandmarkVertexArray.resize(this.groundEffect.vertexArray.length);for(const e of this.centroidData)this.writeCentroidToBuffer(e)}updateReplacement(e,r,c){if(r.updateTime===this.replacementUpdateTime)return;this.replacementUpdateTime=r.updateTime;const h=r.getReplacementRegionsForTile(e.toUnwrapped());if(tb(this.activeReplacements,h))return;if(this.activeReplacements=h,this.centroidVertexArray.length===0)this.createCentroidsBuffer();else for(const g of this.centroidData)g.flags&=2147483647;const m=[];for(const g of this.activeReplacements){if(g.order<c)continue;const b=Math.max(1,Math.pow(2,g.footprintTileId.canonical.z-e.canonical.z));for(const T of this.centroidData)if(!(T.flags&Sd||g.min.x>T.max.x||T.min.x>g.max.x||g.min.y>T.max.y||T.min.y>g.max.y))for(let E=0;E<T.footprintSegLen;E++){const I=this.footprintSegments[T.footprintSegIdx+E];if(m.length=0,vO(this.footprintVertices,I.vertexOffset,I.vertexCount,g.footprintTileId.canonical,e.canonical,m),xE(g.footprint,m,this.footprintIndices.uint16,I.indexOffset,I.indexCount,-I.vertexOffset,-b)){T.flags|=Sd;break}}}for(const g of this.centroidData)this.writeCentroidToBuffer(g);this.borderDoneWithNeighborZ=[-1,-1,-1,-1]}footprintContainsPoint(e,r,c){let h=!1;for(let m=0;m<c.footprintSegLen;m++){const g=this.footprintSegments[c.footprintSegIdx+m];let b=0;for(const T of g.ringIndices){for(let E=b,I=T+b-1;E<T+b;I=E++){const M=this.footprintVertices.int16[2*(E+g.vertexOffset)+0],k=this.footprintVertices.int16[2*(E+g.vertexOffset)+1],B=this.footprintVertices.int16[2*(I+g.vertexOffset)+1];k>r!=B>r&&e<(this.footprintVertices.int16[2*(I+g.vertexOffset)+0]-M)*(r-k)/(B-k)+M&&(h=!h)}b=T}}return h}getHeightAtTileCoord(e,r){let c=Number.NEGATIVE_INFINITY,h=!0;const m=4*(e+Rt)*Rt+(r+Rt);if(this.partLookup.hasOwnProperty(m)){const g=this.partLookup[m];return g?{height:g.height,hidden:!!(g.flags&Sd)}:void 0}for(const g of this.centroidData)e>g.max.x||g.min.x>e||r>g.max.y||g.min.y>r||this.footprintContainsPoint(e,r,g)&&g&&g.height>c&&(c=g.height,this.partLookup[m]=g,h=!!(g.flags&Sd));if(c!==Number.NEGATIVE_INFINITY)return{height:c,hidden:h};this.partLookup[m]=void 0}}function DE(a,e){const r=a.add(e)._unit();return a.x*r.x+a.y*r.y}function yO(a,e,r,c){const h=e.sub(a)._perp()._unit(),m=r.sub(e)._perp()._unit();return kE(a,e,r,DE(h,m),c)}function kE(a,e,r,c,h){const m=Math.sqrt(1-c*c);return Math.min(a.dist(e)/3,e.dist(r)/3,h*m/c)}function sb(a,e,r){return a.x<r[0].x&&e.x<r[0].x||a.x>r[1].x&&e.x>r[1].x||a.y<r[0].y&&e.y<r[0].y||a.y>r[1].y&&e.y>r[1].y}function LE(a,e){return a.x<e[0].x||a.x>e[1].x||a.y<e[0].y||a.y>e[1].y}function RE(a,e,r){if(a.x<0||a.x>=Rt||e.x<0||e.x>=Rt||r.x<0||r.x>=Rt)return!1;const c=r.sub(e),h=c.perp(),m=a.sub(e);return(c.x*m.x+c.y*m.y)/Math.sqrt((c.x*c.x+c.y*c.y)*(m.x*m.x+m.y*m.y))>-.866&&h.x*m.x+h.y*m.y<0}function OE(a,e,r){const c=e?2|a:-3&a;return r?1|c:-2&c}function zE(){const a=Math.PI/32,e=Math.tan(a),r=W;return r*Math.sqrt(1+2*e*e)-r}function FE(a,e,r){const c=1<<r.z,h=Se(r.x/c),m=Se((r.x+1)/c),g=Ae(r.y/c),b=Ae((r.y+1)/c);return function(T,E,I,M,k=0,B){const N=[];if(!T.length||!I||!M)return N;const U=(oe,he)=>{for(const Te of oe)N.push({polygon:Te,bounds:he})},Y=Math.ceil(Math.log2(I)),J=Math.ceil(Math.log2(M)),ae=Y-J,ne=[];for(let oe=0;oe<Math.abs(ae);oe++)ne.push(ae>0?0:1);for(let oe=0;oe<Math.min(Y,J);oe++)ne.push(0),ne.push(1);let G=T;if(G=M0(G,E[0].y-k,E[1].y+k,1),G=M0(G,E[0].x-k,E[1].x+k,0),!G.length)return N;const te=[];for(ne.length?te.push({polygons:G,bounds:E,depth:0}):U(G,E);te.length;){const oe=te.pop(),he=oe.depth,Te=ne[he],Me=oe.bounds[0],Pe=oe.bounds[1],ze=Te===0?Me.x:Me.y,tt=Te===0?Pe.x:Pe.y,mt=B(Te,ze,tt),ut=M0(oe.polygons,ze-k,mt+k,Te),pt=M0(oe.polygons,mt-k,tt+k,Te);if(ut.length){const bt=[Me,new kt(Te===0?mt:Pe.x,Te===1?mt:Pe.y)];ne.length>he+1?te.push({polygons:ut,bounds:bt,depth:he+1}):U(ut,bt)}if(pt.length){const bt=[new kt(Te===0?mt:Me.x,Te===1?mt:Me.y),Pe];ne.length>he+1?te.push({polygons:pt,bounds:bt,depth:he+1}):U(pt,bt)}}return N}(a,e,Math.ceil((m-h)/11.25),Math.ceil((g-b)/11.25),1,(T,E,I)=>{if(T===0)return .5*(E+I);{const M=Ae((r.y+E/Rt)/c);return(ye(.5*(Ae((r.y+I/Rt)/c)+M))*c-r.y)*Rt}})}function vO(a,e,r,c,h,m){const g=Math.pow(2,c.z-h.z);for(let b=0;b<r;b++){let T=a.int16[2*(b+e)+0],E=a.int16[2*(b+e)+1];T=(T+h.x*Rt)*g-c.x*Rt,E=(E+h.y*Rt)*g-c.y*Rt,m.push(new kt(T,E))}}let BE,NE;Vt(L0,"FillExtrusionBucket",{omit:["layers","features"]}),Vt(CE,"PartData"),Vt(AE,"FootprintSegment"),Vt(IE,"BorderCentroidData"),Vt(PE,"GroundEffect");class Xf extends kt{constructor(e,r,c){super(e,r),this.z=c}}class VE extends Xf{constructor(e,r,c,h){super(e,r,c),this.w=h}}function $E(a,e,r,c){const h=r==="x"?"y":"x",m=(c-a[r])/(e[r]-a[r]);a[h]=Math.round(a[h]+(e[h]-a[h])*m),a[r]=c,a.hasOwnProperty("z")&&(a.z=gi(a.z,e.z,m)),a.hasOwnProperty("w")&&(a.w=gi(a.w,e.w,m))}function jE(a,e,r,c){const h=r,m=c;for(const g of["x","y"]){let b=a,T=e;b[g]>=T[g]&&(b=e,T=a),b[g]<h&&T[g]>h&&$E(b,T,g,h),b[g]<m&&T[g]>m&&$E(T,b,g,m)}}function R0(a,e,r,c,h,m){const g=[];for(let b=0;b<a.length;b++){const T=a[b];let E;const I=g.length;let M=0;for(let k=0;k<T.length-1;k++){let B=T[k],N=T[k+1],U=0;const Y=M;let J,ae;m&&(U=Math.hypot(N.x-B.x,N.y-B.y),M+=U,J=B,ae=N),B.x<e&&N.x<e||(B.x<e?B=new kt(e,B.y+(e-B.x)/(N.x-B.x)*(N.y-B.y))._round():N.x<e&&(N=new kt(e,B.y+(e-B.x)/(N.x-B.x)*(N.y-B.y))._round()),B.y<r&&N.y<r||(B.y<r?B=new kt(B.x+(r-B.y)/(N.y-B.y)*(N.x-B.x),r)._round():N.y<r&&(N=new kt(B.x+(r-B.y)/(N.y-B.y)*(N.x-B.x),r)._round()),B.x>=c&&N.x>=c||(B.x>=c?B=new kt(c,B.y+(c-B.x)/(N.x-B.x)*(N.y-B.y))._round():N.x>=c&&(N=new kt(c,B.y+(c-B.x)/(N.x-B.x)*(N.y-B.y))._round()),B.y>=h&&N.y>=h||(B.y>=h?B=new kt(B.x+(h-B.y)/(N.y-B.y)*(N.x-B.x),h)._round():N.y>=h&&(N=new kt(B.x+(h-B.y)/(N.y-B.y)*(N.x-B.x),h)._round()),E&&B.equals(E[E.length-1])||(E=[B],g.pu
601sh(E),m&&m.push({progress:{min:Y+UE(J,ae,B)*U,max:1},parentIndex:b,prevPoint:J,nextPoint:ae})),E.push(N),m&&(m[m.length-1].progress.max=Y+UE(J,ae,N)*U,m[m.length-1].nextPoint=ae)))))}if(m&&M>0)for(let k=I;k<g.length;k++)m[k].progress.min/=M,m[k].progress.max/=M}return g}function xO(a,e,r,c,h){if(a.length<2)return void c.push(a);const m=[];for(;e.valid();){const[E,I]=e.get();for(let M=0;M<a.length-1;M++){const k=a[M],B=a[M+1],N=zs(k,B,E,I);if(N){const[U]=N,Y=new kt(gi(k.x,B.x,U),gi(k.y,B.y,U));m.push({t:M+U,distance:0,point:Y})}}e.next()}if(m.length===0)return void c.push(a);m.sort((E,I)=>E.t-I.t);let g=0,b=0,T=[];for(c.push(T);g!==a.length;){if(b===m.length){for(;g!==a.length;)T.length!==0&&T[T.length-1].equals(a[g])||T.push(a[g]),g++;break}m[b].t<=g?(T.length!==0&&T[T.length-1].equals(m[b].point)||T.push(m[b].point),Math.trunc(m[b].t),b++):(T.length!==0&&T[T.length-1].equals(a[g])||T.push(a[g]),g++)}}function UE(a,e,r){return a.x!==e.x?(r.x-a.x)/(e.x-a.x):a.y!==e.y?(r.y-a.y)/(e.y-a.y):0}function c_(a,e){return a.x*e.x+a.y*e.y}function HE(a,e){if(a.length===1){let r=0;const c=e[r++];let h;for(;!h||c.equals(h);)if(h=e[r++],!h)return 1/0;for(;r<e.length;r++){const m=e[r],g=a[0],b=h.sub(c),T=m.sub(c),E=g.sub(c),I=c_(b,b),M=c_(b,T),k=c_(T,T),B=c_(E,b),N=c_(E,T),U=I*k-M*M,Y=(k*B-M*N)/U,J=(I*N-M*B)/U,ae=c.z*(1-Y-J)+h.z*Y+m.z*J;if(isFinite(ae))return ae}return 1/0}{let r=1/0;for(const c of e)r=Math.min(r,c.z);return r}}function GE(a,e,r,c,h,m,g,b){const T=g*h.getElevationAt(a,e,!0,!0),E=m[0]!==0,I=E?m[1]===0?g*(m[0]/7-450):g*function(M,k,B){const N=Math.floor(k[0]/8),U=Math.floor(k[1]/8),Y=10*(k[0]-8*N),J=10*(k[1]-8*U),ae=M.getElevationAt(N,U,!0,!0),ne=M.getMeterToDEM(B),G=Math.floor(.5*(Y*ne-1)),te=Math.floor(.5*(J*ne-1)),oe=M.tileCoordToPixel(N,U),he=2*G+1,Te=2*te+1,Me=function(pt,bt,Ye,ft,qe){return[pt.getElevationAtPixel(bt,Ye,!0),pt.getElevationAtPixel(bt+qe,Ye,!0),pt.getElevationAtPixel(bt,Ye+qe,!0),pt.getElevationAtPixel(bt+ft,Ye+qe,!0)]}(M,oe.x-G,oe.y-te,he,Te),Pe=Math.abs(Me[0]-Me[1]),ze=Math.abs(Me[2]-Me[3]),tt=Math.abs(Me[0]-Me[2])+Math.abs(Me[1]-Me[3]),mt=Math.min(.25,.5*ne*(Pe+ze)/he),ut=Math.min(.25,.5*ne*tt/Te);return ae+Math.max(mt*Y,ut*J)}(h,m,b):T;return{base:T+(r===0?-1:r),top:E?Math.max(I+c,T+r+2):T+c}}const bO=Rn([{name:"a_pos_normal",components:2,type:"Int16"},{name:"a_data",components:4,type:"Uint8"},{name:"a_linesofar",components:1,type:"Float32"}],4),wO=Rn([{name:"a_z_offset_width",components:3,type:"Float32"}],4),{members:TO}=bO,SO=Rn([{name:"a_packed",components:3,type:"Float32"}]),{members:EO}=SO,AO=Rn([{name:"a_pattern_data",components:3,type:"Float32"}]),{members:CO}=AO;class WE{constructor(e,r){this.width=e,this.height=r,this.nextRow=0,this.image=new wd({width:e,height:r}),this.positions={},this.uploaded=!1}getDash(e,r){const c=this.getKey(e,r);return this.positions[c]}trim(){const e=this.width,r=this.height=qt(this.nextRow);this.image.resize({width:e,height:r})}getKey(e,r){return e.join(",")+r}getDashRanges(e,r,c){const h=[];let m=e.length%2==1?-e[e.length-1]*c:0,g=e[0]*c,b=!0;h.push({left:m,right:g,isDash:b,zeroLength:e[0]===0});let T=e[0];for(let E=1;E<e.length;E++){b=!b;const I=e[E];m=T*c,T+=I,g=T*c,h.push({left:m,right:g,isDash:b,zeroLength:I===0})}return h}addRoundDash(e,r,c){const h=r/2;for(let m=-c;m<=c;m++){const g=this.width*(this.nextRow+c+m);let b=0,T=e[b];for(let E=0;E<this.width;E++){E/T.right>1&&(T=e[++b]);const I=Math.abs(E-T.left),M=Math.abs(E-T.right),k=Math.min(I,M);let B;const N=m/c*(h+1);if(T.isDash){const U=h-Math.abs(N);B=Math.sqrt(k*k+U*U)}else B=h-Math.sqrt(k*k+N*N);this.image.data[g+E]=Math.max(0,Math.min(255,B+128))}}}addRegularDash(e,r){for(let T=e.length-1;T>=0;--T){const E=e[T],I=e[T+1];E.zeroLength?e.splice(T,1):I&&I.isDash===E.isDash&&(I.left=E.left,e.splice(T,1))}const c=e[0],h=e[e.length-1];c.isDash===h.isDash&&(c.left=h.left-this.width,h.right=c.right+this.width);const m=this.width*this.nextRow;let g=0,b=e[g];for(let T=0;T<this.width;T++){T/b.right>1&&(b=e[++g]);const E=Math.abs(T-b.left),I=Math.abs(T-b.right),M=Math.min(E,I);this.image.data[m+T]=Math.max(0,Math.min(255,(b.isDash?M:-M)+r+128))}}
601addDash(e,r){const c=this.getKey(e,r);if(this.positions[c])return this.positions[c];const h=r==="round",m=h?7:0,g=2*m+1;if(this.nextRow+g>this.height)return Yi("LineAtlas out of space"),null;e.length===0&&e.push(1);let b=0;for(let I=0;I<e.length;I++)e[I]<0&&(Yi("Negative value is found in line dasharray, replacing values with 0"),e[I]=0),b+=e[I];if(b!==0){const I=this.width/b,M=this.getDashRanges(e,this.width,I);h?this.addRoundDash(M,I,m):this.addRegularDash(M,r==="square"?.5*I:0)}const T=this.nextRow+m;this.nextRow+=g;const E={tl:[T,m],br:[b,0]};return this.positions[c]=E,E}}Vt(WE,"LineAtlas");const IO=Td.VectorTileFeature.types,MO=Math.cos(Math.PI/180*37.5),PO=Math.cos(Math.PI/180*5);class rb{constructor(e){this.evaluationGlobals={zoom:0,lineProgress:void 0},this.elevationType="none",this.zoom=e.zoom,this.evaluationGlobals.zoom=this.zoom,this.overscaling=e.overscaling,this.pixelRatio=e.pixelRatio,this.layers=e.layers,this.layerIds=this.layers.map(r=>r.fqid),this.index=e.index,this.projection=e.projection,this.hasPattern=!1,this.hasCrossSlope=!1,this.patternFeatures=[],this.lineClipsArray=[],this.gradients={},this.layers.forEach(r=>{this.gradients[r.id]={}}),this.layoutVertexArray=new $g,this.layoutVertexArray2=new Hl,this.patternVertexArray=new Hl,this.indexArray=new Vr,this.programConfigurations=new rh(e.layers,{zoom:e.zoom,lut:e.lut}),this.segments=new Vs,this.maxLineLength=0,this.zOffsetVertexArray=new Hl,this.stateDependentLayerIds=this.layers.filter(r=>r.isStateDependent()).map(r=>r.id),this.tessellationStep=e.tessellationStep?e.tessellationStep:Rt/64}updateFootprints(e,r){}populate(e,r,c,h){this.hasPattern=U1("line",this.layers,this.pixelRatio,r);const m=this.layers[0].layout.get("line-sort-key");this.tileToMeter=Be(c);const g=this.layers[0].layout.get("line-elevation-reference");if(g==="hd-road-markup")this.elevationType="road";else{const k=this.layers[0].layout.get("line-z-offset"),B=k.isConstant()&&!k.constantOr(0);this.elevationType=g!=="sea"&&g!=="ground"&&B?"none":"offset",this.elevationType==="offset"&&g==="none"&&Yi(`line-elevation-reference: ground is used for the layer ${this.layerIds[0]} because non-zero line-z-offset value was found.`)}const b=this.layers[0].layout.get("line-cross-slope");this.hasCrossSlope=this.elevationType==="offset"&&b!==void 0;const T=[];for(const{feature:k,id:B,index:N,sourceLayerIndex:U}of e){const Y=this.layers[0]._featureFilter.needGeometry,J=ci(k,Y);if(!this.layers[0]._featureFilter.filter(new Un(this.zoom),J,c))continue;const ae=m?m.evaluate(J,{},c):void 0,ne={id:B,properties:k.properties,type:k.type,sourceLayerIndex:U,index:N,geometry:Y?J.geometry:Qt(k,c,h),patterns:{},sortKey:ae};T.push(ne)}m&&T.sort((k,B)=>k.sortKey-B.sortKey);const{lineAtlas:E,featureIndex:I}=r,M=this.addConstantDashes(E);for(const k of T){const{geometry:B,index:N,sourceLayerIndex:U}=k;if(M&&this.addFeatureDashes(k,E),this.hasPattern){const Y=H1("line",this.layers,k,this.zoom,this.pixelRatio,r);this.patternFeatures.push(Y)}else this.addFeature(k,B,N,c,E.positions,r.availableImages,r.brightness,r.elevationFeatures);I.insert(e[N].feature,B,N,U,this.index)}}addConstantDashes(e){let r=!1;for(const c of this.layers){const h=c.paint.get("line-dasharray").value,m=c.layout.get("line-cap").value;if(h.kind!=="constant"||m.kind!=="constant")r=!0;else{const g=m.value,b=h.value;if(!b)continue;e.addDash(b,g)}}return r}addFeatureDashes(e,r){const c=this.zoom;for(const h of this.layers){const m=h.paint.get("line-dasharray").value,g=h.layout.get("line-cap").value;if(m.kind==="constant"&&g.kind==="constant")continue;let b,T;if(m.kind==="constant"){if(b=m.value,!b)continue}else b=m.evaluate({zoom:c},e);T=g.kind==="constant"?g.value:g.evaluate({zoom:c},e),r.addDash(b,T),e.patterns[h.id]=[r.getKey(b,T)]}}update(e,r,c,h,m,g,b){this.programConfigurations.updatePaintArrays(e,r,m,c,h,g,b)}addFeatures(e,r,c,h,m,g){for(const b of this.patternFeatures)this.addFeature(b,b.geometry,b.index,r,c,h,g)}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,EO)),this.patternVertexArray.length!==0&&(this.patternVertexBuffer=e.createVertexBuffer(this.patternVertexArray,CO)),!this.zOffsetVertexBuffer&&this.zOffsetVertexArray.length>0&&(this.zOffsetVertexBuffer=e.createVertexBuffer(this.zOffsetVertexArray,wO.members,!0)),this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,TO),this.indexBuffer=e.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(e),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.zOffsetVertexBuffer&&this.zOffsetVertexBuffer.destroy(),this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())}lineFeatureClips(e){if(e.properties&&e.properties.hasOwnProperty("mapbox_clip_start")&&e.properties.hasOwnProperty("mapbox_clip_end"))return{start:+e.properties.mapbox_clip_start,end:+e.properties.mapbox_clip_end}}addFeature(e,r,c,h,m,g,b,T){const E=this.layers[0].layout,I=E.get("line-join").evaluate(e,{}),M=E.get("line-cap").evaluate(e,{}),k=E.get("line-miter-limit"),B=E.get("line-round-limit");this.lineClips=this.lineFeatureClips(e),this.lineFeature=e,this.zOffsetValue=E.get("line-z-offset").value;const N=this.layers[0].paint.get("line-width").value;if(N.kind!=="constant"&&N.isLineProgressConstant===!1&&(this.variableWidthValue=N),this.elevationType==="road"){const U=this.layoutVertexArray.length;if(!this.addElevatedRoadFeature(e,r,h,T,I,M,k,B)){const[Y,J]=this.clipRuntimeLinesToTile(r,1);for(let ae=0;ae<Y.length;ae++){const ne=Y[ae],G=J[ae],te={progress:{min:G.progress.min,max:G.progress.max},nextDir:this.computeSegNextDir(G,ne),prevDir:this.computeSegPrevDir(G,ne)};this.addLine(ne,e,h,I,M,k,B,te)}this.fillNonElevatedRoadSegment(U)}}else for(const U of r)this.addLine(U,e,h,I,M,k,B);this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,e,c,m,g,h,b)}computeSegNextDir(e,r){return e.nextPoint.sub(r.at(-2)).unit()}computeSegPrevDir(e,r){return r[1].sub(e.prevPoint).unit()}clipLinesToTile(e,r){return R0(e,-r,-r,Rt+r,Rt+r)}clipRuntimeLinesToTile(e,r){const c=[];return[R0(e,-r,-r,Rt+r,Rt+r,c),c]}
601addElevatedRoadFeature(e,r,c,h,m,g,b,T){const E=[],I=X1.getElevationFeature(e,h);if(I){const M=this.clipLinesToTile(r,1),k=this.prepareElevatedLines(M,I,c);for(const B of k)E.push({geometry:B,elevation:I,elevationTileID:c,segment:{progress:{min:0,max:1},nextDir:void 0,prevDir:void 0}})}if(E.length===0)return!1;for(const M of E){const k=this.layoutVertexArray.length;this.addLine(M.geometry,e,c,m,g,b,T);const B=new oE(c,M.elevationTileID);if(M.elevation)for(let N=k;N<this.layoutVertexArray.length;N++){const U=new kt(this.layoutVertexArray.int16[6*N]>>1,this.layoutVertexArray.int16[6*N+1]>>1),Y=B.pointElevation(U,M.elevation,.05);this.updateHeightRange(Y),this.zOffsetVertexArray.emplaceBack(Y,0,0)}else this.fillNonElevatedRoadSegment(k)}return!0}prepareElevatedLines(e,r,c){if(r.constantHeight!=null)return e;const h=[],m=1/Be(c);for(const g of e)xO(g,new rE(r,m),0,h);return h}fillNonElevatedRoadSegment(e){for(let r=e;r<this.layoutVertexArray.length;r++)this.zOffsetVertexArray.emplaceBack(0,0,0)}updateHeightRange(e){this.heightRange?(this.heightRange.min=Math.min(this.heightRange.min,e),this.heightRange.max=Math.max(this.heightRange.max,e)):this.heightRange={min:e,max:e}}addLine(e,r,c,h,m,g,b,T){this.distance=0,this.prevDistance=0,this.scaledDistance=0,this.totalDistance=0,this.totalFeatureLength=0,this.lineSoFar=0,this.currentVertex=void 0;const E=h==="none";this.patternJoinNone=this.hasPattern&&E,this.segmentStart=0,this.segmentStartf32=0,this.segmentPoints=[];const I=T&&T.progress.min>0,M=T&&T.progress.max<1;if(this.lineClips){let Te={min:this.lineClips.start,max:this.lineClips.end},Me=1;if(T){const tt=this.lineClips.end-this.lineClips.start;Te=function(mt,ut,pt){return{min:Tr(mt.min,ut,pt),max:Tr(mt.max,ut,pt)}}(T.progress,{min:0,max:1},Te),tt>0&&(Me=(Te.max-Te.min)/tt)}const Pe=+r.properties.mapbox_clip_feature_len,ze=+r.properties.mapbox_clip_seg_len;if(Number.isNaN(Pe)||Number.isNaN(ze)){for(let mt=0;mt<e.length-1;mt++)this.totalDistance+=e[mt].dist(e[mt+1]);const tt=this.totalDistance/(Te.max-Te.min);this.totalFeatureLength=Number.isFinite(tt)?tt:0,this.lineClips.start=Te.min,this.lineClips.end=Te.max,this.maxLineLength=Math.max(this.maxLineLength,this.totalDistance)}else this.totalFeatureLength=Pe,this.distance=ze*Me,this.lineClips.start=Te.min,this.lineClips.end=Te.max,this.maxLineLength=Math.max(this.maxLineLength,this.distance);this.lineClipsArray.push(this.lineClips),this.updateScaledDistance()}const k=IO[r.type]==="Polygon";let B=e.length;for(;B>=2&&e[B-1].equals(e[B-2]);)B--;let N=0;for(;N<B-1&&e[N].equals(e[N+1]);)N++;if(B<(k?3:2))return;h==="bevel"&&(g=1.05);const U=this.segments.prepareSegment(10*B,this.layoutVertexArray,this.indexArray);let Y,J,ae,ne,G,te,oe,he;T&&T.prevDir&&(te=T.prevDir.perp()),T&&T.nextDir&&(oe=T.nextDir.perp()),this.e1=this.e2=-1,k&&(Y=e[B-2],G=e[N].sub(Y)._unit()._perp());for(let Te=N;Te<B;Te++){if(ae=Te===B-1?k?e[N+1]:void 0:e[Te+1],ae&&e[Te].equals(ae))continue;G&&(ne=G),Y&&(J=Y),Y=e[Te],he=this.evaluateLineProgressFeatures(J?J.dist(Y):0),G=ae?ae.sub(Y)._unit()._perp():ne,ne=ne||G;const Me=J&&ae;let Pe=Me?h:k||E?"butt":m;const ze=ne.x*G.x+ne.y*G.y;if(E){const qe=function(et){if(et.patternJoinNone){const Tt=et.segmentPoints.length/2,St=et.lineSoFar-et.segmentStart;for(let li=0;li<Tt;++li){const Jt=et.segmentPoints[2*li+1],Bt=Math.round(et.segmentPoints[2*li])+.5+.25*Jt;et.patternVertexArray.emplaceBack(Bt,St,et.segmentStart),et.patternVertexArray.emplaceBack(Bt,St,et.segmentStart)}et.segmentPoints.length=0}et.e1=et.e2=-1};if(Me&&ze<PO){this.updateDistance(J,Y),this.addCurrentVertex(Y,ne,1,1,U,he),qe(this),this.addCurrentVertex(Y,G,-1,-1,U,he);continue}if(J){if(!ae){this.updateDistance(J,Y),this.addCurrentVertex(Y,ne,1,1,U,he),qe(this);continue}Pe="miter"}}let tt=ne.add(G);tt.x===0&&tt.y===0||tt._unit();const mt=tt.x*G.x+tt.y*G.y,ut=mt!==0?1/mt:1/0,pt=2*Math.sqrt(2-2*mt),bt=mt<MO&&J&&ae,Ye=ne.x*G.y-ne.y*G.x>0,ft=this.overscaling<=16?15*Rt/(512*this.overscaling):0;if(Me&&Pe==="round"){if(ut<b)Pe="miter";else if(ut<=2){const qe=ob(Y,-10,Rt+10);Pe=this.elevationType==="offset"&&(qe||this.hasCrossSlope)?"miter":"fakeround"}}if(Pe==="miter"&&ut>g&&(Pe="bevel"),Pe==="bevel"&&(ut>2&&(Pe="flipbevel"),ut<g&&(Pe="miter")),J&&!(Pe==="miter"&&bt)&&this.updateDistance(J,Y),Pe==="miter")if(bt){const qe=Y.dist(J);if(qe>
6012*ft){const Tt=Y.sub(Y.sub(J)._mult(ft/qe)._round());this.updateDistance(J,Tt),this.addCurrentVertex(Tt,ne,0,0,U,he),J=Tt}this.updateDistance(J,Y),tt._mult(ut),this.addCurrentVertex(Y,tt,0,0,U,he);const et=Y.dist(ae);if(et>2*ft){const Tt=Y.add(ae.sub(Y)._mult(ft/et)._round());this.updateDistance(Y,Tt),this.addCurrentVertex(Tt,G,0,0,U,he),Y=Tt}}else tt._mult(ut),this.addCurrentVertex(Y,tt,0,0,U,he);else if(Pe==="flipbevel"){if(ut>100)tt=G.mult(-1);else{const qe=ut*ne.add(G).mag()/ne.sub(G).mag();tt._perp()._mult(qe*(Ye?-1:1))}this.addCurrentVertex(Y,tt,0,0,U,he),this.addCurrentVertex(Y,tt.mult(-1),0,0,U,he)}else if(Pe==="bevel"||Pe==="fakeround"){he!=null&&J&&this.addCurrentVertex(Y,oe||ne,-1,-1,U,he);const qe=Y.dist(J)<=2*ft&&Pe!=="bevel",et=tt.mult(Ye?1:-1);et._mult(ut);const Tt=G.mult(Ye?-1:1),St=ne.mult(Ye?-1:1),li=this.evaluateLineProgressFeatures(this.distance);if(he==null&&(this.addHalfVertex(Y,et.x,et.y,!1,!Ye,0,U,li),qe||this.addHalfVertex(Y,et.x+2*St.x,et.y+2*St.y,!1,Ye,0,U,li)),Pe==="fakeround"){const Jt=Math.round(180*pt/Math.PI/20);this.addHalfVertex(Y,St.x,St.y,!1,Ye,0,U,li);for(let Bt=0;Bt<Jt;Bt++){let wt=Bt/Jt;if(wt!==.5){const si=wt-.5;wt+=wt*si*(wt-1)*((1.0904+ze*(ze*(3.55645-1.43519*ze)-3.2452))*si*si+(.848013+ze*(.215638*ze-1.06021)))}const Ni=Tt.sub(St)._mult(wt)._add(St)._unit();this.addHalfVertex(Y,Ni.x,Ni.y,!1,Ye,0,U,li)}this.addHalfVertex(Y,Tt.x,Tt.y,!1,Ye,0,U,li)}qe||he!=null||this.addHalfVertex(Y,et.x+2*Tt.x,et.y+2*Tt.y,!1,Ye,0,U,li),he!=null&&ae&&this.addCurrentVertex(Y,te||G,1,1,U,he)}else if(Pe==="butt")this.addCurrentVertex(Y,tt,0,0,U,he);else if(Pe==="square"){if(!J){const qe=I?0:-1;this.addCurrentVertex(Y,tt,qe,qe,U,he)}if(this.addCurrentVertex(Y,tt,0,0,U,he),J){const qe=M?0:1;this.addCurrentVertex(Y,tt,qe,qe,U,he)}}else if(Pe==="round"){if(J){const qe=!Me&&oe?oe:ne;this.addCurrentVertex(Y,qe,0,0,U,he),!Me&&M||this.addCurrentVertex(Y,qe,1,1,U,he,!0)}if(ae){const qe=!Me&&te?te:G;!Me&&I||this.addCurrentVertex(Y,qe,-1,-1,U,he,!0),this.addCurrentVertex(Y,qe,0,0,U,he)}}}}addVerticesTo(e,r,c,h,m,g,b,T,E,I){const M=(r.w-e.w)/this.tessellationStep|0;let k=0;const B=this.scaledDistance;if(M>1){this.lineSoFar=e.w;const U=(r.x-e.x)/M,Y=(r.y-e.y)/M,J=(r.z-e.z)/M,ae=(r.w-e.w)/M;for(let ne=1;ne<M;++ne){e.x+=U,e.y+=Y,e.z+=J,this.lineSoFar+=ae,k+=ae;const G=this.evaluateLineProgressFeatures(this.prevDistance+k);this.scaledDistance=(this.prevDistance+k)/this.totalDistance,this.addHalfVertex(e,c,h,I,!1,b,E,G),this.addHalfVertex(e,m,g,I,!0,-T,E,G)}}this.lineSoFar=r.w,this.scaledDistance=B;const N=this.evaluateLineProgressFeatures(this.distance);this.addHalfVertex(r,c,h,I,!1,b,E,N),this.addHalfVertex(r,m,g,I,!0,-T,E,N)}evaluateLineProgressFeatures(e){if(!this.variableWidthValue&&this.elevationType!=="offset")return null;this.evaluationGlobals.lineProgress=0,this.lineClips?this.evaluationGlobals.lineProgress=Math.min(1,(this.totalFeatureLength*this.lineClips.start+e)/this.totalFeatureLength):Yi(`line-progress evaluation for ${this.layerIds[0]} requires enabling 'lineMetrics' for the source.`);let r=0;return this.variableWidthValue&&this.variableWidthValue.kind!=="constant"&&(r=this.variableWidthValue.evaluate(this.evaluationGlobals,this.lineFeature)||0),this.elevationType!=="offset"?{zOffset:0,variableWidth:r}:this.zOffsetValue.kind==="constant"?{zOffset:this.zOffsetValue.value,variableWidth:r}:{zOffset:this.zOffsetValue.evaluate(this.evaluationGlobals,this.lineFeature)||0,variableWidth:r}}addCurrentVertex(e,r,c,h,m,g,b=!1){const T=r.x+r.y*c,E=r.y-r.x*c,I=r.y*h-r.x,M=-r.y-r.x*h;if(g!=null){const k=this.elevationType==="offset",B=-10,N=Rt+10,U=g.zOffset,Y=new VE(e.x,e.y,U,this.lineSoFar),J=!!k&&ob(e,B,N),ae=this.lineSoFar,ne=this.distance;if(this.currentVertex)if(J){const G=this.currentVertexIsOutside,te=this.currentVertex,oe=new VE(e.x,e.y,U,this.lineSoFar);if(jE(te,oe,B,N),!ob(oe,B,N)){if(G){this.e1=this.e2=-1,this.distance-=te.dist(Y),this.lineSoFar=te.w;const he=this.evaluateLineProgressFeatures(te.w-this.totalFeatureLength*(this.lineClips?this.lineClips.start:0));this.addHalfVertex(te,T,E,b,!1,c,m,he),this.addHalfVertex(te,I,M,b,!0,-h,m,he),this.prevDistance=this.distance}this.distance=this.prevDistance+te.dist(oe),this.scaledDistance=this.distance/this.totalDistance,this.addVerticesTo(te,oe,T,E,I,M,
601c,h,m,b),this.distance=ne,this.scaledDistance=this.distance/this.totalDistance}}else{const G=this.currentVertex;if(this.currentVertexIsOutside){jE(G,Y,B,N),this.e1=this.e2=-1,this.distance-=G.dist(Y),this.scaledDistance=this.distance/this.totalDistance,this.lineSoFar=G.w;const te=this.evaluateLineProgressFeatures(G.w-this.totalFeatureLength*(this.lineClips?this.lineClips.start:0));this.addHalfVertex(G,T,E,b,!1,c,m,te),this.addHalfVertex(G,I,M,b,!0,-h,m,te),this.prevDistance=this.distance,this.distance=ne,this.scaledDistance=this.distance/this.totalDistance}this.addVerticesTo(G,Y,T,E,I,M,c,h,m,b)}else J||(this.addHalfVertex(e,T,E,b,!1,c,m,g),this.addHalfVertex(e,I,M,b,!0,-h,m,g));this.currentVertex=Y,this.currentVertexIsOutside=J,this.lineSoFar=ae}else this.addHalfVertex(e,T,E,b,!1,c,m,g),this.addHalfVertex(e,I,M,b,!0,-h,m,g)}addHalfVertex({x:e,y:r},c,h,m,g,b,T,E){if(this.patternJoinNone&&(this.segmentPoints.length===0&&(this.segmentStart=this.lineSoFar,this.segmentStartf32=Math.fround(this.lineSoFar)),g||this.segmentPoints.push(this.lineSoFar-this.segmentStart,b)),this.layoutVertexArray.emplaceBack((e<<1)+(m?1:0),(r<<1)+(g?1:0),Math.round(63*c)+128,Math.round(63*h)+128,1+(b===0?0:b<0?-1:1),0,this.lineSoFar-this.segmentStartf32),this.lineClips){const M=gi(this.lineClips.start,this.lineClips.end,this.scaledDistance);this.layoutVertexArray2.emplaceBack(this.scaledDistance,this.lineClipsArray.length,M)}const I=T.vertexLength++;this.e1>=0&&this.e2>=0&&(this.indexArray.emplaceBack(this.e1,this.e2,I),T.primitiveLength++),g?this.e2=I:this.e1=I,E!=null&&this.zOffsetVertexArray.emplaceBack(E.zOffset,E.variableWidth,E.variableWidth)}updateScaledDistance(){this.lineClips?(this.scaledDistance=this.distance/this.totalDistance,this.lineSoFar=this.totalFeatureLength*this.lineClips.start+this.distance):this.lineSoFar=this.distance}updateDistance(e,r){this.prevDistance=this.distance,this.distance+=e.dist(r),this.updateScaledDistance()}}function ob(a,e,r){return a.x<e||a.x>r||a.y<e||a.y>r}let qE,ZE;function XE(a,e,r){return e*(Rt/(a.tileSize*Math.pow(2,r-a.tileID.overscaledZ)))}Vt(rb,"LineBucket",{omit:["layers","patternFeatures","currentVertex","currentVertexIsOutside"]});const YE=(a,e,r)=>(1-r)*a+r*e;function KE(a,e){return 1/XE(a,1,e.tileZoom)}function JE(a,e,r,c){return a.translatePosMatrix(c||e.tileID.projMatrix,e,r.paint.get("line-translate"),r.paint.get("line-translate-anchor"))}const QE=a=>{const e=[];eA(a)&&e.push("RENDER_LINE_DASH"),a.paint.get("line-gradient")&&e.push("RENDER_LINE_GRADIENT");const r=a.paint.get("line-trim-offset");r[0]===0&&r[1]===0||e.push("RENDER_LINE_TRIM_OFFSET"),a.paint.get("line-border-width").constantOr(1)!==0&&e.push("RENDER_LINE_BORDER");const c=a.layout.get("line-join").constantOr("miter")==="none",h=!!a.paint.get("line-pattern").constantOr(1);return c&&h&&e.push("LINE_JOIN_NONE"),e};function eA(a){const e=a.paint.get("line-dasharray").value;return e.value||e.kind!=="constant"}let ab;const tA=()=>ab||(ab={layout:qE||(qE=new Ys({"line-cap":new Xt($e.layout_line["line-cap"]),"line-join":new Xt($e.layout_line["line-join"]),"line-miter-limit":new It($e.layout_line["line-miter-limit"]),"line-round-limit":new It($e.layout_line["line-round-limit"]),"line-sort-key":new Xt($e.layout_line["line-sort-key"]),"line-z-offset":new Xt($e.layout_line["line-z-offset"]),"line-elevation-reference":new It($e.layout_line["line-elevation-reference"]),"line-cross-slope":new It($e.layout_line["line-cross-slope"]),visibility:new It($e.layout_line.visibility),"line-width-unit":new It($e.layout_line["line-width-unit"])})),paint:ZE||(ZE=new Ys({"line-opacity":new Xt($e.paint_line["line-opacity"]),"line-color":new Xt($e.paint_line["line-color"]),"line-translate":new It($e.paint_line["line-translate"]),"line-translate-anchor":new It($e.paint_line["line-translate-anchor"]),"line-width":new Xt($e.paint_line["line-width"]),"line-gap-width":new Xt($e.paint_line["line-gap-width"]),"line-offset":new Xt($e.paint_line["line-offset"]),"line-blur":new Xt($e.paint_line["line-blur"]),"line-dasharray":new Xt($e.paint_line["line-dasharray"]),"line-pattern":new Xt($e.paint_line["line-pattern"]),"line-pattern-cross-fade":new It($e.paint_line["line-pattern-cross-fade"]),"line-gradient":new eh($e.paint_line["line-gradient"]),"line-trim-offset":new It($e.paint_line["line-trim-offset"]),"line-trim-fade-range":new It($e.paint_line["line-trim-fade-range"]),"line-trim-color":new It($e.paint_line["line-trim-color"]),"line-emissive-strength":new It($e.paint_line["line-emissive-strength"]),"line-border-width":new Xt($e.paint_line["line-border-width"]),"line-border-color":new Xt($e.paint_line["line-border-color"]),"line-occlusion-opacity":new It($e.paint_line["line-occlusion-opacity"]),"line-color-use-theme":new Xt({type:"string",default:"default","property-type":"data-driven"}
vendor: 4,382 bytes, line 601
601),"line-gradient-use-theme":new Xt({type:"string",default:"default","property-type":"data-driven"}),"line-trim-color-use-theme":new Xt({type:"string",default:"default","property-type":"data-driven"}),"line-border-color-use-theme":new Xt({type:"string",default:"default","property-type":"data-driven"})}))},ab);class DO extends Xt{possiblyEvaluate(e,r){return r=new Un(Math.floor(r.zoom),{now:r.now,fadeDuration:r.fadeDuration,transition:r.transition}),super.possiblyEvaluate(e,r)}evaluate(e,r,c,h){return r=He({},r,{zoom:Math.floor(r.zoom)}),super.evaluate(e,r,c,h)}}let u_;function iA(a,e){return e>0?e+2*a:a}const kO=Rn([{name:"a_pos_offset",components:4,type:"Int16"},{name:"a_tex_size",components:4,type:"Uint16"},{name:"a_pixeloffset",components:4,type:"Int16"}],4),LO=Rn([{name:"a_globe_anchor",components:3,type:"Int16"},{name:"a_globe_normal",components:3,type:"Float32"}],4),RO=Rn([{name:"a_projected_pos",components:4,type:"Float32"}],4);Rn([{name:"a_fade_opacity",components:1,type:"Uint32"}],4);const OO=Rn([{name:"a_auto_z_offset",components:1,type:"Float32"}],4),zO=Rn([{name:"a_texb",components:2,type:"Uint16"}]),FO=Rn([{name:"a_placed",components:2,type:"Uint8"},{name:"a_shift",components:2,type:"Float32"},{name:"a_elevation_from_sea",components:2,type:"Float32"}]),BO=Rn([{name:"a_size_scale",components:1,type:"Float32"},{name:"a_padding",components:2,type:"Float32"},{name:"a_auto_z_offset",components:1,type:"Float32"}]);Rn([{type:"Int16",name:"projectedAnchorX"},{type:"Int16",name:"projectedAnchorY"},{type:"Int16",name:"projectedAnchorZ"},{type:"Int16",name:"tileAnchorX"},{type:"Int16",name:"tileAnchorY"},{type:"Float32",name:"x1"},{type:"Float32",name:"y1"},{type:"Float32",name:"x2"},{type:"Float32",name:"y2"},{type:"Int16",name:"padding"},{type:"Uint32",name:"featureIndex"},{type:"Uint16",name:"sourceLayerIndex"},{type:"Uint16",name:"bucketIndex"}]);const nA=Rn([{name:"a_pos",components:3,type:"Int16"},{name:"a_anchor_pos",components:2,type:"Int16"},{name:"a_extrude",components:2,type:"Int16"}],4),NO=Rn([{name:"a_pos_2f",components:2,type:"Float32"},{name:"a_radius",components:1,type:"Float32"},{name:"a_flags",components:2,type:"Int16"}],4);Rn([{name:"triangle",components:3,type:"Uint16"}]),Rn([{type:"Int16",name:"projectedAnchorX"},{type:"Int16",name:"projectedAnchorY"},{type:"Int16",name:"projectedAnchorZ"},{type:"Float32",name:"tileAnchorX"},{type:"Float32",name:"tileAnchorY"},{type:"Uint16",name:"glyphStartIndex"},{type:"Uint16",name:"numGlyphs"},{type:"Uint32",name:"vertexStartIndex"},{type:"Uint32",name:"lineStartIndex"},{type:"Uint32",name:"lineLength"},{type:"Uint16",name:"segment"},{type:"Uint16",name:"lowerSize"},{type:"Uint16",name:"upperSize"},{type:"Float32",name:"lineOffsetX"},{type:"Float32",name:"lineOffsetY"},{type:"Uint8",name:"writingMode"},{type:"Uint8",name:"placedOrientation"},{type:"Uint8",name:"hidden"},{type:"Uint32",name:"crossTileID"},{type:"Int16",name:"associatedIconIndex"},{type:"Uint8",name:"flipState"}]),Rn([{type:"Float32",name:"tileAnchorX"},{type:"Float32",name:"tileAnchorY"},{type:"Int16",name:"projectedAnchorX"},{type:"Int16",name:"projectedAnchorY"},{type:"Int16",name:"projectedAnchorZ"},{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",components:2,name:"textOffset"},{type:"Float32",name:"collisionCircleDiameter"},{type:"Float32",name:"zOffset"},{type:"Uint8",name:"hasIconTextFit"},{type:"Uint16",name:"elevationFeatureIndex"}
601]),Rn([{type:"Float32",name:"offsetX"}]),Rn([{type:"Int16",name:"x"},{type:"Int16",name:"y"}]);var Xr=24;function VO(a,e,r){return a.sections.forEach(c=>{c.text=function(h,m,g){const b=m.layout.get("text-transform").evaluate(g,{});return b==="uppercase"?h=h.toLocaleUpperCase():b==="lowercase"&&(h=h.toLocaleLowerCase()),sa.applyArabicShaping&&(h=sa.applyArabicShaping(h)),h}(c.text,e,r)}),a}const h_={"!":"ï¸","#":"ï¼",$:"ï¼","%":"ï¼
","&":"ï¼","(":"︵",")":"︶","*":"ï¼","+":"ï¼",",":"ï¸","-":"︲",".":"ã»","/":"ï¼",":":"ï¸",";":"ï¸","<":"︿","=":"ï¼",">":"ï¹","?":"ï¸","@":"ï¼ ","[":"ï¹","\\":"ï¼¼","]":"ï¹","^":"ï¼¾",_:"︳","`":"ï½","{":"︷","|":"â","}":"︸","~":"ï½","¢":"ï¿ ","£":"ï¿¡","Â¥":"ï¿¥","¦":"¦","¬":"ï¿¢","¯":"ï¿£","â":"︲","â":"︱","â":"ï¹","â":"ï¹","â":"ï¹","â":"ï¹","â¦":"ï¸","â§":"ã»","â©":"₩","ã":"ï¸","ã":"ï¸","ã":"︿","ã":"ï¹","ã":"︽","ã":"︾","ã":"ï¹","ã":"ï¹","ã":"ï¹","ã":"ï¹","ã":"︻","ã":"︼","ã":"︹","ã":"︺","ã":"ï¸","ã":"ï¸","ï¼":"ï¸","ï¼":"︵","ï¼":"︶","ï¼":"ï¸","ï¼":"︲","ï¼":"ã»","ï¼":"ï¸","ï¼":"ï¸","ï¼":"︿","ï¼":"ï¹","ï¼":"ï¸","ï¼»":"ï¹","ï¼½":"ï¹","_":"︳","ï½":"︷","ï½":"â","ï½":"︸","ï½":"︵","ï½ ":"︶","。":"ï¸","ï½¢":"ï¹","ï½£":"ï¹","â":"â","â":"â"};function $O(a){return a==="︶"||a==="ï¹"||a==="︸"||a==="ï¹"||a==="ï¹"||a==="︾"||a==="︼"||a==="︺"||a==="ï¸"||a==="ï¹"||a==="ï¸"||a==="ï¸"||a==="ï¸"||a==="ï½"||a==="ï¿£"||a==="ï¸"||a==="ï¸"}function jO(a){return a==="︵"||a==="ï¹"||a==="︷"||a==="ï¹"||a==="ï¹"||a==="︽"||a==="︻"||a==="︹"||a==="ï¸"||a==="︿"}var sA,lb,rA,cb={};/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */function UO(){return sA||(sA=1,cb.read=function(a,e,r,c,h){var m,g,b=8*h-c-1,T=(1<<b)-1,E=T>>1,I=-7,M=r?h-1:0,k=r?-1:1,B=a[e+M];for(M+=k,m=B&(1<<-I)-1,B>>=-I,I+=b;I>0;m=256*m+a[e+M],M+=k,I-=8);for(g=m&(1<<-I)-1,m>>=-I,I+=c;I>0;g=256*g+a[e+M],M+=k,I-=8);if(m===0)m=1-E;else{if(m===T)return g?NaN:1/0*(B?-1:1);g+=Math.pow(2,c),m-=E}return(B?-1:1)*g*Math.pow(2,m-c)},cb.write=function(a,e,r,c,h,m){var g,b,T,E=8*m-h-1,I=(1<<E)-1,M=I>>1,k=h===23?Math.pow(2,-24)-Math.pow(2,-77):0,B=c?0:m-1,N=c?1:-1,U=e<0||e===0&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(b=isNaN(e)?1:0,g=I):(g=Math.floor(Math.log(e)/Math.LN2),e*(T=M
vendor: 3,813 bytes, line 601
601ath.pow(2,-g))<1&&(g--,T*=2),(e+=g+M>=1?k/T:k*Math.pow(2,1-M))*T>=2&&(g++,T/=2),g+M>=I?(b=0,g=I):g+M>=1?(b=(e*T-1)*Math.pow(2,h),g+=M):(b=e*Math.pow(2,M-1)*Math.pow(2,h),g=0));h>=8;a[r+B]=255&b,B+=N,b/=256,h-=8);for(g=g<<h|b,E+=h;E>0;a[r+B]=255&g,B+=N,g/=256,E-=8);a[r+B-N]|=128*U}),cb}function oA(){if(rA)return lb;rA=1,lb=e;var a=UO();function e(G){this.buf=ArrayBuffer.isView&&ArrayBuffer.isView(G)?G:new Uint8Array(G||0),this.pos=0,this.type=0,this.length=this.buf.length}e.Varint=0,e.Fixed64=1,e.Bytes=2,e.Fixed32=5;var r=4294967296,c=1/r,h=typeof TextDecoder>"u"?null:new TextDecoder("utf8");function m(G){return G.type===e.Bytes?G.readVarint()+G.pos:G.pos+1}function g(G,te,oe){return oe?4294967296*te+(G>>>0):4294967296*(te>>>0)+(G>>>0)}function b(G,te,oe){var he=te<=16383?1:te<=2097151?2:te<=268435455?3:Math.floor(Math.log(te)/(7*Math.LN2));oe.realloc(he);for(var Te=oe.pos-1;Te>=G;Te--)oe.buf[Te+he]=oe.buf[Te]}function T(G,te){for(var oe=0;oe<G.length;oe++)te.writeVarint(G[oe])}function E(G,te){for(var oe=0;oe<G.length;oe++)te.writeSVarint(G[oe])}function I(G,te){for(var oe=0;oe<G.length;oe++)te.writeFloat(G[oe])}function M(G,te){for(var oe=0;oe<G.length;oe++)te.writeDouble(G[oe])}function k(G,te){for(var oe=0;oe<G.length;oe++)te.writeBoolean(G[oe])}function B(G,te){for(var oe=0;oe<G.length;oe++)te.writeFixed32(G[oe])}function N(G,te){for(var oe=0;oe<G.length;oe++)te.writeSFixed32(G[oe])}function U(G,te){for(var oe=0;oe<G.length;oe++)te.writeFixed64(G[oe])}function Y(G,te){for(var oe=0;oe<G.length;oe++)te.writeSFixed64(G[oe])}function J(G,te){return(G[te]|G[te+1]<<8|G[te+2]<<16)+16777216*G[te+3]}function ae(G,te,oe){G[oe]=te,G[oe+1]=te>>>8,G[oe+2]=te>>>16,G[oe+3]=te>>>24}function ne(G,te){return(G[te]|G[te+1]<<8|G[te+2]<<16)+(G[te+3]<<24)}return e.prototype={destroy:function(){this.buf=null},readFields:function(G,te,oe){for(oe=oe||this.length;this.pos<oe;){var he=this.readVarint(),Te=he>>3,Me=this.pos;this.type=7&he,G(Te,te,this),this.pos===Me&&this.skip(he)}return te},readMessage:function(G,te){return this.readFields(G,te,this.readVarint()+this.pos)},readFixed32:function(){var G=J(this.buf,this.pos);return this.pos+=4,G},readSFixed32:function(){var G=ne(this.buf,this.pos);return this.pos+=4,G},readFixed64:function(){var G=J(this.buf,this.pos)+J(this.buf,this.pos+4)*r;return this.pos+=8,G},readSFixed64:function(){var G=J(this.buf,this.pos)+ne(this.buf,this.pos+4)*r;return this.pos+=8,G},readFloat:function(){var G=a.read(this.buf,this.pos,!0,23,4);return this.pos+=4,G},readDouble:function(){var G=a.read(this.buf,this.pos,!0,52,8);return this.pos+=8,G},readVarint:function(G){var te,oe,he=this.buf;return te=127&(oe=he[this.pos++]),oe<128?te:(te|=(127&(oe=he[this.pos++]))<<7,oe<128?te:(te|=(127&(oe=he[this.pos++]))<<14,oe<128?te:(te|=(127&(oe=he[this.pos++]))<<21,oe<128?te:function(Te,Me,Pe){var ze,tt,mt=Pe.buf;if(ze=(112&(tt=mt[Pe.pos++]))>>4,tt<128||(ze|=(127&(tt=mt[Pe.pos++]))<<3,tt<128)||(ze|=(127&(tt=mt[Pe.pos++]))<<10,tt<128)||(ze|=(127&(tt=mt[Pe.pos++]))<<17,tt<128)||(ze|=(127&(tt=mt[Pe.pos++]))<<24,tt<128)||(ze|=(1&(tt=mt[Pe.pos++]))<<31,tt<128))return g(Te,ze,Me);throw new Error("Expected varint not more than 10 bytes")}(te|=(15&(oe=he[this.pos]))<<28,G,this))))},readVarint64:function(){return this.readVarint(!0)},readSVarint:function(){var G=this.readVarint();return G%2==1?(G+1)/-2:G/2},readBoolean:function(){return!!this.readVarint()},readString:function(){var G=this.readVarint()+this.pos,te=this.pos;return this.pos=G,G-te>=12&&h?function(oe,he,Te){return h.decode(oe.subarray(he,Te))}(this.buf,te,G):function(oe,he,Te){for(var Me="",Pe=he;Pe<Te;){var ze,tt,mt,ut=oe[Pe],pt=null,bt=ut>239?4:ut>223?3:ut>191?2:1;if(Pe+bt>Te)break;bt===1?ut<128&&(pt=ut):bt===2?(192&(ze=oe[Pe+1]))==128&&(pt=(31&ut)<<6|63&ze)<=127&&(pt=null):bt===3?(tt=oe[Pe+2],
vendor: 6,415 bytes, line 601
601(192&(ze=oe[Pe+1]))==128&&(192&tt)==128&&((pt=(15&ut)<<12|(63&ze)<<6|63&tt)<=2047||pt>=55296&&pt<=57343)&&(pt=null)):bt===4&&(tt=oe[Pe+2],mt=oe[Pe+3],(192&(ze=oe[Pe+1]))==128&&(192&tt)==128&&(192&mt)==128&&((pt=(15&ut)<<18|(63&ze)<<12|(63&tt)<<6|63&mt)<=65535||pt>=1114112)&&(pt=null)),pt===null?(pt=65533,bt=1):pt>65535&&(pt-=65536,Me+=String.fromCharCode(pt>>>10&1023|55296),pt=56320|1023&pt),Me+=String.fromCharCode(pt),Pe+=bt}return Me}(this.buf,te,G)},readBytes:function(){var G=this.readVarint()+this.pos,te=this.buf.subarray(this.pos,G);return this.pos=G,te},readPackedVarint:function(G,te){if(this.type!==e.Bytes)return G.push(this.readVarint(te));var oe=m(this);for(G=G||[];this.pos<oe;)G.push(this.readVarint(te));return G},readPackedSVarint:function(G){if(this.type!==e.Bytes)return G.push(this.readSVarint());var te=m(this);for(G=G||[];this.pos<te;)G.push(this.readSVarint());return G},readPackedBoolean:function(G){if(this.type!==e.Bytes)return G.push(this.readBoolean());var te=m(this);for(G=G||[];this.pos<te;)G.push(this.readBoolean());return G},readPackedFloat:function(G){if(this.type!==e.Bytes)return G.push(this.readFloat());var te=m(this);for(G=G||[];this.pos<te;)G.push(this.readFloat());return G},readPackedDouble:function(G){if(this.type!==e.Bytes)return G.push(this.readDouble());var te=m(this);for(G=G||[];this.pos<te;)G.push(this.readDouble());return G},readPackedFixed32:function(G){if(this.type!==e.Bytes)return G.push(this.readFixed32());var te=m(this);for(G=G||[];this.pos<te;)G.push(this.readFixed32());return G},readPackedSFixed32:function(G){if(this.type!==e.Bytes)return G.push(this.readSFixed32());var te=m(this);for(G=G||[];this.pos<te;)G.push(this.readSFixed32());return G},readPackedFixed64:function(G){if(this.type!==e.Bytes)return G.push(this.readFixed64());var te=m(this);for(G=G||[];this.pos<te;)G.push(this.readFixed64());return G},readPackedSFixed64:function(G){if(this.type!==e.Bytes)return G.push(this.readSFixed64());var te=m(this);for(G=G||[];this.pos<te;)G.push(this.readSFixed64());return G},skip:function(G){var te=7&G;if(te===e.Varint)for(;this.buf[this.pos++]>127;);else if(te===e.Bytes)this.pos=this.readVarint()+this.pos;else if(te===e.Fixed32)this.pos+=4;else{if(te!==e.Fixed64)throw new Error("Unimplemented type: "+te);this.pos+=8}},writeTag:function(G,te){this.writeVarint(G<<3|te)},realloc:function(G){for(var te=this.length||16;te<this.pos+G;)te*=2;if(te!==this.length){var oe=new Uint8Array(te);oe.set(this.buf),this.buf=oe,this.length=te}},finish:function(){return this.length=this.pos,this.pos=0,this.buf.subarray(0,this.length)},writeFixed32:function(G){this.realloc(4),ae(this.buf,G,this.pos),this.pos+=4},writeSFixed32:function(G){this.realloc(4),ae(this.buf,G,this.pos),this.pos+=4},writeFixed64:function(G){this.realloc(8),ae(this.buf,-1&G,this.pos),ae(this.buf,Math.floor(G*c),this.pos+4),this.pos+=8},writeSFixed64:function(G){this.realloc(8),ae(this.buf,-1&G,this.pos),ae(this.buf,Math.floor(G*c),this.pos+4),this.pos+=8},writeVarint:function(G){(G=+G||0)>268435455||G<0?function(te,oe){var he,Te;if(te>=0?(he=te%4294967296|0,Te=te/4294967296|0):(Te=~(-te/4294967296),4294967295^(he=~(-te%4294967296))?he=he+1|0:(he=0,Te=Te+1|0)),te>=18446744073709552e3||te<-18446744073709552e3)throw new Error("Given varint doesn't fit into 10 bytes");oe.realloc(10),function(Me,Pe,ze){ze.buf[ze.pos++]=127&Me|128,Me>>>=7,ze.buf[ze.pos++]=127&Me|128,Me>>>=7,ze.buf[ze.pos++]=127&Me|128,Me>>>=7,ze.buf[ze.pos++]=127&Me|128,ze.buf[ze.pos]=127&(Me>>>=7)}(he,0,oe),function(Me,Pe){var ze=(7&Me)<<4;Pe.buf[Pe.pos++]|=ze|((Me>>>=3)?128:0),Me&&(Pe.buf[Pe.pos++]=127&Me|((Me>>>=7)?128:0),Me&&(Pe.buf[Pe.pos++]=127&Me|((Me>>>=7)?128:0),Me&&(Pe.buf[Pe.pos++]=127&Me|((Me>>>=7)?128:0),Me&&(Pe.buf[Pe.pos++]=127&Me|((Me>>>=7)?128:0),Me&&(Pe.buf[Pe.pos++]=127&Me)))))}(Te,oe)}(G,this):(this.realloc(4),this.buf[this.pos++]=127&G|(G>127?128:0),G<=127||(this.buf[this.pos++]=127&(G>>>=7)|(G>127?128:0),G<=127||(this.buf[this.pos++]=127&(G>>>=7)|(G>127?128:0),G<=127||(this.buf[this.pos++]=G>>>7&127))))},writeSVarint:function(G){this.writeVarint(G<0?2*-G-1:2*G)},writeBoolean:function(G){this.writeVarint(!!G)},writeString:function(G){G=String(G),this.realloc(4*G.length),this.pos++;var te=this.pos;this.pos=function(he,Te,Me){for(var Pe,ze,tt=0;tt<Te.length;tt++){if((Pe=Te.charCodeAt(tt))>55295&&Pe<57344){if(!ze){Pe>56319||tt+1===Te.length?(he[Me++]=239,he[Me++]=191,he[Me++]=189):ze=Pe;continue}if(Pe<56320){he[Me++]=239,he[Me++]=191,he[Me++]=189,ze=Pe;continue}Pe=ze-55296<<10|Pe-56320|65536,ze=null}else ze&&(he[Me++]=239,he[Me++]=191,he[Me++]=189,ze=null);Pe<128?he[Me++]=Pe:(Pe<2048?he[Me++]=Pe>>6|192:(Pe<65536?he[Me++]=Pe>>12|224:(he[Me++]=Pe>>18|240,he[Me++]=Pe>>12&63|128),he[Me++]=Pe>>6&63|128),he[Me++]=63&Pe|128)}return Me}(this.buf,G,this.pos);var oe=this.pos-te;oe>=128&&b(te,oe,this),this.pos=te-1,this.writeVarint(oe),this.pos+=oe},writeFloat:function(G){this.realloc(4),a.write(this.buf,G,this.pos,!0,23,4),this.pos+=4},writeDouble:function(G){this.realloc(8),a.write(this.buf,G,this.pos,!0,52,8),this.pos+=8},writeBytes:function(G){var te=G.length;this.writeVarint(te),this.realloc(te);for(var oe=0;oe<te;oe++)this.buf[this.pos++]=G[oe]},writeRawMessage:function(G,te){this.pos++;var oe=this.pos;G(te,this);var he=this.pos-oe;he>=128&&b(oe,he,this),this.pos=oe-1,this.writeVarint(he),this.pos+=he},writeMessage:function(G,te,oe){this.writeTag(G,e.Bytes),this.writeRawMessage(te,oe)},writePackedVarint:function(G,te){te.length&&this.writeMessage(G,T,te)},writePackedSVarint:function(G,te){te.length&&this.writeMessage(G,E,te)},writePackedBoolean:function(G,te){te.length&&this.writeMessage(G,k,te)},writePackedFloat:function(G,te){te.length&&this.writeMessage(G,I,te)},writePackedDouble:function(G,te){te.length&&this.writeMessage(G,M,te)},writePackedFixed32:function(G,te){te.length&&this.writeMessage(G,B,te)},writePackedSFixed32:function(G,te){te.length&&this.writeMessage(G,N,te)},writePackedFixed64:function(G,te){te.length&&this.writeMessage(G,U,te)},writePackedSFixed64:function(G,te){te.length&&this.writeMessage(G,Y,te)},writeBytesField:function(G,te){this.writeTag(G,e.Bytes),this.writeBytes(te)},writeFixed32Field:function(G,te){this.writeTag(G,e.Fixed32),this.writeFixed32(te)},writeSFixed32Field:function(G,te){this.writeTag(G,e.Fixed32),this.writeSFixed32(te)},writeFixed64Field:function(G,te){this.writeTag(G,e.Fixed64),this.writeFixed64
601(te)},writeSFixed64Field:function(G,te){this.writeTag(G,e.Fixed64),this.writeSFixed64(te)},writeVarintField:function(G,te){this.writeTag(G,e.Varint),this.writeVarint(te)},writeSVarintField:function(G,te){this.writeTag(G,e.Varint),this.writeSVarint(te)},writeStringField:function(G,te){this.writeTag(G,e.Bytes),this.writeString(te)},writeFloatField:function(G,te){this.writeTag(G,e.Fixed32),this.writeFloat(te)},writeDoubleField:function(G,te){this.writeTag(G,e.Fixed64),this.writeDouble(te)},writeBooleanField:function(G,te){this.writeVarintField(G,!!te)}},lb}var O0=ga(oA());const ub=3;function HO(a,e,r){e.glyphs=[],a===1&&r.readMessage(GO,e)}function GO(a,e,r){if(a===3){const{id:c,bitmap:h,width:m,height:g,left:b,top:T,advance:E}=r.readMessage(WO,{});e.glyphs.push({id:c,bitmap:new wd({width:m+2*ub,height:g+2*ub},h),metrics:{width:m,height:g,left:b,top:T,advance:E}})}else a===4?e.ascender=r.readSVarint():a===5&&(e.descender=r.readSVarint())}function WO(a,e,r){a===1?e.id=r.readVarint():a===2?e.bitmap=r.readBytes():a===3?e.width=r.readVarint():a===4?e.height=r.readVarint():a===5?e.left=r.readSVarint():a===6?e.top=r.readSVarint():a===7&&(e.advance=r.readVarint())}const qO=ub,ba={horizontal:1,vertical:2,horizontalOnly:3};class d_{constructor(){this.scale=1,this.fontStack="",this.image=null}static forText(e,r){const c=new d_;return c.scale=e||1,c.fontStack=r,c}static forImage(e){const r=new d_;return r.image=e,r}}class Em{constructor(){this.text="",this.sectionIndex=[],this.sections=[],this.imageSectionID=null}static fromFeature(e,r,c){const h=new Em;for(let m=0;m<e.sections.length;m++){const g=e.sections[m];g.image?h.addImageSection(g,c):h.addTextSection(g,r)}return h}length(){return this.text.length}getSection(e){return this.sections[this.sectionIndex[e]]}getSections(){return this.sections}getSectionIndex(e){return this.sectionIndex[e]}getCodePoint(e){return this.text.codePointAt(e)}verticalizePunctuation(e){this.text=function(r,c){let h="";for(let m=0;m<r.length;m++){const g=r.charCodeAt(m+1)||null,b=r.charCodeAt(m-1)||null;h+=!c&&(g&&Pf(g)&&!h_[r[m+1]]||b&&Pf(b)&&!h_[r[m-1]])||!h_[r[m]]?r[m]:h_[r[m]]}return h}(this.text,e)}trim(){let e=0;for(let c=0;c<this.text.length&&z0[this.text.charCodeAt(c)];c++)e++;let r=this.text.length;for(let c=this.text.length-1;c>=0&&c>=e&&z0[this.text.charCodeAt(c)];c--)r--;this.text=this.text.substring(e,r),this.sectionIndex=this.sectionIndex.slice(e,r)}substring(e,r){const c=new Em;return c.text=this.text.substring(e,r),c.sectionIndex=this.sectionIndex.slice(e,r),c.sections=this.sections,c}toString(){return this.text}getMaxScale(){return this.sectionIndex.reduce((e,r)=>Math.max(e,this.sections[r].scale),0)}addTextSection(e,r){this.text+=e.text,this.sections.push(d_.forText(e.scale,e.fontStack||r));const c=this.sections.length-1;for(let h=0;h<e.text.length;++h)this.sectionIndex.push(c)}addImageSection(e,r){const c=e.image?e.image.getPrimary():null;if(!c)return void Yi("Can't add FormattedSection with an empty image.");c.scaleSelf(r);const h=this.getNextImageSectionCharCode();h?(this.text+=String.fromCodePoint(h),this.sections.push(d_.forImage(c)),this.sectionIndex.push(this.sections.length-1)):Yi("Reached maximum number of images 6401")}getNextImageSectionCharCode(){return this.imageSectionID?this.imageSectionID>=63743?null:++this.imageSectionID:(this.imageSectionID=57344,this.imageSectionID)}}function hb(a,e,r,c,h,m,g,b,T,E,I,M,k,B,N,U=1){const Y=Em.fromFeature(a,h,U);M===ba.vertical&&Y.verticalizePunctuation(k);let J=[];const ae=function(he,Te,Me,Pe,ze,tt){if(!he)return[];const mt=[],ut=function(ft,qe,et,Tt,St,li){let Jt=0;for(let Bt=0;Bt<ft.length();Bt++){const wt=ft.getSection(Bt);Jt+=aA(ft.getCodePoint(Bt),wt,Tt,St,qe,li)}return Jt/Math.max(1,Math.ceil(Jt/et))}(he,Te,Me,Pe,ze,tt),pt=he.text.indexOf("â")>=0;let bt=0;for(let ft=0;ft<he.length();ft++){const qe=he.getSection(ft),et=he.getCodePoint(ft);if(z0[et]||(bt+=aA(et,qe,Pe,ze,Te,tt)),ft<he.length()-1){const Tt=!((Ye=et)<11904||!(mi["Bopomofo Extended"](Ye)||mi.Bopomofo(Ye)||mi["CJK Compatibility Forms"](Ye)||mi["CJK Compatibility Ideographs"](Ye)||mi["CJK Compatibility"](Ye)||mi["CJK Radicals Supplement"](Ye)||mi["CJK Strokes"](Ye)||mi["CJK Symbols and Punctuation"](Ye)||mi["CJK Unified Ideographs Extension A"](Ye)||mi["CJK Unified Ideographs"](Ye)||mi["Enclosed CJK Letters and Months"](Ye)||mi["Halfwidth and Fullwidth Forms"](Ye)||mi.Hiragana(Ye)||mi["Ideographic Description Characters"](Ye)||mi["Kangxi Radicals"](Ye)||mi["Katakana Phonet
601ic Extensions"](Ye)||mi.Katakana(Ye)||mi["Vertical Forms"](Ye)||mi["Yi Radicals"](Ye)||mi["Yi Syllables"](Ye)));(ZO[et]||Tt||qe.image)&&mt.push(cA(ft+1,bt,ut,mt,XO(et,he.getCodePoint(ft+1),Tt&&pt),!1))}}var Ye;return uA(cA(he.length(),bt,ut,mt,0,!0))}(Y,E,m,e,c,B),{processBidirectionalText:ne,processStyledBidirectionalText:G}=sa;if(ne&&Y.sections.length===1){const he=ne(Y.toString(),ae);for(const Te of he){const Me=new Em;Me.text=Te,Me.sections=Y.sections;for(let Pe=0;Pe<Te.length;Pe++)Me.sectionIndex.push(0);J.push(Me)}}else if(G){const he=G(Y.text,Y.sectionIndex,ae);for(const Te of he){const Me=new Em;Me.text=Te[0],Me.sectionIndex=Te[1],Me.sections=Y.sections,J.push(Me)}}else J=function(he,Te){const Me=[],Pe=he.text;let ze=0;for(const tt of Te)Me.push(he.substring(ze,tt)),ze=tt;return ze<Pe.length&&Me.push(he.substring(ze,Pe.length)),Me}(Y,ae);const te=[],oe={positionedLines:te,text:Y.toString(),top:I[1],bottom:I[1],left:I[0],right:I[0],writingMode:M,iconsInText:!1,verticalizable:!1,hasBaseline:!1};if(function(he,Te,Me,Pe,ze,tt,mt,ut,pt,bt,Ye,ft){let qe=0,et=0,Tt=0;const St=ut==="right"?1:ut==="left"?0:.5;let li=!1;for(const ri of ze){const Oi=ri.getSections();for(const Xi of Oi){if(Xi.image)continue;const Ji=Te[Xi.fontStack];if(Ji&&(li=Ji.ascender!==void 0&&Ji.descender!==void 0,!li))break}if(!li)break}let Jt=0;for(const ri of ze){ri.trim();const Oi=ri.getMaxScale(),Xi=(Oi-1)*Xr,Ji={positionedGlyphs:[],lineOffset:0};he.positionedLines[Jt]=Ji;const ln=Ji.positionedGlyphs;let rn=0;if(!ri.length()){et+=tt,++Jt;continue}let nn=0,as=0;for(let le=0;le<ri.length();le++){const de=ri.getSection(le),nt=ri.getSectionIndex(le),Pt=ri.getCodePoint(le);let jt=de.scale,Nt=null,oi=null,Ai=null,pn=Xr,mn=0;pt===ba.vertical&&((Bt=Pt)===12312||Bt===12313||Bt===12316||Bt===12540||Bt===12448)&&(pt=ba.horizontal);const sn=!(pt===ba.horizontal||!Ye&&!Yu(Pt)||Ye&&(z0[Pt]||Lg(Pt)));if(de.image){const Xn=Pe.get(de.image.toString());if(!Xn)continue;Ai=de.image,he.iconsInText=he.iconsInText||!0,oi=Xn.paddedRect;const ds=Xn.displaySize;jt=jt*Xr/ft,Nt={width:ds[0],height:ds[1],left:0,top:-3,advance:sn?ds[1]:ds[0],localGlyph:!1},mn=li?-Nt.height*jt:Oi*Xr-17-ds[1]*jt,pn=Nt.advance;const gn=(sn?ds[0]:ds[1])*jt-Xr*Oi;gn>0&&gn>rn&&(rn=gn)}else{const Xn=Me[de.fontStack];if(!Xn)continue;Xn[Pt]&&(oi=Xn[Pt]);const ds=Te[de.fontStack];if(!ds)continue;const gn=ds.glyphs[Pt];if(!gn)continue;if(Nt=gn.metrics,pn=Pt!==8203?Xr:0,li){const $s=ds.ascender!==void 0?Math.abs(ds.ascender):0,vs=ds.descender!==void 0?Math.abs(ds.descender):0,Wn=($s+vs)*jt;nn<Wn&&(nn=Wn,as=($s-vs)/2*jt),mn=-$s*jt}else mn=(Oi-jt)*Xr-17}sn?(he.verticalizable=!0,ln.push({glyph:Pt,image:Ai,x:qe,y:et+mn,vertical:sn,scale:jt,localGlyph:Nt.localGlyph,fontStack:de.fontStack,sectionIndex:nt,metrics:Nt,rect:oi}),qe+=pn*jt+bt):(ln.push({glyph:Pt,image:Ai,x:qe,y:et+mn,vertical:sn,scale:jt,localGlyph:Nt.localGlyph,fontStack:de.fontStack,sectionIndex:nt,metrics:Nt,rect:oi}),qe+=Nt.advance*jt+bt)}ln.length!==0&&(Tt=Math.max(qe-bt,Tt),li?hA(ln,St,rn,as,tt*Oi/2):hA(ln,St,rn,0,tt/2)),qe=0;const ys=tt*Oi+rn;Ji.lineOffset=Math.max(rn,Xi),et+=ys,++Jt}var Bt;const wt=et,{horizontalAlign:Ni,verticalAlign:si}=db(mt);(function(ri,Oi,Xi,Ji,ln,rn){const nn=(Oi-Xi)*ln,as=-rn*Ji;for(const ys of ri)for(const le of ys.positionedGlyphs)le.x+=nn,le.y+=as})(he.positionedLines,St,Ni,si,Tt,wt),he.top+=-si*wt,he.bottom=he.top+wt,he.left+=-Ni*Tt,he.right=he.left+Tt,he.hasBaseline=li}(oe,e,r,c,J,g,b,T,M,E,k,N),!function(he){for(const Te of he)if(Te.positionedGlyphs.length!==0)return!1;return!0}(te))return oe}const z0={9:!0,10:!0,11:!0,12:!0,13:!0,32:!0},ZO={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 aA(a,e,r,c,h,m){if(e.image){const g=c.get(e.image.toString());return g?g.displaySize[0]*e.scale*Xr/m+h:0}{const g=r[e.fontStack],b=g&&g.glyphs[a];return b?b.metrics.advance*e.scale+h:0}}function lA(a,e,r,c){const h=Math.pow(a-e,2);return c?a<e?h/2:2*h:h+Math.abs(r)*r}function XO(a,e,r){let c=0;return a===10&&(c-=1e4),r&&(c+=150),a!==40&&a!==65288||(c+=50),e!==41&&e!==65289||(c+=50),c}function cA(a,e,r,c,h,m){let g=null,b=lA(e,r,h,m);for(const T of c){const E=lA(e-T.x,r,h,m)+T.badness;E<=b&&(g=T,b=E)}return{index:a,x:e,priorBreak:g,badness:b}}function uA(a){return a?uA(a.priorBreak).concat(a.index):[]}function db(a){let e=.5,r=.5;switch(a){case"right":case"top-right":case"bottom-right":e=1;break;case"left":case"top-left":case"bottom-left":e=0}switch(a){case"bottom":case"bottom-right":case"bottom-left":r=1;break;case"top":case"top-right":case"top-left":r=0}return{horizontalAlign:e,verticalAlign:r}}function hA(a,e,r,c,h){if(!(e||r||c||h))return;const m=a.length-1,g=a[m],b=(g.x+g.metrics.advance*g.scale)*e;for(let T=0;T<=m;T++)a[T].x-=b,a[T].y+=r+c+h}function dA(a){return a.imagePrimary!==void 0&&a.top!==void 0&&a.bottom!==void 0&&a.left!==void 0&&a.right!==void 0}function YO(a,e,r,c){const{horizontalAlign:h,verticalAlign:m}=db(c),g=r[0]-a.displaySize[0]*h,b=r[1]-a.displaySize[1]*m;return{imagePrimary:a,imageSecondary:e,top:b,bottom:b+a.displaySize[1],left:g,right:g+a.displaySize[0]}}function fA(a,e,r,c,h,m){const g=a.imagePrimary;let b;if(g.content){const Y=g.content,J=g.pixelRatio||1;b=[Y[0]/J,Y[1]/J,g.displaySize[0]-Y[2]/J,g.displaySize[1]-Y[3]/J]}const T=e.left*m,E=e.right*m;let I,M,k,B;r==="width"||r==="both"?(B=h[0]+T-c[3],M=h[0]+E+c[1]):(B=h[0]+(T+E-g.displaySize[0])/2,M=B+g.displaySize[0]);const N=e.top*m,U=e.bottom*m;return r==="height"||r==="both"?(I=h[1]+N-c[0],k=h[1]+U+c[2]):(I=h[1]+(N+U-g.displaySize[1])/2,k=I+g.displaySize[1]),{imagePrimary:g,imageSecondary:void 0,top:I,right:M,bottom:k,left:B,collisionPadding:b}}
vendor: 5,630 bytes, line 601
601function pA(a){return!a.imagePrimary.stretchX}function mA(a){return!a.imagePrimary.stretchY}function gA(a){return{width:a.right-a.left,height:a.bottom-a.top}}const du=128;function _A(a,e){const{expression:r}=e;if(r.kind==="constant")return{kind:"constant",layoutSize:r.evaluate(new Un(a+1))};if(r.kind==="source")return{kind:"source"};{const{zoomStops:c,interpolationType:h}=r;let m=0;for(;m<c.length&&c[m]<=a;)m++;m=Math.max(0,m-1);let g=m;for(;g<c.length&&c[g]<a+1;)g++;g=Math.min(c.length-1,g);const b=c[m],T=c[g];return r.kind==="composite"?{kind:"composite",minZoom:b,maxZoom:T,interpolationType:h}:{kind:"camera",minZoom:b,maxZoom:T,minSize:r.evaluate(new Un(b)),maxSize:r.evaluate(new Un(T)),interpolationType:h}}}function fb(a,{uSize:e,uSizeT:r},{lowerSize:c,upperSize:h}){return a.kind==="source"?c/du:a.kind==="composite"?gi(c/du,h/du,r):e}function f_(a,e,r=1){let c=0,h=0;if(a.kind==="constant")h=a.layoutSize*r;else if(a.kind!=="source"){const{interpolationType:m,minZoom:g,maxZoom:b}=a,T=m?ke(no.interpolationFactor(m,e,g,b),0,1):0;a.kind==="camera"?h=gi(a.minSize,a.maxSize,T)*r:c=T*r}return{uSizeT:c,uSize:h}}class lh extends kt{constructor(e,r,c,h,m){super(e,r),this.angle=h,this.z=c,m!==void 0&&(this.segment=m)}clone(){return new lh(this.x,this.y,this.z,this.angle,this.segment)}}function yA(a,e,r,c,h){if(e.segment===void 0)return!0;let m=e,g=e.segment+1,b=0;for(;b>-r/2;){if(g--,g<0)return!1;b-=a[g].dist(m),m=a[g]}b+=a[g].dist(a[g+1]),g++;const T=[];let E=0;for(;b<r/2;){const I=a[g],M=a[g+1];if(!M)return!1;let k=a[g-1].angleTo(I)-I.angleTo(M);for(k=Math.abs((k+3*Math.PI)%(2*Math.PI)-Math.PI),T.push({distance:b,angleDelta:k}),E+=k;b-T[0].distance>c;)E-=T.shift().angleDelta;if(E>h)return!1;g++,b+=I.dist(M)}return!0}function vA(a){let e=0;for(let r=0;r<a.length-1;r++)e+=a[r].dist(a[r+1]);return e}function xA(a,e,r){return a?.6*e*r:0}function bA(a,e){return Math.max(a?a.right-a.left:0,e?e.right-e.left:0)}function KO(a,e,r,c,h,m){const g=xA(r,h,m),b=bA(r,c)*m;let T=0;const E=vA(a)/2;for(let I=0;I<a.length-1;I++){const M=a[I],k=a[I+1],B=M.dist(k);if(T+B>E){const N=(E-T)/B,U=gi(M.x,k.x,N),Y=gi(M.y,k.y,N),J=new lh(U,Y,0,k.angleTo(M),I);return!g||yA(a,J,b,g,e)?J:void 0}T+=B}}function JO(a,e,r,c,h,m,g,b,T){const E=xA(c,m,g),I=bA(c,h),M=I*g,k=a[0].x===0||a[0].x===T||a[0].y===0||a[0].y===T;return e-M<e/4&&(e=M+e/4),wA(a,k?e/2*b%e:(I/2+2*m)*g*b%e,e,E,r,M,k,!1,T)}function wA(a,e,r,c,h,m,g,b,T){const E=m/2,I=vA(a);let M=0,k=e-r,B=[];for(let N=0;N<a.length-1;N++){const U=a[N],Y=a[N+1],J=U.dist(Y),ae=Y.angleTo(U);for(;k+r<M+J;){k+=r;const ne=(k-M)/J,G=gi(U.x,Y.x,ne),te=gi(U.y,Y.y,ne);if(G>=0&&G<T&&te>=0&&te<T&&k-E>=0&&k+E<=I){const oe=new lh(G,te,0,ae,N);c&&!yA(a,oe,m,c,h)||B.push(oe)}}M+=J}return b||B.length||g||(B=wA(a,M/2,r,c,h,m,g,!0,T)),B}function TA(a){let e=0,r=0;for(const g of a)e+=g.w*g.h,r=Math.max(r,g.w);a.sort((g,b)=>b.h-g.h);const c=[{x:0,y:0,w:Math.max(Math.ceil(Math.sqrt(e/.95)),r),h:1/0}];let h=0,m=0;for(const g of a)for(let b=c.length-1;b>=0;b--){const T=c[b];if(!(g.w>T.w||g.h>T.h)){if(g.x=T.x,g.y=T.y,m=Math.max(m,g.y+g.h),h=Math.max(h,g.x+g.w),g.w===T.w&&g.h===T.h){const E=c.pop();b<c.length&&(c[b]=E)}else g.h===T.h?(T.x+=g.w,T.w-=g.w):g.w===T.w?(T.y+=g.h,T.h-=g.h):(c.push({x:T.x+g.w,y:T.y,w:T.w-g.w,h:g.h}),T.y+=g.h,T.h-=g.h);break}}return{w:h,h:m,fill:e/(h*m)||0}}Vt(lh,"Anchor");const Yf=1;class p_{static getImagePositionScale(e,r,c){if(r&&e&&e.options&&e.options.transform){const h=e.options.transform;return{x:h.a,y:h.d}}return{x:c,y:c}}constructor(e,r,c,h){this.paddedRect=e;const{pixelRatio:m,version:g,stretchX:b,stretchY:T,content:E,sdf:I,usvg:M}=r;this.pixelRatio=m,this.stretchX=b,this.stretchY=T,this.content=E,this.version=g,this.padding=c,this.sdf=I,this.scale=p_.getImagePositionScale(h,M,m)}get tl(){return[this.paddedRect.x+this.padding,this.paddedRect.y+this.padding]}get br(){return[this.paddedRect.x+this.paddedRect.w-this.padding,this.paddedRect.y+this.paddedRect.h-this.padding]}get displaySize(){return[(this.paddedRect.w-2*this.padding)/this.scale.x,(this.paddedRect.h-2*this.padding)/this.scale.y]}}function pb(a,e,r){const c=ya.parse(a),h=function(m,g,b=[1,1]){return{x:0,y:0,w:(m.data?m.data.width:m.width*b[0])+2*g,h:(m.data?m.data.height:m.height*b[1])+2*g}}(e,r,[c.options.transform.a,c.options.transform.d]);return{bin:h,imagePosition:new p_(h,e,r,c),imageVariant:c}}class SA{constructor(e,r,c){const h=new Map,m=new Map;this.haveRenderCallbacks=[];const g=[];this.addImages(e,h,Yf,g),this.addImages(r,m,2,g);const{w:b,h:T}=TA(g),E=new xo({width:b||1,height:T||1});for(const[I,M]of e.entries()){const k=h.get(I).paddedRect;xo.copy(M.data,E,{x:0,y:0},{x:k.x+Yf,y:k.y+Yf},M.data,c,M.sdf)}for(const[I,M]of r.entries()){const k=m.get(I),B=k.paddedRect;let N=k.padding;const U=B.x+N,Y=B.y+N,J=M.data.width,ae=M.data.height;N=N>1?N-1:N,xo.copy(M.data,E,{x:0,y:0},{x:U,y:Y},M.data,c),xo.copy(M.data,E,{x:0,y:ae-N},{x:U,y:Y-N},{width:J,height:N},c),xo.copy(M.data,E,{x:0,y:0},{x:U,y:Y+ae},{width:J,height:N},c),xo.copy(M.data,E,{x:J-N,y:0},{x:U-N,y:Y},{width:N,height:ae},c),xo.copy(M.data,E,{x:0,y:0},{x:U+J,y:Y},{width:N,height:ae},c),xo.copy(M.data,E,{x:J-N,y:ae-N},{x:U-N,y:Y-N},{width:N,height:N},c),xo.copy(M.data,E,{x:0,y:ae-N},{x:U+J,y:Y-N},{width:N,height:N},c),xo.copy(M.data,E,{x:0,y:0},{x:U+J,y:Y+ae},{width:N,height:N},c),xo.copy(M.data,E,{x:J-N,y:0},{x:U-N,y:Y+ae},{width:N,height:N},c)}this.lut=c,this.image=E,this.iconPositions=h,this.patternPositions=m}addImages(e,r,c,h){for(const[m,g]of e.entries()){const{bin:b,imagePosition:T,imageVariant:E}=pb(m,g,c);r.set(m,T),h.push(b),g.hasRenderCallback&&this.haveRenderCallbacks.push(E.id
601)}}patchUpdatedImages(e,r,c){this.haveRenderCallbacks=this.haveRenderCallbacks.filter(h=>e.hasImage(h,c)),e.dispatchRenderCallbacks(this.haveRenderCallbacks,c);for(const h of e.getUpdatedImages(c)){for(const m of this.iconPositions.keys()){const g=ya.parse(m);if(To.isEqual(g.id,h)){const b=e.getImage(h,c);this.patchUpdatedImage(this.iconPositions.get(m),b,r)}}for(const m of this.patternPositions.keys()){const g=ya.parse(m);if(To.isEqual(g.id,h)){const b=e.getImage(h,c);this.patchUpdatedImage(this.patternPositions.get(m),b,r)}}}}patchUpdatedImage(e,r,c){if(!e||!r||e.version===r.version)return;e.version=r.version;const[h,m]=e.tl,g=e.sdf;if(this.lut||g){const b={width:r.data.width,height:r.data.height},T=new xo(b);xo.copy(r.data,T,{x:0,y:0},{x:0,y:0},b,this.lut,g),c.update(T,{position:{x:h,y:m}})}else c.update(r.data,{position:{x:h,y:m}})}}Vt(p_,"ImagePosition"),Vt(SA,"ImageAtlas");const F0=1e20;function EA(a,e,r,c,h,m,g,b,T){for(let E=e;E<e+c;E++)AA(a,r*m+E,m,h,g,b,T);for(let E=r;E<r+h;E++)AA(a,E*m+e,1,c,g,b,T)}function AA(a,e,r,c,h,m,g){m[0]=0,g[0]=-1e20,g[1]=F0,h[0]=a[e];for(let b=1,T=0,E=0;b<c;b++){h[b]=a[e+b*r];const I=b*b;do{const M=m[T];E=(h[b]-h[M]+I-M*M)/(b-M)/2}while(E<=g[T]&&--T>-1);T++,m[T]=b,g[T]=E,g[T+1]=F0}for(let b=0,T=0;b<c;b++){for(;g[T+1]<b;)T++;const E=m[T],I=b-E;a[e+b*r]=h[E]+I*I}}const Mc=2,mb={none:0,ideographs:1,all:2};class Am{constructor(e,r,c){this.requestManager=e,this.localGlyphMode=r,this.localFontFamily=c,this.urls={},this.entries={},this.localGlyphs={200:{},400:{},500:{},900:{}}}setURL(e,r){this.urls[r]=e}getGlyphs(e,r,c){const h=[],m=this.urls[r]||Fr.GLYPHS_URL;for(const g in e)for(const b of e[g])h.push({stack:g,id:b});rt(h,({stack:g,id:b},T)=>{let E=this.entries[g];E||(E=this.entries[g]={glyphs:{},requests:{},ranges:{},ascender:void 0,descender:void 0});let I=E.glyphs[b];if(I!==void 0)return void T(null,{stack:g,id:b,glyph:I});if(I=this._tinySDF(E,g,b),I)return E.glyphs[b]=I,void T(null,{stack:g,id:b,glyph:I});const M=Math.floor(b/256);if(256*M>65535)return Yi("glyphs > 65535 not supported"),void T(null,{stack:g,id:b,glyph:I});if(E.ranges[M])return void T(null,{stack:g,id:b,glyph:I});let k=E.requests[M];k||(k=E.requests[M]=[],Am.loadGlyphRange(g,M,m,this.requestManager,(B,N)=>{if(N){E.ascender=N.ascender,E.descender=N.descender;for(const U in N.glyphs)this._doesCharSupportLocalGlyph(+U)||(E.glyphs[+U]=N.glyphs[+U]);E.ranges[M]=!0}for(const U of k)U(B,N);delete E.requests[M]})),k.push((B,N)=>{B?T(B):N&&T(null,{stack:g,id:b,glyph:N.glyphs[b]||null})})},(g,b)=>{if(g)c(g);else if(b){const T={};for(const{stack:E,id:I,glyph:M}of b)T[E]===void 0&&(T[E]={}),T[E].glyphs===void 0&&(T[E].glyphs={}),T[E].glyphs[I]=M&&{id:M.id,bitmap:M.bitmap.clone(),metrics:M.metrics},T[E].ascender=this.entries[E].ascender,T[E].descender=this.entries[E].descender;c(null,T)}})}_doesCharSupportLocalGlyph(e){return this.localGlyphMode!==mb.none&&(this.localGlyphMode===mb.all?!!this.localFontFamily:!!this.localFontFamily&&(mi["CJK Unified Ideographs"](e)||mi["Hangul Syllables"](e)||mi.Hiragana(e)||mi.Katakana(e)||mi["CJK Symbols and Punctuation"](e)||mi["CJK Unified Ideographs Extension A"](e)||mi["CJK Unified Ideographs Extension B"](e)||mi.Osage(e)))}_tinySDF(e,r,c){const h=this.localFontFamily;if(!h||!this._doesCharSupportLocalGlyph(c))return;let m=e.tinySDF;if(!m){let U="400";/bold/i.test(r)?U="900":/medium/i.test(r)?U="500":/light/i.test(r)&&(U="200"),m=e.tinySDF=new Am.TinySDF({fontFamily:h,fontWeight:U,fontSize:24*Mc,buffer:3*Mc,radius:8*Mc}),m.fontWeight=U}if(this.localGlyphs[m.fontWeight][c])return this.localGlyphs[m.fontWeight][c];const g=String.fromCodePoint(c),{data:b,width:T,height:E,glyphWidth:I,glyphHeight:M,glyphLeft:k,glyphTop:B,glyphAdvance:N}=m.draw(g);return this.localGlyphs[m.fontWeight][c]={id:c,bitmap:new wd({width:T,height:E},b),metrics:{width:I/Mc,height:M/Mc,left:k/Mc,top:B/Mc-27,advance:N/Mc,localGlyph:!0}}}}Am.loadGlyphRange=function(a,e,r,c,h){const m=256*e,g=m+255,b=c.transformRequest(c.normalizeGlyphsURL(r).replace("{fontstack}",a).replace("{range}",`${m}-${g}`),Pu.Glyphs);cc(b,(T,E)=>{if(T)h(T);else if(E){const I={},M=function(k){return new O0(k).readFields(HO,{})}(E);for(const k of M.glyphs)I[k.id]=k;
601h(null,{glyphs:I,ascender:M.ascender,descender:M.descender})}})},Am.TinySDF=class{constructor({fontSize:a=24,buffer:e=3,radius:r=8,cutoff:c=.25,fontFamily:h="sans-serif",fontWeight:m="normal",fontStyle:g="normal"}={}){this.buffer=e,this.cutoff=c,this.radius=r;const b=this.size=a+4*e,T=this._createCanvas(b),E=this.ctx=T.getContext("2d",{willReadFrequently:!0});E.font=`${g} ${m} ${a}px ${h}`,E.textBaseline="alphabetic",E.textAlign="left",E.fillStyle="black",this.gridOuter=new Float64Array(b*b),this.gridInner=new Float64Array(b*b),this.f=new Float64Array(b),this.z=new Float64Array(b+1),this.v=new Uint16Array(b)}_createCanvas(a){const e=document.createElement("canvas");return e.width=e.height=a,e}draw(a){const{width:e,actualBoundingBoxAscent:r,actualBoundingBoxDescent:c,actualBoundingBoxLeft:h,actualBoundingBoxRight:m}=this.ctx.measureText(a),g=Math.ceil(r),b=Math.max(0,Math.min(this.size-this.buffer,Math.ceil(m-h))),T=Math.min(this.size-this.buffer,g+Math.ceil(c)),E=b+2*this.buffer,I=T+2*this.buffer,M=Math.max(E*I,0),k=new Uint8ClampedArray(M),B={data:k,width:E,height:I,glyphWidth:b,glyphHeight:T,glyphTop:g,glyphLeft:0,glyphAdvance:e};if(b===0||T===0)return B;const{ctx:N,buffer:U,gridInner:Y,gridOuter:J}=this;N.clearRect(U,U,b,T),N.fillText(a,U,U+g);const ae=N.getImageData(U,U,b,T);J.fill(F0,0,M),Y.fill(0,0,M);for(let ne=0;ne<T;ne++)for(let G=0;G<b;G++){const te=ae.data[4*(ne*b+G)+3]/255;if(te===0)continue;const oe=(ne+U)*E+G+U;if(te===1)J[oe]=0,Y[oe]=F0;else{const he=.5-te;J[oe]=he>0?he*he:0,Y[oe]=he<0?he*he:0}}EA(J,0,0,E,I,E,this.f,this.v,this.z),EA(Y,U,U,b,T,E,this.f,this.v,this.z);for(let ne=0;ne<M;ne++){const G=Math.sqrt(J[ne])-Math.sqrt(Y[ne]);k[ne]=Math.round(255-255*(G/this.radius+this.cutoff))}return B}};const Kf=Yf;function CA(a,e){return a+e[1]-e[0]}function IA(a,e,r,c,h=1){const m=[],g=a.imagePrimary,b=g.pixelRatio,T=g.paddedRect.w-2*Kf,E=g.paddedRect.h-2*Kf,I=(a.right-a.left)*h,M=(a.bottom-a.top)*h,k=g.stretchX||[[0,T]],B=g.stretchY||[[0,E]],N=k.reduce(CA,0),U=B.reduce(CA,0),Y=T-N,J=E-U;let ae=0,ne=N,G=0,te=U,oe=0,he=Y,Te=0,Me=J;if(g.content&&c){const ze=g.content;ae=B0(k,0,ze[0]),G=B0(B,0,ze[1]),ne=B0(k,ze[0],ze[2]),te=B0(B,ze[1],ze[3]),oe=ze[0]-ae,Te=ze[1]-G,he=ze[2]-ze[0]-ne,Me=ze[3]-ze[1]-te}const Pe=(ze,tt,mt,ut)=>{const pt=N0(ze.stretch-ae,ne,I,a.left*h),bt=V0(ze.fixed-oe,he,ze.stretch,N),Ye=N0(tt.stretch-G,te,M,a.top*h),ft=V0(tt.fixed-Te,Me,tt.stretch,U),qe=N0(mt.stretch-ae,ne,I,a.left*h),et=V0(mt.fixed-oe,he,mt.stretch,N),Tt=N0(ut.stretch-G,te,M,a.top*h),St=V0(ut.fixed-Te,Me,ut.stretch,U),li=new kt(pt,Ye),Jt=new kt(qe,Ye),Bt=new kt(qe,Tt),wt=new kt(pt,Tt),Ni=new kt(bt/b,ft/b),si=new kt(et/b,St/b),ri=e*Math.PI/180;if(ri){const nn=Math.sin(ri),as=Math.cos(ri),ys=[as,-nn,nn,as];li._matMult(ys),Jt._matMult(ys),wt._matMult(ys),Bt._matMult(ys)}const Oi=ze.stretch+ze.fixed,Xi=mt.stretch+mt.fixed,Ji=tt.stretch+tt.fixed,ln=ut.stretch+ut.fixed,rn=a.imageSecondary;return{tl:li,tr:Jt,bl:wt,br:Bt,texPrimary:{x:g.paddedRect.x+Kf+Oi,y:g.paddedRect.y+Kf+Ji,w:Xi-Oi,h:ln-Ji},texSecondary:rn?{x:rn.paddedRect.x+Kf+Oi,y:rn.paddedRect.y+Kf+Ji,w:Xi-Oi,h:ln-Ji}:void 0,writingMode:void 0,glyphOffset:[0,0],sectionIndex:0,pixelOffsetTL:Ni,pixelOffsetBR:si,minFontScaleX:he/b/I,minFontScaleY:Me/b/M,isSDF:r}};if(c&&(g.stretchX||g.stretchY)){const ze=MA(k,Y,N),tt=MA(B,J,U);for(let mt=0;mt<ze.length-1;mt++){const ut=ze[mt],pt=ze[mt+1];for(let bt=0;bt<tt.length-1;bt++)m.push(Pe(ut,tt[bt],pt,tt[bt+1]))}}else m.push(Pe({fixed:0,stretch:-1},{fixed:0,stretch:-1},{fixed:0,stretch:T+1},{fixed:0,stretch:E+1}));return m}function B0(a,e,r){let c=0;for(const h of a)c+=Math.max(e,Math.min(r,h[1]))-Math.max(e,Math.min(r,h[0]));return c}function MA(a,e,r){const c=[{fixed:-1,stretch:0}];for(const[h,m]of a){const g=c[c.length-1];c.push({fixed:h-g.stretch,stretch:g.stretch}),c.push({fixed:h-g.stretch,stretch:g.stretch+(m-h)})}return c.push({fixed:e+Kf,stretch:r}),c}function N0(a,e,r,c){return a/e*r+c}function V0(a,e,r,c){return a-e*r/c}function QO(a,e,r,c){const h=e+a.positionedLines[c].lineOffset;return c===0?r+h/2:r+(h+(e+a.positionedLines[c-1].lineOffset))/2}function e5(a,e=1,r=!1){let c=1/0,h=1/0,m=-1/0,g=-1/0;const b=a[0];for(let B=0;B<b.length;B++){const N=b[B];(!B||N.x<c)&&(c=N.x),(!B||N.y<h)&&(h=N.y),(!B||N.x>m)&&(m=N.x),(!B||N.y>g)&&(g=N.y)}const T=Math.min(m-c,g-h);let E=T/2;const I=new Wh([],t5);if(T===0)return new kt(c,h);for(let B=c;B<m;B+=T)for(let N=h;N<g;N+=T)I.push(new Cm(B+E,N+E,E,a));let M=function(B){let N=0,U=0,Y=0;const J=B[0];for(let ae=0,ne=J.length,G=ne-1;ae<ne;G=ae++){const te=J[ae],oe=J[G],he=te.x*oe.y-oe.x*te.y;U+=(te.x+oe.x)*he,Y+=(te.y+oe.y)*he,N+=3*he}return new Cm(U/N,Y/N,0,B)}(a),k=I.length;for(;I.length;){const B=I.pop();(B.d>M.d||!M.d)&&(M=B,r&&console.log("found best %d after %d probes",Math.round(1e4*B.d)/1e4,k)),B.max-M.d<=e||(E=B.h/2,I.push(new Cm(B.p.x-E,B.p.y-E,E,a)),I.push(new Cm(B.p.x+E,B.p.y-E,E,a)),I.push(new Cm(B.p.x-E,B.p.y+E,E,a)),I.push(new Cm(B.p.x+E,B.p.y+E,E,a)),k+=4)}
601return r&&(console.log(`num probes: ${k}`),console.log(`best distance: ${M.d}`)),M.p}function t5(a,e){return e.max-a.max}class Cm{constructor(e,r,c,h){this.p=new kt(e,r),this.h=c,this.d=function(m,g){let b=!1,T=1/0;for(let E=0;E<g.length;E++){const I=g[E];for(let M=0,k=I.length,B=k-1;M<k;B=M++){const N=I[M],U=I[B];N.y>m.y!=U.y>m.y&&m.x<(U.x-N.x)*(m.y-N.y)/(U.y-N.y)+N.x&&(b=!b),T=Math.min(T,bn(m,N,U))}}return(b?1:-1)*Math.sqrt(T)}(this.p,h),this.max=this.d+this.h*Math.SQRT2}}const i5=Object.keys,gb=Number.POSITIVE_INFINITY,n5=Math.sqrt(2);function PA(a,[e,r]){let c=0,h=0;if(r===gb){e<0&&(e=0);const m=e/n5;switch(a){case"top-right":case"top-left":h=m-7;break;case"bottom-right":case"bottom-left":h=7-m;break;case"bottom":h=7-e;break;case"top":h=e-7}switch(a){case"top-right":case"bottom-right":c=-m;break;case"top-left":case"bottom-left":c=m;break;case"left":c=e;break;case"right":c=-e}}else{switch(e=Math.abs(e),r=Math.abs(r),a){case"top-right":case"top-left":case"top":h=r-7;break;case"bottom-right":case"bottom-left":case"bottom":h=7-r}switch(a){case"top-right":case"bottom-right":case"right":c=-e;break;case"top-left":case"bottom-left":case"left":c=e}}return[c,h]}function $0(a,e,r,c,h,m,g,b,T){if(!e||!e.usvg)return;const E=gA(c),I=gA(h),M=m!=="both"&&m!=="width"||!pA(c)?1:Math.max(1,I.width/E.width),k=m!=="both"&&m!=="height"||!mA(c)?1:Math.max(1,I.height/E.height);r.scaleSelf(M,k);const B=r.toString();g.set(B,r),b.set(B,e);const{imagePosition:N}=pb(B,e,Yf);T.set(B,N)}function DA(a,e,r,c,h,m,g,b){if(!a)return;const T=function(E,I,M,k,B){if(E.kind==="camera")return E.maxSize;if(E.kind==="composite"){const N=I.possiblyEvaluate(new Un(E.maxZoom),M).evaluate(B,{},M),U=I.possiblyEvaluate(new Un(E.minZoom),M).evaluate(B,{},M);return Math.max(N,U)}return I.possiblyEvaluate(new Un(k)).evaluate(B,{},M)}(e,r,c,h,m);return a.scaleSelf(T*b*g)}function kA(a,e,r,c,h,m,g,b){return{iconPrimary:DA(a.getPrimary(),e,r,c,h,m,g,b),iconSecondary:DA(a.getSecondary(),e,r,c,h,m,g,b)}}function LA(a,e,r,c){if(!a)return;const h=e.get(r.toString());if(a.imagePrimary=h,c){const m=e.get(c.toString());a.imageSecondary=m}}function s5(a,e){for(const r in a.horizontal)RA(a.horizontal[r],e);RA(a.vertical,e)}function RA(a,e){if(a){for(const r of a.positionedLines)for(const c of r.positionedGlyphs)if(c.image!==null){const h=c.image.toString();c.rect=e.get(h).paddedRect}}}function _b(a){switch(a){case"right":case"top-right":case"bottom-right":return"right";case"left":case"top-left":case"bottom-left":return"left"}return"center"}function r5(a,e,r,c,h,m,g,b,T){const E=yb(m.horizontal)||m.vertical,I=r.get("icon-text-fit-padding").evaluate(c,{},h);let M,k=e;return e&&T!=="none"&&(a.allowVerticalPlacement&&m.vertical&&(M=fA(e,m.vertical,T,I,b,g)),E&&(k=fA(e,E,T,I,b,g))),{defaultShapedIcon:k,verticallyShapedIcon:M}}function o5(a,e,r,c,h,m,g,b,T,E,I,M,k,B,N,U,Y,J,ae,ne){let G=g.textMaxSize.evaluate(e,{},k);G===void 0?G=b*g.textScaleFactor:G*=g.textScaleFactor;const te=a.layers[0].layout,oe=yb(r.horizontal)||r.vertical,he=B.name==="globe",Te=Xr,Me=a.tilePixelRatio*G/Te,Pe=(bt=a.overscaling,a.zoom>18&&bt>2&&(bt>>=1),Math.max(Rt/(512*bt),1)*te.get("symbol-spacing")),ze=te.get("text-padding")*a.tilePixelRatio,tt=te.get("icon-padding")*a.tilePixelRatio,mt=X(te.get("text-max-angle")),ut=te.get("icon-rotation-alignment")==="map"&&ne!=="point",pt=Pe/2;var bt;a.hasAnyIconTextFit===!1&&Y!=="none"&&(a.hasAnyIconTextFit=!0);const Ye=e.properties?+e.properties[Wf]:null,ft=Ye&&a.elevationFeatureIdToIndex?a.elevationFeatureIdToIndex.get(Ye):65535,qe=(et,Tt,St)=>{if(Tt.x<0||Tt.x>=Rt||Tt.y<0||Tt.y>=Rt)return;let li=null;if(he){const{x:Jt,y:Bt,z:wt}=B.projectTilePoint(Tt.x,Tt.y,St);li={anchor:new lh(Jt,Bt,wt,0,void 0),up:B.upVector(St,Tt.x,Tt.y)}}(function(Jt,Bt,wt,Ni,si,ri,Oi,Xi,Ji,ln,rn,nn,as,ys,le,de,nt,Pt,jt,Nt,oi,Ai,pn,mn,sn,Xn,ds,gn,$s){const vs=Jt.addToLineVertexArray(Bt,Ni);let Wn,Js,ws,fs,xs,Qn,an,ss=0,js=0,Ei=0,En=0,Ts=-1,Xs=-1;const Ps={};let yr=uo("");const ls=wt?wt.anchor:Bt,pr=gn!=="none";let oa=0,bo=0;if(Ji._unevaluatedLayout.getValue("text-radial-offset")===void 0){const vr=Ji.layout.get("text-offset").evaluate(oi,{},sn);oa=vr[0]*Xr,bo=vr[1]*Xr}else oa=Ji.layout.get("text-radial-offset").evaluate(oi,{},sn)*Xr,bo=gb;if(Jt.allowVerticalPlacement&&si.vertical){const vr=si.vertical;if(le)Qn=vb(vr),Xi&&(an=vb(Xi));else{const Rr=Ji.layout.get("text-rotate").evaluate(oi,{},sn)+90;ws=j0(ln,ls,Bt,rn,nn,as,vr,ys,Rr,de),Xi&&(fs=j0(ln,ls,Bt,rn,nn,as,Xi,Pt,Rr))}}if(ri){const vr=Jt.iconSizeData,Rr=Ji.layout.get("icon-rotate").evaluate(oi,{},sn),wo=IA(ri,Rr,pn,pr,Ai.iconScaleFactor),Ro=Xi?IA(Xi,Rr,pn,pr,Ai.iconScaleFactor):void 0;
601Js=j0(ln,ls,Bt,rn,nn,as,ri,Pt,Rr,null),ss=4*wo.length;let Co=null;vr.kind==="source"?(Co=[du*Ji.layout.get("icon-size").evaluate(oi,{},sn)*Ai.iconScaleFactor],Co[0]>Ed&&Yi(`${Jt.layerIds[0]}: Value for "icon-size" is >= ${m_}. Reduce your "icon-size".`)):vr.kind==="composite"&&(Co=[du*Ai.compositeIconSizes[0].evaluate(oi,{},sn)*Ai.iconScaleFactor,du*Ai.compositeIconSizes[1].evaluate(oi,{},sn)*Ai.iconScaleFactor],(Co[0]>Ed||Co[1]>Ed)&&Yi(`${Jt.layerIds[0]}: Value for "icon-size" is >= ${m_}. Reduce your "icon-size".`)),Jt.addSymbols(Jt.icon,wo,Co,Nt,jt,oi,void 0,wt,Bt,vs.lineStartIndex,vs.lineLength,-1,mn,sn,Xn,ds),Ts=Jt.icon.placedSymbolArray.length-1,Ro&&(js=4*Ro.length,Jt.addSymbols(Jt.icon,Ro,Co,Nt,jt,oi,ba.vertical,wt,Bt,vs.lineStartIndex,vs.lineLength,-1,mn,sn,Xn,ds),Xs=Jt.icon.placedSymbolArray.length-1)}for(const vr in si.horizontal){const Rr=vr,wo=si.horizontal[Rr];Wn||(yr=uo(wo.text),le?xs=vb(wo):Wn=j0(ln,ls,Bt,rn,nn,as,wo,ys,Ji.layout.get("text-rotate").evaluate(oi,{},sn),de));const Ro=wo.positionedLines.length===1;if(Ei+=OA(Jt,wt,Bt,wo,Oi,Ji,le,oi,de,vs,si.vertical?ba.horizontal:ba.horizontalOnly,Ro?i5(si.horizontal):[Rr],Ps,Ts,Ai,mn,sn,Xn),Ro)break}si.vertical&&(En+=OA(Jt,wt,Bt,si.vertical,Oi,Ji,le,oi,de,vs,ba.vertical,["vertical"],Ps,Xs,Ai,mn,sn,Xn));let oo=-1;const aa=(vr,Rr)=>vr?Math.max(vr,Rr):Rr;oo=aa(xs,oo),oo=aa(Qn,oo),oo=aa(an,oo);const fu=oo>-1?1:0;Jt.glyphOffsetArray.length>=65535&&Yi("Too many glyphs being rendered in a tile. See https://github.com/mapbox/mapbox-gl-js/issues/2907"),oi.sortKey!==void 0&&Jt.addToSortKeyRanges(Jt.symbolInstances.length,oi.sortKey),Jt.symbolInstances.emplaceBack(Bt.x,Bt.y,ls.x,ls.y,ls.z,Ps.right>=0?Ps.right:-1,Ps.center>=0?Ps.center:-1,Ps.left>=0?Ps.left:-1,Ps.vertical>=0?Ps.vertical:-1,Ts,Xs,yr,Wn!==void 0?Wn:Jt.collisionBoxArray.length,Wn!==void 0?Wn+1:Jt.collisionBoxArray.length,ws!==void 0?ws:Jt.collisionBoxArray.length,ws!==void 0?ws+1:Jt.collisionBoxArray.length,Js!==void 0?Js:Jt.collisionBoxArray.length,Js!==void 0?Js+1:Jt.collisionBoxArray.length,fs||Jt.collisionBoxArray.length,fs?fs+1:Jt.collisionBoxArray.length,rn,Ei,En,ss,js,fu,0,oa,bo,oo,0,pr?1:0,$s)})(a,Tt,li,et,r,c,m,h,a.layers[0],a.collisionBoxArray,e.index,e.sourceLayerIndex,a.index,ze,ae,E,0,tt,ut,J,e,g,I,M,k,N,U,Y,ft)};if(ne==="line")for(const et of R0(e.geometry,0,0,Rt,Rt)){const Tt=JO(et,Pe,mt,r.vertical||oe,c,Te,Me,a.overscaling,Rt);for(const St of Tt)oe&&a5(a,oe.text,pt,St)||qe(et,St,k)}else if(ne==="line-center"){for(const et of e.geometry)if(et.length>1){const Tt=KO(et,mt,r.vertical||oe,c,Te,Me);Tt&&qe(et,Tt,k)}}else if(e.type==="Polygon")for(const et of C0(e.geometry,0)){const Tt=e5(et,16);qe(et[0],new lh(Tt.x,Tt.y,0,0,void 0),k)}else if(e.type==="LineString")for(const et of e.geometry)qe(et,new lh(et[0].x,et[0].y,0,0,void 0),k);else if(e.type==="Point")for(const et of e.geometry)for(const Tt of et)qe([Tt],new lh(Tt.x,Tt.y,0,0,void 0),k)}const m_=255,Ed=m_*du;function OA(a,e,r,c,h,m,g,b,T,E,I,M,k,B,N,U,Y,J){const ae=function(te,oe,he,Te,Me,Pe,ze,tt){const mt=[];if(oe.positionedLines.length===0)return mt;const ut=Te.layout.get("text-rotate").evaluate(Pe,{})*Math.PI/180,pt=function(et){const Tt=et[0],St=et[1],li=Tt*St;return li>0?[Tt,-St]:li<0?[-Tt,St]:Tt===0?[St,Tt]:[St,-Tt]}(he);let bt=Math.abs(oe.top-oe.bottom);for(const et of oe.positionedLines)bt-=et.lineOffset;const Ye=oe.positionedLines.length,ft=bt/Ye;let qe=oe.top-he[1];for(let et=0;et<Ye;++et){const Tt=oe.positionedLines[et];qe=QO(oe,ft,qe,et);for(const St of Tt.positionedGlyphs){if(!St.rect)continue;const li=St.rect||{};let Jt=qO+1,Bt=!0,wt=1,Ni=0;if(St.image){const oi=ze.get(St.image.toString());if(!oi)continue;if(oi.sdf){Yi("SDF images are not supported in formatted text and will be ignored.");continue}Bt=!1,wt=oi.pixelRatio,Jt=Yf/wt}const si=(Me||tt)&&St.vertical,ri=St.metrics.advance*St.scale/2,Oi=St.metrics,Xi=St.rect;if(Xi===null)continue;tt&&oe.verticalizable&&(Ni=St.image?ri-St.metrics.width*St.scale/2:0);const Ji=Me?[St.x+ri,St.y]:[0,0];let ln=[0,0],rn=[0,0],nn=!1;Me||(si?(rn=[St.x+ri+pt[0],St.y+pt[1]-Ni],nn=!0):ln=[St.x+ri+he[0],St.y+he[1]-Ni]);const as=Xi.w*St.scale/(wt*(St.localGlyph?Mc:1)),ys=Xi.h*St.scale/(wt*(St.localGlyph?Mc:1));let le,de,nt,Pt;if(si){const oi=St.y-qe,Ai=new kt(-ri,ri-oi),pn=-Math.PI/2,mn=new kt(...rn);
vendor: 6,291 bytes, line 601
601le=new kt(-ri+ln[0],ln[1]),le._rotateAround(pn,Ai)._add(mn),le.x+=-oi+ri,le.y-=(Oi.left-Jt)*St.scale;const sn=St.image?Oi.advance*St.scale:Xr*St.scale,Xn=String.fromCodePoint(St.glyph);$O(Xn)?le.x+=(1-Jt)*St.scale:jO(Xn)?le.x+=sn-Oi.height*St.scale+(-Jt-1)*St.scale:le.x+=St.image||Oi.width+2*Jt===Xi.w&&Oi.height+2*Jt===Xi.h?(sn-ys)/2:(sn-(Oi.height+2*Jt)*St.scale)/2,de=new kt(le.x,le.y-as),nt=new kt(le.x+ys,le.y),Pt=new kt(le.x+ys,le.y-as)}else{const oi=(Oi.left-Jt)*St.scale-ri+ln[0],Ai=(-Oi.top-Jt)*St.scale+ln[1],pn=oi+as,mn=Ai+ys;le=new kt(oi,Ai),de=new kt(pn,Ai),nt=new kt(oi,mn),Pt=new kt(pn,mn)}if(ut){let oi;oi=Me?new kt(0,0):nn?new kt(pt[0],pt[1]):new kt(he[0],he[1]),le._rotateAround(ut,oi),de._rotateAround(ut,oi),nt._rotateAround(ut,oi),Pt._rotateAround(ut,oi)}const jt=new kt(0,0),Nt=new kt(0,0);mt.push({tl:le,tr:de,bl:nt,br:Pt,texPrimary:li,texSecondary:void 0,writingMode:oe.writingMode,glyphOffset:Ji,sectionIndex:St.sectionIndex,isSDF:Bt,pixelOffsetTL:jt,pixelOffsetBR:Nt,minFontScaleX:0,minFontScaleY:0})}}return mt}(0,c,T,m,g,b,h,a.allowVerticalPlacement),ne=a.textSizeData;let G=null;ne.kind==="source"?(G=[du*m.layout.get("text-size").evaluate(b,{},Y)*N.textScaleFactor],G[0]>Ed&&Yi(`${a.layerIds[0]}: Value for "text-size" is >= ${m_}. Reduce your "text-size".`)):ne.kind==="composite"&&(G=[du*N.compositeTextSizes[0].evaluate(b,{},Y)*N.textScaleFactor,du*N.compositeTextSizes[1].evaluate(b,{},Y)*N.textScaleFactor],(G[0]>Ed||G[1]>Ed)&&Yi(`${a.layerIds[0]}: Value for "text-size" is >= ${m_}. Reduce your "text-size".`)),a.addSymbols(a.text,ae,G,T,g,b,I,e,r,E.lineStartIndex,E.lineLength,B,U,Y,J,!1);for(const te of M)k[te]=a.text.placedSymbolArray.length-1;return 4*ae.length}function yb(a){for(const e in a)return a[e];return null}function j0(a,e,r,c,h,m,g,b,T,E){let I=g.top,M=g.bottom,k=g.left,B=g.right;if(dA(g)&&g.collisionPadding){const N=g.collisionPadding;k-=N[0],I-=N[1],B+=N[2],M+=N[3]}if(T){const N=new kt(k,I),U=new kt(B,I),Y=new kt(k,M),J=new kt(B,M),ae=X(T);let ne=new kt(0,0);E&&(ne=new kt(E[0],E[1])),N._rotateAround(ae,ne),U._rotateAround(ae,ne),Y._rotateAround(ae,ne),J._rotateAround(ae,ne),k=Math.min(N.x,U.x,Y.x,J.x),B=Math.max(N.x,U.x,Y.x,J.x),I=Math.min(N.y,U.y,Y.y,J.y),M=Math.max(N.y,U.y,Y.y,J.y)}return a.emplaceBack(e.x,e.y,e.z,r.x,r.y,k,I,B,M,b,c,h,m),a.length-1}function vb(a){dA(a)&&a.collisionPadding&&(a.top-=a.collisionPadding[1],a.bottom+=a.collisionPadding[3]);const e=a.bottom-a.top;return e>0?Math.max(10,e):null}function a5(a,e,r,c){const h=a.compareText;if(e in h){const m=h[e];for(let g=m.length-1;g>=0;g--)if(c.dist(m[g])<r)return!0}else h[e]=[];return h[e].push(c),!1}function zA(a,e){const r=a.fovAboveCenter,c=a.elevation?a.elevation.getMinElevationBelowMSL()*e:0,h=(a._camera.position[2]*a.worldSize-c)/Math.cos(a._pitch),m=Math.sin(r)*h/Math.sin(Math.max(Math.PI/2-a._pitch-r,.01));let g=Math.sin(a._pitch)*m+h;const b=h*(1/a._horizonShift);if(!a.elevation||a.elevation.exaggeration()===0){let T=Math.max(a.zoom-17,0);a.isOrthographic&&(T/=10),g*=1+T}return Math.min(1.01*g,b)}function g_(a,e){if(!e.isReprojectedInTileSpace)return{scale:1<<a.z,x:a.x,y:a.y,x2:a.x+1,y2:a.y+1,projection:e};const r=Math.pow(2,-a.z),c=a.x*r,h=(a.x+1)*r,m=a.y*r,g=(a.y+1)*r,b=Se(c),T=Se(h),E=Ae(m),I=Ae(g),M=e.project(b,E),k=e.project(T,E),B=e.project(T,I),N=e.project(b,I);let U=Math.min(M.x,k.x,B.x,N.x),Y=Math.min(M.y,k.y,B.y,N.y),J=Math.max(M.x,k.x,B.x,N.x),ae=Math.max(M.y,k.y,B.y,N.y);const ne=r/16;function G(oe,he,Te,Me,Pe,ze){const tt=(Te+Pe)/2,mt=(Me+ze)/2,ut=e.project(Se(tt),Ae(mt)),pt=Math.max(0,U-ut.x,Y-ut.y,ut.x-J,ut.y-ae);U=Math.min(U,ut.x),J=Math.max(J,ut.x),Y=Math.min(Y,ut.y),ae=Math.max(ae,ut.y),pt>ne&&(G(oe,ut,Te,Me,tt,mt),G(ut,he,tt,mt,Pe,ze))}G(M,k,c,m,h,m),G(k,B,h,m,h,g),G(B,N,h,g,c,g),G(N,M,c,g,c,m),U-=ne,Y-=ne,J+=ne,ae+=ne;const te=1/Math.max(J-U,ae-Y);return{scale:te,x:U*te,y:Y*te,x2:J*te,y2:ae*te,projection:e}}function FA(a,{x:e,y:r},c=0){return new kt(((e-c)*a.scale-a.x)*Rt,(r*a.scale-a.y)*Rt)}const l5=re(new Float32Array(16));class Ad{constructor(e){this.spec=e,this.name=e.name,this.wrap=!1,this.requiresDraping=!1,this.supportsWorldCopies=!1,this.supportsTerrain=!1,this.supportsFog=!1,this.supportsFreeCamera=!1,this.zAxisUnit="meters",this.isReprojectedInTileSpace=!0,this.unsupportedLayers=["custom"],this.center=[0,0],this.range=[3.5,7]}project(e,r){return{x:0,y:0,z:0}}unproject(e,r){return new Z(0,0)}projectTilePoint(e,r,c){return{x:e,y:r,z:0}}locationPoint(e,r,c,h=!0){return e._coordinatePoint(e.locationCoordinate(r,c),h)}pixelsPerMeter(e,r){return pe(1,e)*r}pixelSpaceConversion(e,r,c){return 1}farthestPixelDistance(e){return zA(e,e.pixelsPerMeter)}pointCoordinate(e,r,c,h){const m=e.horizonLineFromTop(!1),g=new kt(r,Math.max(m,c));return e.rayIntersectionCoordinate(e.pointRayIntersection(g,h))}pointCoordinate3D(e,r,c){const h=new kt(r,c);if(e.elevation)return e.elevation.pointCoordinate(h);{const m=this.pointCoordinate(e,h.x,h.y,0);return[m.x,m.y,m.z]}}isPointAboveHorizon(e,r){if(e.elevation&&e.elevation.visibleDemTiles.length)return!this.pointCoordinate3D(e,r.x,r.y);const c=e.horizonLineFromTop();return r.y<c}createInversionMatrix(e,r){return l5}createTileMatrix(e,r,c){let h,m,g;const b=c.canonical,T=re(new Float64Array(16));if(this.isReprojectedInTileSpace){const E=g_(b,this);h=1,m=E.x+c.wrap*E.scale,g=E.y,je(T,T,[h/E.scale,h/E.scale,e.pixelsPerMeter/r])}else h=r/e.zoomScale(b.z),m=(b.x+Math.pow(2,b.z)*c.wrap)*h,g=b.y*h;return Ee(T,T,[m,g,0]),je(T,T,[h/Rt,h/Rt,1]),T}upVector(e,r,c){return[0,0,1]}upVectorScale(e,r,c){return{metersToTile:1}}}class c5 extends Ad{constructor(e){super(e),this.range=[4,7],this.center=e.center||[-96,37.5];const[r,c]=this.parallels=e.parallels||[29.5,45.5],h=Math.sin(X(r));this.n=(h+Math.sin(X(c)))/2,this.c=1+h*(2*this.n-h),this.r0=Math.sqrt(this.c)/this.n}project(e,r){const{n:c,c:h,r0:m}=this,g=X(e-this.center[0]),b=X(r),T=Math.sqrt(h-2*c*Math.sin(b))/c;return{x:T*Math.sin(g*c),y:T*Math.cos(g*c)-m,z:0}}unproject(e,r){const{n:c,c:h,r0:m}=this,g=m+r;let b=Math.atan2(e,Math.abs(g))*Math.sign(g);g*c<0&&(b-=Math.PI*Math.sign(e)*Math.sign(g));const T=X(this.center[0])*c;b=Ze(b,-Math.PI-T,Math.PI-T);const E=ke(ie(b/c)+this.center[0],-180,180),I=Math.asin(ke((h-(e*e+g*g)*c*c)/(2*c),-1,1)),M=ke(ie(I),-85.051129,Ne);return new Z(E,M)}}
vendor: 5,802 bytes, line 601
601const __=1.340264,y_=-.081106,v_=893e-6,x_=.003796,U0=Math.sqrt(3)/2;class u5 extends Ad{project(e,r){r=r/180*Math.PI,e=e/180*Math.PI;const c=Math.asin(U0*Math.sin(r)),h=c*c,m=h*h*h;return{x:.5*(e*Math.cos(c)/(U0*(__+3*y_*h+m*(7*v_+9*x_*h)))/Math.PI+.5),y:1-.5*(c*(__+y_*h+m*(v_+x_*h))/Math.PI+1),z:0}}unproject(e,r){e=(2*e-.5)*Math.PI;let c=r=(2*(1-r)-1)*Math.PI,h=c*c,m=h*h*h;for(let I,M,k,B=0;B<12&&(M=c*(__+y_*h+m*(v_+x_*h))-r,k=__+3*y_*h+m*(7*v_+9*x_*h),I=M/k,c=ke(c-I,-Math.PI/3,Math.PI/3),h=c*c,m=h*h*h,!(Math.abs(I)<1e-12));++B);const g=U0*e*(__+3*y_*h+m*(7*v_+9*x_*h))/Math.cos(c),b=Math.asin(Math.sin(c)/U0),T=ke(180*g/Math.PI,-180,180),E=ke(180*b/Math.PI,-85.051129,Ne);return new Z(T,E)}}class h5 extends Ad{constructor(e){super(e),this.wrap=!0,this.supportsWorldCopies=!0}project(e,r){return{x:.5+e/360,y:.5-r/360,z:0}}unproject(e,r){const c=360*(e-.5),h=ke(360*(.5-r),-85.051129,Ne);return new Z(c,h)}}const Im=Math.PI/2;function H0(a){return Math.tan((Im+a)/2)}class d5 extends Ad{constructor(e){super(e),this.center=e.center||[0,30];const[r,c]=this.parallels=e.parallels||[30,30];let h=X(r),m=X(c);this.southernCenter=h+m<0,this.southernCenter&&(h=-h,m=-m);const g=Math.cos(h),b=H0(h);this.n=h===m?Math.sin(h):Math.log(g/Math.cos(m))/Math.log(H0(m)/b),this.f=g*Math.pow(H0(h),this.n)/this.n}project(e,r){r=X(r),this.southernCenter&&(r=-r),e=X(e-this.center[0]);const c=1e-6,{n:h,f:m}=this;m>0?r<-Im+c&&(r=-Im+c):r>Im-c&&(r=Im-c);const g=m/Math.pow(H0(r),h);let b=g*Math.sin(h*e),T=m-g*Math.cos(h*e);return b=.5*(b/Math.PI+.5),T=.5*(T/Math.PI+.5),{x:b,y:this.southernCenter?T:1-T,z:0}}unproject(e,r){e=(2*e-.5)*Math.PI,this.southernCenter&&(r=1-r),r=(2*(1-r)-.5)*Math.PI;const{n:c,f:h}=this,m=h-r,g=Math.sign(m),b=Math.sign(c)*Math.sqrt(e*e+m*m);let T=Math.atan2(e,Math.abs(m))*g;m*c<0&&(T-=Math.PI*Math.sign(e)*g);const E=ke(ie(T/c)+this.center[0],-180,180),I=ke(ie(2*Math.atan(Math.pow(h/b,1/c))-Im),-85.051129,Ne);return new Z(E,this.southernCenter?-I:I)}}class BA extends Ad{constructor(e){super(e),this.wrap=!0,this.supportsWorldCopies=!0,this.supportsTerrain=!0,this.supportsFog=!0,this.supportsFreeCamera=!0,this.isReprojectedInTileSpace=!1,this.unsupportedLayers=[],this.range=null}project(e,r){return{x:_e(e),y:ye(r),z:0}}unproject(e,r){const c=Se(e),h=Ae(r);return new Z(c,h)}}const NA=X(Ne);class f5 extends Ad{project(e,r){const c=(r=X(r))*r,h=c*c;return{x:.5*((e=X(e))*(.8707-.131979*c+h*(h*(.003971*c-.001529*h)-.013791))/Math.PI+.5),y:1-.5*(r*(1.007226+c*(.015085+h*(.028874*c-.044475-.005916*h)))/Math.PI+1),z:0}}unproject(e,r){e=(2*e-.5)*Math.PI;let c=r=(2*(1-r)-1)*Math.PI,h=25,m=0,g=c*c;do{g=c*c;const E=g*g;m=(c*(1.007226+g*(.015085+E*(.028874*g-.044475-.005916*E)))-r)/(1.007226+g*(.045255+E*(.259866*g-.311325-.005916*11*E))),c=ke(c-m,-NA,NA)}while(Math.abs(m)>1e-6&&--h>0);g=c*c;const b=ke(ie(e/(.8707+g*(g*(g*g*g*(.003971-.001529*g)-.013791)-.131979))),-180,180),T=ie(c);return new Z(b,T)}}const VA=X(Ne);class p5 extends Ad{project(e,r){r=X(r),e=X(e);const c=Math.cos(r),h=2/Math.PI,m=Math.acos(c*Math.cos(e/2)),g=Math.sin(m)/m,b=.5*(e*h+2*c*Math.sin(e/2)/g)||0,T=.5*(r+Math.sin(r)/g)||0;return{x:.5*(b/Math.PI+.5),y:1-.5*(T/Math.PI+1),z:0}}unproject(e,r){let c=e=(2*e-.5)*Math.PI,h=r=(2*(1-r)-1)*Math.PI,m=25;const g=1e-6;let b=0,T=0;do{const E=Math.cos(h),I=Math.sin(h),M=2*I*E,k=I*I,B=E*E,N=Math.cos(c/2),U=Math.sin(c/2),Y=2*N*U,J=U*U,ae=1-B*N*N,ne=ae?1/ae:0,G=ae?Math.acos(E*N)*Math.sqrt(1/ae):0,te=.5*(2*G*E*U+2*c/Math.PI)-e,oe=.5*(G*I+h)-r,he=.5*ne*(B*J+G*E*N*k)+1/Math.PI,Te=ne*(Y*M/4-G*I*U),Me=.125*ne*(M*U-G*I*B*Y),Pe=.5*ne*(k*N+G*J*E)+.5,ze=Te*Me-Pe*he;b=(oe*Te-te*Pe)/ze,T=(te*Me-oe*he)/ze,c=ke(c-b,-Math.PI,Math.PI),h=ke(h-T,-VA,VA)}while((Math.abs(b)>g||Math.abs(T)>g)&&--m>0);return new Z(ie(c),ie(h))}}class $A extends Ad{constructor(e){super(e),this.center=e.center||[0,0],this.parallels=e.parallels||[0,0],this.cosPhi=Math.max(.01,Math.cos(X(this.parallels[0]))),this.scale=1/(2*Math.max(Math.PI*this.cosPhi,1/this.cosPhi)),this.wrap=!0,this.supportsWorldCopies=!0}project(e,r){const{scale:c,cosPhi:h}=this;return{x:X(e)*h*c+.5,y:-Math.sin(X(r))/h*c+.5,z:0}}unproject(e,r){const{scale:c,cosPhi:h}=this,m=-(r-.5)/c,g=ke(ie((e-.5)/c)/h,-180,180),b=Math.asin(ke(m*h,-1,1)),T=ke(ie(b),-85.051129,Ne);return new Z(g,T)}}class m5 extends BA{constructor(e){super(e),this.requiresDraping=!0,this.supportsWorldCopies=!1,this.supportsFog=!0,this.zAxisUnit="pixels",this.unsupportedLayers=["debug"],this.range=[3,5]}projectTilePoint(e,r,c){const h=Qg(e,r,c);return ti(h,h,S0(uu(c))),{x:h[0],y:h[1],z:h[2]}}locationPoint(e,r,c){const h=q(r.lat,r.lng),m=hn([],h),g=c?e._centerAltitude+c:e.elevation?e.elevation.getAtPointOrZero(e.locationCoordinate(r),e._centerAltitude):e._centerAltitude;Yn(h,h,m,pe(1,0)*Rt*g);const b=re(new Float64Array(16));return ve(b,e.pixelMatrix,e.globeMatrix),ti(h,h,b),new kt(h[0],h[1])}pixelsPerMeter(e,r){return pe(1,0)*r}pixelSpaceConversion(e,r,c){const h=pe(1,e)*r,m=gi(pe(1,45)*r,h,c);return this.pixelsPerMeter(e,r)/m}createTileMatrix(e,r,c){const h=F1(uu(c.canonical));return ve(new Float64Array(16),e.globeMatrix,h)}createInversionMatrix(e,r){const{center:c}=e,h=S0(uu(r));return Je(h,h,X(c.lng)),Ve(h,h,X(c.lat)),je(h,h,[e._pixelsPerMercatorPixel,e._pixelsPerMercatorPixel,1]),Float32Array.from(h)}pointCoordinate(e,r,c,h){return ES(e,r,c,!0)||new We(0,0)}pointCoordinate3D(e,r,c){const h=this.pointCoordinate(e,r,c,0);return[h.x,h.y,h.z]}isPointAboveHorizon(e,r){return!ES(e,r.x,r.y,!1)}farthestPixelDistance(e){const r=function(h,m){const g=h.cameraToCenterDistance,b=h._centerAltitude*m,T=h._camera,E=h._camera.forward(),I=ki([],Ue([],E,-g),[0,0,b]),M=h.worldSize/(2*Math.PI),k=[0,0,-M],B=h.width/h.height,N=Math.tan(h.fovAboveCenter),U=Ue([],T.up(),N),Y=Ue([],T.right(),N*B),J=hn([],ki([],ki([],E,U),Y)),ae=[];let ne;
vendor: 4,236 bytes, line 601
601if(new pl(I,J).closestPointOnSphere(k,M,ae)){const G=ki([],ae,k),te=Oe([],G,I);ne=Math.cos(h.fovAboveCenter)*yi(te)}else{const G=Oe([],I,k),te=Oe([],k,I);hn(te,te);const oe=yi(G)-M;ne=Math.sqrt(oe*(oe+2*M));const he=Math.acos(ne/(M+oe))-Math.acos(Hi(E,te));ne*=Math.cos(he)}return 1.01*ne}(e,this.pixelsPerMeter(e.center.lat,e.worldSize)),c=bd(e.zoom);if(c>0){const h=zA(e,pe(1,e.center.lat)*e.worldSize),m=e.worldSize/(2*Math.PI),g=Math.max(e.width,e.height)/e.worldSize*Math.PI;return gi(r,h+m*(1-Math.cos(g)),Math.pow(c,10))}return r}upVector(e,r,c){return Qg(r,c,e,1)}upVectorScale(e){return{metersToTile:xd(T0(uu(e)))}}}function jA(a){const e=a.parallels,r=!!e&&Math.abs(e[0]+e[1])<.01;switch(a.name){case"mercator":return new BA(a);case"equirectangular":return new h5(a);case"naturalEarth":return new f5(a);case"equalEarth":return new u5(a);case"winkelTripel":return new p5(a);case"albers":return r?new $A(a):new c5(a);case"lambertConformalConic":return r?new $A(a):new d5(a);case"globe":return new m5(a)}throw new Error(`Invalid projection name: ${a.name}`)}const g5=Td.VectorTileFeature.types,_5=[{name:"a_fade_opacity",components:1,type:"Uint8",offset:0}];function G0(a,e,r,c,h,m,g,b,T,E,I,M,k){const B=b?Math.min(Ed,Math.round(b[0])):0,N=b?Math.min(Ed,Math.round(b[1])):0;a.emplaceBack(e,r,Math.round(32*c),Math.round(32*h),m,g,(B<<1)+(T?1:0),N,16*E,16*I,256*M,256*k)}function W0(a,e,r){a.emplaceBack(e,r)}function q0(a,e,r,c,h,m,g){a.emplaceBack(e,r,c,h,m,g)}function Z0(a,e,r,c,h){a.emplaceBack(e,r,c,h),a.emplaceBack(e,r,c,h),a.emplaceBack(e,r,c,h),a.emplaceBack(e,r,c,h)}function y5(a){for(const e of a.sections)if(Rg(e.text))return!0;return!1}class xb{constructor(e){this.layoutVertexArray=new pd,this.indexArray=new Vr,this.programConfigurations=e,this.segments=new Vs,this.dynamicLayoutVertexArray=new Gl,this.opacityVertexArray=new jg,this.placedSymbolArray=new c0,this.iconTransitioningVertexArray=new au,this.globeExtVertexArray=new qo,this.zOffsetVertexArray=new dd}isEmpty(){return this.layoutVertexArray.length===0&&this.indexArray.length===0&&this.dynamicLayoutVertexArray.length===0&&this.opacityVertexArray.length===0&&this.iconTransitioningVertexArray.length===0}upload(e,r,c,h,m){this.isEmpty()||(c&&(this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,kO.members),this.indexBuffer=e.createIndexBuffer(this.indexArray,r),this.dynamicLayoutVertexBuffer=e.createVertexBuffer(this.dynamicLayoutVertexArray,RO.members,!0),this.opacityVertexBuffer=e.createVertexBuffer(this.opacityVertexArray,_5,!0),this.iconTransitioningVertexArray.length>0&&(this.iconTransitioningVertexBuffer=e.createVertexBuffer(this.iconTransitioningVertexArray,zO.members,!0)),this.globeExtVertexArray.length>0&&(this.globeExtVertexBuffer=e.createVertexBuffer(this.globeExtVertexArray,LO.members,!0)),!this.zOffsetVertexBuffer&&(this.zOffsetVertexArray.length>0||m)&&(this.zOffsetVertexBuffer=e.createVertexBuffer(this.zOffsetVertexArray,OO.members,!0)),this.opacityVertexBuffer.itemSize=1),(c||h)&&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(),this.iconTransitioningVertexBuffer&&this.iconTransitioningVertexBuffer.destroy(),this.globeExtVertexBuffer&&this.globeExtVertexBuffer.destroy(),this.zOffsetVertexBuffer&&this.zOffsetVertexBuffer.destroy())}}Vt(xb,"SymbolBuffers");class bb{constructor(e,r,c){this.layoutVertexArray=new e,this.layoutAttributes=r,this.indexArray=new c,this.segments=new Vs,this.collisionVertexArray=new Hg,this.collisionVertexArrayExt=new Gl}upload(e){this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,this.layoutAttributes),this.indexBuffer=e.createIndexBuffer(this.indexArray),this.collisionVertexBuffer=e.createVertexBuffer(this.collisionVertexArray,FO.members,!0),this.collisionVertexBufferExt=e.createVertexBuffer(this.collisionVertexArrayExt,BO.members,!0)}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.segments.destroy(),this.collisionVertexBuffer.destroy(),this.collisionVertexBufferExt.de
601stroy())}}Vt(bb,"CollisionBuffers");class X0{constructor(e){this.collisionBoxArray=e.collisionBoxArray,this.zoom=e.zoom,this.lut=e.lut,this.overscaling=e.overscaling,this.layers=e.layers,this.layerIds=this.layers.map(g=>g.fqid),this.index=e.index,this.pixelRatio=e.pixelRatio,this.sourceLayerIndex=e.sourceLayerIndex,this.hasPattern=!1,this.hasRTLText=!1,this.fullyClipped=!1,this.hasAnyIconTextFit=!1,this.sortKeyRanges=[],this.collisionCircleArray=[],this.placementInvProjMatrix=re([]),this.placementViewportMatrix=re([]);const r=this.layers[0]._unevaluatedLayout._values;this.textSizeData=_A(this.zoom,r["text-size"]),this.iconSizeData=_A(this.zoom,r["icon-size"]);const c=this.layers[0].layout,h=c.get("symbol-sort-key"),m=c.get("symbol-z-order");this.canOverlap=c.get("text-allow-overlap")||c.get("icon-allow-overlap")||c.get("text-ignore-placement")||c.get("icon-ignore-placement"),this.sortFeaturesByKey=m!=="viewport-y"&&h.constantOr(1)!==void 0,this.sortFeaturesByY=(m==="viewport-y"||m==="auto"&&!this.sortFeaturesByKey)&&this.canOverlap,this.writingModes=c.get("text-writing-mode").map(g=>ba[g]),this.stateDependentLayerIds=this.layers.filter(g=>g.isStateDependent()).map(g=>g.id),this.sourceID=e.sourceID,this.projection=e.projection,this.hasAnyZOffset=!1,this.zOffsetSortDirty=!1,this.zOffsetBuffersNeedUpload=!1,this.elevationType="none",this.elevationStateComplete=!1,this.activeReplacements=[],this.replacementUpdateTime=0}createArrays(){this.text=new xb(new rh(this.layers,{zoom:this.zoom,lut:this.lut},e=>e.startsWith("text")||e.startsWith("symbol"))),this.icon=new xb(new rh(this.layers,{zoom:this.zoom,lut:this.lut},e=>e.startsWith("icon")||e.startsWith("symbol"))),this.glyphOffsetArray=new Yg,this.lineVertexArray=new d0,this.symbolInstances=new h0}calculateGlyphDependencies(e,r,c,h,m){for(const g of e){const b=g.codePointAt(0);if(b===void 0)break;if(r[b]=!0,h&&m&&b<=65535){const T=h_[g];T&&(r[T.charCodeAt(0)]=!0)}}}updateFootprints(e,r){}updateReplacement(e,r){if(r.updateTime===this.replacementUpdateTime)return!1;this.replacementUpdateTime=r.updateTime;const c=r.getReplacementRegionsForTile(e.toUnwrapped(),!0);return!tb(this.activeReplacements,c)&&(this.activeReplacements=c,!0)}populate(e,r,c,h){const m=this.layers[0],g=m.layout,b=this.projection.name==="globe",T=g.get("text-font"),E=g.get("text-field"),I=g.get("icon-image"),[M,k]=g.get("icon-size-scale-range"),B=ke(r.scaleFactor||1,M,k),N=(E.value.kind!=="constant"||E.value.value instanceof fo&&!E.value.value.isEmpty()||E.value.value.toString().length>0)&&(T.value.kind!=="constant"||T.value.value.length>0),U=I.value.kind!=="constant"||!!I.value.value||Object.keys(I.parameters).length>0,Y=g.get("symbol-sort-key");if(this.features=[],!N&&!U)return;const J=r.iconDependencies,ae=r.glyphDependencies,ne=r.availableImages,G=new Un(this.zoom);for(const{feature:te,id:oe,index:he,sourceLayerIndex:Te}of e){const Me=m._featureFilter.needGeometry,Pe=ci(te,Me);if(!m._featureFilter.filter(G,Pe,c))continue;if(Me||(Pe.geometry=Qt(te,c,h)),b&&te.type!==1&&c.z<=5){const pt=Pe.geometry,bt=.98078528056,Ye=(ft,qe)=>Hi(Qg(ft.x,ft.y,c,1),Qg(qe.x,qe.y,c,1))<bt;for(let ft=0;ft<pt.length;ft++)pt[ft]=gt(pt[ft],Ye)}let ze,tt;if(N){const pt=m.getValueAndResolveTokens("text-field",Pe,c,ne),bt=fo.factory(pt);y5(bt)&&(this.hasRTLText=!0),(!this.hasRTLText||Sc()==="unavailable"||this.hasRTLText&&sa.isParsed())&&(ze=VO(bt,m,Pe))}if(U){const pt=m.getValueAndResolveTokens("icon-image",Pe,c,ne);tt=typeof pt=="string"?So.build(pt):pt}if(!ze&&!tt)continue;const mt=this.sortFeaturesByKey?Y.evaluate(Pe,{},c):void 0,ut={id:oe,text:ze,icon:tt,index:he,sourceLayerIndex:Te,geometry:Pe.geometry,properties:te.properties,type:g5[te.type],sortKey:mt};if(this.features.push(ut),tt){const pt=this.layers[0]._unevaluatedLayout._values,{iconPrimary:bt,iconSecondary:Ye}=kA(tt,this.iconSizeData,pt["icon-size"],c,this.zoom,ut,this.pixelRatio,B),ft=bt.id.toString();if(J.has(ft)?J.get(ft).push(bt):J.set(ft,[bt]),Ye){const qe=Ye.id.toString();J.has(qe)?J.get(qe).push(Ye):J.set(qe,[Ye])}}if(ze){const pt=T.evaluate(Pe,{},c).join(","),bt=g.get("text-rotation-alignment")==="map"&&g.get("symbol-placement")!=="point";this.allowVerticalPlacement=this.writingModes&&this.writingModes.indexOf(ba.vertical)>=0;
601for(const Ye of ze.sections)if(Ye.image){const ft=Ye.image.getPrimary().scaleSelf(this.pixelRatio),qe=ft.id.toString(),et=J.get(qe)||[];et.push(ft),J.set(qe,et)}else{const ft=Mf(ze.toString()),qe=Ye.fontStack||pt,et=ae[qe]=ae[qe]||{};this.calculateGlyphDependencies(Ye.text,et,bt,this.allowVerticalPlacement,ft)}}}if(g.get("symbol-placement")==="line"&&(this.features=function(te){const oe={},he={},Te=[];let Me=0;function Pe(ut){Te.push(te[ut]),Me++}function ze(ut,pt,bt){const Ye=he[ut];return delete he[ut],he[pt]=Ye,Te[Ye].geometry[0].pop(),Te[Ye].geometry[0]=Te[Ye].geometry[0].concat(bt[0]),Ye}function tt(ut,pt,bt){const Ye=oe[pt];return delete oe[pt],oe[ut]=Ye,Te[Ye].geometry[0].shift(),Te[Ye].geometry[0]=bt[0].concat(Te[Ye].geometry[0]),Ye}function mt(ut,pt,bt){const Ye=bt?pt[0][pt[0].length-1]:pt[0][0];return`${ut}:${Ye.x}:${Ye.y}`}for(let ut=0;ut<te.length;ut++){const pt=te[ut],bt=pt.geometry,Ye=pt.text?pt.text.toString():null;if(!Ye){Pe(ut);continue}const ft=mt(Ye,bt),qe=mt(Ye,bt,!0);if(ft in he&&qe in oe&&he[ft]!==oe[qe]){const et=tt(ft,qe,bt),Tt=ze(ft,qe,Te[et].geometry);delete oe[ft],delete he[qe],he[mt(Ye,Te[Tt].geometry,!0)]=Tt,Te[et].geometry=null}else ft in he?ze(ft,qe,bt):qe in oe?tt(ft,qe,bt):(Pe(ut),oe[ft]=Me-1,he[qe]=Me-1)}return Te.filter(ut=>ut.geometry)}(this.features)),g.get("symbol-elevation-reference")==="hd-road-markup"){if(this.elevationType="road",r.elevationFeatures){!this.elevationFeatures&&r.elevationFeatures.length>0&&(this.elevationFeatures=[],this.elevationFeatureIdToIndex=new Map);for(const te of r.elevationFeatures)this.elevationFeatureIdToIndex.set(te.id,this.elevationFeatures.length),this.elevationFeatures.push(te)}}else g.get("symbol-z-elevate")&&(this.elevationType="offset");this.elevationType!=="none"&&(this.zOffsetBuffersNeedUpload=!0),this.sortFeaturesByKey&&this.features.sort((te,oe)=>te.sortKey-oe.sortKey)}update(e,r,c,h,m,g,b){this.text.programConfigurations.updatePaintArrays(e,r,m,c,h,g,b),this.icon.programConfigurations.updatePaintArrays(e,r,m,c,h,g,b)}updateRoadElevation(){if(this.elevationType!=="road"||!this.elevationFeatures||this.elevationStateComplete)return;this.elevationStateComplete=!0,this.hasAnyZOffset=!1;let e=!1;for(let r=0;r<this.symbolInstances.length;r++){const c=this.symbolInstances.get(r);if(c.elevationFeatureIndex===65535)continue;const h=this.elevationFeatures[c.elevationFeatureIndex];if(h){const m=.05+h.pointElevation(new kt(c.tileAnchorX,c.tileAnchorY));c.zOffset!==m&&(e=!0,c.zOffset=m)}}e&&(this.zOffsetBuffersNeedUpload=!0,this.zOffsetSortDirty=!0)}updateZOffset(){const e=(m,g,b)=>{c+=g,c>m.length&&m.resize(c);for(let T=-g;T<0;T++)m.emplace(T+c,b)},r=(m,g,b)=>{h+=g,h>m.length&&m.resize(h);for(let T=-g;T<0;T++)m.emplace(T+h,b)};if(!this.zOffsetBuffersNeedUpload)return;this.zOffsetBuffersNeedUpload=!1;let c=0,h=0;for(let m=0;m<this.symbolInstances.length;m++){const g=this.symbolInstances.get(m),{numHorizontalGlyphVertices:b,numVerticalGlyphVertices:T,numIconVertices:E}=g,I=g.zOffset,M=E>0;if((b>0||T>0)&&(e(this.text.zOffsetVertexArray,b,I),e(this.text.zOffsetVertexArray,T,I)),M){const{placedIconSymbolIndex:k,verticalPlacedIconSymbolIndex:B}=g;k>=0&&r(this.icon.zOffsetVertexArray,E,I),B>=0&&r(this.icon.zOffsetVertexArray,g.numVerticalIconVertices,I)}}this.text.zOffsetVertexBuffer&&this.text.zOffsetVertexBuffer.updateData(this.text.zOffsetVertexArray),this.icon.zOffsetVertexBuffer&&this.icon.zOffsetVertexBuffer.updateData(this.icon.zOffsetVertexArray)}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.zOffsetBuffersNeedUpload),this.icon.upload(e,this.sortFeaturesByY,!this.uploaded,this.icon.programConfigurations.needsUpload,this.zOffsetBuffersNeedUpload),this.uploaded=!0}destroyDebugData(){this.textCollisionBox.destroy(),this.iconCollisionBox.destroy()}getProjection(){return this.projectionInstance||(this.projectionInstance=jA(this.projection)),this.projectionInstance}destroy(){this.text.destroy(),this.icon.destroy(),this.hasDebugData()&&this.destroyDebugData()}addToLineVertexArray(e,r){const c=this.lineVertexArray.length;if(e.segment!==void 0)for(const{x:h,y:m}of r)this.lineVertexArray.emplaceBack(h,m);return{lineStartIndex:c,lineLength:this.lineVertexArray.length-c}}addSymbols(e,r,c,h,m,g,b,T,E,I,M,k,B,N,U,Y){const J=e.indexArray,ae=e.layoutVertexArray,ne=e.globeExtVertexArray,G=e.segments.prepareSegment(4*r.length,ae,J,this.canOverlap?g.sortKey:void 0),te=this.glyphOffsetArray.length,oe=G.vertexLength,he=this.allowVerticalPlacement&&b===ba.vertical?Math.PI/2:0,Te=g.text&&g.text.sections;for(let Pe=0;Pe<r.length;Pe++){const{tl:ze,tr:tt,bl:mt,br:ut,texPrimary:pt,texSecondary:bt,pixelOffsetTL:Ye,pixelOffsetBR:ft,minFontScaleX:qe,minFontScaleY:et,glyphOffset:Tt,isSDF:St,sectionIndex:li}=r[Pe],Jt=G.vertexLength,Bt=Tt[1];if(G0(ae,E.x,E.y,ze.x,Bt+ze.y,pt.x,pt.y,c,St,Ye.x,Ye.y,qe,et),G0(ae,E.x,E.y,tt.x,Bt+tt.y,pt.x+pt.w,pt.y,c,St,ft.x,Ye.y,qe,et),G0(ae,E.x,E.y,mt.x,Bt+mt.y,pt.x,pt.y+pt.h,c,St,Ye.x,ft.
vendor: 4,809 bytes, line 601
601y,qe,et),G0(ae,E.x,E.y,ut.x,Bt+ut.y,pt.x+pt.w,pt.y+pt.h,c,St,ft.x,ft.y,qe,et),T){const{x:wt,y:Ni,z:si}=T.anchor,[ri,Oi,Xi]=T.up;q0(ne,wt,Ni,si,ri,Oi,Xi),q0(ne,wt,Ni,si,ri,Oi,Xi),q0(ne,wt,Ni,si,ri,Oi,Xi),q0(ne,wt,Ni,si,ri,Oi,Xi),Z0(e.dynamicLayoutVertexArray,wt,Ni,si,he)}else Z0(e.dynamicLayoutVertexArray,E.x,E.y,E.z,he);if(Y){const wt=bt||pt;W0(e.iconTransitioningVertexArray,wt.x,wt.y),W0(e.iconTransitioningVertexArray,wt.x+wt.w,wt.y),W0(e.iconTransitioningVertexArray,wt.x,wt.y+wt.h),W0(e.iconTransitioningVertexArray,wt.x+wt.w,wt.y+wt.h)}J.emplaceBack(Jt,Jt+1,Jt+2),J.emplaceBack(Jt+1,Jt+2,Jt+3),G.vertexLength+=4,G.primitiveLength+=2,this.glyphOffsetArray.emplaceBack(Tt[0]),Pe!==r.length-1&&li===r[Pe+1].sectionIndex||e.programConfigurations.populatePaintArrays(ae.length,g,g.index,{},B,N,U,Te&&Te[li])}const Me=T?T.anchor:E;e.placedSymbolArray.emplaceBack(Me.x,Me.y,Me.z,E.x,E.y,te,this.glyphOffsetArray.length-te,oe,I,M,E.segment,c?c[0]:0,c?c[1]:0,h[0],h[1],b,0,0,0,k,0)}_commitLayoutVertex(e,r,c,h,m,g,b){e.emplaceBack(r,c,h,m,g,Math.round(b.x),Math.round(b.y))}_addCollisionDebugVertices(e,r,c,h,m,g,b){const T=c.segments.prepareSegment(4,c.layoutVertexArray,c.indexArray),E=T.vertexLength,I=b.tileAnchorX,M=b.tileAnchorY;for(let B=0;B<4;B++)c.collisionVertexArray.emplaceBack(0,0,0,0,0,0);this._commitDebugCollisionVertexUpdate(c.collisionVertexArrayExt,r,e.padding,b.zOffset),this._commitLayoutVertex(c.layoutVertexArray,h,m,g,I,M,new kt(e.x1,e.y1)),this._commitLayoutVertex(c.layoutVertexArray,h,m,g,I,M,new kt(e.x2,e.y1)),this._commitLayoutVertex(c.layoutVertexArray,h,m,g,I,M,new kt(e.x2,e.y2)),this._commitLayoutVertex(c.layoutVertexArray,h,m,g,I,M,new kt(e.x1,e.y2)),T.vertexLength+=4;const k=c.indexArray;k.emplaceBack(E,E+1),k.emplaceBack(E+1,E+2),k.emplaceBack(E+2,E+3),k.emplaceBack(E+3,E),T.primitiveLength+=4}_addTextDebugCollisionBoxes(e,r,c,h,m,g){for(let b=h;b<m;b++){const T=c.get(b),E=this.getSymbolInstanceTextSize(e,g,r,b);this._addCollisionDebugVertices(T,E,this.textCollisionBox,T.projectedAnchorX,T.projectedAnchorY,T.projectedAnchorZ,g)}}_addIconDebugCollisionBoxes(e,r,c,h,m,g){for(let b=h;b<m;b++){const T=c.get(b),E=this.getSymbolInstanceIconSize(e,r,g.placedIconSymbolIndex);this._addCollisionDebugVertices(T,E,this.iconCollisionBox,T.projectedAnchorX,T.projectedAnchorY,T.projectedAnchorZ,g)}}generateCollisionDebugBuffers(e,r,c){this.hasDebugData()&&this.destroyDebugData(),this.textCollisionBox=new bb(pm,nA.members,au),this.iconCollisionBox=new bb(pm,nA.members,au);const h=f_(this.iconSizeData,e),m=f_(this.textSizeData,e,c);for(let g=0;g<this.symbolInstances.length;g++){const b=this.symbolInstances.get(g);this._addTextDebugCollisionBoxes(m,e,r,b.textBoxStartIndex,b.textBoxEndIndex,b),this._addTextDebugCollisionBoxes(m,e,r,b.verticalTextBoxStartIndex,b.verticalTextBoxEndIndex,b),this._addIconDebugCollisionBoxes(h,e,r,b.iconBoxStartIndex,b.iconBoxEndIndex,b),this._addIconDebugCollisionBoxes(h,e,r,b.verticalIconBoxStartIndex,b.verticalIconBoxEndIndex,b)}}getSymbolInstanceTextSize(e,r,c,h){const m=this.text.placedSymbolArray.get(r.rightJustifiedTextSymbolIndex>=0?r.rightJustifiedTextSymbolIndex:r.centerJustifiedTextSymbolIndex>=0?r.centerJustifiedTextSymbolIndex:r.leftJustifiedTextSymbolIndex>=0?r.leftJustifiedTextSymbolIndex:r.verticalPlacedTextSymbolIndex>=0?r.verticalPlacedTextSymbolIndex:h),g=fb(this.textSizeData,e,m)/Xr;return this.tilePixelRatio*g}getSymbolInstanceIconSize(e,r,c){const h=this.icon.placedSymbolArray.get(c),m=fb(this.iconSizeData,e,h);return this.tilePixelRatio*m}_commitDebugCollisionVertexUpdate(e,r,c,h){e.emplaceBack(r,-c,-c,h),e.emplaceBack(r,c,-c,h),e.emplaceBack(r,c,c,h),e.emplaceBack(r,-c,c,h)}_updateTextDebugCollisionBoxes(e,r,c,h,m,g,b){for(let T=h;T<m;T++){const E=c.get(T),I=this.getSymbolInstanceTextSize(e,g,r,T);this._commitDebugCollisionVertexUpdate(this.textCollisionBox.collisionVertexArrayExt,I,E.padding,g.zOffset)}}_updateIconDebugCollisionBoxes(e,r,c,h,m,g,b){for(let T=h;T<m;T++){const E=c.get(T),I=this.getSymbolInstanceIconSize(e,r,g.placedIconSymbolIndex);this._commitDebugCollisionVertexUpdate(this.iconCollisionBox.collisionVertexArrayExt,I,E.padding,g.zOffset)}}updateCollisionDebugBuffers(e,r,c,h){if(!this.hasDebugData())return;this.hasTextCollisionBoxData()&&this.textCollisionBox.collisionVertexArrayExt.clear(),this.hasIconCollisionBoxData()&&this.iconCollisionBox.collisionVertexArrayExt.clear();const m=f_(this.iconSizeData,e,h),g=f_(this.textSizeData,e,c);for(let b=0;b<this.symbolInstances.length;b++){const T=this.symbolInstances.get(b);this._updateTextDebugCollisionBoxes(g,e,r,T.textBoxStartIndex,T.textBoxEndIndex,T,c),this._updateTextDebugCollisionBoxes(g,e,r,T.verticalTextBoxStartIndex,T.verticalTextBoxEndIndex,T,c),this._updateIconDebugCollisionBoxes(m,e,r,T.iconBoxStartIndex,T.
vendor: 16,093 bytes, line 601
601iconBoxEndIndex,T,h),this._updateIconDebugCollisionBoxes(m,e,r,T.verticalIconBoxStartIndex,T.verticalIconBoxEndIndex,T,h)}this.hasTextCollisionBoxData()&&this.textCollisionBox.collisionVertexBufferExt&&this.textCollisionBox.collisionVertexBufferExt.updateData(this.textCollisionBox.collisionVertexArrayExt),this.hasIconCollisionBoxData()&&this.iconCollisionBox.collisionVertexBufferExt&&this.iconCollisionBox.collisionVertexBufferExt.updateData(this.iconCollisionBox.collisionVertexArrayExt)}_deserializeCollisionBoxesForSymbol(e,r,c,h,m,g,b,T,E){const I={};if(r<c){const{x1:M,y1:k,x2:B,y2:N,padding:U,projectedAnchorX:Y,projectedAnchorY:J,projectedAnchorZ:ae,tileAnchorX:ne,tileAnchorY:G,featureIndex:te}=e.get(r);I.textBox={x1:M,y1:k,x2:B,y2:N,padding:U,projectedAnchorX:Y,projectedAnchorY:J,projectedAnchorZ:ae,tileAnchorX:ne,tileAnchorY:G},I.textFeatureIndex=te}if(h<m){const{x1:M,y1:k,x2:B,y2:N,padding:U,projectedAnchorX:Y,projectedAnchorY:J,projectedAnchorZ:ae,tileAnchorX:ne,tileAnchorY:G,featureIndex:te}=e.get(h);I.verticalTextBox={x1:M,y1:k,x2:B,y2:N,padding:U,projectedAnchorX:Y,projectedAnchorY:J,projectedAnchorZ:ae,tileAnchorX:ne,tileAnchorY:G},I.verticalTextFeatureIndex=te}if(g<b){const{x1:M,y1:k,x2:B,y2:N,padding:U,projectedAnchorX:Y,projectedAnchorY:J,projectedAnchorZ:ae,tileAnchorX:ne,tileAnchorY:G,featureIndex:te}=e.get(g);I.iconBox={x1:M,y1:k,x2:B,y2:N,padding:U,projectedAnchorX:Y,projectedAnchorY:J,projectedAnchorZ:ae,tileAnchorX:ne,tileAnchorY:G},I.iconFeatureIndex=te}if(T<E){const{x1:M,y1:k,x2:B,y2:N,padding:U,projectedAnchorX:Y,projectedAnchorY:J,projectedAnchorZ:ae,tileAnchorX:ne,tileAnchorY:G,featureIndex:te}=e.get(T);I.verticalIconBox={x1:M,y1:k,x2:B,y2:N,padding:U,projectedAnchorX:Y,projectedAnchorY:J,projectedAnchorZ:ae,tileAnchorX:ne,tileAnchorY:G},I.verticalIconFeatureIndex=te}return I}deserializeCollisionBoxes(e){this.collisionArrays=[];for(let r=0;r<this.symbolInstances.length;r++){const c=this.symbolInstances.get(r);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}hasIconTextFit(){return this.hasAnyIconTextFit}addIndicesForPlacedSymbol(e,r){const c=e.placedSymbolArray.get(r),h=c.vertexStartIndex+4*c.numGlyphs;for(let m=c.vertexStartIndex;m<h;m+=4)e.indexArray.emplaceBack(m,m+1,m+2),e.indexArray.emplaceBack(m+1,m+2,m+3)}getSortedSymbolIndexes(e){if(this.sortedAngle===e&&this.symbolInstanceIndexes!==void 0)return this.symbolInstanceIndexes;const r=Math.sin(e),c=Math.cos(e),h=[],m=[],g=[];for(let b=0;b<this.symbolInstances.length;++b){g.push(b);const T=this.symbolInstances.get(b);h.push(0|Math.round(r*T.tileAnchorX+c*T.tileAnchorY)),m.push(T.featureIndex)}return g.sort((b,T)=>h[b]-h[T]||m[T]-m[b]),g}getSortedIndexesByZOffset(){if(!this.zOffsetSortDirty)return this.symbolInstanceIndexesSortedZOffset;if(!this.symbolInstanceIndexesSortedZOffset){this.symbolInstanceIndexesSortedZOffset=[];for(let e=0;e<this.symbolInstances.length;++e)this.symbolInstanceIndexesSortedZOffset.push(e)}return this.zOffsetSortDirty=!1,this.symbolInstanceIndexesSortedZOffset.sort((e,r)=>this.symbolInstances.get(r).zOffset-this.symbolInstances.get(e).zOffset)}addToSortKeyRanges(e,r){const c=this.sortKeyRanges[this.sortKeyRanges.length-1];c&&c.sortKey===r?c.symbolInstanceEnd=e+1:this.sortKeyRanges.push({sortKey:r,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(const r of this.symbolInstanceIndexes){const c=this.symbolInstances.get(r);this.featureSortOrder.push(c.featureIndex);const{rightJustifiedTextSymbolIndex:h,centerJustifiedTextSymbolIndex:m,leftJustifiedTextSymbolIndex:g,verticalPlacedTextSymbolIndex:b,placedIconSymbolIndex:T,verticalPlacedIconSymbolIndex:E}=c;h>=0&&this.addIndicesForPlacedSymbol(this.text,h),m>=0&&m!==h&&this.addIndicesForPlacedSymbol(this.text,m),g>=0&&g!==m&&g!==h&&this.addIndicesForPlacedSymbol(this.text,g),b>=0&&this.addIndicesForPlacedSymbol(this.text,b),T>=0&&this.addIndicesForPlacedSymbol(this.icon,T),E>=0&&this.addIndicesForPlacedSymbol(this.icon,E)}this.text.indexBuffer&&this.text.indexBuffer.updateData(this.text.indexArray),this.icon.indexBuffer&&this.icon.indexBuffer.updateData(this.icon.indexArray)}}}let UA,HA,wb;Vt(X0,"SymbolBucket",{omit:["layers","collisionBoxArray","features","compareText"]}),X0.addDynamicAttributes=Z0;class GA{constructor(e){this.type=e.property.overrides?e.property.overrides.runtimeType:ka,this.defaultValue=e}evaluate(e){if(e.formattedSection){const r=this.defaultValue.property.overrides;if(r&&r.hasOverride(e.formattedSection))return r.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}}Vt(GA,"FormatSectionOverride",{omit:["defaultValue"]});const Tb=()=>wb||(wb={layout:UA||(UA=new Ys({"symbol-placement":new It($e.layout_symbol["symbol-placement"]),"symbol-spacing":new It($e.layout_symbol["symbol-spacing"]),"symbol-avoid-edges":new It($e.layout_symbol["symbol-avoid-edges"]),"symbol-sort-key":new Xt($e.layout_symbol["symbol-sort-key"]),"symbol-z-order":new It($e.layout_symbol["symbol-z-order"]),"symbol-z-elevate":new It($e.layout_symbol["symbol-z-elevate"]),"symbol-elevation-reference":new It($e.layout_symbol["symbol-elevation-reference"]),"icon-allow-overlap":new It($e.layout_symbol["icon-allow-overlap"]),"icon-ignore-placement":new It($e.layout_symbol["icon-ignore-placement"]),"icon-optional":new It($e.layout_symbol["icon-optional"]),"icon-rotation-alignment":new It($e.layout_symbol["icon-rotation-alignment"]),"icon-size":new Xt($e.layout_symbol["icon-size"]),"icon-size-scale-range":new It($e.layout_symbol["icon-size-scale-range"]),"icon-text-fit":new Xt($e.layout_symbol["icon-text-fit"]),"icon-text-fit-padding":new Xt($e.layout_symbol["icon-text-fit-padding"]),"icon-image":new Xt($e.layout_symbol["icon-image"]),"icon-rotate":new Xt($e.layout_symbol["icon-rotate"]),"icon-padding":new It($e.layout_symbol["icon-padding"]),"icon-keep-upright":new It($e.layout_symbol["icon-keep-upright"]),"icon-offset":new Xt($e.layout_symbol["icon-offset"]),"icon-anchor":new Xt($e.layout_symbol["icon-anchor"]),"icon-pitch-alignment":new It($e.layout_symbol["icon-pitch-alignment"]),"text-pitch-alignment":new It($e.layout_symbol["text-pitch-alignment"]),"text-rotation-alignment":new It($e.layout_symbol["text-rotation-alignment"]),"text-field":new Xt($e.layout_symbol["text-field"]),"text-font":new Xt($e.layout_symbol["text-font"]),"text-size":new Xt($e.layout_symbol["text-size"]),"text-size-scale-range":new It($e.layout_symbol["text-size-scale-range"]),"text-max-width":new Xt($e.layout_symbol["text-max-width"]),"text-line-height":new Xt($e.layout_symbol["text-line-height"]),"text-letter-spacing":new Xt($e.layout_symbol["text-letter-spacing"]),"text-justify":new Xt($e.layout_symbol["text-justify"]),"text-radial-offset":new Xt($e.layout_symbol["text-radial-offset"]),"text-variable-anchor":new It($e.layout_symbol["text-variable-anchor"]),"text-anchor":new Xt($e.layout_symbol["text-anchor"]),"text-max-angle":new It($e.layout_symbol["text-max-angle"]),"text-writing-mode":new It($e.layout_symbol["text-writing-mode"]),"text-rotate":new Xt($e.layout_symbol["text-rotate"]),"text-padding":new It($e.layout_symbol["text-padding"]),"text-keep-upright":new It($e.layout_symbol["text-keep-upright"]),"text-transform":new Xt($e.layout_symbol["text-transform"]),"text-offset":new Xt($e.layout_symbol["text-offset"]),"text-allow-overlap":new It($e.layout_symbol["text-allow-overlap"]),"text-ignore-placement":new It($e.layout_symbol["text-ignore-placement"]),"text-optional":new It($e.layout_symbol["text-optional"]),visibility:new It($e.layout_symbol.visibility)})),paint:HA||(HA=new Ys({"icon-opacity":new Xt($e.paint_symbol["icon-opacity"]),"icon-occlusion-opacity":new Xt($e.paint_symbol["icon-occlusion-opacity"]),"icon-emissive-strength":new Xt($e.paint_symbol["icon-emissive-strength"]),"text-emissive-strength":new Xt($e.paint_symbol["text-emissive-strength"]),"icon-color":new Xt($e.paint_symbol["icon-color"]),"icon-halo-color":new Xt($e.paint_symbol["icon-halo-color"]),"icon-halo-width":new Xt($e.paint_symbol["icon-halo-width"]),"icon-halo-blur":new Xt($e.paint_symbol["icon-halo-blur"]),"icon-translate":new It($e.paint_symbol["icon-translate"]),"icon-translate-anchor":new It($e.paint_symbol["icon-translate-anchor"]),"icon-image-cross-fade":new It($e.paint_symbol["icon-image-cross-fade"]),"text-opacity":new Xt($e.paint_symbol["text-opacity"]),"text-occlusion-opacity":new Xt($e.paint_symbol["text-occlusion-opacity"]),"text-color":new Xt($e.paint_symbol["text-color"],{runtimeType:io,getOverride:a=>a.textColor,hasOverride:a=>!!a.textColor}),"text-halo-color":new Xt($e.paint_symbol["text-halo-color"]),"text-halo-width":new Xt($e.paint_symbol["text-halo-width"]),"text-halo-blur":new Xt($e.paint_symbol["text-halo-blur"]),"text-translate":new It($e.paint_symbol["text-translate"]),"text-translate-anchor":new It($e.paint_symbol["text-translate-anchor"]),"icon-color-saturation":new It($e.paint_symbol["icon-color-saturation"]),"icon-color-contrast":new It($e.paint_symbol["icon-color-contrast"]),"icon-color-brightness-min":new It($e.paint_symbol["icon-color-brightness-min"]),"icon-color-brightness-max":new It($e.paint_symbol["icon-color-brightness-max"]),"symbol-z-offset":new Xt($e.paint_symbol["symbol-z-offset"]),"icon-color-use-theme":new Xt({type:"string",default:"default","property-type":"data-driven"}),"icon-halo-color-use-theme":new Xt({type:"string",default:"default","property-type":"data-driven"}),"text-color-use-theme":new Xt({type:"string",default:"default","property-type":"data-driven"}),"text-halo-color-use-theme":new Xt({type:"string",default:"default","property-type":"data-driven"})}))},wb);class Y0 extends Lo{constructor(e,r,c,h){super(e,Tb(),r,c,h),this._colorAdjustmentMatrix=re([]),this.hasInitialOcclusionOpacityProperties=e.paint!==void 0&&("icon-occlusion-opacity"in e.paint||"text-occlusion-opacity"in e.paint)}recalculate(e,r){super.recalculate(e,r),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")),this.layout.get("icon-pitch-alignment")==="auto"&&(this.layout._values["icon-pitch-alignment"]=this.layout.get("icon-rotation-alignment"));const c=this.layout.get("text-writing-mode");if(c){const h=[];for(const m of c)h.indexOf(m)<0&&h.push(m);this.layout._values["text-writing-mode"]=h}else this.layout._values["text-writing-mode"]=this.layout.get("symbol-placement")==="point"?["horizontal"]:["horizontal","vertical"];this._setPaintOverrides()}getColorAdjustmentMatrix(e,r,c,h){return this._saturation===e&&this._contrast===r&&this._brightnessMin===c&&this._brightnessMax===h||(this._colorAdjustmentMatrix=function(m,g,b,T){m=Wr(m),g=Gr(g);const E=me(),I=m/3,M=1-2*I,k=[M,I,I,0,I,M,I,0,I,I,M,0,0,0,0,1],B=.5-.5*g,N=T-b;return ve(E,[N,0,0,0,0,N,0,0,0,0,N,0,b,b,b,1],[g,0,0,0,0,g,0,0,0,0,g,0,B,B,B,1]),ve(E,E,k),E}(e,r,c,h),this._saturation=e,this._contrast=r,this._brightnessMin=c,this._brightnessMax=h),this._colorAdjustmentMatrix}getValueAndResolveTokens(e,r,c,h){const m=this.layout.get(e).evaluate(r,{},c,h),g=this._unevaluatedLayout._values[e];return g.isDataDriven()||_o(g.value)||!m?m:function(b,T){return T.replace(/{([^{}]+)}/g,(E,I)=>I in b?String(b[I]):"")}(r.properties,m)}createBucket(e){return new X0(e)}queryRadius(){return 0}queryIntersectsFeature(){return!1}_setPaintOverrides(){for(const e of Tb().paint.overridableProperties){if(!Y0.hasPaintOverride(this.layout,e))continue;const r=this.paint.get(e),c=new GA(r),h=new dr(c,r.property.specification,this.scope,this.options);let m=null;m=r.value.kind==="constant"||r.value.kind==="source"?new Sr("source",h):new so("composite",h,r.value.zoomStops,r.value.interpolationType),this.paint._values[e]=new ud(r.property,m,r.parameters)}}_handleOverridablePaintPropertyUpdate(e,r,c){return!(!this.layout||r.isDataDriven()||c.isDataDriven())&&Y0.hasPaintOverride(this.layout,e)}static hasPaintOverride(e,r){const c=e.get("text-field"),h=Tb().paint.properties[r];let m=!1;const g=b=>{for(const T of b)if(h.overrides&&h.overrides.hasOverride(T))return void(m=!0)};if(c.value.kind==="constant"&&c.value.value instanceof fo)g(c.value.value.sections);else if(c.value.kind==="source"){const b=E=>{m||(E instanceof en&&_r(E.value)===Fu?g(E.value.sections):E instanceof Fl?g(E.sections):E.eachChild(b))},T=c.value;T._styleExpression&&b(T._styleExpression.expression)}return m}getProgramIds(){return["symbol"]}getDefaultProgramParams(e,r,c){return{config:new cu(this,{zoom:r,lut:c}),overrideFog:!1}}hasElevation(){return this.layout&&this.layout.get("symbol-elevation-reference")==="hd-road-markup"}}let WA,qA,ZA,XA;var Sb=Rn([{name:"a_pos",type:"Int16",components:2},{name:"a_texture_pos",type:"Int16",components:2}]);function Eb(a){switch(a){case WebGL2RenderingContext.RGBA8:return WebGL2RenderingContext.RGBA;case WebGL2RenderingContext.DEPTH_COMPONENT16:return WebGL2RenderingContext.DEPTH_COMPONENT;case WebGL2RenderingContext.DEPTH24_STENCIL8:return WebGL2RenderingContext.DEPTH_STENCIL;case WebGL2RenderingContext.R8:case WebGL2RenderingContext.R32F:return WebGL2RenderingContext.RED}}function Ab(a){switch(a){case WebGL2RenderingContext.RGBA8:return WebGL2RenderingContext.UNSIGNED_BYTE;case WebGL2RenderingContext.DEPTH_COMPONENT16:return WebGL2RenderingContext.UNSIGNED_SHORT;case WebGL2RenderingContext.DEPTH24_STENCIL8:return WebGL2RenderingContext.UNSIGNED_INT_24_8;case WebGL2RenderingContext.R8:return WebGL2RenderingContext.UNSIGNED_BYTE;case WebGL2RenderingContext.R32F:return WebGL2RenderingContext.FLOAT}}class Cb{constructor(e,r,c,h){this.context=e,this.format=c,this.useMipmap=h&&h.useMipmap,this.texture=e.gl.createTexture(),this.update(r,{premultiply:h&&h.premultiply})}update(e,r){const c=e&&e instanceof HTMLVideoElement&&e.width===0?e.videoWidth:e.width,h=e&&e instanceof HTMLVideoElement&&e.height===0?e.videoHeight:e.height,{context:m}=this,{gl:g}=m,{x:b,y:T}=r&&r.position?r.position:{x:0,y:0},E=b+c,I=T+h;!this.size||this.size[0]===E&&this.size[1]===I||(g.bindTexture(g.TEXTURE_2D,null),g.deleteTexture(this.texture),this.texture=g.createTexture(),this.size=null),g.bindTexture(g.TEXTURE_2D,this.texture),m.pixelStoreUnpackFlipY.set(!1),m.pixelStoreUnpack.set(1),m.pixelStoreUnpackPremultiplyAlpha.set(this.format===g.RGBA8&&(!r||r.premultiply!==!1));const M=e instanceof HTMLImageElement||e instanceof HTMLCanvasElement||e instanceof HTMLVideoElement||e instanceof ImageData||ImageBitmap&&e instanceof ImageBitmap;if(!this.size&&E>0&&I>0){const k=this.useMipmap?Math.floor(Math.log2(Math.max(E,I)))+1:1;g.texStorage2D(g.TEXTURE_2D,k,this.format,E,I),this.size=[E,I]}if(this.size)if(M)g.texSubImage2D(g.TEXTURE_2D,0,b,T,Eb(this.format),Ab(this.format),e);
vendor: 11,761 bytes, line 601
601else{const k=e.data;k&&g.texSubImage2D(g.TEXTURE_2D,0,b,T,c,h,Eb(this.format),Ab(this.format),k)}this.useMipmap&&g.generateMipmap(g.TEXTURE_2D)}bind(e,r,c=!1){const{context:h}=this,{gl:m}=h;m.bindTexture(m.TEXTURE_2D,this.texture),e!==this.minFilter&&(m.texParameteri(m.TEXTURE_2D,m.TEXTURE_MAG_FILTER,e),m.texParameteri(m.TEXTURE_2D,m.TEXTURE_MIN_FILTER,this.useMipmap&&!c?e===m.NEAREST?m.NEAREST_MIPMAP_NEAREST:m.LINEAR_MIPMAP_LINEAR:e),this.minFilter=e),r!==this.wrapS&&(m.texParameteri(m.TEXTURE_2D,m.TEXTURE_WRAP_S,r),m.texParameteri(m.TEXTURE_2D,m.TEXTURE_WRAP_T,r),this.wrapS=r)}bindExtraParam(e,r,c,h){const{context:m}=this,{gl:g}=m;g.bindTexture(g.TEXTURE_2D,this.texture),r!==this.magFilter&&(g.texParameteri(g.TEXTURE_2D,g.TEXTURE_MAG_FILTER,r),this.magFilter=r),e!==this.minFilter&&(g.texParameteri(g.TEXTURE_2D,g.TEXTURE_MIN_FILTER,this.useMipmap?e===g.NEAREST?g.NEAREST_MIPMAP_NEAREST:g.LINEAR_MIPMAP_LINEAR:e),this.minFilter=e),c!==this.wrapS&&(g.texParameteri(g.TEXTURE_2D,g.TEXTURE_WRAP_S,c),this.wrapS=c),h!==this.wrapT&&(g.texParameteri(g.TEXTURE_2D,g.TEXTURE_WRAP_T,h),this.wrapT=h)}destroy(){const{gl:e}=this.context;e.deleteTexture(this.texture),this.texture=null}}class K0{constructor(e,r){this.context=e,this.texture=r}bind(e,r){const{context:c}=this,{gl:h}=c;h.bindTexture(h.TEXTURE_2D,this.texture),e!==this.minFilter&&(h.texParameteri(h.TEXTURE_2D,h.TEXTURE_MAG_FILTER,e),h.texParameteri(h.TEXTURE_2D,h.TEXTURE_MIN_FILTER,e),this.minFilter=e),r!==this.wrapS&&(h.texParameteri(h.TEXTURE_2D,h.TEXTURE_WRAP_S,r),h.texParameteri(h.TEXTURE_2D,h.TEXTURE_WRAP_T,r),this.wrapS=r)}}function J0(a,e,r,c,h,m,g,b){const T=[a,e,1,r,c,1,h,m,1],E=[g,b,1],I=j([],T),[M,k,B]=qi(E,E,I);return Q(T,T,[M,0,0,0,k,0,0,0,B])}function YA(a,e,r,c,h,m,g,b){const T=function(E,I,M,k,B,N,U,Y){const J=J0(0,0,1,0,1,1,0,1),ae=J0(E,I,M,k,B,N,U,Y);return Q(ae,ae,j([],J))}(a,e,r,c,h,m,g,b);return[T[2]/T[8]/Rt,T[5]/T[8]/Rt]}function Q0(a){return[a[0],Math.min(Math.max(a[1],-85.051129),Ne)]}class KA extends kl{constructor(e,r,c,h){super(),this.id=e,this.dispatcher=c,this.coordinates=r.coordinates,this.type="image",this.minzoom=0,this.maxzoom=22,this.tileSize=512,this.tiles={},this._loaded=!1,this.onNorthPole=!1,this.onSouthPole=!1,this.setEventedParent(h),this.options=r,this._dirty=!1}load(e,r){if(this._loaded=r||!1,this.fire(new Qa("dataloading",{dataType:"source"})),this.url=this.options.url,!this.url)return e&&(this.coordinates=e),this._loaded=!0,void this._finishLoading();this._imageRequest=Ka(this.map._requestManager.transformRequest(this.url,Pu.Image),(c,h)=>{this._imageRequest=null,this._loaded=!0,c?this.fire(new Nh(c)):h&&(this.image=h instanceof HTMLImageElement?jo.getImageData(h):h,this._dirty=!0,this.width=this.image.width,this.height=this.image.height,e&&(this.coordinates=e),this._finishLoading())})}loaded(){return this._loaded}updateImage(e){return e.url?(this._imageRequest&&e.url!==this.options.url&&(this._imageRequest.cancel(),this._imageRequest=null),this.options.url=e.url,this.load(e.coordinates,this._loaded),this):this}setTexture(e){if(!(e.handle instanceof WebGLTexture))throw new Error("The provided handle is not a WebGLTexture instance");return this.texture=new K0(this.map.painter.context,e.handle),this.width=e.dimensions[0],this.height=e.dimensions[1],this._dirty=!1,this._loaded=!0,this._finishLoading(),this}_finishLoading(){this.map&&(this.setCoordinates(this.coordinates),this.fire(new Qa("data",{dataType:"source",sourceDataType:"metadata"})))}onAdd(e){this.map=e,this.load()}onRemove(e){this._imageRequest&&(this._imageRequest.cancel(),this._imageRequest=null),!this.texture||this.texture instanceof K0||this.texture.destroy(),this.boundsBuffer&&(this.boundsBuffer.destroy(),this.elevatedGlobeVertexBuffer&&this.elevatedGlobeVertexBuffer.destroy(),this.elevatedGlobeIndexBuffer&&this.elevatedGlobeIndexBuffer.destroy())}setCoordinates(e){if(this.coordinates=e,this._boundsArray=void 0,this._unsupportedCoords=!1,!e.length)return this;this.onNorthPole=!1,this.onSouthPole=!1;let r=e[0][1],c=e[0][1];for(const m of e)m[1]>c&&(c=m[1]),m[1]<r&&(r=m[1]);const h=(c+r)/2;if(h>Ne?this.onNorthPole=!0:h<-85.051129&&(this.onSouthPole=!0),!this.onNorthPole&&!this.onSouthPole){const m=e.map(We.fromLngLat);this.tileID=function(g){let b=1/0,T=1/0,E=-1/0,I=-1/0;for(const U of g)b=Math.min(b,U.x),T=Math.min(T,U.y),E=Math.max(E,U.x),I=Math.max(I,U.y);const M=Math.max(E-b,I-T),k=Math.max(0,Math.floor(-Math.log(M)/Math.LN2)),B=Math.pow(2,k);let N=Math.floor((b+E)/2*B);return N>1&&(N-=1),new _s(k,N,Math.floor((T+I)/2*B))}(m),this.minzoom=this.maxzoom=this.tileID.z}return this.fire(new Qa("data",{dataType:"source",sourceDataType:"content"})),this}_clear(){this._boundsArray=void 0,this._unsupportedCoords=!1}_prepareData(e){for(const J in this.tiles){const ae=this.tiles[J];ae.state!=="loaded"&&(ae.state="loaded",ae.texture=this.texture)}if(this._boundsArray||this.onNorthPole||this.onSouthPole||this._unsupportedCoords)return;const r=g_(new _s(0,0,0),this.map.transform.projection),c=[r.projection.project(this.coordinates[0][0],this.coordinates[0][1]),r.projection.project(this.coordinates[1][0],this.coordinates[1][1]),r.projection.project(this.coordinates[2][0],this.coordinates[2][1]),r.projection.project(this.coordinates[3][0],this.coordinates[3][1])];if(!function(J){const ae=J[1].x-J[0].x,ne=J[1].y-J[0].y,G=J[2].x-J[1].x,te=J[2].y-J[1].y,oe=J[3].x-J[2].x,he=J[3].y-J[2].y,Te=J[0].x-J[3].x,Me=J[0].y-J[3].y,Pe=ae*te-G*ne,ze=G*he-oe*te,tt=oe*Me-Te*he,mt=Te*ne-ae*Me;return Pe>0&&ze>0&&tt>0&&mt>0||Pe<0&&ze<0&&tt<0&&mt<0}(c))return console.warn("Image source coordinates are defining non-convex area in the Mercator projection"),void(this._unsupportedCoords=!0);const h=g_(this.tileID,this.map.transform.projection),[m,g,b,T]=this.coordinates.map(J=>{const ae=h.projection.project(J[0],J[1]);return FA(h,ae)._round()});this.perspectiveTransform=YA(m.x,m.y,g.x,g.y,b.x,b.y,T.x,T.y);const E=this._boundsArray=new ih;E.emplaceBack(m.x,m.y,0,0),E.emplaceBack(g.x,g.y,Rt,0),E.emplaceBack(T.x,T.y,0,Rt),E.emplaceBack(b.x,b.y,Rt,Rt),this.boundsBuffer&&(this.boundsBuffer.destroy(),this.elevatedGlobeVertexBuffer&&this.elevatedGlobeVertexBuffer.destroy(),this.elevatedGlobeIndexBuffer&&this.elevatedGlobeIndexBuffer.destroy()),this.boundsBuffer=e.createVertexBuffer(E,Sb.members),this.boundsSegments=Vs.simpleSegment(0,0,4,2);const I=[],M=[Q0((k=this.coordinates)[0]),Q0(k[1]),Q0(k[2]),Q0(k[3])];var k;const[B,N,U,Y]=function(J){let ae=J[0][0],ne=ae,G=J[0][1],te=G;for(let oe=1;oe<J.length;oe++)J[oe][0]<ae?ae=J[oe][0]:J[oe][0]>ne&&(ne=J[oe][0]),J[oe][1]<G?G=J[oe][1]:J[oe][1]>te&&(te=J[oe][1]);return[ae,G,ne-ae,te-G]}(M);{const J=new ih,[ae,ne,G,te]=function(Ye){let ft=Ye[0].x,qe=ft,et=Ye[0].y,Tt=et;for(let St=1;St<Ye.length;St++)Ye[St].x<ft?ft=Ye[St].x:Ye[St].x>qe&&(qe=Ye[St].x),Ye[St].y<et?et=Ye[St].y:Ye[St].y>Tt&&(Tt=Ye[St].y);return[ft,et,qe-ft,Tt-et]}(c),oe=Ye=>[(Ye.x-ae)/G,(Ye.y-ne)/te],[he,Te,Me,Pe]=c.map(oe),ze=function(Ye,ft,qe,et,Tt,St,li,Jt){const Bt=J0(0,0,1,0,1,1,0,1);return Q(Bt,Bt,j([],J0(Ye,ft,qe,et,Tt,St,li,Jt)))}(he[0],he[1],Te[0],Te[1],Me[0],Me[1],Pe[0],Pe[1]);this.elevatedGlobePerspectiveTransform=YA(he[0],he[1],Te[0],Te[1],Me[0],Me[1],Pe[0],Pe[1]);const tt=(Ye,ft)=>{I.push(Ye.lng);const qe=Math.round((Ye.lng-B)/U*Rt),et=Math.round((Ye.lat-N)/Y*Rt),Tt=oe(ft),St=qi([],[Tt[0],Tt[1],1],ze),li=Math.round(St[0]/St[2]*Rt),Jt=Math.round(St[1]/St[2]*Rt);J.emplaceBack(qe,et,li,Jt)},mt=c[3].x-c[0].x,ut=c[3].y-c[0].y,pt=c[2].x-c[1].x,bt=c[2].y-c[1].y;for(let Ye=0;Ye<65;Ye++){const ft=Ye/64,qe=[c[0].x+ft*mt,c[0].y+ft*ut],et=[c[1].x+ft*pt,c[1].y+ft*bt],Tt=et[0]-qe[0],St=et[1]-qe[1];for(let li=0;li<65;li++){const Jt=li/64,Bt={x:qe[0]+Tt*Jt,y:qe[1]+St*Jt,z:0};tt(r.projection.unproject(Bt.x,Bt.y),Bt)}}this.elevatedGlobeVertexBuffer=e.createVertexBuffer(J,Sb.members)}{this.maxLongitudeTriangleSize=0;let J=[],ae=new Vr;const ne=(G,te,oe)=>{ae.emplaceBack(G,te,oe);const he=I[G],Te=I[te],Me=I[oe],Pe=Math.min(Math.min(he,Te),Me),ze=Math.max(Math.max(he,Te),Me)-Pe;ze>this.maxLongitudeTriangleSize&&(this.maxLongitudeTriangleSize=ze),J.push(Pe+ze/2)};for(let G=0;G<64;G++)for(let te=0;te<64;te++){const oe=65*G+te,he=oe+1,Te=oe+65,Me=Te+1;ne(oe,Te,he),ne(he,Te,Me)}[J,ae]=function(G,te){const oe=Array.from({length:G.length},(Me,Pe)=>Pe);oe.sort((Me,Pe)=>G[Me]-G[Pe]);const he=[],Te=new Vr;for(let Me=0;Me<oe.length;Me++){const Pe=oe[Me];he.push(G[Pe]);const ze=3*Pe,tt=ze+1;Te.emplaceBack(te.uint16[ze],te.uint16[tt],te.uint16[tt+1])}return[he,Te]}(J,ae),this.elevatedGlobeTrianglesCenterLongitudes=J,this.elevatedGlobeIndexBuffer=e.createIndexBuffer(ae)}this.elevatedGlobeSegments=Vs.simpleSegment(0,0,4225,8192),this.elevatedGlobeGridMatrix=new Float32Array([0,U/Rt,0,Y/Rt,0,0,N,B,0])}prepare(){const e=Object.keys(this.tiles).length!==0;if(this.tileID&&!e)return;const r=this.map.painter.context,c=r.gl;!this._dirty||this.texture instanceof K0||(this.texture?this.texture.update(this.image):(this.texture=new Cb(r,this.image,c.RGBA8),this.texture.bind(c.LINEAR,c.CLAMP_TO_EDGE)),this._dirty=!1),e&&this._prepareData(r)}loadTile(e,r){this.tileID&&this.tileID.equals(e.tileID.canonical)?(this.tiles[String(e.tileID.wrap)]=e,e.buckets={},r(null)):(e.state="errored",r(null))}serialize(){return{type:"image",url:this.options.url,coordinates:this.coordinates}}hasTransition(){return!1}getSegmentsForLongitude(e){const r=this.elevatedGlobeSegments;if(!this.elevatedGlobeTrianglesCenterLongitudes||!r)return null;const c=this.elevatedGlobeTrianglesCenterLongitudes;let h=(m=e+180)+360*Math.round((c[0]-m)/360);var m;const g=new Vs,b=(M,k)=>{g.segments.push({vertexOffset:0,primitiveOffset:M,vertexLength:r.segments[0].vertexLength,primitiveLength:k,sortKey:void 0,vaos:{}})},T=.51*this.maxLongitudeTriangleSize;if(Math.abs(c[0]-h)<=T){const M=Ia(c,0,c.length,h+T);return M===c.length||b(M,Dr(c,M+1,c.length,h+360-T)-M),g}h<c[0]&&(h+=360);const E=Dr(c,0,c.length,h-T);if(E===c.length)return b(0,c.length),g;b(0,E-0);const I=Ia(c,E+1,c.length,h+T);return I!==c.length&&b(I,c.length-I),g}}const v5=(Math.pow(256,2)-1)/16907520;class JA extends Lo{constructor(e,r,c,h){super(e,{layout:ZA||(ZA=new Ys({visibility:new It($e.layout_raster.visibility)})),paint:XA||(XA=new Ys({"raster-opacity":new It($e.paint_raster["raster-opacity"]),"raster-color":new eh($e.paint_raster["raster-color"]),"raster-color-mix":new It($e.paint_raster["raster-color-mix"]),"raster-color-range":new It($e.paint_raster["raster-color-range"]),"raster-hue-rotate":new It($e.paint_raster["raster-hue-rotate"]),"raster-brightness-min":new It($e.paint_raster["raster-brightness-min"]),"raster-brightness-max":new It($e.paint_raster["raster-brightness-max"]),"raster-saturation":new It($e.paint_raster["raster-saturation"]),"raster-contrast":new It($e.paint_raster["raster-contrast"]),"raster-resampling":new It($e.paint_raster["raster-resampling"]),"raster-fade-duration":new It($e.paint_raster["raster-fade-duration"]),"raster-emissive-strength":new It($e.paint_raster["raster-emissive-strength"]),"raster-array-band":new It($e.paint_raster["raster-array-band"]),"raster-elevation":new It($e.paint_raster["raster-elevation"]),"raster-color-use-theme":new Xt({type:"string",default:"default","property-type":"data-driven"})}))},r,c,h),this.updateColorRamp(),this._curRampRange=[NaN,NaN]}getProgramIds(){return["raster"]}hasColorMap(){return!!this._transitionablePaint._values["raster-color"].value.value}tileCoverLift(){return this.paint.get("raster-elevation")}isDraped(e){return!(e&&e._source instanceof KA&&(e._source.onNorthPole||e._source.onSouthPole))&&this.paint.get("raster-elevation")===0}_handleSpecialPaintPropertyUpdate(e){e!=="raster-color"&&e!=="raster-color-range"||(this._curRampRange=[NaN,NaN],this.updateColorRamp())}
vendor: 4,212 bytes, line 601
601updateColorRamp(e){if(!this.hasColorMap()||!this._curRampRange)return;const r=this._transitionablePaint._values["raster-color"].value.expression,[c,h]=e||this._transitionablePaint._values["raster-color-range"].value.expression.evaluate({zoom:0})||[NaN,NaN];isNaN(c)&&isNaN(h)||c===this._curRampRange[0]&&h===this._curRampRange[1]||(this.colorRamp=e_({expression:r,evaluationKey:"rasterValue",image:this.colorRamp,clips:[{start:c,end:h}],resolution:256}),this.colorRampTexture=null,this._curRampRange=[c,h])}}let QA,e3,t3,i3,n3;class s3 extends Lo{constructor(e,r,c,h){super(e,{layout:QA||(QA=new Ys({visibility:new It($e["layout_raster-particle"].visibility)})),paint:e3||(e3=new Ys({"raster-particle-array-band":new It($e["paint_raster-particle"]["raster-particle-array-band"]),"raster-particle-count":new It($e["paint_raster-particle"]["raster-particle-count"]),"raster-particle-color":new eh($e["paint_raster-particle"]["raster-particle-color"]),"raster-particle-max-speed":new It($e["paint_raster-particle"]["raster-particle-max-speed"]),"raster-particle-speed-factor":new It($e["paint_raster-particle"]["raster-particle-speed-factor"]),"raster-particle-fade-opacity-factor":new It($e["paint_raster-particle"]["raster-particle-fade-opacity-factor"]),"raster-particle-reset-rate-factor":new It($e["paint_raster-particle"]["raster-particle-reset-rate-factor"]),"raster-particle-elevation":new It($e["paint_raster-particle"]["raster-particle-elevation"]),"raster-particle-color-use-theme":new Xt({type:"string",default:"default","property-type":"data-driven"})}))},r,c,h),this._updateColorRamp(),this.lastInvalidatedAt=jo.now()}onRemove(e){this.colorRampTexture&&this.colorRampTexture.destroy(),this.tileFramebuffer&&this.tileFramebuffer.destroy(),this.particleFramebuffer&&this.particleFramebuffer.destroy()}hasColorMap(){return!!this._transitionablePaint._values["raster-particle-color"].value.value}getProgramIds(){return["rasterParticle"]}hasOffscreenPass(){return this.visibility!=="none"}isDraped(e){return!1}_handleSpecialPaintPropertyUpdate(e){e!=="raster-particle-color"&&e!=="raster-particle-max-speed"||(this._updateColorRamp(),this._invalidateAnimationState()),e==="raster-particle-count"&&this._invalidateAnimationState()}_updateColorRamp(){if(!this.hasColorMap())return;const e=this._transitionablePaint._values["raster-particle-color"].value.expression,r=this._transitionablePaint._values["raster-particle-max-speed"].value.expression.evaluate({zoom:0});this.colorRamp=e_({expression:e,evaluationKey:"rasterParticleSpeed",image:this.colorRamp,clips:[{start:0,end:r}],resolution:256}),this.colorRampTexture=null}_invalidateAnimationState(){this.lastInvalidatedAt=jo.now()}tileCoverLift(){return this.paint.get("raster-particle-elevation")}}class x5 extends Lo{constructor(e,r){super(e,{},r,null),this.implementation=e,e.slot&&(this.slot=e.slot)}is3D(e){return this.implementation.renderingMode==="3d"}hasOffscreenPass(){return this.implementation.prerender!==void 0}isDraped(e){return this.implementation.renderToTile!==void 0}shouldRedrape(){return!!this.implementation.shouldRerenderTiles&&this.implementation.shouldRerenderTiles()}recalculate(){}updateTransitions(){}hasTransition(){return!1}serialize(){}onAdd(e){this.implementation.onAdd&&this.implementation.onAdd(e,e.painter.context.gl)}onRemove(e){this.implementation.onRemove&&this.implementation.onRemove(e,e.painter.context.gl)}}function Ib(a,e,r){const c=[0,0,1],h=ai([]);return Ci(h,h,r?-X(a)+Math.PI:X(a)),on(h,h,-X(e)),ts(c,c,h),hn(c,c)}function r3(a,e){const r=ev(a.projection,a.zoom,a.width,a.height),c=function(m,g,b,T,E){const I=new Z(b.lng-180*Cd,b.lat),M=new Z(b.lng+180*Cd,b.lat),k=m.project(I.lng,I.lat),B=m.project(M.lng,M.lat),N=-Math.atan2(B.y-k.y,B.x-k.x),U=We.fromLngLat(b);U.y=ke(U.y,-1+Cd,1-Cd);const Y=U.toLngLat(),J=m.project(Y.lng,Y.lat),ae=We.fromLngLat(Y);ae.x+=Cd;const ne=ae.toLngLat(),G=m.project(ne.lng,ne.lat),te=a3(G.x-J.x,G.y-J.y,N),oe=We.fromLngLat(Y);oe.y+=Cd;const he=oe.toLngLat(),Te=m.project(he.lng,he.lat),Me=a3(Te.x-J.x,Te.y-J.y,N),Pe=Math.abs(te.x)/Math.abs(Me.y),ze=re([]);vt(ze,ze,-N*(1-(E?0:T)));const tt=re([]);return je(tt,tt,[1,1-(1-Pe)*T,1]),tt[4]=-Me.x/Me.y*T,vt(tt,tt,N),ve(tt,ze,tt),tt}
601(a.projection,0,a.center,r,e),h=o3(a);return je(c,c,[h,h,1]),c}function o3(a){const e=a.projection,r=ev(a.projection,a.zoom,a.width,a.height),c=Mb(e,a.center),h=Mb(e,Z.convert(e.center));return Math.pow(2,c*r+(1-r)*h)}function ev(a,e,r,c,h=1/0){const m=a.range;if(!m)return 0;const g=Math.min(h,Math.max(r,c)),b=Math.log(g/1024)/Math.LN2;return Le(m[0]+b,m[1]+b,e)}const Cd=1/4e4;function Mb(a,e){const r=ke(e.lat,-85.051129,Ne),c=new Z(e.lng-180*Cd,r),h=new Z(e.lng+180*Cd,r),m=a.project(c.lng,r),g=a.project(h.lng,r),b=We.fromLngLat(c),T=We.fromLngLat(h),E=g.x-m.x,I=g.y-m.y,M=T.x-b.x,k=T.y-b.y,B=Math.sqrt((M*M+k*k)/(E*E+I*I));return Math.log(B)/Math.LN2}function a3(a,e,r){const c=Math.cos(r),h=Math.sin(r);return{x:a*c-e*h,y:a*h+e*c}}function l3(a,e,r){re(a),vt(a,a,X(e[2])),Ve(a,a,X(e[0])),Je(a,a,X(e[1])),je(a,a,r),ve(a,a,[1,0,0,0,0,0,1,0,0,1,0,0,0,0,0,1])}function tv(a,e,r,c,h,m,g,b){const T=[r[0]-e[0],r[1]-e[1],0],E=[c[0]-e[0],c[1]-e[1],0];if(yi(T)<1e-12||yi(E)<1e-12)return ai(a);const I=Ct([],T,E);hn(I,I),wi(E,c,e),T[2]=(m-h)*b,E[2]=(g-h)*b;const M=T;return Ct(M,T,E),hn(M,M),Qs(a,I,M)}function Pb(a,e,r=!1){const c=bd(e.zoom),h=function(m,g,b){const T=g.worldSize,E=[m[12],m[13],m[14]],I=Ae(E[1]/T),M=Se(E[0]/T),k=re([]),B=pe(1,I)*T,N=pe(1,0)*T*st(I,g.zoom),U=1/B1(T);let Y=N*U;if(b){const G=ev(g.projection,g.zoom,g.width,g.height,1024);Y=U*g.projection.pixelSpaceConversion(g.center.lat,T,G)}const J=q(I,M);ki(J,J,Ue([],hn([],J),B*Y*E[2]));const ae=function(G){const te=[G[0],G[1],G[2]];let oe=[0,1,0];const he=Ct([],oe,te);return Ct(oe,te,he),ps(oe)===0&&(oe=[0,1,0],Ct(he,te,oe)),hn(he,he),hn(oe,oe),hn(te,te),[he[0],he[1],he[2],0,oe[0],oe[1],oe[2],0,te[0],te[1],te[2],0,G[0],G[1],G[2],1]}(J);je(k,k,[Y,Y,Y*B]),Ee(k,k,[-E[0],-E[1],-E[2]]);const ne=ve([],g.globeMatrix,ae);return ve(ne,ne,k),ve(ne,ne,m),ne}(a,e,r);if(c>0){const m=function(g,b){const T=b.worldSize,E=pe(1,0)*T*st(b.center.lat,b.zoom)/B1(T),I=pe(1,b.center.lat)*T,M=re([]);return Je(M,M,X(b.center.lng)),Ve(M,M,X(b.center.lat)),Ee(M,M,[0,0,v]),je(M,M,[E,E,E*I]),Ee(M,M,[b.point.x-.5*T,b.point.y-.5*T,0]),ve(M,M,g),ve(M,b.globeMatrix,M)}(a,e);return function(g,b,T){const E=(N,U,Y)=>{const J=yi(N),ae=yi(U),ne=ah(N,U,Y);return Ue(ne,ne,1/yi(ne)*gi(J,ae,Y))},I=E([g[0],g[1],g[2]],[b[0],b[1],b[2]],T),M=E([g[4],g[5],g[6]],[b[4],b[5],b[6]],T),k=E([g[8],g[9],g[10]],[b[8],b[9],b[10]],T),B=ah([g[12],g[13],g[14]],[b[12],b[13],b[14]],T);return[I[0],I[1],I[2],0,M[0],M[1],M[2],0,k[0],k[1],k[2],0,B[0],B[1],B[2],1]}(h,m,c)}return h}function c3(a,e,r,c){const h=Ms.projectAabbCorners(c,r);let m=Number.MAX_VALUE,g=-1;for(let E=0;E<h.length;++E){const I=h[E];I[0]=(.5*I[0]+.5)*e.width,I[1]=(.5-.5*I[1])*e.height,I[2]<m&&(g=E,m=I[2])}const b=E=>new kt(h[E][0],h[E][1]);let T;switch(g){case 0:case 6:T=[b(1),b(5),b(4),b(7),b(3),b(2),b(1)];break;case 1:case 7:T=[b(0),b(4),b(5),b(6),b(2),b(3),b(0)];break;case 3:case 5:T=[b(1),b(0),b(4),b(7),b(6),b(2),b(1)];break;default:T=[b(1),b(5),b(6),b(7),b(3),b(0),b(1)]}if(bi(a,T))return m}const b5=Rn([{name:"a_pos_3f",components:3,type:"Float32"}]),w5=Rn([{name:"a_color_3f",components:3,type:"Float32"}]),T5=Rn([{name:"a_color_4f",components:4,type:"Float32"}]),S5=Rn([{name:"a_uv_2f",components:2,type:"Float32"}]),E5=Rn([{name:"a_normal_3f",components:3,type:"Float32"}]),A5=Rn([{name:"a_normal_matrix0",components:4,type:"Float32"},{name:"a_normal_matrix1",components:4,type:"Float32"},{name:"a_normal_matrix2",components:4,type:"Float32"},{name:"a_normal_matrix3",components:4,type:"Float32"}]),C5=Rn([{name:"a_pbr",components:4,type:"Uint16"},{name:"a_heightBasedEmissiveStrength",components:3,type:"Float32"}]),u3={None:0,Model:1,Symbol:2,FillExtrusion:4,All:7};class iv{constructor(e,r,c,h){this.message=(e?`${e}: `:"")+c,h&&(this.identifier=h),r!=null&&r.__line__&&(this.line=r.__line__)}}function Db(a,e){const r=a.indexOf("://")===-1;try{return new URL(a,r&&e?"http://example.com":void 0),!0}catch{return!1}}class h3{constructor(e,r){this.feature=e,this.instancedDataOffset=r,this.instancedDataCount=0,this.rotation=[0,0,0],this.scale=[1,1,1],this.translation=[0,0,0]}}class d3{constructor(){this.instancedDataArray=new md,this.instancesEvaluatedElevation=[],this.features=[],this.idToFeaturesIndex={}}}class kb{constructor(e){this.zoom=e.zoom,this.canonical=e.canonical,this.layers=e.layers,this.layerIds=this.layers.map(r=>r.fqid),this.projection=e.projection,this.index=e.index,this.hasZoomDependentProperties=this.layers[0].isZoomDependent(),this.stateDependentLayerIds=this.layers.filter(r=>r.isStateDependent()).map(r=>r.id),this.hasPattern=!1,this.instancesPerModel={},this.validForExaggeration=0,this.maxVerticalOffset=0,this.maxScale=0,this.maxHeight=0,this.lookupDim=this.zoom>this.canonical.z?256:this.zoom>15?75:100,this.instanceCount=0,this.terrainElevationMin=0,this.terrainElevationMax=0,this.validForDEMTile={id:null,timestamp:0},this.modelUris=[],this.modelsRequested=!1,this.activeReplacements=[],this.replacementUpdateTime=0,this.styleDefinedModelURLs=e.styleDefinedModelURLs}updateFootprints(e,r){}populate(e,r,c,h){this.tileToMeter=Be(c);const m=this.layers[0]._featureFilter.needGeometry;this.lookup=new Uint8Array(this.lookupDim*this.lookupDim);for(const{feature:g,id:b,index:T,sourceLayerIndex:E}of e){const I=b??(g.properties&&g.properties.hasOwnProperty("id")?g.properties.id:void 0),M=ci(g,m);if(!this.layers[0]._featureFilter.filter(new Un(this.zoom),M,c))continue;
601const k={id:I,sourceLayerIndex:E,index:T,geometry:m?M.geometry:Qt(g,c,h),properties:g.properties,type:g.type,patterns:{}},B=this.addFeature(k,k.geometry,M);B&&r.featureIndex.insert(g,k.geometry,T,E,this.index,this.instancesPerModel[B].instancedDataArray.length,Rt/32)}this.lookup=null}update(e,r,c,h){for(const m in this.instancesPerModel){const g=this.instancesPerModel[m];for(const b in e)g.idToFeaturesIndex.hasOwnProperty(b)&&(this.evaluate(g.features[g.idToFeaturesIndex[b]],e[b],g,!0),this.uploaded=!1)}this.maxHeight=0}updateZoomBasedPaintProperties(){if(!this.hasZoomDependentProperties)return!1;let e=!1;for(const r in this.instancesPerModel){const c=this.instancesPerModel[r];for(const h of c.features){const m=this.layers[0],g=h.feature,b=this.canonical,T=m.paint.get("model-rotation").evaluate(g,{},b),E=m.paint.get("model-scale").evaluate(g,{},b),I=m.paint.get("model-translation").evaluate(g,{},b);Fe(h.rotation,T)&&Fe(h.scale,E)&&Fe(h.translation,I)||(this.evaluate(h,h.featureStates,c,!0),e=!0)}}return e}updateReplacement(e,r,c,h){if(r.updateTime===this.replacementUpdateTime)return!1;this.replacementUpdateTime=r.updateTime;const m=r.getReplacementRegionsForTile(e.toUnwrapped(),!0);if(tb(this.activeReplacements,m))return!1;this.activeReplacements=m;let g=!1;for(const b in this.instancesPerModel){const T=this.instancesPerModel[b],E=T.instancedDataArray;for(const I of T.features){const M=I.instancedDataOffset,k=I.instancedDataCount;for(let B=0;B<k;B++){const N=16*(B+M);let U=E.float32[N+0];const Y=U>Rt;U=Y?U-Rt:U;const J=Math.floor(U),ae=E.float32[N+1];let ne=!1;for(const G of this.activeReplacements)if(!_E(G,c,u3.Model,h)&&!(G.min.x>J||J>G.max.x||G.min.y>ae||ae>G.max.y)&&(ne=TE(wE(J,ae,e.canonical,G.footprintTileId.canonical),G.footprint),ne))break;E.float32[N]=ne?U+Rt:U,g=g||ne!==Y}}}return g}isEmpty(){for(const e in this.instancesPerModel)if(this.instancesPerModel[e].instancedDataArray.length!==0)return!1;return!0}uploadPending(){return!this.uploaded}upload(e){if(!this.uploaded)for(const r in this.instancesPerModel){const c=this.instancesPerModel[r];c.instancedDataArray.length<0||c.instancedDataArray.length===0||(c.instancedDataBuffer?c.instancedDataBuffer.updateData(c.instancedDataArray):c.instancedDataBuffer=e.createVertexBuffer(c.instancedDataArray,A5.members,!0,void 0,this.instanceCount))}this.uploaded=!0}destroy(){for(const r in this.instancesPerModel){const c=this.instancesPerModel[r];c.instancedDataArray.length!==0&&c.instancedDataBuffer&&c.instancedDataBuffer.destroy()}const e=this.layers[0].modelManager;if(e&&this.modelUris&&this.modelsRequested)for(const r of this.modelUris)e.removeModel(r,"",!0)}addFeature(e,r,c){const h=this.layers[0],m=h.layout.get("model-id").evaluate(c,{},this.canonical);if(!m)return Yi(`modelId is not evaluated for layer ${h.id} and it is not going to get rendered.`),m;(Db(m,!1)||this.styleDefinedModelURLs[m]!==void 0)&&(this.modelUris.includes(m)||this.modelUris.push(m)),this.instancesPerModel[m]||(this.instancesPerModel[m]=new d3);const g=this.instancesPerModel[m],b=g.instancedDataArray,T=new h3(c,b.length);for(const E of r)for(const I of E){if(I.x<0||I.x>=Rt||I.y<0||I.y>=Rt)continue;const M=(this.lookupDim-1)/Rt,k=this.lookupDim*(I.y*M|0)+I.x*M|0;if(this.lookup){if(this.lookup[k]!==0)continue;this.lookup[k]=1}this.instanceCount++;const B=b.length;b.resize(B+1),g.instancesEvaluatedElevation.push(0),b.float32[16*B]=I.x,b.float32[16*B+1]=I.y}return T.instancedDataCount=g.instancedDataArray.length-T.instancedDataOffset,T.instancedDataCount>0&&(e.id&&(g.idToFeaturesIndex[e.id]=g.features.length),g.features.push(T),this.evaluate(T,{},g,!1)),m}getModelUris(){return this.modelUris}evaluate(e,r,c,h){const m=this.layers[0],g=e.feature,b=this.canonical,T=e.rotation=m.paint.get("model-rotation").evaluate(g,r,b),E=e.scale=m.paint.get("model-scale").evaluate(g,r,b),I=e.translation=m.paint.get("model-translation").evaluate(g,r,b),M=m.paint.get("model-color").evaluate(g,r,b);M.a=m.paint.get("model-color-mix-intensity").evaluate(g,r,b);const k=[];this.maxVerticalOffset<I[2]&&(this.maxVerticalOffset=I[2]),this.maxScale=Math.max(Math.max(this.maxScale,E[0]),Math.max(E[1],E[2])),l3(k,T,E);const B=Math.round(100*M.a)+M.b/1.05;for(let N=0;N<e.instancedDataCount;++N){const U=e.instancedDataOffset+N,Y=16*U,J=c.instancedDataArray.float32;let ae=0;h&&(ae=J[Y+6]-c.instancesEvaluatedElevation[U]);const ne=0|J[Y+1];J[Y]=(0|J[Y])+M.r/1.05,J[Y+1]=ne+M.g/1.05,J[Y+2]=B,J[Y+3]=1/(b.z>10?this.tileToMeter:Be(b,ne)),J[Y+4]=I[0],J[Y+5]=I[1],J[Y+6]=I[2]+ae,J[Y+7]=k[0],J[Y+8]=k[1],J[Y+9]=k[2],J[Y
601+10]=k[4],J[Y+11]=k[5],J[Y+12]=k[6],J[Y+13]=k[8],J[Y+14]=k[9],J[Y+15]=k[10],c.instancesEvaluatedElevation[U]=I[2]}}}let f3,p3;Vt(kb,"ModelBucket",{omit:["layers"]}),Vt(d3,"PerModelAttributes"),Vt(h3,"ModelFeature");const Jf=64,Mm={CoordinateSpaceTile:1,CoordinateSpaceYUp:2,HasMapboxMeshFeatures:4,HasMeshoptCompression:8};function m3(a,e,r,c,h,m,g,b,T,E=!1){const I=r.zoom,M=r.project(c),k=st(c.lat,I),B=1/k;re(a),Ee(a,a,[M.x+g[0]*B,M.y+g[1]*B,g[2]]);let N=1,U=1;const Y=r.worldSize;if(E){if(r.projection.name==="mercator"){let G=0;r.elevation&&(G=r.elevation.getAtPointOrZero(new We(M.x/Y,M.y/Y),0));const te=pi([],[M.x,M.y,G,1],r.projMatrix)[3]/r.cameraToCenterDistance;N=te,U=te*st(r.center.lat,I)}else if(r.projection.name==="globe"){const G=Pb(a,r),te=[0,0,0,1];pi(te,te,ve([],r.projMatrix,G));const oe=te[3]/r.cameraToCenterDistance,he=bd(I),Te=r.projection.pixelsPerMeter(c.lat,Y)*st(c.lat,I),Me=r.projection.pixelsPerMeter(r.center.lat,Y)*st(r.center.lat,I);N=oe/gi(Te,lt(r.center.lat),he),U=oe*k/Te,N*=Me,U*=Me}}else N=B;je(a,a,[N,N,U]);const J=[...a],ae=e.orientation,ne=[];if(l3(ne,[ae[0]+h[0],ae[1]+h[1],ae[2]+h[2]],m),ve(a,J,ne),b&&r.elevation){let G=0;const te=[];if(T&&r.elevation){G=function(he,Te,Me,Pe,ze){const tt=Te.elevation;if(!tt)return 0;const mt=Ms.projectAabbCorners(Me,Pe),ut=pe(1,ze.lat)*Te.worldSize,pt=function(wt,Ni){const si=[0,0,1],ri=[{corners:[0,1,3,2],dotProductWithUp:0},{corners:[1,5,2,6],dotProductWithUp:0},{corners:[0,4,1,5],dotProductWithUp:0},{corners:[2,6,3,7],dotProductWithUp:0},{corners:[4,7,5,6],dotProductWithUp:0},{corners:[0,3,4,7],dotProductWithUp:0}];for(const Oi of ri){const Xi=wt[Oi.corners[0]],Ji=wt[Oi.corners[1]],ln=wt[Oi.corners[2]],rn=[Ji[0]-Xi[0],Ji[1]-Xi[1],Ni*(Ji[2]-Xi[2])],nn=Ct(rn,rn,[ln[0]-Xi[0],ln[1]-Xi[1],Ni*(ln[2]-Xi[2])]);hn(nn,nn),Oi.dotProductWithUp=Hi(nn,si)}return ri.sort((Oi,Xi)=>Oi.dotProductWithUp-Xi.dotProductWithUp),ri[0].corners}(mt,ut),bt=mt[pt[0]],Ye=mt[pt[1]],ft=mt[pt[2]],qe=mt[pt[3]],et=tt.getAtPointOrZero(new We(bt[0]/Te.worldSize,bt[1]/Te.worldSize),0),Tt=tt.getAtPointOrZero(new We(Ye[0]/Te.worldSize,Ye[1]/Te.worldSize),0),St=tt.getAtPointOrZero(new We(ft[0]/Te.worldSize,ft[1]/Te.worldSize),0),li=tt.getAtPointOrZero(new We(qe[0]/Te.worldSize,qe[1]/Te.worldSize),0),Jt=(et+li)/2,Bt=(Tt+St)/2;return Jt>Bt?Tt<St?tv(he,Ye,qe,bt,Tt,li,et,ut):tv(he,ft,bt,qe,St,et,li,ut):et<li?tv(he,bt,Ye,ft,et,Tt,St,ut):tv(he,qe,ft,Ye,li,St,Tt,ut),Math.max(Jt,Bt)}(te,r,e.aabb,a,c);const oe=ve([],At([],te),ne);ve(a,J,oe)}else G=r.elevation.getAtPointOrZero(new We(M.x/Y,M.y/Y),0);G!==0&&(a[14]+=G)}}function b_(a,e,r=!1){a.uploaded||(a.gfxTexture=new Cb(e,a.image,r?e.gl.R8:e.gl.RGBA8,{useMipmap:a.sampler.minFilter>=e.gl.NEAREST_MIPMAP_NEAREST}),a.uploaded=!0,a.image=null)}function I5(a,e,r){a.indexBuffer=e.createIndexBuffer(a.indexArray,!1,!0),a.vertexBuffer=e.createVertexBuffer(a.vertexArray,b5.members,!1,!0),a.normalArray&&(a.normalBuffer=e.createVertexBuffer(a.normalArray,E5.members,!1,!0)),a.texcoordArray&&(a.texcoordBuffer=e.createVertexBuffer(a.texcoordArray,S5.members,!1,!0)),a.colorArray&&(a.colorBuffer=e.createVertexBuffer(a.colorArray,(a.colorArray.bytesPerElement===12?w5:T5).members,!1,!0)),a.featureArray&&(a.pbrBuffer=e.createVertexBuffer(a.featureArray,C5.members,!0)),a.segments=Vs.simpleSegment(0,0,a.vertexArray.length,a.indexArray.length);const c=a.material;c.pbrMetallicRoughness.baseColorTexture&&b_(c.pbrMetallicRoughness.baseColorTexture,e),c.pbrMetallicRoughness.metallicRoughnessTexture&&b_(c.pbrMetallicRoughness.metallicRoughnessTexture,e),c.normalTexture&&b_(c.normalTexture,e),c.occlusionTexture&&b_(c.occlusionTexture,e,r),c.emissionTexture&&b_(c.emissionTexture,e)}function Lb(a,e,r){if(a.meshes)for(const c of a.meshes)I5(c,e,r);if(a.children)for(const c of a.children)Lb(c,e,r)}function nv(a){if(a.meshes)for(const e of a.meshes)e.indexArray.destroy(),e.vertexArray.destroy(),e.colorArray&&e.colorArray.destroy(),e.normalArray&&e.normalArray.destroy(),e.texcoordArray&&e.texcoordArray.destroy(),e.featureArray&&e.featureArray.destroy();if(a.children)for(const e of a.children)nv(e)}function Rb(a){if(a.meshes)for(const r of a.meshes)r.vertexBuffer&&(r.vertexBuffer.destroy(),r.indexBuffer.destroy(),r.normalBuffer&&r.n
601ormalBuffer.destroy(),r.texcoordBuffer&&r.texcoordBuffer.destroy(),r.colorBuffer&&r.colorBuffer.destroy(),r.pbrBuffer&&r.pbrBuffer.destroy(),r.segments.destroy(),r.material&&((e=r.material).pbrMetallicRoughness.baseColorTexture&&e.pbrMetallicRoughness.baseColorTexture.gfxTexture&&e.pbrMetallicRoughness.baseColorTexture.gfxTexture.destroy(),e.pbrMetallicRoughness.metallicRoughnessTexture&&e.pbrMetallicRoughness.metallicRoughnessTexture.gfxTexture&&e.pbrMetallicRoughness.metallicRoughnessTexture.gfxTexture.destroy(),e.normalTexture&&e.normalTexture.gfxTexture&&e.normalTexture.gfxTexture.destroy(),e.emissionTexture&&e.emissionTexture.gfxTexture&&e.emissionTexture.gfxTexture.destroy(),e.occlusionTexture&&e.occlusionTexture.gfxTexture&&e.occlusionTexture.gfxTexture.destroy()));var e;if(a.children)for(const r of a.children)Rb(r)}class Pm{constructor(e,r,c){this._demTile=e,this._dem=this._demTile.dem,this._scale=r,this._offset=c}static create(e,r,c){const h=c||e.findDEMTileFor(r);if(!h||!h.dem)return;const m=h.dem,g=h.tileID,b=1<<r.canonical.z-g.canonical.z;return new Pm(h,m.dim/Rt/b,[(r.canonical.x/b-g.canonical.x)*m.dim,(r.canonical.y/b-g.canonical.y)*m.dim])}tileCoordToPixel(e,r){const c=r*this._scale+this._offset[1],h=Math.floor(e*this._scale+this._offset[0]),m=Math.floor(c);return new kt(h,m)}getElevationAt(e,r,c,h){const m=e*this._scale+this._offset[0],g=r*this._scale+this._offset[1],b=Math.floor(m),T=Math.floor(g),E=this._dem;return h=!!h,c?gi(gi(E.get(b,T,h),E.get(b,T+1,h),g-T),gi(E.get(b+1,T,h),E.get(b+1,T+1,h),g-T),m-b):E.get(b,T,h)}getElevationAtPixel(e,r,c){return this._dem.get(e,r,!!c)}getMeterToDEM(e){return(1<<this._demTile.tileID.canonical.z)*pe(1,e)*this._dem.stride}}const Ob=new Float32Array(262144),Qf=new Uint8Array(262144);function g3(a){let e=0;if(a.meshes)for(const r of a.meshes)e=Math.max(e,r.aabb.max[2]);if(a.children)for(const r of a.children)e=Math.max(e,g3(r));return e}function _3(a,e,r){if(a.meshes)for(const c of a.meshes){if(c.aabb.min[0]===1/0)continue;const h=Ms.applyTransform(c.aabb,a.matrix);r.insert(e,h.min[0],h.min[1],h.max[0],h.max[1])}if(a.children)for(const c of a.children)_3(c,e,r)}const y3=["","wall","door","roof","window","lamp","logo"];class v3{constructor(e){this.node=e,this.evaluatedRMEA=[[1,0,0,1],[1,0,0,1],[1,0,0,1],[1,0,0,1],[.4,1,0,1],[1,0,0,1],[1,0,0,1]],this.hiddenByReplacement=!1,this.evaluatedScale=[1,1,1],this.evaluatedColor=[],this.emissionHeightBasedParams=[],this.cameraCollisionOpacity=1,this.feature={type:"Point",id:e.id,geometry:[],properties:{height:g3(e)}},this.aabb=this._getLocalBounds(),this.state=null}_getLocalBounds(){if(!this.node.meshes)return new Ms([1/0,1/0,1/0],[-1/0,-1/0,-1/0]);if(!this.aabb){let e=0;const r=new Ms([1/0,1/0,1/0],[-1/0,-1/0,-1/0]);for(const c of this.node.meshes)this.node.lightMeshIndex!==e&&(c.transformedAabb=Ms.applyTransformFast(c.aabb,this.node.matrix),r.encapsulate(c.transformedAabb)),e++;this.aabb=r}return this.aabb}}class sv{constructor(e,r,c,h,m,g,b){this.id=c,this.layers=e,this.layerIds=this.layers.map(T=>T.fqid),this.stateDependentLayerIds=this.layers.filter(T=>T.isStateDependent()).map(T=>T.id),this.modelTraits|=Mm.CoordinateSpaceTile,this.uploaded=!1,this.hasPattern=!1,h&&(this.modelTraits|=Mm.HasMapboxMeshFeatures),m&&(this.modelTraits|=Mm.HasMeshoptCompression),this.zoom=-1,this.terrainExaggeration=1,this.projection={name:"mercator"},this.replacementUpdateTime=0,this.elevationReadFromZ=255,this.brightness=g,this.dirty=!0,this.needsUpload=!1,this.filter=null,this.nodesInfo=[];for(const T of r)this.nodesInfo.push(new v3(T)),_3(T,b.featureIndexArray.length,b.grid),b.featureIndexArray.emplaceBack(this.nodesInfo.length-1,0,b.bucketLayerIDs.length-1,0);this.states={}}updateFootprints(e,r){for(const c of this.getNodesInfo()){const h=c.node;h.footprint&&r.push({footprint:h.footprint,id:e})}}update(e){const r=Object.keys(e).length!==0;if(r&&!this.stateDependentLayers.length)return;const c=r?this.stateDependentLayers:this.layers;if(!Za(e,this.states))for(const h of c)this.evaluate(h,e);this.states=structuredClone(e)}populate(){console.log("populate 3D model bucket")}uploadPending(){return!this.uploaded||this.needsUpload}upload(e){if(!this.needsUpload)return;const r=this.getNodesInfo();for(const c of r){const h=c.node;this.uploaded?this.updatePbrBuffer(h):Lb(h,e,!0)}for(const c of r)nv(c.node);this.uploaded=!0,this.needsUpload=!1}updatePbrBuffer(e){let r=!1;if(!e.meshes)return r;for(const c of e.meshes)c.pbrBuffer&&(c.pbrBuffer.updateData(c.featureArray),r=!0);return r}needsReEvaluation(e,r,c){const h=e.transform.projectionOptions,m=e.style.getBrightness(),g=this.brightness!==m;if(!this.uploaded||this.dirty||h.name!==this.projection.name||w_(c.paint.get("model-color").value,g)||w_(c.paint.get("model-color-mix-intensity").value,g)||w_(c.paint.get("model-roughness").value,g)||w_(c.paint.get("model-emissive-strength").value,g)||w_(c.paint.get("model-height-based-emissive-strength-multiplier").value,g)){this.projection=h,this.brightness=m;const b=this.getNodesInfo();for(const T of b)T.state=null;return!0}return!1}evaluateScale(e,r){if(e.transform.zoom===this.zoom)return;this.zoom=e.transform.zoom;const c=this.getNodesInfo(),h=this.id.canonical;for(const m of c){const g=m.feature;m.evaluatedScale=r.paint.get("model-scale").evaluate(g,{},h)}}evaluate(e,r){const c=this.getNodesInfo();
601for(const h of c){if(!h.node.meshes)continue;const m=h.feature,g=r&&r[m.id];if(Za(g,h.state))continue;h.state=structuredClone(g);const b=h.node.meshes&&h.node.meshes[0].featureData,T=h.evaluatedColor[2],E=h.evaluatedRMEA[2],I=this.id.canonical;if(h.hasTranslucentParts=!1,b){for(let M=0;M<y3.length;M++){const k=y3[M];k.length&&(m.properties.part=k);const B=e.paint.get("model-color").evaluate(m,g,I).toRenderColor(null),N=e.paint.get("model-color-mix-intensity").evaluate(m,g,I);h.evaluatedColor[M]=[B.r,B.g,B.b,N],h.evaluatedRMEA[M][0]=e.paint.get("model-roughness").evaluate(m,g,I),h.evaluatedRMEA[M][2]=e.paint.get("model-emissive-strength").evaluate(m,g,I),h.evaluatedRMEA[M][3]=B.a,h.emissionHeightBasedParams[M]=e.paint.get("model-height-based-emissive-strength-multiplier").evaluate(m,g,I),!h.hasTranslucentParts&&B.a<1&&(h.hasTranslucentParts=!0)}delete m.properties.part,P5(h,T!==h.evaluatedColor[2]||E!==h.evaluatedRMEA[2],this.modelTraits)}else h.evaluatedRMEA[0][2]=e.paint.get("model-emissive-strength").evaluate(m,g,I);h.evaluatedScale=e.paint.get("model-scale").evaluate(m,g,I),this.updatePbrBuffer(h.node)||(this.needsUpload=!0)}this.dirty=!1}elevationUpdate(e,r,c,h){const m=e.findDEMTileFor(c);if(m&&(m.tileID.canonical!==this.terrainTile||r!==this.terrainExaggeration)){if(m.dem&&m.tileID.overscaledZ!==this.elevationReadFromZ){this.elevationReadFromZ=m.tileID.overscaledZ;const g=Pm.create(e,c,m);if(!g)return;this.modelTraits&Mm.HasMapboxMeshFeatures&&this.updateDEM(e,g,c,h);for(const b of this.getNodesInfo()){const T=b.node;if(!T.footprint||!T.footprint.vertices||!T.footprint.vertices.length)continue;const E=T.footprint.vertices;let I=g.getElevationAt(E[0].x,E[0].y,!0,!0);for(let M=1;M<E.length;M++)I=Math.min(I,g.getElevationAt(E[M].x,E[M].y,!0,!0));T.elevation=I}}this.terrainTile=m.tileID.canonical,this.terrainExaggeration=r}}updateDEM(e,r,c,h){let m=r._dem._modifiedForSources[h];if(m===void 0&&(r._dem._modifiedForSources[h]=[],m=r._dem._modifiedForSources[h]),m.includes(c.canonical))return;const g=r._dem.dim;m.push(c.canonical);let b=!1;for(const T of this.getNodesInfo()){const E=T.node;if(!E.footprint||!E.footprint.grid)continue;const I=E.footprint.grid,M=r.tileCoordToPixel(I.min.x,I.min.y),k=r.tileCoordToPixel(I.max.x,I.max.y),B=Math.min(Math.min(g-k.y,M.x),Math.min(M.y,g-k.x));if(B<0)continue;const N=ke(B,2,5);let U=Math.max(0,M.x-N),Y=Math.max(0,M.y-N),J=Math.min(k.x+N,g-1),ae=Math.min(k.y+N,g-1);for(let oe=Y;oe<=ae;++oe)for(let he=U;he<=J;++he)Qf[oe*g+he]=255;let ne=0,G=0;for(let oe=0;oe<I.cellsY;++oe)for(let he=0;he<I.cellsX;++he){if(!I.cells[oe*I.cellsX+he])continue;const Te=r.tileCoordToPixel(I.min.x+he/I.xScale,I.min.y+oe/I.yScale),Me=r.tileCoordToPixel(I.min.x+(he+1)/I.xScale,I.min.y+(oe+1)/I.yScale);for(let Pe=Te.y;Pe<=Math.min(Me.y+1,g-1);++Pe)for(let ze=Te.x;ze<=Math.min(Me.x+1,g-1);++ze)Qf[Pe*g+ze]===255&&(Qf[Pe*g+ze]=0,ne+=r.getElevationAtPixel(ze,Pe),G++)}const te=ne/G;U=Math.max(1,M.x-N),Y=Math.max(1,M.y-N),J=Math.min(k.x+N,g-2),ae=Math.min(k.y+N,g-2),b=!0;for(let oe=Y;oe<=ae;++oe)for(let he=U;he<=J;++he)Qf[oe*g+he]===0&&(Ob[oe*g+he]=r._dem.set(he,oe,te));for(let oe=1;oe<N;++oe){U=Math.max(1,M.x-oe),Y=Math.max(1,M.y-oe),J=Math.min(k.x+oe,g-2),ae=Math.min(k.y+oe,g-2);for(let he=Y;he<=ae;++he)for(let Te=U;Te<=J;++Te){const Me=he*g+Te;if(Qf[Me]===255){let Pe=0,ze=0,tt=-1,mt=-1;for(let ut=-1;ut<=1;++ut)for(let pt=-1;pt<=1;++pt){const bt=(he+ut)*g+Te+pt;if(Qf[bt]>=oe)continue;const Ye=Ob[bt],ft=Math.abs(Ye);ft>ze&&(Pe=Ye,ze=ft,tt=pt,mt=ut)}if(ze>.1){const ut=1-(oe+.5*Math.abs(tt*mt))/N;let pt=r._dem.get(Te,he)+Pe*ut;const bt=r._dem.get(Te+tt,he+mt),Ye=r._dem.get(Te-tt,he-mt,!0);(pt-bt)*(pt-Ye)>0&&(pt=(bt+Ye)/2),Ob[Me]=r._dem.set(Te,he,pt),Qf[Me]=oe}}}}}b&&(r._demTile.needsDEMTextureUpload=!0,r._dem._timestamp=jo.now())}setFilter(e){this.filter=e?Og(e):null}getNodesInfo(){return this.filter?this.nodesInfo.filter(e=>this.filter.filter(new Un(this.id.overscaledZ),e.feature,this.id.canonical)):this.nodesInfo}destroy(){const e=this.getNodesInfo();for(const r of e)nv(r.node),Rb(r.node)}isEmpty(){return!this.nodesInfo.length}updateReplacement(e,r){if(r.updateTime===this.replacementUpdateTime)return;this.replacementUpdateTime=r.updateTime;const c=r.getReplacementRegionsForTile(e.toUnwrapped()),h=this.getNodesInfo();for(let m=0;m<this.nodesInfo.length;m++){const g=h[m].node;h[m].hiddenByReplacement=!!g.footprint&&!c.find(b=>b.footprint===g.footprint)}}getHeightAtTileCoord(e,r){const c=this.getNodesInfo(),h=[],m=[0,0,0],g=re([]);for(let b=0;b<this.nodesInfo.length;b++){const T=c[b],E=T.node.meshes[0],I=E.transformedAabb;if(e<I.min[0]||r<I.min[1]||e>I.max[0]||r>I.max[1])continue;if(T.node.hidden===!0)return{height:1/0,maxHeight:T.feature.properties.height,hidden:!1,verticalScale:T.evaluatedScale[2]};be(g,T.node.matrix),m[0]=e,m[1]=r,ti(m,m,g);const M=(m[0]-E.aabb.min[0])/(E.aabb.max[0]-E.aabb.min[0])*Jf|0,k=Math.min(63,(m[1]-E.aabb.min[1])/(E.aabb.max[1]-E.aabb.min[1])*Jf|0)*Jf+Math.min(63,M),B=E.heightmap[k];if(!(B<0&&T.node.footprint))return T.hiddenByReplacement?void 0:{height:B,maxHeight:T.feature.properties.height,hidden:!1,verticalScale:T.evaluatedScale[2]};if(T.node.footprint.grid.query(new kt(e,r),new kt(e,r),h),h.length>0)return{height:void 0,maxHeight:T.feature.properties.height,hidden:T.hiddenByReplacement,verticalScale:T.evaluatedScale[2]}}}}function w_(a,e){return a instanceof Sr&&!a.isLightConstant&&e}function M5(a,e,r,c,h,m,g,b){let T=(61440&e|(61440&e)>>4)>>8,E=(3840&e|(3840&e)>>4)>>4,I=240&e|(240&e)>>4;r[3]>0&&(T=gi(T,255*r[0],r[3]),E=gi(E,255*r[1],r[3]),I=gi(I,255*r[2],r[3]));const M=T<<8|E,k=I<<8|Math.floor(255*c[3]),B=function(oe){const he=ke(oe,0,2);return Math.min(Math.round(.5*he*255),255)}(c[2])<<8|15*c[0]<<4|15*c[1],N=ke(h[0],0,1),U=ke(h[1],0,1),Y=ke(h[2],0,1),J=ke(h[3],0,1);let ae,ne,G,te;if(N!==U&&g!==m&&U!==N){const oe=g-m;ne=1/(oe*(U-N)),G=-(m+oe*N)/(oe*(U-N));const he=ke(h[4],-1,1);te=Math.pow(10,he),ae=255*Y<<8|255*J}else ae=65535,ne=0,G=1,te=1;if(a.emplaceBack(M,k,B,ae,ne,G,te),b){const oe=b.length;b.clear();for(let he=0;he<oe;he++)b.emplaceBack(M,k,B,ae,ne,G,te)}}function P5(a,e,r){const c=a.node;let h=0;const m=r&Mm.HasMeshoptCompression;for(const g of c.meshes){if(c.lights&&c.lightMeshIndex===h||!g.featureData)continue;g.featureArray=new Bf,g.featureArray.reserve(g.featureData.length);let b=e;for(const T of g.featureData){const E=m?65535&T:T>>16&65535,I=m?T>>16&65535:65535&T,M=(15&I)<8?15&I:0,k=a.evaluatedRMEA[M],B=a.evaluatedColor[M],N=a.emissionHeightBasedParams[M];let U;if(b&&M===2&&c.lights&&(U=new Bf,U.resize(10*c.lights.length)),M5(g.featureArray,E,B,k,N,g.aabb.min[2],g.aabb.max[2],U),U&&b){b=!1;const Y=c.meshes[c.lightMeshIndex];Y.featureArray=U,Y.featureArray._trim()}}g.featureArray._trim(),h++}}function x3(a,e,r,c){const h=1<<a.z;e.lat=Ae((c/Rt+a.y)/h),e.lng=Se((r/Rt+a.x)/h)}Vt(sv,"Tiled3dModelBucket",{omit:["layers"]}),Vt(v3,"Tiled3dModelFeature");const D5={circle:class extends Lo{constructor(a,e,r,c){super(a,{layout:Nn||(Nn=new Ys({"circle-sort-key":new Xt($e.layout_circle["circle-sort-key"]),"circle-elevation-reference":new It($e.layout_circle["circle-elevation-reference"]),visibility:new It($e.layout_circle.visibility)})),paint:Ls||(Ls=new Ys({"circle-radius":new Xt($e.paint_circle["circle-radius"]),"circle-color":new Xt($e.paint_circle["circle-color"]),"circle-blur":new Xt($e.paint_circle["circle-blur"]),"circle-opacity":new Xt($e.paint_circle["circle-opacity"]),"circle-translate":new It($e.paint_circle["circle-translate"]),"circle-translate-anchor":new It($e.paint_circle["circle-translate-anchor"]),"circle-pitch-scale":new It($e.paint_circle["circle-pitch-scale"]),"circle-pitch-alignment":new It($e.paint_circle["circle-pitch-alignment"]),"circle-stroke-width":new Xt($e.paint_circle["circle-stroke-width"]),"circle-stroke-color":new Xt($e.paint_circle["circle-stroke-color"]),"circle-stroke-opacity":new Xt($e.paint_circle["circle-stroke-opacity"]),"circle-emissive-strength":new It($e.paint_circle["circle-emissive-strength"]),"circle-color-use-theme":new Xt({type:"string",default:"default","property-type":"data-driven"}),"circle-stroke-color-use-theme":new Xt({type:"string",default:"default","property-type":"data-driven"})}))},e,r,c)}createBucket(a){return new ni(a)}queryRadius(a){const e=a;return tn("circle-radius",this,e)+tn("circle-stroke-width",this,e)+Cs(this.paint.get("circle-translate"))}queryIntersectsFeature(a,e,r,c,h,m,g,b){const T=Is(this.paint.get("circle-translate"),this.paint.get("circle-translate-anchor"),m.angle,a.pixelToTileUnitsFactor),E=this.paint.get("circle-radius").evaluate(e,r)+this.paint.get("circle-stroke-width").evaluate(e,r);return RS(a,c,m,g,b,this.paint.get("circle-pitch-alignment")==="map",this.paint.get("circle-pitch-scale")==="map",T,E)}getProgramIds(){return["circle"]}getDefaultProgramParams(a,e,r){const c=LS(this);return{config:new cu(this,{zoom:e,lut:r}),defines:c,overrideFog:!1}}
vendor: 12,909 bytes, line 601
601hasElevation(){return this.layout&&this.layout.get("circle-elevation-reference")!=="none"}},heatmap:class extends Lo{createBucket(a){return new zS(a)}constructor(a,e,r,c){super(a,{layout:FS||(FS=new Ys({visibility:new It($e.layout_heatmap.visibility)})),paint:BS||(BS=new Ys({"heatmap-radius":new Xt($e.paint_heatmap["heatmap-radius"]),"heatmap-weight":new Xt($e.paint_heatmap["heatmap-weight"]),"heatmap-intensity":new It($e.paint_heatmap["heatmap-intensity"]),"heatmap-color":new eh($e.paint_heatmap["heatmap-color"]),"heatmap-opacity":new It($e.paint_heatmap["heatmap-opacity"]),"heatmap-color-use-theme":new Xt({type:"string",default:"default","property-type":"data-driven"})}))},e,r,c),this._updateColorRamp()}_handleSpecialPaintPropertyUpdate(a){a==="heatmap-color"&&this._updateColorRamp()}_updateColorRamp(){this.colorRamp=e_({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(a){return tn("heatmap-radius",this,a)}queryIntersectsFeature(a,e,r,c,h,m,g,b){const T=this.paint.get("heatmap-radius").evaluate(e,r);return RS(a,c,m,g,b,!0,!0,new kt(0,0),T)}hasOffscreenPass(){return this.paint.get("heatmap-opacity")!==0&&this.visibility!=="none"}getProgramIds(){return["heatmap","heatmapTexture"]}getDefaultProgramParams(a,e,r){return a==="heatmap"?{config:new cu(this,{zoom:e,lut:r}),overrideFog:!1}:{}}},hillshade:class extends Lo{constructor(a,e,r,c){super(a,{layout:NS||(NS=new Ys({visibility:new It($e.layout_hillshade.visibility)})),paint:VS||(VS=new Ys({"hillshade-illumination-direction":new It($e.paint_hillshade["hillshade-illumination-direction"]),"hillshade-illumination-anchor":new It($e.paint_hillshade["hillshade-illumination-anchor"]),"hillshade-exaggeration":new It($e.paint_hillshade["hillshade-exaggeration"]),"hillshade-shadow-color":new It($e.paint_hillshade["hillshade-shadow-color"]),"hillshade-highlight-color":new It($e.paint_hillshade["hillshade-highlight-color"]),"hillshade-accent-color":new It($e.paint_hillshade["hillshade-accent-color"]),"hillshade-emissive-strength":new It($e.paint_hillshade["hillshade-emissive-strength"]),"hillshade-shadow-color-use-theme":new Xt({type:"string",default:"default","property-type":"data-driven"}),"hillshade-highlight-color-use-theme":new Xt({type:"string",default:"default","property-type":"data-driven"}),"hillshade-accent-color-use-theme":new Xt({type:"string",default:"default","property-type":"data-driven"})}))},e,r,c)}shouldRedrape(){return this.hasOffscreenPass()&&this.paint.get("hillshade-illumination-anchor")==="viewport"}hasOffscreenPass(){return this.paint.get("hillshade-exaggeration")!==0&&this.visibility!=="none"}getProgramIds(){return["hillshade","hillshadePrepare"]}getDefaultProgramParams(a,e,r){return{overrideFog:!1}}},fill:class extends Lo{constructor(a,e,r,c){super(a,{layout:dE||(dE=new Ys({"fill-sort-key":new Xt($e.layout_fill["fill-sort-key"]),visibility:new It($e.layout_fill.visibility),"fill-elevation-reference":new It($e.layout_fill["fill-elevation-reference"]),"fill-construct-bridge-guard-rail":new Xt($e.layout_fill["fill-construct-bridge-guard-rail"])})),paint:fE||(fE=new Ys({"fill-antialias":new It($e.paint_fill["fill-antialias"]),"fill-opacity":new Xt($e.paint_fill["fill-opacity"]),"fill-color":new Xt($e.paint_fill["fill-color"]),"fill-outline-color":new Xt($e.paint_fill["fill-outline-color"]),"fill-translate":new It($e.paint_fill["fill-translate"]),"fill-translate-anchor":new It($e.paint_fill["fill-translate-anchor"]),"fill-pattern":new Xt($e.paint_fill["fill-pattern"]),"fill-pattern-cross-fade":new It($e.paint_fill["fill-pattern-cross-fade"]),"fill-emissive-strength":new It($e.paint_fill["fill-emissive-strength"]),"fill-z-offset":new Xt($e.paint_fill["fill-z-offset"]),"fill-bridge-guard-rail-color":new Xt($e.paint_fill["fill-bridge-guard-rail-color"]),"fill-tunnel-structure-color":new Xt($e.paint_fill["fill-tunnel-structure-color"]),"fill-color-use-theme":new Xt({type:"string",default:"default","property-type":"data-driven"}),"fill-outline-color-use-theme":new Xt({type:"string",default:"default","property-type":"data-driven"}),"fill-bridge-guard-rail-color-use-theme":new Xt({type:"string",default:"default","property-type":"data-driven"}),"fill-tunnel-structure-color-use-theme":new Xt({type:"string",default:"default","property-type":"data-driven"})}))},e,r,c)}getProgramIds(){const a=this.paint.get("fill-pattern"),e=a&&a.constantOr(1),r=[e?"fillPattern":"fill"];return this.paint.get("fill-antialias")&&r.push(e&&!this.getPaintProperty("fill-outline-color")?"fillOutlinePattern":"fillOutline"),r}getDefaultProgramParams(a,e,r){return{config:new cu(this,{zoom:e,lut:r}),overrideFog:!1}}recalculate(a,e){super.recalculate(a,e);const r=this.paint._values["fill-outline-color"];r.value.kind==="constant"&&r.value.value===void 0&&(this.paint._values["fill-outline-color"]=this.paint._values["fill-color"])}createBucket(a){return new J1(a)}queryRadius(){return Cs(this.paint.get("fill-translate"))}queryIntersectsFeature(a,e,r,c,h,m){return!a.queryGeometry.isAboveHorizon&&un(In(a.tilespaceGeometry,this.paint.get("fill-translate"),this.paint.get("fill-translate-anchor"),m.angle,a.pixelToTileUnitsFactor),c)}isTileClipped(){return this.paint.get("fill-z-offset").constantOr(1)===0}is3D(a){if(this.paint.get("fill-z-offset").constantOr(1)!==0)return!0;const e=this.layout&&this.layout.get("fill-elevation-reference")!=="none";return a!=null?e&&!a:e}hasElevation(){return this.layout&&this.layout.get("fill-elevation-reference")!=="none"}hasShadowPass(){return this.layout&&this.layout.get("fill-elevation-reference")!=="none"}},"fill-extrusion":class extends Lo{constructor(a,e,r,c){super(a,{layout:BE||(BE=new Ys({visibility:new It($e["layout_fill-extrusion"].visibility),"fill-extrusion-edge-radius":new It($e["layout_fill-extrusion"]["fill-extrusion-edge-radius"])})),paint:NE||(NE=new Ys({"fill-extrusion-opacity":new It($e["paint_fill-extrusion"]["fill-extrusion-opacity"]),"fill-extrusion-color":new Xt($e["paint_fill-extrusion"]["fill-extrusion-color"]),"fill-extrusion-translate":new It($e["paint_fill-extrusion"]["fill-extrusion-translate"]),"fill-extrusion-translate-anchor":new It($e["paint_fill-extrusion"]["fill-extrusion-translate-anchor"]),"fill-extrusion-pattern":new Xt($e["paint_fill-extrusion"]["fill-extrusion-pattern"]),"fill-extrusion-pattern-cross-fade":new It($e["paint_fill-extrusion"]["fill-extrusion-pattern-cross-fade"]),"fill-extrusion-height":new Xt($e["paint_fill-extrusion"]["fill-extrusion-height"]),"fill-extrusion-base":new Xt($e["paint_fill-extrusion"]["fill-extrusion-base"]),"fill-extrusion-height-alignment":new It($e["paint_fill-extrusion"]["fill-extrusion-height-alignment"]),"fill-extrusion-base-alignment":new It($e["paint_fill-extrusion"]["fill-extrusion-base-alignment"]),"fill-extrusion-vertical-gradient":new It($e["paint_fill-extrusion"]["fill-extrusion-vertical-gradient"]),"fill-extrusion-ambient-occlusion-intensity":new It($e["paint_fill-extrusion"]["fill-extrusion-ambient-occlusion-intensity"]),"fill-extrusion-ambient-occlusion-radius":new It($e["paint_fill-extrusion"]["fill-extrusion-ambient-occlusion-radius"]),"fill-extrusion-ambient-occlusion-wall-radius":new It($e["paint_fill-extrusion"]["fill-extrusion-ambient-occlusion-wall-radius"]),"fill-extrusion-ambient-occlusion-ground-radius":new It($e["paint_fill-extrusion"]["fill-extrusion-ambient-occlusion-ground-radius"]),"fill-extrusion-ambient-occlusion-ground-attenuation":new It($e["paint_fill-extrusion"]["fill-extrusion-ambient-occlusion-ground-attenuation"]),"fill-extrusion-flood-light-color":new It($e["paint_fill-extrusion"]["fill-extrusion-flood-light-color"]),"fill-extrusion-flood-light-intensity":new It($e["paint_fill-extrusion"]["fill-extrusion-flood-light-intensity"]),"fill-extrusion-flood-light-wall-radius":new Xt($e["paint_fill-extrusion"]["fill-extrusion-flood-light-wall-radius"]),"fill-extrusion-flood-light-ground-radius":new Xt($e["paint_fill-extrusion"]["fill-extrusion-flood-light-ground-radius"]),"fill-extrusion-flood-light-ground-attenuation":new It($e["paint_fill-extrusion"]["fill-extrusion-flood-light-ground-attenuation"]),"fill-extrusion-vertical-scale":new It($e["paint_fill-extrusion"]["fill-extrusion-vertical-scale"]),"fill-extrusion-rounded-roof":new It($e["paint_fill-extrusion"]["fill-extrusion-rounded-roof"]),"fill-extrusion-cutoff-fade-range":new It($e["paint_fill-extrusion"]["fill-extrusion-cutoff-fade-range"]),"fill-extrusion-emissive-strength":new Xt($e["paint_fill-extrusion"]["fill-extrusion-emissive-strength"]),"fill-extrusion-line-width":new Xt($e["paint_fill-extrusion"]["fill-extrusion-line-width"]),"fill-extrusion-cast-shadows":new It($e["paint_fill-extrusion"]["fill-extrusion-cast-shadows"]),"fill-extrusion-color-use-theme":new Xt({type:"string",default:"default","property-type":"data-driven"}),"fill-extrusion-flood-light-color-use-theme":new Xt({type:"string",default:"default","property-type":"data-driven"})}))},e,r,c),this._stats={numRenderedVerticesInShadowPass:0,numRenderedVerticesInTransparentPass:0}}createBucket(a){return new L0(a)}queryRadius(){return Cs(this.paint.get("fill-extrusion-translate"))}is3D(a){return!0}hasShadowPass(){return this.paint.get("fill-extrusion-cast-shadows")}cutoffRange(){return this.paint.get("fill-extrusion-cutoff-fade-range")}canCastShadows(){return!0}getProgramIds(){return[this.paint.get("fill-extrusion-pattern").constantOr(1)?"fillExtrusionPattern":"fillExtrusion"]}queryIntersectsFeature(a,e,r,c,h,m,g,b,T){const E=Is(this.paint.get("fill-extrusion-translate"),this.paint.get("fill-extrusion-translate-anchor"),m.angle,a.pixelToTileUnitsFactor),I=this.paint.get("fill-extrusion-height").evaluate(e,r),M=this.paint.get("fill-extrusion-base").evaluate(e,r),k=[0,0],B=b&&m.elevation,N=m.elevation?m.elevation.exaggeration():1,U=a.tile.getBucket(this);if(B&&U instanceof L0){const G=U.centroidVertexArray,te=T+1;te<G.length&&(k[0]=G.geta_centroid_pos0(te),k[1]=G.geta_centroid_pos1(te))}if(k[0]===0&&k[1]===1)return!1;m.projection.name==="globe"&&(c=FE([c],[new kt(0,0),new kt(Rt,Rt)],a.tileID.canonical).map(G=>G.polygon).flat());const Y=B?b:null,[J,ae]=function(G,te,oe,he,Te,Me,Pe,ze,tt,mt,ut){return G.projection.name==="globe"?function(pt,bt,Ye,ft,qe,et,Tt,St,li,Jt,Bt){const wt=[],Ni=[],si=pt.projection.upVectorScale(Bt,pt.center.lat,pt.worldSize).metersToTile,ri=[0,0,0,1],Oi=[0,0,0,1],Xi=(ln,rn,nn,as)=>{ln[0]=rn,ln[1]=nn,ln[2]=as,ln[3]=1},Ji=zE();Ye>0&&(Ye+=Ji),ft+=Ji;for(const ln of bt){const rn=[],nn=[];for(const as of ln){const ys=as.x+qe.x,le=as.y+qe.y,de=pt.projection.projectTilePoint(ys,le,Bt),nt=pt.projection.upVector(Bt,as.x,as.y);let Pt=Ye,jt=ft;if(Tt){const Nt=GE(ys,le,Ye,ft,Tt,St,li,Jt);Pt+=Nt.base,jt+=Nt.top}Ye!==0?Xi(ri,de.x+nt[0]*si*Pt,de.y+nt[1]*si*Pt,de.z+nt[2]*si*Pt):Xi(ri,de.x,de.y,de.z),Xi(Oi,de.x+nt[0]*si*jt,de.y+nt[1]*si*jt,de.z+nt[2]*si*jt),ti(ri,ri,et),ti(Oi,Oi,et),rn.push(new Xf(ri[0],ri[1],ri[2])),nn.push(new Xf(Oi[0],Oi[1],Oi[2]))}wt.push(rn),Ni.push(nn)}return[wt,Ni]}(G,te,oe,he,Te,Me,Pe,ze,tt,mt,ut):Pe?function(pt,bt,Ye,ft,qe,et,Tt,St,li){const Jt=[],Bt=[],wt=[0,0,0,1];for(const Ni of pt){const si=[],ri=[];for(const Oi of Ni){const Xi=Oi.x+ft.x,Ji=Oi.y+ft.y,ln=GE(Xi,Ji,bt,Ye,et,Tt,St,li);wt[0]=Xi,wt[1]=Ji,wt[2]=ln.base,wt[3]=1,pi(wt,wt,qe),wt[3]=Math.max(wt[3],1e-5);const rn=new Xf(wt[0]/wt[3],wt[1]/wt[3],wt[2]/wt[3]);wt[0]=Xi,wt[1]=Ji,wt[2]=ln.top,wt[3]=1,pi(wt,wt,qe),wt[3]=Math.max(wt[3],1e-5);const nn=new Xf(wt[0]/wt[3],wt[1]/wt[3],wt[2]/wt[3]);si.push(rn),ri.push(nn)}Jt.push(si),Bt.push(ri)}return[Jt,Bt]}(te,oe,he,Te,Me,Pe,ze,tt,mt):function(pt,bt,Ye,ft,qe){const et=[],Tt=[],St=qe[8]*bt,li=qe[9]*bt,Jt=qe[10]*bt,Bt=qe[11]*bt,wt=qe[8]*Ye,Ni=qe[9]*Ye,si=qe[10]*Ye,ri=qe[11]*Ye;for(const Oi of pt){const Xi=[],Ji=[];for(const ln of Oi){const rn=ln.x+ft.x,nn=ln.y+ft.y,as=qe[0]*rn+qe[4]*nn+qe[12],ys=qe[1]*rn+qe[5]*nn+qe[13],le=qe[2]*rn+qe[6]*nn+qe[14],de=qe[3]*rn+qe[7]*nn+qe[15],nt=as+St,Pt=ys+li,jt=le+Jt,Nt=Math.max(de+Bt,1e-5),oi=as+wt,Ai=ys+Ni,pn=le+si,mn=Math.max(de+ri,1e-5);Xi.push(new Xf(nt/Nt,Pt/Nt,jt/Nt)),Ji.push(new Xf(oi/mn,Ai/mn,pn/mn))}et.push(Xi),Tt.push(Ji)}return[et,Tt]}(te,oe,he,Te,Me)}(m,c,M,I,E,g,Y,k,N,m.center.lat,a.tileID.canonical),ne=a.queryGeometry;return function(G,te,oe){let he=1/0;un(oe,te)&&(he=HE(oe,te[0]));for(let Te=0;Te<te.length;Te++){const Me=te[Te],Pe=G[Te];for(let ze=0;ze<Me.length-1;ze++){const tt=Me[ze],mt=[tt,Me[ze+1],Pe[ze+1],Pe[ze],tt];bi(oe,mt)&&(he=Math.min(he,HE(oe,mt)))}}return he!==1/0&&he}(J,ae,ne.isPointQuery()?ne.screenBounds:ne.screenGeometry)}},line:class extends Lo{constructor(a,e,r,c){const h=tA();super(a,h,e,r,c),h.layout&&(this.layout=new Qu(h.layout)),this.gradientVersion=0,this.hasElevatedBuckets=!1,this.hasNonElevatedBuckets=!1}
601_handleSpecialPaintPropertyUpdate(a){if(a==="line-gradient"){const e=this._transitionablePaint._values["line-gradient"].value.expression;this.stepInterpolant=e._styleExpression&&e._styleExpression.expression instanceof Gu,this.gradientVersion=(this.gradientVersion+1)%Number.MAX_SAFE_INTEGER}}gradientExpression(){return this._transitionablePaint._values["line-gradient"].value.expression}widthExpression(){return this._transitionablePaint._values["line-width"].value.expression}recalculate(a,e){super.recalculate(a,e),this.paint._values["line-floorwidth"]=(()=>{if(u_)return u_;const r=tA();return u_=new DO(r.paint.properties["line-width"].specification),u_.useIntegerZoom=!0,u_})().possiblyEvaluate(this._transitioningPaint._values["line-width"].value,a)}createBucket(a){return new rb(a)}getProgramIds(){return[this.paint.get("line-pattern").constantOr(1)?"linePattern":"line"]}getDefaultProgramParams(a,e,r){const c=QE(this);return{config:new cu(this,{zoom:e,lut:r}),defines:c,overrideFog:!1}}queryRadius(a){const e=a,r=iA(tn("line-width",this,e),tn("line-gap-width",this,e)),c=tn("line-offset",this,e);return r/2+Math.abs(c)+Cs(this.paint.get("line-translate"))}queryIntersectsFeature(a,e,r,c,h,m){if(a.queryGeometry.isAboveHorizon)return!1;const g=In(a.tilespaceGeometry,this.paint.get("line-translate"),this.paint.get("line-translate-anchor"),m.angle,a.pixelToTileUnitsFactor),b=a.pixelToTileUnitsFactor/2*iA(this.paint.get("line-width").evaluate(e,r),this.paint.get("line-gap-width").evaluate(e,r)),T=this.paint.get("line-offset").evaluate(e,r);return T&&(c=function(E,I){const M=[],k=new kt(0,0);for(let B=0;B<E.length;B++){const N=E[B],U=[];for(let Y=0;Y<N.length;Y++){const J=N[Y],ae=N[Y+1],ne=Y===0?k:J.sub(N[Y-1])._unit()._perp(),G=Y===N.length-1?k:ae.sub(J)._unit()._perp(),te=ne._add(G)._unit();te._mult(1/(te.x*G.x+te.y*G.y)),U.push(te._mult(I)._add(J))}M.push(U)}return M}(c,T*a.pixelToTileUnitsFactor)),function(E,I,M){for(let k=0;k<I.length;k++){const B=I[k];if(E.length>=3){for(let N=0;N<B.length;N++)if(ns(E,B[N]))return!0}if(is(E,B,M))return!0}return!1}(g,c,b)}isTileClipped(){return this.hasNonElevatedBuckets}isDraped(a){return!this.hasElevatedBuckets}hasElevation(){return this.layout&&this.layout.get("line-elevation-reference")!=="none"}},symbol:Y0,background:class extends Lo{constructor(a,e,r,c){super(a,{layout:WA||(WA=new Ys({visibility:new It($e.layout_background.visibility)})),paint:qA||(qA=new Ys({"background-pitch-alignment":new It($e.paint_background["background-pitch-alignment"]),"background-color":new It($e.paint_background["background-color"]),"background-pattern":new It($e.paint_background["background-pattern"]),"background-opacity":new It($e.paint_background["background-opacity"]),"background-emissive-strength":new It($e.paint_background["background-emissive-strength"]),"background-color-use-theme":new Xt({type:"string",default:"default","property-type":"data-driven"})}))},e,r,c)}getProgramIds(){return[this.paint.get("background-pattern")?"backgroundPattern":"background"]}getDefaultProgramParams(a,e,r){return{overrideFog:!1}}is3D(a){return this.paint.get("background-pitch-alignment")==="viewport"}},raster:JA,"raster-particle":s3,sky:class extends Lo{constructor(a,e,r,c){super(a,{layout:t3||(t3=new Ys({visibility:new It($e.layout_sky.visibility)})),paint:i3||(i3=new Ys({"sky-type":new It($e.paint_sky["sky-type"]),"sky-atmosphere-sun":new It($e.paint_sky["sky-atmosphere-sun"]),"sky-atmosphere-sun-intensity":new It($e.paint_sky["sky-atmosphere-sun-intensity"]),"sky-gradient-center":new It($e.paint_sky["sky-gradient-center"]),"sky-gradient-radius":new It($e.paint_sky["sky-gradient-radius"]),"sky-gradient":new eh($e.paint_sky["sky-gradient"]),"sky-atmosphere-halo-color":new It($e.paint_sky["sky-atmosphere-halo-color"]),"sky-atmosphere-color":new It($e.paint_sky["sky-atmosphere-color"]),"sky-opacity":new It($e.paint_sky["sky-opacity"]),"sky-gradient-use-theme":new Xt({type:"string",default:"default","property-type":"data-driven"}),"sky-atmosphere-halo-color-use-theme":new Xt({type:"string",default:"default","property-type":"data-driven"}),"sky-atmosphere-color-use-theme":new Xt({type:"string",default:"default","property-type":"data-driven"})}))},e,r,c),this._updateColorRamp()}
601_handleSpecialPaintPropertyUpdate(a){a==="sky-gradient"?this._updateColorRamp():a!=="sky-atmosphere-sun"&&a!=="sky-atmosphere-halo-color"&&a!=="sky-atmosphere-color"&&a!=="sky-atmosphere-sun-intensity"||(this._skyboxInvalidated=!0)}_updateColorRamp(){this.colorRamp=e_({expression:this._transitionablePaint._values["sky-gradient"].value.expression,evaluationKey:"skyRadialProgress"}),this.colorRampTexture&&(this.colorRampTexture.destroy(),this.colorRampTexture=null)}needsSkyboxCapture(a){if(this._skyboxInvalidated||!this.skyboxTexture||!this.skyboxGeometry)return!0;if(!this.paint.get("sky-atmosphere-sun")){const e=a.style.light.properties.get("position");return this._lightPosition.azimuthal!==e.azimuthal||this._lightPosition.polar!==e.polar}return!1}getCenter(a,e){if(this.paint.get("sky-type")==="atmosphere"){const c=this.paint.get("sky-atmosphere-sun"),h=!c,m=a.style.light,g=m.properties.get("position");return h&&m.properties.get("anchor")==="viewport"&&Yi("The sun direction is attached to a light with viewport anchor, lighting may behave unexpectedly."),h?Ib(g.azimuthal,90-g.polar,e):Ib(c[0],90-c[1],e)}const r=this.paint.get("sky-gradient-center");return Ib(r[0],90-r[1],e)}isSky(){return!0}markSkyboxValid(a){this._skyboxInvalidated=!1,this._lightPosition=a.style.light.properties.get("position")}hasOffscreenPass(){return!0}getProgramIds(){const a=this.paint.get("sky-type");return a==="atmosphere"?["skyboxCapture","skybox"]:a==="gradient"?["skyboxGradient"]:null}},slot:class extends Lo{constructor(a,e,r,c){super(a,{paint:n3||(n3=new Ys({}))},e,null)}},model:class extends Lo{constructor(a,e,r,c){super(a,{layout:f3||(f3=new Ys({visibility:new It($e.layout_model.visibility),"model-id":new Xt($e.layout_model["model-id"])})),paint:p3||(p3=new Ys({"model-opacity":new Xt($e.paint_model["model-opacity"]),"model-rotation":new Xt($e.paint_model["model-rotation"]),"model-scale":new Xt($e.paint_model["model-scale"]),"model-translation":new Xt($e.paint_model["model-translation"]),"model-color":new Xt($e.paint_model["model-color"]),"model-color-mix-intensity":new Xt($e.paint_model["model-color-mix-intensity"]),"model-type":new It($e.paint_model["model-type"]),"model-cast-shadows":new It($e.paint_model["model-cast-shadows"]),"model-receive-shadows":new It($e.paint_model["model-receive-shadows"]),"model-ambient-occlusion-intensity":new It($e.paint_model["model-ambient-occlusion-intensity"]),"model-emissive-strength":new Xt($e.paint_model["model-emissive-strength"]),"model-roughness":new Xt($e.paint_model["model-roughness"]),"model-height-based-emissive-strength-multiplier":new Xt($e.paint_model["model-height-based-emissive-strength-multiplier"]),"model-cutoff-fade-range":new It($e.paint_model["model-cutoff-fade-range"]),"model-front-cutoff":new It($e.paint_model["model-front-cutoff"]),"model-color-use-theme":new Xt({type:"string",default:"default","property-type":"data-driven"})}))},e,r,c),this._stats={numRenderedVerticesInShadowPass:0,numRenderedVerticesInTransparentPass:0}}createBucket(a){return new kb(a)}getProgramIds(){return["model"]}is3D(a){return!0}hasShadowPass(){return!0}canCastShadows(){return!0}hasLightBeamPass(){return!0}cutoffRange(){return this.paint.get("model-cutoff-fade-range")}queryRadius(a){return a instanceof sv?Rt-1:0}queryIntersectsFeature(a,e,r,c,h,m){if(!this.modelManager)return!1;const g=this.modelManager,b=a.tile.getBucket(this);if(!(b&&b instanceof kb))return!1;for(const T in b.instancesPerModel){const E=b.instancesPerModel[T],I=e.id!==void 0?e.id:e.properties&&e.properties.hasOwnProperty("id")?e.properties.id:void 0;if(E.idToFeaturesIndex.hasOwnProperty(I)){const M=E.features[E.idToFeaturesIndex[I]],k=g.getModel(T,this.scope);if(!k)return!1;let B=me();const N=new Z(0,0),U=b.canonical;let Y=Number.MAX_VALUE;for(let J=0;J<M.instancedDataCount;++J){const ae=16*(M.instancedDataOffset+J),ne=E.instancedDataArray.float32,G=[ne[ae+4],ne[ae+5],ne[ae+6]];x3(U,N,ne[ae],0|ne[ae+1]),m3(B,k,m,N,M.rotation,M.scale,G,!1,!1,!1),m.projection.name==="globe"&&(B=Pb(B,m));const te=ve([],m.projMatrix,B),oe=a.queryGeometry,he=c3(oe.isPointQuery()?oe.screenBounds:oe.screenGeometry,m,te,k.aabb);he!=null&&(Y=Math.min(he,Y))}return Y!==Number.MAX_VALUE&&Y}}return!1}
601_handleOverridablePaintPropertyUpdate(a,e,r){return!(!this.layout||e.isDataDriven()||r.isDataDriven()||a!=="model-color"&&a!=="model-color-mix-intensity"&&a!=="model-rotation"&&a!=="model-scale"&&a!=="model-translation"&&a!=="model-emissive-strength")}_isPropertyZoomDependent(a){const e=this._transitionablePaint._values[a];return e!=null&&e.value!=null&&e.value.expression!=null&&e.value.expression instanceof so}isZoomDependent(){return this._isPropertyZoomDependent("model-scale")||this._isPropertyZoomDependent("model-rotation")||this._isPropertyZoomDependent("model-translation")}},clip:class extends Lo{constructor(a,e,r,c){super(a,{layout:pE||(pE=new Ys({"clip-layer-types":new It($e.layout_clip["clip-layer-types"]),"clip-layer-scope":new It($e.layout_clip["clip-layer-scope"])})),paint:mE||(mE=new Ys({}))},e,r,c)}recalculate(a,e){super.recalculate(a,e)}createBucket(a){return new gE(a)}is3D(a){return!0}}};class k5{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(){this._channel=void 0,this._callback=()=>{}}}class L5{constructor(){this.tasks={},this.taskQueue=[],xi(["process"],this),this.invoker=new k5(this.process),this.nextId=0}add(e,r){const c=this.nextId++,h=function({type:m,isSymbolTile:g,zoom:b}){return b=b||0,m==="message"?0:m!=="maybePrepare"||g?m!=="parseTile"||g?m==="parseTile"&&g?300-b:m==="maybePrepare"&&g?400-b:500:200-b:100-b}(r);if(h===0){try{e()}finally{}return null}return this.tasks[c]={fn:e,metadata:r,priority:h,id:c},this.taskQueue.push(c),this.invoker.trigger(),{cancel:()=>{delete this.tasks[c]}}}process(){try{if(this.taskQueue=this.taskQueue.filter(c=>!!this.tasks[c]),!this.taskQueue.length)return;const e=this.pick();if(e===null)return;const r=this.tasks[e];if(delete this.tasks[e],this.taskQueue.length&&this.invoker.trigger(),!r)return;r.fn()}finally{}}pick(){let e=null,r=1/0;for(let h=0;h<this.taskQueue.length;h++){const m=this.tasks[this.taskQueue[h]];m.priority<r&&(r=m.priority,e=h)}if(e===null)return null;const c=this.taskQueue[e];return this.taskQueue.splice(e,1),c}remove(){this.invoker.remove()}}class b3{constructor(e,r,c){this.target=e,this.parent=r,this.mapId=c,this.callbacks={},this.cancelCallbacks={},xi(["receive"],this),this.target.addEventListener("message",this.receive,!1),this.scheduler=new L5}send(e,r,c,h,m=!1,g){const b=Math.round(1e18*Math.random()).toString(36).substring(0,10);c&&(c.metadata=g,this.callbacks[b]=c);const T=new Set;return this.target.postMessage({id:b,type:e,hasCallback:!!c,targetMapId:h,mustQueue:m,sourceMapId:this.mapId,data:ol(r,T)},T),{cancel:()=>{c&&delete this.callbacks[b],this.target.postMessage({id:b,type:"<cancel>",targetMapId:h,sourceMapId:this.mapId})}}}receive(e){const r=e.data;if(!r)return;const c=r.id;if(c&&(!r.targetMapId||this.mapId===r.targetMapId))if(r.type==="<cancel>"){const h=this.cancelCallbacks[c];delete this.cancelCallbacks[c],h&&h.cancel()}else if(r.mustQueue||Gn(self)){const h=this.callbacks[c],m=this.scheduler.add(()=>this.processTask(c,r),h&&h.metadata||{type:"message"});m&&(this.cancelCallbacks[c]=m)}else this.processTask(c,r)}processTask(e,r){if(delete this.cancelCallbacks[e],r.type==="<response>"){const c=this.callbacks[e];delete this.callbacks[e],c&&(r.error?c(al(r.error)):c(null,al(r.data)))}else{const c=new Set,h=r.hasCallback?(g,b)=>{this.target.postMessage({id:e,type:"<response>",sourceMapId:this.mapId,error:g?ol(g):null,data:ol(b,c)},c)}:()=>{},m=al(r.data);if(this.parent[r.type])this.parent[r.type](r.sourceMapId,m,h);else if(this.parent.getWorkerSource){const g=r.type.split("."),{source:b,scope:T}=m;this.parent.getWorkerSource(r.sourceMapId,g[0],b,T)[g[1]](m,h)}else h(new Error(`Could not find function ${r.type}`))}}remove(){this.scheduler.remove(),this.target.removeEventListener("message",this.receive,!1)}}var T_={workerUrl:"",workerClass:null,workerParams:void 0};const zb="mapboxgl_preloaded_worker_pool";class ep{constructor(){this.active={}}acquire(e,r=ep.workerCount){if(!this.workers)for(this.workers=[];this.workers.length<r;)this.workers.push(T_.workerClass!=null?new T_.workerClass:new self.Worker(T_.workerUrl,T_.workerParams));return this.active[e]=!0,this.workers.slice()}release(e){delete this.active[e],this.workers&&this.numActive()===0&&(this.workers.forEac
601h(r=>{r.terminate()}),this.workers=null)}isPreloaded(){return!!this.active[zb]}numActive(){return Object.keys(this.active).length}}ep.workerCount=2;class Dm{constructor(e,r,c="Worker",h=ep.workerCount){this.workerPool=e,this.actors=[],this.currentActor=0,this.id=Ht();const m=this.workerPool.acquire(this.id,h);for(let g=0;g<m.length;g++){const b=new Dm.Actor(m[g],r,this.id);b.name=`${c} ${g}`,this.actors.push(b)}this.ready=!1,this.broadcast("checkIfReady",null,()=>{this.ready=!0})}broadcast(e,r,c){rt(this.actors,(h,m)=>{h.send(e,r,m)},c=c||function(){})}getActor(){return this.currentActor=(this.currentActor+1)%this.actors.length,this.actors[this.currentActor]}remove(){this.actors.forEach(e=>{e.remove()}),this.actors=[],this.workerPool.release(this.id)}}let S_,Fb;function rv(){return S_||(S_=new ep),S_}Dm.Actor=b3;const Bb=new Cn(0,0,0),Nb={PATH_RULE_UNSPECIFIED:0,PATH_RULE_NON_ZERO:1,PATH_RULE_EVEN_ODD:2},Vb={LINE_CAP_UNSPECIFIED:0,LINE_CAP_BUTT:1,LINE_CAP_ROUND:2,LINE_CAP_SQUARE:3},ov={LINE_JOIN_UNSPECIFIED:0,LINE_JOIN_MITER:1,LINE_JOIN_MITER_CLIP:2,LINE_JOIN_ROUND:3,LINE_JOIN_BEVEL:4},R5={PAINT_ORDER_UNSPECIFIED:0,PAINT_ORDER_FILL_AND_STROKE:1,PAINT_ORDER_STROKE_AND_FILL:2},E_={PATH_COMMAND_UNSPECIFIED:0,PATH_COMMAND_MOVE:1,PATH_COMMAND_LINE:2,PATH_COMMAND_QUAD:3,PATH_COMMAND_CUBIC:4,PATH_COMMAND_CLOSE:5},w3={MASK_TYPE_UNSPECIFIED:0,MASK_TYPE_LUMINANCE:1,MASK_TYPE_ALPHA:2};function O5(a,e,r){a===1&&e.icons.push(function(c,h){return function(m){if(m.usvg_tree.height||(m.usvg_tree.height=m.usvg_tree.width),!m.metadata)return m;const{metadata:g}=m;if(g.content_area){const{content_area:b}=g;b.top==null&&(b.top=b.left),b.width==null&&(b.width=m.usvg_tree.width),b.height==null&&(b.height=b.width)}return g.stretch_x&&g.stretch_x.length&&T3(g,"x"),g.stretch_y&&g.stretch_y.length&&T3(g,"y"),m}(c.readFields(z5,{name:void 0},h))}(r,r.readVarint()+r.pos))}function T3(a,e){const r=[],c=a[`stretch_${e}`];let h=null;for(let m=0;m<c.length;m++)h===null?h=r.length===0?c[0]:r[r.length-1][1]+c[m]:(r.push([h,h+c[m]]),h=null);a[`stretch_${e}_areas`]=r}function z5(a,e,r){a===1?e.name=r.readString():a===2?e.metadata=function(c,h){return c.readFields(F5,{stretch_x:null,stretch_y:null,stretch_x_areas:null,stretch_y_areas:null,variables:[]},h)}(r,r.readVarint()+r.pos):a===3&&(e.usvg_tree=function(c,h){return c.readFields(V5,{width:20,children:[],linear_gradients:[],radial_gradients:[],clip_paths:[],masks:[]},h)}(r,r.readVarint()+r.pos),e.data="usvg_tree")}function F5(a,e,r){a===1?e.stretch_x=r.readPackedVarint():a===2?e.stretch_y=r.readPackedVarint():a===3?e.content_area=function(c,h){return c.readFields(B5,{left:0},h)}(r,r.readVarint()+r.pos):a===4&&e.variables.push(function(c,h){return c.readFields(N5,{name:void 0},h)}(r,r.readVarint()+r.pos))}function B5(a,e,r){a===1?e.left=r.readVarint():a===2?e.width=r.readVarint():a===3?e.top=r.readVarint():a===4&&(e.height=r.readVarint())}function N5(a,e,r){a===1?e.name=r.readString():a===2&&(e.rgb_color=cv(r.readVarint()),e.value="rgb_color")}function V5(a,e,r){a===1?e.width=e.height=r.readVarint():a===2?e.height=r.readVarint():a===3?e.children.push(av(r,r.readVarint()+r.pos)):a===4?e.linear_gradients.push(function(c,h){return c.readFields(q5,{spread_method:1,stops:[],x1:0,y1:0,x2:1,y2:0},h)}(r,r.readVarint()+r.pos)):a===5?e.radial_gradients.push(function(c,h){return c.readFields(X5,{spread_method:1,stops:[],cx:.5,cy:.5,r:.5,fx:.5,fy:.5,fr:0},h)}(r,r.readVarint()+r.pos)):a===7?e.clip_paths.push(function(c,h){return c.readFields(Y5,{children:[]},h)}(r,r.readVarint()+r.pos)):a===8&&e.masks.push(function(c,h){const m=c.readFields(K5,{left:0,width:20,mask_type:w3.MASK_TYPE_LUMINANCE,children:[]},h);return m.height==null&&(m.height=m.width),m.top==null&&(m.top=m.left),m}(r,r.readVarint()+r.pos))}function av(a,e){return a.readFields($5,{},e)}function $5(a,e,r){a===1?(e.group=function(c,h){return c.readFields(j5,{opacity:255,children:[]},h)}(r,r.readVarint()+r.pos),e.node="group"):a===2&&(e.path=function(c,h){return c.readFields(H5,{paint_order:1,commands:[],step:1,diffs:[],rule:Nb.PATH_RULE_NON_ZERO},h)}(r,r.readVarint()+r.pos),e.node="path")}function j5(a,e,r){a===1?e.transform=lv(r,r.readVarint()+r.pos):a===2?e.opacity=r.readVarint():a===5?e.clip_path_idx=r.readVarint():a===6?e.mask_idx=r.readVarint():a===7&&e.children.push(av(r,r.readVarint()+r.pos))}function lv(a,e){return a.readFields(U5,{sx:1,ky:0,kx:0,sy:1,tx:0,ty:0},e)}function U5(a,e,r){a===1?e.sx=r.readFloat():a===2?e.ky=r.readFloat():a===3?e.kx=r.readFloat():a===4?e.sy=r.readFloat():a===5?e.tx=r.readFloat():a===6&&(e.ty=r.readFloat())}function H5(a,e,r){a===1?e.fill=function(c,h){return c.readFields(G5,{rgb_color:Bb,paint:"rgb_color",opacity:255},h)}(r,r.readVarint()+r.pos):a===2?e.stroke=function(c,h){return c.readFields(W5,{rgb_color:Bb,paint:"rgb_color",dasharray:[],dashoffset:0,miterlimit:4,opacity:255,width:1,linecap:1,linejoin:1},h)}(r,r.readVarint()+r.pos):a===3?e.paint_order=r.readVarint():a===5?r.readPackedVarint(e.commands):a===6?e.step=r.readFloat():a===7?r.readPackedSVarint(e.diffs):a===8&&(e.rule=r.readVarint())}function G5(a,e,r){a===1?(e.rgb_color=cv(r.readVarint()),e.paint="rgb_color"):a===2?(e.linear_gradient_idx=r.readVarint(),e.paint="linear_gradient_idx"):a===3?(e.radial_gradient_idx=r.readVarint(),e.paint="radial_gradient_idx"):a===5&&(e.opacity=r.readVarint())}function cv(a){return new Cn((a>>16&255)/255,(a>>8&255)/255,(255&a)/255,1)}function W5(a,e,r){a===1?(e.rgb_color=cv(r.readVarint()),e.paint="rgb_color"):a===2?(e.linear_gradient_idx=r.readVarint(),e.paint="linear_gradient_idx"):a===3?(e.radial_gradient_idx=r.readVarint(),e.paint="radial_gradient_idx"):a===5?r.readPackedFloat(e.dasharray):a===6?e.dashoffset=r.readFloat():a===7?e.miterlimit=r.readFloat():a===8?e.opacity=r.readVarint():a===9?e.width=r.readFloat():a===10?e.linecap=r.readVarint():a===11&&(e.linejoin=r.readVarint())}function q5(a,e,r){a===1?e.transform=lv(r,r.readVarint()+r.pos):a===2?e.spread_method=r.readVarint():a===3?e.stops.push(S3(r,r.readVarint()+r.pos)):a===4?e.x1=r.readFloat():a===5?e.y1=r.readFloat():a===6?e.x2=r.readFloat():a===7&&(e.y2=r.readFloat())}function S3(a,e){return a.readFields(Z5,{offset:0,opacity:255,rgb_color:Bb},e)}function Z5(a,e,r){a===1?e.offset=r.readFloat():a===2?e.opacity=r.readVarint():a===3&&(e.rgb_color=cv(r.readVarint()))}function X5(a,e,r){a===1?e.transform=lv(r,r.readVarint()+r.pos):a===2?e.spread_method=r.readVarint():a===3?e.stops.push(S3(r,r.readVarint()+r.pos)):a===4?e.cx=r.readFloat():a===5?e.cy=r.readFloat():a===6?e.r=r.readFloat():a===7?e.fx=r.readFloat():a===8?e.fy=r.readFloat():a===9&&(e.fr=r.readFloat())}function Y5(a,e,r){a===1?e.transform=lv(r,r.readVarint()+r.pos):a===2?e.clip_path_idx=r.readVarint():a===3&&e.children.push(av(r,r.readVarint()+r.pos))}function K5(a,e,r){a===1?e.left=e.top=r.readFloat():a===2?e.width=e.height=r.readFloat():a===3?e.top=r.readFloat():a===4?e.height=r.readFloat():a===5?e.mask_type=r.readVarint():a===6?e.mask_idx=r.readVarint():a===7&&e.children.push(av(r,r.readVarint()+r.pos))}class J5{static calculate(e={},r=[]){const c=new Map,h=new Map;if(Object.keys(e).length===0)return c;r.forEach(m=>{h.set(m.name,m.rgb_color||new Cn(0,0,0))});for(const[m,g]of Object.entries(e))h.has(m)?c.set(h.get(m).toStringPremultipliedAlpha(),g):console.warn(`Ignoring unknown image variable "${m}"`);return c}}function km(a,e=255,r){const c=e/255,h=a.toStringPremultipliedAlpha(),m=r.has(h
601)?r.get(h).clone():a.clone();return m.a*=c,m.toString()}function A_(a,e){if(!Iu()){const r=document.createElement("canvas");return r.width=a,r.height=e,r}return new OffscreenCanvas(a,e)}function Q5(a,e){const r=J5.calculate(e.params,a.metadata?a.metadata.variables:[]),c=a.usvg_tree,h=c.width,m=c.height,g=e.transform?e.transform:new DOMMatrix,b=Math.max(1,Math.round(h*g.a)),T=Math.max(1,Math.round(m*g.d)),E=new DOMMatrix([b/h,0,0,T/m,0,0]),I=A_(b,T).getContext("2d");return $b(I,E,c,c,r),I.getImageData(0,0,b,T)}function $b(a,e,r,c,h){for(const m of c.children)E3(a,e,r,m,h)}function E3(a,e,r,c,h){c.group?(a.save(),function(m,g,b,T,E){const I=T.mask_idx!=null?b.masks[T.mask_idx]:null,M=T.clip_path_idx!=null?b.clip_paths[T.clip_path_idx]:null;if(T.transform&&(g=uv(T.transform).preMultiplySelf(g)),!function(N,U,Y){return N.opacity!==255||U||Y}(T,M!=null,I!=null))return void $b(m,g,b,T,E);const k=A_(m.canvas.width,m.canvas.height),B=k.getContext("2d");$b(B,g,b,T,E),M&&k3(B,g,b,M),I&&L3(B,g,b,I,E),m.globalAlpha=T.opacity/255,m.drawImage(k,0,0)}(a,e,r,c.group,h),a.restore()):c.path&&(a.save(),function(m,g,b,T,E){const I=R3(T);m.setTransform(g),T.paint_order===R5.PAINT_ORDER_FILL_AND_STROKE?(A3(m,b,T,I,E),I3(m,b,T,I,E)):(I3(m,b,T,I,E),A3(m,b,T,I,E))}(a,e,r,c.path,h),a.restore())}function A3(a,e,r,c,h){const m=r.fill;if(!m)return;const g=m.opacity/255;switch(m.paint){case"rgb_color":a.fillStyle=km(m.rgb_color,m.opacity,h);break;case"linear_gradient_idx":a.fillStyle=M3(a,e.linear_gradients[m.linear_gradient_idx],g,h);break;case"radial_gradient_idx":a.fillStyle=P3(a,e.radial_gradients[m.radial_gradient_idx],g,h)}a.fill(c,C3(r))}function C3(a){return a.rule===Nb.PATH_RULE_NON_ZERO?"nonzero":a.rule===Nb.PATH_RULE_EVEN_ODD?"evenodd":void 0}function I3(a,e,r,c,h){const m=r.stroke;if(!m)return;a.lineWidth=m.width,a.miterLimit=m.miterlimit,a.setLineDash(m.dasharray),a.lineDashOffset=m.dashoffset;const g=m.opacity/255;switch(m.paint){case"rgb_color":a.strokeStyle=km(m.rgb_color,m.opacity,h);break;case"linear_gradient_idx":a.strokeStyle=M3(a,e.linear_gradients[m.linear_gradient_idx],g,h);break;case"radial_gradient_idx":a.strokeStyle=P3(a,e.radial_gradients[m.radial_gradient_idx],g,h)}switch(m.linejoin){case ov.LINE_JOIN_MITER_CLIP:case ov.LINE_JOIN_MITER:a.lineJoin="miter";break;case ov.LINE_JOIN_ROUND:a.lineJoin="round";break;case ov.LINE_JOIN_BEVEL:a.lineJoin="bevel"}switch(m.linecap){case Vb.LINE_CAP_BUTT:a.lineCap="butt";break;case Vb.LINE_CAP_ROUND:a.lineCap="round";break;case Vb.LINE_CAP_SQUARE:a.lineCap="square"}a.stroke(c)}function M3(a,e,r,c){if(e.stops.length===1){const k=e.stops[0];return km(k.rgb_color,k.opacity*r,c)}const h=uv(e.transform),{x1:m,y1:g,x2:b,y2:T}=e,E=h.transformPoint(new DOMPoint(m,g)),I=h.transformPoint(new DOMPoint(b,T)),M=a.createLinearGradient(E.x,E.y,I.x,I.y);for(const k of e.stops)M.addColorStop(k.offset,km(k.rgb_color,k.opacity*r,c));return M}function P3(a,e,r,c){if(e.stops.length===1){const k=e.stops[0];return km(k.rgb_color,k.opacity*r,c)}const h=uv(e.transform),{fx:m,fy:g,cx:b,cy:T}=e,E=h.transformPoint(new DOMPoint(m,g)),I=h.transformPoint(new DOMPoint(b,T)),M=a.createRadialGradient(E.x,E.y,0,I.x,I.y,e.r*((h.a+h.d)/2));for(const k of e.stops)M.addColorStop(k.offset,km(k.rgb_color,k.opacity*r,c));return M}function D3(a,e,r,c){const h=c.transform?uv(c.transform).preMultiplySelf(e):e,m=A_(a.canvas.width,a.canvas.height),g=m.getContext("2d");for(const T of c.children)if(T.group)D3(g,h,r,T.group);else if(T.path){const E=T.path,I=new Path2D;I.addPath(R3(E),h),g.fill(I,C3(E))}const b=c.clip_path_idx!=null?r.clip_paths[c.clip_path_idx]:null;b&&k3(g,h,r,b),a.globalCompositeOperation="source-over",a.drawImage(m,0,0)}function k3(a,e,r,c){const h=A_(a.canvas.width,a.canvas.height);D3(h.getContext("2d"),e,r,c),a.globalCompositeOperation="destination-in",a.drawImage(h,0,0)}function L3(a,e,r,c,h){if(c.children.length===0)return;const m=c.mask_idx!=null?r.masks[c.mask_idx]:null;m&&L3(a,e,r,m,h);const g=a.canvas.width,b=a.canvas.height,T=A_(g,b),E=T.getContext("2d"),I=c.width,M=c.height,k=c.left,B=c.top,N=new Path2D,U=new Path2D;U.rect(k,B,I,M),N.addPath(U,e),E.clip(N);for(const ae of c.children)E3(E,e,r,ae,h);const Y=E.getImageData(0,0,g,b),J=Y.data;if(c.mask_type===w3.MASK_TYPE_LUMINANCE)for(let ae=0;ae<J.length;ae+=4)J[ae+3]=J[ae+3]/255*(.2126*J[ae]+.7152*J[ae+1]+.0722*J[ae+2]);E.putImageData(Y,0,0),a.globalCompositeOperation="destination-in",a.drawImage(T,0,0)}function uv(a){return a?new DOMMatrix([a.sx,a.ky,a.kx,a.sy,a.tx,a.ty]):new DOMMatrix}function R3(a){const e=new Path2D,r=a.step;let c=a.diffs[0]*r,h=a.diffs[1]*r;e.moveTo(c,h);for(let m=0,g=2;m<a.commands.length;m++)switch(a.commands[m]){case E_.PATH_COMMAND_MOVE:c+=a.diffs[g++]*r,h+=a.diffs[g++]*r,e.moveTo(c,h);break;case E_.PATH_COMMAND_LINE:c+=a.diffs[g++]*r,h+=a.diffs[g++]*r,e.lineTo(c,h);break;case E_.PATH_COMMAND_QUAD:{const b=c+a.diffs[g++]*r,T=h+a.diffs[g++]*r;c=b+a.diffs[g++]*r,h=T+a.diffs[g++]*r,e.quadraticCurveTo(b,T,c,h);break}case E_.PATH_COMMAND_CUBIC:{const b=c+a.diffs[g++]*r,T=h+a.diffs[g++]*r,E=b+a.diffs[g++]*r,I=T+a.diffs[g++]*r;c=E+a.diffs[g++]*r,h=I+a.diffs[g++]*r,e.bezierCurveTo(b,T,E,I,c,h);break}case E_.PATH_COMMAND_CLOSE:e.closePath()}return e}class hv{constructor(e){this.capacity=e,this.cache=new Map}get(e){if(!this.cache.has(e))return;const r=this.cache.get(e);return this.cache.delete(e),this.cache.set(e,r),r}put(e,r){this.cache.has(e)?this.cache.delete(e):this.cache.size===this.capacity&&this.cache.delete(this.cache.keys().next().value),this.cache.set(e,r)}delete(e){this.cache.delete(e)}}Vt(hv,"LRUCache");class jb{constructor(){this.cacheMap=new Map,this.cacheDependenciesMap=new Map}static _getImage(e){return new xo(e,e.data)}getFromCache(e,r,c){return this.cacheMap.has(c)||this.cacheMap.set(c,new hv(150)),this.cacheMap.get(c).get(th(e.toString(),r))}setInCache(e,r,c,h){this.cacheDependenciesMap.has(h)||this.cacheDependenciesMap.set(h,new Map),this.cacheMap.has(h)||this.cacheMap.set(h,new hv(150));const m=this.cacheDependenciesMap.get(h),g=th(e.id.toString(),c);m.get(g)||m.set(g,new Set);const b=this.cacheMap.get(h),T=e.toString();m.get(g).add(T),b.put(th(e.toString(),c),r)}removeImagesFromCacheByIds(e,r,c=0){if(!this.cacheMap.has(c)||!this.cacheDependenciesMap.has(c))return;const h=this.cacheMap.get(c),m=this.cacheDependenciesMap.get(c);for(const g of e){const b=th(g.toString(),r);if(m.has(b)){for(const T of m.get(b))h.delete(T);m.delete(b)}}}rasterize(e,r,c,h,m=Q5){const g=this.getFromCache(e,c,h);if(g)return g.clone();const b=m(r.icon,e.options),T=jb._getImage(b);return this.setInCache(e,T,c,h),T.clone()}}class O3{constructor(e){this.size=e,this.minimums=[],this.maximums=[],this.leaves=[]}getElevation(e,r){const c=this.toIdx(e,r);return{min:this.minimums[c],max:this.maximums[c]}}isLeaf(e,r){return this.leaves[this.toIdx(e,r)]}toIdx(e,r){return r*this.size+e}}function z3(a,e,r,c){let h=0,m=Number.MAX_VALUE;for(let g=0;g<3;g++)if(Math.abs(c[g])<1e-15){if(r[g]<a[g]||r[g]>e[g])return null}else{const b=1/c[g];let T=(a[g]-r[g])*b,E=(e[g]-r[g])*b;if(T>E){const I=T;T=E,E=I}if(T>h&&(h=T),E<m&&(m=E),h>m)return null}return h}function F3(a,e,r,c,h,m,g,b,T,E,I){const M=c-a,k=h-e,B=m-r,N=g-a,U=b-e,Y=T-r,J=I[1]*Y-I[2]*U,ae=I[2]*N-I[0]*Y,ne=I[0]*U-I[1]*N,G=M*J+k*ae+B*ne;if(Math.abs(G)<1e-15)return null;const te=1/G,oe=E[0]-a,he=E[1]-e,Te=E[2]-r,Me=(oe*J+he*ae+Te*ne)*te;if(Me<0||Me>1)return null;const Pe=he*B-Te*k,ze=Te*M-oe*B,tt=oe*k-he*M,mt=(I[0]*Pe+I[1]*ze+I[2]*tt)*te;return mt<0||Me+mt>1?null:(N*Pe+U*ze+Y*tt)*te}function B3(a,e,r){return(a-e)/(r-e)}
vendor: 3,185 bytes, line 601
601function N3(a,e,r,c,h,m,g,b,T){const E=1<<r,I=m-c,M=g-h,k=(a+1)/E*I+c,B=(e+0)/E*M+h,N=(e+1)/E*M+h;b[0]=(a+0)/E*I+c,b[1]=B,T[0]=k,T[1]=N}class V3{constructor(e){if(this.maximums=[],this.minimums=[],this.leaves=[],this.childOffsets=[],this.nodeCount=0,this.dem=e,this._siblingOffset=[[0,0],[1,0],[0,1],[1,1]],!this.dem)return;const r=function(m){const g=Math.ceil(Math.log2(m.dim/8)),b=[];let T=Math.ceil(Math.pow(2,g));const E=1/T,I=(B,N,U,Y,J)=>{const ae=Y?1:0,ne=(B+1)*U-ae,G=N*U,te=(N+1)*U-ae;J[0]=B*U,J[1]=G,J[2]=ne,J[3]=te};let M=new O3(T);const k=[];for(let B=0;B<T*T;B++){I(B%T,Math.floor(B/T),E,!1,k);const N=Id(k[0],k[1],m),U=Id(k[2],k[1],m),Y=Id(k[2],k[3],m),J=Id(k[0],k[3],m);M.minimums.push(Math.min(N,U,Y,J)),M.maximums.push(Math.max(N,U,Y,J)),M.leaves.push(1)}for(b.push(M),T/=2;T>=1;T/=2){const B=b[b.length-1];M=new O3(T);for(let N=0;N<T*T;N++){I(N%T,Math.floor(N/T),2,!0,k);const U=B.getElevation(k[0],k[1]),Y=B.getElevation(k[2],k[1]),J=B.getElevation(k[2],k[3]),ae=B.getElevation(k[0],k[3]),ne=B.isLeaf(k[0],k[1]),G=B.isLeaf(k[2],k[1]),te=B.isLeaf(k[2],k[3]),oe=B.isLeaf(k[0],k[3]),he=Math.min(U.min,Y.min,J.min,ae.min),Te=Math.max(U.max,Y.max,J.max,ae.max),Me=ne&&G&&te&&oe;M.maximums.push(Te),M.minimums.push(he),M.leaves.push(Te-he<=5&&Me?1:0)}b.push(M)}return b}(this.dem),c=r.length-1,h=r[c];this._addNode(h.minimums[0],h.maximums[0],h.leaves[0]),this._construct(r,0,0,c,0)}raycastRoot(e,r,c,h,m,g,b=1){return z3([e,r,-100],[c,h,this.maximums[0]*b],m,g)}raycast(e,r,c,h,m,g,b=1){if(!this.nodeCount)return null;const T=this.raycastRoot(e,r,c,h,m,g,b);if(T==null)return null;const E=[],I=[],M=[],k=[],B=[{idx:0,t:T,nodex:0,nodey:0,depth:0}];for(;B.length>0;){const{idx:N,t:U,nodex:Y,nodey:J,depth:ae}=B.pop();if(this.leaves[N]){N3(Y,J,ae,e,r,c,h,M,k);const G=1<<ae,te=(Y+0)/G,oe=(Y+1)/G,he=(J+0)/G,Te=(J+1)/G,Me=Id(te,he,this.dem)*b,Pe=Id(oe,he,this.dem)*b,ze=Id(oe,Te,this.dem)*b,tt=Id(te,Te,this.dem)*b,mt=F3(M[0],M[1],Me,k[0],M[1],Pe,k[0],k[1],ze,m,g),ut=F3(k[0],k[1],ze,M[0],k[1],tt,M[0],M[1],Me,m,g),pt=Math.min(mt!==null?mt:Number.MAX_VALUE,ut!==null?ut:Number.MAX_VALUE);if(pt!==Number.MAX_VALUE)return pt;{const bt=Yn([],m,g,U);if($3(Me,Pe,tt,ze,B3(bt[0],M[0],k[0]),B3(bt[1],M[1],k[1]))>=bt[2])return U}continue}let ne=0;for(let G=0;G<this._siblingOffset.length;G++){N3((Y<<1)+this._siblingOffset[G][0],(J<<1)+this._siblingOffset[G][1],ae+1,e,r,c,h,M,k),M[2]=-100,k[2]=this.maximums[this.childOffsets[N]+G]*b;const te=z3(M,k,m,g);if(te!=null){const oe=te;E[G]=oe;let he=!1;for(let Te=0;Te<ne&&!he;Te++)oe>=E[I[Te]]&&(I.splice(Te,0,G),he=!0);he||(I[ne]=G),ne++}}for(let G=0;G<ne;G++){const te=I[G];B.push({idx:this.childOffsets[N]+te,t:E[te],nodex:(Y<<1)+this._siblingOffset[te][0],nodey:(J<<1)+this._siblingOffset[te][1],depth:ae+1})}}return null}_addNode(e,r,c){return this.minimums.push(e),this.maximums.push(r),this.leaves.push(c),this.childOffsets.push(0),this.nodeCount++}_construct(e,r,c,h,m){if(e[h].isLeaf(r,c)===1)return;this.childOffsets[m]||(this.childOffsets[m]=this.nodeCount);const g=h-1,b=e[g];let T=0,E=0;for(let I=0;I<this._siblingOffset.length;I++){const M=2*r+this._siblingOffset[I][0],k=2*c+this._siblingOffset[I][1],B=b.getElevation(M,
vendor: 6,231 bytes, line 601
601k),N=b.isLeaf(M,k),U=this._addNode(B.min,B.max,N);N&&(T|=1<<I),E||(E=U)}for(let I=0;I<this._siblingOffset.length;I++)T&1<<I||this._construct(e,2*r+this._siblingOffset[I][0],2*c+this._siblingOffset[I][1],g,E+I)}}function $3(a,e,r,c,h,m){return gi(gi(a,r,m),gi(e,c,m),h)}function Id(a,e,r){const c=r.dim,h=ke(a*c-.5,0,c-1),m=ke(e*c-.5,0,c-1),g=Math.floor(h),b=Math.floor(m),T=Math.min(g+1,c-1),E=Math.min(b+1,c-1);return $3(r.get(g,b),r.get(T,b),r.get(g,E),r.get(T,E),h-g,m-b)}const ez={mapbox:[6553.6,25.6,.1,1e4],terrarium:[256,1,1/256,32768]};function tz(a,e,r){return(256*a*256+256*e+r)/10-1e4}function iz(a,e,r){return 256*a+e+r/256-32768}class dv{get tree(){return this._tree||this._buildQuadTree(),this._tree}constructor(e,r,c,h=!1){if(this.uid=e,r.height!==r.width)throw new RangeError("DEM tiles must be square");if(c&&c!=="mapbox"&&c!=="terrarium")return void Yi(`"${c}" is not a valid encoding type. Valid types include "mapbox" and "terrarium".`);this.stride=r.height;const m=this.dim=r.height-2,g=new Uint32Array(r.data.buffer);if(this.pixels=new Uint8Array(r.data.buffer),this.floatView=new Float32Array(r.data.buffer),this.borderReady=h,this._modifiedForSources={},!h){for(let T=0;T<m;T++)g[this._idx(-1,T)]=g[this._idx(0,T)],g[this._idx(m,T)]=g[this._idx(m-1,T)],g[this._idx(T,-1)]=g[this._idx(T,0)],g[this._idx(T,m)]=g[this._idx(T,m-1)];g[this._idx(-1,-1)]=g[this._idx(0,0)],g[this._idx(m,-1)]=g[this._idx(m-1,0)],g[this._idx(-1,m)]=g[this._idx(0,m-1)],g[this._idx(m,m)]=g[this._idx(m-1,m-1)]}const b=c==="terrarium"?iz:tz;for(let T=0;T<g.length;++T){const E=4*T;this.floatView[T]=b(this.pixels[E],this.pixels[E+1],this.pixels[E+2])}this._timestamp=jo.now()}_buildQuadTree(){this._tree=new V3(this)}get(e,r,c=!1){c&&(e=ke(e,-1,this.dim),r=ke(r,-1,this.dim));const h=this._idx(e,r);return this.floatView[h]}set(e,r,c){const h=this._idx(e,r),m=this.floatView[h];return this.floatView[h]=c,c-m}static getUnpackVector(e){return ez[e]}_idx(e,r){if(e<-1||e>=this.dim+1||r<-1||r>=this.dim+1)throw new RangeError("out of range source coordinates for DEM data");return(r+1)*this.stride+(e+1)}static pack(e,r){const c=[0,0,0,0],h=dv.getUnpackVector(r);let m=Math.floor((e+h[3])/h[2]);return c[2]=m%256,m=Math.floor(m/256),c[1]=m%256,m=Math.floor(m/256),c[0]=m,c}getPixels(){return new US({width:this.stride,height:this.stride},this.pixels)}backfillBorder(e,r,c){if(this.dim!==e.dim)throw new Error("dem dimension mismatch");let h=r*this.dim,m=r*this.dim+this.dim,g=c*this.dim,b=c*this.dim+this.dim;switch(r){case-1:h=m-1;break;case 1:m=h+1}switch(c){case-1:g=b-1;break;case 1:b=g+1}const T=-r*this.dim,E=-c*this.dim;for(let I=g;I<b;I++)for(let M=h;M<m;M++){const k=4*this._idx(M,I),B=4*this._idx(M+T,I+E);this.pixels[k+0]=e.pixels[B+0],this.pixels[k+1]=e.pixels[B+1],this.pixels[k+2]=e.pixels[B+2],this.pixels[k+3]=e.pixels[B+3]}}onDeserialize(){this._tree&&(this._tree.dem=this)}}function nz(a,e,r){a===1?e.headerLength=r.readFixed32():a===2?e.x=r.readVarint():a===3?e.y=r.readVarint():a===4?e.z=r.readVarint():a===5&&e.layers.push(function(c,h){return c.readFields(lz,{version:0,name:"",units:"",tileSize:0,buffer:0,pixelFormat:0,dataIndex:[]},h)}(r,r.readVarint()+r.pos))}function sz(a,e,r){a===1?(e.delta_filter=function(c,h){return c.readFields(rz,{blockSize:0},h)}(r,r.readVarint()+r.pos),e.filter="delta_filter"):a===2?(r.readVarint(),e.filter="zigzag_filter"):a===3?(r.readVarint(),e.filter="bitshuffle_filter"):a===4&&(r.readVarint(),e.filter="byteshuffle_filter")}function rz(a,e,r){a===1&&(e.blockSize=r.readVarint())}function oz(a,e,r){a===1?(r.readVarint(),e.codec="gzip_data"):a===2?(r.readVarint(),e.codec="jpeg_image"):a===3?(r.readVarint(),e.codec="webp_image"):a===4&&(r.readVarint(),e.codec="png_image")}function az(a,e,r){let c=0,h=0;a===1?e.firstByte=r.readFixed64():a===2?e.lastByte=r.readFixed64():a===3?e.filters.push(function(m,g){return m.readFields(sz,{},g)}(r,r.readVarint()+r.pos)):a===4?e.codec=function(m,g){return m.readFields(oz,{},g)}(r,r.readVarint()+r.pos):a===5?h=r.readFloat():a===6?c=r.readFloat():a===7?e.bands.push(r.readString()):a===8?e.offset=r.readDouble():a===9&&(e.scale=r.readDouble()),e.offset===0&&(e.offset=h),e.scale===0&&(e.scale=c)}function lz(a,e,r){a===1?e.version=r.readVarint():a===2?e.name=r.readString():a===3?e.units=r.readString():a===4?e.tileSize=r.readVarint():a===5?e.buffer=r.readVarint():a===6?e.pixelFormat=r.readVarint():a===7&&e.dataIndex.push(function(c,h){return c.readFields(az,{firstByte:0,lastByte:0,filters:[],codec:null,offset:0,scale:0,bands:[]},h)}(r,r.readVarint()+r.pos))}function cz(a,e,r){if(a===2)(function(c,h,m){c.readFields(uz,m,h)})(r,r.readVarint()+r.pos,e);else if(a===3)throw new Error("Not implemented")}function uz(a,e,r){if(a===1){let c=0;const h=r.readVarint()+r.pos;for(;r.pos<h;)e[c++]=r.readVarint()}}function hz(a,e){if(e.length!==4)throw new Error(`Expected data of dimension 4 but got ${e.length}.`);let r=e[3];for(let c=2;c>=1;c--){const h=c===1?1:0,m=c===2?1:0;for(let g=0;g<e[0];g++){const b=e[1]*g;for(let T=h;T<e[1];T++){const E=e[2]*(T+b);for(let I=m;I<e[2];I++){const M=e[3]*(I+E);for(let k=0;k<e[3];k++){const B=M+k;a[B]+=a[B-r]}}}}r*=e[c]}return a}function dz(a){for(let e=0,r=a.length;e<r;e++)a[e]=a[e]>>>1^-(1&a[e]);return a}function fz(a,e){switch(e){case"uint32":return a;case"uint16":for(let r=0;r<a.length;r+=2){const c=a[r],h=a[r+1];a[r]=(240&c)>>4|(61440&c)>>8|(240&h)<<4|61440&h,a[r+1]=15&c|(3840&c)>>4|(15&h)<<8|(3840&h)<<4}return a;case"uint8":for(let r=0;r<a.length;r+=4){const c=a[r],h=a[r+1],m=a[r+2],g=a[r+3];a[r+0]=(192&c)>>6|(192&h)>>4|(192&m)>>2|192&g,a[r+1]=(48&c)>>4|(48&h)>>2|48&m|(48&g)<<2,a[r+2]=(12&c)>>2|12&h|(12&m)<<2|(12&g)<<4,a[r+3]=3&c|(3&h)<<2|(3&m)<<4|(3&g)<<6}return a;default:throw new Error(`Invalid pixel format, "${e}"`)}}Vt(dv,"DEMData"),Vt(V3,"DemMinMaxQuadTree",{omit:["dem"]});var ml=Uint8Array,C_=Uint16Array,pz=Int32Array,j3=new ml([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),U3=new ml([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),mz=new ml([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),H3=function(a,e){for(var r=new C_(31),c=0;c<31;++c)r[c]=e+=1<<a[c-1];var h=new pz(r[30]);for(c=1;c<30;++c)for(var m=r[c];m<r[c+1];
vendor: 1,037 bytes, line 601
601++m)h[m]=m-r[c]<<5|c;return{b:r,r:h}},G3=H3(j3,2),W3=G3.b,gz=G3.r;W3[28]=258,gz[258]=28;for(var _z=H3(U3,0).b,q3=new C_(32768),Er=0;Er<32768;++Er){var Lm=(43690&Er)>>1|(21845&Er)<<1;q3[Er]=((65280&(Lm=(61680&(Lm=(52428&Lm)>>2|(13107&Lm)<<2))>>4|(3855&Lm)<<4))>>8|(255&Lm)<<8)>>1}var I_=function(a,e,r){for(var c=a.length,h=0,m=new C_(e);h<c;++h)a[h]&&++m[a[h]-1];var g,b=new C_(e);for(h=1;h<e;++h)b[h]=b[h-1]+m[h-1]<<1;g=new C_(1<<e);var T=15-e;for(h=0;h<c;++h)if(a[h])for(var E=h<<4|a[h],I=e-a[h],M=b[a[h]-1]++<<I,k=M|(1<<I)-1;M<=k;++M)g[q3[M]>>T]=E;return g},M_=new ml(288);for(Er=0;Er<144;++Er)M_[Er]=8;for(Er=144;Er<256;++Er)M_[Er]=9;for(Er=256;Er<280;++Er)M_[Er]=7;for(Er=280;Er<288;++Er)M_[Er]=8;var Z3=new ml(32);for(Er=0;Er<32;++Er)Z3[Er]=5;var yz=I_(M_,9),vz=I_(Z3,5),Ub=function(a){for(var e=a[0],r=1;r<a.length;++r)a[r]>e&&(e=a[r]);return e},Pc=function(a,e,r){var c=e/8|0;return(a[c]|a[c+1]<<8)>>(7&e)&r},Hb=function(a,e){var r=e/8|0;return(a[r]|a[r+1]<<8|a[r+2]<<16)>>(7&e)},xz=["unexpected EOF","invalid block type","invali
601d length/literal","invalid distance","stream finished","no stream handler",,"no callback","invalid UTF-8 data","extra field too long","date not in range 1980-2099","filename too long","stream finishing","invalid zip data"],Dc=function(a,e,r){var c=new Error(e||xz[a]);if(c.code=a,Error.captureStackTrace&&Error.captureStackTrace(c,Dc),!r)throw c;return c},bz=new ml(0),wz=typeof TextDecoder<"u"&&new TextDecoder;try{wz.decode(bz,{stream:!0})}catch{}const Tz={gzip_data:"gzip"};class Xl extends Error{constructor(e){super(e),this.name="MRTError"}}const Sz={0:"uint32",1:"uint32",2:"uint16",3:"uint8"},X3={uint32:1,uint16:2,uint8:4},Ez={uint32:Uint32Array,uint16:Uint16Array,uint8:Uint8Array};let Gb;class fv{constructor(e=5){this.x=NaN,this.y=NaN,this.z=NaN,this.layers={},this._cacheSize=e}getLayer(e){const r=this.layers[e];if(!r)throw new Xl(`Layer '${e}' not found`);return r}getHeaderLength(e){const r=new Uint8Array(e),c=new DataView(e);if(r[0]!==13)throw new Xl("File is not a valid MRT.");return c.getUint32(1,!0)}parseHeader(e){const r=new Uint8Array(e),c=this.getHeaderLength(e);if(r.length<c)throw new Xl(`Expected header with length >= ${c} but got buffer of length ${r.length}`);const h=function(m,g){return m.readFields(nz,{headerLength:0,x:0,y:0,z:0,layers:[]},void 0)}(new Gb(r.subarray(0,c)));if(!isNaN(this.x)&&(this.x!==h.x||this.y!==h.y||this.z!==h.z))throw new Xl(`Invalid attempt to parse header ${h.z}/${h.x}/${h.y} for tile ${this.z}/${this.x}/${this.y}`);this.x=h.x,this.y=h.y,this.z=h.z;for(const m of h.layers)this.layers[m.name]=new Y3(m,{cacheSize:this._cacheSize});return this}createDecodingTask(e){const r=[],c=this.getLayer(e.layerName);for(let h of e.blockIndices){const m=c.dataIndex[h],g=m.firstByte-e.firstByte,b=m.lastByte-e.firstByte;if(c._blocksInProgress.has(h))continue;const T={layerName:c.name,firstByte:g,lastByte:b,pixelFormat:c.pixelFormat,blockIndex:h,blockShape:[m.bands.length].concat(c.bandShape),buffer:c.buffer,codec:m.codec.codec,filters:m.filters.map(E=>E.filter)};c._blocksInProgress.add(h),r.push(T)}return new K3(r,()=>{r.forEach(h=>c._blocksInProgress.delete(h.blockIndex))},(h,m)=>{if(r.forEach(g=>c._blocksInProgress.delete(g.blockIndex)),h)throw h;m.forEach(g=>{this.getLayer(g.layerName).processDecodedData(g)})})}}class Y3{constructor({version:e,name:r,units:c,tileSize:h,pixelFormat:m,buffer:g,dataIndex:b},T){if(this.version=e,this.version!==1)throw new Xl(`Cannot parse raster layer encoded with MRT version ${e}`);this.name=r,this.units=c,this.tileSize=h,this.buffer=g,this.pixelFormat=Sz[m],this.dataIndex=b,this.bandShape=[h+2*g,h+2*g,X3[this.pixelFormat]],this._decodedBlocks=new hv(T?T.cacheSize:5),this._blocksInProgress=new Set}get dimension(){return X3[this.pixelFormat]}get cacheSize(){return this._decodedBlocks.capacity}getBandList(){return this.dataIndex.map(({bands:e})=>e).flat()}processDecodedData(e){const r=e.blockIndex.toString();this._decodedBlocks.get(r)||this._decodedBlocks.put(r,e.data)}getBlockForBand(e){let r=0;switch(typeof e){case"string":for(const[c,h]of this.dataIndex.entries()){for(const[m,g]of h.bands.entries())if(g===e)return{bandIndex:r+m,blockIndex:c,blockBandIndex:m};r+=h.bands.length}break;case"number":for(const[c,h]of this.dataIndex.entries()){if(e>=r&&e<r+h.bands.length)return{bandIndex:e,blockIndex:c,blockBandIndex:e-r};r+=h.bands.length}break;default:throw new Xl(`Invalid band \`${JSON.stringify(e)}\`. Expected string or integer.`)}return{blockIndex:-1,blockBandIndex:-1}}getDataRange(e){let r=1/0,c=-1/0;const h=[],m=new Set;for(const g of e){const{blockIndex:b}=this.getBlockForBand(g);if(b<0)throw new Xl(`Invalid band: ${JSON.stringify(g)}`);const T=this.dataIndex[b];h.includes(b)||h.push(b),m.add(b),r=Math.min(r,T.firstByte),c=Math.max(c,T.lastByte)}if(m.size>this.cacheSize)throw new Xl(`Number of blocks to decode (${m.size}) exceeds cache size (${this.cacheSize}).`);return{layerName:this.name,firstByte:r,lastByte:c,blockIndices:h}}hasBand(e){const{blockIndex:r}=this.getBlockForBand(e);return r>=0}hasDataForBand(e){const{blockIndex:r}=this.getBlockForBand(e);return r>=0&&!!this._decodedBlocks.get(r.toString())}getBandView(e){const{blockIndex:r,blockBandIndex:c}=this.getBlockForBand(e);if(r<0)throw new Xl(`Band not found: ${JSON.stringify(e)}`);const h=this._decodedBlocks.get(r.toString());if(!h)throw new Xl(`Data for band ${JSON.stringify(e)} of layer "${this.name}" not decoded.`);const m=this.dataIndex[r],g=this.bandShape.reduce((E,I)=>E*I,1),b=c*g,T=h.subarray(b,b+g);return{data:T,bytes:new Uint8Array(T.buffer).subarray(T.byteOffset,T.byteOffset+T.byteLength),tileSize:this.tileSize,buffer:this.buffer,pixelFormat:this.pixelFormat,dimension:this.dimension,offset:m.offset,scale:m.scale}}}
601fv.setPbf=function(a){Gb=a};class K3{constructor(e,r,c){this.tasks=e,this._onCancel=r,this._onComplete=c,this._finalized=!1}cancel(){this._finalized||(this._onCancel(),this._finalized=!0)}complete(e,r){this._finalized||(this._onComplete(e,r),this._finalized=!0)}}fv.performDecoding=function(a,e){const r=new Uint8Array(a);return Promise.all(e.tasks.map(c=>{const{layerName:h,firstByte:m,lastByte:g,pixelFormat:b,blockShape:T,blockIndex:E,filters:I,codec:M}=c,k=r.subarray(m,g+1),B=new Uint32Array(T[0]*T[1]*T[2]);let N;if(M!=="gzip_data")throw new Xl(`Unhandled codec: ${M}`);return N=function(U,Y){if(!globalThis.DecompressionStream&&Y==="gzip_data")return Promise.resolve(((G=function(he){he[0]==31&&he[1]==139&&he[2]==8||Dc(6,"invalid gzip data");var Te=he[3],Me=10;4&Te&&(Me+=2+(he[10]|he[11]<<8));for(var Pe=(Te>>3&1)+(Te>>4&1);Pe>0;Pe-=!he[Me++]);return Me+(2&Te)}(ne=U))+8>ne.length&&Dc(6,"invalid gzip data"),function(he,Te,Me,Pe){var ze=he.length;if(!ze||Te.f&&!Te.l)return Me||new ml(0);var tt=!Me,mt=tt||Te.i!=2,ut=Te.i;tt&&(Me=new ml(3*ze));var pt,bt,Ye=function(Js){var ws=Me.length;if(Js>ws){var fs=new ml(Math.max(2*ws,Js));fs.set(Me),Me=fs}},ft=Te.f||0,qe=Te.p||0,et=Te.b||0,Tt=Te.l,St=Te.d,li=Te.m,Jt=Te.n,Bt=8*ze;do{if(!Tt){ft=Pc(he,qe,1);var wt=Pc(he,qe+1,3);if(qe+=3,!wt){var Ni=he[(le=4+((qe+7)/8|0))-4]|he[le-3]<<8,si=le+Ni;if(si>ze){ut&&Dc(0);break}mt&&Ye(et+Ni),Me.set(he.subarray(le,si),et),Te.b=et+=Ni,Te.p=qe=8*si,Te.f=ft;continue}if(wt==1)Tt=yz,St=vz,li=9,Jt=5;else if(wt==2){var ri=Pc(he,qe,31)+257,Oi=Pc(he,qe+10,15)+4,Xi=ri+Pc(he,qe+5,31)+1;qe+=14;for(var Ji=new ml(Xi),ln=new ml(19),rn=0;rn<Oi;++rn)ln[mz[rn]]=Pc(he,qe+3*rn,7);qe+=3*Oi;var nn=Ub(ln),as=(1<<nn)-1,ys=I_(ln,nn);for(rn=0;rn<Xi;){var le,de=ys[Pc(he,qe,as)];if(qe+=15&de,(le=de>>4)<16)Ji[rn++]=le;else{var nt=0,Pt=0;for(le==16?(Pt=3+Pc(he,qe,3),qe+=2,nt=Ji[rn-1]):le==17?(Pt=3+Pc(he,qe,7),qe+=3):le==18&&(Pt=11+Pc(he,qe,127),qe+=7);Pt--;)Ji[rn++]=nt}}var jt=Ji.subarray(0,ri),Nt=Ji.subarray(ri);li=Ub(jt),Jt=Ub(Nt),Tt=I_(jt,li),St=I_(Nt,Jt)}else Dc(1);if(qe>Bt){ut&&Dc(0);break}}mt&&Ye(et+131072);for(var oi=(1<<li)-1,Ai=(1<<Jt)-1,pn=qe;;pn=qe){var mn=(nt=Tt[Hb(he,qe)&oi])>>4;if((qe+=15&nt)>Bt){ut&&Dc(0);break}if(nt||Dc(2),mn<256)Me[et++]=mn;else{if(mn==256){pn=qe,Tt=null;break}var sn=mn-254;mn>264&&(sn=Pc(he,qe,(1<<(gn=j3[rn=mn-257]))-1)+W3[rn],qe+=gn);var Xn=St[Hb(he,qe)&Ai],ds=Xn>>4;if(Xn||Dc(3),qe+=15&Xn,Nt=_z[ds],ds>3){var gn=U3[ds];Nt+=Hb(he,qe)&(1<<gn)-1,qe+=gn}if(qe>Bt){ut&&Dc(0);break}mt&&Ye(et+131072);var $s=et+sn;if(et<Nt){var vs=0-Nt,Wn=Math.min(Nt,$s);for(vs+et<0&&Dc(3);et<Wn;++et)Me[et]=(void 0)[vs+et]}for(;et<$s;++et)Me[et]=Me[et-Nt]}}Te.l=Tt,Te.p=pn,Te.b=et,Te.f=ft,Tt&&(ft=1,Te.m=li,Te.d=St,Te.n=Jt)}while(!ft);return et!=Me.length&&tt?(pt=Me,((bt=et)==null||bt>pt.length)&&(bt=pt.length),new ml(pt.subarray(0,bt))):Me.subarray(0,et)}(ne.subarray(G,-8),{i:2},new ml(((J=ne)[(ae=J.length)-4]|J[ae-3]<<8|J[ae-2]<<16|J[ae-1]<<24)>>>0))));var J,ae,ne,G;const te=Tz[Y];if(!te)throw new Error(`Unhandled codec: ${Y}`);const oe=new globalThis.DecompressionStream(te);return new Response(new Blob([U]).stream().pipeThrough(oe)).arrayBuffer().then(he=>new Uint8Array(he))}(k,M).then(U=>(function(Y,J){Y.readFields(cz,J)}(new Gb(U),B),new Ez[b](B.buffer))),N.then(U=>{for(let Y=I.length-1;Y>=0;Y--)switch(I[Y]){case"delta_filter":hz(U,T);break;case"zigzag_filter":dz(U);break;case"bitshuffle_filter":fz(U,b);break;default:throw new Xl(`Unhandled filter "${I[Y]}"`)}return{layerName:h,blockIndex:E,data:U}}).catch(U=>{throw U})}))},Vt(K3,"MRTDecodingBatch",{omit:["_onCancel","_onComplete"]}),Vt(fv,"MapboxRasterTile"),Vt(Y3,"MapboxRasterLayer",{omit:["_blocksInProgress"]});let P_,Wb,kc,Rm,qb,Om=null;function J3(){return Gn(self)&&self.worker.dracoUrl?self.worker.dracoUrl:Wb||Fr.DRACO_URL}function Q3(){if(Gn(self)&&self.worker.meshoptUrl)return self.worker.meshoptUrl;if(Rm)return Rm;const a=new Uint8Array([0,97,115,109,1,0,0,0,1,4,1,96,0,0,3,3,2,0,0,5,3,1,0,1,12,1,0,10,22,2,12,0,65,0,65,0,65,0,252,10,0,0,11,7,0,65,0,253,15,26,11]);if(typeof WebAssembly!="object")throw new Error("WebAssembly not supported, cannot instantiate meshoptimizer");return Rm=WebAssembly.validate(a)?Fr.MESHOPT_SIMD_URL:Fr.MESHOPT_URL,Rm}const pv={5120:Int8Array,5121:Uint8Array,5122:Int16Array,5123:Uint16Array,5125:Uint32Array,5126:Float32Array},Az={5120:"DT_INT8",5121:"DT_UINT8",5122:"DT_INT16",5123:"DT_UINT16",5125:"DT_UINT32",5126:"DT_FLOAT32"},D_={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16};function eC(a,e,r){const c=r.json.bufferViews.length,h=r.buffers.length;e.bufferView=c,r.json.bufferViews[c]={buffer:h,byteLength:a.byteLength},r.buffers[h]=a}const Zb="KHR_draco_mesh_compression";function Cz(a,e){const r=a.extensions&&a.extensions[Zb];if(!r)return;const c=new kc.Decoder,h=sC(e,r.bufferView),m=new kc.Mesh;if(!c.DecodeArrayToMesh(h,h.byteLength,m))throw new Error("Failed to decode Draco mesh");const g=e.json.accessors[a.indices],b=pv[g.componentType],T=g.count*b.BYTES_PER_ELEMENT,E=kc._malloc(T);b===Uint16Array?c.GetTrianglesUInt16Array(m,T,E):c.GetTrianglesUInt32Array(m,T,E),eC(kc.memory.buffer.slice(E,E+T),g,e),kc._free(E);for(const I of Object.keys(r.attributes)){const M=c.GetAttributeByUniqueId(m,r.attributes[I]),k=e.json.accessors[a.attributes[I]],B=Az[k.componentType],N=k.count*D_[k.type]*pv[k.componentType].BYTES_PER_ELEMENT,U=kc._malloc(N);c.GetAttributeDataArrayForAllPoints(m,M,kc[B],N,U),eC(kc.memory.buffer.slice(U,U+N),k,e),kc._free(U)}c.destroy(),m.destroy(),delete a.extensions[Zb]}const mv="EXT_meshopt_compression";function Iz(a,e){if(!a.extensions||!a.extensions[mv])return;const r=a.extensions[mv],c=new Uint8Array(e.buffers[r.buffer],r.byteOffset||0,r.byteLength||0),h=new Uint8Array(r.count*r.byteStride);qb.decodeGltfBuffer(h,r.count,r.byteStride,c,r.mode,r.filter),a.buffer=e.buffers.length,a.byteOffset=0,e.buffers[a.buffer]=h.buffer,delete a.extensions[mv]}const tC=1179937895,iC=new TextDecoder("utf8");function nC(a,e){return new URL(a,e).href}function Mz(a,e,r,c){return fetch(nC(a.uri,c)).then(h=>h.arrayBuffer()).then(h=>{e.buffers[r]=h})}function sC(a,e){const r=a.json.bufferViews[e];return new Uint8Array(a.buffers[r.buffer],r.byteOffset||0,r.byteLength)}function Pz(a,e,r,c){if(a.uri){const h=nC(a.uri,c);return fetch(h).then(m=>m.blob()).then(m=>createImageBitmap(m)).then(m=>{e.images[r]=m})}if(a.bufferView!==void 0){const h=sC(e,a.bufferView),m=new Blob([h],{type:a.mimeType});return createImageBitmap(m).then(g=>{e.images[r]=g})}}function rC(a,e=0,r){const c={json:null,images:[],buffers:[]};
601if(new Uint32Array(a,e,1)[0]===tC){const I=new Uint32Array(a,e);let M=2;const k=(I[M++]>>2)-3,B=I[M++]>>2;if(M++,c.json=JSON.parse(iC.decode(I.subarray(M,M+B))),M+=B,M<k){const N=I[M++];M++;const U=e+(M<<2);c.buffers[0]=a.slice(U,U+N)}}else c.json=JSON.parse(iC.decode(new Uint8Array(a,e)));const{buffers:h,images:m,meshes:g,extensionsUsed:b,bufferViews:T}=c.json;let E=Promise.resolve();if(h){const I=[];for(let M=0;M<h.length;M++){const k=h[M];k.uri?I.push(Mz(k,c,M,r)):c.buffers[M]||(c.buffers[M]=null)}E=Promise.all(I)}return E.then(()=>{const I=[],M=b&&b.includes(Zb),k=b&&b.includes(mv);if(M&&I.push(function(){if(!kc)return P_??(P_=function(B){let N,U=null;function Y(){N=new Uint8Array(U.buffer)}function J(){throw new Error("Unexpected Draco error.")}const ae={a:{a:J,d:function(ne,G,te){return N.copyWithin(ne,G,G+te)},c:function(ne){const G=N.length,te=Math.max(ne>>>0,Math.ceil(1.2*G)),oe=Math.ceil((te-G)/65536);try{return U.grow(oe),Y(),!0}catch{return!1}},b:J}};return(WebAssembly.instantiateStreaming?WebAssembly.instantiateStreaming(B,ae):B.then(ne=>ne.arrayBuffer()).then(ne=>WebAssembly.instantiate(ne,ae))).then(ne=>{const{Rb:G,Qb:te,P:oe,T:he,X:Te,Ja:Me,La:Pe,Qa:ze,Va:tt,Wa:mt,eb:ut,jb:pt,f:bt,e:Ye,yb:ft,zb:qe,Ab:et,Bb:Tt,Db:St,Gb:li}=ne.instance.exports;U=Ye;const Jt=(()=>{let Bt=0,wt=0,Ni=0,si=0;return ri=>{Ni&&(G(si),G(Bt),wt+=Ni,Ni=Bt=0),Bt||(wt+=128,Bt=te(wt));const Oi=ri.length+7&-8;let Xi=Bt;Oi>=wt&&(Ni=Oi,Xi=si=te(Oi));for(let Ji=0;Ji<ri.length;Ji++)N[Xi+Ji]=ri[Ji];return Xi}})();return Y(),bt(),{memory:Ye,_free:G,_malloc:te,Mesh:class{constructor(){this.ptr=oe()}destroy(){he(this.ptr)}},Decoder:class{constructor(){this.ptr=Me()}destroy(){pt(this.ptr)}DecodeArrayToMesh(Bt,wt,Ni){const si=Jt(Bt),ri=Pe(this.ptr,si,wt,Ni.ptr);return!!Te(ri)}GetAttributeByUniqueId(Bt,wt){return{ptr:ze(this.ptr,Bt.ptr,wt)}}GetTrianglesUInt16Array(Bt,wt,Ni){tt(this.ptr,Bt.ptr,wt,Ni)}GetTrianglesUInt32Array(Bt,wt,Ni){mt(this.ptr,Bt.ptr,wt,Ni)}GetAttributeDataArrayForAllPoints(Bt,wt,Ni,si,ri){ut(this.ptr,Bt.ptr,wt.ptr,Ni,si,ri)}},DT_INT8:ft(),DT_UINT8:qe(),DT_INT16:et(),DT_UINT16:Tt(),DT_UINT32:St(),DT_FLOAT32:li()}})}(fetch(J3())),P_.then(B=>{kc=B,P_=void 0}))}()),k&&I.push(function(){if(qb)return;const B=function(N){let U;const Y=WebAssembly.instantiateStreaming(N,{}).then(ne=>{U=ne.instance,U.exports.__wasm_call_ctors()}),J={NONE:"",OCTAHEDRAL:"meshopt_decodeFilterOct",QUATERNION:"meshopt_decodeFilterQuat",EXPONENTIAL:"meshopt_decodeFilterExp"},ae={ATTRIBUTES:"meshopt_decodeVertexBuffer",TRIANGLES:"meshopt_decodeIndexBuffer",INDICES:"meshopt_decodeIndexSequence"};return{ready:Y,supported:!0,decodeGltfBuffer(ne,G,te,oe,he,Te){(function(Me,Pe,ze,tt,mt,ut,pt){const bt=Me.exports.sbrk,Ye=tt+3&-4,ft=bt(Ye*mt),qe=bt(ut.length),et=new Uint8Array(Me.exports.memory.buffer);et.set(ut,qe);const Tt=Pe(ft,tt,mt,qe,ut.length);if(Tt===0&&pt&&pt(ft,Ye,mt),ze.set(et.subarray(ft,ft+tt*mt)),bt(ft-bt(0)),Tt!==0)throw new Error(`Malformed buffer data: ${Tt}`)})(U,U.exports[ae[he]],ne,G,te,oe,U.exports[J[Te]])}}}(fetch(Q3()));return B.ready.then(()=>{qb=B})}()),m)for(let B=0;B<m.length;B++)I.push(Pz(m[B],c,B,r));return(I.length?Promise.all(I):Promise.resolve()).then(()=>{if(M&&g)for(const{primitives:B}of g)for(const N of B)Cz(N,c);if(k&&g&&T)for(const B of T)Iz(B,c);return c})})}function tp(a,e){const r=a.json.bufferViews[e.bufferView],c=pv[e.componentType];return new c(a.buffers[r.buffer],(e.byteOffset||0)+(r.byteOffset||0),e.count*(r.byteStride&&r.byteStride!==D_[e.type]*c.BYTES_PER_ELEMENT?r.byteStride/c.BYTES_PER_ELEMENT:D_[e.type]))}function Xb(a,e,r,c){const h=pv[e.componentType],m=function(I){switch(I){case Int8Array:return 1/127;case Uint8Array:return 1/255;case Int16Array:return 1/32767;case Uint16Array:return 1/65535;default:return 1}}(h),g=a.json.bufferViews[e.bufferView],b=g.byteStride?g.byteStride/h.BYTES_PER_ELEMENT:D_[e.type],T=r.float32,E=T.length/r.capacity;for(let I=0,M=0;I<e.count*b;I+=b,M+=E)for(let k=0;k<E;k++)T[M+k]=c[I+k]*m;r._trim()}function Dz(a,e,r){const c=a.indices,h=a.attributes,m={};m.indexArray=new Vr;const g=e.json.accessors[c],b=g.count/3;m.indexArray.reserve(b);const T=tp(e,g);for(let k=0;k<b;k++)m.indexArray.emplaceBack(T[3*k],T[3*k+1],T[3*k+2]);m.indexArray._trim(),m.vertexArray=new Hl;const E=e.json.accessors[h.POSITION];m.vertexArray.reserve(E.count);const I=tp(e,E);for(let k=0;k<E.count;k++)m.vertexArray.emplaceBack(I[3*k],I[3*k+1],I[3*k+2]);if(m.vertexArray._trim(),m.aabb=new Ms(E.min,E.max),m.centroid=function(k,B){const N=[0,0,0],U=k.length;if(U>0){for(let Y=0;Y<U;Y++){const J=3*k[Y];
601N[0]+=B[J],N[1]+=B[J+1],N[2]+=B[J+2]}N[0]/=U,N[1]/=U,N[2]/=U}return N}(T,I),h.COLOR_0!==void 0){const k=e.json.accessors[h.COLOR_0],B=D_[k.type],N=tp(e,k);m.colorArray=B===3?new Hl:new Gl,m.colorArray.resize(k.count),Xb(e,k,m.colorArray,N)}if(h.NORMAL!==void 0){m.normalArray=new Hl;const k=e.json.accessors[h.NORMAL];m.normalArray.resize(k.count);const B=tp(e,k);Xb(e,k,m.normalArray,B)}if(h.TEXCOORD_0!==void 0&&r.length>0){m.texcoordArray=new sh;const k=e.json.accessors[h.TEXCOORD_0];m.texcoordArray.resize(k.count);const B=tp(e,k);Xb(e,k,m.texcoordArray,B)}if(h._FEATURE_ID_RGBA4444!==void 0){const k=e.json.accessors[h._FEATURE_ID_RGBA4444];e.json.extensionsUsed&&e.json.extensionsUsed.includes("EXT_meshopt_compression")&&(m.featureData=tp(e,k))}h._FEATURE_RGBA4444!==void 0&&(m.featureData=new Uint32Array(tp(e,e.json.accessors[h._FEATURE_RGBA4444]).buffer));const M=a.material;return m.material=function(k,B){const{emissiveFactor:N=[0,0,0],alphaMode:U="OPAQUE",alphaCutoff:Y=.5,normalTexture:J,occlusionTexture:ae,emissiveTexture:ne,doubleSided:G}=k,{baseColorFactor:te=[1,1,1,1],metallicFactor:oe=1,roughnessFactor:he=1,baseColorTexture:Te,metallicRoughnessTexture:Me}=k.pbrMetallicRoughness||{},Pe=ae?B[ae.index]:void 0;if(ae&&ae.extensions&&ae.extensions.KHR_texture_transform&&Pe){const ze=ae.extensions.KHR_texture_transform;Pe.offsetScale=[ze.offset[0],ze.offset[1],ze.scale[0],ze.scale[1]]}return{pbrMetallicRoughness:{baseColorFactor:new Cn(...te),metallicFactor:oe,roughnessFactor:he,baseColorTexture:Te?B[Te.index]:void 0,metallicRoughnessTexture:Me?B[Me.index]:void 0},doubleSided:G,emissiveFactor:N,alphaMode:U,alphaCutoff:Y,normalTexture:J?B[J.index]:void 0,occlusionTexture:Pe,emissionTexture:ne?B[ne.index]:void 0,defined:k.defined===void 0}}(M!==void 0?e.json.materials[M]:{defined:!1},r),m}function oC(a,e,r){const{matrix:c,rotation:h,translation:m,scale:g,mesh:b,extras:T,children:E}=a,I={};if(I.matrix=c||function(M,k,B,N){var U=k[0],Y=k[1],J=k[2],ae=k[3],ne=U+U,G=Y+Y,te=J+J,oe=U*ne,he=U*G,Te=U*te,Me=Y*G,Pe=Y*te,ze=J*te,tt=ae*ne,mt=ae*G,ut=ae*te,pt=N[0],bt=N[1],Ye=N[2];return M[0]=(1-(Me+ze))*pt,M[1]=(he+ut)*pt,M[2]=(Te-mt)*pt,M[3]=0,M[4]=(he-ut)*bt,M[5]=(1-(oe+ze))*bt,M[6]=(Pe+tt)*bt,M[7]=0,M[8]=(Te+mt)*Ye,M[9]=(Pe-tt)*Ye,M[10]=(1-(oe+Me))*Ye,M[11]=0,M[12]=B[0],M[13]=B[1],M[14]=B[2],M[15]=1,M}([],h||[0,0,0,1],m||[0,0,0],g||[1,1,1]),b!==void 0){I.meshes=r[b];const M=I.anchor=[0,0];for(const k of I.meshes){const{min:B,max:N}=k.aabb;M[0]+=B[0]+N[0],M[1]+=B[1]+N[1]}M[0]=Math.floor(M[0]/I.meshes.length/2),M[1]=Math.floor(M[1]/I.meshes.length/2)}if(T&&(T.id&&(I.id=T.id),T.lights&&(I.lights=function(M){if(!M.length)return[];const k=function(J){const ae=atob(J),ne=new Uint8Array(ae.length);for(let G=0;G<ae.length;G++)ne[G]=ae.codePointAt(G);return ne}(M),B=[],N=k.length/24,U=new Uint16Array(k.buffer),Y=new Float32Array(k.buffer);for(let J=0;J<N;J++){const ae=U[2*J*6]/30,ne=U[2*J*6+1]/30,G=U[2*J*6+10]/100,te=Y[6*J+1],oe=Y[6*J+2],he=Y[6*J+3],Te=Y[6*J+4],Me=he-te,Pe=Te-oe,ze=Math.hypot(Me,Pe);B.push({pos:[te+.5*Me,oe+.5*Pe,ne],normal:[Pe/ze,-Me/ze,0],width:ze,height:ae,depth:G,points:[te,oe,he,Te]})}return B}(T.lights))),E){const M=[];for(const k of E)M.push(oC(e.json.nodes[k],e,r));I.children=M}return I}function kz(a){if(a.vertices.length===0||a.indices.length===0)return null;const e=new Q1(a.vertices,a.indices,8,256),[r,c]=[e.min.clone(),e.max.clone()];return{vertices:a.vertices,indices:a.indices,grid:e,min:r,max:c}}function Lz(a){if(!a.extras||!a.extras.ground)return null;const e=a.extras.ground;if(!e||!Array.isArray(e)||e.length===0)return null;const r=e[0];if(!r||!Array.isArray(r)||r.length===0)return null;const c=[];for(const g of r){if(!Array.isArray(g)||g.length!==2)continue;const b=g[0],T=g[1];typeof b=="number"&&typeof T=="number"&&c.push(new kt(b,T))}if(c.length<3)return null;c.length>1&&c[c.length-1].equals(c[0])&&c.pop();let h=0;for(let g=0;g<c.length;g++){const b=c[g],T=c[(g+1)%c.length],E=c[(g+2)%c.length];h+=(b.x-T.x)*(E.y-T.y)-(E.x-T.x)*(b.y-T.y)}h>0&&c.reverse();const m=t_(c.flatMap(g=>[g.x,g.y]),[]);return m.length===0?null:{vertices:c,indices:m}}function Rz(a,e){const r=[],c=[];let h=0;const m=[];for(const g of a){h=r.length;const b=g.vertexArray.float32,T=g.indexArray.uint16;for(let E=0;E<g.vertexArray.length;E++)m[0]=b[3*E+0],m[1]=b[3*E+1],m[2]=b[3*E+2],ti(m,m,e),r.push(new kt(m[0],m[1]));for(let E=0;E<3*g.indexArray.length;E++)c.push(T[E]+h)}if(c.length%3!=0)return null;for(let g=0;g<c.length;g+=3){const b=r[c[g+0]],T=r[c[g+1]],E=r[c[g+2]];
601(b.x-T.x)*(E.y-T.y)-(E.x-T.x)*(b.y-T.y)>0&&([c[g+1],c[g+2]]=[c[g+2],c[g+1]])}return{vertices:r,indices:c}}function aC(a){const e=function(T,E){const I=[],M=WebGL2RenderingContext;if(T.json.textures)for(const k of T.json.textures){const B={magFilter:M.LINEAR,minFilter:M.NEAREST,wrapS:M.REPEAT,wrapT:M.REPEAT};k.sampler!==void 0&&Object.assign(B,T.json.samplers[k.sampler]),I.push({image:E[k.source],sampler:B,uploaded:!1})}return I}(a,a.images),r=function(T,E){const I=[];for(const M of T.json.meshes){const k=[];for(const B of M.primitives)k.push(Dz(B,T,E));I.push(k)}return I}(a,e),{scenes:c,scene:h,nodes:m}=a.json,g=c?c[h||0].nodes:m,b=[];for(const T of g)b.push(oC(m[T],a,r));return function(T,E,I){const M={},k=new Set;for(let B=0;B<T.length;B++){const N=I[E[B]];if(!N.extras)continue;const U=N.extras["mapbox:footprint:version"],Y=N.extras["mapbox:footprint:id"];(U||Y)&&k.add(B),U==="1.0.0"&&Y&&(M[Y]=B)}for(let B=0;B<T.length;B++){if(k.has(B))continue;const N=T[B],U=I[E[B]];if(!U.extras)continue;let Y=null;N.id in M&&(Y=Rz(T[M[N.id]].meshes,N.matrix)),Y||(Y=Lz(U)),Y&&(N.footprint=kz(Y))}if(k.size>0){const B=Array.from(k.values()).sort((N,U)=>N-U);for(let N=B.length-1;N>=0;N--)T.splice(B[N],1)}}(b,g,a.json.nodes),b}function Oz(a){a.heightmap=new Float32Array(4096),a.heightmap.fill(-1);const e=a.vertexArray.float32,r=a.aabb.min[0]-1,c=a.aabb.min[1]-1,h=Jf/(a.aabb.max[0]-r+2),m=Jf/(a.aabb.max[1]-c+2);for(let g=0;g<e.length;g+=3){const b=e[g+2],T=(e[g+0]-r)*h|0,E=(e[g+1]-c)*m|0;b>a.heightmap[E*Jf+T]&&(a.heightmap[E*Jf+T]=b)}}function zz(a,e){const r={};r.indexArray=new Vr,r.indexArray.reserve(4*a.length),r.vertexArray=new Hl,r.vertexArray.reserve(10*a.length),r.colorArray=new Gl,r.vertexArray.reserve(10*a.length);let c=0;for(const g of a){const b=Math.min(10,Math.max(4,1.3*g.height))*e,T=[-g.normal[1],g.normal[0],0],E=Math.min(.29,.1*g.width/g.depth),I=g.width-2*g.depth*e*(E+.01),M=Yn([],g.pos,T,I/2),k=Yn([],g.pos,T,-I/2),B=[M[0],M[1],M[2]+g.height],N=[k[0],k[1],k[2]+g.height],U=Yn([],g.normal,T,E);Ue(U,U,b);const Y=Yn([],g.normal,T,-E);Ue(Y,Y,b),ki(U,M,U),ki(Y,k,Y),M[2]+=.1,k[2]+=.1,r.vertexArray.emplaceBack(U[0],U[1],U[2]),r.vertexArray.emplaceBack(Y[0],Y[1],Y[2]),r.vertexArray.emplaceBack(M[0],M[1],M[2]),r.vertexArray.emplaceBack(k[0],k[1],k[2]),r.vertexArray.emplaceBack(B[0],B[1],B[2]),r.vertexArray.emplaceBack(N[0],N[1],N[2]),r.vertexArray.emplaceBack(M[0],M[1],M[2]),r.vertexArray.emplaceBack(k[0],k[1],k[2]),r.vertexArray.emplaceBack(U[0],U[1],U[2]),r.vertexArray.emplaceBack(Y[0],Y[1],Y[2]);const J=I/b/2;r.colorArray.emplaceBack(-J-E,-1,J,.8),r.colorArray.emplaceBack(J+E,-1,J,.8),r.colorArray.emplaceBack(-J,0,J,1.3),r.colorArray.emplaceBack(J,0,J,1.3),r.colorArray.emplaceBack(J+E,-.8,J,.7),r.colorArray.emplaceBack(J+E,-.8,J,.7),r.colorArray.emplaceBack(0,0,J,1.3),r.colorArray.emplaceBack(0,0,J,1.3),r.colorArray.emplaceBack(J+E,-1.2,J,.8),r.colorArray.emplaceBack(J+E,-1.2,J,.8),r.indexArray.emplaceBack(6+c,4+c,8+c),r.indexArray.emplaceBack(7+c,9+c,5+c),r.indexArray.emplaceBack(0+c,1+c,2+c),r.indexArray.emplaceBack(1+c,3+c,2+c),c+=10}const h={defined:!0,emissiveFactor:[0,0,0]},m={};return m.baseColorFactor=Cn.white,h.pbrMetallicRoughness=m,r.material=h,r.aabb=new Ms([1/0,1/0,1/0],[-1/0,-1/0,-1/0]),r}class lC{constructor(e){this._stringToNumber={},this._numberToString=[];for(let r=0;r<e.length;r++){const c=e[r];this._stringToNumber[c]=r,this._numberToString[r]=c}}encode(e){return this._stringToNumber[e]}decode(e){return this._numberToString[e]}}const Fz=["id","tile","layer","source","sourceLayer","state"];class zm{constructor(e,r,c,h,m){this.type="Feature",this._vectorTileFeature=e,this._z=r,this._x=c,this._y=h,this.properties=e.properties,this.id=m}clone(){const e=new zm(this._vectorTileFeature,this._z,this._x,this._y,this.id);return this.state&&(e.state=Object.assign({},this.state)),this.layer&&(e.layer=Object.assign({},this.layer)),this.source&&(e.source=this.source),this.sourceLayer&&(e.sourceLayer=this.sourceLayer),e}get geometry(){return this._geometry===void 0&&(this._geometry=this._vectorTileFeature.toGeoJSON(this._x,this._y,this._z).geometry),this._geometry}set geometry(e){this._geometry=e}toJSON(){const e={type:"Feature",state:void 0,geometry:this.geometry,properties:this.properties};for(const r of Fz)this[r]!==void 0&&(e[r]=this[r]);return e}}class cC{constructor(e,r){this.tileID=e,this.x=e.canonical.x,this.y=e.canonical.y,this.z=e.canonical.z,this.grid=new Os(Rt,16,0),this.featureIndexArray=new p0,this.promoteId=r,this.is3DTile=!1,this.serializedLayersCache=new Map}insert(e,r,c,h,m,g=0,b=0){const T=this.featureIndexArray.length;this.featureIndexArray.emplaceBack(c,h,m,g);const E=this.grid;for(let I=0;I<r.length;I++){const M=r[I],k=[1/0,1/0,-1/0,-1/0];for(let B=0;B<M.length;B++){const N=M[B];k[0]=Math.min(k[0],N.x),k[1]=Math.min(k[1],N.y),k[2]=Math.max(k[2],N.x),k[3]=Math.max(k[3],N.y)}b!==0&&(k[0]-=b,k[1]-=b,k[2]+=b,k[3]+=b),k[0]<Rt&&k[1]<Rt&&k[2]>=0&&k[3]>=0&&E.insert(T,k[0],k[1],k[2],k[3])}}loadVTLayers(){if(!this.vtLayers){this.vtLayers=new Td.VectorTile(new O0(this.rawTileData)).layers,this.sourceLayerCoder=new lC(this.vtLayers?Object.keys(this.vtLayers).sort():["_geojsonTileLayer"]),this.vtFeatures={};for(const e in this.vtLayers)this.vtFeatures[e]=[]}return this.vtLayers}query(e,r){const{tilespaceGeometry:c,transform:h,tileTransform:m,pixelPosMatrix:g,availableImages:b}=r;this.loadVTLayers(),this.serializedLayersCache.clear();const T=c.bufferedTilespaceBounds,E=this.grid.query(T.min.x,T.min.y,T.max.x,T.max.y,(B,N,U,Y)=>fr(c.bufferedTilespaceGeometry,B,N,U,Y));E.sort(Bz);let I=null;h.elevation&&E.length>0&&(I=Pm.create(h.elevation,this.tileID));const M={};let k;for(let B=0;B<E.length;B++){const N=E[B];if(N===k)continue;k=N;const U=this.featureIndexArray.get(N);let Y=null;
601this.is3DTile?this.loadMatchingModelFeature(M,U,e,c,h):this.loadMatchingFeature(M,U,e,b,(J,ae,ne,G=0)=>(Y||(Y=Qt(J,this.tileID.canonical,m)),ae.queryIntersectsFeature(c,J,ne,Y,this.z,h,g,I,G)))}return M}loadMatchingFeature(e,r,c,h,m){const{featureIndex:g,bucketIndex:b,sourceLayerIndex:T,layoutVertexArrayOffset:E}=r,I=this.bucketLayerIDs[b],M=c.layers,k=Object.keys(M);if(k.length&&!function(J,ae){for(let ne=0;ne<J.length;ne++)if(ae.indexOf(J[ne])>=0)return!0;return!1}(k,I))return;const B=c.sourceCache,N=this.sourceLayerCoder.decode(T),U=this.vtLayers[N].feature(g),Y=this.getId(U,N);for(let J=0;J<I.length;J++){const ae=I[J];if(!M[ae])continue;const{styleLayer:ne,targets:G}=M[ae];let te={};Y!==void 0&&(te=B.getFeatureState(ne.sourceLayer,Y));const oe=!m||m(U,ne,te,E);if(!oe)continue;const he=new zm(U,this.z,this.x,this.y,Y);he.tile=this.tileID.canonical,he.state=te;let Te=this.serializedLayersCache.get(ae);Te||(Te=ne.serialize(),Te.id=ae,this.serializedLayersCache.set(ae,Te)),he.source=Te.source,he.sourceLayer=Te["source-layer"],he.layer=He({},Te),he.layer.paint=uC(Te.paint,ne.paint,U,te,h),he.layer.layout=uC(Te.layout,ne.layout,U,te,h);let Me=!1;for(const Pe of G){this.updateFeatureProperties(he,Pe);const{filter:ze}=Pe;if(ze){if(U.properties=he.properties,ze.needGeometry){const tt=ci(U,!0);if(!ze.filter(new Un(this.tileID.overscaledZ),tt,this.tileID.canonical))continue}else if(!ze.filter(new Un(this.tileID.overscaledZ),U))continue}Me=!0,Pe.targetId&&this.addFeatureVariant(he,Pe)}Me&&this.appendToResult(e,ae,g,he,oe)}}loadMatchingModelFeature(e,r,c,h,m){const g=this.bucketLayerIDs[0][0],b=c.layers;if(!b[g])return;const{styleLayer:T,targets:E}=b[g];if(T.type!=="model")return;const I=h.tile,M=r.featureIndex,k=I.getBucket(T);if(!(k&&k instanceof sv))return;const B=function(Te,Me,Pe,ze){const tt=Te.getNodesInfo()[Me];if(tt.hiddenByReplacement||!tt.node.meshes)return;let mt=Number.MAX_VALUE;const ut=tt.node,pt=Pe.tile,bt=ze.calculatePosMatrix(pt.tileID.toUnwrapped(),ze.worldSize),Ye=tt.evaluatedScale;let ft=0;ze.elevation&&ut.elevation&&(ft=ut.elevation*ze.elevation.exaggeration()),Ee(bt,bt,[(ut.anchor?ut.anchor[0]:0)*(Ye[0]-1),(ut.anchor?ut.anchor[1]:0)*(Ye[1]-1),ft]),je(bt,bt,Ye);const qe=Pe.queryGeometry,et=qe.isPointQuery()?qe.screenBounds:qe.screenGeometry,Tt=function(li){const Jt=ve([],bt,li.matrix);ve(Jt,ze.expandedFarZProjMatrix,Jt);for(let Bt=0;Bt<li.meshes.length;++Bt){const wt=li.meshes[Bt];if(Bt===li.lightMeshIndex)continue;const Ni=c3(et,ze,Jt,wt.aabb);Ni!=null&&(mt=Math.min(Ni,mt))}if(li.children)for(const Bt of li.children)Tt(Bt)};if(Tt(ut),mt===Number.MAX_VALUE)return;const St=new Z(0,0);return x3(pt.tileID.canonical,St,tt.node.anchor[0],tt.node.anchor[1]),{intersectionZ:mt,position:St,feature:tt.feature}}(k,M,h,m);if(!B)return;const{z:N,x:U,y:Y}=I.tileID.canonical,{feature:J,intersectionZ:ae,position:ne}=B;let G={};J.id!==void 0&&(G=c.sourceCache.getFeatureState(T.sourceLayer,J.id));const te=new zm({},N,U,Y,J.id);te.tile=this.tileID.canonical,te.state=G,te.properties=J.properties,te.geometry={type:"Point",coordinates:[ne.lng,ne.lat]};let oe=this.serializedLayersCache.get(g);oe||(oe=T.serialize(),oe.id=g,this.serializedLayersCache.set(g,oe)),te.source=oe.source,te.sourceLayer=oe["source-layer"],te.layer=He({},oe);let he=!1;for(const Te of E){this.updateFeatureProperties(te,Te);const{filter:Me}=Te;if(Me){if(J.properties=te.properties,Me.needGeometry){if(!Me.filter(new Un(this.tileID.overscaledZ),J,this.tileID.canonical))continue}else if(!Me.filter(new Un(this.tileID.overscaledZ),J))continue}he=!0,Te.targetId&&this.addFeatureVariant(te,Te)}he&&this.appendToResult(e,g,M,te,ae)}updateFeatureProperties(e,r,c){if(r.properties){const h={};for(const m in r.properties){const g=r.properties[m].evaluate({zoom:this.z},e._vectorTileFeature,e.state,e.tile,c);g!=null&&(h[m]=g)}e.properties=h}}addFeatureVariant(e,r,c){const h={target:r.target,namespace:r.namespace,uniqueFeatureID:r.uniqueFeatureID};r.properties&&(h.properties=e.properties),e.variants=e.variants||{},e.variants[r.targetId]=e.variants[r.targetId]||[],e.variants[r.targetId].push(h)}appendToResult(e,r,c,h,m){let g=e[r];g===void 0&&(g=e[r]=[]),g.push({featureIndex:c,feature:h,intersectionZ:m})}lookupSymbolFeatures(e,r,c,h,m){const g={};this.loadVTLayers();
601for(const b of e)this.loadMatchingFeature(g,{bucketIndex:r,sourceLayerIndex:c,featureIndex:b,layoutVertexArrayOffset:0},h,m);return g}loadFeature(e){const{featureIndex:r,sourceLayerIndex:c}=e;this.loadVTLayers();const h=this.sourceLayerCoder.decode(c),m=this.vtFeatures[h];if(m[r])return m[r];const g=this.vtLayers[h].feature(r);return m[r]=g,g}hasLayer(e){for(const r of this.bucketLayerIDs)for(const c of r)if(e===c)return!0;return!1}getId(e,r){let c=e.id;if(this.promoteId){const h=Array.isArray(this.promoteId)||typeof this.promoteId!="object"?this.promoteId:this.promoteId[r];if(h!=null)if(Array.isArray(h)){if(!this.promoteIdExpression){const m=yo(h);if(m.result!=="success"){const g=m.value.map(b=>`${b.key}: ${b.message}`).join(", ");return void Yi(`Failed to create expression for promoteId: ${g}`)}this.promoteIdExpression=m.value}this.promoteIdExpression._evaluator||(this.promoteIdExpression._evaluator=new jh),c=this.promoteIdExpression.evaluate({zoom:0},e)}else c=e.properties[h];typeof c=="boolean"&&(c=Number(c))}return c}}function uC(a,e,r,c,h){return Pi(a,(m,g)=>{const b=e instanceof Qu?e.get(g):null;return b&&b.evaluate?b.evaluate(r,c,void 0,h):b})}function Bz(a,e){return e-a}Vt(cC,"FeatureIndex",{omit:["rawTileData","sourceLayerCoder"]});const hC=[Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array];class Yb{static from(e){if(!(e instanceof ArrayBuffer))throw new Error("Data must be an instance of ArrayBuffer.");const[r,c]=new Uint8Array(e,0,2);if(r!==219)throw new Error("Data does not appear to be in a KDBush format.");const h=c>>4;if(h!==1)throw new Error(`Got v${h} data when expected v1.`);const m=hC[15&c];if(!m)throw new Error("Unrecognized array type.");const[g]=new Uint16Array(e,2,1),[b]=new Uint32Array(e,4,1);return new Yb(b,g,m,e)}constructor(e,r=64,c=Float64Array,h){if(isNaN(e)||e<0)throw new Error(`Unpexpected numItems value: ${e}.`);this.numItems=+e,this.nodeSize=Math.min(Math.max(+r,2),65535),this.ArrayType=c,this.IndexArrayType=e<65536?Uint16Array:Uint32Array;const m=hC.indexOf(this.ArrayType),g=2*e*this.ArrayType.BYTES_PER_ELEMENT,b=e*this.IndexArrayType.BYTES_PER_ELEMENT,T=(8-b%8)%8;if(m<0)throw new Error(`Unexpected typed array class: ${c}.`);h&&h instanceof ArrayBuffer?(this.data=h,this.ids=new this.IndexArrayType(this.data,8,e),this.coords=new this.ArrayType(this.data,8+b+T,2*e),this._pos=2*e,this._finished=!0):(this.data=new ArrayBuffer(8+g+b+T),this.ids=new this.IndexArrayType(this.data,8,e),this.coords=new this.ArrayType(this.data,8+b+T,2*e),this._pos=0,this._finished=!1,new Uint8Array(this.data,0,2).set([219,16+m]),new Uint16Array(this.data,2,1)[0]=r,new Uint32Array(this.data,4,1)[0]=e)}add(e,r){const c=this._pos>>1;return this.ids[c]=c,this.coords[this._pos++]=e,this.coords[this._pos++]=r,c}finish(){const e=this._pos>>1;if(e!==this.numItems)throw new Error(`Added ${e} items when expected ${this.numItems}.`);return Kb(this.ids,this.coords,this.nodeSize,0,this.numItems-1,0),this._finished=!0,this}range(e,r,c,h){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");const{ids:m,coords:g,nodeSize:b}=this,T=[0,m.length-1,0],E=[];for(;T.length;){const I=T.pop()||0,M=T.pop()||0,k=T.pop()||0;if(M-k<=b){for(let Y=k;Y<=M;Y++){const J=g[2*Y],ae=g[2*Y+1];J>=e&&J<=c&&ae>=r&&ae<=h&&E.push(m[Y])}continue}const B=k+M>>1,N=g[2*B],U=g[2*B+1];N>=e&&N<=c&&U>=r&&U<=h&&E.push(m[B]),(I===0?e<=N:r<=U)&&(T.push(k),T.push(B-1),T.push(1-I)),(I===0?c>=N:h>=U)&&(T.push(B+1),T.push(M),T.push(1-I))}return E}within(e,r,c){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");const{ids:h,coords:m,nodeSize:g}=this,b=[0,h.length-1,0],T=[],E=c*c;for(;b.length;){const I=b.pop()||0,M=b.pop()||0,k=b.pop()||0;if(M-k<=g){for(let Y=k;Y<=M;Y++)fC(m[2*Y],m[2*Y+1],e,r)<=E&&T.push(h[Y]);continue}const B=k+M>>1,N=m[2*B],U=m[2*B+1];fC(N,U,e,r)<=E&&T.push(h[B]),(I===0?e-c<=N:r-c<=U)&&(b.push(k),b.push(B-1),b.push(1-I)),(I===0?e+c>=N:r+c>=U)&&(b.push(B+1),b.push(M),b.push(1-I))}return T}}function Kb(a,e,r,c,h,m){if(h-c<=r)return;const g=c+h>>1;dC(a,e,g,c,h,m),Kb(a,e,r,c,g-1,1-m),Kb(a,e,r,g+1,h,1-m)}function dC(a,e,r,c,h,m){for(;h>c;){if(h-c>600){const E=h-c+1,I=r-c+1,M=Math.log(E),k=.5*Math.exp(2*M/3),B=.5*Math.sqrt(M*k*(E-k)/E)*(I-E/2<0?-1:1);
601dC(a,e,r,Math.max(c,Math.floor(r-I*k/E+B)),Math.min(h,Math.floor(r+(E-I)*k/E+B)),m)}const g=e[2*r+m];let b=c,T=h;for(k_(a,e,c,r),e[2*h+m]>g&&k_(a,e,c,h);b<T;){for(k_(a,e,b,T),b++,T--;e[2*b+m]<g;)b++;for(;e[2*T+m]>g;)T--}e[2*c+m]===g?k_(a,e,c,T):(T++,k_(a,e,T,h)),T<=r&&(c=T+1),r<=T&&(h=T-1)}}function k_(a,e,r,c){Jb(a,r,c),Jb(e,2*r,2*c),Jb(e,2*r+1,2*c+1)}function Jb(a,e,r){const c=a[e];a[e]=a[r],a[r]=c}function fC(a,e,r,c){const h=a-r,m=e-c;return h*h+m*m}s.$=qr,s.A=Qa,s.B=ya,s.C=th,s.D=Dm,s.E=kl,s.F=2,s.G=p_,s.H=TA,s.I=To,s.J=class extends iv{},s.K=Di,s.L=Ll,s.M=cl,s.N=Ns,s.O=kn,s.P=kt,s.Q=Fn,s.R=Pu,s.S=_o,s.T=Cb,s.U=am,s.V=iv,s.W=vo,s.X=yo,s.Y=nl,s.Z=bc,s._=Hu,s.a=function(a){return Fr.API_CDN_URL_REGEX.test(a)},s.a$=Ht,s.a0=Hc,s.a1=lm,s.a2=Gs,s.a3=Ln,s.a4=function(a){const e=a.value;let r=[];if(!e)return r;const c=Di(e);return c!=="string"?(r=r.concat([new iv(a.key,e,`string expected, "${c}" found`)]),r):(Db(e,!0)||(r=r.concat([new iv(a.key,e,`invalid url "${e}"`)])),r)},s.a5=$e,s.a6=e0,s.a7=Ys,s.a8=It,s.a9=class{constructor(a){this.specification=a}possiblyEvaluate(a,e){return Jn(a.expression.evaluate(e))}interpolate(a,e,r){return{x:gi(a.x,e.x,r),y:gi(a.y,e.y,r),z:gi(a.z,e.z,r),azimuthal:gi(a.azimuthal,e.azimuthal,r),polar:gi(a.polar,e.polar,r)}}},s.aA=pi,s.aB=ns,s.aC=ht,s.aD=ke,s.aE=v,s.aF=function(a,e){const r={};for(let c=0;c<e.length;c++){const h=e[c];h in a&&(r[h]=a[h])}return r},s.aG=se,s.aH=ye,s.aI=class{constructor(a){this.entries={},this.scheduler=a}request(a,e,r,c){const h=this.entries[a]=this.entries[a]||{callbacks:[]};if(h.result){const[m,g]=h.result;return this.scheduler?this.scheduler.add(()=>{c(m,g)},e):c(m,g),()=>{}}return h.callbacks.push(c),h.cancel||(h.cancel=r((m,g)=>{h.result=[m,g];for(const b of h.callbacks)this.scheduler?this.scheduler.add(()=>{b(m,g)},e):b(m,g);setTimeout(()=>delete this.entries[a],3e3)})),()=>{h.result||(h.callbacks=h.callbacks.filter(m=>m!==c),h.callbacks.length||(h.cancel(),delete this.entries[a]))}}},s.aJ=function(a,e,r){const c=JSON.stringify(a.request);return a.data&&(this.deduped.entries[c]={result:[null,a.data]}),this.deduped.request(c,{type:"parseTile",isSymbolTile:a.isSymbolTile,zoom:a.tileZoom},h=>{const m=cc(a.request,(g,b,T,E)=>{g?h(g):b&&h(null,{vectorTile:r?void 0:new Td.VectorTile(new O0(b)),rawData:b,cacheControl:T,expires:E})});return()=>{m.cancel(),h()}},e)},s.aK=function(a){Mu++,Mu>Uo&&(a.getActor().send("enforceCacheSizeLimit",Do),Mu=0)},s.aL=function(a){return a<=1?1:Math.pow(2,Math.floor(Math.log(a)/Math.LN2))},s.aM=ar,s.aN=JA,s.aO=s3,s.aP=KA,s.aQ=function(a,e){const r=document.createElement("video");r.muted=!0,r.onloadstart=function(){e(null,r)};for(let c=0;c<a.length;c++){const h=document.createElement("source");df(a[c])||(r.crossOrigin="Anonymous"),h.src=a[c],r.appendChild(h)}return{cancel:()=>{}}},s.aR=K0,s.aS=function(a){return fetch(a).then(e=>e.arrayBuffer()).then(e=>rC(e,0,a))},s.aT=aC,s.aU=class{constructor(a,e,r,c){this.id=a,this.position=e!=null?new Z(e[0],e[1]):new Z(0,0),this.orientation=r??[0,0,0],this.nodes=c,this.uploaded=!1,this.aabb=new Ms([1/0,1/0,1/0],[-1/0,-1/0,-1/0]),this.matrix=[]}_applyTransformations(a,e){if(ve(a.matrix,e,a.matrix),a.meshes)for(const r of a.meshes){const c=Ms.applyTransformFast(r.aabb,a.matrix);this.aabb.encapsulate(c)}if(a.children)for(const r of a.children)this._applyTransformations(r,a.matrix)}computeBoundsAndApplyParent(){const a=re([]);for(const e of this.nodes)this._applyTransformations(e,a)}computeModelMatrix(a,e,r,c,h,m,g=!1){m3(this.matrix,this,a.transform,this.position,e,r,c,h,m,g)}upload(a){if(!this.uploaded){for(const e of this.nodes)Lb(e,a);for(const e of this.nodes)nv(e);this.uploaded=!0}}destroy(){for(const a of this.nodes)Rb(a)}},s.aV=xi,s.aW=g_,s.aX=Se,s.aY=Ae,s.aZ=ih,s.a_=Vr,s.aa=Un,s.ab=so,s.ac=We,s.ad=ti,s.ae=yi,s.af=Le,s.ag=Qu,s.ah=bd,s.ai=gi,s.aj=Rt,s.ak=Np,s.al=X,s.am=Cn,s.an=class{constructor(a){this.specification=a}possiblyEvaluate(a,e){return function([r,c]){const h=Jn([1,r,c]);return{x:h.x,y:h.y,z:h.z}}(a.expression.evaluate(e))}interpolate(a,e,r){return{x:gi(a.x,e.x,r),y:gi(a.y,e.y,r),z:gi(a.z,e.z,r)}}},s.ao=function(a,e,r=0,c=!0){const h=new kt(r,r),m=a.sub(h),g=e.add(h),b=[m,new kt(g.x,m.y),g,new kt(m.x,g.y)];return c&&b.push(m.clone()),b},s.ap=function(a,e){const r=[];for(let c=0;c<a.length;c++){const h=Ze(c-1,-1,a.length-1),m=Ze(c+1,-1,a.length-1),g=a[c],b=a[m],T=a[h].sub(g).unit(),E=b.sub(g).unit(),I=E.angleWithSep(T.x,T.y),M=T.add(E).unit().mult(-1*e/Math.sin(I/2));
601r.push(g.add(M))}return r},s.aq=FA,s.ar=fr,s.as=function(a,e,r=0){return Fi(((e.x-r)*a.scale-a.x)*Rt,(e.y*a.scale-a.y)*Rt,Ge(e.z,e.y))},s.at=Oe,s.au=hn,s.av=pl,s.aw=XE,s.ax=function(a){let e=1/0,r=1/0,c=-1/0,h=-1/0;for(const m of a)e=Math.min(e,m.x),r=Math.min(r,m.y),c=Math.max(c,m.x),h=Math.max(h,m.y);return{min:new kt(e,r),max:new kt(c,h)}},s.ay=_e,s.az=ve,s.b=function(a){return Fr.API_FONTS_REGEX.test(a)},s.b$=Ue,s.b0=_m,s.b1=X0,s.b2=function(){sa.isLoading()||sa.isLoaded()||Sc()!=="deferred"||om()},s.b3=Og,s.b4=ci,s.b5=zm,s.b6=Hs,s.b7=rb,s.b8=J1,s.b9=Qt,s.bA=function(a,e){const{x:r,y:c}=a.point,h=PS(r,c,a.worldSize/a._pixelsPerMercatorPixel,0,0);return ve(h,h,F1(uu(e)))},s.bB=R,s.bC=function(a){return a[0]=0,a[1]=0,a[2]=0,a},s.bD=function(a,e){return Math.hypot(e[0]-a[0],e[1]-a[1],e[2]-a[2])},s.bE=Hi,s.bF=Yn,s.bG=Ct,s.bH=f_,s.bI=ba,s.bJ=fb,s.bK=function(a,e,r,c,h){const m=5*e+2;a.float32[m+0]=r,a.float32[m+1]=c,a.float32[m+2]=h},s.bL=Z0,s.bM=R0,s.bN=bi,s.bO=Xr,s.bP=_E,s.bQ=u3,s.bR=wE,s.bS=TE,s.bT=_b,s.bU=PA,s.bV=db,s.bW=Yb,s.bX=Ze,s.bY=ai,s.bZ=function(a,e,r){r*=.5;var c=e[0],h=e[1],m=e[2],g=e[3],b=Math.sin(r),T=Math.cos(r);return a[0]=c*T+h*b,a[1]=h*T-c*b,a[2]=m*T+g*b,a[3]=g*T-m*b,a},s.b_=on,s.ba=Ec,s.bb=Ff,s.bc=ql,s.bd=Vs,s.be=t_,s.bf=Sb,s.bg=function(a,e){const r=bd(e.zoom);if(r===0)return uu(a);const c=w0(a),h=z1(c),m=_e(c.getWest())*e.worldSize,g=_e(c.getEast())*e.worldSize,b=ye(c.getNorth())*e.worldSize,T=ye(c.getSouth())*e.worldSize,E=[m,b,0],I=[g,b,0],M=[m,T,0],k=[g,T,0],B=be([],e.globeMatrix);return ti(E,E,B),ti(I,I,B),ti(M,M,B),ti(k,k,B),h[0]=ah(h[0],M,r),h[1]=ah(h[1],k,r),h[2]=ah(h[2],I,r),h[3]=ah(h[3],E,r),Ms.fromPoints(h)},s.bh=S0,s.bi=be,s.bj=Qg,s.bk=ah,s.bl=hm,s.bm=$a,s.bn=_t,s.bo=Ee,s.bp=fv,s.bq=O0,s.br=cc,s.bs=function(a,e){const r=[];for(const c in a)c in e||r.push(c);return r},s.bt=rt,s.bu=["type","source","source-layer","minzoom","maxzoom","filter","layout"],s.bv=Za,s.bw=function(a){var e=new P(16);return e[0]=a[0],e[1]=a[1],e[2]=a[2],e[3]=a[3],e[4]=a[4],e[5]=a[5],e[6]=a[6],e[7]=a[7],e[8]=a[8],e[9]=a[9],e[10]=a[10],e[11]=a[11],e[12]=a[12],e[13]=a[13],e[14]=a[14],e[15]=a[15],e},s.bx=re,s.by=vt,s.bz=me,s.c=Al,s.c$=function(a){return a({pluginStatus:Ao,pluginURL:Na}),Ju.on("pluginStateChange",a),a},s.c0=$t,s.c1=hr,s.c2=function(a,e){return a[0]=-e[0],a[1]=-e[1],a[2]=-e[2],a[3]=e[3],a},s.c3=At,s.c4=function(a,e,r,c,h){var m,g=1/Math.tan(e/2);return a[0]=g/r,a[1]=0,a[2]=0,a[3]=0,a[4]=0,a[5]=g,a[6]=0,a[7]=0,a[8]=0,a[9]=0,a[11]=-1,a[12]=0,a[13]=0,a[15]=0,h!=null&&h!==1/0?(a[10]=(h+c)*(m=1/(c-h)),a[14]=2*h*c*m):(a[10]=-1,a[14]=-2*c),a},s.c5=function(a,e,r,c,h,m,g){var b=1/(e-r),T=1/(c-h),E=1/(m-g);return a[0]=-2*b,a[1]=0,a[2]=0,a[3]=0,a[4]=0,a[5]=-2*T,a[6]=0,a[7]=0,a[8]=0,a[9]=0,a[10]=2*E,a[11]=0,a[12]=(e+r)*b,a[13]=(h+c)*T,a[14]=(g+m)*E,a[15]=1,a},s.c6=pe,s.c7=function(a,e,r){a[4*e+0]=r[0],a[4*e+1]=r[1],a[4*e+2]=r[2],a[4*e+3]=r[3]},s.c8=$f,s.c9=ul,s.cA=ev,s.cB=ei,s.cC=r3,s.cD=function(a){const e=r3(a,!0);return R([],[e[0],e[1],e[4],e[5]])},s.cE=je,s.cF=vd,s.cG=Ve,s.cH=function(a){const{x:e,y:r}=a.point,{lng:c,lat:h}=a._center;return PS(e,r,a.worldSize,c,h)},s.cI=Li,s.cJ=ie,s.cK=ro,s.cL=w,s.cM=function(a,e,r){let c=0;for(let h=0;h<2;++h)a[h]>0&&(c+=(a[h]-0)*(a[h]-0)),e[h]<0&&(c+=(0-e[h])*(0-e[h]));return c},s.cN=45,s.cO=Ou,s.cP=xe,s.cQ=xm,s.cR=function(a,e,r){const c=Math.sqrt(a*a+e*e+r*r),h=c>0?Math.acos(r/c)*Qe:0;let m=a!==0||e!==0?Math.atan2(-e,-a)*Qe+90:0;return m<0&&(m+=360),[c,m,h]},s.cS=Fi,s.cT=Be,s.cU=ki,s.cV=Ms,s.cW=Jn,s.cX=function(a){return[Math.pow(a[0],1/2.2),Math.pow(a[1],1/2.2),Math.pow(a[2],1/2.2)]},s.cY=wi,s.cZ=Db,s.c_=function(a,e){return a.readFields(O5,{icons:[]},e)},s.ca=Vf,s.cb=cr,s.cc=vm,s.cd=Z,s.ce=jA,s.cf=function(){var a=new P(4);return P!=Float32Array&&(a[1]=0,a[2]=0),a[0]=1,a[3]=1,a},s.cg=function(a,e,r){var c=e[0],h=e[1],m=e[2],g=e[3],b=Math.sin(r),T=Math.cos(r);return a[0]=c*T+m*b,a[1]=h*T+g*b,a[2]=c*-b+m*T,a[3]=h*-b+g*T,a},s.ch=function(a,e){return a[0]===e[0]&&a[1]===e[1]&&a[2]===e[2]&&a[3]===e[3]},s.ci=Fe,s.cj=function(a){return Math.hypot(a[0],a[1],a[2],a[3])},s.ck=Us,s.cl=ts,s.cm=Zr,s.cn=Hf,s.co=o3,s.cp=_s,s.cq=CS,s.cr=function(a,e,r,c,h,m,g,b,T){if(T.name==="globe")return CS(a,e,new _s(r,c,h),!1);const E=g_({z:r,x:c,y:h},T);return new Ms([(m+E.x/E.scale)*e,e*(E.y/E.scale),g],[(m+E.x2/E.scale)*e,e*(E.y2/E.scale),b])},s.cs=function(a,e,r){return a[0]=Math.min(e[0],r[0]),a[1]=Math.min(e[1],r[1]),a[2]=Math.min(e[2],r[2]),a[3]=Math.min(e[3],r[3]),a},s.ct=function(a,e,r){return a[0]=Math.max(e[0],r[0]),a[1]=Math.max(e[1],r[1]),a[2]=Math.max(e[2],r[2]),a[3]=Math.max(e[3],r[3]),a},s.cu=function(a){const e=Math.round((a+45+360)%360/90)%4;return ge[e]},s.cv=Ne,s.cw=Wt,s.cx=S,s.cy=function(a){const e=re(new Float64Array(16));ve(e,a.pixelMatrix,a.globeMatrix);const r=[0,F,0],c=[0,O,0];return ti(r,r,e),ti(c,c,e),[r[0]>0&&r[0]<=a.width&&r[1]>0&&r[1]<=a.height&&!N1(a,new Z(a.center.lat,90)),c[0]>0&&c[0]<=a.width&&c[1]>0&&c[1]<=a.height&&!N1(a,new Z(a.center.lat,-90))]},s.cz=function(a,e){const{scale:r}=a.tileTransform,c=r*Rt/(a.tileSize*Math.pow(2,e.zoom-a.tileID.overscaledZ+a.tileID.canonical.z));return function(h,m,g){var b=m[1],T=m[2],E=m[3],I=g[0],M=g[1];return h[0]=m[0]*I,h[1]=b*I,h[2]=T*M,h[3]=E*M,h}(new Float32Array(4),e.inverseAdjustmentMatrix,[c,c])},s.d=function(a){return Fr.API_TILEJSON_REGEX.test(a)},s.d$=Xg,s.d0=rv,s.d1=Am,s.d2=mb,s.d3=_n,s.d4=Ul,s.d5=kr,s.d6=uo,s.d7=Qi,s.d8=function(a){const e=a.indexOf(Lf);return e>=0?a.slice(0,e):a},s.d9=function(a){return a.indexOf(Lf)>=0},s.dA=MS,s.dB=Wr,s.dC=Gr,s.dD=256,s.dE=function(a,e){const r=[0,0,0];return ti(r,r,S0(uu(e.canonical))),ti(r,r,a),r},s.dF=a=>({u_camera_to_center_distance:new cr(a),u_extrude_scale:new Va(a),u_device_pixel_ratio:new cr(a),u_matrix:new $f(a),u_inv_rot_matrix:new $f(a),u_merc_center:new ul(a),u_tile_id:new Vf(a),u_zoom_transition:new cr(a),u_up_dir:new Vf(a),u_emissive_strength:new cr(a)}),s.dG=a=>({u_matrix:new $f(a),u_pixels_to_tile_units:new Va(a),u_device_pixel_ratio:new cr(a),u_width_scale:new cr(a),u_floor_width_scale:new cr(a),u_units_to_pixels:new ul(a),u_dash_image:new vm(a),u_gradient_image:new vm(a),u_image_height:new cr(a),u_texsize:new ul(a),u_tile_units_to_pixels:new cr(a),u_alph
vendor: 4,624 bytes, line 601
601a_discard_threshold:new cr(a),u_trim_offset:new ul(a),u_trim_fade_range:new ul(a),u_trim_color:new xm(a),u_emissive_strength:new cr(a),u_zbias_factor:new cr(a),u_tile_to_meter:new cr(a),u_ground_shadow_factor:new Vf(a)}),s.dH=a=>({u_matrix:new $f(a),u_texsize:new ul(a),u_pixels_to_tile_units:new Va(a),u_device_pixel_ratio:new cr(a),u_width_scale:new cr(a),u_floor_width_scale:new cr(a),u_image:new vm(a),u_units_to_pixels:new ul(a),u_tile_units_to_pixels:new cr(a),u_alpha_discard_threshold:new cr(a),u_trim_offset:new ul(a),u_trim_fade_range:new ul(a),u_trim_color:new xm(a),u_emissive_strength:new cr(a),u_zbias_factor:new cr(a),u_tile_to_meter:new cr(a),u_ground_shadow_factor:new Vf(a),u_pattern_transition:new cr(a)}),s.dI=Of,s.dJ=NO,s.dK=LS,s.dL=(a,e,r,c,h,m)=>{const g=a.transform,b=g.projection.name==="globe";let T;if(m.paint.get("circle-pitch-alignment")==="map")if(b){const I=MS(g.zoom,e.canonical)*g._pixelsPerMercatorPixel;T=Float32Array.from([I,0,0,I])}else T=g.calculatePixelsToTileUnitsMatrix(r);else T=new Float32Array([g.pixelsToGLUnits[0],0,0,g.pixelsToGLUnits[1]]);const E={u_camera_to_center_distance:a.transform.getCameraToCenterDistance(g.projection),u_matrix:a.translatePosMatrix(e.projMatrix,r,m.paint.get("circle-translate"),m.paint.get("circle-translate-anchor")),u_device_pixel_ratio:jo.devicePixelRatio,u_extrude_scale:T,u_inv_rot_matrix:RR,u_merc_center:[0,0],u_tile_id:[0,0,0],u_zoom_transition:0,u_up_dir:[0,0,0],u_emissive_strength:m.paint.get("circle-emissive-strength")};if(b){E.u_inv_rot_matrix=c,E.u_merc_center=h,E.u_tile_id=[e.canonical.x,e.canonical.y,1<<e.canonical.z],E.u_zoom_transition=bd(g.zoom);const I=h[0]*Rt,M=h[1]*Rt;E.u_up_dir=g.projection.upVector(new _s(0,0,0),I,M)}return E},s.dM=QE,s.dN=So,s.dO=(a,e,r,c,h,m,g,b,T,E)=>{const I=a.transform,M=I.pitch<15?YE(.07,.7,ke((14-I.zoom)/5,0,1)):.07,k=r.paint.get("line-trim-color-use-theme").constantOr("default")==="none";return{u_matrix:JE(a,e,r,c),u_texsize:e.imageAtlasTexture?e.imageAtlasTexture.size:[0,0],u_pixels_to_tile_units:I.calculatePixelsToTileUnitsMatrix(e),u_device_pixel_ratio:h,u_width_scale:m,u_floor_width_scale:g,u_image:0,u_tile_units_to_pixels:KE(e,I),u_units_to_pixels:[1/I.pixelsToGLUnits[0],1/I.pixelsToGLUnits[1]],u_alpha_discard_threshold:0,u_trim_offset:b,u_trim_fade_range:r.paint.get("line-trim-fade-range"),u_trim_color:r.paint.get("line-trim-color").toRenderColor(k?null:r.lut).toArray01(),u_emissive_strength:r.paint.get("line-emissive-strength"),u_zbias_factor:M,u_tile_to_meter:Be(e.tileID.canonical,0),u_ground_shadow_factor:T,u_pattern_transition:E}},s.dP=(a,e,r,c,h,m,g,b,T,E)=>{const I=a.transform,M=I.calculatePixelsToTileUnitsMatrix(e),k=r.paint.get("line-trim-color-use-theme").constantOr("default")==="none",B=I.pitch<15?YE(.07,.7,ke((14-I.zoom)/5,0,1)):.07;return{u_matrix:JE(a,e,r,c),u_pixels_to_tile_units:M,u_device_pixel_ratio:m,u_width_scale:g,u_floor_width_scale:b,u_units_to_pixels:[1/I.pixelsToGLUnits[0],1/I.pixelsToGLUnits[1]],u_dash_image:0,u_gradient_image:1,u_image_height:h,u_texsize:eA(r)&&e.lineAtlasTexture?e.lineAtlasTexture.size:[0,0],u_tile_units_to_pixels:KE(e,a.transform),u_alpha_discard_threshold:0,u_trim_offset:T,u_trim_fade_range:r.paint.get("line-trim-fade-range"),u_trim_color:r.paint.get("line-trim-color").toRenderColor(k?null:r.lut).toArray01(),u_emissive_strength:r.paint.get("line-emissive-strength"),u_zbias_factor:B,u_tile_to_meter:Be(e.tileID.canonical,0),u_ground_shadow_factor:E}},s.dQ=qt,s.dR=e_,s.dS=Ge,s.dT=zE,s.dU=fl,s.dV=L0,s.dW=Sd,s.dX=450,s.dY=7,s.dZ=v5,s.d_=Rn,s.da=function(a){const e=a.lastIndexOf(Lf);return e>=0?a.slice(e+1):""},s.db=function(a){const e=[],r=a.id;return r===void 0&&e.push({message:`layers.${r}: missing required property "id"`}),a.render===void 0&&e.push({message:`layers.${r}: missing required method "render"`}),a.renderingMode&&a.renderingMode!=="2d"&&a.renderingMode!=="3d"&&e.push({message:`layers.${r}: property "renderingMode" must be either "2d" or "3d"`}),e},s.dc=function(a,e,r,c){return a.type==="custom"?new x5(a,e):new D5[a.type](a,e,r,c)},s.dd=Ri,s.de=function(a){const e=a.indexOf(Lf);return e>=0?a.slice(e+1):""},s.df=class extends zm{constructor(a,e){super(a._vectorTileFeature,a._z,a._x,a._y,a.id),a.state&&(this.state=Object.assign({},a.state)),this.target=e.target,this.namespace=e.namespace,e.properties&&(this.properties=e.properties),this.target&&("featuresetId"in this.target&&!this.target.importId||"layerId"in this.target)&&(this.source=a.source,this.sourceLayer=a.sourceLayer,this.layer=a.layer)}toJSON(){const a=super.toJSON();return a.target=this.target,a.namespace=this.namespace,a}}
601,s.dg=Ju,s.dh=Uc,s.di=x0,s.dj=class extends Wl{constructor(a){super(a),this.current=b0}set(a,e,r){if(this.fetchUniformLocation(a,e)){for(let c=0;c<9;c++)if(r[c]!==this.current[c]){this.current=r,this.gl.uniformMatrix3fv(this.location,!1,r);break}}}},s.dk=Ie,s.dl=function(a,e,r){const c=bd(r.zoom),h=a.style.map._antialias,m=a.terrain&&a.terrain.exaggeration()>0;return c===0&&!h&&!m},s.dm=function(a){const e=a.pixelsPerMeter,r=e/pe(1,a.center.lat),c=re(new Float64Array(16));return Ee(c,c,[a.point.x,a.point.y,0]),je(c,c,[r,r,e]),Float32Array.from(c)},s.dn=w0,s.dp=function(a){const e=Ne-5;a=ke(a,-80.051129,e)/e*90;const r=Math.pow(Math.abs(Math.sin(X(a))),3);return Math.round(r*(L.length-1))},s.dq=function(a,e,r,c){const h=e.getNorth(),m=e.getSouth(),g=e.getWest(),b=e.getEast(),T=1<<a.z,E=b-g,I=h-m,M=E/D,k=-I/L[r],B=[0,M,0,k,0,0,h,g,0];if(a.z>0){const N=180/c;Q(B,B,[N/E+1,0,0,0,N/I+1,0,-.5*N/M,.5*N/k,1])}return B[2]=T,B[5]=a.x,B[8]=a.y,B},s.dr=uu,s.ds=function(a,e,r){const c=re(new Float64Array(16)),h=(e/(1<<a)-.5)*Math.PI*2;return Je(c,r.globeMatrix,h),Float32Array.from(c)},s.dt=class{isDataAvailableAtPoint(a){const e=this._source();if(this.isUsingMockSource()||!e||a.y<0||a.y>1)return!1;const r=e.getSource().maxzoom,c=1<<r,h=Math.floor(a.x),m=Math.floor((a.x-h)*c),g=Math.floor(a.y*c),b=this.findDEMTileFor(new ar(r,h,r,m,g));return!(!b||!b.dem)}getAtPointOrZero(a,e=0){return this.getAtPoint(a,e)||0}getAtPoint(a,e,r=!0){if(this.isUsingMockSource())return null;e==null&&(e=null);const c=this._source();if(!c||a.y<0||a.y>1)return e;const h=c.getSource().maxzoom,m=1<<h,g=Math.floor(a.x),b=a.x-g,T=new ar(h,g,h,Math.floor(b*m),Math.floor(a.y*m)),E=this.findDEMTileFor(T);if(!E||!E.dem)return e;const I=E.dem,M=1<<E.tileID.canonical.z,k=(b*M-E.tileID.canonical.x)*I.dim,B=(a.y*M-E.tileID.canonical.y)*I.dim,N=Math.floor(k),U=Math.floor(B);return(r?this.exaggeration():1)*gi(gi(I.get(N,U),I.get(N,U+1),B-U),gi(I.get(N+1,U),I.get(N+1,U+1),B-U),k-N)}getAtTileOffset(a,e,r){const c=1<<a.canonical.z;return this.getAtPointOrZero(new We(a.wrap+(a.canonical.x+e/Rt)/c,(a.canonical.y+r/Rt)/c))}getAtTileOffsetFunc(a,e,r,c){return h=>{const m=this.getAtTileOffset(a,h.x,h.y),g=c.upVector(a.canonical,h.x,h.y);return Ue(g,g,m*c.upVectorScale(a.canonical,e,r).metersToTile),g}}getForTilePoints(a,e,r,c){if(this.isUsingMockSource())return!1;const h=Pm.create(this,a,c);return!!h&&(e.forEach(m=>{m[2]=this.exaggeration()*h.getElevationAt(m[0],m[1],r)}),!0)}getMinMaxForTile(a){if(this.isUsingMockSource())return null;const e=this.findDEMTileFor(a);if(!e||!e.dem)return null;const r=e.dem.tree,c=e.tileID,h=1<<a.canonical.z-c.canonical.z;let m=a.canonical.x/h-c.canonical.x,g=a.canonical.y/h-c.canonical.y,b=0;for(let T=0;T<a.canonical.z-c.canonical.z&&!r.leaves[b];T++){m*=2,g*=2;const E=2*Math.floor(g)+Math.floor(m);b=r.childOffsets[b]+E,m%=1,g%=1}
601return{min:this.exaggeration()*r.minimums[b],max:this.exaggeration()*r.maximums[b]}}getMinElevationBelowMSL(){throw new Error("Pure virtual method called.")}raycast(a,e,r){throw new Error("Pure virtual method called.")}pointCoordinate(a){throw new Error("Pure virtual method called.")}_source(){throw new Error("Pure virtual method called.")}isUsingMockSource(){throw new Error("Pure virtual method called.")}exaggeration(){throw new Error("Pure virtual method called.")}findDEMTileFor(a){throw new Error("Pure virtual method called.")}get visibleDemTiles(){throw new Error("Getter must be implemented in subclass.")}getMinMaxForVisibleTiles(){const a=this.visibleDemTiles;if(a.length===0)return null;let e=!1,r=Number.MAX_VALUE,c=Number.MIN_VALUE;for(const h of a){const m=this.getMinMaxForTile(h.tileID);m&&(r=Math.min(r,m.min),c=Math.max(c,m.max),e=!0)}return e?{min:r,max:c}:null}},s.du=US,s.dv=xd,s.dw=function(a,e){return[Math.pow(a[0],2.2)*e,Math.pow(a[1],2.2)*e,Math.pow(a[2],2.2)*e]},s.dx=V,s.dy=function(a,e){var r=Math.sin(e),c=Math.cos(e);return a[0]=c,a[1]=r,a[2]=0,a[3]=-r,a[4]=c,a[5]=0,a[6]=0,a[7]=0,a[8]=1,a},s.dz=qi,s.e=Fr,s.e$=lC,s.e0=256,s.e1=F1,s.e2=Hl,s.e3=Je,s.e4=function(a,e){return a[0]=e[0],a[1]=e[1],a[2]=e[2],a[3]=e[4],a[4]=e[5],a[5]=e[6],a[6]=e[8],a[7]=e[9],a[8]=e[10],a},s.e5=lu,s.e6=zf,s.e7=function(a,e,r,c,h){return ke((a-e)/(r-e)*(h-c)+c,c,h)},s.e8=Ci,s.e9=function(a,e){var r=e[0],c=e[1],h=e[2],m=e[3],g=e[4],b=e[5],T=e[6],E=e[7],I=e[8],M=I*g-b*E,k=-I*m+b*T,B=E*m-g*T,N=r*M+c*k+h*B;return N?(a[0]=M*(N=1/N),a[1]=(-I*c+h*E)*N,a[2]=(b*c-h*g)*N,a[3]=k*N,a[4]=(I*r-h*T)*N,a[5]=(-b*r+h*m)*N,a[6]=B*N,a[7]=(-E*r+c*T)*N,a[8]=(g*r-c*m)*N,a):null},s.eA=function(a,e,r){return a[0]=e[0]/r[0],a[1]=e[1]/r[1],a[2]=e[2]/r[2],a},s.eB=dt,s.eC=q,s.eD=ps,s.eE=function(a,e,r,c){return a[0]=e,a[1]=r,a[2]=c,a},s.eF=function([a,e,r]){const c=Math.hypot(a,e,r),h=Math.atan2(a,r),m=.5*Math.PI-Math.acos(-e/c);return new Z(ie(h),ie(m))},s.eG=Ti,s.eH=Mb,s.eI=function(a){const e=a.navigator?a.navigator.userAgent:null;return!!function(r){if(ir==null){const c=r.navigator?r.navigator.userAgent:null;ir=!!r.safari||!(!c||!(/\b(iPad|iPhone|iPod)\b/.test(c)||c.match("Safari")&&!c.match("Chrome")))}return ir}(a)&&!(!e||!(e.match("Version/15.4")||e.match("Version/15.5")||e.match(/CPU (OS|iPhone OS) (15_4|15_5) like Mac OS X/)))},s.eJ=function(a,e){Do=a,Uo=e},s.eK=N1,s.eL=DS,s.eM=function(a){const e=[0,0,0],r=re(new Float64Array(16));return ve(r,a.pixelMatrix,a.globeMatrix),ti(e,e,r),new kt(e[0],e[1])},s.eN=function(a,e,r=!1){if(Ao===kf||Ao===ll||Ao===nu)throw new Error("setRTLTextPlugin cannot be called multiple times.");Na=jo.resolveURL(a),Ao=kf,cd=e,Ku(),r||om()},s.eO=Sc,s.eP=function(){rv().acquire(zb)},s.eQ=function(){const a=S_;a&&(a.isPreloaded()&&a.numActive()===1?(a.release(zb),S_=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()"))},s.eR=ep,s.eS=function(a){const e=Fh();if(!e)return;const r=e.delete(Po);a&&r.then(()=>a()).catch(a)},s.eT=T_,s.eU=J3,s.eV=function(a){Wb=jo.resolveURL(a),Om||(Om=new Dm(rv(),new kl)),Om.broadcast("setDracoUrl",Wb)},s.eW=Q3,s.eX=function(a){Rm=jo.resolveURL(a),Om||(Om=new Dm(rv(),new kl)),Om.broadcast("setMeshoptUrl",Rm)},s.eY=Vt,s.eZ=wd,s.e_=Mc,s.ea=ot,s.eb=On,s.ec=st,s.ed=class{constructor(a,e,r,c){this.context=a,this.format=c,this.size=r,this.texture=a.gl.createTexture();const[h,m,g]=this.size,{gl:b}=a;b.bindTexture(b.TEXTURE_3D,this.texture),a.pixelStoreUnpackFlipY.set(!1),a.pixelStoreUnpack.set(1),a.pixelStoreUnpackPremultiplyAlpha.set(!1),b.texImage3D(b.TEXTURE_3D,0,this.format,h,m,g,0,Eb(this.format),Ab(this.format),e.data)}bind(a,e){const{context:r}=this,{gl:c}=r;c.bindTexture(c.TEXTURE_3D,this.texture),a!==this.minFilter&&(c.texParameteri(c.TEXTURE_3D,c.TEXTURE_MAG_FILTER,a),c.texParameteri(c.TEXTURE_3D,c.TEXTURE_MIN_FILTER,a),this.minFilter=a),e!==this.wrapS&&(c.texParameteri(c.TEXTURE_3D,c.TEXTURE_WRAP_S,e),c.texParameteri(c.TEXTURE_3D,c.TEXTURE_WRAP_T,e),this.wrapS=e)}destroy(){const{gl:a}=this.context;a.deleteTexture(this.texture),this.texture=null}},s.ee=function(a,e){if(a===e){var r=e[1],c=e[2],h=e[3],m=e[6],g=e[7],b=e[11];a[1]=e[4],a[2]=e[8],a[3]=e[12],a[4]=r,a[6]=e[9],a[7]=e[13],a[8]=c,a[9]=m,a[11]=e[14],a[12]=h,a[13]=g,a[14]=b}else a[0]=e[0],a[1]=e[4],a[2]=e[8],a[3]=e[12],a[4]=e[1],a[5]=e[5],a[6]=e[9],a[7]=e[13],a[8]=e[2],a[9]=e[6],a[10]=e[10],a[11]=e[14],a[12]=e[3],a[13]=e[7],a[14]=e[11],a[15]=e[15];return a},s.ef=Pb,s.eg=Yt,s.eh=[1,1,1],s.ei=function(a,e,r,c){var h=new P(4);return h[0]=a,h[1]=e,h[2]=r,h[3]=c,h},s.ej=Ft,s.ek=function(a,e,r,c){var h=e[0],m=e[1],g=e[2],b=e[3];return a[0]=h+c*(r[0]-h),a[1]=m+c*(r[1]-m),a[2]=g+c*(r[2]-g),a[3]=b+c*(r[3]-b),a},s.el=Pm,s.em=Mm,s.en=au,s.eo=sh,s.ep=function(a,e,r,c,h,m,g,b,T,E,I,M,k,B,N,U){var Y=new P(16);return Y[0]=a,Y[1]=e,Y[2]=r,Y[3]=c,Y[4]=h,Y[5]=m,Y[6]=g,Y[7]=b,Y[8]=T,Y[9]=E,Y[10]=I,Y[11]=M,Y[12]=k,Y[13]=B,Y[14]=N,Y[15]=U,Y},s.eq=W,s.er=mm,s.es=qg,s.et=class{constructor(){this._updateTime=0,this._sourceIds=[],this._activeRegions=[],this._prevRegions=[],this._globalClipBounds={min:new kt(1/0,1/0),max:new kt(-1/0,-1/0)}}clear(){this._activeRegions.length>0&&++this._updateTime,this._activeRegions=[],this._prevRegions=[]}get updateTime(){return this._updateTime}getReplacementRegionsForTile(a,e=!1){const r=vE(new kt(0,0),new kt(Rt,Rt),a),c=[];if(e&&!eb(r,this._globalClipBounds))return c;for(const h of this._activeRegions){if(h.hiddenByOverlap||!eb(r,h))continue;const m=hO(h.min,h.max,a);c.push({min:m.min,max:m.max,sourceId:this._sourceIds[h.priority],footprint:h.footprint,footprintTileId:h.tileId,order:h.order,clipMask:h.clipMask,clipScope:h.clipScope})}return c}setSources(a){this._setSources(a.map(e=>({getSourceId:()=>e.cache.id,getFootprints:()=>{const r=[];for(const c of e.cache.getVisibleCoordinates()){const h=e.cache.getTile(c).buckets[e.layer];h&&h.updateFootprints(c.toUnwrapped(),r)}return r},getOrder:()=>e.order,getClipMask:()=>e.clipMask,getClipScope:()=>e.clipScope})))}_addSource(a){const e=a.getFootprints();if(e.length===0)return;const r=a.getOrder(),c=a.getClipMask(),h=a.getClipScope();for(const m of e){if(!m.footprint)continue;const g=vE(m.footprint.min,m.footprint.max,m.id);this._activeRegions.push({min:g.min,max:g.max,hiddenByOverlap:!1,priority:this._sourceIds.length,tileId:m.id,footprint:m.footprint,order:r,clipMask:c,clipScope:h})}this._sourceIds.push(a.getSourceId())}_computeReplacement(){this._activeRegions.sort((e,r)=>e.priority-r.priority||D0(e.min,r.min)||D0(e.max,r.max)||e.order-r.order||e.clipMask-r.clipMask||function(c,h){const m=(g,b)=>g+b;return c.length-h.length||c.reduce(m,"").localeCompare(h.reduce(m,""))}(e.clipScope,r.clipScope));let a=this._activeRegions.length!==this._prevRegions.length;if(!a){let e=0;for(;!a&&e!==this._activeRegions.length;){const r=this._activeRegions[e],c=this._prevRegions[e];a=r.priority!==c.priority||!yE(r,c)||r.order!==c.order||r.clipMask!==c.clipMask||!Za(r.clipScope,c.clipScope),++e}}if(a){++this._updateTime;for(const r of this._activeRegions)r.order!==P0&&(this._globalClipBounds.min.x=Math.min(this._globalClipBounds.min.x,r.min.x),this._globalClipBounds.min.y=Math.min(this._globalClipBounds.min.y,r.min.y),this._globalClipBounds.max.x=Math.max(this._globalClipBounds.max.x,r.max.x),this._globalClipBounds.max.y=Math.max(this._globalClipBounds.max.y,r.max.y));const e=r=>{const c=this._activeRegions;if(r>=c.length)return r;const h=c[r].priority;for(;r<c.length&&c[r].priority===h;)++r;return r};if(this._sourceIds.length>1){let r=0,c=e(r);for(;r!==c;){let h=r;
vendor: 4,918 bytes, line 601
601const m=r;for(;h!==c;){const g=this._activeRegions[h];g.hiddenByOverlap=!1;for(let b=0;b<m;b++){const T=this._activeRegions[b];if(!T.hiddenByOverlap&&g.order===P0&&eb(g,T)&&(g.hiddenByOverlap=bE(g.footprint,g.tileId,T.footprint,T.tileId),g.hiddenByOverlap))break}++h}r=c,c=e(r)}}}}_setSources(a){[this._prevRegions,this._activeRegions]=[this._activeRegions,[]],this._sourceIds=[];for(let e=a.length-1;e>=0;e--)this._addSource(a[e]);this._computeReplacement()}},s.eu=class{constructor(a){this._createGrid(a),this._createPoles(a)}destroy(){this._poleIndexBuffer.destroy(),this._gridBuffer.destroy(),this._gridIndexBuffer.destroy(),this._poleNorthVertexBuffer.destroy(),this._poleSouthVertexBuffer.destroy();for(const a of this._poleSegments)a.destroy();for(const a of this._gridSegments)a.withSkirts.destroy(),a.withoutSkirts.destroy()}_fillGridMeshWithLods(a,e){const r=new Ec,c=new Vr,h=[],m=a+1+2,g=e[0]+1,b=e[0]+1+(1+e.length),T=(E,I,M)=>{let k=E===m-1?E-2:E===0?E:E-1;return k+=M?24575:0,[k,I]};for(let E=0;E<m;++E)r.emplaceBack(...T(E,0,!0));for(let E=0;E<g;++E)for(let I=0;I<m;++I)r.emplaceBack(...T(I,E,(I===0||I===m-1)&&!0));for(let E=0;E<e.length;++E){const I=e[E];for(let M=0;M<m;++M)r.emplaceBack(...T(M,I,!0))}for(let E=0;E<e.length;++E){const I=c.length,M=e[E]+1+2,k=new Vr;for(let U=0;U<M-1;U++){const Y=U===M-2,J=Y?m*(b-e.length+E-U):m;for(let ae=0;ae<m-1;ae++){const ne=U*m+ae;U===0||Y||ae===0||ae===m-2?(k.emplaceBack(ne+1,ne,ne+J),k.emplaceBack(ne+J,ne+J+1,ne+1)):(c.emplaceBack(ne+1,ne,ne+J),c.emplaceBack(ne+J,ne+J+1,ne+1))}}const B=Vs.simpleSegment(0,I,r.length,c.length-I);for(let U=0;U<k.uint16.length;U+=3)c.emplaceBack(k.uint16[U],k.uint16[U+1],k.uint16[U+2]);const N=Vs.simpleSegment(0,I,r.length,c.length-I);h.push({withoutSkirts:B,withSkirts:N})}return{vertices:r,indices:c,segments:h}}_createGrid(a){const e=this._fillGridMeshWithLods(D,L);this._gridSegments=e.segments,this._gridBuffer=a.createVertexBuffer(e.vertices,ql.members),this._gridIndexBuffer=a.createIndexBuffer(e.indices,!0)}_createPoles(a){const e=new Vr;for(let g=0;g<=D;g++)e.emplaceBack(0,g+1,g+2);this._poleIndexBuffer=a.createIndexBuffer(e,!0);const r=new lu,c=new lu,h=new lu,m=new lu;this._poleSegments=[];for(let g=0,b=0;g<w;g++){const T=360/(1<<g);r.emplaceBack(0,-v,0,.5,0),c.emplaceBack(0,-v,0,.5,1),h.emplaceBack(0,-v,0,.5,.5),m.emplaceBack(0,-v,0,.5,.5);for(let E=0;E<=D;E++){let I=E/D,M=0;const k=gi(0,T,I),[B,N,U]=$(kR,LR,k,v);r.emplaceBack(B,N,U,I,M),c.emplaceBack(B,N,U,I,1-M);const Y=X(k);I=.5+.5*Math.sin(Y),M=.5+.5*Math.cos(Y),h.emplaceBack(B,N,U,I,M),m.emplaceBack(B,N,U,I,1-M)}this._poleSegments.push(Vs.simpleSegment(b,0,66,64)),b+=66}this._poleNorthVertexBuffer=a.createVertexBuffer(r,ra,!1),this._poleSouthVertexBuffer=a.createVertexBuffer(c,ra,!1),this._texturedPoleNorthVertexBuffer=a.createVertexBuffer(h,ra,!1),this._texturedPoleSouthVertexBuffer=a.createVertexBuffer(m,ra,!1)}getGridBuffers(a,e){return[this._gridBuffer,this._gridIndexBuffer,e?this._gridSegments[a].withSkirts:this._gridSegments[a].withoutSkirts]}getPoleBuffers(a,e){return[e?this._texturedPoleNorthVertexBuffer:this._poleNorthVertexBuffer,e?this._texturedPoleSouthVertexBuffer:this._poleSouthVertexBuffer,this._poleIndexBuffer,this._poleSegments[a]]}},s.ev=P0,s.ew=Ce,s.ex=function(){return!!document.fullscreenElement||!!document.webkitFullscreenElement},s.ey=De,s.ez=Et,s.f=function(a){return a.indexOf("mapbox:")===0},s.f0=cC,s.f1=WE,s.f2=Wf,s.f3="hd_road_elevation",s.f4=X1,s.f5=Pi,s.f6=Zf,s.f7=pb,s.f8=Yf,s.f9=function(a,e,r,c,h,m,g,b=1,T,E){a.createArrays(),a.tilePixelRatio=Rt/(512*a.overscaling),a.compareText={},a.iconsNeedLinear=!1;const I=a.layers[0].layout,M=a.layers[0]._unevaluatedLayout._values,k={};k.scaleFactor=b,k.textSizeScaleRange=I.get("text-size-scale-range"),k.iconSizeScaleRange=I.get("icon-size-scale-range");const[B,N]=k.textSizeScaleRange,[U,Y]=k.iconSizeScaleRange;k.textScaleFactor=ke(k.scaleFactor,B,N),k.iconScaleFactor=ke(k.scaleFactor,U,Y);const J=M["text-size"],ae=M["icon-size"];if(a.textSizeData.kind==="composite"){const{minZoom:Te,maxZoom:Me}=a.textSizeData;k.compositeTextSizes=[J.possiblyEvaluate(new Un(Te),m),J.possiblyEvaluate(new Un(Me),m)]}if(a.iconSizeData.kind==="composite"){const{minZoom:Te,maxZoom:Me}=a.iconSizeData;k.compositeIconSizes=[ae.possiblyEvaluate(new Un(Te),m),ae.possiblyEvaluate(new Un(Me),m)]}k.layoutTextSize=J.possiblyEvaluate(new Un(g+1),m),k.layoutIconSize=ae.possiblyEvaluate(new Un(g+1),m),k.textMaxSize=J.possiblyEvaluate(new Un(18),m);const ne=I.get("symbol-placement"),G=I.get("text-rotation-alignment")==="map"&&ne!=="point",te=I.get("text-size");let oe=!1;const he=[];for(const Te of a.features){const Me=I.get("text-font").evaluate(Te,{},m).join(","),Pe=te.evaluate(Te,{},m)*k.textScaleFactor,ze=k.layoutTextSize.evaluate(Te,{},m)*k.textScaleFactor,tt=k.layoutIconSize.evaluate(Te,{},m)*k.iconScaleFactor,mt={horizontal:{},vertical:void 0},ut=Te.text;
601let pt,bt=[0,0];if(ut){const ri=ut.toString(),Oi=I.get("text-letter-spacing").evaluate(Te,{},m)*Xr,Xi=I.get("text-line-height").evaluate(Te,{},m)*Xr,Ji=kg(ri)?Oi:0,ln=I.get("text-anchor").evaluate(Te,{},m),rn=I.get("text-variable-anchor");if(!rn){const de=I.get("text-radial-offset").evaluate(Te,{},m);if(de)bt=PA(ln,[de*Xr,gb]);else{const nt=I.get("text-offset").evaluate(Te,{},m);bt=[nt[0]*Xr,nt[1]*Xr]}}let nn=G?"center":I.get("text-justify").evaluate(Te,{},m);const as=ne==="point",ys=as?I.get("text-max-width").evaluate(Te,{},m)*Xr:1/0,le=de=>{a.allowVerticalPlacement&&Mf(ri)&&(mt.vertical=hb(ut,e,r,h,Me,ys,Xi,ln,de,Ji,bt,ba.vertical,!0,ze,Pe,T))};if(!G&&rn){const de=nn==="auto"?rn.map(Pt=>_b(Pt)):[nn];let nt=!1;for(let Pt=0;Pt<de.length;Pt++){const jt=de[Pt];if(!mt.horizontal[jt])if(nt)mt.horizontal[jt]=mt.horizontal[0];else{const Nt=hb(ut,e,r,h,Me,ys,Xi,"center",jt,Ji,bt,ba.horizontal,!1,ze,Pe,T);Nt&&(mt.horizontal[jt]=Nt,nt=Nt.positionedLines.length===1)}}le("left")}else{if(nn==="auto"&&(nn=_b(ln)),as||I.get("text-writing-mode").indexOf("horizontal")>=0||!Mf(ri)){const de=hb(ut,e,r,h,Me,ys,Xi,ln,nn,Ji,bt,ba.horizontal,!1,ze,Pe,T);de&&(mt.horizontal[nn]=de)}le(as?"left":nn)}}let Ye,ft,qe,et,Tt,St,li,Jt=!1;if(Te.icon&&Te.icon.hasPrimary()){const ri=kA(Te.icon,a.iconSizeData,M["icon-size"],m,a.zoom,Te,T,k.iconScaleFactor);Ye=ri.iconPrimary,qe=ri.iconSecondary;const Oi=Ye.toString();if(ft=c.get(Oi),ft&&(Tt=I.get("icon-offset").evaluate(Te,{},m),St=I.get("icon-anchor").evaluate(Te,{},m),li=I.get("icon-text-fit").evaluate(Te,{},m),pt=YO(h.get(Oi),qe?h.get(qe.toString()):void 0,Tt,St),Jt=ft.sdf,a.sdfIcons===void 0?a.sdfIcons=ft.sdf:a.sdfIcons!==ft.sdf&&Yi("Style sheet warning: Cannot mix SDF and non-SDF icons in one buffer"),(ft.pixelRatio!==a.pixelRatio||I.get("icon-rotate").constantOr(1)!==0)&&(a.iconsNeedLinear=!0)),qe){const Xi=qe.toString();et=c.get(Xi)}}oe=oe||!(!Te.icon||!Te.icon.hasSecondary());const Bt=yb(mt.horizontal)||mt.vertical;
601a.iconsInText||(a.iconsInText=!!Bt&&Bt.iconsInText);const wt=ze*k.textScaleFactor/Xr,{defaultShapedIcon:Ni,verticallyShapedIcon:si}=r5(a,pt,I,Te,m,mt,wt,Tt,li);li!=="none"&&pt&&(pA(pt)||mA(pt))&&($0(0,ft,Ye,pt,Ni,li,E,c,h),$0(0,et,qe,pt,Ni,li,E,c,h),si&&($0(0,ft,Ye,pt,si,li,E,c,h),$0(0,et,qe,pt,si,li,E,c,h))),pt=Ni,he.push({feature:Te,shapedTextOrientations:mt,shapedText:Bt,shapedIcon:pt,iconPrimary:Ye,iconSecondary:qe,iconOffset:Tt,iconAnchor:St,verticallyShapedIcon:si,layoutTextSize:ze,layoutIconSize:tt,textOffset:bt,isSDFIcon:Jt,iconTextFit:li})}return{featureData:he,sizes:k,hasAnySecondaryIcon:oe,textAlongLine:G,symbolPlacement:ne}},s.fa=SA,s.fb=function(a,e,r,c,h,m,g,b,T,E){const{featureData:I,hasAnySecondaryIcon:M,sizes:k,textAlongLine:B,symbolPlacement:N}=e;for(const U of I){const{shapedIcon:Y,verticallyShapedIcon:J,feature:ae,shapedTextOrientations:ne,shapedText:G,layoutTextSize:te,textOffset:oe,isSDFIcon:he,iconPrimary:Te,iconSecondary:Me,iconTextFit:Pe,iconOffset:ze}=U;LA(Y,E.iconPositions,Te,Me),LA(J,E.iconPositions,Te,Me),s5(ne,E.iconPositions),(G||Y)&&o5(a,ae,ne,Y,J,T,k,te,0,oe,he,c,h,g,b,M,Pe,ze,B,N)}r&&a.generateCollisionDebugBuffers(m,a.collisionBoxArray,k.textScaleFactor)},s.fc=Td,s.fd=dv,s.fe=Cu,s.ff=iE,s.fg=oA,s.fh=ga,s.fi=function(a){let e=0;if(new Uint32Array(a,0,1)[0]!==tC){const r=new Uint32Array(a,0,7),[,,c,h,m,g]=r;e=r.byteLength+h+m+g+m,(c!==a.byteLength||e>=a.byteLength)&&Yi("Invalid b3dm header information.")}return rC(a,e)},s.fj=function(a,e){const r=aC(a);for(const c of r){for(const h of c.meshes)Oz(h);c.lights&&(c.lightMeshIndex=c.meshes.length,c.meshes.push(zz(c.lights,e)))}return r},s.fk=sv,s.fl=Gn,s.fm=b3,s.fn=sa,s.fo=function(a){eo(),Qr!=null&&Qr.then(e=>{e.keys().then(r=>{for(let c=0;c<r.length-a;c++)e.delete(r[c]).catch(h=>Yi(h.message))}).catch(r=>Yi(r.message))}).catch(e=>Yi(e.message))},s.g=function(a,e){return Uc(He(a,{method:"GET"}),e)},s.h=_a,s.i=function(a){return Fr.API_STYLE_REGEX.test(a)&&!Al(a)},s.j=function(a){return decodeURIComponent(atob(a).split("").map(e=>"%"+("00"+e.charCodeAt(0).toString(16)).slice(-2)).join(""))},s.k=function(a){return btoa(encodeURIComponent(a).replace(/%([0-9A-F]{2})/g,(e,r)=>String.fromCharCode(+("0x"+r))))},s.l=He,s.m=Pa,s.n=function(a,e){return Uc(He(a,{type:"json"}),e)},s.o=Ka,s.p=function(a,e){return Uc(He(a,{method:"POST"}),e)},s.q=jo,s.r=xo,s.s=function(a){try{const e=self[a];return e.setItem("_mapbox_test_",1),e.removeItem("_mapbox_test_"),!0}catch{return!1}},s.t=Iu,s.u=function(){return function a(e){return e?(e^Math.random()*(16>>e/4)).toString(16):([1e7]+-[1e3]+-4e3+-8e3+-1e11).replace(/[018]/g,a)}()},s.v=function(a){return!!a&&/^[0-9a-f]{8}-[0-9a-f]{4}-[4][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i.test(a)},s.w=Yi,s.x=function(){return Fb||(Fb=new ep),Fb},s.y=jb,s.z=Nh}),_(["./shared"],function(s){function A(Qe){const X=Qe?Qe.url.toString():void 0;return X?performance.getEntriesByName(X):[]}function P(Qe){if(typeof Qe=="number"||typeof Qe=="boolean"||typeof Qe=="string"||Qe==null)return JSON.stringify(Qe);if(Array.isArray(Qe)){let ie="[";for(const ge of Qe)ie+=`${P(ge)},`;return`${ie}]`}let X="{";for(const ie of Object.keys(Qe).sort())X+=`${ie}:${P(Qe[ie])},`;return`${X}}`}function R(Qe){let X="";for(const ie of s.bu)(Qe.type!=="model"||ie!=="minzoom"&&ie!=="maxzoom")&&(X+=`/${P(Qe[ie])}`);return X}class V{constructor(X){this.keyCache={},this._layers={},this._layerConfigs={},X&&this.replace(X)}replace(X,ie){this._layerConfigs={},this._layers={},this.update(X,[],ie)}update(X,ie,ge){this._options=ge;for(const Ce of X)this._layerConfigs[Ce.id]=Ce,(this._layers[Ce.id]=s.dc(Ce,this.scope,null,this._options)).compileFilter(ge),this.keyCache[Ce.id]&&delete this.keyCache[Ce.id];for(const Ce of ie)delete this.keyCache[Ce],delete this._layerConfigs[Ce],delete this._layers[Ce];this.familiesBySource={};const Ie=function(Ce,De){const ke={};for(let Ze=0;Ze<Ce.length;Ze++){const rt=Ce[Ze];let He=De&&De[rt.id];He||(rt.type==="symbol"?He=rt.id:(He=R(rt),rt.type==="line"&&rt.paint&&function Ht(qt){return typeof qt=="string"&&qt==="line-progress"||(Array.isArray(qt)?qt.some(Ht):!(!qt||typeof qt!="object")&&Object.values(qt).some(Ht))}(rt.paint["line-width"])&&(He+=`/${P(rt.paint["line-width"])}`))),De&&(De[rt.id]=He);let Lt=ke[He];Lt||(Lt=ke[He]=[]),Lt.push(rt)}const Le=[];for(const Ze in ke)Le.push(ke[Ze]);return Le}(Object.values(this._layerConfigs),this.keyCache);for(const Ce of Ie){const De=Ce.map(Lt=>this._layers[Lt.id]),ke=De[0];if(ke.visibility==="none")continue;const Le=ke.source||"";let Ze=this.familiesBySource[Le];Ze||(Ze=this.familiesBySource[Le]={});const rt=ke.sourceLayer||"_geojsonTileLayer";let He=Ze[rt];He||(He=Ze[rt]=[]),He.push(De)}}}const j=1*s.e_;class Q{constructor(X){const ie={},ge=[];for(const ke in X){const Le=X[ke],Ze=ie[ke]={};for(const rt in Le.glyphs){const He=Le.glyphs[+rt];if(!He||He.bitmap.width===0||He.bitmap.height===0)continue;const Lt=He.metrics.localGlyph?j:1,Ht={x:0,y:0,w:He.bitmap.width+2*Lt,h:He.bitmap.height+2*Lt};ge.push(Ht),Ze[rt]=Ht}}const{w:Ie,h:Ce}=s.H(ge),De=new s.eZ({width:Ie||1,height:Ce||1});for(const ke in X){const Le=X[ke];for(const Ze in Le.glyphs){const rt=Le.glyphs[+Ze];
601if(!rt||rt.bitmap.width===0||rt.bitmap.height===0)continue;const He=ie[ke][Ze],Lt=rt.metrics.localGlyph?j:1;s.eZ.copy(rt.bitmap,De,{x:0,y:0},{x:He.x+Lt,y:He.y+Lt},rt.bitmap)}}this.image=De,this.positions=ie}}s.eY(Q,"GlyphAtlas");class me{constructor(X){this.tileID=new s.aM(X.tileID.overscaledZ,X.tileID.wrap,X.tileID.canonical.z,X.tileID.canonical.x,X.tileID.canonical.y),this.tileZoom=X.tileZoom,this.uid=X.uid,this.zoom=X.zoom,this.lut=X.lut,this.canonical=X.tileID.canonical,this.pixelRatio=X.pixelRatio,this.tileSize=X.tileSize,this.source=X.source,this.scope=X.scope,this.overscaling=this.tileID.overscaleFactor(),this.showCollisionBoxes=X.showCollisionBoxes,this.collectResourceTiming=!!X.request&&X.request.collectResourceTiming,this.promoteId=X.promoteId,this.isSymbolTile=X.isSymbolTile,this.tileTransform=s.aW(X.tileID.canonical,X.projection),this.projection=X.projection,this.worldview=X.worldview,this.localizableLayerIds=X.localizableLayerIds,this.brightness=X.brightness,this.extraShadowCaster=!!X.extraShadowCaster,this.tessellationStep=X.tessellationStep,this.scaleFactor=X.scaleFactor}parse(X,ie,ge,Ie,Ce,De){this.status="parsing",this.data=X,this.collisionBoxArray=new s.b0;const ke=new s.e$(Object.keys(X.layers).sort()),Le=new s.f0(this.tileID,this.promoteId);Le.bucketLayerIDs=[];const Ze={},rt=new s.f1(256,256),He={featureIndex:Le,iconDependencies:new Map,patternDependencies:new Map,glyphDependencies:{},lineAtlas:rt,availableImages:ge,brightness:this.brightness,scaleFactor:this.scaleFactor,elevationFeatures:void 0},Lt=ie.familiesBySource[this.source];for(const Tn in Lt){const Jn=X.layers[Tn];if(!Jn)continue;let Gn=!1,Hs=!1,ir=!1;for(const Gr of Lt[Tn])Gr[0].type==="symbol"?Gn=!0:Hs=!0,Gr[0].is3D()&&Gr[0].type!=="model"&&(ir=!0);if(this.extraShadowCaster&&!ir||this.isSymbolTile===!0&&!Gn||this.isSymbolTile===!1&&!Hs)continue;Jn.version===1&&s.w(`Vector tile source "${this.source}" layer "${Tn}" does not use vector tile spec v2 and therefore may have some rendering errors.`);const hr=ke.encode(Tn),Dr=[];let Ia=!1;for(let Gr=0,Wr=0;Gr<Jn.length;Gr++){const Tr=Jn.feature(Gr),Fr=Le.getId(Tr,Tn);if(this.localizableLayerIds&&this.localizableLayerIds.has(Tn)){const _a=Tr.properties?Tr.properties.worldview:null;if(this.worldview&&typeof _a=="string")if(_a==="all")Tr.properties.$localized=!0;else{if(!_a.split(",").includes(this.worldview))continue;Tr.properties.$localized=!0,Tr.properties.worldview=this.worldview}}!Ia&&Tr.properties&&Tr.properties.hasOwnProperty(s.f2)&&(Ia=!0),Dr.push({feature:Tr,id:Fr,index:Wr,sourceLayerIndex:hr}),Wr++}Ia&&!He.elevationFeatures&&X.layers.hasOwnProperty(s.f3)&&(He.elevationFeatures=s.f4.parseFrom(X.layers[s.f3],this.canonical));for(const Gr of Lt[Tn]){const Wr=Gr[0];(!this.extraShadowCaster||Wr.is3D()&&Wr.type!=="model")&&(this.isSymbolTile!==void 0&&Wr.type==="symbol"!==this.isSymbolTile||Wr.minzoom&&this.zoom<Math.floor(Wr.minzoom)||Wr.maxzoom&&this.zoom>=Wr.maxzoom||Wr.visibility!=="none"&&(re(Gr,this.zoom,He.brightness,ge),(Ze[Wr.id]=Wr.createBucket({index:Le.bucketLayerIDs.length,layers:Gr,zoom:this.zoom,lut:this.lut,canonical:this.canonical,pixelRatio:this.pixelRatio,overscaling:this.overscaling,collisionBoxArray:this.collisionBoxArray,sourceLayerIndex:hr,sourceID:this.source,projection:this.projection.spec,tessellationStep:this.tessellationStep,styleDefinedModelURLs:Ie})).populate(Dr,He,this.tileID.canonical,this.tileTransform),Le.bucketLayerIDs.push(Gr.map(Tr=>s.C(Tr.id,Tr.scope)))))}}let Ht,qt,xi,Pi,Ri,Qi;rt.trim();const hs={type:"maybePrepare",isSymbolTile:this.isSymbolTile,zoom:this.zoom},Yi=()=>{if(Ht)return this.status="done",De(Ht);if(this.extraShadowCaster)this.status="done",De(null,{buckets:Object.values(Ze).filter(Tn=>!Tn.isEmpty()),featureIndex:Le,collisionBoxArray:null,glyphAtlasImage:null,lineAtlas:null,imageAtlas:null,brightness:He.brightness,glyphMap:null,iconMap:null,glyphPositions:null});else if(qt&&xi&&Pi){const Tn=new Q(qt),Jn=new Map;for(const[ir,hr]of xi.entries()){const{imagePosition:Dr}=s.f7(ir,hr,s.f8);Jn.set(ir,Dr)}const Gn={};for(const ir in Ze){const hr=Ze[ir];hr instanceof s.b1&&(re(hr.layers,this.zoom,He.brightness,ge),Gn[ir]=s.f9(hr,qt,Tn.positions,xi,Jn,this.tileID.canonical,this.tileZoom,this.scaleFactor,this.pixelRatio,Ri))}const Hs={iconsPending:!0,patternsPending:!0};this.rasterizeIfNeeded(Ce,xi,Ri,()=>{Hs.iconsPending=!1,jn(Gn,Tn,Hs)}),this.rasterizeIfNeeded(Ce,Pi,Qi,()=>{Hs.patternsPending=!1,jn(Gn,Tn,Hs)})}},jn=(Tn,Jn,Gn,Hs)=>{if(Gn.iconsPending||Gn.patternsPending)return;const ir=new s.fa(xi,Pi,this.lut);for(const hr in Ze){const Dr=Ze[hr];if(hr in Tn)s.fb(Dr,Tn[hr],this.showCollisionBoxes,ge,this.tileID.canonical,this.tileZoom,this.projection,this.brightness,xi,ir);else if(Dr.hasPattern&&(Dr instanceof s.b7||Dr instanceof s.b8||Dr instanceof s.dV)){re(Dr.layers,this.zoom,He.brightness,ge);const Ia=Object.fromEntries(ir.patternPositions);Dr.addFeatures(He,this.tileID.canonical,Ia,ge,this.tileTransform,this.brightness)}}this.status="done",De(null,{buckets:Object.values(Ze).filter(hr=>!hr.isEmpty()),featureIndex:Le,collisionBoxArray:this.collisionBoxArray,glyphAtlasImage:Jn.image,lineAtlas:rt,imageAtlas:ir,brightness:He.brightness})};if(!this.extraShadowCaster){const Tn=s.f5(He.glyphDependencies,Hs=>Object.keys(Hs).map(Number));Object.keys(Tn).length?Ce.send("getGlyphs",{uid:this.uid,stacks:Tn,scope:this.scope},(Hs,ir)=>{Ht||(Ht=Hs,qt=ir,Yi())},void 0,!1,hs):qt={};const Jn=Array.from(He.iconDependencies.keys()).map(Hs=>s.I.parse(Hs));Jn.length?Ce.send("getImages",{images:Jn,source:this.source,scope:this.scope,tileID:this.tileID,type:"icons"},(Hs,ir)=>{Ht||(Ht=Hs,xi=new Map,Ri=this.updateImageMapAndGetImageTaskQueue(xi,ir,He.iconDependencies),Yi())},void 0,!1,hs):(xi=new Map,Ri=new Map);const Gn=Array.from(He.patternDependencies.keys()).map(Hs=>s.I.parse(Hs));Gn.length?Ce.send("getImages",{images:Gn,source:this.source,scope:this.scope,tileID:this.tileID,type:"patterns"},(Hs,ir)=>{Ht||(Ht=Hs,Pi=new Map,Qi=this.updateImageMapAndGetImageTaskQueue(Pi,ir,He.patternDependencies),Yi())},void 0,!1,hs):(Pi=new Map,Qi=new Map)}if(He.elevationFeatures&&He.elevationFeatures.length>0){const Tn=[];for(const Gn of Object.values(Ze))if(Gn instanceof s.b8){const Hs=Gn.getUnevaluatedPortalGraph();Hs&&Tn.push(Hs)}const Jn=s.f6.evaluate(Tn);for(const Gn of Object.values(Ze))Gn instanceof s.b8&&Gn.setEvaluatedPortalGraph(Jn)}Yi()}rasterizeIfNeeded(X,ie,ge,Ie){Array.from(ie.values()).some(Ce=>Ce.usvg)?this.rasterize(X,ie,ge,Ie):Ie()}updateImageMapAndGetImageTaskQueue(X,ie,ge){const Ie=new Map;for(const Ce of ie.keys()){const De=ge.get(Ce)||[];for(const ke of De){const Le=ke.toString(),Ze=ie.get(ke.id.toString());Ze.usvg?Ie.has(Le)||(Ie.set(Le,ke),X.set(Le,Object.assign({},Ze))):X.set(Le,Ze)}}return Ie}rasterize(X,ie,ge,Ie){this.rasterizeTask=X.send("rasterizeImages",{scope:this.scope,tasks:ge},(Ce,De)=>{if(!Ce)for(const[ke,Le]of De.entries()){const Ze=Object.assign(ie.get(ke),{data:Le});ie.set(ke,Ze)}Ie()})}cancelRasterize(){this.rasterizeTask&&this.rasterizeTask.cancel()}}function re(Qe,X,ie,ge){const Ie=new s.aa(X,{brightness:ie});for(const Ce of Qe)Ce.recalculate(Ie,ge)}class be extends s.E{constructor(X,ie,ge,Ie,Ce,De,ke){super(),this.actor=X,this.layerIndex=ie,this.availableImages=ge,this.availableModels=Ie,this.loadVectorData=De||s.aJ,this.loading={},this.loaded={},this.deduped=new s.aI(X.scheduler),this.isSpriteLoaded=Ce,this.scheduler
601=X.scheduler,this.brightness=ke}loadTile(X,ie){const ge=X.uid,Ie=X&&X.request,Ce=Ie&&Ie.collectResourceTiming,De=this.loading[ge]=new me(X);De.abort=this.loadVectorData(X,(ke,Le)=>{const Ze=!this.loading[ge];if(delete this.loading[ge],De.cancelRasterize(),Ze||ke||!Le)return De.status="done",Ze||(this.loaded[ge]=De),ie(ke);const rt=Le.rawData,He={};Le.expires&&(He.expires=Le.expires),Le.cacheControl&&(He.cacheControl=Le.cacheControl),De.vectorTile=Le.vectorTile||new s.fc.VectorTile(new s.bq(rt));const Lt=()=>{De.parse(De.vectorTile,this.layerIndex,this.availableImages,this.availableModels,this.actor,(Ht,qt)=>{if(Ht||!qt)return ie(Ht);const xi={};if(Ce){const Pi=A(Ie);Pi.length>0&&(xi.resourceTiming=JSON.parse(JSON.stringify(Pi)))}ie(null,s.l({rawTileData:rt.slice(0)},qt,He,xi))})};this.isSpriteLoaded?Lt():this.once("isSpriteLoaded",()=>{this.scheduler?this.scheduler.add(Lt,{type:"parseTile",isSymbolTile:X.isSymbolTile,zoom:X.tileZoom}):Lt()}),this.loaded=this.loaded||{},this.loaded[ge]=De})}reloadTile(X,ie){const ge=this.loaded,Ie=X.uid;if(ge&&ge[Ie]){const Ce=ge[Ie];Ce.scaleFactor=X.scaleFactor,Ce.showCollisionBoxes=X.showCollisionBoxes,Ce.projection=X.projection,Ce.brightness=X.brightness,Ce.tileTransform=s.aW(X.tileID.canonical,X.projection),Ce.extraShadowCaster=X.extraShadowCaster,Ce.lut=X.lut;const De=(ke,Le)=>{const Ze=Ce.reloadCallback;Ze&&(delete Ce.reloadCallback,Ce.parse(Ce.vectorTile,this.layerIndex,this.availableImages,this.availableModels,this.actor,Ze)),ie(ke,Le)};Ce.status==="parsing"?Ce.reloadCallback=De:Ce.status==="done"&&(Ce.vectorTile?Ce.parse(Ce.vectorTile,this.layerIndex,this.availableImages,this.availableModels,this.actor,De):De())}else ie(null,void 0)}abortTile(X,ie){const ge=X.uid,Ie=this.loading[ge];Ie&&(Ie.abort&&Ie.abort(),delete this.loading[ge]),ie()}removeTile(X,ie){const ge=this.loaded,Ie=X.uid;ge&&ge[Ie]&&delete ge[Ie],ie()}}class ve{loadTile(X,ie){const{uid:ge,encoding:Ie,rawImageData:Ce,padding:De}=X,ke=ImageBitmap&&Ce instanceof ImageBitmap?this.getImageData(Ce,De):Ce;ie(null,new s.fd(ge,ke,Ie,De<1))}reloadTile(X,ie){ie(null,null)}abortTile(X,ie){ie()}removeTile(X,ie){ie()}getImageData(X,ie){this.offscreenCanvas&&this.offscreenCanvasContext||(this.offscreenCanvas=new OffscreenCanvas(X.width,X.height),this.offscreenCanvasContext=this.offscreenCanvas.getContext("2d",{willReadFrequently:!0})),this.offscreenCanvas.width=X.width,this.offscreenCanvas.height=X.height,this.offscreenCanvasContext.drawImage(X,0,0,X.width,X.height);const ge=this.offscreenCanvasContext.getImageData(-ie,-ie,X.width+2*ie,X.height+2*ie);return this.offscreenCanvasContext.clearRect(0,0,this.offscreenCanvas.width,this.offscreenCanvas.height),ge}}s.bp.setPbf(s.bq);class Ee{constructor(X){this._mrt=new s.bp(X.partial?30:1/0),this._isHeaderLoaded=!1,this.uid=X.uid,this.tileID=X.tileID,this.source=X.source}parse(X,ie){const ge=this._mrt;this.status="parsing",this._entireBuffer=X;try{ge.parseHeader(X),this._isHeaderLoaded=!0;const Ie=[];for(const Ce in ge.layers){const De=ge.getLayer(Ce),ke=De.getDataRange(De.getBandList()),Le=ge.createDecodingTask(ke),Ze=X.slice(ke.firstByte,ke.lastByte+1),rt=s.bp.performDecoding(Ze,Le).then(He=>Le.complete(null,He)).catch(He=>Le.complete(He,null));Ie.push(rt)}Promise.allSettled(Ie).then(()=>ie(null,ge)).catch(Ce=>ie(Ce))}catch(Ie){ie(Ie)}}}class je{constructor(X){this.actor=X,this.loading={},this.loaded={}}loadTile(X,ie){const ge=X.uid,Ie=X.request,Ce=this.loading[ge]=new Ee(X),{cancel:De}=s.br(Ie,(ke,Le,Ze,rt)=>{const He=!this.loading[ge];if(delete this.loading[ge],He||ke||!Le)return Ce.status="done",He||(this.loaded[ge]=Ce),ie(ke);Ce.parse(Le,(Lt,Ht)=>{if(Lt||!Ht)return ie(Lt);ie(null,Ht,Ze,rt)}),this.loaded[ge]=Ce});Ce.abort=De}reloadTile(X,ie){ie(null,void 0)}abortTile(X,ie){const ge=X.uid,Ie=this.loading[ge];Ie&&(Ie.abort&&Ie.abort(),delete this.loading[ge]),ie()}removeTile(X,ie){const ge=X.uid;this.loaded[ge]&&delete this.loaded[ge],ie()}decodeRasterArray(X,ie){s.bp.performDecoding(X.buffer,X.task).then(ge=>ie(null,ge)).catch(ge=>ie(ge))}}const Ve=s.fc.VectorTileFeature.prototype.toGeoJSON;class Je{constructor(X){this._feature=X,this.extent=s.aj,this.type=X.t
601ype,this.properties=X.tags,"id"in X&&!isNaN(X.id)&&(this.id=parseInt(X.id,10))}loadGeometry(){if(this._feature.type===1){const X=[];for(const ie of this._feature.geometry)X.push([new s.P(ie[0],ie[1])]);return X}{const X=[];for(const ie of this._feature.geometry){const ge=[];for(const Ie of ie)ge.push(new s.P(Ie[0],Ie[1]));X.push(ge)}return X}}toGeoJSON(X,ie,ge){return Ve.call(this,X,ie,ge)}}class vt{constructor(X){this.layers={_geojsonTileLayer:this},this.name="_geojsonTileLayer",this.extent=s.aj,this.length=X.length,this._features=X}feature(X){return new Je(this._features[X])}}const _t=64/4096,Mt=128;class At{constructor(){this.features=new Map}clear(){this.features.clear()}load(X=[],ie){for(const ge of X){const Ie=ge.id;if(Ie==null)continue;let Ce=this.features.get(Ie);Ce&&this.updateCache(Ce,ie),ge.geometry?(Ce=Yt(ge),this.updateCache(Ce,ie),this.features.set(Ie,Ce)):this.features.delete(Ie),this.updateCache(Ce,ie)}}updateCache(X,ie){for(const{canonical:ge,uid:Ie}of Object.values(ie)){const{z:Ce,x:De,y:ke}=ge;ei(X,Math.pow(2,Ce),De,ke)&&delete ie[Ie]}}getTile(X,ie,ge){const Ie=Math.pow(2,X),Ce=[];for(const De of this.features.values())ei(De,Ie,ie,ge)&&Ce.push(ki(De,Ie,ie,ge));return{features:Ce}}getFeatures(){return[...this.features.values()]}}function ei({minX:Qe,minY:X,maxX:ie,maxY:ge},Ie,Ce,De){return Qe<(Ce+1+_t)/Ie&&X<(De+1+_t)/Ie&&ie>(Ce-_t)/Ie&&ge>(De-_t)/Ie}function Yt(Qe){const{id:X,geometry:ie,properties:ge}=Qe;if(!ie)return;if(ie.type==="GeometryCollection")throw new Error("GeometryCollection not supported in dynamic mode.");const{type:Ie,coordinates:Ce}=ie,De={id:X,type:1,geometry:[],tags:ge,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0},ke=De.geometry;if(Ie==="Point")Zt(Ce,ke,De);else if(Ie==="MultiPoint")for(const Le of Ce)Zt(Le,ke,De);else if(Ie==="LineString")De.type=2,yi(Ce,ke,De);else if(Ie==="MultiLineString")De.type=2,Fi(Ce,ke,De);else if(Ie==="Polygon")De.type=3,Fi(Ce,ke,De,!0);else{if(Ie!=="MultiPolygon")throw new Error("Input data is not a valid GeoJSON object.");De.type=3;for(const Le of Ce)Fi(Le,ke,De,!0)}return De}function Zt([Qe,X],ie,ge){const Ie=s.ay(Qe);let Ce=s.aH(X);Ce=Ce<0?0:Ce>1?1:Ce,ie.push(Ie,Ce),ge.minX=Math.min(ge.minX,Ie),ge.minY=Math.min(ge.minY,Ce),ge.maxX=Math.max(ge.maxX,Ie),ge.maxY=Math.max(ge.maxY,Ce)}function yi(Qe,X,ie,ge=!1,Ie=!1){const Ce=[];for(const De of Qe)Zt(De,Ce,ie);X.push(Ce),ge&&function(De,ke){let Le=0;for(let Ze=0,rt=De.length,He=rt-2;Ze<rt;He=Ze,Ze+=2)Le+=(De[Ze]-De[He])*(De[Ze+1]+De[He+1]);if(Le>0===ke)for(let Ze=0,rt=De.length;Ze<rt/2;Ze+=2){const He=De[Ze],Lt=De[Ze+1];De[Ze]=De[rt-2-Ze],De[Ze+1]=De[rt-1-Ze],De[rt-2-Ze]=He,De[rt-1-Ze]=Lt}}(Ce,Ie)}function Fi(Qe,X,ie,ge=!1){for(let Ie=0;Ie<Qe.length;Ie++)yi(Qe[Ie],X,ie,ge,Ie===0)}function ki(Qe,X,ie,ge){const{id:Ie,type:Ce,geometry:De,tags:ke}=Qe,Le=[];if(Ce===1)(function(Ze,rt,He,Lt,Ht){for(let qt=0;qt<Ze.length;qt+=2){const xi=Math.round(s.aj*(Ze[qt+0]*rt-He)),Pi=Math.round(s.aj*(Ze[qt+1]*rt-Lt));Ht.push([xi,Pi])}})(De,X,ie,ge,Le);else for(const Ze of De)wi(Ze,X,ie,ge,Le);return{id:Ie,type:Ce,geometry:Le,tags:ke}}function wi(Qe,X,ie,ge,Ie){const De=s.aj+Mt;let ke;for(let Le=0;Le<Qe.length-2;Le+=2){let Ze=Math.round(s.aj*(Qe[Le+0]*X-ie)),rt=Math.round(s.aj*(Qe[Le+1]*X-ge)),He=Math.round(s.aj*(Qe[Le+2]*X-ie)),Lt=Math.round(s.aj*(Qe[Le+3]*X-ge));const Ht=He-Ze,qt=Lt-rt;Ze<-128&&He<-128||(Ze<-128?(rt+=Math.round(qt*((-128-Ze)/Ht)),Ze=-128):He<-128&&(Lt=rt+Math.round(qt*((-128-Ze)/Ht)),He=-128),rt<-128&&Lt<-128||(rt<-128?(Ze+=Math.round(Ht*((-128-rt)/qt)),rt=-128):Lt<-128&&(He=Ze+Math.round(Ht*((-128-rt)/qt)),Lt=-128),Ze>=De&&He>=De||(Ze>=De?(rt+=Math.round(qt*((De-Ze)/Ht)),Ze=De):He>=De&&(Lt=rt+Math.round(qt*((De-Ze)/Ht)),He=De),rt>=De&&Lt>=De||(rt>=De?(Ze+=Math.round(Ht*((De-rt)/qt)),rt=De):Lt>=De&&(He=Ze+Math.round(Ht*((De-rt)/qt)),Lt=De),ke&&Ze===ke[ke.length-1][0]&&rt===ke[ke.length-1][1]||(ke=[[Ze,rt]],Ie.push(ke)),ke.push([He,Lt])))))}}var Li,cn,vi,Ue={exports:{}},Yn=function(){if(vi)return Ue.exports;vi=1;var Qe=s.fg(),X=function(){if(cn)return Li;cn=1;var rt=s.fe(),He=s.ff().VectorTileFeature;function Lt(qt,xi){this.options=xi||{},this.features=qt,this.length=qt.length}function Ht(qt,xi){this.id=typeof qt.id=="number"?qt.id:void 0,this.type=qt.type,this.rawGeometry=qt.type===1?[qt.geometry]:qt.geometry,this.properties=qt.tags,this.extent=xi||4096}return Li=Lt,Lt.prototype.feature=function(qt){return new Ht(this.features[qt],this.options.extent)},Ht.prototype.loadGeometry=function(){var qt=this.rawGeometry;this.geometry=[];for(var xi=0;xi<qt.length;xi++){for(var Pi=qt[xi],Ri=[],Qi=0;Qi<Pi.length;Qi++)Ri.push(new rt(Pi[Qi][0],Pi[Qi][1]));this.geometry.push(Ri)}return this.geometry},Ht.prototype.bbox=function(){this.geometry||this.loadGeometry();for(var qt=this.geometry,xi=1/0,Pi=-1/0,Ri=1/0,Qi=-1/0,hs=0;hs<qt.length;hs++)for(var Yi=qt[hs],jn=0;jn<Yi.length;jn++){var Tn=Yi[jn];xi=Math.min(xi,Tn.x),Pi=Math.max(Pi,Tn.x),Ri=Math.min(Ri,Tn.y),Qi=Math.max(Qi,Tn.y)}return[xi,Ri,Pi,Qi]},Ht.prototype.toGeoJSON=He.prototype.toGeoJSON,Li}();function ie(rt){var He=new Qe;return function(Lt,Ht){for(var qt in Lt.layers)Ht.writeMessage(3,ge,Lt.layers[qt])}(rt,He),He.finish()}function ge(rt,He){var Lt;
601He.writeVarintField(15,rt.version||1),He.writeStringField(1,rt.name||""),He.writeVarintField(5,rt.extent||4096);var Ht={keys:[],values:[],keycache:{},valuecache:{}};for(Lt=0;Lt<rt.length;Lt++)Ht.feature=rt.feature(Lt),He.writeMessage(2,Ie,Ht);var qt=Ht.keys;for(Lt=0;Lt<qt.length;Lt++)He.writeStringField(3,qt[Lt]);var xi=Ht.values;for(Lt=0;Lt<xi.length;Lt++)He.writeMessage(4,Ze,xi[Lt])}function Ie(rt,He){var Lt=rt.feature;Lt.id!==void 0&&He.writeVarintField(1,Lt.id),He.writeMessage(2,Ce,rt),He.writeVarintField(3,Lt.type),He.writeMessage(4,Le,Lt)}function Ce(rt,He){var Lt=rt.feature,Ht=rt.keys,qt=rt.values,xi=rt.keycache,Pi=rt.valuecache;for(var Ri in Lt.properties){var Qi=Lt.properties[Ri],hs=xi[Ri];if(Qi!==null){hs===void 0&&(Ht.push(Ri),xi[Ri]=hs=Ht.length-1),He.writeVarint(hs);var Yi=typeof Qi;Yi!=="string"&&Yi!=="boolean"&&Yi!=="number"&&(Qi=JSON.stringify(Qi));var jn=Yi+":"+Qi,Tn=Pi[jn];Tn===void 0&&(qt.push(Qi),Pi[jn]=Tn=qt.length-1),He.writeVarint(Tn)}}}function De(rt,He){return(He<<3)+(7&rt)}function ke(rt){return rt<<1^rt>>31}function Le(rt,He){for(var Lt=rt.loadGeometry(),Ht=rt.type,qt=0,xi=0,Pi=Lt.length,Ri=0;Ri<Pi;Ri++){var Qi=Lt[Ri],hs=1;Ht===1&&(hs=Qi.length),He.writeVarint(De(1,hs));for(var Yi=Ht===3?Qi.length-1:Qi.length,jn=0;jn<Yi;jn++){jn===1&&Ht!==1&&He.writeVarint(De(2,Yi-1));var Tn=Qi[jn].x-qt,Jn=Qi[jn].y-xi;
vendor: 14,134 bytes, line 601
601He.writeVarint(ke(Tn)),He.writeVarint(ke(Jn)),qt+=Tn,xi+=Jn}Ht===3&&He.writeVarint(De(7,1))}}function Ze(rt,He){var Lt=typeof rt;Lt==="string"?He.writeStringField(1,rt):Lt==="boolean"?He.writeBooleanField(7,rt):Lt==="number"&&(rt%1!=0?He.writeDoubleField(3,rt):rt<0?He.writeSVarintField(6,rt):He.writeVarintField(5,rt))}return Ue.exports=ie,Ue.exports.fromVectorTileJs=ie,Ue.exports.fromGeojsonVt=function(rt,He){He=He||{};var Lt={};for(var Ht in rt)Lt[Ht]=new X(rt[Ht].features,He),Lt[Ht].name=Ht,Lt[Ht].version=He.version,Lt[Ht].extent=He.extent;return ie({layers:Lt})},Ue.exports.GeoJSONWrapper=X,Ue.exports}(),Ki=s.fh(Yn);const ps={minZoom:0,maxZoom:16,minPoints:2,radius:40,extent:512,nodeSize:64,log:!1,generateId:!1,reduce:null,map:Qe=>Qe},On=Math.fround||(hn=new Float32Array(1),Qe=>(hn[0]=+Qe,hn[0]));var hn;const Hi=3,Ct=5,zt=6;class ti{constructor(X){this.options=Object.assign(Object.create(ps),X),this.trees=new Array(this.options.maxZoom+1),this.stride=this.options.reduce?7:6,this.clusterProps=[]}load(X){const{log:ie,minZoom:ge,maxZoom:Ie}=this.options;ie&&console.time("total time");const Ce=`prepare ${X.length} points`;ie&&console.time(Ce),this.points=X;const De=[];for(let Le=0;Le<X.length;Le++){const Ze=X[Le];if(!Ze.geometry)continue;const[rt,He]=Ze.geometry.coordinates,Lt=On(Fe(rt)),Ht=On(Oe(He));De.push(Lt,Ht,1/0,Le,-1,1),this.options.reduce&&De.push(0)}let ke=this.trees[Ie+1]=this._createTree(De);ie&&console.timeEnd(Ce);for(let Le=Ie;Le>=ge;Le--){const Ze=+Date.now();ke=this.trees[Le]=this._createTree(this._cluster(ke,Le)),ie&&console.log("z%d: %d clusters in %dms",Le,ke.numItems,+Date.now()-Ze)}return ie&&console.timeEnd("total time"),this}getClusters(X,ie){let ge=((X[0]+180)%360+360)%360-180;const Ie=Math.max(-90,Math.min(90,X[1]));let Ce=X[2]===180?180:((X[2]+180)%360+360)%360-180;const De=Math.max(-90,Math.min(90,X[3]));if(X[2]-X[0]>=360)ge=-180,Ce=180;else if(ge>Ce){const He=this.getClusters([ge,Ie,180,De],ie),Lt=this.getClusters([-180,Ie,Ce,De],ie);return He.concat(Lt)}const ke=this.trees[this._limitZoom(ie)],Le=ke.range(Fe(ge),Oe(De),Fe(Ce),Oe(Ie)),Ze=ke.data,rt=[];for(const He of Le){const Lt=this.stride*He;rt.push(Ze[Lt+Ct]>1?qi(Ze,Lt,this.clusterProps):this.points[Ze[Lt+Hi]])}return rt}getChildren(X){const ie=this._getOriginId(X),ge=this._getOriginZoom(X),Ie="No cluster with the specified id.",Ce=this.trees[ge];if(!Ce)throw new Error(Ie);const De=Ce.data;if(ie*this.stride>=De.length)throw new Error(Ie);const ke=this.options.radius/(this.options.extent*Math.pow(2,ge-1)),Le=Ce.within(De[ie*this.stride],De[ie*this.stride+1],ke),Ze=[];for(const rt of Le){const He=rt*this.stride;De[He+4]===X&&Ze.push(De[He+Ct]>1?qi(De,He,this.clusterProps):this.points[De[He+Hi]])}if(Ze.length===0)throw new Error(Ie);return Ze}getLeaves(X,ie,ge){const Ie=[];return this._appendLeaves(Ie,X,ie=ie||10,ge=ge||0,0),Ie}getTile(X,ie,ge){const Ie=this.trees[this._limitZoom(X)],Ce=Math.pow(2,X),{extent:De,radius:ke}=this.options,Le=ke/De,Ze=(ge-Le)/Ce,rt=(ge+1+Le)/Ce,He={features:[]};return this._addTileFeatures(Ie.range((ie-Le)/Ce,Ze,(ie+1+Le)/Ce,rt),Ie.data,ie,ge,Ce,He),ie===0&&this._addTileFeatures(Ie.range(1-Le/Ce,Ze,1,rt),Ie.data,Ce,ge,Ce,He),ie===Ce-1&&this._addTileFeatures(Ie.range(0,Ze,Le/Ce,rt),Ie.data,-1,ge,Ce,He),He.features.length?He:null}getClusterExpansionZoom(X){let ie=this._getOriginZoom(X)-1;for(;ie<=this.options.maxZoom;){const ge=this.getChildren(X);if(ie++,ge.length!==1)break;X=ge[0].properties.cluster_id}return ie}_appendLeaves(X,ie,ge,Ie,Ce){const De=this.getChildren(ie);for(const ke of De){const Le=ke.properties;if(Le&&Le.cluster?Ce+Le.point_count<=Ie?Ce+=Le.point_count:Ce=this._appendLeaves(X,Le.cluster_id,ge,Ie,Ce):Ce<Ie?Ce++:X.push(ke),X.length===ge)break}return Ce}_createTree(X){const ie=new s.bW(X.length/this.stride|0,this.options.nodeSize,Float32Array);for(let ge=0;ge<X.length;ge+=this.stride)ie.add(X[ge],X[ge+1]);return ie.finish(),ie.data=X,ie}_addTileFeatures(X,ie,ge,Ie,Ce,De){for(const ke of X){const Le=ke*this.stride,Ze=ie[Le+Ct]>1;let rt,He,Lt;if(Ze)rt=ts(ie,Le,this.clusterProps),He=ie[Le],Lt=ie[Le+1];else{const xi=this.points[ie[Le+Hi]];rt=xi.properties;const[Pi,Ri]=xi.geometry.coordinates;He=Fe(Pi),Lt=Oe(Ri)}const Ht={type:1,geometry:[[Math.round(this.options.extent*(He*Ce-ge)),Math.round(this.options.extent*(Lt*Ce-Ie))]],tags:rt};let qt;qt=Ze||this.options.generateId?ie[Le+Hi]:this.points[ie[Le+Hi]].id,qt!==void 0&&(Ht.id=qt),De.features.push(Ht)}}_limitZoom(X){return Math.max(this.options.minZoom,Math.min(Math.floor(+X),this.options.maxZoom+1))}_cluster(X,ie){const{radius:ge,extent:Ie,reduce:Ce,minPoints:De}=this.options,ke=ge/(Ie*Math.pow(2,ie)),Le=X.data,Ze=[],rt=this.stride;for(let He=0;He<Le.length;He+=rt){if(Le[He+2]<=ie)continue;Le[He+2]=ie;const Lt=Le[He],Ht=Le[He+1],qt=X.within(Le[He],Le[He+1],ke),xi=Le[He+Ct];let Pi=xi;for(const Ri of qt){const Qi=Ri*rt;Le[Qi+2]>ie&&(Pi+=Le[Qi+Ct])}if(Pi>xi&&Pi>=De){let Ri,Qi=Lt*xi,hs=Ht*xi,Yi=-1;const jn=(He/rt<<5)+(ie+1)+this.points.length;for(const Tn of qt){const Jn=Tn*rt;if(Le[Jn+2]<=ie)continue;Le[Jn+2]=ie;const Gn=Le[Jn+Ct];Qi+=Le[Jn]*Gn,hs+=Le[Jn+1]*Gn,Le[Jn+4]=jn,Ce&&(Ri||(Ri=this._map(Le,He,!0),Yi=this.clusterProps.length,this.clusterProps.push(Ri)),Ce(Ri,this._map(Le,Jn)))}Le[He+4]=jn,Ze.push(Qi/Pi,hs/Pi,1/0,jn,-1,Pi),Ce&&Ze.push(Yi)}else{for(let Ri=0;Ri<rt;Ri++)Ze.push(Le[He+Ri]);if(Pi>1)for(const Ri of qt){const Qi=Ri*rt;if(!(Le[Qi+2]<=ie)){Le[Qi+2]=ie;for(let hs=0;hs<rt;hs++)Ze.push(Le[Qi+hs])}}}}return Ze}_getOriginId(X){return X-this.points.length>>5}_getOriginZoom(X){return(X-this.points.length)%32}_map(X,ie,ge){if(X[ie+Ct]>1){const De=this.clusterProps[X[ie+zt]];return ge?Object.assign({},De):De}const Ie=this.points[X[ie+Hi]].properties,Ce=this.options.map(Ie);return ge&&Ce===Ie?Object.assign({},Ce):Ce}}function qi(Qe,X,ie){return{type:"Feature",id:Qe[X+Hi],properties:ts(Qe,X,ie),geometry:{type:"Point",coordinates:[(ge=Qe[X],360*(ge-.5)),dt(Qe[X+1])]}};var ge}function ts(Qe,X,ie){const ge=Qe[X+Ct],Ie=ge>=1e4?`${Math.round(ge/1e3)}k`:ge>=1e3?Math.round(ge/100)/10+"k":ge,Ce=Qe[X+zt],De=Ce===-1?{}:Object.assign({},ie[Ce]);return Object.assign(De,{cluster:!0,cluster_id:Qe[X+Hi],point_count:ge,point_count_abbreviated:Ie})}function Fe(Qe){return Qe/360+.5}function Oe(Qe){const X=Math.sin(Qe*Math.PI/180),ie=.5-.25*Math.log((1+X)/(1-X))/Math.PI;return ie<0?0:ie>1?1:ie}function dt(Qe){const X=(180-360*Qe)*Math.PI/180;return 360*Math.atan(Math.exp(X))/Math.PI-90}function $t(Qe,X,ie,ge){let Ie=ge;const Ce=X+(ie-X>>1);let De,ke=ie-X;const Le=Qe[X],Ze=Qe[X+1],rt=Qe[ie],He=Qe[ie+1];for(let Lt=X+3;Lt<ie;Lt+=3){const Ht=Ft(Qe[Lt],Qe[Lt+1],Le,Ze,rt,He);if(Ht>Ie)De=Lt,Ie=Ht;else if(Ht===Ie){const qt=Math.abs(Lt-Ce);qt<ke&&(De=Lt,ke=qt)}}Ie>ge&&(De-X>3&&$t(Qe,X,De,ge),Qe[De+2]=Ie,ie-De>3&&$t(Qe,De,ie,ge))}function Ft(Qe,X,ie,ge,Ie,Ce){let De=Ie-ie,ke=Ce-ge;if(De!==0||ke!==0){const Le=((Qe-ie)*De+(X-ge)*ke)/(De*De+ke*ke);Le>1?(ie=Ie,ge=Ce):Le>0&&(ie+=De*Le,ge+=ke*Le)}return De=Qe-ie,ke=X-ge,De*De+ke*ke}function Wt(Qe,X,ie,ge){const Ie={id:Qe??null,type:X,geometry:ie,tags:ge,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0};if(X==="Point"||X==="MultiPoint"||X==="LineString")Ti(Ie,ie);else if(X==="Polygon")Ti(Ie,ie[0]);else if(X==="MultiLineString")for(const Ce of ie)Ti(Ie,Ce);else if(X==="MultiPolygon")for(const Ce of ie)Ti(Ie,Ce[0]);return Ie}function Ti(Qe,X){for(let ie=0;ie<X.length;ie+=3)Qe.minX=Math.min(Qe.minX,X[ie]),Qe.minY=Math.min(Qe.minY,X[ie+1]),Qe.maxX=Math.max(Qe.maxX,X[ie]),Qe.maxY=Math.max(Qe.maxY,X[ie+1])}function pi(Qe,X,ie,ge){if(!X.geometry)return;const Ie=X.geometry.coordinates;if(Ie&&Ie.length===0)return;const Ce=X.geometry.type,De=Math.pow(ie.tolerance/((1<<ie.maxZoom)*ie.extent),2);let ke=[],Le=X.id;if(ie.promoteId?Le=X.properties[ie.promoteId]:ie.generateId&&(Le=ge||0),Ce==="Point")di(Ie,ke);else if(Ce==="MultiPoint")for(const Ze of Ie)di(Ze,ke);else if(Ce==="LineString")ai(Ie,ke,De,!1);else if(Ce==="MultiLineString"){if(ie.lineMetrics){for(const Ze of Ie)ke=[],ai(Ze,ke,De,!1),Qe.push(Wt(Le,"LineString",ke,X.properties));return}on(Ie,ke,De,!1)}else if(Ce==="Polygon")on(Ie,ke,De,!0);else{if(Ce!=="MultiPolygon"){if(Ce==="GeometryCollection"){for(const Ze of X.geometry.geometries)pi(Qe,{id:Le,geometry:Ze,properties:X.properties},ie,ge);return}throw new Error("Input data is not a valid GeoJSON object.")}for(const Ze of Ie){const rt=[];on(Ze,rt,De,!0),ke.push(rt)}}Qe.push(Wt(Le,Ce,ke,X.properties))}function di(Qe,X){X.push(Ci(Qe[0]),Bi(Qe[1]),0)}function ai(Qe,X,ie,ge){let Ie,Ce,De=0;for(let Le=0;Le<Qe.length;Le++){const Ze=Ci(Qe[Le][0]),rt=Bi(Qe[Le][1]);X.push(Ze,rt,0),Le>0&&(De+=ge?(Ie*rt-Ze*Ce)/2:Math.sqrt(Math.pow(Ze-Ie,2)+Math.pow(rt-Ce,2))),Ie=Ze,Ce=rt}const ke=X.length-3;X[2]=1,$t(X,0,ke,ie),X[ke+2]=1,X.size=Math.abs(De),X.start=0,X.end=X.size}function on(Qe,X,ie,ge){for(let Ie=0;Ie<Qe.length;Ie++){const Ce=[];ai(Qe[Ie],Ce,ie,ge),X.push(Ce)}}function Ci(Qe){return Qe/360+.5}function Bi(Qe){const X=Math.sin(Qe*Math.PI/180),ie=.5-.25*Math.log((1+X)/(1-X))/Math.PI;return ie<0?0:ie>1?1:ie}function Gi(Qe,X,ie,ge,Ie,Ce,De,ke){if(ge/=X,Ce>=(ie/=X)&&De<ge)return Qe;if(De<ie||Ce>=ge)return null;const Le=[];for(const Ze of Qe){const rt=Ze.geometry;let He=Ze.type;const Lt=Ie===0?Ze.minX:Ze.minY,Ht=Ie===0?Ze.maxX:Ze.maxY;if(Lt>=ie&&Ht<ge){Le.push(Ze);continue}if(Ht<ie||Lt>=ge)continue;let qt=[];if(He==="Point"||He==="MultiPoint")Vn(rt,qt,ie,ge,Ie);else if(He==="LineString")Kn(rt,qt,ie,ge,Ie,!1,ke.lineMetrics);else if(He==="MultiLineString")Us(rt,qt,ie,ge,Ie,!1);else if(He==="Polygon")Us(rt,qt,ie,ge,Ie,!0);else if(He==="MultiPolygon")for(const xi of rt){const Pi=[];Us(xi,Pi,ie,ge,Ie,!0),Pi.length&&qt.push(Pi)}if(qt.length){if(ke.lineMetrics&&He==="LineString"){for(const xi of qt)Le.push(Wt(Ze.id,He,xi,Ze.tags));continue}He!=="LineString"&&He!=="MultiLineString"||(qt.length===1?(He="LineString",qt=qt[0]):He="MultiLineString"),He!=="Point"&&He!=="MultiPoint"||(He=qt.length===3?"Point":"MultiPoint"),Le.push(Wt(Ze.id,He,qt,Ze.tags))}}return Le.length?Le:null}function Vn(Qe,X,ie,ge,Ie){for(let Ce=0;Ce<Qe.length;Ce+=3){const De=Qe[Ce+Ie];De>=ie&&De<=ge&&Qs(X,Qe[Ce],Qe[Ce+1],Qe[Ce+2])}}function Kn(Qe,X,ie,ge,Ie,Ce,De){let ke=$n(Qe);const Le=Ie===0?tr:Pr;let Ze,rt,He=Qe.start;for(let Pi=0;Pi<Qe.length-3;Pi+=3){const Ri=Qe[Pi],Qi=Qe[Pi+1],hs=Qe[Pi+2],Yi=Qe[Pi+3],jn=Qe[Pi+4],Tn=Ie===0?Ri:Qi,Jn=Ie===0?Yi:jn;let Gn=!1;De&&(Ze=Math.sqrt(Math.pow(Ri-Yi,2)+Math.pow(Qi-jn,2))),Tn<ie?Jn>ie&&(rt=Le(ke,Ri,Qi,Yi,jn,ie),De&&(ke.start=He+Ze*rt)):Tn>ge?Jn<ge&&(rt=Le(ke,Ri,Qi,Yi,jn,ge),De&&(ke.start=He+Ze*rt)):Qs(ke,Ri,Qi,hs),Jn<ie&&Tn>=ie&&(rt=Le(ke,Ri,Qi,Yi,jn,ie),Gn=!0),Jn>ge&&Tn<=ge&&(rt=Le(ke,Ri,Qi,Yi,jn,ge),Gn=!0),!Ce&&Gn&&(De&&(ke.end=He+Ze*rt),X.push(ke),ke=$n(Qe)),De&&(He+=Ze)}let Lt=Qe.length-3;const Ht=Qe[Lt],qt=Qe[Lt+1],xi=Ie===0?Ht:qt;xi>=ie&&xi<=ge&&Qs(ke,Ht,qt,Qe[Lt+2]),Lt=ke.length-3,Ce&&Lt>=3&&(ke[Lt]!==ke[0]||ke[Lt+1]!==ke[1])&&Qs(ke,ke[0],ke[1],ke[2]),ke.length&&X.push(ke)}function $n(Qe){const X=[];return X.size=Qe.size,X.start=Qe.start,X.end=Qe.end,X}function Us(Qe,X,ie,ge,Ie,Ce){for(const De of Qe)Kn(De,X,ie,ge,Ie,Ce,!1)}function Qs(Qe,X,ie,ge){Qe.push(X,ie,ge)}function tr(Qe,X,ie,ge,Ie,Ce){const De=(Ce-X)/(ge-X);return Qs(Qe,Ce,ie+(Ie-ie)*De,1),De}function Pr(Qe,X,ie,ge,Ie,Ce){const De=(Ce-ie)/(Ie-ie);return Qs(Qe,X+(ge-X)*De,Ce,1),De}function Mo(Qe,X){const ie=[];for(let ge=0;ge<Qe.length;ge++){const Ie=Qe[ge],Ce=Ie.type;let De;if(Ce==="Point"||Ce==="MultiPoint"||Ce==="LineString")De=Bo(Ie.geometry,X);else if(Ce==="MultiLineString"||Ce==="Polygon"){De=[];for(const ke of Ie.geometry)De.push(Bo(ke,X))}else if(Ce==="MultiPolygon"){De=[];for(const ke of Ie.geometry){const Le=[];for(const Ze of ke)Le.push(Bo(Ze,X));De.push(Le)}}ie.push(Wt(Ie.id,Ce,De,Ie.tags))}return ie}function Bo(Qe,X){const ie=[];ie.size=Qe.size,Qe.start!==void 0&&(ie.start=Qe.start,ie.end=Qe.end);for(let ge=0;ge<Qe.length;ge+=3)ie.push(Qe[ge]+X,Qe[ge+1],Qe[ge+2]);return ie}function wr(Qe,X){if(Qe.transformed)return Qe;const ie=1<<Qe.z,ge=Qe.x,Ie=Qe.y;for(const Ce of Qe.features){const De=Ce.geometry,ke=Ce.type;if(Ce.geometry=[],ke===1)for(let Le=0;Le<De.length;Le+=2)Ce.geometry.push(Hr(De[Le],De[Le+1],X,ie,ge,Ie));else for(let Le=0;Le<De.length;Le++){const Ze=[];for(let rt=0;rt<De[Le].length;rt+=2)Ze.push(Hr(De[Le][rt],De[Le][rt+1],X,ie,ge,Ie));Ce.geometry.push(Ze)}}return Qe.transformed=!0,Qe}function Hr(Qe,X,ie,ge,Ie,Ce){return[Math.round(ie*(Qe*ge-Ie)),Math.round(ie*(X*ge-Ce))]}function El(Qe,X,ie,ge,Ie){const Ce=X===Ie.maxZoom?0:Ie.tolerance/((1<<X)*Ie.extent),De={features:[],numPoints:0,numSimplified:0,numFeatures:Qe.length,source:null,x:ie,y:ge,z:X,transformed:!1,minX:2,minY:1,maxX:-1,maxY:0};for(const ke of Qe)Ss(De,ke,Ce,Ie);return De}function Ss(Qe,X,ie,ge){const Ie=X.geometry,Ce=X.type,De=[];if(Qe.minX=Math.min(Qe.minX,X.minX),Qe.minY=Math.min(Qe.minY,X.minY),Qe.maxX=Math.max(Qe.maxX,X.maxX),Qe.maxY=Math.max(Qe.maxY,X.maxY),Ce==="Point"||Ce==="MultiPoint")for(let ke=0;ke<Ie.length;ke+=3)De.push(Ie[ke],Ie[ke+1]),Qe.numPoints++,Qe.numSimplified++;else if(Ce==="LineString")ga(De,Ie,Qe,ie,!1,!1);else if(Ce==="MultiLineString"||Ce==="Polygon")for(let ke=0;ke<Ie.length;ke++)ga(De,Ie[ke],Qe,ie,Ce==="Polygon",ke===0);else if(Ce==="MultiPolygon")for(let ke=0;ke<Ie.length;ke++){const Le=Ie[ke];for(let Ze=0;Ze<Le.length;Ze++)ga(De,Le[Ze],Qe,ie,!0,Ze===0)}if(De.length){let ke=X.tags||null;if(Ce==="LineString"&&ge.lineMetrics){ke={};for(const Ze in X.tags)ke[Ze]=X.tags[Ze];ke.mapbox_clip_start=Ie.start/Ie.size,ke.mapbox_clip_end=Ie.end/Ie.size}const Le={geometry:De,type:Ce==="Polygon"||Ce==="MultiPolygon"?3:Ce==="LineString"||Ce==="MultiLineString"?2:1,tags:ke};X.id!==null&&(Le.id=X.id),Qe.features.push(Le)}}function ga(Qe,X,ie,ge,Ie,Ce){const De=ge*ge;if(ge>0&&X.size<(Ie?De:ge))return void(ie.numPoints+=X.length/3);const ke=[];for(let Le=0;Le<X.length;Le+=3)(ge===0||X[Le+2]>De)&&(ie.numSimplified++,ke.push(X[Le],X[Le+1])),ie.numPoints++;Ie&&function(Le,Ze){let rt=0;for(let He=0,Lt=Le.length,Ht=Lt-2;He<Lt;Ht=He,He+=2)rt+=(Le[He]-Le[Ht])*(Le[He+1]+Le[Ht+1]);if(rt>0===Ze)for(let He=0,Lt=Le.length;He<Lt/2;He+=2){const Ht=Le[He],qt=Le[He+1];
601Le[He]=Le[Lt-2-He],Le[He+1]=Le[Lt-1-He],Le[Lt-2-He]=Ht,Le[Lt-1-He]=qt}}(ke,Ce),Qe.push(ke)}const qa={maxZoom:14,indexMaxZoom:5,indexMaxPoints:1e5,tolerance:3,extent:4096,buffer:64,lineMetrics:!1,promoteId:null,generateId:!1,debug:0};class No{constructor(X,ie){const ge=(ie=this.options=function(Ce,De){for(const ke in De)Ce[ke]=De[ke];return Ce}(Object.create(qa),ie)).debug;if(ge&&console.time("preprocess data"),ie.maxZoom<0||ie.maxZoom>24)throw new Error("maxZoom should be in the 0-24 range");if(ie.promoteId&&ie.generateId)throw new Error("promoteId and generateId cannot be used together.");let Ie=function(Ce,De){const ke=[];if(Ce.type==="FeatureCollection")for(let Le=0;Le<Ce.features.length;Le++)pi(ke,Ce.features[Le],De,Le);else pi(ke,Ce.type==="Feature"?Ce:{geometry:Ce},De);return ke}(X,ie);this.tiles={},this.tileCoords=[],ge&&(console.timeEnd("preprocess data"),console.log("index: maxZoom: %d, maxPoints: %d",ie.indexMaxZoom,ie.indexMaxPoints),console.time("generate tiles"),this.stats={},this.total=0),Ie=function(Ce,De){const ke=De.buffer/De.extent;let Le=Ce;const Ze=Gi(Ce,1,-1-ke,ke,0,-1,2,De),rt=Gi(Ce,1,1-ke,2+ke,0,-1,2,De);return(Ze||rt)&&(Le=Gi(Ce,1,-ke,1+ke,0,-1,2,De)||[],Ze&&(Le=Mo(Ze,1).concat(Le)),rt&&(Le=Le.concat(Mo(rt,-1)))),Le}(Ie,ie),Ie.length&&this.splitTile(Ie,0,0,0),ge&&(Ie.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)))}splitTile(X,ie,ge,Ie,Ce,De,ke){const Le=[X,ie,ge,Ie],Ze=this.options,rt=Ze.debug;for(;Le.length;){Ie=Le.pop(),ge=Le.pop(),ie=Le.pop(),X=Le.pop();const He=1<<ie,Lt=Vc(ie,ge,Ie);let Ht=this.tiles[Lt];if(!Ht&&(rt>1&&console.time("creation"),Ht=this.tiles[Lt]=El(X,ie,ge,Ie,Ze),this.tileCoords.push({z:ie,x:ge,y:Ie}),rt)){rt>1&&(console.log("tile z%d-%d-%d (features: %d, points: %d, simplified: %d)",ie,ge,Ie,Ht.numFeatures,Ht.numPoints,Ht.numSimplified),console.timeEnd("creation"));const Gn=`z${ie}`;this.stats[Gn]=(this.stats[Gn]||0)+1,this.total++}if(Ht.source=X,Ce==null){if(ie===Ze.indexMaxZoom||Ht.numPoints<=Ze.indexMaxPoints)continue}else{if(ie===Ze.maxZoom||ie===Ce)continue;if(Ce!=null){const Gn=Ce-ie;if(ge!==De>>Gn||Ie!==ke>>Gn)continue}}if(Ht.source=null,X.length===0)continue;rt>1&&console.time("clipping");const qt=.5*Ze.buffer/Ze.extent,xi=.5-qt,Pi=.5+qt,Ri=1+qt;let Qi=null,hs=null,Yi=null,jn=null,Tn=Gi(X,He,ge-qt,ge+Pi,0,Ht.minX,Ht.maxX,Ze),Jn=Gi(X,He,ge+xi,ge+Ri,0,Ht.minX,Ht.maxX,Ze);X=null,Tn&&(Qi=Gi(Tn,He,Ie-qt,Ie+Pi,1,Ht.minY,Ht.maxY,Ze),hs=Gi(Tn,He,Ie+xi,Ie+Ri,1,Ht.minY,Ht.maxY,Ze),Tn=null),Jn&&(Yi=Gi(Jn,He,Ie-qt,Ie+Pi,1,Ht.minY,Ht.maxY,Ze),jn=Gi(Jn,He,Ie+xi,Ie+Ri,1,Ht.minY,Ht.maxY,Ze),Jn=null),rt>1&&console.timeEnd("clipping"),Le.push(Qi||[],ie+1,2*ge,2*Ie),Le.push(hs||[],ie+1,2*ge,2*Ie+1),Le.push(Yi||[],ie+1,2*ge+1,2*Ie),Le.push(jn||[],ie+1,2*ge+1,2*Ie+1)}}getTile(X,ie,ge){X=+X,ie=+ie,ge=+ge;const Ie=this.options,{extent:Ce,debug:De}=Ie;if(X<0||X>24)return null;const ke=1<<X,Le=Vc(X,ie=ie+ke&ke-1,ge);if(this.tiles[Le])return wr(this.tiles[Le],Ce);De>1&&console.log("drilling down to z%d-%d-%d",X,ie,ge);let Ze,rt=X,He=ie,Lt=ge;for(;!Ze&&rt>0;)rt--,He>>=1,Lt>>=1,Ze=this.tiles[Vc(rt,He,Lt)];return Ze&&Ze.source?(De>1&&(console.log("found parent tile z%d-%d-%d",rt,He,Lt),console.time("drilling down")),this.splitTile(Ze.source,rt,He,Lt,X,ie,ge),De>1&&console.timeEnd("drilling down"),this.tiles[Le]?wr(this.tiles[Le],Ce):null):null}}function Vc(Qe,X,ie){return 32*((1<<Qe)*ie+X)+Qe}function zh(Qe,X){const ie=Qe.tileID.canonical;if(!this._geoJSONIndex)return void X(null,null);const ge=this._geoJSONIndex.getTile(ie.z,ie.x,ie.y);if(!ge)return void X(null,null);const Ie=new vt(ge.features);let Ce=Ki(Ie);Ce.byteOffset===0&&Ce.byteLength===Ce.buffer.byteLength||(Ce=new Uint8Array(Ce)),X(null,{vectorTile:Ie,rawData:Ce.buffer})}class Cu extends be{constructor(X,ie,ge,Ie,Ce,De,ke){super(X,ie,ge,Ie,Ce,zh,ke),De&&(this.loadGeoJSON=De),this._dynamicIndex=new At}loadData(X,ie){const ge=X&&X.request,Ie=ge&&ge.collectResourceTiming;this.loadGeoJSON(X,(Ce,De)=>{if(Ce||!De)return ie(Ce);
601if(typeof De!="object")return ie(new Error(`Input data given to '${X.source}' is not a valid GeoJSON object.`));{try{if(X.filter){const Le=s.X(X.filter,{type:"boolean","property-type":"data-driven",overridable:!1,transition:!1});if(Le.result==="error")throw new Error(Le.value.map(Ze=>`${Ze.key}: ${Ze.message}`).join(", "));De.features=De.features.filter(Ze=>Le.value.evaluate({zoom:0},Ze))}X.dynamic?(De.type==="Feature"&&(De={type:"FeatureCollection",features:[De]}),X.append||(this._dynamicIndex.clear(),this.loaded={}),this._dynamicIndex.load(De.features,this.loaded),X.cluster&&(De.features=this._dynamicIndex.getFeatures())):this.loaded={},this._geoJSONIndex=X.cluster?new ti(function({superclusterOptions:Le,clusterProperties:Ze}){if(!Ze||!Le)return Le;const rt={},He={},Lt={accumulated:null,zoom:0},Ht={properties:null},qt=Object.keys(Ze);for(const xi of qt){const[Pi,Ri]=Ze[xi],Qi=s.X(Ri),hs=s.X(typeof Pi=="string"?[Pi,["accumulated"],["get",xi]]:Pi);rt[xi]=Qi.value,He[xi]=hs.value}return Le.map=xi=>{Ht.properties=xi;const Pi={};for(const Ri of qt)Pi[Ri]=rt[Ri].evaluate(Lt,Ht);return Pi},Le.reduce=(xi,Pi)=>{Ht.properties=Pi;for(const Ri of qt)Lt.accumulated=xi[Ri],xi[Ri]=He[Ri].evaluate(Lt,Ht)},Le}(X)).load(De.features):X.dynamic?this._dynamicIndex:function(Le,Ze){return new No(Le,Ze)}(De,X.geojsonVtOptions)}catch(Le){return ie(Le)}const ke={};if(Ie){const Le=A(ge);Le&&(ke.resourceTiming={},ke.resourceTiming[X.source]=JSON.parse(JSON.stringify(Le)))}ie(null,ke)}})}reloadTile(X,ie){const ge=this.loaded;return ge&&ge[X.uid]?X.partial?ie(null,void 0):super.reloadTile(X,ie):this.loadTile(X,ie)}loadGeoJSON(X,ie){if(X.request)s.n(X.request,ie);else{if(typeof X.data!="string")return ie(new Error(`Input data given to '${X.source}' is not a valid GeoJSON object.`));try{return ie(null,JSON.parse(X.data))}catch{return ie(new Error(`Input data given to '${X.source}' is not a valid GeoJSON object.`))}}}getClusterExpansionZoom(X,ie){try{ie(null,this._geoJSONIndex.getClusterExpansionZoom(X.clusterId))}catch(ge){ie(ge)}}getClusterChildren(X,ie){try{ie(null,this._geoJSONIndex.getChildren(X.clusterId))}catch(ge){ie(ge)}}getClusterLeaves(X,ie){try{ie(null,this._geoJSONIndex.getLeaves(X.clusterId,X.limit,X.offset))}catch(ge){ie(ge)}}}class kt{constructor(X,ie){this.tileID=new s.aM(X.tileID.overscaledZ,X.tileID.wrap,X.tileID.canonical.z,X.tileID.canonical.x,X.tileID.canonical.y),this.tileZoom=X.tileZoom,this.uid=X.uid,this.zoom=X.zoom,this.canonical=X.tileID.canonical,this.pixelRatio=X.pixelRatio,this.tileSize=X.tileSize,this.source=X.source,this.overscaling=this.tileID.overscaleFactor(),this.projection=X.projection,this.brightness=ie}parse(X,ie,ge,Ie){this.status="parsing";const Ce=new s.aM(ge.tileID.overscaledZ,ge.tileID.wrap,ge.tileID.canonical.z,ge.tileID.canonical.x,ge.tileID.canonical.y),De=[],ke=ie.familiesBySource[ge.source],Le=new s.f0(Ce,ge.promoteId);Le.bucketLayerIDs=[],Le.is3DTile=!0,s.fi(X).then(Ze=>{if(!Ze)return Ie(new Error("Could not parse tile"));const rt=s.fj(Ze,1/s.cT(ge.tileID.canonical)),He=Ze.json.extensionsUsed&&Ze.json.extensionsUsed.includes("MAPBOX_mesh_features")||Ze.json.asset.extras&&Ze.json.asset.extras.MAPBOX_mesh_features,Lt=Ze.json.extensionsUsed&&Ze.json.extensionsUsed.includes("EXT_meshopt_compression"),Ht=new s.aa(this.zoom,{brightness:this.brightness});for(const qt in ke)for(const xi of ke[qt]){const Pi=xi[0];Le.bucketLayerIDs.push(xi.map(Qi=>s.C(Qi.id,Qi.scope))),Pi.recalculate(Ht,[]);const Ri=new s.fk(xi,rt,Ce,He,Lt,this.brightness,Le);He||(Ri.needsUpload=!0),De.push(Ri),Ri.evaluate(Pi)}this.status="done",Ie(null,{buckets:De,featureIndex:Le,collisionBoxArray:null,glyphAtlasImage:null,lineAtlas:null,imageAtlas:null,brightness:null})}).catch(Ze=>Ie(new Error(Ze.message)))}}class Za{constructor(X,ie,ge,Ie,Ce,De,ke){this.actor=X,this.layerIndex=ie,this.availableImages=ge,this.availableModels=Ie,this.brightness=ke,this.loading={},this.loaded={}}loadTile(X,ie){const ge=X.uid,Ie=this.loading[ge]=new kt(X,this.brightness);s.br(X.request,(Ce,De)=>{const ke=!this.loading[ge];return delete this.loading[ge],ke||Ce?(Ie.status="done",ke||(this.loaded[ge]=Ie),ie(Ce)):De&&De.byteLength!==0?void Ie.parse(De,this.layerIndex,X,(Le,Ze)=>{Ie.status="done",this.loaded=this.loaded||{},this.loaded[ge]=Ie,Le||!Ze?ie(Le):ie(null,Ze)}):(Ie.status="done",this.loaded[ge]=Ie,ie())})}reloadTile(X,ie){const ge=this.loaded,Ie=X.uid;if(ge&&ge[Ie]){const Ce=ge[Ie];Ce.projection=X.projection,Ce.brightness=X.brightness;const De=(ke,Le)=>{Ce.reloadCallback&&(delete Ce.reloadCallback,this.loadTile(X,ie)),ie(ke,Le)};Ce.status==="parsing"?Ce.reloadCallback=De:Ce.status==="done"&&this.loadTile(X,ie)}}abortTile(X,ie){const ge=X.uid;this.loading[ge]&&delete this.loading[ge],ie()}removeTile(X,ie){const ge=this.loaded,Ie=X.uid;ge&&ge[Ie]&&delete ge[Ie],ie()}}class Xa{constructor(X){this.self=X,this.actor=new s.fm(X,this),this.layerIndexes={},this.availableImages={},this.availableModels={},this.isSpriteLoaded={},this.imageRasterizer=new s.y,this.projections={},this.defaultProjection=s.ce({name:"mercator"}),this.workerSourceTypes={vector:be,geojson:Cu,"raster-dem":ve,"raster-array":je,"batched-model":Za},this.workerSources={}
601,this.self.registerWorkerSource=(ie,ge)=>{if(this.workerSourceTypes[ie])throw new Error(`Worker source with name "${ie}" already registered.`);this.workerSourceTypes[ie]=ge},this.self.registerRTLTextPlugin=ie=>{if(s.fn.isParsed())throw new Error("RTL text plugin already registered.");s.fn.applyArabicShaping=ie.applyArabicShaping,s.fn.processBidirectionalText=ie.processBidirectionalText,s.fn.processStyledBidirectionalText=ie.processStyledBidirectionalText}}clearCaches(X,ie,ge){delete this.layerIndexes[X],delete this.availableImages[X],delete this.availableModels[X],delete this.workerSources[X],ge()}checkIfReady(X,ie,ge){ge()}setReferrer(X,ie){this.referrer=ie}spriteLoaded(X,ie){this.isSpriteLoaded[X]||(this.isSpriteLoaded[X]={});const{scope:ge,isLoaded:Ie}=ie;if(this.isSpriteLoaded[X][ge]=Ie,this.workerSources[X]&&this.workerSources[X][ge])for(const Ce in this.workerSources[X][ge]){const De=this.workerSources[X][ge][Ce];for(const ke in De){const Le=De[ke];Le instanceof be&&(Le.isSpriteLoaded=Ie,Le.fire(new s.A("isSpriteLoaded")))}}}setImages(X,ie,ge){this.availableImages[X]||(this.availableImages[X]={});const{scope:Ie,images:Ce}=ie;if(this.availableImages[X][Ie]=Ce,this.workerSources[X]&&this.workerSources[X][Ie]){for(const De in this.workerSources[X][Ie]){const ke=this.workerSources[X][Ie][De];for(const Le in ke)ke[Le].availableImages=Ce}ge()}else ge()}setModels(X,{scope:ie,models:ge},Ie){if(this.availableModels[X]||(this.availableModels[X]={}),this.availableModels[X][ie]=ge,this.workerSources[X]&&this.workerSources[X][ie]){for(const Ce in this.workerSources[X][ie]){const De=this.workerSources[X][ie][Ce];for(const ke in De)De[ke].availableModels=ge}Ie()}else Ie()}setProjection(X,ie){this.projections[X]=s.ce(ie)}setBrightness(X,ie,ge){this.brightness=ie,ge()}setLayers(X,ie,ge){this.getLayerIndex(X,ie.scope).replace(ie.layers,ie.options),ge()}updateLayers(X,ie,ge){this.getLayerIndex(X,ie.scope).update(ie.layers,ie.removedIds,ie.options),ge()}loadTile(X,ie,ge){ie.projection=this.projections[X]||this.defaultProjection,this.getWorkerSource(X,ie.type,ie.source,ie.scope).loadTile(ie,ge)}decodeRasterArray(X,ie,ge){this.getWorkerSource(X,ie.type,ie.source,ie.scope).decodeRasterArray(ie,ge)}reloadTile(X,ie,ge){ie.projection=this.projections[X]||this.defaultProjection,this.getWorkerSource(X,ie.type,ie.source,ie.scope).reloadTile(ie,ge)}abortTile(X,ie,ge){this.getWorkerSource(X,ie.type,ie.source,ie.scope).abortTile(ie,ge)}removeTile(X,ie,ge){this.getWorkerSource(X,ie.type,ie.source,ie.scope).removeTile(ie,ge)}removeSource(X,ie,ge){if(!(this.workerSources[X]&&this.workerSources[X][ie.scope]&&this.workerSources[X][ie.scope][ie.type]&&this.workerSources[X][ie.scope][ie.type][ie.source]))return;const Ie=this.workerSources[X][ie.scope][ie.type][ie.source];delete this.workerSources[X][ie.scope][ie.type][ie.source],Ie.removeSource!==void 0?Ie.removeSource(ie,ge):ge()}loadWorkerSource(X,ie,ge){try{this.self.importScripts(ie.url),ge()}catch(Ie){ge(Ie.toString())}}syncRTLPluginState(X,ie,ge){try{s.fn.setState(ie);const Ie=s.fn.getPluginURL();if(s.fn.isLoaded()&&!s.fn.isParsed()&&Ie!=null){this.self.importScripts(Ie);const Ce=s.fn.isParsed();ge(Ce?void 0:new Error(`RTL Text Plugin failed to import scripts from ${Ie}`),Ce)}}catch(Ie){ge(Ie.toString())}}setDracoUrl(X,ie){this.dracoUrl=ie}getAvailableImages(X,ie){this.availableImages[X]||(this.availableImages[X]={});let ge=this.availableImages[X][ie];return ge||(ge=[]),ge}getAvailableModels(X,ie){this.availableModels[X]||(this.availableModels[X]={});let ge=this.availableModels[X][ie];return ge||(ge={}),ge}getLayerIndex(X,ie){this.layerIndexes[X]||(this.layerIndexes[X]={});let ge=this.layerIndexes[X][ie];return ge||(ge=this.layerIndexes[X][ie]=new V,ge.scope=ie),ge}getWorkerSource(X,ie,ge,Ie){const Ce=this.workerSources;return Ce[X]||(Ce[X]={}),Ce[X][Ie]||(Ce[X][Ie]={}),Ce[X][Ie][ie]||(Ce[X][Ie][ie]={}),this.isSpriteLoaded[X]||(this.isSpriteLoaded[X]={}),Ce[X][Ie][ie][ge]||(Ce[X][Ie][ie][ge]=new this.workerSourceTypes[ie]({send:(De,ke,Le,Ze,rt,He)=>this.actor.send(De,ke,Le,X,rt,He),scheduler:this.actor.scheduler},this.getLayerIndex(X,Ie),this.getAvailableImages(X,Ie),this.getAvailableModels(X,Ie),this.isSpriteLoaded[X][Ie],void 0,this.brightness)),Ce[X][Ie][ie][ge]}rasterizeImagesWorker(X,ie,ge){const Ie=new Map;for(const[Ce,{image:De,imageVariant:ke}]of ie.tasks.entries()){const Le=this.imageRasterizer.rasterize(ke,De,ie.scope,X);Ie.set(Ce,Le)}ge(void 0,Ie)}removeRasterizedImages(X,ie,ge){this.imageRasterizer.removeImagesFromCacheByIds(ie.imageIds,ie.scope,X),ge()}enforceCacheSizeLimit(X,ie){s.fo(ie)}getWorkerPerformanceMetrics(X,ie,ge){ge(void 0,void 0)}}return s.fl(self)&&(self.worker=new Xa(self)),Xa}),_(["./shared"],function(s){var A="3.12.0";const P={create:"create",load:"load",fullLoad:"fullLoad"},R={mark(f){performance.mark(f)},measure(f,i,l){performance.measure(f,i,l)}};function V(f){const i=f.name.split("?")[0];return s.a(i)&&i.includes("mapbox-gl.js")?"javascript":s.a(i)&&i.includes("mapbox-gl.css")?"css":s.b(i)?"fontRange":s.c(i)?"sprite":s.i(i)?"style":s.d(i)?"tilejson":"other"}var j,Q={},me=function(){if(j)return Q;function f(p){return!i(p)}function i(p){return typeof window>"u"||typeof document>"u"?"not a browser":function(){if(!("Worker"in window&&"Blob"in window&&"URL"in window))return!1;var v,w,S=new Blob([""],{type:"text/javascript"}),C=URL.createObjectURL(S);try{w=new Worker(C),v=!0}catch{v=!1}return w&&w.terminate(),URL.revokeObjectURL(C),v}()?function(){var v=document.createElement("canvas");v.width=v.height=1;var w=v.getContext("2d");if(!w)return!1;var S=w.getImageData(0,0,1,1);return S&&S.width===v.width}()?(l[y=p&&p.failIfMajorPerformanceCaveat]===void 0&&(l[y]=function(v){var w,S=function(C){var D=document.createElement("canvas"),L=Object.create(f.webGLContextAttributes);return L.failIfMajorPerformanceCaveat=C,D.getContext("webgl2",L)}(v);if(!S)return!1;try{w=S.createShader(S.VERTEX_SHADER)}catch{return!1}return!(!w||S.isContextLost())&&(S.shaderSource(w,"void main() {}"),S.compileShader(w),S.getShaderParameter(w,S.COMPILE_STATUS)===!0)}(y)),l[y]?document.documentMode?"insufficient ECMAScript 6 support":void 0:"insufficient WebGL2 support"):"insufficient Canvas/getImageData support":"insufficient worker support";var y}j=1,Q.supported=f,Q.notSupportedReason=i;var l={};return f.webGLContextAttributes={antialias:!1,alpha:!0,stencil:!0,depth:!0},Q}();function re(f,i,l){const p=document.createElement(f);return i!=null&&(p.className=i),l&&l.appendChild(p),p}function be(f,i,l){const p=document.createElementNS("http://www.w3.org/2000/svg",f);for(const y of Object.keys(i))p.setAttributeNS(null,y,String(i[y]));return l&&l.appendChild(p),p}const ve=typeof document<"u"?document.documentElement&&document.documentElement.style:null,Ee=ve&&ve.userSelect!==void 0?"userSelect":"WebkitUserSelect";let je;function Ve(){ve&&Ee&&(je=ve[Ee],ve[Ee]="none")}function Je(){ve&&Ee&&(ve[Ee]=je)}function vt(f){f.preventDefault(),f.stopPropagation(),window.removeEventListener("click",vt,!0)}function _t(){window.addEventListener("click",vt,!0),window.setTimeout(()=>{window.removeEventListener("click",vt,!0)},0)}function Mt(f,i){const l=f.getBoundingClientRect();return Yt(f,l,i)}function At(f,i){const l=f.getBoundingClientRect(),p=[];for(let y=0;y<i.length;y++)p.push(Yt(f,l,i[y]));return p}function ei(f){return/firefox/i.test(navigator.userAgent)&&/macintosh/i.test(navigator.userAgent)&&f.button===2&&f.ctrlKey?0:f.button}function Yt(f,i,l){const p=f.offsetWidth===i.width?1:f.offsetWidth/i.width;return new s.P((l.clientX-i.left)*p,(l.clientY-i.top)*p)}const Zt="01",yi="NO_ACCESS_TOKEN";class Fi{constructor(i,l,p){this._transformRequestFn=i,this._customAccessToken=l,this._silenceAuthErrors=!!p,this._createSkuToken()}_createSkuToken(){const i=function(){let l="";for(let p=0;p<10;p++)l+="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"[Math.floor(62*Math.random())];return{token:["1",Zt,l].join(""),tokenExpiresAt:Date.now()+432e5}}();this._skuToken=i.token,this._skuTokenExpiresAt=i.tokenExpiresAt}_isSkuTokenExpired(){return Date.now()>this._skuTokenExpiresAt}transformRequest(i,l){return this._transformRequestFn&&this._transformRequestFn(i,l)||{url:i}}normalizeStyleURL(i,l){if(!s.f(i))return i;const p=wi(i);return p.params.push(`sdk=js-${A}`),p.path=`/styles/v1${p.path}`,this._makeAPIURL(p,this._customAccessToken||l)}normalizeGlyphsURL(i,l){if(!s.f(i))return i;const p=wi(i);return p.path=`/fonts/v1${p.path}`,this._makeAPIURL(p,this._customAccessToken||l)}normalizeModelURL(i,l){if(!s.f(i))return i;const p=wi(i);return p.path=`/models/v1${p.path}`,this._makeAPIURL(p,this._customAccessToken||l)}normalizeSourceURL(i,l,p,y){if(!s.f(i))return i;const v=wi(i);return v.path=`/v4/${v.authority}.json`,v.params.push("secure"),p&&v.params.push(`language=${p}`),y&&v.params.push(`worldview=${y}`),this._makeAPIURL(v,this._customAccessToken||l)}normalizeIconsetURL(i,l){const p=wi(i);return s.f(i)?(p.path=`/styles/v1${p.path}/iconset.pbf`,this._makeAPIURL(p,this._customAccessToken||l)):Li(p)}normalizeSpriteURL(i,l,p,y){const v=wi(i);return s.f(i)?(v.path=`/styles/v1${v.path}/sprite${l}${p}`,this._makeAPIURL(v,this._customAccessToken||y)):(v.path+=`${l}${p}`,Li(v))}normalizeTileURL(i,l,p){if(this._isSkuTokenExpired()&&this._createSkuToken(),i&&!s.f(i))return i;const y=wi(i);y.path=y.path.replace(/(\.(png|jpg)\d*)(?=$)/,`${l||p&&y.authority!=="raster"&&p===512?"@2x":""}${s.m.supported?".webp":"$1"}`),y.authority==="raster"?y.path=`/${s.e.RASTER_URL_PREFIX}${y.path}`:y.authority==="rasterarrays"?y.path=`/${s.e.RASTERARRAYS_URL_PREFIX}${y.path}`:y.authority==="3dtiles"?y.path=`/${s.e.TILES3D_URL_PREFIX}${y.path}`:(y.path=y.path.replace(/^.+\/v4\//,"/"),y.path=`/${s.e.TILE_URL_VERSION}${y.path}`);const v=this._customAccessToken||function(w){for(const S of w){const C=S.match(/^access_token=(.*)$/);if(C)return C[1]}return null}(y.params)||s.e.ACCESS_TOKEN;return s.e.REQUIRE_ACCESS_TOKEN&&v&&this._skuToken&&y.params.push(`sku=${this._skuToken}`),this._makeAPIURL(y,v)}canonicalizeTileURL(i,l){const p=wi(i);if(!p.path.match(/^(\/v4\/|\/(raster|rasterarrays)\/v1\/)/)||!p.path.match(/\.[\w]+$/))return i;let y="mapbox://";p.path.match(/^\/raster\/v1\//)?y+=`raster/${p.path.replace(`/${s.e.RASTER_URL_PREFIX}/`,"")}`:p.path.match(/^\/rasterarrays\/v1\//)?y+=`rasterarrays/${p.path.replace(`/${s.e.RASTERARRAYS_URL_PREFIX}/`,"")}`:y+=`tiles/${p.path.replace(`/${s.e.TILE_URL_VERSION}/`,"")}`;let v=p.params;return l&&(v=v.filter(w=>!w.match(/^access_token=/))),v.length&&(y+=`?${v.join("&")}`),y}canonicalizeTileset(i,l){const p=!!l&&s.f(l),y=[];for(const v of i.tiles||[])s.h(v)?y.push(this.canonicalizeTileURL(v,p)):y.push(v);return y}_makeAPIURL(i,l){const p="See https://docs.mapbox.com/api/overview/#access-tokens-and-token-scopes",y=wi(s.e.API_URL);if(i.protocol=y.protocol,i.authority=y.authority,i.protocol==="http"){const v=i.params.indexOf("secure");v>=0&&i.params.splice(v,1)}if(y.path!=="/"&&(i.path=`${y.path}${i.path}`),!s.e.REQUIRE_ACCESS_TOKEN)return Li(i);if(l=l||s.e.ACCESS_TOKEN,!this._silenceAuthErrors){if(!l)throw new Error(`An API access token is required to use Mapbox GL. ${p}`);
601if(l[0]==="s")throw new Error(`Use a public access token (pk.*) with Mapbox GL, not a secret access token (sk.*). ${p}`)}return i.params=i.params.filter(v=>v.indexOf("access_token")===-1),i.params.push(`access_token=${l||""}`),Li(i)}}const ki=/^(\w+):\/\/([^/?]*)(\/[^?]+)?\??(.+)?/;function wi(f){const i=f.match(ki);if(!i)throw new Error("Unable to parse URL object");return{protocol:i[1],authority:i[2],path:i[3]||"/",params:i[4]?i[4].split("&"):[]}}function Li(f){const i=f.params.length?`?${f.params.join("&")}`:"";return`${f.protocol}://${f.authority}${f.path}${i}`}const cn="mapbox.eventData";function vi(f){if(!f)return null;const i=f.split(".");if(!i||i.length!==3)return null;try{return JSON.parse(s.j(i[1]))}catch{return null}}class Ue{constructor(i){this.type=i,this.anonId=null,this.eventData={},this.queue=[],this.pendingRequest=null}getStorageKey(i){const l=vi(s.e.ACCESS_TOKEN);let p="";return p=l&&l.u?s.k(l.u):s.e.ACCESS_TOKEN||"",i?`${cn}.${i}:${p}`:`${cn}:${p}`}fetchEventData(){const i=s.s("localStorage"),l=this.getStorageKey(),p=this.getStorageKey("uuid");if(i)try{const y=localStorage.getItem(l);y&&(this.eventData=JSON.parse(y));const v=localStorage.getItem(p);v&&(this.anonId=v)}catch{s.w("Unable to read from LocalStorage")}}saveEventData(){const i=s.s("localStorage"),l=this.getStorageKey(),p=this.getStorageKey("uuid"),y=this.anonId;if(i&&y)try{localStorage.setItem(p,y),Object.keys(this.eventData).length>=1&&localStorage.setItem(l,JSON.stringify(this.eventData))}catch{s.w("Unable to write to LocalStorage")}}processRequests(i){}postEvent(i,l,p,y){if(!s.e.EVENTS_URL)return;const v=wi(s.e.EVENTS_URL);v.params.push(`access_token=${y||s.e.ACCESS_TOKEN||""}`);const w={event:this.type,created:new Date(i).toISOString()},S=l?s.l(w,l):w,C={url:Li(v),headers:{"Content-Type":"text/plain"},body:JSON.stringify([S])};this.pendingRequest=s.p(C,D=>{this.pendingRequest=null,p(D),this.saveEventData(),this.processRequests(y)})}queueRequest(i,l){this.queue.push(i),this.processRequests(l)}}const Yn=new class extends Ue{constructor(f){super("appUserTurnstile"),this._customAccessToken=f}postTurnstileEvent(f,i){s.e.EVENTS_URL&&s.e.ACCESS_TOKEN&&Array.isArray(f)&&f.some(l=>s.f(l)||s.h(l))&&this.queueRequest(Date.now(),i)}processRequests(f){if(this.pendingRequest||this.queue.length===0)return;this.anonId&&this.eventData.lastSuccess&&this.eventData.tokenU||this.fetchEventData();const i=vi(s.e.ACCESS_TOKEN),l=i?i.u:s.e.ACCESS_TOKEN;let p=l!==this.eventData.tokenU;s.v(this.anonId)||(this.anonId=s.u(),p=!0);const y=this.queue.shift();if(this.eventData.lastSuccess){const v=new Date(this.eventData.lastSuccess),w=new Date(y),S=(y-this.eventData.lastSuccess)/864e5;p=p||S>=1||S<-1||v.getDate()!==w.getDate()}else p=!0;p?this.postEvent(y,{sdkIdentifier:"mapbox-gl-js",sdkVersion:A,skuId:Zt,"enabled.telemetry":!1,userId:this.anonId},v=>{v||(this.eventData.lastSuccess=y,this.eventData.tokenU=l)},f):this.processRequests()}},Ki=Yn.postTurnstileEvent.bind(Yn),ps=new class extends Ue{constructor(){super("map.load"),this.success={},this.skuToken=""}postMapLoadEvent(f,i,l,p){this.skuToken=i,this.errorCb=p,s.e.EVENTS_URL&&(l||s.e.ACCESS_TOKEN?this.queueRequest({id:f,timestamp:Date.now()},l):this.errorCb(new Error(yi)))}processRequests(f){if(this.pendingRequest||this.queue.length===0)return;const{id:i,timestamp:l}=this.queue.shift();i&&this.success[i]||(this.anonId||this.fetchEventData(),s.v(this.anonId)||(this.anonId=s.u()),this.postEvent(l,{sdkIdentifier:"mapbox-gl-js",sdkVersion:A,skuId:Zt,skuToken:this.skuToken,userId:this.anonId},p=>{p?this.errorCb(p):i&&(this.success[i]=!0)},f))}remove(){this.errorCb=null}},On=ps.postMapLoadEvent.bind(ps),hn=new class extends Ue{constructor(){super("style.load"),this.eventIdPerMapInstanceMap=new Map,this.mapInstanceIdMap=new WeakMap}getMapInstanceId(f){let i=this.mapInstanceIdMap.get(f);return i||(i=s.u(),this.mapInstanceIdMap.set(f,i)),i}getEventId(f){const i=this.eventIdPerMapInstanceMap.get(f)||0;return this.eventIdPerMapInstanceMap.set(f,i+1),i}postStyleLoadEvent(f,i){const{map:l,style:p,importedStyles:y}=i;if(!s.e.EVENTS_URL||!f&&!s.e.ACCESS_TOKEN)return;const v=this.getMapInstanceId(l),w={mapInstanceId:v,eventId:this.getEventId(v),style:p};y.length&&(w.importedStyles=y),this.queueRequest({timestamp:Date.now(),payload:w},f)}processRequests(f){if(this.pendingRequest||this.queue.length===0)return;const{timestamp:i,payload:l}=this.queue.shift();this.postEvent(i,l,()=>{},f)}},Hi=hn.postStyleLoadEvent.bind(hn),Ct=new class extends Ue{constructor(){super("gljs.performance")}postPerformanceEvent(f,i){s.e.EVENTS_URL&&(f||s.e.ACCESS_TOKEN)&&this.queueRequest({timestamp:Date.now(),performanceData:i},f)}processRequests(f){if(this.pendingRequest||this.queue.length===0)return;const{timestamp:i,performanceData:l}=this.queue.shift(),p=function(y){const v=performance.getEntriesByType("resource"),w=performance.getEntriesByType("mark"),S=function($){const q={};if($){for(const W in $)if(W!=="other")for(const K of $[W]){const Z=`${W}ResolveRangeMin`,se=`${W}ResolveRangeMax`,ue=`${W}RequestCount`,fe=`${W}RequestCachedCount`;q[Z]=Math.min(q[Z]||1/0,K.startTime),q[se]=Math.max(q[se]||-1/0,K.responseEnd);const xe=_e=>{q[_e]===void 0&&(q[_e]=0),++q[_e]};K.transferSize!==void 0&&K.transferSize===0&&xe(fe),xe(ue)}}return q}(function($,q){const W={};if($)for(const K of $){const Z=q(K);W[Z]===void 0&&(W[Z]=[]),W[Z].push(K)}return W}(v,V)),C=window.devicePixelRatio,D=navigator.connection||navigator.mozConnection||navigator.webkitConnection,L=D?D.effectiveType:void 0,F={counters:[],metadata:[],attributes:[]},O=($,q,W)=>{W!=null&&$.push({name:q,value:W.toString()})};for(const $ in S)O(F.counters,$,S[$]);if(y.interactionRange[0]!==1/0&&y.interactionRange[1]!==-1/0&&(O(F.counters,"interactionRangeMin",y.interactionRange[0]),O(F.counters,"interactionRangeMax",y.interactionRange[1])),w)for(const $ of Object.keys(P)){const q=P[$],W=w.find(K=>K.name===q);W&&O(F.counters,q,W.startTime)}return O(F.counters,"visibilityHidden",y.visibilityHidden),O(F.attributes,"style",function($){if($)for(const q of $){const W=q.name.split("?")[0];if(s.i(W)){const K=W.split("/").slice(-2);if(K.length===2)return`mapbox://styles/${K[0]}/${K[1]}`}}}(v)),O(F.attributes,"terrainEnabled",y.terrainEnabled?"true":"false"),O(F.attributes,"fogEnabled",y.fogEnabled?"true":"false"),O(F.attributes,"projection",y.projection),O(F.attributes,"zoom",y.zoom),O(F.metadata,"devicePixelRatio",C),O(F.metadata,"connectionEffectiveType",L),O(F.metadata,"navigatorUserAgent",navigator.userAgent),O(F.metadata,"screenWidth",window.screen.width),O(F.metadata,"screenHeight",window.screen.height),O(F.metadata,"windowWidth",window.innerWidth),O(F.metadata,"windowHeight",window.innerHeight),O(F.metadata,"mapWidth",y.width/C),O(F.metadata,"mapHeight",y.height/C),O(F.metadata,"webglRenderer",y.renderer),O(F.metadata,"webglVendor",y.vendor),O(F.metadata,"sdkVersion",A),O(F.metadata,"sdkIdentifier","mapbox-gl-js"),F}(l);for(const y of p.metadata);for(const y of p.counters);for(const y of p.attributes);this.postEvent(i,p,()=>{},f)}},zt=Ct.postPerformanceEvent.bind(Ct),ti=new class extends Ue{constructor(){super("map.auth"),this.success={},this.skuToken=""}getSession(f,i,l,p){if(!s.e.API_URL||!s.e.SESSION_PATH)return;const y=wi(s.e.API_URL+s.e.SESSION_PATH);
601y.params.push(`sku=${i||""}`),y.params.push(`access_token=${p||s.e.ACCESS_TOKEN||""}`);const v={url:Li(y),headers:{"Content-Type":"text/plain"}};this.pendingRequest=s.g(v,w=>{this.pendingRequest=null,l(w),this.saveEventData(),this.processRequests(p)})}getSessionAPI(f,i,l,p){this.skuToken=i,this.errorCb=p,s.e.SESSION_PATH&&s.e.API_URL&&(l||s.e.ACCESS_TOKEN?this.queueRequest({id:f,timestamp:Date.now()},l):this.errorCb(new Error(yi)))}processRequests(f){if(this.pendingRequest||this.queue.length===0)return;const{id:i,timestamp:l}=this.queue.shift();i&&this.success[i]||this.getSession(l,this.skuToken,p=>{p?this.errorCb(p):i&&(this.success[i]=!0)},f)}remove(){this.errorCb=null}},qi=ti.getSessionAPI.bind(ti),ts=new Set;function Fe(f,i){i?ts.add(f):ts.delete(f)}class Oe{constructor(){this._changed=!1,this._updatedLayers={},this._removedLayers={},this._updatedSourceCaches={},this._updatedPaintProps=new Set,this._updatedImages={}}isDirty(){return this._changed}setDirty(){this._changed=!0}getUpdatedSourceCaches(){return this._updatedSourceCaches}updateSourceCache(i,l){this._updatedSourceCaches[i]=l,this.setDirty()}discardSourceCacheUpdate(i){delete this._updatedSourceCaches[i]}updateLayer(i){const l=i.scope;this._updatedLayers[l]=this._updatedLayers[l]||new Set,this._updatedLayers[l].add(i.id),this.setDirty()}removeLayer(i){const l=i.scope;this._removedLayers[l]=this._removedLayers[l]||{},this._updatedLayers[l]=this._updatedLayers[l]||new Set,this._removedLayers[l][i.id]=i,this._updatedLayers[l].delete(i.id),this._updatedPaintProps.delete(i.fqid),this.setDirty()}getRemovedLayer(i){return this._removedLayers[i.scope]?this._removedLayers[i.scope][i.id]:null}discardLayerRemoval(i){this._removedLayers[i.scope]&&delete this._removedLayers[i.scope][i.id]}getLayerUpdatesByScope(){const i={};for(const l in this._updatedLayers)i[l]=i[l]||{},i[l].updatedIds=Array.from(this._updatedLayers[l].values());for(const l in this._removedLayers)i[l]=i[l]||{},i[l].removedIds=Object.keys(this._removedLayers[l]);return i}getUpdatedPaintProperties(){return this._updatedPaintProps}updatePaintProperties(i){this._updatedPaintProps.add(i.fqid),this.setDirty()}getUpdatedImages(i){return this._updatedImages[i]?Array.from(this._updatedImages[i].values()):[]}updateImage(i,l){this._updatedImages[l]=this._updatedImages[l]||new Set,this._updatedImages[l].add(s.I.toString(i)),this.setDirty()}resetUpdatedImages(i){this._updatedImages[i]&&this._updatedImages[i].clear()}reset(){this._changed=!1,this._updatedLayers={},this._removedLayers={},this._updatedSourceCaches={},this._updatedPaintProps.clear(),this._updatedImages={}}}function dt(f){const{userImage:i}=f;return!!(i&&i.render&&i.render())&&(f.data.replace(new Uint8Array(i.data.buffer)),!0)}class $t extends s.E{constructor(i){super(),this.imageProviders=new Map,this.images=new Map,this.updatedImages=new Map,this.callbackDispatchedThisFrame=new Map,this.loaded=new Map,this.requestors=[],this.patterns=new Map,this.patternsInFlight=new Set,this.atlasImage=new Map,this.atlasTexture=new Map,this.dirty=!0,this.spriteFormat=i,i!=="raster"&&s.t()&&(this.imageRasterizerDispatcher=new s.D(s.x(),this,"Image Rasterizer Worker",1))}addScope(i){this.loaded.set(i,!1),this.imageProviders.set(i,new Map),this.images.set(i,new Map),this.updatedImages.set(i,new Set),this.callbackDispatchedThisFrame.set(i,new Set),this.patterns.set(i,new Map),this.atlasImage.set(i,new s.r({width:1,height:1}))}removeScope(i){this.loaded.delete(i),this.imageProviders.delete(i),this.images.delete(i),this.updatedImages.delete(i),this.callbackDispatchedThisFrame.delete(i),this.patterns.delete(i),this.atlasImage.delete(i);const l=this.atlasTexture.get(i);l&&(l.destroy(),this.atlasTexture.delete(i))}addImageProvider(i,l){this.imageProviders.has(l)||this.imageProviders.set(l,new Map),this.imageProviders.get(l).set(i.id,i)}removeImageProvider(i,l){this.imageProviders.has(l)&&this.imageProviders.get(l).delete(i)}getPendingImageProviders(){const i=[];for(const l of this.imageProviders.values())for(const p of l.values())p.hasPendingRequests()&&i.push(p);return i}get imageRasterizer(){return this._imageRasterizer||(this._imageRasterizer=new s.y),this._imageRasterizer}isLoaded(){for(const i of this.loaded.keys())if(!this.loaded.get(i))return!1;return!0}
601setLoaded(i,l){if(this.loaded.get(l)!==i&&(this.loaded.set(l,i),i)){for(const{ids:p,callback:y}of this.requestors)this._notify(p,l,y);this.requestors=[]}}hasImage(i,l){return!!this.getImage(i,l)}getImage(i,l){return this.images.get(l).get(i.toString())}addImage(i,l,p){this._validate(i,p)&&this.images.get(l).set(i.toString(),p)}_validate(i,l){let p=!0;return this._validateStretch(l.stretchX,l.data&&l.data.width)||(this.fire(new s.z(new Error(`Image "${i.name}" has invalid "stretchX" value`))),p=!1),this._validateStretch(l.stretchY,l.data&&l.data.height)||(this.fire(new s.z(new Error(`Image "${i.name}" has invalid "stretchY" value`))),p=!1),this._validateContent(l.content,l)||(this.fire(new s.z(new Error(`Image "${i.name}" has invalid "content" value`))),p=!1),p}_validateStretch(i,l){if(!i)return!0;let p=0;for(const y of i){if(y[0]<p||y[1]<y[0]||l<y[1])return!1;p=y[1]}return!0}_validateContent(i,l){return i?i.length!==4||!l.usvg&&(i[0]<0||l.data.width<i[0]||i[1]<0||l.data.height<i[1]||i[2]<0||l.data.width<i[2]||i[3]<0||l.data.height<i[3])?!1:!(i[2]<i[0]||i[3]<i[1]):!0}updateImage(i,l,p){const y=this.images.get(l).get(i.toString());p.version=y.version+1,this.images.get(l).set(i.toString(),p),this.updatedImages.get(l).add(i),this.removeFromImageRasterizerCache(i,l)}clearUpdatedImages(i){this.updatedImages.get(i).clear()}removeFromImageRasterizerCache(i,l){this.spriteFormat!=="raster"&&(s.t()?this.imageRasterizerDispatcher.getActor().send("removeRasterizedImages",{imageIds:[i],scope:l}):this.imageRasterizer.removeImagesFromCacheByIds([i],l))}removeImage(i,l){const p=this.images.get(l),y=p.get(i.toString());p.delete(i.toString()),this.patterns.get(l).delete(i.toString()),this.removeFromImageRasterizerCache(i,l),y.userImage&&y.userImage.onRemove&&y.userImage.onRemove()}listImages(i){return Array.from(this.images.get(i).keys()).map(l=>s.I.from(l))}getImages(i,l,p){const y=[],v=[],w=this.imageProviders.get(l);for(const L of i){if(!L.iconsetId){y.push(L);continue}const F=w.get(L.iconsetId);F&&(this.getImage(L,l)?v.push(L):F.addPendingRequest(L))}if(y.length===0)return void this._notify(v,l,p);let S=!0;const C=!!this.loaded.get(l),D=this.images.get(l);if(!C)for(const L of y)D.has(L.toString())||(S=!1);C||S?this._notify(y,l,p):this.requestors.push({ids:y,scope:l,callback:p})}rasterizeImages(i,l){const p=new Map,{tasks:y,scope:v}=i;for(const[w,S]of y.entries()){const C=this.getImage(S.id,v);C&&p.set(w,{image:C,imageVariant:S})}this._rasterizeImages(v,p,l)}_rasterizeImages(i,l,p){if(s.t())this.imageRasterizerDispatcher.getActor().send("rasterizeImagesWorker",{tasks:l,scope:i},p);else{const y=new Map;for(const[v,{image:w,imageVariant:S}]of l.entries())y.set(v,this.imageRasterizer.rasterize(S,w,i,0));p(void 0,y)}}getUpdatedImages(i){return this.updatedImages.get(i)||new Set}_notify(i,l,p){const y=this.images.get(l),v=new Map;for(const w of i){if(!y.get(w.toString())){if(w.iconsetId)continue;this.fire(new s.A("styleimagemissing",{id:w.name}))}const S=y.get(w.toString());if(!S){s.w(`Image "${w.name}" 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.`);continue}const C={data:S.usvg?null:S.data.clone(),pixelRatio:S.pixelRatio,sdf:S.sdf,usvg:S.usvg,version:S.version,stretchX:S.stretchX,stretchY:S.stretchY,content:S.content,hasRenderCallback:!!(S.userImage&&S.userImage.render)};S.usvg&&Object.assign(C,{width:S.icon.usvg_tree.width,height:S.icon.usvg_tree.height}),v.set(s.I.toString(w),C)}p(null,v)}getPixelSize(i){const{width:l,height:p}=this.atlasImage.get(i);return{width:l,height:p}}getPattern(i,l,p){const y=i.toString(),v=this.patterns.get(l),w=v.get(y),S=this.getImage(i,l);if(!S)return null;if(w){if(w.position.version===S.version)return w.position;w.position.version=S.version}else{if(S.usvg&&!S.data){const C=this.getPatternInFlightId(y,l);if(this.patternsInFlight.has(C))return null;this.patternsInFlight.add(C);const D=new s.B(i).scaleSelf(s.q.devicePixelRatio),L=new Map([[D.toString(),{image:S,imageVariant:D}]]);return this._rasterizeImages(l,L,(F,O)=>this.storePatternImage(D,l,S,p,O)),null}this.storePattern(i,l,S)}return this._updatePatternAtlas(l,p),v.get(y).position}getPatternInFlightId(i,l){return s.C(i,l)}hasPatternsInFlight(){return this.patternsInFlight.size!==0}storePatternImage(i,l,p,y,v){const w=i.toString(),S=v?v.get(w):void 0;S&&(p.data=S,this.storePattern(i.id,l,p),this._updatePatternAtlas(l,y),this.patternsInFlight.delete(this.getPatternInFlightId(i.id.toString(),l)))}storePattern(i,l,p){const y={w:p.data.width+2*s.F,h:p.data.height+2*s.F,x:0,y:0},v=new s.G(y,p,s.F);this.patterns.get(l).set(i.toString(),{bin:y,position:v})}bind(i,l){const p=i.gl;let y=this.atlasTexture.get(l);y?this.dirty&&(y.update(this.atlasImage.get(l)),this.dirty=!1):(y=new s.T(i,this.atlasImage.get(l),p.RGBA8),this.atlasTexture.set(l,y)),y.bind(p.LINEAR,p.CLAMP_TO_EDGE)}_updatePatternAtlas(i,l){const p=this.patterns.get(i),y=Array.from(p.values()).map(({bin:D})=>D),{w:v,h:w}=s.H(y),S=this.atlasImage.get(i);
601S.resize({width:v||1,height:w||1});const C=this.images.get(i);for(const[D,{bin:L,position:F}]of p.entries()){let O=F.padding;const $=L.x+O,q=L.y+O,W=C.get(D).data,K=W.width,Z=W.height;O=O>1?O-1:O,s.r.copy(W,S,{x:0,y:0},{x:$,y:q},{width:K,height:Z},l),s.r.copy(W,S,{x:0,y:Z-O},{x:$,y:q-O},{width:K,height:O},l),s.r.copy(W,S,{x:0,y:0},{x:$,y:q+Z},{width:K,height:O},l),s.r.copy(W,S,{x:K-O,y:0},{x:$-O,y:q},{width:O,height:Z},l),s.r.copy(W,S,{x:0,y:0},{x:$+K,y:q},{width:O,height:Z},l),s.r.copy(W,S,{x:K-O,y:Z-O},{x:$-O,y:q-O},{width:O,height:O},l),s.r.copy(W,S,{x:0,y:Z-O},{x:$+K,y:q-O},{width:O,height:O},l),s.r.copy(W,S,{x:0,y:0},{x:$+K,y:q+Z},{width:O,height:O},l),s.r.copy(W,S,{x:K-O,y:0},{x:$-O,y:q+Z},{width:O,height:O},l)}this.dirty=!0}beginFrame(){for(const i of this.images.keys())this.callbackDispatchedThisFrame.set(i,new Set)}dispatchRenderCallbacks(i,l){const p=this.images.get(l);for(const y of i){if(this.callbackDispatchedThisFrame.get(l).has(y.toString()))continue;this.callbackDispatchedThisFrame.get(l).add(y.toString());const v=p.get(y.toString());dt(v)&&this.updateImage(y,l,v)}}}function Ft(f){const i=f.key,l=f.value,p=f.valueSpec||{},y=f.objectElementValidators||{},v=f.style,w=f.styleSpec;let S=[];const C=s.K(l);if(C!=="object")return[new s.V(i,l,`object expected, ${C} found`)];for(const D in l){const L=D.split(".")[0];let F;y[L]?F=y[L]:p[L]?F=Ss:y["*"]?F=y["*"]:p["*"]&&(F=Ss),F?S=S.concat(F({key:(i&&`${i}.`)+D,value:l[D],valueSpec:p[L]||p["*"],style:v,styleSpec:w,object:l,objectKey:D},l)):S.push(new s.J(i,l[D],`unknown property "${D}"`))}for(const D in p)y[D]||p[D].required&&p[D].default===void 0&&l[D]===void 0&&S.push(new s.V(i,l,`missing required property "${D}"`));return S}function Wt(f){const i=f.value,l=f.valueSpec,p=f.style,y=f.styleSpec,v=f.key,w=f.arrayElementValidator||Ss;if(s.K(i)!=="array")return[new s.V(v,i,`array expected, ${s.K(i)} found`)];if(l.length&&i.length!==l.length)return[new s.V(v,i,`array length ${l.length} expected, length ${i.length} found`)];if(l["min-length"]&&i.length<l["min-length"])return[new s.V(v,i,`array length at least ${l["min-length"]} expected, length ${i.length} found`)];let S={type:l.value,values:l.values,minimum:l.minimum,maximum:l.maximum,function:void 0};y.$version<7&&(S.function=l.function),s.K(l.value)==="object"&&(S=l.value);let C=[];for(let D=0;D<i.length;D++)C=C.concat(w({array:i,arrayIndex:D,value:i[D],valueSpec:S,style:p,styleSpec:y,key:`${v}[${D}]`},!0));return C}function Ti(f){const i=f.key,l=f.value,p=f.valueSpec;let y=s.K(l);if(y==="number"&&l!=l&&(y="NaN"),y!=="number")return[new s.V(i,l,`number expected, ${y} found`)];if("minimum"in p){let v=p.minimum;if(s.K(p.minimum)==="array"&&(v=p.minimum[f.arrayIndex]),l<v)return[new s.V(i,l,`${l} is less than the minimum value ${v}`)]}if("maximum"in p){let v=p.maximum;if(s.K(p.maximum)==="array"&&(v=p.maximum[f.arrayIndex]),l>v)return[new s.V(i,l,`${l} is greater than the maximum value ${v}`)]}return[]}function pi(f){const i=f.valueSpec,l=s.M(f.value.type);let p,y,v,w={};const S=l!=="categorical"&&f.value.property===void 0,C=!S,D=s.K(f.value.stops)==="array"&&s.K(f.value.stops[0])==="array"&&s.K(f.value.stops[0][0])==="object",L=Ft({key:f.key,value:f.value,valueSpec:f.styleSpec.function,style:f.style,styleSpec:f.styleSpec,objectElementValidators:{stops:function($){if(l==="identity")return[new s.V($.key,$.value,'identity function may not have a "stops" property')];let q=[];const W=$.value;return q=q.concat(Wt({key:$.key,value:W,valueSpec:$.valueSpec,style:$.style,styleSpec:$.styleSpec,arrayElementValidator:F})),s.K(W)==="array"&&W.length===0&&q.push(new s.V($.key,W,"array must have at least one stop")),q},default:function($){return Ss({key:$.key,value:$.value,valueSpec:i,style:$.style,styleSpec:$.styleSpec})}}});return l==="identity"&&S&&L.push(new s.V(f.key,f.value,'missing required property "property"')),l==="identity"||f.value.stops||L.push(new s.V(f.key,f.value,'missing required property "stops"')),l==="exponential"&&f.valueSpec.expression&&!s.N(f.valueSpec)&&L.push(new s.V(f.key,f.value,"exponential functions not supported")),f.styleSpec.$version>=8&&(C&&!s.O(f.valueSpec)?L.push(new s.V(f.key,f.value,"property functions not supported")):S&&!s.Q(f.valueSpec)&&L.push(new s.V(f.key,f.value,"zoom functions not supported"))),l!=="categorical"&&!D||f.value.property!==void 0||L.push(new s.V(f.key,f.value,'"property" property is required')),L;function F($){let q=[];const W=$.value,K=$.key;if(s.K(W)!=="array")return[new s.V(K,W,`array expected, ${s.K(W)} found`)];if(W.length!==2)return[new s.V(K,W,`array length 2 expected, length ${W.length} found`)];if(D){if(s.K(W[0])!=="object")return[new s.V(K,W,`object expected, ${s.K(W[0])} found`)];if(W[0].zoom===void 0)return[new s.V(K,W,"object stop key must have zoom")];if(W[0].value===void 0)return[new s.V(K,W,"object stop key must have value")];const Z=s.M(W[0].zoom);if(typeof Z!="number")return[new s.V(K,W[0].zoom,"stop zoom values must be numbers")];if(v&&v>Z)return[new s.V(K,W[0].zoom,"stop zoom values must appear in ascending order")];Z!==v&&(v=Z,y=void 0,w={}),q=q.concat(Ft({key:`${K}[0]`,value:W[0],valueSpec:{zoom:{}},style:$.style,styleSpec:$.styleSpec,objectElementValidators:{zoom:Ti,value:O}}))}else q=q.concat(O({key:`${K}[0]`,value:W[0],valueSpec:{},style:$.style,styleSpec:$.styleSpec},W));return s.S(s.U(W[1]))?q.concat([new s.V(`${K}[1]`,W[1],"expressions are not allowed in function stops.")]):q.concat(Ss({key:`${K}[1]`,value:W[1],valueSpec:i,style:$.style,styleSpec:$.styleSpec}))}function O($,q){const W=s.K($.value),K=s.M($.value),Z=$.value!==null?$.value:q;if(p){if(W!==p)return[new s.V($.key,Z,`${W} stop domain type must match previous stop domain type ${p}`)]}else p=W;if(W!=="number"&&W!=="string"&&W!=="boolean"&&typeof K!="number"&&typeof K!="str
601ing"&&typeof K!="boolean")return[new s.V($.key,Z,"stop domain value must be a number, string, or boolean")];if(W!=="number"&&l!=="categorical"){let se=`number expected, ${W} found`;return s.O(i)&&l===void 0&&(se+='\nIf you intended to use a categorical function, specify `"type": "categorical"`.'),[new s.V($.key,Z,se)]}return l!=="categorical"||W!=="number"||typeof K=="number"&&isFinite(K)&&Math.floor(K)===K?l!=="categorical"&&W==="number"&&typeof K=="number"&&typeof y=="number"&&y!==void 0&&K<y?[new s.V($.key,Z,"stop domain values must appear in ascending order")]:(y=K,l==="categorical"&&K in w?[new s.V($.key,Z,"stop domain values must be unique")]:(w[K]=!0,[])):[new s.V($.key,Z,`integer expected, found ${String(K)}`)]}}function di(f){const i=(f.expressionContext==="property"?s.W:s.X)(s.U(f.value),f.valueSpec);if(i.result==="error")return i.value.map(p=>new s.V(`${f.key}${p.key}`,f.value,p.message));const l=i.value.expression||i.value._styleExpression.expression;if(f.expressionContext==="property"&&f.propertyKey==="text-font"&&!l.outputDefined())return[new s.V(f.key,f.value,`Invalid data expression for "${f.propertyKey}". Output values must be contained as literals within the expression.`)];if(f.expressionContext==="property"&&f.propertyType==="layout"&&!s.Y(l))return[new s.V(f.key,f.value,'"feature-state" data expressions are not supported with layout properties.')];if(f.expressionContext==="filter")return ai(l,f);if(f.expressionContext&&f.expressionContext.indexOf("cluster")===0){if(!s.Z(l,["zoom","feature-state"]))return[new s.V(f.key,f.value,'"zoom" and "feature-state" expressions are not supported with cluster properties.')];if(f.expressionContext==="cluster-initial"&&!s._(l))return[new s.V(f.key,f.value,"Feature data expressions are not supported with initial expression part of cluster properties.")]}return[]}function ai(f,i){const l=new Set(["zoom","feature-state","pitch","distance-from-center"]);if(i.valueSpec&&i.valueSpec.expression)for(const y of i.valueSpec.expression.parameters)l.delete(y);if(l.size===0)return[];const p=[];return f instanceof s.$&&l.has(f.name)?[new s.V(i.key,i.value,`["${f.name}"] expression is not supported in a filter for a ${i.object.type} layer with id: ${i.object.id}`)]:(f.eachChild(y=>{p.push(...ai(y,i))}),p)}function on(f){const i=f.key,l=f.value,p=f.valueSpec,y=[];return Array.isArray(p.values)?p.values.indexOf(s.M(l))===-1&&y.push(new s.V(i,l,`expected one of [${p.values.join(", ")}], ${JSON.stringify(l)} found`)):Object.keys(p.values).indexOf(s.M(l))===-1&&y.push(new s.V(i,l,`expected one of [${Object.keys(p.values).join(", ")}], ${JSON.stringify(l)} found`)),y}function Ci(f){return s.a1(s.U(f.value))?di(s.L({},f,{expressionContext:"filter",valueSpec:f.styleSpec[`filter_${f.layerType||"fill"}`]})):Bi(f)}function Bi(f){const i=f.value,l=f.key;if(s.K(i)!=="array")return[new s.V(l,i,`array expected, ${s.K(i)} found`)];const p=f.styleSpec;let y,v=[];if(i.length<1)return[new s.V(l,i,"filter array must have at least 1 element")];switch(v=v.concat(on({key:`${l}[0]`,value:i[0],valueSpec:p.filter_operator,style:f.style,styleSpec:f.styleSpec})),s.M(i[0])){case"<":case"<=":case">":case">=":i.length>=2&&s.M(i[1])==="$type"&&v.push(new s.V(l,i,`"$type" cannot be use with operator "${i[0]}"`));case"==":case"!=":i.length!==3&&v.push(new s.V(l,i,`filter array for operator "${i[0]}" must have 3 elements`));case"in":case"!in":i.length>=2&&(y=s.K(i[1]),y!=="string"&&v.push(new s.V(`${l}[1]`,i[1],`string expected, ${y} found`)));for(let w=2;w<i.length;w++)y=s.K(i[w]),s.M(i[1])==="$type"?v=v.concat(on({key:`${l}[${w}]`,value:i[w],valueSpec:p.geometry_type,style:f.style,styleSpec:f.styleSpec})):y!=="string"&&y!=="number"&&y!=="boolean"&&v.push(new s.V(`${l}[${w}]`,i[w],`string, number, or boolean expected, ${y} found`));break;case"any":case"all":case"none":for(let w=1;w<i.length;w++)v=v.concat(Bi({key:`${l}[${w}]`,value:i[w],style:f.style,styleSpec:f.styleSpec}));break;case"has":case"!has":y=s.K(i[1]),i.length!==2?v.push(new s.V(l,i,`filter array for "${i[0]}" operator must have 2 elements`)):y!=="string"&&v.push(new s.V(`${l}[1]`,i[1],`string expected, ${y} found`))}return v}function Gi(f,i){const l=f.key,p=f.style,y=f.layer,v=f.styleSpec,w=f.value,S=f.objectKey,C=v[`${i}_${f.layerType}`];if(!C)return[];const D=S.match(/^(.*)-use-theme$/);if(i==="paint"&&D&&C[D[1]])return s.S(w)?[].concat(Ss({key:f.key,value:w,valueSpec:{type:"string",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},style:p,styleSpec:v,expressionContext:"property",propertyType:i,propertyKey:S})):Ss({key:l,value:w,valueSpec:{type:"string"},style:p,styleSpec:v});const L=S.match(/^(.*)-transition$/);if(i==="paint"&&L&&C[L[1]]&&C[L[1]].transition)return Ss({key:l,value:w,valueSpec:v.transition,style:p,styleSpec:v});const F=f.valueSpec||C[S];if(!F)return[new s.J(l,w,`unknown property "${S}"`)];let O;
601if(s.K(w)==="string"&&s.O(F)&&!F.tokens&&(O=/^{([^}]+)}$/.exec(w))){const q=`\`{ "type": "identity", "property": ${O?JSON.stringify(O[1]):'"_"'} }\``;return[new s.V(l,w,`"${S}" does not support interpolation syntax 602Use an identity property function instead: ${q}.`)]}const $=[];if(f.layerType==="symbol")S!=="text-field"||!p||p.glyphs||p.imports||$.push(new s.V(l,w,'use of "text-field" requires a style "glyphs" property')),S==="text-font"&&s.a2(s.U(w))&&s.M(w.type)==="identity"&&$.push(new s.V(l,w,'"text-font" does not support identity functions'));else if(f.layerType==="model"&&i==="paint"&&y&&y.layout&&y.layout.hasOwnProperty("model-id")&&s.O(F)&&(s.a3(F)||s.Q(F))){const q=s.W(s.U(w),F),W=q.value.expression||q.value._styleExpression.expression;W&&!s.Z(W,["measure-light"])&&(S==="model-emissive-strength"&&s._(W)&&s.Y(W)||$.push(new s.V(l,w,`${S} does not support measure-light expressions when the model layer source is vector tile or GeoJSON.`)))}return $.concat(Ss({key:f.key,value:w,valueSpec:F,style:p,styleSpec:v,expressionContext:"property",propertyType:i,propertyKey:S}))}function Vn(f){return Gi(f,"paint")}function Kn(f){return Gi(f,"layout")}function $n(f){let i=[];const l=f.value,p=f.key,y=f.style,v=f.styleSpec;l.type||l.ref||i.push(new s.V(p,l,'either "type" or "ref" is required'));let w=s.M(l.type);const S=s.M(l.ref);if(l.id){const C=s.M(l.id);for(let D=0;D<f.arrayIndex;D++){const L=y.layers[D];s.M(L.id)===C&&i.push(new s.V(p,l.id,`duplicate layer id "${l.id}", previously used at line ${L.id.__line__}`))}}if("ref"in l){let C;["type","source","source-layer","filter","layout"].forEach(D=>{D in l&&i.push(new s.V(p,l[D],`"${D}" is prohibited for ref layers`))}),y.layers.forEach(D=>{s.M(D.id)===S&&(C=D)}),C?C.ref?i.push(new s.V(p,l.ref,"ref cannot reference another ref layer")):w=s.M(C.type):typeof S=="string"&&i.push(new s.V(p,l.ref,`ref layer "${S}" not found`))}else if(w!=="background"&&w!=="sky"&&w!=="slot")if(l.source){const C=y.sources&&y.sources[l.source],D=C&&s.M(C.type);C?D==="vector"&&w==="raster"?i.push(new s.V(p,l.source,`layer "${l.id}" requires a raster source`)):D==="raster"&&w!=="raster"?i.push(new s.V(p,l.source,`layer "${l.id}" requires a vector source`)):D!=="vector"||l["source-layer"]?D==="raster-dem"&&w!=="hillshade"?i.push(new s.V(p,l.source,"raster-dem source can only be used with layer type 'hillshade'.")):D!=="raster-array"||["raster","raster-particle"].includes(w)?w==="line"&&l.paint&&(l.paint["line-gradient"]||l.paint["line-trim-offset"])&&D==="geojson"&&!C.lineMetrics?i.push(new s.V(p,l,`layer "${l.id}" specifies a line-gradient, which requires the GeoJSON source to have \`lineMetrics\` enabled.`)):w==="raster-particle"&&D!=="raster-array"&&i.push(new s.V(p,l.source,`layer "${l.id}" requires a 'raster-array' source.`)):i.push(new s.V(p,l.source,"raster-array source can only be used with layer type 'raster'.")):i.push(new s.V(p,l,`layer "${l.id}" must specify a "source-layer"`)):i.push(new s.V(p,l.source,`source "${l.source}" not found`))}else i.push(new s.V(p,l,'missing required property "source"'));return i=i.concat(Ft({key:p,value:l,valueSpec:v.layer,style:f.style,styleSpec:f.styleSpec,objectElementValidators:{"*":()=>[],type:()=>Ss({key:`${p}.type`,value:l.type,valueSpec:v.layer.type,style:f.style,styleSpec:f.styleSpec,object:l,objectKey:"type"}),filter:C=>Ci(s.L({layerType:w},C)),layout:C=>Ft({layer:l,key:C.key,value:C.value,valueSpec:{},style:C.style,styleSpec:C.styleSpec,objectElementValidators:{"*":D=>Kn(s.L({layerType:w},D))}}),paint:C=>Ft({layer:l,key:C.key,value:C.value,valueSpec:{},style:C.style,styleSpec:C.styleSpec,objectElementValidators:{"*":D=>Vn(s.L({layerType:w,layer:l},D))}})}})),i}function Us(f){const i=f.value,l=f.key,p=s.K(i);return p!=="string"?[new s.V(l,i,`string expected, ${p} found`)]:[]}const Qs={promoteId:function f({key:i,value:l}){if(s.K(l)==="string")return Us({key:i,value:l});if(Array.isArray(l)){const p=[],y=s.U(l),v=s.X(y);return v.result==="error"&&v.value.forEach(w=>{p.push(new s.V(`${i}${w.key}`,null,`${w.message}`))}),s.Z(v.value.expression,["zoom","heatmap-density","line-progress","raster-value","sky-radial-progress","accumulated","is-supported-script","pitch","distance-from-center","measure-light","raster-particle-speed"])||p.push(new s.V(`${i}`,null,"promoteId expression should be only feature dependent")),p}{const p=[];for(const y in l)p.push(...f({key:`${i}.${y}`,value:l[y]}));return p}}};function tr(f){const i=f.value,l=f.key,p=f.styleSpec,y=f.style;if(!i.type)return[new s.V(l,i,'"type" is required')];const v=s.M(i.type);let w=[];switch(["vector","raster","raster-dem","raster-array"].includes(v)&&(i.url||i.tiles||w.push(new s.J(l,i,'Either "url" or "tiles" is required.'))),v){case"vector":case"raster":case"raster-dem":case"raster-array":return w=w.concat(Ft({key:l,value:i,valueSpec:p[`source_${v.replace("-","_")}`],style:f.style,styleSpec:p,objectElementValidators:Qs})),w;case"geojson":if(w=Ft({key:l,value:i,valueSpec:p.source_geojson,style:y,styleSpec:p,objectElementValidators:Qs}),i.cluster)for(const S in i.clusterProperties){const[C,D]=i.clusterProperties[S],L=typeof C=="string"?[C,["accumulated"],["get",S]]:C;w.push(...di({key:`${l}.${S}.map`,value:D,expressionContext:"cluster-map"})),w.push(...di({key:`${l}.${S}.reduce`,value:L,expressionContext:"cluster-reduce"}))}return w;case"video":return Ft({key:l,value:i,valueSpec:p.source_video,style:y,styleSpec:p});case"image":return Ft({key:l,value:i,valueSpec:p.source_image,style:y,styleSpec:p});case"canvas":return[new s.V(l,null,"Please use runtime APIs to add canvas sources, rather than
602including them in stylesheets.","source.canvas")];default:return on({key:`${l}.type`,value:i.type,valueSpec:{values:Pr(p)},style:y,styleSpec:p})}}function Pr(f){return f.source.reduce((i,l)=>{const p=f[l];return p.type.type==="enum"&&(i=i.concat(Object.keys(p.type.values))),i},[])}function Mo(f){const i=f.value,l=f.styleSpec,p=l.light,y=f.style;let v=[];const w=s.K(i);if(i===void 0)return v;if(w!=="object")return v=v.concat([new s.V("light",i,`object expected, ${w} found`)]),v;for(const S in i){const C=S.match(/^(.*)-transition$/),D=S.match(/^(.*)-use-theme$/);v=v.concat(D&&p[D[1]]?Ss({key:S,value:i[S],valueSpec:{type:"string"},style:y,styleSpec:l}):C&&p[C[1]]&&p[C[1]].transition?Ss({key:S,value:i[S],valueSpec:l.transition,style:y,styleSpec:l}):p[S]?Ss({key:S,value:i[S],valueSpec:p[S],style:y,styleSpec:l}):[new s.V(S,i[S],`unknown property "${S}"`)])}return v}function Bo(f){const i=f.value;let l=[];if(!i)return l;const p=s.K(i);if(p!=="object")return l=l.concat([new s.V("light-3d",i,`object expected, ${p} found`)]),l;const y=f.styleSpec,v=y["light-3d"],w=f.key,S=f.style,C=f.style.lights;for(const F of["type","id"])if(!(F in i))return l=l.concat([new s.V("light-3d",i,`missing property ${F} on light`)]),l;if(i.type&&C)for(let F=0;F<f.arrayIndex;F++){const O=s.M(i.type),$=C[F];s.M($.type)===O&&l.push(new s.V(w,i.id,`duplicate light type "${i.type}", previously defined at line ${$.id.__line__}`))}const D=`properties_light_${i.type}`;if(!(D in y))return l=l.concat([new s.V("light-3d",i,`Invalid light type ${i.type}`)]),l;const L=y[D];for(const F in i)if(F==="properties"){const O=i[F],$=s.K(O);if($!=="object")return l=l.concat([new s.V("properties",O,`object expected, ${$} found`)]),l;for(const q in O)l=l.concat(L[q]?Ss({key:q,value:O[q],valueSpec:L[q],style:S,styleSpec:y}):[new s.J(f.key,O[q],`unknown property "${q}"`)])}else{const O=F.match(/^(.*)-transition$/),$=F.match(/^(.*)-use-theme$/);l=l.concat($&&v[$[1]]?Ss({key:F,value:i[F],valueSpec:{type:"string"},style:S,styleSpec:y}):O&&v[O[1]]&&v[O[1]].transition?Ss({key:F,value:i[F],valueSpec:y.transition,style:S,styleSpec:y}):v[F]?Ss({key:F,value:i[F],valueSpec:v[F],style:S,styleSpec:y}):[new s.J(F,i[F],`unknown property "${F}"`)])}return l}function wr(f){const i=f.value,l=f.key,p=f.style,y=f.styleSpec,v=y.terrain;let w=[];const S=s.K(i);if(i===void 0||S==="null")return w;if(S!=="object")return w=w.concat([new s.V("terrain",i,`object expected, ${S} found`)]),w;for(const C in i){const D=C.match(/^(.*)-transition$/),L=C.match(/^(.*)-use-theme$/);w=w.concat(L&&v[L[1]]?Ss({key:C,value:i[C],valueSpec:{type:"string"},style:p,styleSpec:y}):D&&v[D[1]]&&v[D[1]].transition?Ss({key:C,value:i[C],valueSpec:y.transition,style:p,styleSpec:y}):v[C]?Ss({key:C,value:i[C],valueSpec:v[C],style:p,styleSpec:y}):[new s.J(C,i[C],`unknown property "${C}"`)])}if(i.source){const C=p.sources&&p.sources[i.source],D=C&&s.M(C.type);C?D!=="raster-dem"&&w.push(new s.V(l,i.source,`terrain cannot be used with a source of type ${String(D)}, it only be used with a "raster-dem" source type`)):w.push(new s.V(l,i.source,`source "${i.source}" not found`))}else w.push(new s.V(l,i,'terrain is missing required property "source"'));return w}function Hr(f){const i=f.value,l=f.style,p=f.styleSpec,y=p.fog;let v=[];const w=s.K(i);if(i===void 0)return v;if(w!=="object")return v=v.concat([new s.V("fog",i,`object expected, ${w} found`)]),v;for(const S in i){const C=S.match(/^(.*)-transition$/),D=S.match(/^(.*)-use-theme$/);v=v.concat(D&&y[D[1]]?Ss({key:S,value:i[S],valueSpec:{type:"string"},style:l,styleSpec:p}):C&&y[C[1]]&&y[C[1]].transition?Ss({key:S,value:i[S],valueSpec:p.transition,style:l,styleSpec:p}):y[S]?Ss({key:S,value:i[S],valueSpec:y[S],style:l,styleSpec:p}):[new s.J(S,i[S],`unknown property "${S}"`)])}return v}const El={"*":()=>[],array:Wt,boolean:function(f){const i=f.value,l=f.key,p=s.K(i);return p!=="boolean"?[new s.V(l,i,`boolean expected, ${p} found`)]:[]},number:Ti,color:function(f){const i=f.key,l=f.value,p=s.K(l);return p!=="string"?[new s.V(i,l,`color expected, ${p} found`)]:s.a0.parseCSSColor(l)===null?[new s.V(i,l,`color expected, "${l}" found`)]:[]},enum:on,filter:Ci,function:pi,layer:$n,object:Ft,source:tr,model:s.a4,light:Mo,"light-3d":Bo,terrain:wr,fog:Hr,string:Us,formatted:function(f){return Us(f).length===0?[]:di(f)},resolvedImage:function(f){return Us(f).length===0?[]:di(f)},projection:function(f){const i=f.value,l=f.styleSpec,p=l.projection,y=f.style;let v=[];const w=s.K(i);if(w==="object")for(const S in i)v=v.concat(Ss({key:S,value:i[S],valueSpec:p[S],style:y,styleSpec:l}));else w!=="string"&&(v=v.concat([new s.V("projection",i,`object or string expected, ${w} found`)]));return v},import:function(f){const{value:i,styleSpec:l}=f,{data:p,...y}=i;Object.defineProperty(y,"__line__",{value:i.__line__,enumerable:!1});let v=Ft(s.L({},f,{value:y,valueSpec:l.import}));return s.M(y.id)===""&&v.push(new s.V(`${f.key}.id`,y,"import id can't be an empty string")),p&&(v=v.concat(qa(p,l,{key:`${f.key}.data`}))),v},iconset:function(f){const i=f.value,l=f.key,p=f.styleSpec,y=f.style;if(!i.type)return[new s.V(l,i,'"type" is required')];const v=s.M(i.type);let w=[];if(w=w.concat(Ft({key:l,value:i,valueSpec:p[`iconset_${v}`],style:y,styleSpec:p})),v==="source"&&i.source){const S=y.sources&&y.sources[i.source],C=S&&s.M(S.type);S?C!=="raster-array"&&w.push(new s.V(l,i.source,`iconset cannot be used with a source of type ${String(C)}, it only be used with a "raster-array" source type`)):w.push(new s.V(l,i.source,`source "${i.source}" not found`))}return w}};function Ss(f,i=!1){const l=f.value,p=f.valueSpec,y=f.styleSpec;if(p.expression&&s.a2(s.M(l)))return pi(f);if(p.expression&&s.S(s.U(l)))return di(f);if(p.type&&El[p.type]){const v=El[p.type](f);return i===!0&&v.length>0&&s.K(f.value)==="array"?di(f):v}return Ft(s.L({},f,{valueSpec:p.type?y[p.type]:p}))}function ga(f){const i=f.value,l=f.key,p=Us(f);return p.length||(i.indexOf("{fontstack}")===-1&&p.push(new s.V(l,i,'"glyphs" url must include a "{fontstack}" token')),i.indexOf("{range}")===-1&&p.push(new s.V(l,i,'"glyphs" url must include a "{range}" token'))),p}function qa(f,i=s.a5,l={}){return Ss({key:l.key||"",value:f,valueSpec:i.$root,styleSpec:i,style:f,objectElementValidators:{glyphs:ga,"*":()=>[]}})}function No(f,i=s.a5){return De(qa(f,i))}const Vc=f=>De(tr(f)),zh=f=>De(Mo(f)),Cu=f=>De(Bo(f)),kt=f=>De(wr(f)),Za=f=>De(Hr(f)),Xa=f=>De(function(i){const l=i.value,p=i.style,y=i.styleSpec,v=y.snow;let w=[];const S=s.K(l);if(l===void 0)return w;if(S!=="object")return w=w.concat([new s.V("snow",l,`object expected, ${S} found`)]),w;for(const C in l){const D=C.match(/^(.*)-transition$/);w=w.concat(D&&v[D[1]]&&v[D[1]].transition?Ss({key:C,value:l[C],valueSpec:y.transition,style:p,styleSpec:y}):v[C]?Ss({key:C,value:l[C],valueSpec:v[C],style:p,styleSpec:y}):[new s.J(C,l[C],`unknown property "${C}"`)])}return w}(f)),Qe=f=>De(function(i){const l=i.value,p=i.style,y=i.styleSpec,v=y.rain;let w=[];const S=s.K(l);if(l===void 0)return w;if(S!=="object")return w=w.concat([new s.V("rain",l,`object expected, ${S} found`)]),w;for(const C in l){const D=C.match(/^(.*)-transition$/);w=w.concat(D&&v[D[1]]&&v[D[1]].transition?Ss({key:C,value:l[C],valueSpec:y.transition,style:p,styleSpec:y}):v[C]?Ss({key:C,value:l[C],valueSpec:v[C],style:p,styleSpec:y}):[new s.J(C,l[C],`unknown property "${C}"`)])}return w}(f)),X=f=>De($n(f)),ie=f=>De(Ci(f)),ge=f=>De(Vn(f)),Ie=f=>De(Kn(f)),Ce=f=>De(s.a4(f));function De(f){return f.slice().sort((i,l)=>i.line&&l.line?i.line-l.line:0)}function ke(f,i){let l=!1;if(i&&i.length)for(const p of i)p instanceof s.J?s.w(p.message):(f.fire(new s.z(new Error(p.message))),l=!0);return l}let Le;class Ze extends s.E{constructor(i,l="flat"){super(),this._transitionable=new s.a6(Le||(Le=new s.a7({anchor:new s.a8(s.a5.light.anchor),position:new s.a9(s.a5.light.position),color:new s.a8(s.a5.light.color),intensity:new s.a8(s.a5.light.intensity)}))),this.setLight(i,l),this._transitioning=this._transitionable.untransitioned()}getLight(){return this._transitionable.serialize()}setLight(i,l,p={}
602){this._validate(zh,i,p)||(this._transitionable.setTransitionOrValue(i),this.id=l)}updateTransitions(i){this._transitioning=this._transitionable.transitioned(i,this._transitioning)}hasTransition(){return this._transitioning.hasTransition()}recalculate(i){this.properties=this._transitioning.possiblyEvaluate(i)}_validate(i,l,p){return(!p||p.validate!==!1)&&ke(this,i.call(No,s.l({value:l,style:{glyphs:!0,sprite:!0},styleSpec:s.a5})))}}let rt=class extends s.E{constructor(f,i,l,p){super(),this.scope=l,this._transitionable=new s.a6(new s.a7({source:new s.a8(s.a5.terrain.source),exaggeration:new s.a8(s.a5.terrain.exaggeration)}),l,p),this._transitionable.setTransitionOrValue(f,p),this._transitioning=this._transitionable.untransitioned(),this.drapeRenderMode=i}get(){return this._transitionable.serialize()}set(f,i){this._transitionable.setTransitionOrValue(f,i)}updateTransitions(f){this._transitioning=this._transitionable.transitioned(f,this._transitioning)}hasTransition(){return this._transitioning.hasTransition()}recalculate(f){this.properties=this._transitioning.possiblyEvaluate(f)}getExaggeration(f){return this._transitioning.possiblyEvaluate(new s.aa(f)).get("exaggeration")}getAttenuationRange(){if(!this.isZoomDependent())return null;const f=this._transitionable._values.exaggeration;if(!f)return null;const i=f.value.expression;if(!i)return null;let l=-1,p=-1,y=1;for(const v of i.zoomStops)y=i.evaluate(new s.aa(v)),y>.01?(l=v,p=-1):p=v;return y<.01&&l>0&&p>l?[l,p]:null}isZoomDependent(){const f=this._transitionable._values.exaggeration;return f!=null&&f.value!=null&&f.value.expression!=null&&f.value.expression instanceof s.ab}};const He=45,Lt=65,Ht=.05;function qt(f,i,l,p){const y=s.af(He,Lt,l),[v,w]=xi(f,p);let S=1-Math.min(1,Math.exp((i-v)/(w-v)*-6));return S*=S*S,S=Math.min(1,1.00747*S),S*y*f.alpha}function xi(f,i){const l=.5/Math.tan(.5*i);return[f.range[0]+l,f.range[1]+l]}function Pi(f,i,l,p,y){const v=s.ad([],[i,l,p],y.mercatorFogMatrix);return qt(f,s.ae(v),y.pitch,y._fov)}function Ri(f,i,l,p,y,v,w){const S=[[l,p,0],[y,p,0],[y,v,0],[l,v,0]];let C=Number.MAX_VALUE,D=-Number.MAX_VALUE;for(const L of S){const F=s.ad([],L,i),O=s.ae(F);C=Math.min(C,O),D=Math.max(D,O)}return[qt(f,C,w.pitch,w._fov),qt(f,D,w.pitch,w._fov)]}class Qi extends s.E{constructor(i,l,p,y){super();const v=new s.a7({range:new s.a8(s.a5.fog.range),color:new s.a8(s.a5.fog.color),"color-use-theme":new s.a8({type:"string","property-type":"data-constant",default:"default"}),"high-color":new s.a8(s.a5.fog["high-color"]),"high-color-use-theme":new s.a8({type:"string","property-type":"data-constant",default:"default"}),"space-color":new s.a8(s.a5.fog["space-color"]),"space-color-use-theme":new s.a8({type:"string","property-type":"data-constant",default:"default"}),"horizon-blend":new s.a8(s.a5.fog["horizon-blend"]),"star-intensity":new s.a8(s.a5.fog["star-intensity"]),"vertical-range":new s.a8(s.a5.fog["vertical-range"])});this._transitionable=new s.a6(v,p,new Map(y)),this.set(i,y),this._transitioning=this._transitionable.untransitioned(),this._transform=l,this.properties=new s.ag(v),this.scope=p}get state(){const i=this._transform,l=i.projection.name==="globe",p=s.ah(i.zoom),y=this.properties.get("range"),v=[.5,3];return{range:l?[s.ai(v[0],y[0],p),s.ai(v[1],y[1],p)]:y,horizonBlend:this.properties.get("horizon-blend"),alpha:this.properties.get("color").a}}get(){return this._transitionable.serialize()}set(i,l,p={}){if(this._validate(Za,i,p))return;const y=s.l({},i);for(const v of Object.keys(s.a5.fog))y[v]===void 0&&(y[v]=s.a5.fog[v].default);this._options=y,this._transitionable.setTransitionOrValue(this._options,l)}getOpacity(i){if(!this._transform.projection.supportsFog)return 0;const l=this.properties&&this.properties.get("color")||1;return(this._transform.projection.name==="globe"?1:s.af(He,Lt,i))*l.a}getOpacityAtLatLng(i,l){return this._transform.projection.supportsFog?function(p,y,v){const w=s.ac.fromLngLat(y),S=v.elevation?v.elevation.getAtPointOrZero(w):0;return Pi(p,w.x,w.y,S,v)}(this.state,i,l):0}getOpacityForTile(i){if(!this._transform.projection.supportsFog)return[1,1];const l=this._transform.calculateFogTileMatrix(i.toUnwrapped());return Ri(this.state,l,0,0,s.aj,s.aj,this._transform)}getOpacityForBounds(i,l,p,y,v){return this._transform.projection.supportsFog?Ri(this.state,i,l,p,y,v,this._transform):[1,1]}getFovAdjustedRange(i){return this._transform.projection.supportsFog?xi(this.state,i):[0,1]}isVisibleOnFrustum(i){if(!this._transform.projection.supportsFog)return!1;const l=[4,5,6,7];for(const p of l){const y=i.points[p];let v;if(y[2]>=0)v=y;else{const w=i.points[p-4];v=s.ak(w,y,w[2]/(w[2]-y[2]))}if(Pi(this.state,v[0],v[1],0,this._transform)>=Ht)return!0}return!1}updateConfig(i){this._transitionable.setTransitionOrValue(this._options,new Map(i))}updateTransitions(i){this._transitioning=this._transitionable.transitioned(i,this._transitioning)}hasTransition(){return this._transitioning.hasTransition()}recalculate(i){this.properties=this._transitioning.possiblyEvaluate(i)}_validate(i,l,p){return(!p||p.validate!==!1)&&ke(this,i.call(No,s.l({value:l,style:{glyphs:!0,sprite:!0},styleSpec:s.a5}
602)))}}let hs,Yi,jn,Tn,Jn=class extends s.E{constructor(f,i,l,p){super();const y=hs||(hs=new s.a7({density:new s.a8(s.a5.snow.density),intensity:new s.a8(s.a5.snow.intensity),color:new s.a8(s.a5.snow.color),opacity:new s.a8(s.a5.snow.opacity),vignette:new s.a8(s.a5.snow.vignette),"vignette-color":new s.a8(s.a5.snow["vignette-color"]),"center-thinning":new s.a8(s.a5.snow["center-thinning"]),direction:new s.a8(s.a5.snow.direction),"flake-size":new s.a8(s.a5.snow["flake-size"])}));this._transitionable=new s.a6(y,l,new Map(p)),this.set(f,p),this._transitioning=this._transitionable.untransitioned(),this.properties=new s.ag(y),this.scope=l}get state(){const f=this.properties.get("opacity"),i=this.properties.get("color"),l=this.properties.get("direction"),p=s.al(l[0]),y=-Math.max(s.al(l[1]),.01),v=[Math.cos(p)*Math.cos(y),Math.sin(p)*Math.cos(y),Math.sin(y)],w=this.properties.get("vignette"),S=this.properties.get("vignette-color");return S.a=w,{density:this.properties.get("density"),intensity:this.properties.get("intensity"),color:new s.am(i.r,i.g,i.b,i.a*f),direction:v,centerThinning:this.properties.get("center-thinning"),flakeSize:this.properties.get("flake-size"),vignetteColor:S}}get(){return this._transitionable.serialize()}set(f,i,l={}){if(this._validate(Xa,f,l))return;const p=s.l({},f);for(const y of Object.keys(s.a5.snow))p[y]===void 0&&(p[y]=s.a5.snow[y].default);this._options=p,this._transitionable.setTransitionOrValue(this._options,i)}updateConfig(f){this._transitionable.setTransitionOrValue(this._options,new Map(f))}updateTransitions(f){this._transitioning=this._transitionable.transitioned(f,this._transitioning)}hasTransition(){return this._transitioning.hasTransition()}recalculate(f){this.properties=this._transitioning.possiblyEvaluate(f)}_validate(f,i,l){return(!l||l.validate!==!1)&&ke(this,f.call(No,s.l({value:i,style:{glyphs:!0,sprite:!0},styleSpec:s.a5})))}},Gn=class extends s.E{constructor(f,i,l,p){super();const y=Yi||(Yi=new s.a7({density:new s.a8(s.a5.rain.density),intensity:new s.a8(s.a5.rain.intensity),color:new s.a8(s.a5.rain.color),opacity:new s.a8(s.a5.rain.opacity),vignette:new s.a8(s.a5.rain.vignette),"vignette-color":new s.a8(s.a5.rain["vignette-color"]),"center-thinning":new s.a8(s.a5.rain["center-thinning"]),direction:new s.a8(s.a5.rain.direction),"droplet-size":new s.a8(s.a5.rain["droplet-size"]),"distortion-strength":new s.a8(s.a5.rain["distortion-strength"])}));this._transitionable=new s.a6(y,l,new Map(p)),this.set(f,p),this._transitioning=this._transitionable.untransitioned(),this.properties=new s.ag(y),this.scope=l}get state(){const f=this.properties.get("opacity"),i=this.properties.get("color"),l=this.properties.get("direction"),p=s.al(l[0]),y=-Math.max(s.al(l[1]),.01),v=[Math.cos(p)*Math.cos(y),Math.sin(p)*Math.cos(y),Math.sin(y)],w=this.properties.get("vignette-color");return w.a=this.properties.get("vignette"),{density:this.properties.get("density"),intensity:this.properties.get("intensity"),color:new s.am(i.r,i.g,i.b,i.a*f),direction:v,centerThinning:this.properties.get("center-thinning"),dropletSize:this.properties.get("droplet-size"),distortionStrength:this.properties.get("distortion-strength"),vignetteColor:w}}get(){return this._transitionable.serialize()}set(f,i,l={}){if(this._validate(Qe,f,l))return;const p=s.l({},f);for(const y of Object.keys(s.a5.rain))p[y]===void 0&&(p[y]=s.a5.rain[y].default);this._options=p,this._transitionable.setTransitionOrValue(this._options,i)}updateConfig(f){this._transitionable.setTransitionOrValue(this._options,new Map(f))}updateTransitions(f){this._transitioning=this._transitionable.transitioned(f,this._transitioning)}hasTransition(){return this._transitioning.hasTransition()}recalculate(f){this.properties=this._transitioning.possiblyEvaluate(f)}_validate(f,i,l){return(!l||l.validate!==!1)&&ke(this,f.call(No,s.l({value:i,style:{glyphs:!0,sprite:!0},styleSpec:s.a5})))}};class Hs extends s.E{constructor(i,l,p,y){super(),this.scope=p,this._options=i,this.properties=new s.ag(l),this._transitionable=new s.a6(l,p,new Map(y)),this._transitionable.setTransitionOrValue(i.properties),this._transitioning=this._transitionable.untransitioned()}updateConfig(i){this._transitionable.setTransitionOrValue(this._options.properties,new Map(i))}updateTransitions(i){this._transitioning=this._transitionable.transitioned(i,this._transitioning)}hasTransition(){return this._transitioning.hasTransition()}recalculate(i){this.properties=this._transitioning.possiblyEvaluate(i)}get(){return this._options.properties=this._transitionable.serialize(),this._options}set(i,l){this._options=i,this._transitionable.setTransitionOrValue(i.properties,l)}shadowsEnabled(){return!!this.properties&&this.properties.get("cast-shadows")===!0}}class ir{constructor(i,l,p,y){this.screenBounds=i,this.cameraPoint=l,this._screenRaycastCache={},this._cameraRaycastCache={},this.isAboveHorizon=p,this.screenGeometry=this.bufferedScreenGeometry(0),this.screenGeometryMercator=this._bufferedScreenMercator(0,y)}static createFromScreenPoints(i,l){let p,y;if(i instanceof s.P||typeof i[0]=="number"){const v=s.P.convert(i);p=[v],y=l.isPointAboveHorizon(v)}else{const v=s.P.convert(i[0]),w=s.P.convert(i[1]),S=v.add(w)._div(2);p=[v,w],y=s.ao(v,w).every(C=>l.isPointAboveHorizon(C))&&l.isPointAboveHorizon(S)}return new ir(p,l.getCameraPoint(),y,l)}isPointQuery(){return this.screenBounds.length===1}bufferedScreenGeometry(i){return s.ao(this.screenBounds[0],this.screenBounds.length===1?this.screenBounds[0]:this.screenBounds[1],i)}bufferedCameraGeometry(i){const l=this.screenBounds[0],p=this.screenBounds.length===1?this.screenBounds[0].add(new s.P(1,1)):this.screenBounds[1],y=s.ao(l,p,0,!1);return this.cameraPoint.y>p.y&&(this.cameraPoint.x>l.x&&this.cameraPoint.x<p.x?y.splice(3,0,this.cameraPoint):this.cameraPoint.x>=p.x?y[2]=this.cameraPoint:this.cameraPoint.x<=l.x&&(y[3]=this.cameraPoint)),s.ap(y,i)}bufferedCameraGeometryGlobe(i){const l=this.screenBounds[0],p=this.screenBounds.length===1?this.screenBounds[0].add(new s.P(1,1)):this.screenBounds[1],y=s.ao(l,p,i),v=this.cameraPoint.clone();switch(3*((v.y>l.y)+(v.y>p.y))+((v.x>l.x)+(v.x>p.x))){case 0:y[0]=v,y[4]=v.clone();break;case 1:y.splice(1,0,v);break;case 2:y[1]=v;break;case 3:y.splice(4,0,v);break;case 5:y.splice(2,0,v);break;case 6:y[3]=v;break;case 7:y.splice(3,0,v);break;case 8:y[2]=v}return y}containsTile(i,l,p,y=0){const v=i.queryPadding/l._pixelsPerMercatorPixel+1,w=p?this._bufferedCameraMercator(v,l):this._bufferedScreenMercator(v,l);let S=i.tileID.wrap+(w.unwrapped?y:0);const C=w.polygon.map(K=>s.aq(i.tileTransform,K,S));if(!s.ar(C,0,0,s.aj,s.aj))return;S=i.tileID.wrap+(this.screenGeometryMercator.unwrapped?y:0);const D=this.screenGeometryMercator.polygon.map(K=>s.as(i.tileTransform,K,S)),L=D.map(K=>new s.P(K[0],K[1])),F=l.getFreeCameraOptions().position||new s.ac(0,0,0),O=s.as(i.tileTransform,F,S),$=D.map(K=>{const Z=s.at(K,K,O);return s.au(Z,Z),new s.av(O,Z)}),q=s.aw(i,1,l.zoom)*l._pixelsPerMercatorPixel;return{queryGeometry:this,tilespaceGeometry:L,tilespaceRays:$,bufferedTilespaceGeometry:C,bufferedTilespaceBounds:(W=s.ax(C),W.min.x=s.aD(W.min.x,0,s.aj),W.min.y=s.aD(W.min.y,0,s.aj),W.max.x=s.aD(W.max.x,0,s.aj),W.max.y=s.aD(W.max.y,0,s.aj),W),tile:i,tileID:i.tileID,pixelToTileUnitsFactor:q};var W}_bufferedScreenMercator(i,l){const p=Ia(i);if(this._screenRaycastCache[p])return this._screenRaycastCache[p];{let y;return y=l.projection.name==="globe"?this._projectAndResample(this.bufferedScreenGeometry(i),l):{polygon:this.bufferedScreenGeometry(i).map(v=>l.pointCoordinate3D(v)),unwrapped:!0},this._screenRaycastCache[p]=y,y}}_bufferedCameraMercator(i,l){const p=Ia(i);if(this._cameraRaycastCache[p])return this._cameraRaycastCache[p];{let y;return y=l.projection.name==="globe"?this._projectAndResample(this.bufferedCameraGeometryGlobe(i),l):{polygon:this.bufferedCameraGeometry(i).map(v=>l.pointCoordinate3D(v)),unwrapped:!0},this._cameraRaycastCache[p]=y,y}}_projectAndResample(i,l){const p=function(v,w){const S=s.az([],w.pixelMatrix,w.globeMatrix),C=[0,-s.aE,0,1],D=[0,s.aE,0,1],L=[0,0,0,1];s.aA(C,C,S),s.aA(D,D,S),s.aA(L,L,S);const F=new s.P(C[0]/C[3],C[1]/C[3]),O=new s.P(D[0]/D[3],D[1]/D[3]),$=s.aB(v,F)&&C[3]<L[3],q=s.aB(v,O)&&D[3]<L[3];if(!$&&!q)return null;const W=function(ye,pe,Se){for(let Ae=1;Ae<ye.length;Ae++){const Ge=Dr(pe.pointCoordinate3D(ye[Ae-1]).x),Ne=Dr(pe.pointCoordinate3D(ye[Ae]).x);if(Se<0){if(Ge<Ne)return{idx:Ae,t:-Ge/(Ne-1-Ge)}}else if(Ne<Ge)return{idx:Ae,t:(1-Ge)/(Ne+1-Ge)}}return null}(v,w,$?-1:1);if(!W)return null;const{idx:K,t:Z}=W;let se=K>1?hr(v.slice(0,K),w):[],ue=K<v.length?hr(v.slice(K),w):[];se=se.map(ye=>new s.P(Dr(ye.x),ye.y)),ue=ue.map(ye=>new s.P(Dr(ye.x),ye.y));const fe=[...se];fe.length===0&&fe.push(ue[ue.length-1]);const xe=s.ai(fe[fe.length-1].y,(ue.length===0?se[0]:ue[0]).y,Z);let _e;return _e=$?[new s.P(0,xe),new s.P(0,0),new s.P(1,0),new s.P(1,xe)]:[new s.P(1,xe),new s.P(1,1),new s.P(0,1),new s.P(0,xe)],fe.push(..._e),ue.length===0?fe.push(se[0]):fe.push(...ue),{polygon:fe.map(ye=>new s.ac(ye.x,ye.y)),unwrapped:!1}}(i,l);if(p)return p;const y=function(v,w){let S=!1,C=-1/0,D=0;for(let F=0;F<v.length-1;F++)v[F].x>
602C&&(C=v[F].x,D=F);for(let F=0;F<v.length-1;F++){const O=(D+F)%(v.length-1),$=v[O],q=v[O+1];Math.abs($.x-q.x)>.5&&($.x<q.x?($.x+=1,O===0&&(v[v.length-1].x+=1)):(q.x+=1,O+1===v.length-1&&(v[0].x+=1)),S=!0)}const L=s.ay(w.center.lng);return S&&L<Math.abs(L-1)&&v.forEach(F=>{F.x-=1}),{polygon:v,unwrapped:S}}(hr(i,l).map(v=>new s.P(Dr(v.x),v.y)),l);return{polygon:y.polygon.map(v=>new s.ac(v.x,v.y)),unwrapped:y.unwrapped}}}function hr(f,i){return s.aC(f,l=>{const p=i.pointCoordinate3D(l);l.x=p.x,l.y=p.y},1/256)}function Dr(f){return f<0?1+f%1:f%1}function Ia(f){return 100*f|0}function Gr(f,i,l,p,y){const v=function(S,C){if(S)return y(S);if(C){if(f.url&&C.tiles&&f.tiles&&delete f.tiles,C.variants){if(!Array.isArray(C.variants))return y(new Error("variants must be an array"));for(const L of C.variants){if(L==null||typeof L!="object"||L.constructor!==Object)return y(new Error("variant must be an object"));if(!Array.isArray(L.capabilities))return y(new Error("capabilities must be an array"));if(L.capabilities.length===1&&L.capabilities[0]==="meshopt"){C=s.l(C,L);break}}}const D=s.aF(s.l({},C,f),["tilejson","tiles","minzoom","maxzoom","attribution","mapbox_logo","bounds","extra_bounds","scheme","tileSize","encoding","vector_layers","raster_layers","worldview_options","worldview_default","worldview"]);D.tiles=i.canonicalizeTileset(D,f.url),y(null,D)}},w=function(S,C,D){if(!S)return null;if(!C&&!D)return S;D=D||S.worldview_default;const L=Object.values(S.language||{});if(L.length===0)return null;const F=Object.values(S.worldview||{});if(F.length===0)return null;const O=L.every(q=>q===C),$=F.every(q=>q===D);return O&&$?S:C in(S.language_options||{})||D in(S.worldview_options||{})?null:S.language_options&&S.worldview_options?S:null}(f.data,l,p);return w?s.q.frame(()=>v(null,w)):f.url?s.n(i.transformRequest(i.normalizeSourceURL(f.url,null,l,p),s.R.Source),v):s.q.frame(()=>{const{data:S,...C}=f;v(null,C)})}function Wr(f,i){const l=Math.pow(2,i.z),p=Math.floor(s.ay(f.getWest())*l),y=Math.floor(s.aH(f.getNorth())*l),v=Math.ceil(s.ay(f.getEast())*l),w=Math.ceil(s.aH(f.getSouth())*l);return i.x>=p&&i.x<v&&i.y>=y&&i.y<w}class Tr{constructor(i,l,p){this.bounds=i?s.aG.convert(this.validateBounds(i)):null,this.minzoom=l||0,this.maxzoom=p||24}validateBounds(i){return Array.isArray(i)&&i.length===4?[Math.max(-180,i[0]),Math.max(-90,i[1]),Math.min(180,i[2]),Math.min(90,i[3])]:[-180,-90,180,90]}addExtraBounds(i){if(i){this.extraBounds||(this.extraBounds=[]);for(const l of i)this.extraBounds.push(s.aG.convert(this.validateBounds(l)))}}contains(i){if(i.z>this.maxzoom||i.z<this.minzoom||this.bounds&&!Wr(this.bounds,i))return!1;if(!this.extraBounds)return!0;for(const l of this.extraBounds)if(Wr(l,i))return!0;return!1}static fromTileJSON(i){if(!i.bounds&&!i.extra_bounds)return null;const l=new Tr(i.bounds,i.minzoom,i.maxzoom);return l.addExtraBounds(i.extra_bounds),l}}class Fr extends s.E{constructor(i,l,p,y){if(super(),this.id=i,this.dispatcher=p,this.type="vector",this.minzoom=0,this.maxzoom=22,this.scheme="xyz",this.tileSize=512,this.reparseOverscaled=!0,this.isTileClipped=!0,this._loaded=!1,s.l(this,s.aF(l,["url","scheme","tileSize","promoteId"])),this._options=s.l({type:"vector"},l),this._collectResourceTiming=!!l.collectResourceTiming,this.tileSize!==512)throw new Error("vector tile sources must have a tileSize of 512");this.setEventedParent(y),this._tileWorkers={},this._deduped=new s.aI}load(i){this._loaded=!1,this.fire(new s.A("dataloading",{dataType:"source"}));const l=Array.isArray(this.map._language)?this.map._language.join():this.map._language,p=this.map.getWorldview();this._tileJSONRequest=Gr(this._options,this.map._requestManager,l,p,(y,v)=>{if(this._tileJSONRequest=null,this._loaded=!0,y)l&&console.warn(`Ensure that your requested language string is a valid BCP-47 code or list of codes. Found: ${l}`),p&&console.warn(`Requested worldview strings must be a valid ISO alpha-2 code. Found: ${p}`),this.fire(new s.z(y));else if(v){if(s.l(this,v),this.hasWorldviews=!!v.worldview_options,v.worldview_default&&(this.worldviewDefault=v.worldview_default),v.vector_layers){this.vectorLayers=v.vector_layers,this.vectorLayerIds=[],this.localizableLayerIds=new Set;for(const w of v.vector_layers)this.vectorLayerIds.push(w.id),v.worldview&&v.worldview[w.source]&&this.localizableLayerIds.add(w.id)}this.tileBounds=Tr.fromTileJSON(v),Ki(v.tiles,this.map._requestManager._customAccessToken),this.fire(new s.A("data",{dataType:"source",sourceDataType:"metadata"})),this.fire(new s.A("data",{dataType:"source",sourceDataType:"content"}))}i&&i(y)})}loaded(){return this._loaded}
602hasTile(i){return!this.tileBounds||this.tileBounds.contains(i.canonical)}onAdd(i){this.map=i,this.load()}reload(){this.cancelTileJSONRequest();const i=s.C(this.id,this.scope);this.load(()=>this.map.style.clearSource(i))}setTiles(i){return this._options.tiles=i,this.reload(),this}setUrl(i){return this.url=i,this._options.url=i,this.reload(),this}onRemove(i){this.cancelTileJSONRequest()}serialize(){return s.l({},this._options)}loadTile(i,l){const p=i.tileID.canonical.url(this.tiles,this.scheme),y=this.map._requestManager.normalizeTileURL(p),v=this.map._requestManager.transformRequest(y,s.R.Tile),w=this.map.style?this.map.style.getLut(this.scope):null,S=w?{image:w.image.clone()}:null,C={request:v,data:void 0,uid:i.uid,tileID:i.tileID,tileZoom:i.tileZoom,zoom:i.tileID.overscaledZ,maxZoom:this.maxzoom,lut:S,tileSize:this.tileSize*i.tileID.overscaleFactor(),type:this.type,source:this.id,scope:this.scope,pixelRatio:s.q.devicePixelRatio,showCollisionBoxes:this.map.showCollisionBoxes,promoteId:this.promoteId,isSymbolTile:i.isSymbolTile,brightness:this.map.style&&this.map.style.getBrightness()||0,extraShadowCaster:i.isExtraShadowCaster,tessellationStep:this.map._tessellationStep,scaleFactor:this.map.getScaleFactor()};if(this.hasWorldviews&&s.f(p)&&(C.worldview=this.map.getWorldview()||this.worldviewDefault,C.localizableLayerIds=this.localizableLayerIds),C.request.collectResourceTiming=this._collectResourceTiming,i.actor&&i.state!=="expired")i.state==="loading"?i.reloadCallback=l:i.request=i.actor.send("reloadTile",C,D.bind(this));else if(i.actor=this._tileWorkers[y]=this._tileWorkers[y]||this.dispatcher.getActor(),this.dispatcher.ready)i.request=i.actor.send("loadTile",C,D.bind(this),void 0,!0);else{const L=s.aJ.call({deduped:this._deduped},C,(F,O)=>{F||!O?D.call(this,F):(C.data={cacheControl:O.cacheControl,expires:O.expires,rawData:O.rawData.slice(0)},i.actor&&i.actor.send("loadTile",C,D.bind(this),void 0,!0))},!0);i.request={cancel:L}}function D(L,F){return delete i.request,i.aborted?l(null):L&&L.status!==404?l(L):(F&&F.resourceTiming&&(i.resourceTiming=F.resourceTiming),this.map._refreshExpiredTiles&&F&&i.setExpiryData(F),i.loadVectorData(F,this.map.painter),s.aK(this.dispatcher),l(null),void(i.reloadCallback&&(this.loadTile(i,i.reloadCallback),i.reloadCallback=null)))}}abortTile(i){i.request&&(i.request.cancel(),delete i.request),i.actor&&i.actor.send("abortTile",{uid:i.uid,type:this.t
602ype,source:this.id,scope:this.scope})}unloadTile(i,l){i.actor&&i.actor.send("removeTile",{uid:i.uid,type:this.type,source:this.id,scope:this.scope}),i.destroy()}hasTransition(){return!1}afterUpdate(){this._tileWorkers={}}cancelTileJSONRequest(){this._tileJSONRequest&&(this._tileJSONRequest.cancel(),this._tileJSONRequest=null)}}class _a extends s.E{constructor(i,l,p,y){super(),this.id=i,this.dispatcher=p,this.setEventedParent(y),this.type="raster",this.minzoom=0,this.maxzoom=22,this.roundZoom=!0,this.scheme="xyz",this.tileSize=512,this._loaded=!1,this._options=s.l({type:"raster"},l),s.l(this,s.aF(l,["url","scheme","tileSize"]))}load(i){this._loaded=!1,this.fire(new s.A("dataloading",{dataType:"source"})),this._tileJSONRequest=Gr(this._options,this.map._requestManager,null,null,(l,p)=>{this._tileJSONRequest=null,this._loaded=!0,l?this.fire(new s.z(l)):p&&(s.l(this,p),p.raster_layers&&(this.rasterLayers=p.raster_layers,this.rasterLayerIds=this.rasterLayers.map(y=>y.id)),this.tileBounds=Tr.fromTileJSON(p),Ki(p.tiles),this.fire(new s.A("data",{dataType:"source",sourceDataType:"metadata"})),this.fire(new s.A("data",{dataType:"source",sourceDataType:"content"}))),i&&i(l)})}loaded(){return this._loaded}onAdd(i){this.map=i,this.load()}reload(){this.cancelTileJSONRequest();const i=s.C(this.id,this.scope);this.load(()=>this.map.style.clearSource(i))}setTiles(i){return this._options.tiles=i,this.reload(),this}setUrl(i){return this.url=i,this._options.url=i,this.reload(),this}onRemove(i){this.cancelTileJSONRequest()}serialize(){return s.l({},this._options)}hasTile(i){return!this.tileBounds||this.tileBounds.contains(i.canonical)}loadTile(i,l){const p=s.q.devicePixelRatio>=2,y=this.map._requestManager.normalizeTileURL(i.tileID.canonical.url(this.tiles,this.scheme),p,this.tileSize);i.request=s.o(this.map._requestManager.transformRequest(y,s.R.Tile),(v,w,S,C)=>(delete i.request,i.aborted?(i.state="unloaded",l(null)):v?(i.state="errored",l(v)):w?(this.map._refreshExpiredTiles&&i.setExpiryData({cacheControl:S,expires:C}),i.setTexture(w,this.map.painter),i.state="loaded",s.aK(this.dispatcher),void l(null)):l(null)))}abortTile(i,l){i.request&&(i.request.cancel(),delete i.request),l&&l()}unloadTile(i,l){i.texture&&i.texture instanceof s.T?(i.destroy(!0),i.texture&&i.texture instanceof s.T&&this.map.painter.saveTileTexture(i.texture)):i.destroy(),l&&l()}hasTransition(){return!1}cancelTileJSONRequest(){this._tileJSONRequest&&(this._tileJSONRequest.cancel(),this._tileJSONRequest=null)}}class Al extends _a{constructor(i,l,p,y){super(i,l,p,y),this.type="raster-array",this.maxzoom=22,this.partial=!0,this._options=s.l({type:"raster-array"},l)}triggerRepaint(i){const l=this.map.painter._terrain,p=this.map.style.getSourceCache(this.id);l&&l.enabled&&p&&l._clearRenderCacheForTile(p.id,i.tileID),this.map.triggerRepaint()}loadTile(i,l){const p=this.map._requestManager.normalizeTileURL(i.tileID.canonical.url(this.tiles,this.scheme),!1,this.tileSize),y=this.map._requestManager.transformRequest(p,s.R.Tile),v={request:y,uid:i.uid,tileID:i.tileID,type:this.t
602ype,source:this.id,scope:this.scope,partial:this.partial};i.source=this.id,i.scope=this.scope,i.requestParams=y,i.actor||(i.actor=this.dispatcher.getActor());const w=(S,C,D,L)=>{if(delete i.request,i.aborted)return i.state="unloaded",l(null);if(S)return S.name==="AbortError"?void 0:(i.state="errored",l(S));if(this.map._refreshExpiredTiles&&C&&i.setExpiryData({cacheControl:D,expires:L}),this.partial)i.state="empty";else{if(!C)return l(null);i.state="loaded",i._isHeaderLoaded=!0,i._mrt=C}l(null)};i.request=this.partial?i.fetchHeader(void 0,w.bind(this)):i.actor.send("loadTile",v,w.bind(this),void 0,!0)}abortTile(i){i.request&&(i.request.cancel(),delete i.request),i.actor&&i.actor.send("abortTile",{uid:i.uid,type:this.type,source:this.id,scope:this.scope})}unloadTile(i,l){const p=i.texture;p&&p instanceof s.T?(i.destroy(!0),this.map.painter.saveTileTexture(p)):(i.destroy(),i.flushQueues(),i._isHeaderLoaded=!1,delete i._mrt,delete i.textureDescriptor),i.fbo&&(i.fbo.destroy(),delete i.fbo),delete i.request,delete i.requestParams,delete i.neighboringTiles,i.state="unloaded"}prepareTile(i,l,p){i._isHeaderLoaded&&(i.state!=="empty"&&(i.state="reloading"),i.fetchBand(l,p,(y,v)=>{if(y)return i.state="errored",this.fire(new s.z(y)),void this.triggerRepaint(i);v&&(i._isHeaderLoaded=!0,i.setTexture(v,this.map.painter),i.state="loaded",this.triggerRepaint(i))}))}getInitialBand(i){if(!this.rasterLayers)return 0;const l=this.rasterLayers.find(({id:v})=>v===i),p=l&&l.fields,y=p&&p.bands&&p.bands;return y?y[0]:0}getTextureDescriptor(i,l,p){if(!i)return;const y=l.sourceLayer||this.rasterLayerIds&&this.rasterLayerIds[0];if(!y)return;let v=null;l instanceof s.aN?v=l.paint.get("raster-array-band"):l instanceof s.aO&&(v=l.paint.get("raster-particle-array-band"));const w=v||this.getInitialBand(y);if(w!=null)if(i.textureDescriptor){if(!i.updateNeeded(y,w)||p)return Object.assign({},i.textureDescriptor,{texture:i.texture})}else this.prepareTile(i,y,w)}getImages(i,l){const p=new Map;for(const y of i)for(const v of l){const[w,S]=v.split("/"),C=y.getLayer(w);if(!C||!C.hasBand(S)||!C.hasDataForBand(S))continue;const{bytes:D,tileSize:L,buffer:F}=C.getBandView(S),O=L+2*F,$={data:new s.r({width:O,height:O},D),pixelRatio:2,sdf:!1,usvg:!1,version:0};p.set(v,$)}return p}}const $c={vector:Fr,raster:_a,"raster-dem":class extends _a{constructor(f,i,l,p){super(f,i,l,p),this.type="raster-dem",this.maxzoom=22,this._options=s.l({type:"raster-dem"},i),this.encoding=i.encoding||"mapbox"}loadTile(f,i){const l=this.map._requestManager.normalizeTileURL(f.tileID.canonical.url(this.tiles,this.scheme),!1,this.tileSize);function p(y,v){y&&(f.state="errored",i(y)),v&&(f.dem=v,f.dem.onDeserialize(),f.needsHillshadePrepare=!0,f.needsDEMTextureUpload=!0,f.state="loaded",i(null))}f.request=s.o(this.map._requestManager.transformRequest(l,s.R.Tile),(function(y,v,w,S){if(delete f.request,f.aborted)f.state="unloaded",i(null);else if(y)f.state="errored",i(y);else if(v){this.map._refreshExpiredTiles&&f.setExpiryData({cacheControl:w,expires:S});const C=ImageBitmap&&v instanceof ImageBitmap&&s.t(),D=1-(v.width-s.aL(v.width))/2;D<1||f.neighboringTiles||(f.neighboringTiles=this._getNeighboringTiles(f.tileID));const L=C?v:s.q.getImageData(v,D),F={uid:f.uid,tileID:f.tileID,source:this.id,type:this.t
602ype,scope:this.scope,rawImageData:L,encoding:this.encoding,padding:D};f.actor&&f.state!=="expired"||(f.actor=this.dispatcher.getActor(),f.actor.send("loadTile",F,p.bind(this),void 0,!0))}}).bind(this))}_getNeighboringTiles(f){const i=f.canonical,l=Math.pow(2,i.z),p=(i.x-1+l)%l,y=i.x===0?f.wrap-1:f.wrap,v=(i.x+1+l)%l,w=i.x+1===l?f.wrap+1:f.wrap,S={};return S[new s.aM(f.overscaledZ,y,i.z,p,i.y).key]={backfilled:!1},S[new s.aM(f.overscaledZ,w,i.z,v,i.y).key]={backfilled:!1},i.y>0&&(S[new s.aM(f.overscaledZ,y,i.z,p,i.y-1).key]={backfilled:!1},S[new s.aM(f.overscaledZ,f.wrap,i.z,i.x,i.y-1).key]={backfilled:!1},S[new s.aM(f.overscaledZ,w,i.z,v,i.y-1).key]={backfilled:!1}),i.y+1<l&&(S[new s.aM(f.overscaledZ,y,i.z,p,i.y+1).key]={backfilled:!1},S[new s.aM(f.overscaledZ,f.wrap,i.z,i.x,i.y+1).key]={backfilled:!1},S[new s.aM(f.overscaledZ,w,i.z,v,i.y+1).key]={backfilled:!1}),S}},"raster-array":Al,geojson:class extends s.E{constructor(f,i,l,p){super(),this.id=f,this.type="geojson",this.minzoom=0,this.maxzoom=18,this.tileSize=512,this.isTileClipped=!0,this.reparseOverscaled=!0,this._loaded=!1,this.actor=l.getActor(),this.setEventedParent(p),this._data=i.data,this._options=s.l({},i),this._collectResourceTiming=i.collectResourceTiming,i.maxzoom!==void 0&&(this.maxzoom=i.maxzoom),i.minzoom!==void 0&&(this.minzoom=i.minzoom),i.type&&(this.type=i.type),i.attribution&&(this.attribution=i.attribution),this.promoteId=i.promoteId;const y=s.aj/this.tileSize;this.workerOptions=s.l({source:this.id,scope:this.scope,cluster:i.cluster||!1,geojsonVtOptions:{buffer:(i.buffer!==void 0?i.buffer:128)*y,tolerance:(i.tolerance!==void 0?i.tolerance:.375)*y,extent:s.aj,maxZoom:this.maxzoom,lineMetrics:i.lineMetrics||!1,generateId:i.generateId||!1},superclusterOptions:{maxZoom:i.clusterMaxZoom!==void 0?i.clusterMaxZoom:this.maxzoom-1,minPoints:Math.max(2,i.clusterMinPoints||2),extent:s.aj,radius:(i.clusterRadius!==void 0?i.clusterRadius:50)*y,log:!1,generateId:i.generateId||!1},clusterProperties:i.clusterProperties,filter:i.filter,dynamic:i.dynamic},i.workerOptions)}onAdd(f){this.map=f,this.setData(this._data)}setData(f){return this._data=f,this._updateWorkerData(),this}updateData(f){if(!this._options.dynamic)return this.fire(new s.z(new Error("Can't call updateData on a GeoJSON source with dynamic set to false.")));if(typeof f!="string"&&(f.type==="Feature"&&(f={type:"FeatureCollection",features:[f]}),f.type!=="FeatureCollection"))return this.fire(new s.z(new Error("Data to update should be a feature or a feature collection.")));if(this._coalesce&&typeof f!="string"&&typeof this._data!="string"&&this._data.type==="FeatureCollection"){const i=new Map;for(const l of this._data.features)i.set(l.id,l);for(const l of f.features)i.set(l.id,l);this._data.features=[...i.values()]}else this._data=f;return this._updateWorkerData(!0),this}getClusterExpansionZoom(f,i){return this.actor.send("geojson.getClusterExpansionZoom",{clusterId:f,source:this.id,scope:this.scope},i),this}getClusterChildren(f,i){return this.actor.send("geojson.getClusterChildren",{clusterId:f,source:this.id,scope:this.scope},i),this}getClusterLeaves(f,i,l,p){return this.actor.send("geojson.getClusterLeaves",{source:this.id,scope:this.scope,clusterId:f,limit:i,offset:l},p),this}_updateWorkerData(f=!1){if(this._pendingLoad)return void(this._coalesce=!0);this.fire(new s.A("dataloading",{dataType:"source"})),this._loaded=!1;const i=s.l({append:f},this.workerOptions);i.scope=this.scope;const l=this._data;typeof l=="string"?(i.request=this.map._requestManager.transformRequest(s.q.resolveURL(l),s.R.Source),i.request.collectResourceTiming=this._collectResourceTiming):i.data=JSON.stringify(l),this._pendingLoad=this.actor.send(`${this.type}.loadData`,i,(p,y)=>{if(this._loaded=!0,this._pendingLoad=null,p)this.fire(new s.z(p));else{const v={dataType:"source",sourceDataType:this._metadataFired?"content":"metadata"};this._collectResourceTiming&&y&&y.resourceTiming&&y.resourceTiming[this.id]&&(v.resourceTiming=y.resourceTiming[this.id]),f&&(this._partialReload=!0),this.fire(new s.A("data",v)),this._partialReload=!1,this._metadataFired=!0}this._coalesce&&(this._updateWorkerData(f),this._coalesce=!1)})}loaded(){return this._loaded}reload(){const f=s.C(this.id,this.scope);this.map.style.clearSource(f),this._updateWorkerData()}loadTile(f,i){const l=f.actor?"reloadTile":"loadTile";f.actor=this.actor;const p=this.map.style?this.map.style.getLut(this.scope):null,y=p?{image:p.image.clone()}
602:null,v=this._partialReload,w={type:this.type,uid:f.uid,tileID:f.tileID,tileZoom:f.tileZoom,zoom:f.tileID.overscaledZ,maxZoom:this.maxzoom,tileSize:this.tileSize,source:this.id,lut:y,scope:this.scope,pixelRatio:s.q.devicePixelRatio,showCollisionBoxes:this.map.showCollisionBoxes,promoteId:this.promoteId,brightness:this.map.style&&this.map.style.getBrightness()||0,extraShadowCaster:f.isExtraShadowCaster,scaleFactor:this.map.getScaleFactor(),partial:v};f.request=this.actor.send(l,w,(S,C)=>v&&!C?(f.state="loaded",i(null)):(delete f.request,f.destroy(),f.aborted?i(null):S?i(S):(f.loadVectorData(C,this.map.painter,l==="reloadTile"),i(null))),void 0,l==="loadTile")}abortTile(f){f.request&&(f.request.cancel(),delete f.request),f.aborted=!0}unloadTile(f,i){this.actor.send("removeTile",{uid:f.uid,type:this.type,source:this.id,scope:this.scope}),f.destroy()}onRemove(f){this._pendingLoad&&this._pendingLoad.cancel()}serialize(){return s.l({},this._options,{type:this.type,data:this._data})}hasTransition(){return!1}},video:class extends s.aP{constructor(f,i,l,p){super(f,i,l,p),this.roundZoom=!0,this.type="video",this.options=i}load(){this._loaded=!1;const f=this.options;this.urls=[];for(const i of f.urls)this.urls.push(this.map._requestManager.transformRequest(i,s.R.Source).url);s.aQ(this.urls,(i,l)=>{this._loaded=!0,i?this.fire(new s.z(i)):l&&(this.video=l,this.video.loop=!0,this.video.setAttribute("playsinline",""),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(f){if(this.video){const i=this.video.seekable;f<i.start(0)||f>i.end(0)?this.fire(new s.z(new s.V(`sources.${this.id}`,null,`Playback for this video can be set only between the ${i.start(0)} and ${i.end(0)}-second mark.`))):this.video.currentTime=f}}getVideo(){return this.video}onAdd(f){this.map||(this.map=f,this.load(),this.video&&(this.video.play(),this.setCoordinates(this.coordinates)))}prepare(){if(Object.keys(this.tiles).length===0||this.video.readyState<2)return;const f=this.map.painter.context,i=f.gl;this.texture?this.video.paused||(this.texture.bind(i.LINEAR,i.CLAMP_TO_EDGE),i.texSubImage2D(i.TEXTURE_2D,0,0,0,i.RGBA,i.UNSIGNED_BYTE,this.video)):(this.texture=new s.T(f,this.video,i.RGBA8),this.texture.bind(i.LINEAR,i.CLAMP_TO_EDGE),this.width=this.video.videoWidth,this.height=this.video.videoHeight),this._prepareData(f)}serialize(){return{type:"video",urls:this.urls,coordinates:this.coordinates}}hasTransition(){return this.video&&!this.video.paused}},image:s.aP,model:class extends s.E{constructor(f,i,l,p){super(),this.id=f,this.type="model",this.models=[],this._loaded=!1,this._options=i}load(){const f=[];for(const i in this._options.models){const l=this._options.models[i],p=s.aS(this.map._requestManager.transformRequest(l.uri,s.R.Model).url).then(y=>{if(!y)return;const v=s.aT(y),w=new s.aU(i,l.position,l.orientation,v);w.computeBoundsAndApplyParent(),this.models.push(w)}).catch(y=>{this.fire(new s.z(new Error(`Could not load model ${i} from ${l.uri}: ${y.message}`)))});f.push(p)}Promise.allSettled(f).then(()=>{this._loaded=!0,this.fire(new s.A("data",{dataType:"source",sourceDataType:"metadata"}))}).catch(i=>{this._loaded=!0,this.fire(new s.z(new Error(`Could not load models: ${i.message}`)))})}onAdd(f){this.map=f,this.load()}hasTransition(){return!1}loaded(){return this._loaded}getModels(){return this.models}loadTile(f,i){}serialize(){return this._options}},"batched-model":class extends s.E{constructor(f,i,l,p){super(),this.type="batched-model",this.id=f,this.tileSize=512,this._options=i,this.tiles=this._options.tiles,this.maxzoom=i.maxzoom||19,this.minzoom=i.minzoom||0,this.roundZoom=!0,this.usedInConflation=!0,this.dispatcher=l,this.reparseOverscaled=!1,this.scheme="xyz",this._loaded=!1,this.setEventedParent(p)}onAdd(f){this.map=f,this.load()}reload(){this.cancelTileJSONRequest();const f=s.C(this.id,this.scope);this.load(()=>this.map.style.clearSource(f))}cancelTileJSONRequest(){this._tileJSONRequest&&(this._tileJSONRequest.cancel(),this._tileJSONRequest=null)}load(f){this._loaded=!1,this.fire(new s.A("dataloading",{dataType:"source"}));const i=Array.isArray(this.map._language)?this.map._language.join():this.map._language,l=this.map.getWorldview();this._tileJSONRequest=Gr(this._options,this.map._requestManager,i,l,(p,y)=>{this._tileJSONRequest=null,this._loaded=!0,p?(i&&console.warn(`Ensure that your requested language string is a valid BCP-47 code or list of codes. Found: ${i}`),l&&l.length!==2&&console.warn(`Requested worldview strings must be a valid ISO alpha-2 code. Found: ${l}`),this.fire(new s.z(p))):y&&(s.l(this,y),y.bounds&&(this.tileBounds=new Tr(y.bounds,this.minzoom,this.maxzoom)),Ki(y.tiles,this.map._requestManager._customAccessToken),this.fire(new s.A("data",{dataType:"source",sourceDataType:"metadata"})),this.fire(new s.A("data",{dataType:"source",sourceDataType:"content"}))),f&&f(p)})}hasTransition(){return!1}hasTile(f){return!this.tileBounds||this.tileBounds.contains(f.canonical)}loaded(){return this._loaded}loadTile(f,i){const l=this.map._requestManager.normalizeTileURL(f.tileID.canonical.url(this.tiles,this.scheme)),p={request:this.map._requestManager.transformRequest(l,s.R.Tile),data:void 0,uid:f.uid,tileID:f.tileID,tileZoom:f.tileZoom,zoom:f.tileID.overscaledZ,tileSize:this.tileSize*f.tileID.overscaleFactor(),type:this.t
602ype,source:this.id,scope:this.scope,showCollisionBoxes:this.map.showCollisionBoxes,isSymbolTile:f.isSymbolTile,brightness:this.map.style&&this.map.style.getBrightness()||0,pixelRatio:s.q.devicePixelRatio,promoteId:this.promoteId};if(f.actor&&f.state!=="expired")if(f.state==="loading")f.reloadCallback=i;else{if(f.buckets){const v=Object.values(f.buckets);for(const w of v)w.dirty=!0;return void(f.state="loaded")}f.request=f.actor.send("reloadTile",p,y.bind(this))}else f.actor=this.dispatcher.getActor(),f.request=f.actor.send("loadTile",p,y.bind(this),void 0,!0);function y(v,w){return f.aborted?i(null):v&&v.status!==404?i(v):(this.map._refreshExpiredTiles&&w&&f.setExpiryData(w),f.loadModelData(w,this.map.painter),f.state="loaded",void i(null))}}serialize(){return s.l({},this._options)}},canvas:class extends s.aP{constructor(f,i,l,p){super(f,i,l,p),i.coordinates?Array.isArray(i.coordinates)&&i.coordinates.length===4&&!i.coordinates.some(y=>!Array.isArray(y)||y.length!==2||y.some(v=>typeof v!="number"))||this.fire(new s.z(new s.V(`sources.${f}`,null,'"coordinates" property must be an array of 4 longitude/latitude array pairs'))):this.fire(new s.z(new s.V(`sources.${f}`,null,'missing required property "coordinates"'))),i.animate&&typeof i.animate!="boolean"&&this.fire(new s.z(new s.V(`sources.${f}`,null,'optional "animate" property must be a boolean value'))),i.canvas?typeof i.canvas=="string"||i.canvas instanceof HTMLCanvasElement||this.fire(new s.z(new s.V(`sources.${f}`,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 s.z(new s.V(`sources.${f}`,null,'missing required property "canvas"'))),this.options=i,this.animate=i.animate===void 0||i.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 s.z(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(f){this.map=f,this.load(),this.canvas&&this.animate&&this.play()}onRemove(f){this.pause()}prepare(){let f=!1;if(this.canvas.width!==this.width&&(this.width=this.canvas.width,f=!0),this.canvas.height!==this.height&&(this.height=this.canvas.height,f=!0),this._hasInvalidDimensions()||Object.keys(this.tiles).length===0)return;const i=this.map.painter.context;this.texture?!f&&!this._playing||this.texture instanceof s.aR||this.texture.update(this.canvas,{premultiply:!0}):this.texture=new s.T(i,this.canvas,i.gl.RGBA8,{premultiply:!0}),this._prepareData(i)}serialize(){return{type:"canvas",coordinates:this.coordinates}}hasTransition(){return this._playing}_hasInvalidDimensions(){for(const f of[this.canvas.width,this.canvas.height])if(isNaN(f)||f<=0)return!0;return!1}},custom:class extends s.E{constructor(f,i,l,p){super(),this.id=f,this.type="custom",this._dataType="raster",this._dispatcher=l,this._implementation=i,this.setEventedParent(p),this.scheme="xyz",this.minzoom=0,this.maxzoom=22,this.tileSize=512,this._loaded=!1,this.roundZoom=!0,this._implementation||this.fire(new s.z(new Error(`Missing implementation for ${this.id} custom source`))),this._implementation.loadTile||this.fire(new s.z(new Error(`Missing loadTile implementation for ${this.id} custom source`))),this._implementation.bounds&&(this.tileBounds=new Tr(this._implementation.bounds,this.minzoom,this.maxzoom)),i.update=this._update.bind(this),i.clearTiles=this._clearTiles.bind(this),i.coveringTiles=this._coveringTiles.bind(this),s.l(this,s.aF(i,["dataType","scheme","minzoom","maxzoom","tileSize","attribution","minTileCacheSize","maxTileCacheSize"]))}serialize(){return s.aF(this,["type","scheme","minzoom","maxzoom","tileSize","attribution"])}load(){this._loaded=!0,this.fire(new s.A("data",{dataType:"source",sourceDataType:"metadata"})),this.fire(new s.A("data",{dataType:"source",sourceDataType:"content"}))}loaded(){return this._loaded}onAdd(f){this.map=f,this._loaded=!1,this.fire(new s.A("dataloading",{dataType:"source"})),this._implementation.onAdd&&this._implementation.onAdd(f),this.load()}onRemove(f){this._implementation.onRemove&&this._implementation.onRemove(f)}hasTile(f){if(this._implementation.hasTile){const{x:i,y:l,z:p}=f.canonical;return this._implementation.hasTile({x:i,y:l,z:p})}return!this.tileBounds||this.tileBounds.contains(f.canonical)}loadTile(f,i){const{x:l,y:p,z:y}=f.tileID.canonical,v=new AbortController;f.request=Promise.resolve(this._implementation.loadTile({x:l,y:p,z:y},{signal:v.signal})).then((function(w){return delete f.request,f.aborted?(f.state="unloaded",i(null)):w===void 0?(f.state="errored",i(null)):w===null?(this.loadTileData(f,{width:this.tileSize,height:this.tileSize,data:null}),f.state="loaded",i(null)):function(S){return S instanceof ImageData||S instanceof HTMLCanvasElement||S instanceof ImageBitmap||S instanceof HTMLImageElement}(w)?(this.loadTileData(f,w),f.state="loaded",void i(null)):(f.state="errored",i(new Error(`Can't infer data type for ${this.id}, only raster data supported at the moment`)))}).bind(this)).catch(w=>{w.name!=="AbortError"&&(f.state="errored",i(w))}),f.request.cancel=()=>v.abort()}loadTileData(f,i){f.setTexture(i,this.map.painter)}unloadTile(f,i){if(f.texture&&f.texture instanceof s.T?(f.destroy(!0),f.texture&&f.texture instanceof s.T&&this.map.painter.saveTileTexture(f.texture)):f.destroy(),this._implementation.unloadTile){const{x:l,y:p,z:y}=f.tileID.canonical;this._implementation.unloadTile({x:l,y:p,z:y})}i&&i()}abortTile(f,i){f.request&&f.request.cancel&&(f.request.cancel(),delete f.request),i&&i()}hasTransition(){return!1}_coveringTiles(){return this.map.transform.coveringTiles({tileSize:this.tileSize,minzoom:this.minzoom,maxzoom:this.maxzoom,roundZoom:this.roundZoom}).map(f=>({x:f.canonical.x,y:f.canonical.y,z:f.canonical.z}))}_clearTiles(){const f=s.C(this.id,this.scope);this.map.style.clearSource(f)}
602_update(){this.fire(new s.A("data",{dataType:"source",sourceDataType:"content"}))}}},ac=function(f,i,l,p){const y=new $c[i.type](f,i,l,p);if(y.id!==f)throw new Error(`Expected Source id to be ${f} instead of ${y.id}`);return s.aV(["load","abort","unload","serialize","prepare"],y),y};function Vo(f,i,l=""){return`${l}:${i.id||""}:${i.layer.id}:${function(p){if("layerId"in p)return`layer:${p.layerId}`;{const{featuresetId:y,importId:v}=p;return`featureset:${y}${v?`:import:${v}`:""}`}}(f.target)}`}function Jr(f,i,l,p=""){if(f.uniqueFeatureID){const y=Vo(f,i,p);if(l.has(y))return!0;l.add(y)}return!1}function $o(f,i,l,p,y=!1){const v=i.sourceCache.transform,w=i.sourceCache.tilesIn(f,i.has3DLayers,y);w.sort(jo);const S=[];for(const C of w){const D=C.tile.queryRenderedFeatures(i,C,l,p,v,y);Object.keys(D).length&&S.push({wrappedTileID:C.tile.tileID.wrapped().key,queryResults:D})}return S.length===0?{}:function(C){const D={},L={};for(const F of C){const O=F.queryResults,$=F.wrappedTileID,q=L[$]=L[$]||{};for(const W in O){const K=O[W],Z=q[W]=q[W]||{},se=D[W]=D[W]||[];for(const ue of K)Z[ue.featureIndex]||(Z[ue.featureIndex]=!0,se.push(ue))}}return D}(S)}function co(f,i,l,p,y){const v={},w=p.queryRenderedSymbols(f),S=[];for(const C of Object.keys(w).map(Number))S.push(y[C]);S.sort(jo);for(const C of S){const D=C.featureIndex.lookupSymbolFeatures(w[C.bucketInstanceId],C.bucketIndex,C.sourceLayerIndex,i,l);for(const L in D){const F=v[L]=v[L]||[],O=D[L];O.sort(($,q)=>{const W=C.featureSortOrder;if(W){const K=W.indexOf($.featureIndex);return W.indexOf(q.featureIndex)-K}return q.featureIndex-$.featureIndex});for(const $ of O)F.push($)}}return v}function Iu(f,i){const l=f.getRenderableIds().map(v=>f.getTileByID(v)),p=[],y={};for(let v=0;v<l.length;v++){const w=l[v],S=w.tileID.canonical.key;y[S]||(y[S]=!0,w.querySourceFeatures(p,i))}return p}function jo(f,i){const l=f.tileID,p=i.tileID;return l.overscaledZ-p.overscaledZ||l.canonical.y-p.canonical.y||l.wrap-p.wrap||l.canonical.x-p.canonical.x}function Yo(f,i){const l={};if(!i)return l;for(const p of f){const y=p.layerIds.map(v=>i.getLayer(v)).filter(Boolean);if(y.length!==0){p.layers=y,p.stateDependentLayerIds&&(p.stateDependentLayers=p.stateDependentLayerIds.map(v=>y.filter(w=>w.id===v)[0]));for(const v of y)l[v.fqid]=p}}return l}const kr=32,Po=33,Do=new Uint16Array(8184);for(let f=0;f<2046;f++){let i=f+2,l=0,p=0,y=0,v=0,w=0,S=0;for(1&i?y=v=w=kr:l=p=S=kr;(i>>=1)>1;){const D=l+y>>1,L=p+v>>1;1&i?(y=l,v=p,l=w,p=S):(l=y,p=v,y=w,v=S),w=D,S=L}const C=4*f;Do[C+0]=l,Do[C+1]=p,Do[C+2]=y,Do[C+3]=v}const Uo=new Uint16Array(2178),Ma=new Uint8Array(1089),Qr=new Uint16Array(1089);function lc(f){return f===0?-.03125:f===32?.03125:0}const Fh={type:2,extent:s.aj,loadGeometry:()=>[[new s.P(0,0),new s.P(s.aj+1,0),new s.P(s.aj+1,s.aj+1),new s.P(0,s.aj+1),new s.P(0,0)]]};class eo{constructor(i,l,p,y,v){this.tileID=i,this.uid=s.a$(),this.uses=0,this.tileSize=l,this.tileZoom=p,this.buckets={},this.expirationTime=null,this.queryPadding=0,this.hasSymbolBuckets=!1,this.hasRTLText=!1,this.dependencies={},this.isRaster=v,y&&y.style&&(this._lastUpdatedBrightness=y.style.getBrightness()),this.expiredRequestCount=0,this.state="loading",y&&y.transform&&(this.projection=y.transform.projection)}registerFadeDuration(i){const l=i+this.timeAdded;l<s.q.now()||this.fadeEndTime&&l<this.fadeEndTime||(this.fadeEndTime=l)}wasRequested(){return this.state==="errored"||this.state==="loaded"||this.state==="reloading"}get tileTransform(){return this._tileTransform||(this._tileTransform=s.aW(this.tileID.canonical,this.projection)),this._tileTransform}loadVectorData(i,l,p){if(this.unloadVectorData(),this.state="loaded",i){i.featureIndex&&(this.latestFeatureIndex=i.featureIndex,i.rawTileData?(this.latestRawTileData=i.rawTileData,this.latestFeatureIndex.rawTileData=i.rawTileData):this.latestRawTileData&&(this.latestFeatureIndex.rawTileData=this.latestRawTileData)),this.collisionBoxArray=i.collisionBoxArray,this.buckets=Yo(i.buckets,l.style),this.hasSymbolBuckets=!1;for(const y in this.buckets){const v=this.buckets[y];if(v instanceof s.b1){if(this.hasSymbolBuckets=!0,!p)break;v.justReloaded=!0}}if(this.hasRTLText=!1,this.hasSymbolBuckets)for(const y in this.buckets){const v=this.buckets[y];if(v instanceof s.b1&&v.hasRTLText){this.hasRTLText=!0,s.b2();break}}this.queryPadding=0;for(const y in this.buckets){const v=this.buckets[y],w=l.style.getOwnLayer(y);if(!w)continue;const S=w.queryRadius(v);this.queryPadding=Math.max(this.queryPadding,S)}i.imageAtlas&&(this.imageAtlas=i.imageAtlas),i.glyphAtlasImage&&(this.glyphAtlasImage=i.glyphAtlasImage),i.lineAtlas&&(this.lineAtlas=i.lineAtlas),this._lastUpdatedBrightness=i.brightness}else this.collisionBoxArray=new s.b0}unloadVectorData(){if(this.hasData()){for(const i in this.buckets)this.buckets[i].destroy();this.buckets={},this.imageAtlas&&(this.imageAtlas=null),this.lineAtlas&&(this.lineAtlas=null),this.imageAtlasTexture&&this.imageAtlasTexture.destroy(),this.glyphAtlasTexture&&this.glyphAtlasTexture.destroy(),this.lineAtlasTexture&&this.lineAtlasTexture.destroy(),this._tileBoundsBuffer&&(this._tileBoundsBuffer.destroy(),this._tileBoundsIndexBuffer.destroy(),this._tileBoundsSegments.destroy(),this._tileBoundsBuffer=null),this._tileDebugBuffer&&(this._tileDebugBuffer.destroy(),this._tileDebugSegments.destroy(),this._tileDebugBuffer=null),this._tileDebugIndexBuffer&&(this._tileDebugIndexBuffer.destroy(),this._tileDebugIndexBuffer=null),this._globeTileDebugBorderBuffer&&(this._globeTileDebugBorderBuffer.destroy(),this._globeTileDebugBorderBuffer=null),this._tileDebugTextBuffer&&(this._tileDebugTextBuffer.destroy(),this._tileDebugTextSegments.destroy(),this._tileDebugTextIndexBuffer.destroy(),this._tileDebugTextBuffer=null),this._globeTileDebugTextBuffer&&(this._globeTileDebugTextBuffer.destroy(),this._globeTileDebugTextBuffer=null),this.latestFeatureIndex=null,this.state="unloaded"}}loadModelData(i,l,p){i&&(i.resourceTiming&&(this.resourceTiming=i.resourceTiming),this.buckets=Object.assign({},this.buckets,Yo(i.buckets,l.style)),i.featureIndex&&(this.latestFeatureIndex=i.featureIndex))}getBucket(i){return this.buckets[i.fqid]}upload(i){for(const y in this.buckets){const v=this.buckets[y];v.uploadPending()&&v.upload(i)}const l=i.gl,p=this.imageAtlas;p&&!p.uploaded&&(this.imageAtlasTexture=new s.T(i,p.image,l.RGBA8,{useMipmap:!!p.patternPositions.size}),this.imageAtlas.uploaded=!0),this.glyphAtlasImage&&(this.glyphAtlasTexture=new s.T(i,this.glyphAtlasImage,l.R8),this.glyphAtlasImage=null),this.lineAtlas&&!this.lineAtlas.uploaded&&(this.lineAtlasTexture=new s.T(i,this.lineAtlas.image,l.R8),this.lineAtlas.uploaded=!0)}prepare(i,l,p){if(this.imageAtlas&&this.imageAtlasTexture&&this.imageAtlas.patchUpdatedImages(i,this.imageAtlasTexture,p),!l||!this.latestFeatureIndex||!this.latestFeatureIndex.rawTileData)return;const y=l.style.getBrightness();(this._lastUpdatedBrightness||y)&&(this._lastUpdatedBrightness&&y&&Math.abs(this._lastUpdatedBrightness-y)<.001||(this.updateBuckets(l,this._lastUpdatedBrightness!==y),this._lastUpdatedBrightness=y))}queryRenderedFeatures(i,l,p,y,v,w){if(!this.latestFeatureIndex||!this.latestFeatureIndex.rawTileData&&!this.latestFeatureIndex.is3DTile)return{};const S=function(C,D){const L=s.bn([],[.5*C.width,.5*-C.height,1]);
602return s.bo(L,L,[1,-1,0]),s.az(L,L,C.calculateProjMatrix(D.toUnwrapped())),Float32Array.from(L)}(v,this.tileID);return this.latestFeatureIndex.query(i,{tilespaceGeometry:l,pixelPosMatrix:S,transform:y,availableImages:p,tileTransform:this.tileTransform})}querySourceFeatures(i,l){const p=this.latestFeatureIndex;if(!p||!p.rawTileData)return;const y=p.loadVTLayers(),v=l?l.sourceLayer:"",w=y._geojsonTileLayer||y[v];if(!w)return;const S=s.b3(l&&l.filter),{z:C,x:D,y:L}=this.tileID.canonical,F={z:C,x:D,y:L};for(let O=0;O<w.length;O++){const $=w.feature(O);if(S.needGeometry){const K=s.b4($,!0);if(!S.filter(new s.aa(this.tileID.overscaledZ),K,this.tileID.canonical))continue}else if(!S.filter(new s.aa(this.tileID.overscaledZ),$))continue;const q=p.getId($,v),W=new s.b5($,C,D,L,q);W.tile=F,i.push(W)}}loaded(){return this.state==="loaded"||this.state==="errored"}hasData(){return this.state==="loaded"||this.state==="reloading"||this.state==="expired"}patternsLoaded(){return!!this.imageAtlas&&!!this.imageAtlas.patternPositions.size}setExpiryData(i){const l=this.expirationTime;if(i.cacheControl){const p=s.b6(i.cacheControl);p["max-age"]&&(this.expirationTime=Date.now()+1e3*p["max-age"])}else i.expires&&(this.expirationTime=new Date(i.expires).getTime());if(this.expirationTime){const p=Date.now();let y=!1;if(this.expirationTime>p)y=!1;else if(l)if(this.expirationTime<l)y=!0;else{const v=this.expirationTime-l;v?this.expirationTime=p+Math.max(v,3e4):y=!0}else y=!0;y?(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)}refreshFeatureState(i){this.latestFeatureIndex&&(this.latestFeatureIndex.rawTileData||this.latestFeatureIndex.is3DTile)&&i&&this.updateBuckets(i)}updateBuckets(i,l){if(!this.latestFeatureIndex||!i.style)return;const p=this.latestFeatureIndex.loadVTLayers(),y=i.style.listImages(),v=i.style.getBrightness();for(const w in this.buckets){if(!i.style.hasLayer(w))continue;const S=this.buckets[w],C=S.layers[0],D=C.sourceLayer||"_geojsonTileLayer",L=p[D],F=i.style.getLayerSourceCache(C);let O={};F&&(O=F._state.getState(D,void 0));const $=this.imageAtlas?Object.fromEntries(this.imageAtlas.patternPositions):{},q=Object.keys(O).length>0&&!l;q&&!S.stateDependentLayers.length&&!l||S.update(O,L,y,$,q?S.stateDependentLayers:S.layers,l,v),(S instanceof s.b7||S instanceof s.b8)&&i._terrain&&i._terrain.enabled&&F&&S.uploadPending()&&i._terrain._clearRenderCacheForTile(F.id,this.tileID);const W=i&&i.style&&i.style.getOwnLayer(w);W&&(this.queryPadding=Math.max(this.queryPadding,W.queryRadius(S)))}}holdingForFade(){return this.symbolFadeHoldUntil!==void 0}symbolFadeFinished(){return!this.symbolFadeHoldUntil||this.symbolFadeHoldUntil<s.q.now()}clearFadeHold(){this.symbolFadeHoldUntil=void 0}setHoldDuration(i){this.symbolFadeHoldUntil=s.q.now()+i}setTexture(i,l){const p=l.context,y=p.gl;this.texture=this.texture||l.getTileTexture(i.width),this.texture&&this.texture instanceof s.T?this.texture.update(i):(this.texture=new s.T(p,i,y.RGBA8,{useMipmap:!0}),this.texture.bind(y.LINEAR,y.CLAMP_TO_EDGE))}setDependencies(i,l){const p={};for(const y of l)p[y]=!0;this.dependencies[i]=p}hasDependency(i,l){for(const p of i){const y=this.dependencies[p];if(y){for(const v of l)if(y[v])return!0}}return!1}clearQueryDebugViz(){}_makeDebugTileBoundsBuffers(i,l){if(!l||l.name==="mercator"||this._tileDebugBuffer)return;const p=s.b9(Fh,this.tileID.canonical,this.tileTransform)[0],y=new s.ba,v=new s.bb;for(let w=0;w<p.length;w++){const{x:S,y:C}=p[w];y.emplaceBack(S,C),v.emplaceBack(w)}v.emplaceBack(0),this._tileDebugIndexBuffer=i.createIndexBuffer(v),this._tileDebugBuffer=i.createVertexBuffer(y,s.bc.members),this._tileDebugSegments=s.bd.simpleSegment(0,0,y.length,v.length)}_makeTileBoundsBuffers(i,l){if(this._tileBoundsBuffer||!l||l.name==="mercator")return;const p=s.b9(Fh,this.tileID.canonical,this.tileTransform)[0];let y,v;if(this.isRaster){const w=function(S,C){const D=s.aW(S,C),L=Math.pow(2,S.z);for(let K=0;K<Po;K++)for(let Z=0;Z<Po;Z++){const se=s.aX((S.x+(Z+lc(Z))/kr)/L),ue=s.aY((S.y+(K+lc(K))/kr)/L),fe=C.project(se,ue),xe=K*Po+Z;Uo[2*xe+0]=Math.round((fe.x*D.scale-D.x)*s.aj),Uo[2*xe+1]=Math.round((fe.y*D.scale-D.y)*s.aj)}Ma.fill(0),Qr.fill(0);for(let K=2045;K>=0;K--){const Z=4*K,se=Do[Z+0],ue=Do[Z+1],fe=Do[Z+2],xe=Do[Z+3],_e=se+fe>>1,ye=ue+xe>>1,pe=_e+ye-ue,Se=ye+se-_e,Ae=ue*Po+se,Ge=xe*Po+fe,Ne=ye*Po+_e,lt=Math.hypot((Uo[2*Ae+0]+Uo[2*Ge+0])/2-Uo[2*Ne+0],(Uo[2*Ae+1]+Uo[2*Ge+1])/2-Uo[2*Ne+1])>=16;Ma[Ne]=Ma[Ne]||(lt?1:0),K<1022&&(Ma[Ne]=Ma[Ne]||Ma[(ue+Se>>1)*Po+(se+pe>>
vendor: 4,700 bytes, line 602
6021)]||Ma[(xe+Se>>1)*Po+(fe+pe>>1)])}const F=new s.aZ,O=new s.a_;let $=0;function q(K,Z){const se=Z*Po+K;return Qr[se]===0&&(F.emplaceBack(Uo[2*se+0],Uo[2*se+1],K*s.aj/kr,Z*s.aj/kr),Qr[se]=++$),Qr[se]-1}function W(K,Z,se,ue,fe,xe){const _e=K+se>>1,ye=Z+ue>>1;if(Math.abs(K-fe)+Math.abs(Z-xe)>1&&Ma[ye*Po+_e])W(fe,xe,K,Z,_e,ye),W(se,ue,fe,xe,_e,ye);else{const pe=q(K,Z),Se=q(se,ue),Ae=q(fe,xe);O.emplaceBack(pe,Se,Ae)}}return W(0,0,kr,kr,kr,0),W(kr,kr,0,0,0,kr),{vertices:F,indices:O}}(this.tileID.canonical,l);y=w.vertices,v=w.indices}else{y=new s.aZ,v=new s.a_;for(const{x:S,y:C}of p)y.emplaceBack(S,C,0,0);const w=s.be(y.int16.subarray(0,4*y.length),void 0,4);for(let S=0;S<w.length;S+=3)v.emplaceBack(w[S],w[S+1],w[S+2])}this._tileBoundsBuffer=i.createVertexBuffer(y,s.bf.members),this._tileBoundsIndexBuffer=i.createIndexBuffer(v),this._tileBoundsSegments=s.bd.simpleSegment(0,0,y.length,v.length)}_makeGlobeTileDebugBuffers(i,l){const p=l.projection;if(!p||p.name!=="globe"||l.freezeTileCoverage)return;const y=this.tileID.canonical,v=s.bg(y,l),w=s.bh(v),S=s.ah(l.zoom);let C;S>0&&(C=s.bi(new Float64Array(16),l.globeMatrix)),this._makeGlobeTileDebugBorderBuffer(i,y,l,w,C,S),this._makeGlobeTileDebugTextBuffer(i,y,l,w,C,S)}_globePoint(i,l,p,y,v,w,S){let C=s.bj(i,l,p);if(w){const D=1<<p.z,L=s.ay(y.center.lng),F=s.aH(y.center.lat),O=(p.x+.5)/D-L;let $=0;O>.5?$=-1:O<-.5&&($=1);let q=(i/s.aj+p.x)/D+$,W=(l/s.aj+p.y)/D;q=(q-L)*y._pixelsPerMercatorPixel+L,W=(W-F)*y._pixelsPerMercatorPixel+F;const K=[q*y.worldSize,W*y.worldSize,0];s.ad(K,K,w),C=s.bk(C,K,S)}return s.ad(C,C,v)}_makeGlobeTileDebugBorderBuffer(i,l,p,y,v,w){const S=new s.ba,C=new s.bb,D=new s.bl,L=(O,$,q,W,K)=>{const Z=(q-O)/(K-1),se=(W-$)/(K-1),ue=S.length;for(let fe=0;fe<K;fe++){const xe=O+fe*Z,_e=$+fe*se;S.emplaceBack(xe,_e);const ye=this._globePoint(xe,_e,l,p,y,v,w);D.emplaceBack(ye[0],ye[1],ye[2]),C.emplaceBack(ue+fe)}},F=s.aj;L(0,0,F,0,16),L(F,0,F,F,16),L(F,F,0,F,16),L(0,F,0,0,16),this._tileDebugIndexBuffer=i.createIndexBuffer(C),this._tileDebugBuffer=i.createVertexBuffer(S,s.bc.members),this._globeTileDebugBorderBuffer=i.createVertexBuffer(D,s.bm.members),this._tileDebugSegments=s.bd.simpleSegment(0,0,S.length,C.length)}_makeGlobeTileDebugTextBuffer(i,l,p,y,v,w){const S=s.aj/4,C=new s.ba,D=new s.a_,L=new s.bl,F=25;D.reserve(32),C.reserve(F),L.reserve(F);const O=($,q)=>F*$+q;for(let $=0;$<F;$++){const q=$*S;for(let W=0;W<F;W++){const K=W*S;C.emplaceBack(K,q);const Z=this._globePoint(K,q,l,p,y,v,w);L.emplaceBack(Z[0],Z[1],Z[2])}}for(let $=0;$<4;$++)for(let q=0;q<4;q++){const W=O($,q),K=O($,q+1),Z=O($+1,q),se=O($+1,q+1);D.emplaceBack(W,K,Z),D.emplaceBack(Z,K,se)}this._tileDebugTextIndexBuffer=i.createIndexBuffer(D),this._tileDebugTextBuffer=i.createVertexBuffer(C,s.bc.members),this._globeTileDebugTextBuffer=i.createVertexBuffer(L,s.bm.members),this._tileDebugTextSegments=s.bd.simpleSegment(0,0,F,32)}destroy(i=!1){for(const l in this.buckets)this.buckets[l].destroy();this.buckets={},this.imageAtlas&&(this.imageAtlas=null),this.lineAtlas&&(this.lineAtlas=null),this.imageAtlasTexture&&(this.imageAtlasTexture.destroy(),delete this.imageAtlasTexture),this.glyphAtlasTexture&&(this.glyphAtlasTexture.destroy(),delete this.glyphAtlasTexture),this.lineAtlasTexture&&(this.lineAtlasTexture.destroy(),delete this.lineAtlasTexture),this._tileBoundsBuffer&&(this._tileBoundsBuffer.destroy(),this._tileBoundsIndexBuffer.destroy(),this._tileBoundsSegments.destroy(),this._tileBoundsBuffer=null),this._tileDebugBuffer&&(this._tileDebugBuffer.destroy(),this._tileDebugSegments.destroy(),this._tileDebugBuffer=null),this._tileDebugIndexBuffer&&(this._tileDebugIndexBuffer.destroy(),this._tileDebugIndexBuffer=null),this._globeTileDebugBorderBuffer&&(this._globeTileDebugBorderBuffer.destroy(),this._globeTileDebugBorderBuffer=null),this._tileDebugTextBuffer&&(this._tileDebugTextBuffer.destroy(),this._tileDebugTextSegments.destroy(),this._tileDebugTextIndexBuffer.destroy(),this._tileDebugTextBuffer=null),this._globeTileDebugTextBuffer&&(this._globeTileDebugTextBuffer.destroy(),this._globeTileDebugTextBuffer=null),!i&&this.texture&&this.texture instanceof s.T&&(this.texture.destroy(),delete this.texture),this.hillshadeFBO&&(this.hillshadeFBO.destroy(),delete this.hillshadeFBO),this.dem&&delete this.dem,this.neighboringTiles&&delete this.neighboringTiles,this.demTexture&&(this.demTexture.destroy(),delete this.demTexture),this.rasterParticleState&&(this.rasterParticleState.destroy(),delete this.rasterParticleState),this.latestFeatureIndex=null,this.state="unloaded"}}s.bp.setPbf(s.bq);class Mu extends eo{constructor(i,l,p,y,v){super(i,l,p,y,v),this._workQueue=[],this._fetchQueue=[],this._isHeaderLoaded=!1}
602getLayers(){return this._mrt?Object.values(this._mrt.layers):[]}getLayer(i){return this._mrt&&this._mrt.getLayer(i)}setTexture(i,l){const p=l.context,y=p.gl;this.texture=this.texture||l.getTileTexture(i.width),this.texture&&this.texture instanceof s.T?this.texture.update(i,{premultiply:!1}):this.texture=new s.T(p,i,y.RGBA8,{premultiply:!1})}flushQueues(){for(;this._workQueue.length;)this._workQueue.pop()();for(;this._fetchQueue.length;)this._fetchQueue.pop()()}fetchHeader(i=16384,l){const p=this._mrt=new s.bp(30),y=Object.assign({},this.requestParams,{headers:{Range:"bytes=0-"+(i-1)}});return this.entireBuffer=null,this.request=s.br(y,(v,w,S,C)=>{if(v)l(v);else try{const D=p.getHeaderLength(w);if(D>i)return void(this.request=this.fetchHeader(D,l));p.parseHeader(w),this._isHeaderLoaded=!0;let L=0;for(const F of Object.values(p.layers))L=Math.max(L,F.dataIndex[F.dataIndex.length-1].lastByte);w.byteLength>=L&&(this.entireBuffer=w),l(null,this.entireBuffer||w,S,C)}catch(D){l(D)}}),this.request}fetchBand(i,l,p){const y=this._mrt;if(!this._isHeaderLoaded||!y)return void p(new Error("Tile header is not ready"));const v=this.actor;if(!v)return void p(new Error("Can't fetch tile band without an actor"));let w;const S=(F,O)=>{w.complete(F,O),F?p(F):(this.updateTextureDescriptor(i,l),p(null,this.textureDescriptor&&this.textureDescriptor.img))},C=(F,O)=>{if(F)return p(F);const $=v.send("decodeRasterArray",{type:"raster-array",source:this.source,scope:this.scope,tileID:this.tileID,uid:this.uid,buffer:O,task:w},S,void 0,!0);this._workQueue.push(()=>{$&&$.cancel(),w.cancel()})},D=y.getLayer(i);if(!D)return void p(new Error(`Unknown sourceLayer "${i}"`));if(D.hasDataForBand(l))return this.updateTextureDescriptor(i,l),void p(null,this.textureDescriptor?this.textureDescriptor.img:null);const L=D.getDataRange([l]);if(w=y.createDecodingTask(L),!w||w.tasks.length)if(this.flushQueues(),this.entireBuffer)C(null,this.entireBuffer.slice(L.firstByte,L.lastByte+1));else{const F=Object.assign({},this.requestParams,{headers:{Range:`bytes=${L.firstByte}-${L.lastByte}`}}),O=s.br(F,C);this._fetchQueue.push(()=>{O.cancel(),w.cancel()})}else p(null)}updateNeeded(i,l){return(!this.textureDescriptor||this.textureDescriptor.band!==l||this.textureDescriptor.layer!==i)&&this.state!=="errored"}updateTextureDescriptor(i,l){if(!this._mrt)return;const p=this._mrt.getLayer(i);if(!p||!p.hasBand(l)||!p.hasDataForBand(l))return;const{bytes:y,tileSize:v,buffer:w,offset:S,scale:C}=p.getBandView(l),D=v+2*w,L=new s.r({width:D,height:D},y),F=this.texture;F&&F instanceof s.T&&F.update(L,{premultiply:!1}),this.textureDescriptor={layer:i,band:l,img:L,buffer:w,offset:S,tileSize:v,format:p.pixelFormat,mix:[C,256*C,65536*C,16777216*C]}}}class Pa{constructor(i,l){this.max=i,this.onRemove=l,this.reset()}reset(){for(const i in this.data)for(const l of this.data[i])l.timeout&&clearTimeout(l.timeout),this.onRemove(l.value);return this.data={},this.order=[],this}add(i,l,p){const y=i.wrapped().key;this.data[y]===void 0&&(this.data[y]=[]);const v={value:l,timeout:void 0};if(p!==void 0&&(v.timeout=setTimeout(()=>{this.remove(i,v)},p)),this.data[y].push(v),this.order.push(y),this.order.length>this.max){const w=this._getAndRemoveByKey(this.order[0]);w&&this.onRemove(w)}return this}has(i){return i.wrapped().key in this.data}getAndRemove(i){return this.has(i)?this._getAndRemoveByKey(i.wrapped().key):null}_getAndRemoveByKey(i){const l=this.data[i].shift();return l.timeout&&clearTimeout(l.timeout),this.data[i].length===0&&delete this.data[i],this.order.splice(this.order.indexOf(i),1),l.value}getByKey(i){const l=this.data[i];return l?l[0].value:null}get(i){return this.has(i)?this.data[i.wrapped().key][0].value:null}remove(i,l){if(!this.has(i))return this;const p=i.wrapped().key,y=l===void 0?0:this.data[p].indexOf(l),v=this.data[p][y];return this.data[p].splice(y,1),v.timeout&&clearTimeout(v.timeout),this.data[p].length===0&&delete this.data[p],this.onRemove(v.value),this.order.splice(this.order.indexOf(p),1),this}setMaxSize(i){for(this.max=i;this.order.length>this.max;){const l=this._getAndRemoveByKey(this.order[0]);l&&this.onRemove(l)}return this}filter(i){const l=[];for(const p in this.data)for(const y of this.data[p])i(y.value)||l.push(y);for(const p of l)this.remove(p.value.tileID,p)}}class Cl{constructor(){this.state={},this.stateChanges={},this.deletedStates={}}updateState(i,l,p){const y=String(l);if(this.stateChanges[i]=this.stateChanges[i]||{},this.stateChanges[i][y]=this.stateChanges[i][y]||{},s.l(this.stateChanges[i][y],p),this.deletedStates[i]===null){this.deletedStates[i]={};for(const v in this.state[i])v!==y&&(this.deletedStates[i][v]=null)}else if(this.deletedStates[i]&&this.deletedStates[i][y]===null){this.deletedStates[i][y]={};for(const v in this.state[i][y])p[v]||(this.deletedStates[i][y][v]=null)}else for(const v in p)this.deletedStates[i]&&this.deletedStates[i][y]&&this.deletedStates[i][y][v]===null&&delete this.deletedStates[i][y][v]}removeFeatureState(i,l,p){if(this.deletedStates[i]===null)return;const y=String(l);if(this.deletedStates[i]=this.deletedStates[i]||{},p&&l!==void 0)this.deletedStates[i][y]!==null&&(this.deletedStates[i][y]=this.deletedStates[i][y]||{},this.deletedStates[i][y][p]=null);else if(l!==void 0)if(this.stateChanges[i]&&this.stateChanges[i][y])for(p in this.deletedStates[i][y]={},this.stateChanges[i][y])this.deletedStates[i][y][p]=null;else this.deletedStates[i][y]=null;else this.deletedStates[i]=null}getState(i,l){const p=this.state[i]||{},y=this.stateChanges[i]||{},v=this.deletedStates[i];if(v===null)return{};if(l!==void 0){const S=String(l),C=s.l({},p[S],y[S]);if(v){const D=v[l];
602if(D===null)return{};for(const L in D)delete C[L]}return C}const w=s.l({},p,y);if(v)for(const S in v)delete w[S];return w}initializeTileState(i,l){i.refreshFeatureState(l)}coalesceChanges(i,l){const p={};for(const y in this.stateChanges){this.state[y]=this.state[y]||{};const v={};for(const w in this.stateChanges[y])this.state[y][w]||(this.state[y][w]={}),s.l(this.state[y][w],this.stateChanges[y][w]),v[w]=this.state[y][w];p[y]=v}for(const y in this.deletedStates){this.state[y]=this.state[y]||{};const v={};if(this.deletedStates[y]===null)for(const w in this.state[y])v[w]={},this.state[y][w]={};else for(const w in this.deletedStates[y]){if(this.deletedStates[y][w]===null)this.state[y][w]={};else if(this.state[y][w])for(const S of Object.keys(this.deletedStates[y][w]))delete this.state[y][w][S];v[w]=this.state[y][w]}p[y]=p[y]||{},s.l(p[y],v)}if(this.stateChanges={},this.deletedStates={},Object.keys(p).length!==0)for(const y in i)i[y].refreshFeatureState(l)}}class to extends s.E{constructor(i,l,p){super(),this.id=i,this._onlySymbols=p,l.on("data",y=>{y.dataType==="source"&&y.sourceDataType==="metadata"&&(this._sourceLoaded=!0),this._sourceLoaded&&!this._paused&&y.dataType==="source"&&y.sourceDataType==="content"&&(this.reload(),this.transform&&this.update(this.transform))}),l.on("error",()=>{this._sourceErrored=!0}),this._source=l,this._tiles={},this._cache=new Pa(0,this._unloadTile.bind(this)),this._timers={},this._cacheTimers={},this._minTileCacheSize=l.minTileCacheSize,this._maxTileCacheSize=l.maxTileCacheSize,this._loadedParentTiles={},this.castsShadows=!1,this.tileCoverLift=0,this._coveredTiles={},this._shadowCasterTiles={},this._state=new Cl,this._isRaster=this._source.type==="raster"||this._source.type==="raster-dem"||this._source.type==="raster-array"||this._source.type==="custom"&&this._source._dataType==="raster"}onAdd(i){this.map=i,this._minTileCacheSize=this._minTileCacheSize===void 0&&i?i._minTileCacheSize:this._minTileCacheSize,this._maxTileCacheSize=this._maxTileCacheSize===void 0&&i?i._maxTileC
vendor: 4,718 bytes, line 602
602acheSize:this._maxTileCacheSize}loaded(){if(this._sourceErrored)return!0;if(!this._sourceLoaded||!this._source.loaded())return!1;for(const i in this._tiles)if(!this._tiles[i].loaded())return!1;return!0}getSource(){return this._source}pause(){this._paused=!0}resume(){if(!this._paused)return;const i=this._shouldReloadOnResume;this._paused=!1,this._shouldReloadOnResume=!1,i&&this.reload(),this.transform&&this.update(this.transform)}_loadTile(i,l){return i.isSymbolTile=this._onlySymbols,i.isExtraShadowCaster=this._shadowCasterTiles[i.tileID.key],this._source.loadTile(i,l)}_unloadTile(i){if(this._source.unloadTile)return this._source.unloadTile(i)}_abortTile(i){if(this._source.abortTile)return this._source.abortTile(i)}serialize(){return this._source.serialize()}prepare(i){this._source.prepare&&this._source.prepare(),this._state.coalesceChanges(this._tiles,this.map?this.map.painter:null);for(const l in this._tiles){const p=this._tiles[l];p.upload(i),p.prepare(this.map.style.imageManager,this.map?this.map.painter:null,this._source.scope)}}getIds(){return Object.values(this._tiles).map(i=>i.tileID).sort(Il).map(i=>i.key)}getRenderableIds(i,l){const p=[];for(const y in this._tiles)this._isIdRenderable(+y,i,l)&&p.push(this._tiles[y]);return i?p.sort((y,v)=>{const w=y.tileID,S=v.tileID,C=new s.P(w.canonical.x,w.canonical.y)._rotate(this.transform.angle),D=new s.P(S.canonical.x,S.canonical.y)._rotate(this.transform.angle);return w.overscaledZ-S.overscaledZ||D.y-C.y||D.x-C.x}).map(y=>y.tileID.key):p.map(y=>y.tileID).sort(Il).map(y=>y.key)}hasRenderableParent(i){const l=this.findLoadedParent(i,0);return!!l&&this._isIdRenderable(l.tileID.key)}_isIdRenderable(i,l,p){return this._tiles[i]&&this._tiles[i].hasData()&&!this._coveredTiles[i]&&(l||!this._tiles[i].holdingForFade())&&(p||!this._shadowCasterTiles[i])}reload(){if(this._paused)this._shouldReloadOnResume=!0;else{this._cache.reset();for(const i in this._tiles)this._tiles[i].state!=="errored"&&this._reloadTile(+i,"reloading")}}_reloadTile(i,l){const p=this._tiles[i];p&&(p.state!=="loading"&&(p.state=l),this._loadTile(p,this._tileLoaded.bind(this,p,i,l)))}_tileLoaded(i,l,p,y){if(y)if(i.state="errored",y.status!==404)this._source.fire(new s.z(y,{tile:i}));else{if(this._source.fire(new s.A("data",{dataType:"source",sourceDataType:"error",sourceId:this._source.id,tile:i})),!(i.tileID.key in this._loadedParentTiles))return;if(this._source.type==="raster-dem"&&this.usedForTerrain&&this.map.painter.terrain){const v=this.map.painter.terrain;this.update(this.transform,v.getScaledDemTileSize(),!0),v.resetTileLookupCache(this.id)}else this.update(this.transform)}else i.timeAdded=s.q.now(),p==="expired"&&(i.refreshedUponExpiration=!0),this._setTileReloadTimer(l,i),this._source.type==="raster-dem"&&i.dem&&this._backfillDEM(i),this._state.initializeTileState(i,this.map?this.map.painter:null),this._source.fire(new s.A("data",{dataType:"source",tile:i,coord:i.tileID,sourceCacheId:this.id}))}_backfillDEM(i){const l=this.getRenderableIds();for(let y=0;y<l.length;y++){const v=l[y];if(i.neighboringTiles&&i.neighboringTiles[v]){const w=this.getTileByID(v);p(i,w),p(w,i)}}function p(y,v){if(!y.dem||y.dem.borderReady)return;y.needsHillshadePrepare=!0,y.needsDEMTextureUpload=!0;let w=v.tileID.canonical.x-y.tileID.canonical.x;const S=v.tileID.canonical.y-y.tileID.canonical.y,C=Math.pow(2,y.tileID.canonical.z),D=v.tileID.key;w===0&&S===0||Math.abs(S)>1||(Math.abs(w)>1&&(Math.abs(w+C)===1?w+=C:Math.abs(w-C)===1&&(w-=C)),v.dem&&y.dem&&(y.dem.backfillBorder(v.dem,w,S),y.neighboringTiles&&y.neighboringTiles[D]&&(y.neighboringTiles[D].backfilled=!0)))}}getTile(i){return this.getTileByID(i.key)}getTileByID(i){return this._tiles[i]}_retainLoadedChildren(i,l,p,y){for(const v in this._tiles){let w=this._tiles[v];if(y[v]||!w.hasData()||w.tileID.overscaledZ<=l||w.tileID.overscaledZ>p)continue;let S=w.tileID;for(;w&&w.tileID.overscaledZ>l+1;){const D=w.tileID.scaledTo(w.tileID.overscaledZ-1);w=this._tiles[D.key],w&&w.hasData()&&(S=D)}let C=S;for(;C.overscaledZ>l;)if(C=C.scaledTo(C.overscaledZ-1),i[C.key]){y[S.key]=S;break}}}findLoadedParent(i,l){if(i.key in this._loadedParentTiles){const p=this._loadedParentTiles[i.key];return p&&p.tileID.overscaledZ>=l?p:null}for(let p=i.overscaledZ-1;p>=l;p--){const y=i.scaledTo(p),v=this._getLoadedTile(y);if(v)return v}}_getLoadedTile(i){const l=this._tiles[i.key];return l&&l.hasData()?l:this._cache.getByKey(this._source.reparseOverscaled?i.wrapped().key:i.canonical.key)}updateCacheSize(i,l){l=l||this._source.tileSize;const p=Math.ceil(i.width/l)+1,y=Math.ceil(i.height/l)+1,v=Math.floor(p*y*5),w=typeof this._minTileCacheSize=="number"?Math.max(this._minTileCacheSize,v):v,S=typeof this._maxTileC
602acheSize=="number"?Math.min(this._maxTileCacheSize,w):w;this._cache.setMaxSize(S)}handleWrapJump(i){const l=Math.round((i-(this._prevLng===void 0?i:this._prevLng))/360);if(this._prevLng=i,l){const p={};for(const y in this._tiles){const v=this._tiles[y];v.tileID=v.tileID.unwrapTo(v.tileID.wrap+l),p[v.tileID.key]=v}this._tiles=p;for(const y in this._timers)clearTimeout(this._timers[y]),delete this._timers[y];for(const y in this._tiles)this._setTileReloadTimer(+y,this._tiles[y])}}update(i,l,p,y,v){if(this.transform=i,!this._sourceLoaded||this._paused||this.transform.freezeTileCoverage||this.usedForTerrain&&!p)return;this.updateCacheSize(i,l),this.transform.projection.name!=="globe"&&this.handleWrapJump(this.transform.center.lng),this._shadowCasterTiles={},this._coveredTiles={};const w=this._source.type==="batched-model";let S,C=this._source.maxzoom;const D=this.map&&this.map.painter?this.map.painter._terrain:null;if(D&&D.sourceCache===this&&D.attenuationRange()){const O=D.attenuationRange()[0],$=Math.floor(O)-Math.log2(D.getDemUpscale());C>$&&(C=$)}if(this.used||this.usedForTerrain){if(this._source.tileID)S=i.getVisibleUnwrappedCoordinates(this._source.tileID).map(O=>new s.aM(O.canonical.z,O.wrap,O.canonical.z,O.canonical.x,O.canonical.y));else if(this.tileCoverLift!==0){const O=i.clone();O.tileCoverLift=this.tileCoverLift,S=O.coveringTiles({tileSize:l||this._source.tileSize,minzoom:this._source.minzoom,maxzoom:C,roundZoom:this._source.roundZoom&&!p,reparseOverscaled:this._source.reparseOverscaled,isTerrainDEM:this.usedForTerrain,calculateQuadrantVisibility:w}),this._source.minzoom<=1&&i.projection.name==="globe"&&(S.push(new s.aM(1,0,1,0,0)),S.push(new s.aM(1,0,1,1,0)),S.push(new s.aM(1,0,1,0,1)),S.push(new s.aM(1,0,1,1,1)))}else if(S=i.coveringTiles({tileSize:l||this._source.tileSize,minzoom:this._source.minzoom,maxzoom:C,roundZoom:this._source.roundZoom&&!p,reparseOverscaled:this._source.reparseOverscaled,isTerrainDEM:this.usedForTerrain,calculateQuadrantVisibility:w}),this._source.hasTile){const O=this._source.hasTile.bind(this._source);S=S.filter($=>O($))}}else S=[];if(S.length>0&&this.transform.projection.name!=="globe"&&!this.usedForTerrain&&!jc(this._source.type)){const O=i.coveringZoomLevel({tileSize:l||this._source.tileSize,roundZoom:this._source.roundZoom&&!p}),$=Math.min(O,this._source.maxzoom);if(w){const q=i.extendTileCover(S,$);for(const W of q)S.push(W)}else if(v){const q=i.extendTileCover(S,$,this.transform._camera.forward());for(const W of q)S.push(W)}else if(this.castsShadows&&y){const q=i.extendTileCover(S,$,y);for(const W of q)this._shadowCasterTiles[W.key]=!0,S.push(W)}}const L=this._updateRetainedTiles(S);if(jc(this._source.type)&&S.length!==0){const O={},$={},q=Object.keys(L);for(const K of q){const Z=L[K],se=this._tiles[K];if(!se||se.fadeEndTime&&se.fadeEndTime<=s.q.now())continue;const ue=this.findLoadedParent(Z,Math.max(Z.overscaledZ-to.maxOverzooming,this._source.minzoom));ue&&(this._addTile(ue.tileID),O[ue.tileID.key]=ue.tileID),$[K]=Z}const W=S[S.length-1].overscaledZ;for(const K in this._tiles){const Z=this._tiles[K];if(L[K]||!Z.hasData())continue;let se=Z.tileID;for(;se.overscaledZ>W;){se=se.scaledTo(se.overscaledZ-1);const ue=this._tiles[se.key];if(ue&&ue.hasData()&&$[se.key]){L[K]=Z.tileID;break}}}for(const K in O)L[K]||(this._coveredTiles[K]=!0,L[K]=O[K])}for(const O in L)this._tiles[O].clearFadeHold();const F=s.bs(this._tiles,L);for(const O of F){const $=this._tiles[O];$.hasSymbolBuckets&&!$.holdingForFade()?$.setHoldDuration(this.map._fadeDuration):$.hasSymbolBuckets&&!$.symbolFadeFinished()||this._removeTile(+O)}this._updateLoadedParentTileCache(),this._onlySymbols&&this._source.afterUpdate&&this._source.afterUpdate()}releaseSymbolFadeTiles(){for(const i in this._tiles)this._tiles[i].holdingForFade()&&this._removeTile(+i)}_updateRetainedTiles(i){const l={};if(i.length===0)return l;const p={},y=i.reduce((D,L)=>Math.min(D,L.overscaledZ),1/0),v=i[0].overscaledZ,w=Math.max(v-to.maxOverzooming,this._source.minzoom),S=Math.max(v+to.maxUnderzooming,this._source.minzoom),C={};for(const D of i){const L=this._addTile(D);l[D.key]=D,L.hasData()||y<this._source.maxzoom&&(C[D.key]=D)}this._retainLoadedChildren(C,y,S,l);for(const D of i){let L=this._tiles[D.key];if(L.hasData())continue;if(D.canonical.z>=this._source.maxzoom){const O=D.children(this._source.maxzoom)[0],$=this.getTile(O);if($&&$.hasData()){l[O.key]=O;continue}}else{const O=D.children(this._source.maxzoom);
vendor: 4,140 bytes, line 602
602if(l[O[0].key]&&l[O[1].key]&&l[O[2].key]&&l[O[3].key])continue}let F=L.wasRequested();for(let O=D.overscaledZ-1;O>=w;--O){const $=D.scaledTo(O);if(p[$.key]||(p[$.key]=!0,L=this.getTile($),!L&&F&&(L=this._addTile($)),L&&(l[$.key]=$,F=L.wasRequested(),L.hasData())))break}}return l}_updateLoadedParentTileCache(){this._loadedParentTiles={};for(const i in this._tiles){const l=[];let p,y=this._tiles[i].tileID;for(;y.overscaledZ>0;){if(y.key in this._loadedParentTiles){p=this._loadedParentTiles[y.key];break}l.push(y.key);const v=y.scaledTo(y.overscaledZ-1);if(p=this._getLoadedTile(v),p)break;y=v}for(const v of l)this._loadedParentTiles[v]=p}}_addTile(i){let l=this._tiles[i.key];if(l)return l.isExtraShadowCaster!==!0||this._shadowCasterTiles[i.key]||this._reloadTile(i.key,"reloading"),l;l=this._cache.getAndRemove(i),l&&(this._setTileReloadTimer(i.key,l),l.tileID=i,this._state.initializeTileState(l,this.map?this.map.painter:null),this._cacheTimers[i.key]&&(clearTimeout(this._cacheTimers[i.key]),delete this._cacheTimers[i.key],this._setTileReloadTimer(i.key,l)));const p=!!l;if(!p){const y=this.map?this.map.painter:null,v=this._source.tileSize*i.overscaleFactor();l=this._source.type==="raster-array"?new Mu(i,v,this.transform.tileZoom,y,this._isRaster):new eo(i,v,this.transform.tileZoom,y,this._isRaster),this._loadTile(l,this._tileLoaded.bind(this,l,i.key,l.state))}return l.uses++,this._tiles[i.key]=l,p||this._source.fire(new s.A("dataloading",{tile:l,coord:l.tileID,dataType:"source"})),l}_setTileReloadTimer(i,l){i in this._timers&&(clearTimeout(this._timers[i]),delete this._timers[i]);const p=l.getExpiryTimeout();p&&(this._timers[i]=setTimeout(()=>{this._reloadTile(i,"expired"),delete this._timers[i]},p))}_removeTile(i){const l=this._tiles[i];l&&(l.uses--,delete this._tiles[i],this._timers[i]&&(clearTimeout(this._timers[i]),delete this._timers[i]),l.uses>0||(l.hasData()&&l.state!=="reloading"||l.state==="empty"?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(const i in this._tiles)this._removeTile(+i);this._source._clear&&this._source._clear(),this._cache.reset(),this.map&&this.usedForTerrain&&this.map.painter.terrain&&this.map.painter.terrain.resetTileLookupCache(this.id)}tilesIn(i,l,p){const y=[],v=this.transform;if(!v)return y;const w=v.projection.name==="globe",S=s.ay(v.center.lng);for(const C in this._tiles){const D=this._tiles[C];if(p&&D.clearQueryDebugViz(),D.holdingForFade())continue;let L;if(w){const F=D.tileID.canonical;if(F.z===0){const O=[Math.abs(s.aD(S,...Da(F,-1))-S),Math.abs(s.aD(S,...Da(F,1))-S)];L=[0,2*O.indexOf(Math.min(...O))-1]}else{const O=[Math.abs(s.aD(S,...Da(F,-1))-S),Math.abs(s.aD(S,...Da(F,0))-S),Math.abs(s.aD(S,...Da(F,1))-S)];L=[O.indexOf(Math.min(...O))-1]}}else L=[0];for(const F of L){const O=i.containsTile(D,v,l,F);O&&y.push(O)}}return y}getShadowCasterCoordinates(){return this._getRenderableCoordinates(!1,!0)}getVisibleCoordinates(i){return this._getRenderableCoordinates(i)}_getRenderableCoordinates(i,l){const p=this.getRenderableIds(i,l).map(v=>this._tiles[v].tileID),y=this.transform.projection.name==="globe";for(const v of p)v.projMatrix=this.transform.calculateProjMatrix(v.toUnwrapped()),v.expandedProjMatrix=y?this.transform.calculateProjMatrix(v.toUnwrapped(),!1,!0):v.projMatrix;return p}sortCoordinatesByDistance(i){const l=i.slice(),p=this.transform._camera.position,y=this.transform._camera.forward(),v={};for(const w of l){const S=1/(1<<w.canonical.z);v[w.key]=((w.canonical.x+.5)*S+w.wrap-p[0])*y[0]+((w.canonical.y+.5)*S-p[1])*y[1]-p[2]*y[2]}return l.sort((w,S)=>v[w.key]-v[S.key]),l}hasTransition(){if(this._source.hasTransition())return!0;if(jc(this._source.type))for(const i in this._tiles){const l=this._tiles[i];if(l.fadeEndTime!==void 0&&l.fadeEndTime>=s.q.now())return!0}return!1}setFeatureState(i,l,p){this._state.updateState(i=i||"_geojsonTileLayer",l,p)}removeFeatureState(i,l,p){this._state.removeFeatureState(i=i||"_geojsonTileLayer",l,p)}getFeatureState(i,l){return this._state.getState(i=i||"_geojsonTileLayer",l)}
602setDependencies(i,l,p){const y=this._tiles[i];y&&y.setDependencies(l,p)}reloadTilesForDependencies(i,l){for(const p in this._tiles)this._tiles[p].hasDependency(i,l)&&this._reloadTile(+p,"reloading");this._cache.filter(p=>!p.hasDependency(i,l))}_preloadTiles(i,l){if(!this._sourceLoaded){const C=()=>{this._sourceLoaded&&(this._source.off("data",C),this._preloadTiles(i,l))};return void this._source.on("data",C)}const p=new Map,y=Array.isArray(i)?i:[i],v=this.map.painter.terrain,w=this.usedForTerrain&&v?v.getScaledDemTileSize():this._source.tileSize;for(const C of y){const D=C.coveringTiles({tileSize:w,minzoom:this._source.minzoom,maxzoom:this._source.maxzoom,roundZoom:this._source.roundZoom&&!this.usedForTerrain,reparseOverscaled:this._source.reparseOverscaled,isTerrainDEM:this.usedForTerrain});for(const L of D)p.set(L.key,L);this.usedForTerrain&&C.updateElevation(!1)}const S=Array.from(p.values());s.bt(S,(C,D)=>{const L=new eo(C,this._source.tileSize*C.overscaleFactor(),this.transform.tileZoom,this.map.painter,this._isRaster);this._loadTile(L,F=>{this._source.type==="raster-dem"&&L.dem&&this._backfillDEM(L),D(F,L)})},l)}}function Il(f,i){const l=Math.abs(2*f.wrap)-+(f.wrap<0),p=Math.abs(2*i.wrap)-+(i.wrap<0);return f.overscaledZ-i.overscaledZ||p-l||i.canonical.y-f.canonical.y||i.canonical.x-f.canonical.x}function jc(f){return f==="raster"||f==="image"||f==="video"||f==="custom"}function Da(f,i){const l=1<<f.z;return[f.x/l+i,(f.x+1)/l+i]}to.maxOverzooming=10,to.maxUnderzooming=3;class hf{constructor(i){this.style=i,this.layersGotHidden=!1,this.layers=[]}processLayersChanged(){this.layers=[];const i=!1,l=!1;for(const p in this.style._mergedLayers){const y=this.style._mergedLayers[p];if(y.type==="fill-extrusion")this.layers.push({layer:y,visible:i,visibilityChanged:l});else if(y.type==="model"){const v=this.style.getLayerSource(y);v&&v.type==="batched-model"&&this.layers.push({layer:y,visible:i,visibilityChanged:l})}}}onNewFrame(i){this.layersGotHidden=!1;for(const l of this.layers){const p=l.layer;let y=!1;p.type==="fill-extrusion"?y=!p.isHidden(i)&&p.paint.get("fill-extrusion-opacity")>0:p.type==="model"&&(y=!p.isHidden(i)&&p.paint.get("model-opacity").constantOr(1)>0),this.layersGotHidden=this.layersGotHidden||!y&&l.visible,l.visible=y}}updateZOffset(i,l){this.currentBuildingBuckets=[];for(const y of this.layers){const v=y.layer,w=this.style.getLayerSourceCache(v);let S=1;v.type==="fill-extrusion"&&(S=y.visible?v.paint.get("fill-extrusion-vertical-scale"):0);let C=w?w.getTile(l):null;if(!C&&w&&l.canonical.z>w.getSource().minzoom){let D=l.scaledTo(Math.min(w.getSource().maxzoom,l.overscaledZ-1));for(;D.overscaledZ>=w.getSource().minzoom&&(C=w.getTile(D),!C&&D.overscaledZ!==0);)D=D.scaledTo(D.overscaledZ-1)}this.currentBuildingBuckets.push({bucket:C?C.getBucket(v):null,tileID:C?C.tileID:l,verticalScale:S})}i.hasAnyZOffset=!1;let p=!1;for(let y=0;y<i.symbolInstances.length;y++){const v=i.symbolInstances.get(y),w=v.zOffset,S=this._getHeightAtTileOffset(l,v.tileAnchorX,v.tileAnchorY);v.zOffset=S!==Number.NEGATIVE_INFINITY?S:w,p||w===v.zOffset||(p=!0),i.hasAnyZOffset||v.zOffset===0||(i.hasAnyZOffset=!0)}p&&(i.zOffsetBuffersNeedUpload=!0,i.zOffsetSortDirty=!0)}_mapCoordToOverlappingTile(i,l,p,y){let v=l,w=p;if(i.canonical.z!==y.canonical.z){const S=y.canonical,C=1/(1<<i.canonical.z-S.z);v=(l+i.canonical.x*s.aj)*C-S.x*s.aj|0,w=(p+i.canonical.y*s.aj)*C-S.y*s.aj|0}return{tileX:v,tileY:w}}_getHeightAtTileOffset(i,l,p){let y,v;for(let w=0;w<this.layers.length;++w){if(this.layers[w].layer.type!=="fill-extrusion")continue;const{bucket:S,tileID:C,verticalScale:D}=this.currentBuildingBuckets[w];if(!S)continue;const{tileX:L,tileY:F}=this._mapCoordToOverlappingTile(i,l,p,C),O=S.getHeightAtTileCoord(L,F);O&&O.height!==void 0&&(O.hidden?y=O.height:v=Math.max(O.height*D,v||0))}if(v!==void 0)return v;for(let w=0;w<this.layers.length;++w){const S=this.layers[w];if(S.layer.type!=="model"||!S.visible)continue;const{bucket:C,tileID:D}=this.currentBuildingBuckets[w];if(!C)continue;const{tileX:L,tileY:F}=this._mapCoordToOverlappingTile(i,l,p,D),O=C.getHeightAtTileCoord(L,F);if(O&&!O.hidden)return O.height===void 0&&y!==void 0?Math.min(O.maxHeight,y)*O.verticalScale:O.height?O.height*O.verticalScale:Number.NEGATIVE_INFINITY}return this.layersGotHidden?0:Number.NEGATIVE_INFINITY}}function Pu(f,i){const l={};for(const p in f)p!=="ref"&&(l[p]=f[p]);return s.bu.forEach(p=>{p in i&&(l[p]=i[p])}),l}function Du(f){f=f.slice();const i=Object.create(null);for(let l=0;l<f.length;l++)i[f[l].id]=f[l];for(let l=0;l<f.length;l++)"ref"in f[l]&&(f[l]=Pu(f[l],i[f[l].ref]));return f}const _n={setStyle:"setStyle",addLayer:"addLayer",removeLayer:"removeLayer",setPaintProperty:"setPaintProperty",setLayoutProperty:"setLayoutProperty",setSlot:"setSlot",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",setTerrain:"setTerrain",setFog:"setFog",setSnow:"setSnow",setRain:"setRain",setCamera:"setCamera",setLights:"setLights",setProjection:"setProjection",addImport:"addImport",removeImport:"removeImport",updateImport:"updateImport",addIconset:"addIconset",removeIconset:"removeIconset"};function Uc(f,i,l){l.push({command:_n.addSource,args:[f,i[f]]})}function cc(f,i,l){i.push({command:_n.removeSource,args:[f]}),l[f]=!0}function df(f,i,l,p){cc(f,l,p),Uc(f,i,l)}function ku(f,i,l){let p;for(p in f[l])if(f[l].hasOwnProperty(p)&&p!=="data"&&!s.bv(f[l][p],i[l][p]))return!1;for(p in i[l])if(i[l].hasOwnProperty(p)&&p!=="data"&&!s.bv(f[l][p],i[l][p]))return!1;return!0}function Ya(f,i,l,p,y,v){let w;for(w in i=i||{},f=f||{})f.hasOwnProperty(w)&&(s.bv(f[w],i[w])||l.push({command:v,args:[p,w,i[w],y]}));for(w in i)i.hasOwnProperty(w)&&!f.hasOwnProperty(w)&&(s.bv(f[w],i[w])||l.push({command:v,args:[p,w,i[w],y]}))}function Ml(f){return f.id}function Ka(f,i){return f[i.id]=i,f}class Bp{constructor(i,l){this.reset(i,l)}reset(i,l){this.points=i||[],this._distances=[0];for(let p=1;p<this.points.length;
vendor: 4,698 bytes, line 602
602p++)this._distances[p]=this._distances[p-1]+this.points[p].dist(this.points[p-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(i){if(this.points.length===1)return this.points[0];i=s.aD(i,0,1);let l=1,p=this._distances[l];const y=i*this.paddedLength+this.padding;for(;p<y&&l<this._distances.length;)p=this._distances[++l];const v=l-1,w=this._distances[v],S=p-w,C=S>0?(y-w)/S:0;return this.points[v].mult(1-C).add(this.points[l].mult(C))}}class Bh{constructor(i,l,p){const y=this.boxCells=[],v=this.circleCells=[];this.xCellCount=Math.ceil(i/p),this.yCellCount=Math.ceil(l/p);for(let w=0;w<this.xCellCount*this.yCellCount;w++)y.push([]),v.push([]);this.circleKeys=[],this.boxKeys=[],this.bboxes=[],this.circles=[],this.width=i,this.height=l,this.xScale=this.xCellCount/i,this.yScale=this.yCellCount/l,this.boxUid=0,this.circleUid=0}keysLength(){return this.boxKeys.length+this.circleKeys.length}insert(i,l,p,y,v){this._forEachCell(l,p,y,v,this._insertBoxCell,this.boxUid++),this.boxKeys.push(i),this.bboxes.push(l),this.bboxes.push(p),this.bboxes.push(y),this.bboxes.push(v)}insertCircle(i,l,p,y){this._forEachCell(l-y,p-y,l+y,p+y,this._insertCircleCell,this.circleUid++),this.circleKeys.push(i),this.circles.push(l),this.circles.push(p),this.circles.push(y)}_insertBoxCell(i,l,p,y,v,w){this.boxCells[v].push(w)}_insertCircleCell(i,l,p,y,v,w){this.circleCells[v].push(w)}_query(i,l,p,y,v,w){if(p<0||i>this.width||y<0||l>this.height)return!v&&[];const S=[];if(i<=0&&l<=0&&this.width<=p&&this.height<=y){if(v)return!0;for(let C=0;C<this.boxKeys.length;C++)S.push({key:this.boxKeys[C],x1:this.bboxes[4*C],y1:this.bboxes[4*C+1],x2:this.bboxes[4*C+2],y2:this.bboxes[4*C+3]});for(let C=0;C<this.circleKeys.length;C++){const D=this.circles[3*C],L=this.circles[3*C+1],F=this.circles[3*C+2];S.push({key:this.circleKeys[C],x1:D-F,y1:L-F,x2:D+F,y2:L+F})}return w?S.filter(w):S}return this._forEachCell(i,l,p,y,this._queryCell,S,{hitTest:v,seenUids:{box:{},circle:{}}},w),v?S.length>0:S}_queryCircle(i,l,p,y,v){const w=i-p,S=i+p,C=l-p,D=l+p;if(S<0||w>this.width||D<0||C>this.height)return!y&&[];const L=[];return this._forEachCell(w,C,S,D,this._queryCellCircle,L,{hitTest:y,circle:{x:i,y:l,radius:p},seenUids:{box:{},circle:{}}},v),y?L.length>0:L}query(i,l,p,y,v){return this._query(i,l,p,y,!1,v)}hitTest(i,l,p,y,v){return this._query(i,l,p,y,!0,v)}hitTestCircle(i,l,p,y){return this._queryCircle(i,l,p,!0,y)}_queryCell(i,l,p,y,v,w,S,C){const D=S.seenUids,L=this.boxCells[v];if(L!==null){const O=this.bboxes;for(const $ of L)if(!D.box[$]){D.box[$]=!0;const q=4*$;if(i<=O[q+2]&&l<=O[q+3]&&p>=O[q+0]&&y>=O[q+1]&&(!C||C(this.boxKeys[$]))){if(S.hitTest)return w.push(!0),!0;w.push({key:this.boxKeys[$],x1:O[q],y1:O[q+1],x2:O[q+2],y2:O[q+3]})}}}const F=this.circleCells[v];if(F!==null){const O=this.circles;for(const $ of F)if(!D.circle[$]){D.circle[$]=!0;const q=3*$;if(this._circleAndRectCollide(O[q],O[q+1],O[q+2],i,l,p,y)&&(!C||C(this.circleKeys[$]))){if(S.hitTest)return w.push(!0),!0;{const W=O[q],K=O[q+1],Z=O[q+2];w.push({key:this.circleKeys[$],x1:W-Z,y1:K-Z,x2:W+Z,y2:K+Z})}}}}}_queryCellCircle(i,l,p,y,v,w,S,C){const D=S.circle,L=S.seenUids,F=this.boxCells[v];if(F!==null){const $=this.bboxes;for(const q of F)if(!L.box[q]){L.box[q]=!0;const W=4*q;if(this._circleAndRectCollide(D.x,D.y,D.radius,$[W+0],$[W+1],$[W+2],$[W+3])&&(!C||C(this.boxKeys[q])))return w.push(!0),!0}}const O=this.circleCells[v];if(O!==null){const $=this.circles;for(const q of O)if(!L.circle[q]){L.circle[q]=!0;const W=3*q;if(this._circlesCollide($[W],$[W+1],$[W+2],D.x,D.y,D.radius)&&(!C||C(this.circleKeys[q])))return w.push(!0),!0}}}_forEachCell(i,l,p,y,v,w,S,C){const D=this._convertToXCellCoord(i),L=this._convertToYCellCoord(l),F=this._convertToXCellCoord(p),O=this._convertToYCellCoord(y);for(let $=D;$<=F;$++)for(let q=L;q<=O;q++)if(v.call(this,i,l,p,y,this.xCellCount*q+$,w,S,C))return}_convertToXCellCoord(i){return Math.max(0,Math.min(this.xCellCount-1,Math.floor(i*this.xScale)))}_convertToYCellCoord(i){return Math.max(0,Math.min(this.yCellCount-1,Math.floor(i*this.yScale)))}_circlesCollide(i,l,p,y,v,w){const S=y-i,C=v-l,D=p+w;return D*D>S*S+C*C}_circleAndRectCollide(i,l,p,y,v,w,S){const C=(w-y)/2,D=Math.abs(i-(y+C));if(D>C+p)return!1;const L=(S-v)/2,F=Math.abs(l-(v+L));if(F>L+p)return!1;if(D<=C||F<=L)return!0;const O=D-C,$=F-L;return O*O+$*$<=p*p}}const Ja={unknown:0,flipRequired:1,flipNotRequired:2},uc=Math.tan(85*Math.PI/180);function Pl(f,i,l,p,y,v,w){const S=s.bz();if(l)if(v.name==="globe"){const C=s.bA(y,i);s.az(S,S,C)}else{const C=s.bB([],w);S[0]=C[0],S[1]=C[1],S[4]=C[2],S[5]=C[3],p||s.by(S,S,y.angle)}
602else s.az(S,y.labelPlaneMatrix,f);return S}function Lu(f,i,l,p,y,v,w){const S=Pl(f,i,l,p,y,v,w);return v.name==="globe"&&l||(S[2]=S[6]=S[10]=S[14]=0),S}function hc(f,i,l,p,y,v,w){if(l){if(v.name==="globe"){const S=Pl(f,i,l,p,y,v,w);return s.bi(S,S),s.az(S,f,S),S}{const S=s.bw(f),C=s.bx([]);return C[0]=w[0],C[1]=w[1],C[4]=w[2],C[5]=w[3],s.az(S,S,C),p||s.by(S,S,-y.angle),S}}return y.glCoordMatrix}function uo(f,i,l,p){const y=[f,i,l,1];l?s.aA(y,y,p):ff(y,y,p);const v=y[3];return y[0]/=v,y[1]/=v,y[2]/=v,y}function Qa(f,i){return Math.min(.5+f/i*.5,1.5)}function Nh(f,i){const l=f[0]/f[3],p=f[1]/f[3];return l>=-i[0]&&l<=i[0]&&p>=-i[1]&&p<=i[1]}function Dl(f,i,l,p,y,v,w,S,C,D){const L=l.transform,F=p?f.textSizeData:f.iconSizeData,O=s.bH(F,l.transform.zoom),$=L.projection.name==="globe",q=[256/l.width*2+1,256/l.height*2+1],W=p?f.text.dynamicLayoutVertexArray:f.icon.dynamicLayoutVertexArray;W.clear();let K=null;$&&(K=p?f.text.globeExtVertexArray:f.icon.globeExtVertexArray);const Z=f.lineVertexArray,se=p?f.text.placedSymbolArray:f.icon.placedSymbolArray,ue=l.transform.width/l.transform.height;let fe,xe=!1;for(let _e=0;_e<se.length;_e++){const ye=se.get(_e),{numGlyphs:pe,writingMode:Se}=ye;if(Se!==s.bI.vertical||xe||fe===s.bI.horizontal||(xe=!0),fe=Se,(ye.hidden||Se===s.bI.vertical)&&!xe){Cn(pe,W);continue}xe=!1;const Ae=new s.P(ye.tileAnchorX,ye.tileAnchorY);let{x:Ge,y:Ne,z:lt}=L.projection.projectTilePoint(Ae.x,Ae.y,D.canonical);if(C){const[Qt,ci,Kt]=C(Ae);Ge+=Qt,Ne+=ci,lt+=Kt}const st=[Ge,Ne,lt,1];if(s.aA(st,st,i),!Nh(st,q)){Cn(pe,W);continue}const Et=st[3],Be=Qa(l.transform.getCameraToCenterDistance(L.projection),Et),We=s.bJ(F,O,ye),Re=w?We/Be:We*Be,ht=uo(Ge,Ne,lt,y);if(ht[3]<=0){Cn(pe,W);continue}let Xe={};const gt=s.al(f.layers[0].layout.get("text-max-angle")),ct=Math.cos(gt),yt=w?null:C,xt=To(ye,Re,!1,S,i,y,v,f.glyphOffsetArray,Z,W,K,ht,Ae,Xe,ue,yt,L.projection,D,w,ct);xe=xt.useVertical,yt&&xt.needsFlipping&&(Xe={}),(xt.notEnoughRoom||xe||xt.needsFlipping&&To(ye,Re,!0,S,i,y,v,f.glyphOffsetArray,Z,W,K,ht,Ae,Xe,ue,yt,L.projection,D,w,ct).notEnoughRoom)&&Cn(pe,W)}p?(f.text.dynamicLayoutVertexBuffer.updateData(W),K&&f.text.globeExtVertexBuffer&&f.text.globeExtVertexBuffer.updateData(K)):(f.icon.dynamicLayoutVertexBuffer.updateData(W),K&&f.icon.globeExtVertexBuffer&&f.icon.globeExtVertexBuffer.updateData(K))}function Vh(f,i,l,p,y,v,w,S,C,D,L,F,O,$,q,W,K){const{lineStartIndex:Z,glyphStartIndex:se,segment:ue}=S,fe=se+S.numGlyphs,xe=Z+S.lineLength,_e=i.getoffsetX(se),ye=i.getoffsetX(fe-1),pe=Hc(f*_e,l,p,y,v,w,ue,Z,xe,C,D,L,F,O,!0,$,q,W,K);if(!pe)return null;const Se=Hc(f*ye,l,p,y,v,w,ue,Z,xe,C,D,L,F,O,!0,$,q,W,K);return Se?{first:pe,last:Se}:null}function kl(f,i,l,p){return f===s.bI.horizontal&&Math.abs(p)>Math.abs(l)?{useVertical:!0}:f===s.bI.vertical?p>0?{needsFlipping:!0}:null:i!==Ja.unknown&&function(y,v){return y===0||Math.abs(v/y)>uc}(l,p)?i===Ja.flipRequired?{needsFlipping:!0}:null:l<0?{needsFlipping:!0}:null}function To(f,i,l,p,y,v,w,S,C,D,L,F,O,$,q,W,K,Z,se,ue){const fe=i/24,xe=f.lineOffsetX*fe,_e=f.lineOffsetY*fe,{lineStartIndex:ye,glyphStartIndex:pe,numGlyphs:Se,segment:Ae,writingMode:Ge,flipState:Ne}=f,lt=ye+f.lineLength,st=Et=>{if(L){const[ht,Xe,gt]=Et.up,ct=D.length;s.bK(L,ct+0,ht,Xe,gt),s.bK(L,ct+1,ht,Xe,gt),s.bK(L,ct+2,ht,Xe,gt),s.bK(L,ct+3,ht,Xe,gt)}const[Be,We,Re]=Et.point;s.bL(D,Be,We,Re,Et.angle)};if(Se>1){const Et=Vh(fe,S,xe,_e,l,F,O,f,C,v,$,W,!1,K,Z,se,ue);if(!Et)return{notEnoughRoom:!0};if(p&&!l){let[Be,We,Re]=Et.first.point,[ht,Xe,gt]=Et.last.point;[Be,We]=uo(Be,We,Re,w),[ht,Xe]=uo(ht,Xe,gt,w);const ct=kl(Ge,Ne,(ht-Be)*q,Xe-We);if(f.flipState=ct&&ct.needsFlipping?Ja.flipRequired:Ja.flipNotRequired,ct)return ct}st(Et.first);for(let Be=pe+1;Be<pe+Se-1;Be++){const We=Hc(fe*S.getoffsetX(Be),xe,_e,l,F,O,Ae,ye,lt,C,v,$,W,!1,!1,K,Z,se,ue);if(!We)return D.length-=4*(Be-pe),{notEnoughRoom:!0};st(We)}st(Et.last)}else{if(p&&!l){const Be=uo(O.x,O.y,0,y),We=ye+Ae+1,Re=new s.P(C.getx(We),C.gety(We)),ht=uo(Re.x,Re.y,0,y),Xe=ht[3]>0?ht:Ru(O,Re,Be,1,y,void 0,K,Z.canonical),gt=kl(Ge,Ne,(Xe[0]-Be[0])*q,Xe[1]-Be[1]);if(f.flipState=gt&>.needsFlipping?Ja.flipRequired:Ja.flipNotRequired,gt)return gt}const Et=Hc(fe*S.getoffsetX(pe),xe,_e,l,F,O,Ae,ye,lt,C,v,$,W,!1,!1,K,Z,se,ue);if(!Et)return{notEnoughRoom:!0};st(Et)}return{}}function $h(f,i,l,p,y){const{x:v,y:w,z:S}=p.projectTilePoint(f.x,f.y,i);if(!y)return uo(v,w,S,l);const[C,D,L]=y(f);return uo(v+C,w+D,S+L,l)}function Ru(f,i,l,p,y,v,w,S){const C=$h(f.sub(i)._unit()._add(f),S,y,w,v);return s.at(C,l,C),s.au(C,C),s.bF(C,l,C,p)}function Hc(f,i,l,p,y,v,w,S,C,D,L,F,O,$,q,W,K,Z,se){const ue=p?f-i:f+i;let fe=ue>0?1:-1,xe=0;p&&(fe*=-1,xe=Math.PI),fe<0&&(xe+=Math.PI);let _e=S+w+(fe>0?0:1)|0,ye=y,pe=y,Se=0,Ae=0;const Ge=Math.abs(ue),Ne=[],lt=[];let st=v,Et=st,Be=s.bC([]);const We=()=>Ru(Et,st,pe,Ge-Se+1,L,O,W,K.canonical);for(;Se+Ae<=Ge;){if(_e+=fe,_e<S||_e>=C)return null;
602if(pe=ye,Et=st,Ne.push(pe),$&<.push(Et),st=new s.P(D.getx(_e),D.gety(_e)),ye=F[_e],!ye){const Kt=$h(st,K.canonical,L,W,O);ye=Kt[3]>0?F[_e]=Kt:We()}Se+=Ae;const Qt=s.at([],ye,pe),ci=s.bD(pe,ye);if(l&&ci>0&&Ae>0&&s.bE(Be,Qt)/(Ae*ci)<se)return null;Ae=ci,Be=Qt}q&&O&&(F[_e]&&(ye=We(),Ae=s.bD(pe,ye),Be=s.at([],ye,pe)),F[_e]=ye);const Re=(Ge-Se)/Ae,ht=st.sub(Et)._mult(Re)._add(Et),Xe=s.bF([],pe,Be,Re);let gt=[0,0,1],ct=Be[0],yt=Be[1];if(Z&&(gt=W.upVector(K.canonical,ht.x,ht.y),gt[0]!==0||gt[1]!==0||gt[2]!==1)){const Qt=[gt[2],0,-gt[0]],ci=s.bG([],gt,Qt);s.au(Qt,Qt),s.au(ci,ci),ct=s.bE(Be,Qt),yt=s.bE(Be,ci)}if(l){const Qt=s.bG([],gt,Be);s.au(Qt,Qt),s.bF(Xe,Xe,Qt,l*fe)}const xt=xe+Math.atan2(yt,ct);return Ne.push(Xe),$&<.push(ht),{point:Xe,angle:xt,path:Ne,tilePath:lt,up:gt}}function Cn(f,i){const l=i.length,p=l+4*f;i.resize(p),i.float32.fill(-1/0,4*l,4*p)}function ff(f,i,l){const p=i[0],y=i[1];return f[0]=l[0]*p+l[4]*y+l[12],f[1]=l[1]*p+l[5]*y+l[13],f[3]=l[3]*p+l[7]*y+l[15],f}const gi=100;class Np{constructor(i,l,p=new Bh(i.width+200,i.height+200,25),y=new Bh(i.width+200,i.height+200,25)){this.transform=i,this.grid=p,this.ignoredGrid=y,this.pitchfactor=Math.cos(i._pitch)*i.cameraToCenterDistance,this.screenRightBoundary=i.width+gi,this.screenBottomBoundary=i.height+gi,this.gridRightBoundary=i.width+200,this.gridBottomBoundary=i.height+200,this.fogState=l}placeCollisionBox(i,l,p,y,v,w,S,C){let D=p.projectedAnchorX,L=p.projectedAnchorY,F=p.projectedAnchorZ;const O=p.elevation,$=p.tileID,q=i.getProjection();if(O&&$){const[_e,ye,pe]=q.upVector($.canonical,p.tileAnchorX,p.tileAnchorY),Se=q.upVectorScale($.canonical,this.transform.center.lat,this.transform.worldSize).metersToTile;D+=_e*O*Se,L+=ye*O*Se,F+=pe*O*Se}const W=this.projectAndGetPerspectiveRatio(S,D,L,F,p.tileID,q.name==="globe"||!!O||this.transform.pitch>0,q),K=w*W.perspectiveRatio,Z=(p.x1*l+y.x-p.padding)*K+W.point.x,se=(p.y1*l+y.y-p.padding)*K+W.point.y,ue=(p.x2*l+y.x+p.padding)*K+W.point.x,fe=(p.y2*l+y.y+p.padding)*K+W.point.y,xe=W.perspectiveRatio<=.55||W.occluded;return!this.isInsideGrid(Z,se,ue,fe)||!v&&this.grid.hitTest(Z,se,ue,fe,C)||xe?{box:[],offscreen:!1,occluded:W.occluded}:{box:[Z,se,ue,fe],offscreen:this.isOffscreen(Z,se,ue,fe),occluded:!1}}placeCollisionCircles(i,l,p,y,v,w,S,C,D,L,F,O,$,q,W){const K=[],Z=this.transform.elevation,se=i.getProjection(),ue=Z?Z.getAtTileOffsetFunc(W,this.transform.center.lat,this.transform.worldSize,se):null,fe=new s.P(p.tileAnchorX,p.tileAnchorY);let{x:xe,y:_e,z:ye}=se.projectTilePoint(fe.x,fe.y,W.canonical);if(ue){const[gt,ct,yt]=ue(fe);xe+=gt,_e+=ct,ye+=yt}const pe=se.name==="globe",Se=this.projectAndGetPerspectiveRatio(S,xe,_e,ye,W,pe||!!Z||this.transform.pitch>0,se),{perspectiveRatio:Ae}=Se,Ge=(F?w/Ae:w*Ae)/s.bO,Ne=uo(xe,_e,ye,C),lt=p.lineOffsetX*Ge,st=p.lineOffsetY*Ge,Et=s.al(i.layers[0].layout.get("text-max-angle")),Be=Math.cos(Et),We=Se.signedDistanceFromCamera>0?Vh(Ge,v,lt,st,!1,Ne,fe,p,y,C,{},Z&&!F?ue:null,F&&!!Z,se,W,F,Be):null;let Re=!1,ht=!1,Xe=!0;if(We&&!Se.occluded){const gt=.5*$*Ae+q,ct=new s.P(-100,-100),yt=new s.P(this.screenRightBoundary,this.screenBottomBoundary),xt=new Bp,{first:Qt,last:ci}=We,Kt=Qt.path.length;let hi=[];for(let Vi=Kt-1;Vi>=1;Vi--)hi.push(Qt.path[Vi]);for(let Vi=1;Vi<ci.path.length;Vi++)hi.push(ci.path[Vi]);const ni=2.5*gt;D&&(hi=hi.map(([Vi,un,is],Zn)=>(ue&&!pe&&(is=ue(Zn<Kt-1?Qt.tilePath[Kt-1-Zn]:ci.tilePath[Zn-Kt+2])[2]),uo(Vi,un,is,D))),hi.some(Vi=>Vi[3]<=0)&&(hi=[]));let bi=[];if(hi.length>0){let Vi=1/0,un=-1/0,is=1/0,Zn=-1/0;for(const dn of hi)Vi=Math.min(Vi,dn[0]),is=Math.min(is,dn[1]),un=Math.max(un,dn[0]),Zn=Math.max(Zn,dn[1]);un>=ct.x&&Vi<=yt.x&&Zn>=ct.y&&is<=yt.y&&(bi=[hi.map(dn=>new s.P(dn[0],dn[1]))],(Vi<ct.x||un>yt.x||is<ct.y||Zn>yt.y)&&(bi=s.bM(bi,ct.x,ct.y,yt.x,yt.y)))}for(const Vi of bi){xt.reset(Vi,.25*gt);let un=0;un=xt.length<=.5*gt?1:Math.ceil(xt.paddedLength/ni)+1;for(let is=0;is<un;is++){const Zn=is/Math.max(un-1,1),dn=xt.lerp(Zn),Zs=dn.x+gi,zs=dn.y+gi;K.push(Zs,zs,gt,0);const Zi=Zs-gt,bn=zs-gt,Dn=Zs+gt,ns=zs+gt;if(Xe=Xe&&this.isOffscreen(Zi,bn,Dn,ns),ht=ht||this.isInsideGrid(Zi,bn,Dn,ns),!l&&this.grid.hitTestCircle(Zs,zs,gt,O)&&(Re=!0,!L))return{circles:[],offscreen:!1,collisionDetected:Re,occluded:!1}}}}return{circles:!L&&Re||!ht?[]:K,offscreen:Xe,collisionDetected:Re,occluded:Se.occluded}}queryRenderedSymbols(i){if(i.length===0||this.grid.keysLength()===0&&this.ignoredGrid.keysLength()===0)return{};const l=[];let p=1/0,y=1/0,v=-1/0,w=-1/0;for(const L of i){const F=new s.P(L.x+gi,L.y+gi);p=Math.min(p,F.x),y=Math.min(y,F.y),v=Math.max(v,F.x),w=Math.max(w,F.y),l.push(F)}const S=this.grid.query(p,y,v,w).concat(this.ignoredGrid.query(p,y,v,w)),C={},D={};for(const L of S){const F=L.key;if(C[F.bucketInstanceId]===void 0&&(C[F.bucketInstanceId]={}),C[F.bucketInstanceId][F.featureIndex])continue;const O=[new s.P(L.x1,L.y1),new s.P(L.x2,L.y1),new s.P(L.x2,L.y2),new s.P(L.x1,L.y2)];s.bN(l,O)&&(C[F.bucketInstanceId][F.featureIndex]=!0,D[F.bucketInstanceId]===void 0&&(D[F.bucketInstanceId]=[]),D[F.bucketInstanceId].push(F.featureIndex))}return D}insertCollisionBox(i,l,p,y,v){(l?this.ignoredGrid:this.grid).insert({bucketInstanceId:p,featureIndex:y,collisionGroupID:v},i[0],i[1],i[2],i[3])}insertCollisionCircles(i,l,p,y,v){const w=l?this.ignoredGrid:this.grid,S={bucketInstanceId:p,featureIndex:y,collisionGroupID:v};for(let C=0;C<i.length;
602C+=4)w.insertCircle(S,i[C],i[C+1],i[C+2])}projectAndGetPerspectiveRatio(i,l,p,y,v,w,S){const C=[l,p,y,1];let D=!1;y||this.transform.pitch>0?(s.aA(C,C,i),this.fogState&&v&&S.name!=="globe"&&(D=function(O,$,q,W,K,Z){const se=Z.calculateFogTileMatrix(K),ue=[$,q,W];return s.ad(ue,ue,se),qt(O,s.ae(ue),Z.pitch,Z._fov)}(this.fogState,l,p,y,v.toUnwrapped(),this.transform)>.9)):ff(C,C,i);const L=C[3];return{point:new s.P((C[0]/L+1)/2*this.transform.width+gi,(-C[1]/L+1)/2*this.transform.height+gi),perspectiveRatio:Math.min(.5+this.transform.getCameraToCenterDistance(S)/L*.5,1.5),signedDistanceFromCamera:L,occluded:w&&C[2]>L||D}}isOffscreen(i,l,p,y){return p<gi||i>=this.screenRightBoundary||y<gi||l>this.screenBottomBoundary}isInsideGrid(i,l,p,y){return p>=0&&i<this.gridRightBoundary&&y>=0&&l<this.gridBottomBoundary}getViewportMatrix(){const i=s.bx([]);return s.bo(i,i,[-100,-100,0]),i}}function Ou(f,i,l){const p=i.createTileMatrix(f,f.worldSize,l.toUnwrapped());return s.az(new Float32Array(16),f.projMatrix,p)}function zu(f,i,l){if(i.projection.name===l.projection.name)return f.projMatrix;const p=l.clone();return p.setProjection(i.projection),Ou(p,i.getProjection(),f)}function Ll(f,i,l){return i.name===l.projection.name?f.projMatrix:Ou(l,i,f)}class Ko{constructor(i,l,p,y){this.opacity=i?Math.max(0,Math.min(1,i.opacity+(i.placed?l:-l))):y&&p?1:0,this.placed=p}isHidden(){return this.opacity===0&&!this.placed}}class dc{constructor(i,l,p,y,v,w=!1){this.text=new Ko(i?i.text:null,l,p,v),this.icon=new Ko(i?i.icon:null,l,y,v),this.clipped=w}isHidden(){return this.text.isHidden()&&this.icon.isHidden()}}class ka{constructor(i,l,p,y=!1){this.text=i,this.icon=l,this.skipFade=p,this.clipped=y}}class ui{constructor(){this.invProjMatrix=s.bz(),this.viewportMatrix=s.bz(),this.circles=[]}}class qn{constructor(i,l,p,y,v){this.bucketInstanceId=i,this.featureIndex=l,this.sourceLayerIndex=p,this.bucketIndex=y,this.tileID=v}}class Sn{constructor(i){this.crossSourceCollisions=i,this.maxGroupID=0,this.collisionGroups={}}get(i){if(this.crossSourceCollisions)return{ID:0,predicate:null};if(!this.collisionGroups[i]){const l=++this.maxGroupID;this.collisionGroups[i]={ID:l,predicate:p=>p.collisionGroupID===l}}return this.collisionGroups[i]}}function io(f,i,l,p,y){const{horizontalAlign:v,verticalAlign:w}=s.bV(f),S=-(v-.5)*i,C=-(w-.5)*l,D=s.bU(f,p);return new s.P(S+D[0]*y,C+D[1]*y)}function Rl(f,i,l,p,y){const v=new s.P(f,i);return l&&v._rotate(p?y:-y),v}class zn{constructor(i,l,p,y,v,w){this.transform=i.clone(),this.projection=i.projection.name,this.collisionIndex=new Np(this.transform,v),this.buildingIndex=w,this.placements={},this.opacities={},this.variableOffsets={},this.stale=!1,this.commitTime=0,this.fadeDuration=l,this.retainedQueryData={},this.collisionGroups=new Sn(p),this.collisionCircleArrays={},this.prevPlacement=y,y&&(y.prevPlacement=void 0),this.placedOrientations={}}getBucketParts(i,l,p,y,v=1){const w=p.getBucket(l),S=p.latestFeatureIndex;if(!w||!S||l.fqid!==w.layerIds[0])return;const C=w.layers[0].layout,D=w.layers[0].paint,L=p.collisionBoxArray,F=Math.pow(2,this.transform.zoom-p.tileID.overscaledZ),O=p.tileSize/s.aj,$=p.tileID.toUnwrapped();this.transform.setProjection(w.projection);const q=(W=p.tileID,K=w.getProjection(),Z=this.transform,K.name===this.projection?Z.calculateProjMatrix(W.toUnwrapped()):Ou(Z,K,W));var W,K,Z;const se=C.get("text-pitch-alignment")==="map",ue=C.get("text-rotation-alignment")==="map";l.compileFilter(l.options);const fe=l.dynamicFilter(),xe=l.dynamicFilterNeedsFeature(),_e=this.transform.calculatePixelsToTileUnitsMatrix(p),ye=Lu(q,p.tileID.canonical,se,ue,this.transform,w.getProjection(),_e);let pe=null;if(se){const We=hc(q,p.tileID.canonical,se,ue,this.transform,w.getProjection(),_e);pe=s.az([],this.transform.labelPlaneMatrix,We)}let Se=null;fe&&p.latestFeatureIndex&&(Se={unwrappedTileID:$,dynamicFilter:fe,dynamicFilterNeedsFeature:xe}),this.retainedQueryData[w.bucketInstanceId]=new qn(w.bucketInstanceId,S,w.sourceLayerIndex,w.index,p.tileID);const[Ae,Ge]=w.layers[0].layout.get("text-size-scale-range"),Ne=s.aD(v,Ae,Ge),[lt,st]=C.get("icon-size-scale-range"),Et=s.aD(v,lt,st),Be={bucket:w,layout:C,paint:D,posMatrix:q,textLabelPlaneMatr
602ix:ye,labelToScreenMatrix:pe,clippingData:Se,scale:F,textPixelRatio:O,holdingForFade:p.holdingForFade(),collisionBoxArray:L,partiallyEvaluatedTextSize:s.bH(w.textSizeData,this.transform.zoom,Ne),partiallyEvaluatedIconSize:s.bH(w.iconSizeData,this.transform.zoom,Et),collisionGroup:this.collisionGroups.get(w.sourceID),latestFeatureIndex:p.latestFeatureIndex};if(y)for(const We of w.sortKeyRanges){const{sortKey:Re,symbolInstanceStart:ht,symbolInstanceEnd:Xe}=We;i.push({sortKey:Re,symbolInstanceStart:ht,symbolInstanceEnd:Xe,parameters:Be})}else i.push({symbolInstanceStart:0,symbolInstanceEnd:w.symbolInstances.length,parameters:Be})}attemptAnchorPlacement(i,l,p,y,v,w,S,C,D,L,F,O,$,q,W,K,Z,se){const{textOffset0:ue,textOffset1:fe,crossTileID:xe}=O,_e=[ue,fe],ye=io(i,p,y,_e,v),pe=this.collisionIndex.placeCollisionBox(q,v,l,Rl(ye.x,ye.y,w,S,this.transform.angle),F,C,D,L.predicate);if(K){const Se=q.getSymbolInstanceIconSize(se,this.transform.zoom,O.placedIconSymbolIndex);if(this.collisionIndex.placeCollisionBox(q,Se,K,Rl(ye.x,ye.y,w,S,this.transform.angle),F,C,D,L.predicate).box.length===0)return}if(pe.box.length>0){let Se;return this.prevPlacement&&this.prevPlacement.variableOffsets[xe]&&this.prevPlacement.placements[xe]&&this.prevPlacement.placements[xe].text&&(Se=this.prevPlacement.variableOffsets[xe].anchor),this.variableOffsets[xe]={textOffset:_e,width:p,height:y,anchor:i,textScale:v,prevAnchor:Se},this.markUsedJustification(q,i,O,W),q.allowVerticalPlacement&&(this.markUsedOrientation(q,W,O),this.placedOrientations[xe]=W),{shift:ye,placedGlyphBoxes:pe}}}placeLayerBucketPart(i,l,p,y,v=1){const{bucket:w,layout:S,paint:C,posMatrix:D,textLabelPlaneMatrix:L,labelToScreenMatrix:F,clippingData:O,textPixelRatio:$,holdingForFade:q,collisionBoxArray:W,partiallyEvaluatedTextSize:K,partiallyEvaluatedIconSize:Z,collisionGroup:se,latestFeatureIndex:ue}=i.parameters,fe=S.get("text-optional"),xe=S.get("icon-optional"),_e=S.get("text-allow-overlap"),ye=S.get("icon-allow-overlap"),pe=S.get("text-rotation-alignment")==="map",Se=S.get("text-pitch-alignment")==="map",Ae=C.get("symbol-z-offset"),Ge=S.get("symbol-elevation-reference")==="sea",[Ne,lt]=S.get("text-size-scale-range"),[st,Et]=S.get("icon-size-scale-range"),Be=s.aD(v,Ne,lt),We=s.aD(v,st,Et);this.transform.setProjection(w.projection);let Re=_e&&(ye||!w.hasIconData()||xe),ht=ye&&(_e||!w.hasTextData()||fe);const Xe=!Ae.isConstant();!w.collisionArrays&&W&&w.deserializeCollisionBoxes(W),p&&y&&w.updateCollisionDebugBuffers(this.transform.zoom,W,Be,We);const gt=(ct,yt,xt)=>{const{crossTileID:Qt,numVerticalGlyphVertices:ci}=ct;let Kt=null;if(O&&O.dynamicFilterNeedsFeature||Xe){const In=this.retainedQueryData[w.bucketInstanceId];Kt=ue.loadFeature({featureIndex:ct.featureIndex,bucketIndex:In.bucketIndex,sourceLayerIndex:In.sourceLayerIndex,layoutVertexArrayOffset:0})}if(O&&!(0,O.dynamicFilter)({zoom:this.transform.zoom,pitch:this.transform.pitch},Kt,this.retainedQueryData[w.bucketInstanceId].tileID.canonical,new s.P(ct.tileAnchorX,ct.tileAnchorY),this.transform.calculateDistanceTileData(O.unwrappedTileID)))return this.placements[Qt]=new ka(!1,!1,!1,!0),void l.add(Qt);const hi=Ae.evaluate(Kt,{});if(l.has(Qt))return;if(q)return void(this.placements[Qt]=new ka(!1,!1,!1));let ni=!1,bi=!1,Vi=!0,un=!1,is=!1,Zn=null,dn={box:null,offscreen:null,occluded:null},Zs={box:null,offscreen:null,occluded:null},zs=null,Zi=null,bn=null,Dn=0,ns=0,fr=0;xt.textFeatureIndex?Dn=xt.textFeatureIndex:ct.useRuntimeCollisionCircles&&(Dn=ct.featureIndex),xt.verticalTextFeatureIndex&&(ns=xt.verticalTextFeatureIndex);const Ks=In=>{In.tileID=this.retainedQueryData[w.bucketInstanceId].tileID;const Is=this.transform.elevation;In.elevation=Ge?hi:hi+(Is?Is.getAtTileOffset(In.tileID,In.tileAnchorX,In.tileAnchorY):0),In.elevation+=ct.zOffset},ur=xt.textBox;if(ur){Ks(ur);const In=Nn=>{let Ls=s.bI.horizontal;if(w.allowVerticalPlacement&&!Nn&&this.prevPlacement){const $r=this.prevPlacement.placedOrientations[Qt];$r&&(this.placedOrientations[Qt]=$r,Ls=$r,this.markUsedOrientation(w,Ls,ct))}return Ls},Is=(Nn,Ls)=>{if(w.allowVerticalPlacement&&ci>0&&xt.verticalTextBox){for(const $r of w.writingModes)if($r===s.bI.vertical?(dn=Ls(),Zs=dn):dn=Nn(),dn&&dn.box&&dn.box.length)break}else dn=Nn()};if(S.get("text-variable-anchor")){let Nn=S.get("text-variable-anchor");if(this.prevPlacement&&this.prevPlacement.variableOffsets[Qt]){const _s=this.prevPlacement.variableOffsets[Qt];Nn.indexOf(_s.anchor)>0&&(Nn=Nn.filter(Zr=>Zr!==_s.anchor),Nn.unshift(_s.anchor))}const Ls=(_s,Zr,ar)=>
vendor: 11,004 bytes, line 602
602{const ro=w.getSymbolInstanceTextSize(K,ct,this.transform.zoom,yt),fl=(_s.x2-_s.x1)*ro+2*_s.padding,Ic=(_s.y2-_s.y1)*ro+2*_s.padding,ra=ct.hasIconTextFit&&!ye?Zr:null;ra&&Ks(ra);let $a={box:[],offscreen:!1,occluded:!1};const ql=_e?2*Nn.length:Nn.length;for(let Zl=0;Zl<ql;++Zl){const pl=this.attemptAnchorPlacement(Nn[Zl%Nn.length],_s,fl,Ic,ro,pe,Se,$,D,se,Zl>=Nn.length,ct,yt,w,ar,ra,K,Z);if(pl&&($a=pl.placedGlyphBoxes,$a&&$a.box&&$a.box.length)){ni=!0,Zn=pl.shift;break}}return $a};Is(()=>Ls(ur,xt.iconBox,s.bI.horizontal),()=>{const _s=xt.verticalTextBox;return _s&&Ks(_s),w.allowVerticalPlacement&&!(dn&&dn.box&&dn.box.length)&&ci>0&&_s?Ls(_s,xt.verticalIconBox,s.bI.vertical):{box:null,offscreen:null,occluded:null}}),dn&&(ni=dn.box,Vi=dn.offscreen,un=dn.occluded);const $r=In(!(!dn||!dn.box));if(!ni&&this.prevPlacement){const _s=this.prevPlacement.variableOffsets[Qt];_s&&(this.variableOffsets[Qt]=_s,this.markUsedJustification(w,_s.anchor,ct,$r))}}else{const Nn=(Ls,$r)=>{const _s=w.getSymbolInstanceTextSize(K,ct,this.transform.zoom,yt,v),Zr=this.collisionIndex.placeCollisionBox(w,_s,Ls,new s.P(0,0),_e,$,D,se.predicate);return Zr&&Zr.box&&Zr.box.length&&(this.markUsedOrientation(w,$r,ct),this.placedOrientations[Qt]=$r),Zr};Is(()=>Nn(ur,s.bI.horizontal),()=>{const Ls=xt.verticalTextBox;return w.allowVerticalPlacement&&ci>0&&Ls?(Ks(Ls),Nn(Ls,s.bI.vertical)):{box:null,offscreen:null,occluded:null}}),In(!!(dn&&dn.box&&dn.box.length))}}if(zs=dn,ni=zs&&zs.box&&zs.box.length>0,Vi=zs&&zs.offscreen,un=zs&&zs.occluded,ct.useRuntimeCollisionCircles){const In=w.text.placedSymbolArray.get(ct.centerJustifiedTextSymbolIndex>=0?ct.centerJustifiedTextSymbolIndex:ct.verticalPlacedTextSymbolIndex),Is=s.bJ(w.textSizeData,K,In),Nn=S.get("text-padding");Zi=this.collisionIndex.placeCollisionCircles(w,_e,In,w.lineVertexArray,w.glyphOffsetArray,Is,D,L,F,p,Se,se.predicate,ct.collisionCircleDiameter*Is/s.bO,Nn,this.retainedQueryData[w.bucketInstanceId].tileID),ni=_e||Zi.circles.length>0&&!Zi.collisionDetected,Vi=Vi&&Zi.offscreen,un=Zi.occluded}if(xt.iconFeatureIndex&&(fr=xt.iconFeatureIndex),xt.iconBox){const In=Is=>{Ks(Is);const Nn=ct.hasIconTextFit&&Zn?Rl(Zn.x,Zn.y,pe,Se,this.transform.angle):new s.P(0,0),Ls=w.getSymbolInstanceIconSize(Z,this.transform.zoom,ct.placedIconSymbolIndex);return this.collisionIndex.placeCollisionBox(w,Ls,Is,Nn,ye,$,D,se.predicate)};Zs&&Zs.box&&Zs.box.length&&xt.verticalIconBox?(bn=In(xt.verticalIconBox),bi=bn.box.length>0):(bn=In(xt.iconBox),bi=bn.box.length>0),Vi=Vi&&bn.offscreen,is=bn.occluded}const ks=fe||ct.numHorizontalGlyphVertices===0&&ci===0,tn=xe||ct.numIconVertices===0;if(ks||tn?tn?ks||(bi=bi&&ni):ni=bi&&ni:bi=ni=bi&&ni,ni&&zs&&zs.box&&this.collisionIndex.insertCollisionBox(zs.box,S.get("text-ignore-placement"),w.bucketInstanceId,Zs&&Zs.box&&ns?ns:Dn,se.ID),bi&&bn&&this.collisionIndex.insertCollisionBox(bn.box,S.get("icon-ignore-placement"),w.bucketInstanceId,fr,se.ID),Zi&&(ni&&this.collisionIndex.insertCollisionCircles(Zi.circles,S.get("text-ignore-placement"),w.bucketInstanceId,Dn,se.ID),p)){const In=w.bucketInstanceId;let Is=this.collisionCircleArrays[In];Is===void 0&&(Is=this.collisionCircleArrays[In]=new ui);for(let Nn=0;Nn<Zi.circles.length;Nn+=4)Is.circles.push(Zi.circles[Nn+0]),Is.circles.push(Zi.circles[Nn+1]),Is.circles.push(Zi.circles[Nn+2]),Is.circles.push(Zi.collisionDetected?1:0)}const Cs=w.projection.name!=="globe";Re=Re&&(Cs||!un),ht=ht&&(Cs||!is),this.placements[Qt]=new ka(ni||Re,bi||ht,Vi||w.justReloaded),l.add(Qt)};if(w.elevationType==="offset"&&this.buildingIndex&&this.buildingIndex.updateZOffset(w,this.retainedQueryData[w.bucketInstanceId].tileID),w.elevationType==="road"&&w.updateRoadElevation(),w.updateZOffset(),w.sortFeaturesByY){const ct=w.getSortedSymbolIndexes(this.transform.angle);for(let yt=ct.length-1;yt>=0;--yt){const xt=ct[yt];gt(w.symbolInstances.get(xt),xt,w.collisionArrays[xt])}w.hasAnyZOffset&&s.w(`${w.layerIds[0]} layer symbol-z-elevate: symbols are not sorted by elevation if symbol-z-order is evaluated to viewport-y`)}else if(w.hasAnyZOffset){const ct=w.getSortedIndexesByZOffset();for(let yt=0;yt<ct.length;++yt){const xt=ct[yt];gt(w.symbolInstances.get(xt),xt,w.collisionArrays[xt])}}else for(let ct=i.symbolInstanceStart;ct<i.symbolInstanceEnd;ct++)gt(w.symbolInstances.get(ct),ct,w.collisionArrays[ct]);if(p&&w.bucketInstanceId in this.collisionCircleArrays){const ct=this.collisionCircleArrays[w.bucketInstanceId];s.bi(ct.invProjMatrix,D),ct.viewportMatrix=this.collisionIndex.getViewportMatrix()}w.justReloaded=!1}markUsedJustification(i,l,p,y){const{leftJustifiedTextSymbolIndex:v,centerJustifiedTextSymbolIndex:w,rightJustifiedTextSymbolIndex:S,verticalPlacedTextSymbolIndex:C,crossTileID:D}=p,L=s.bT(l),F=y===s.bI.vertical?C:L==="left"?v:L==="center"?w:L==="right"?S:-1;v>=0&&(i.text.placedSymbolArray.get(v).crossTileID=F>=0&&v!==F?0:D),w>=0&&(i.text.placedSymbolArray.get(w).crossTileID=F>=0&&w!==F?0:D),S>=0&&(i.text.placedSymbolArray.get(S).crossTileID=F>=0&&S!==F?0:D),C>=0&&(i.text.placedSymbolArray.get(C).crossTileID=F>=0&&C!==F?0:D)}markUsedOrientation(i,l,p){const y=l===s.bI.horizontal||l===s.bI.horizontalOnly?l:0,v=l===s.bI.vertical?l:0,{leftJustifiedTextSymbolIndex:w,centerJustifiedTextSymbolIndex:S,rightJustifiedTextSymbolIndex:C,verticalPlacedTextSymbolIndex:D}=p,L=i.text.placedSymbolArray;w>=0&&(L.get(w).placedOrientation=y),S>=0&&(L.get(S).placedOrientation=y),C>=0&&(L.get(C).placedOrientation=y),D>=0&&(L.get(D).placedOrientation=v)}commit(i){this.commitTime=i,this.zoomAtLastRecencyCheck=this.transform.zoom;const l=this.prevPlacement;let p=!1;this.prevZoomAdjustment=l?l.zoomAdjustment(this.transform.zoom):0;const y=l?l.symbolFadeChange(i):1,v=l?l.opacities:{},w=l?l.variableOffsets:{},S=l?l.placedOrientations:{};for(const C in this.placements){const D=this.placements[C],L=v[C];L?(this.opacities[C]=new dc(L,y,D.text,D.icon,null,D.clipped),p=p||D.text!==L.text.placed||D.icon!==L.icon.placed):(this.opacities[C]=new dc(null,y,D.text,D.icon,D.skipFade,D.clipped),p=p||D.text||D.icon)}for(const C in v){const D=v[C];if(!this.opacities[C]){const L=new dc(D,y,!1,!1);L.isHidden()||(this.opacities[C]=L,p=p||D.text.placed||D.icon.placed)}}for(const C in w)this.variableOffsets[C]||!this.opacities[C]||this.opacities[C].isHidden()||(this.variableOffsets[C]=w[C]);for(const C in S)this.placedOrientations[C]||!this.opacities[C]||this.opacities[C].isHidden()||(this.placedOrientations[C]=S[C]);p?this.lastPlacementChangeTime=i:typeof this.lastPlacementChangeTime!="number"&&(this.lastPlacementChangeTime=l?l.lastPlacementChangeTime:i)}updateLayerOpacities(i,l,p,y){const v=new Set;for(const w of l){const S=w.getBucket(i);S&&w.latestFeatureIndex&&i.fqid===S.layerIds[0]&&(this.updateBucketOpacities(S,v,w,w.collisionBoxArray,p,y,w.tileID,i.scope),S.elevationType==="offset"&&this.buildingIndex&&this.buildingIndex.updateZOffset(S,w.tileID),S.elevationType==="road"&&S.updateRoadElevation(),S.updateZOffset())}}updateBucketOpacities(i,l,p,y,v,w,S,C){i.hasTextData()&&i.text.opacityVertexArray.clear(),i.hasIconData()&&i.icon.opacityVertexArray.clear(),i.hasIconCollisionBoxData()&&i.iconCollisionBox.collisionVertexArray.clear(),i.hasTextCollisionBoxData()&&i.textCollisionBox.collisionVertexArray.clear();const D=i.layers[0].layout,L=i.layers[0].paint,F=!!i.layers[0].dynamicFilter(),O=new dc(null,0,!1,!1,!0),$=D.get("text-allow-overlap"),q=D.get("icon-allow-overlap"),W=D.get("text-variable-anchor"),K=D.get("text-rotation-alignment")==="map",Z=D.get("text-pitch-alignment")==="map",se=L.get("symbol-z-offset"),ue=D.get("symbol-elevation-reference")==="sea",fe=!se.isConstant(),xe=new dc(null,0,$&&(q||!i.hasIconData()||D.get("icon-optional")),q&&($||!i.hasTextData()||D.get("text-optional")),!0);!i.collisionArrays&&y&&(i.hasIconCollisionBoxData()||i.hasTextCollisionBoxData())&&i.deserializeCollisionBoxes(y);const _e=(pe,Se,Ae)=>{for(let Ge=0;Ge<Se/4;Ge++)pe.opacityVertexArray.emplaceBack(Ae)};let ye=0;w&&i.updateReplacement(S,w);for(let pe=0;pe<i.symbolInstances.length;pe++){const Se=i.symbolInstances.get(pe),{numHorizontalGlyphVertices:Ae,numVerticalGlyphVertices:Ge,crossTileID:Ne,numIconVertices:lt,tileAnchorX:st,tileAnchorY:Et}=Se;let Be=null;const We=this.retainedQueryData[i.bucketInstanceId];fe&&Se&&We&&(Be=p.latestFeatureIndex.loadFeature({featureIndex:Se.featureIndex,bucketIndex:We.bucketIndex,sourceLayerIndex:We.sourceLayerIndex,layoutVertexArrayOffset:0}));const Re=se.evaluate(Be,{}),ht=l.has(Ne);let Xe=this.opacities[Ne];ht?Xe=O:Xe||(Xe=xe,this.opacities[Ne]=Xe),l.add(Ne);const gt=Ae>0||Ge>0,ct=lt>0,yt=this.placedOrientations[Ne],xt=yt===s.bI.vertical,Qt=yt===s.bI.horizontal||yt===s.bI.horizontalOnly;!gt&&!ct||Xe.isHidden()||ye++;let ci=!1;if((gt||ct)&&w)for(const Kt of i.activeReplacements){if(s.bP(Kt,v,s.bQ.Symbol,C)||Kt.min.x>st||st>Kt.max.x||Kt.min.y>Et||Et>Kt.max.y)continue;const hi=s.bR(st,Et,S.canonical,Kt.footprintTileId.canonical);if(ci=s.bS(hi,Kt.footprint),ci)break}if(gt){const Kt=ci?zl:Jo(Xe.text);_e(i.text,Ae,xt?zl:Kt),_e(i.text,Ge,Qt?zl:Kt);const hi=Xe.text.isHidden(),{leftJustifiedTextSymbolIndex:ni,centerJustifiedTextSymbolIndex:bi,rightJustifiedTextSymbolIndex:Vi,verticalPlacedTextSymbolIndex:un}=Se,is=i.text.placedSymbolArray,Zn=hi||xt?1:0;ni>=0&&(is.get(ni).hidden=Zn),bi>=0&&(is.get(bi).hidden=Zn),Vi>=0&&(is.get(Vi).hidden=Zn),un>=0&&(is.get(un).hidden=hi||Qt?1:0);const dn=this.variableOffsets[Ne];dn&&this.markUsedJustification(i,dn.anchor,Se,yt);const Zs=this.placedOrientations[Ne];Zs&&(this.markUsedJustification(i,"left",Se,Zs),this.markUsedOrientation(i,Zs,Se))}if(ct){const Kt=ci?zl:Jo(Xe.icon),{placedIconSymbolIndex:hi,verticalPlacedIconSymbolIndex:ni}=Se,bi=i.icon.placedSymbolArray,Vi=Xe.icon.isHidden()?1:0;hi>=0&&(_e(i.icon,lt,xt?zl:Kt),bi.get(hi).hidden=Vi),ni>=0&&(_e(i.icon,Se.numVerticalIconVertices,Qt?zl:Kt),bi.get(ni).hidden=Vi)}if(i.hasIconCollisionBoxData()||i.hasTextCollisionBoxData()){const Kt=i.collisionArrays[pe];if(Kt){let hi=new s.P(0,0),ni=!0;if(Kt.textBox||Kt.verticalTextBox){if(W){const Vi=this.variableOffsets[Ne];Vi?(hi=io(Vi.anchor,Vi.width,Vi.height,Vi.textOffset,Vi.textScale),K&&hi._rotate(Z?this.transform.angle:-this.transform.angle)):ni=!1}F&&(ni=!Xe.clipped),Kt.textBox&&fc(i.textCollisionBox.collisionVertexArray,Xe.text.placed,!ni||xt,Re,ue,hi.x,hi.y),Kt.verticalTextBox&&fc(i.textCollisionBox.collisionVertexArray,Xe.text.placed,!ni||Qt,Re,ue,hi.x,hi.y)}const bi=ni&&!!(!Qt&&Kt.verticalIconBox);Kt.iconBox&&fc(i.iconCollisionBox.collisionVertexArray,Xe.icon.placed,bi,Re,ue,Se.hasIconTextFit?hi.x:0,Se.hasIconTextFit?hi.y:0),Kt.verticalIconBox&&fc(i.iconCollisionBox.collisionVertexArray,Xe.icon.placed,!bi,Re,ue,Se.hasIconTextFit?hi.x:0,Se.hasIconTextFit?hi.y:0)}}}if(i.fullyClipped=ye===0,i.sortFeatures(this.transform.angle),this.retainedQueryData[i.bucketInstanceId]&&(this.retainedQueryData[i.bucketInstanceId].featureSortOrder=i.featureSortOrder),i.hasTextData()&&i.text.opacityVertexBuffer&&i.text.opacityVertexBuffer.updateData(i.text.o
602pacityVertexArray),i.hasIconData()&&i.icon.opacityVertexBuffer&&i.icon.opacityVertexBuffer.updateData(i.icon.opacityVertexArray),i.hasIconCollisionBoxData()&&i.iconCollisionBox.collisionVertexBuffer&&i.iconCollisionBox.collisionVertexBuffer.updateData(i.iconCollisionBox.collisionVertexArray),i.hasTextCollisionBoxData()&&i.textCollisionBox.collisionVertexBuffer&&i.textCollisionBox.collisionVertexBuffer.updateData(i.textCollisionBox.collisionVertexArray),i.bucketInstanceId in this.collisionCircleArrays){const pe=this.collisionCircleArrays[i.bucketInstanceId];i.placementInvProjMatrix=pe.invProjMatrix,i.placementViewportMatrix=pe.viewportMatrix,i.collisionCircleArray=pe.circles,delete this.collisionCircleArrays[i.bucketInstanceId]}}symbolFadeChange(i){return this.fadeDuration===0?1:(i-this.commitTime)/this.fadeDuration+this.prevZoomAdjustment}zoomAdjustment(i){return Math.max(0,(this.transform.zoom-i)/1.5)}hasTransitions(i){return this.stale||i-this.lastPlacementChangeTime<this.fadeDuration}stillRecent(i,l){const p=this.zoomAtLastRecencyCheck===l?1-this.zoomAdjustment(l):1;return this.zoomAtLastRecencyCheck=l,this.commitTime+this.fadeDuration*p>i}setStale(){this.stale=!0}}function fc(f,i,l,p,y,v,w){f.emplaceBack(i?1:0,l?1:0,v||0,w||0,p,y?1:0),f.emplaceBack(i?1:0,l?1:0,v||0,w||0,p,y?1:0),f.emplaceBack(i?1:0,l?1:0,v||0,w||0,p,y?1:0),f.emplaceBack(i?1:0,l?1:0,v||0,w||0,p,y?1:0)}const Fu=Math.pow(2,25),Bu=Math.pow(2,24),ho=Math.pow(2,17),or=Math.pow(2,16),Vp=Math.pow(2,9),Nu=Math.pow(2,8),Ol=Math.pow(2,1);function Jo(f){if(f.opacity===0&&!f.placed)return 0;if(f.opacity===1&&f.placed)return 4294967295;const i=f.placed?1:0,l=Math.floor(127*f.opacity);return l*Fu+i*Bu+l*ho+i*or+l*Vp+i*Nu+l*Ol+i}const zl=0;class pc{constructor(i){this._sortAcrossTiles=i.layout.get("symbol-z-order")!=="viewport-y"&&i.layout.get("symbol-sort-key").constantOr(1)!==void 0,this._currentTileIndex=0,this._currentPartIndex=0,this._seenCrossTileIDs=new Set,this._bucketParts=[]}continuePlacement(i,l,p,y,v,w){const S=this._bucketParts;for(;this._currentTileIndex<i.length;)if(l.getBucketParts(S,y,i[this._currentTileIndex],this._sortAcrossTiles,w),this._currentTileIndex++,v())return!0;for(this._sortAcrossTiles&&(this._sortAcrossTiles=!1,S.sort((C,D)=>C.sortKey-D.sortKey));this._currentPartIndex<S.length;){const C=S[this._currentPartIndex];if(l.placeLayerBucketPart(C,this._seenCrossTileIDs,p,C.symbolInstanceStart===0,w),this._currentPartIndex++,v())return!0}return!1}}class fo{constructor(i,l,p,y,v,w,S,C,D){this.placement=new zn(i,v,w,S,C,D),this._currentPlacementIndex=l.length-1,this._forceFullPlacement=p,this._showCollisionBoxes=y,this._done=!1}isDone(){return this._done}continuePlacement(i,l,p,y,v){const w=s.q.now(),S=()=>{const C=s.q.now()-w;return!this._forceFullPlacement&&C>2};for(;this._currentPlacementIndex>=0;){const C=l[i[this._currentPlacementIndex]],D=this.placement.collisionIndex.transform.zoom;if(C.type==="symbol"&&(!C.minzoom||C.minzoom<=D)&&(!C.maxzoom||C.maxzoom>D)){const L=C,F=L.layout.get("symbol-z-elevate"),O=L.layout.get("symbol-sort-key").constantOr(1)!==void 0,$=L.layout.get("symbol-z-order"),q=$==="viewport-y"||$==="auto"&&!($!=="viewport-y"&&O),W=L.layout.get("text-allow-overlap")||L.layout.get("icon-allow-overlap")||L.layout.get("text-ignore-placement")||L.layout.get("icon-ignore-placement"),K=q&&W,Z=this._inProgressLayer=this._inProgressLayer||new pc(L),se=s.C(C.source,C.scope);if(Z.continuePlacement(F||K?y[se]:p[se],this.placement,this._showCollisionBoxes,C,S,v))return;delete this._inProgressLayer}this._currentPlacementIndex--}this._done=!0}commit(i){return this.placement.commit(i),this.placement}}const ya=512/s.aj/2;class So{constructor(i,l,p){this.tileID=i,this.bucketInstanceId=p,this.index=new s.bW(l.length,16,Int32Array),this.keys=[],this.crossTileIDs=[];const y=i.canonical.x*s.aj,v=i.canonical.y*s.aj;for(let w=0;w<l.length;w++){const{key:S,crossTileID:C,tileAnchorX:D,tileAnchorY:L}=l.get(w),F=Math.floor((y+D)*ya),O=Math.floor((v+L)*ya);this.index.add(F,O),this.keys.push(S),this.crossTileIDs.push(C)}this.index.finish()}findMatches(i,l,p){const y=this.tileID.canonical.z<l.canonical.z?1:Math.pow(2,this.tileID.canonical.z-l.canonical.z),v=ya/Math.pow(2,l.canonical.z-this.tileID.canonical.z),w=l.canonical.x*s.aj,S=l.canonical.y*s.aj;for(let C=0;C<i.length;C++){const D=i.get(C);if(D.crossTileID)continue;const{key:L,tileAnchorX:F,tileAnchorY:O}
vendor: 4,132 bytes, line 602
602=D,$=Math.floor((w+F)*v),q=Math.floor((S+O)*v),W=this.index.range($-y,q-y,$+y,q+y).sort((K,Z)=>K-Z);for(const K of W){const Z=this.crossTileIDs[K];if(this.keys[K]===L&&!p.has(Z)){p.add(Z),D.crossTileID=Z;break}}}}}class $p{constructor(){this.maxCrossTileID=0}generate(){return++this.maxCrossTileID}}class Gc{constructor(){this.indexes={},this.usedCrossTileIDs={},this.lng=0}handleWrapJump(i){const l=Math.round((i-this.lng)/360);if(l!==0)for(const p in this.indexes){const y=this.indexes[p],v={};for(const w in y){const S=y[w];S.tileID=S.tileID.unwrapTo(S.tileID.wrap+l),v[S.tileID.key]=S}this.indexes[p]=v}this.lng=i}addBucket(i,l,p){if(this.indexes[i.overscaledZ]&&this.indexes[i.overscaledZ][i.key]){if(this.indexes[i.overscaledZ][i.key].bucketInstanceId===l.bucketInstanceId)return!1;this.removeBucketCrossTileIDs(i.overscaledZ,this.indexes[i.overscaledZ][i.key])}for(let v=0;v<l.symbolInstances.length;v++)l.symbolInstances.get(v).crossTileID=0;this.usedCrossTileIDs[i.overscaledZ]||(this.usedCrossTileIDs[i.overscaledZ]=new Set);const y=this.usedCrossTileIDs[i.overscaledZ];for(const v in this.indexes){const w=this.indexes[v];if(Number(v)>i.overscaledZ)for(const S in w){const C=w[S];C.tileID.isChildOf(i)&&C.findMatches(l.symbolInstances,i,y)}else{const S=w[i.scaledTo(Number(v)).key];S&&S.findMatches(l.symbolInstances,i,y)}}for(let v=0;v<l.symbolInstances.length;v++){const w=l.symbolInstances.get(v);w.crossTileID||(w.crossTileID=p.generate(),y.add(w.crossTileID))}return this.indexes[i.overscaledZ]===void 0&&(this.indexes[i.overscaledZ]={}),this.indexes[i.overscaledZ][i.key]=new So(i,l.symbolInstances,l.bucketInstanceId),!0}removeBucketCrossTileIDs(i,l){for(const p of l.crossTileIDs)this.usedCrossTileIDs[i].delete(p)}removeStaleBuckets(i){let l=!1;for(const p in this.indexes){const y=this.indexes[p];for(const v in y)i[y[v].bucketInstanceId]||(this.removeBucketCrossTileIDs(p,y[v]),delete y[v],l=!0)}return l}}class _r{constructor(){this.layerIndexes={},this.crossTileIDs=new $p,this.maxBucketInstanceId=0,this.bucketsInCurrentPlacement={}}addLayer(i,l,p,y){let v=this.layerIndexes[i.fqid];v===void 0&&(v=this.layerIndexes[i.fqid]=new Gc);let w=!1;const S={};y.name!=="globe"&&v.handleWrapJump(p);for(const C of l){const D=C.getBucket(i);D&&i.fqid===D.layerIds[0]&&(D.bucketInstanceId||(D.bucketInstanceId=++this.maxBucketInstanceId),v.addBucket(C.tileID,D,this.crossTileIDs)&&(w=!0),S[D.bucketInstanceId]=!0)}return v.removeStaleBuckets(S)&&(w=!0),w}pruneUnusedLayers(i){const l={};i.forEach(p=>{l[p]=!0});for(const p in this.layerIndexes)l[p]||delete this.layerIndexes[p]}}const po=771;class en{constructor(i,l,p,y){this.blendFunction=i,this.blendColor=l,this.mask=p,this.blendEquation=y}}en.Replace=[1,0,1,0],en.disabled=new en(en.Replace,s.am.transparent,[!1,!1,!1,!1]),en.unblended=new en(en.Replace,s.am.transparent,[!0,!0,!0,!0]),en.alphaBlended=new en([1,po,1,po],s.am.transparent,[!0,!0,!0,!0]),en.alphaBlendedNonPremultiplied=new en([770,po,770,po],s.am.transparent,[!0,!0,!0,!0]),en.multiply=new en([774,0,774,0],s.am.transparent,[!0,!0,!0,!0]);class Gt{constructor(i,l,p){this.func=i,this.mask=l,this.range=p}}Gt.ReadOnly=!1,Gt.ReadWrite=!0,Gt.disabled=new Gt(519,Gt.ReadOnly,[0,1]);const Wc=7680;class Ii{constructor(i,l,p,y,v,w){this.test=i,this.ref=l,this.mask=p,this.fail=y,this.depthFail=v,this.pass=w}}Ii.disabled=new Ii({func:519,mask:0},0,0,Wc,Wc,Wc);const Fl=1029,qc=2305;class Di{constructor(i,l,p){this.enable=i,this.mode=l,this.frontFace=p}}function pf(f,i){const l=s.c1(f,3);s.c3(f,i),s.c7(f,3,l)}function ko(f,i){const l=s.bY([]);return s.bZ(l,l,-i),s.b_(l,l,-f),l}function jp(f,i){const l=[f[0],f[1],0],p=[i[0],i[1],0];if(s.ae(l)>=1e-15){const w=s.au([],l);s.b$(p,w,s.bE(p,w)),i[0]=p[0],i[1]=p[1]}const y=s.bG([],i,f);if(s.c0(y)<1e-15)return null;const v=Math.atan2(-y[1],y[0]);return ko(Math.atan2(Math.sqrt(f[0]*f[0]+f[1]*f[1]),-f[2]),v)}Di.disabled=new Di(!1,Fl,qc),Di.backCCW=new Di(!0,Fl,qc),Di.backCW=new Di(!0,Fl,2304),Di.frontCW=new Di(!0,1028,2304),Di.frontCCW=new Di(!0,1028,qc);class jh{constructor(i,l){this.position=i,this.orientation=l}get position(){return this._position}
602set position(i){if(i){const l=i instanceof s.ac?i:new s.ac(i[0],i[1],i[2]);this._renderWorldCopies&&(l.x=s.bX(l.x,0,1)),this._position=l}else this._position=null}lookAtPoint(i,l){if(this.orientation=null,!this.position)return;const p=this.position,y=this._elevation?this._elevation.getAtPointOrZero(s.ac.fromLngLat(i)):0,v=s.ac.fromLngLat(i,y),w=[v.x-p.x,v.y-p.y,v.z-p.z];l||(l=[0,0,1]),l[2]=Math.abs(l[2]),this.orientation=jp(w,l)}setPitchBearing(i,l){this.orientation=ko(s.al(i),s.al(-l))}}class qr{constructor(i,l){this._transform=s.bx([]),this.orientation=l,this.position=i}get mercatorPosition(){const i=this.position;return new s.ac(i[0],i[1],i[2])}get position(){const i=s.c1(this._transform,3);return[i[0],i[1],i[2]]}set position(i){var l;i&&s.c7(this._transform,3,[(l=i)[0],l[1],l[2],1])}get orientation(){return this._orientation}set orientation(i){this._orientation=i||s.bY([]),i&&pf(this._transform,this._orientation)}getPitchBearing(){const i=this.forward(),l=this.right();return{bearing:Math.atan2(-l[1],l[0]),pitch:Math.atan2(Math.sqrt(i[0]*i[0]+i[1]*i[1]),-i[2])}}setPitchBearing(i,l){this._orientation=ko(i,l),pf(this._transform,this._orientation)}forward(){const i=s.c1(this._transform,2);return[-i[0],-i[1],-i[2]]}up(){const i=s.c1(this._transform,1);return[-i[0],-i[1],-i[2]]}right(){const i=s.c1(this._transform,0);return[i[0],i[1],i[2]]}getCameraToWorld(i,l){const p=new Float64Array(16);return s.bi(p,this.getWorldToCamera(i,l)),p}getCameraToWorldMercator(){return this._transform}getWorldToCameraPosition(i,l,p){const y=this.position;s.b$(y,y,-i);const v=new Float64Array(16);return s.bn(v,[p,p,p]),s.bo(v,v,y),v[10]*=l,v}getWorldToCamera(i,l){const p=new Float64Array(16),y=new Float64Array(4),v=this.position;return s.c2(y,this._orientation),s.b$(v,v,-i),s.c3(p,y),s.bo(p,p,v),p[1]*=-1,p[5]*=-1,p[9]*=-1,p[13]*=-1,p[8]*=l,p[9]*=l,p[10]*=l,p[11]*=l,p}getCameraToClipPerspective(i,l,p,y){const v=new Float64Array(16);return s.c4(v,i,l,p,y),v}getCameraToClipOrthographic(i,l,p,y,v,w){const S=new Float64Array(16);return s.c5(S,i,l,p,y,v,w),S}getDistanceToElevation(i,l=!1){const p=i===0?0:s.c6(i,l?s.aY(this.position[1]):this.position[1]),y=this.forward();return(p-this.position[2])/y[2]}clone(){return new qr([...this.position],[...this.orientation])}}const mo={BaseColor:5,MetallicRoughness:6,Normal:7,Occlusion:8,Emission:9,LUT:10,ShadowMap0:11};class Zc{constructor(i=0,l=0,p=0,y=0){if(isNaN(i)||i<0||isNaN(l)||l<0||isNaN(p)||p<0||isNaN(y)||y<0)throw new Error("Invalid value for edge-insets, top, bottom, left and right must all be numbers");this.top=i,this.bottom=l,this.left=p,this.right=y}interpolate(i,l,p){return l.top!=null&&i.top!=null&&(this.top=s.ai(i.top,l.top,p)),l.bottom!=null&&i.bottom!=null&&(this.bottom=s.ai(i.bottom,l.bottom,p)),l.left!=null&&i.left!=null&&(this.left=s.ai(i.left,l.left,p)),l.right!=null&&i.right!=null&&(this.right=s.ai(i.right,l.right,p)),this}getCenter(i,l){const p=s.aD((this.left+i-this.right)/2,0,i),y=s.aD((this.top+l-this.bottom)/2,0,l);return new s.P(p,y)}equals(i){return this.top===i.top&&this.bottom===i.bottom&&this.left===i.left&&this.right===i.right}clone(){return new Zc(this.top,this.bottom,this.left,this.right)}toJSON(){return{top:this.top,bottom:this.bottom,left:this.left,right:this.right}}}const el=15;class Bl{constructor(i,l,p,y,v,w,S){this.tileSize=512,this._renderWorldCopies=v===void 0||v,this._minZoom=i||0,this._maxZoom=l||22,this._minPitch=p??0,this._maxPitch=y??60,this.setProjection(w),this.setMaxBounds(S),this.width=0,this.height=0,this._center=new s.cd(0,0),this.zoom=0,this.angle=0,this._fov=.6435011087932844,this._pitch=0,this._nearZ=0,this._farZ=0,this._unmodified=!0,this._edgeInsets=new Zc,this._projMatrixCache={},this._alignedProjMatrixCache={},this._fogTileMatrixCache={},this._expandedProjMatrixCache={},this._distanceTileDataCache={},this._camera=new qr,this._centerAltitude=0,this._averageElevation=0,this.cameraElevationReference="ground",this._pixelsPerMercatorPixel=1,this.globeRadius=0,this.globeCenterInViewSpace=[0,0,0],this._tileCoverLift=0,this.freezeTileCoverage=!1,this._horizonShift=.1,this._orthographicProjectionAtLowPitch=!1,this._allowWorldUnderZoom=!1}clone(){const i=new Bl(this._minZoom,this._maxZoom,this._minPitch,this.maxPitch,this._renderWorldCopies,this.getProjection(),this.maxBounds);return i._elevation=this._elevation,i._centerAltitude=this._centerAltitude,i._centerAltitudeValidForE
vendor: 1,249 bytes, line 602
602xaggeration=this._centerAltitudeValidForExaggeration,i.tileSize=this.tileSize,i.mercatorFromTransition=this.mercatorFromTransition,i.width=this.width,i.height=this.height,i.cameraElevationReference=this.cameraElevationReference,i._center=this._center,i._setZoom(this.zoom),i._seaLevelZoom=this._seaLevelZoom,i.angle=this.angle,i._fov=this._fov,i._pitch=this._pitch,i._nearZ=this._nearZ,i._farZ=this._farZ,i._averageElevation=this._averageElevation,i._orthographicProjectionAtLowPitch=this._orthographicProjectionAtLowPitch,i._unmodified=this._unmodified,i._edgeInsets=this._edgeInsets.clone(),i._camera=this._camera.clone(),i._calcMatrices(),i.freezeTileCoverage=this.freezeTileCoverage,i.frustumCorners=this.frustumCorners,i._allowWorldUnderZoom=this._allowWorldUnderZoom,i}get isOrthographic(){return this.projection.name!=="globe"&&this._orthographicProjectionAtLowPitch&&this.pitch<el}get elevation(){return this._elevation}set elevation(i){this._elevation!==i&&(this._elevation=i,this._updateCameraOnTerrain(),this._calcMatrices())}get depthOcclusionForSymbolsAndCircles(){return this.projection.name!=="globe"&&!this.isOrthographic}updateElevation(i,l=!1){const p=this._elevation&&this._elevation.exaggeration()!==this._centerAltitudeValidForE
602xaggeration;(this._seaLevelZoom==null||p)&&this._updateCameraOnTerrain(),(i||p)&&this._constrainCamera(l),this._calcMatrices()}getProjection(){return s.aF(this.projection,["name","center","parallels"])}setProjection(i){this.projectionOptions=i||{name:"mercator"};const l=this.projection?this.getProjection():void 0;this.projection=s.ce(this.projectionOptions);const p=this.getProjection(),y=!s.bv(l,p);return y&&this._calcMatrices(),this.mercatorFromTransition=!1,y}setOrthographicProjectionAtLowPitch(i){return this._orthographicProjectionAtLowPitch!==i&&(this._orthographicProjectionAtLowPitch=i,this._calcMatrices(),!0)}setMercatorFromTransition(){const i=this.projection.name;this.mercatorFromTransition=!0,this.projectionOptions={name:"mercator"},this.projection=s.ce({name:"mercator"});const l=i!==this.projection.name;return l&&this._calcMatrices(),l}get minZoom(){return this._minZoom}set minZoom(i){this._minZoom!==i&&(this._minZoom=i,this.zoom=Math.max(this.zoom,i))}get maxZoom(){return this._maxZoom}set maxZoom(i){this._maxZoom!==i&&(this._maxZoom=i,this.zoom=Math.min(this.zoom,i))}get minPitch(){return this._minPitch}set minPitch(i){this._minPitch!==i&&(this._minPitch=i,this.pitch=Math.max(this.pitch,i))}get maxPitch(){return this._maxPitch}set maxPitch(i){this._maxPitch!==i&&(this._maxPitch=i,this.pitch=Math.min(this.pitch,i))}get renderWorldCopies(){return this._renderWorldCopies&&this.projection.supportsWorldCopies===!0}set renderWorldCopies(i){i===void 0?i=!0:i===null&&(i=!1),this._renderWorldCopies=i}get worldSize(){return this.tileSize*this.scale}get cameraWorldSizeForFog(){const i=Math.max(this._camera.getDistanceToElevation(this._averageElevation),Number.EPSILON);return this._worldSizeFromZoom(this._zoomFromMercatorZ(i))}get cameraWorldSize(){const i=Math.max(this._camera.getDistanceToElevation(this._averageElevation,!0),Number.EPSILON);return this._worldSizeFromZoom(this._zoomFromMercatorZ(i))}get pixelsPerMeter(){return this.projection.pixelsPerMeter(this.center.lat,this.worldSize)}get cameraPixelsPerMeter(){return s.c6(1,this.center.lat)*this.cameraWorldSizeForFog}get centerOffset(){return this.centerPoint._sub(this.size._div(2))}get size(){return new s.P(this.width,this.height)}get bearing(){return s.bX(this.rotation,-180,180)}set bearing(i){this.rotation=i}get rotation(){return-this.angle/Math.PI*180}set rotation(i){const l=-i*Math.PI/180;this.angle!==l&&(this._unmodified=!1,this.angle=l,this._calcMatrices(),this.rotationMatrix=s.cf(),s.cg(this.rotationMatrix,this.rotationMatrix,this.angle))}get pitch(){return this._pitch/Math.PI*180}set pitch(i){const l=s.aD(i,this.minPitch,this.maxPitch)/180*Math.PI;this._pitch!==l&&(this._unmodified=!1,this._pitch=l,this._calcMatrices())}get aspect(){return this.width/this.height}get fov(){return this._fov/Math.PI*180}set fov(i){i=Math.max(.01,Math.min(60,i)),this._fov!==i&&(this._unmodified=!1,this._fov=s.al(i),this._calcMatrices())}get fovX(){return this._fov}get fovY(){const i=1/Math.tan(.5*this.fovX);return 2*Math.atan(1/this.aspect/i)}get averageElevation(){return this._averageElevation}set averageElevation(i){this._averageElevation=i,this._calcFogMatrices(),this._distanceTileDataCache={}}get zoom(){return this._zoom}set zoom(i){const l=Math.min(Math.max(i,this.minZoom),this.maxZoom);this._zoom!==l&&(this._unmodified=!1,this._setZoom(l),this._updateSeaLevelZoom(),this._constrain(),this._calcMatrices())}_setZoom(i){this._zoom=i,this.scale=this.zoomScale(i),this.tileZoom=Math.floor(i),this.zoomFraction=i-this.tileZoom}get tileCoverLift(){return this._tileCoverLift}set tileCoverLift(i){this._tileCoverLift!==i&&(this._tileCoverLift=i)}_updateCameraOnTerrain(){const i=this.elevation?this.elevation.getAtPoint(this.locationCoordinate(this.center),Number.NEGATIVE_INFINITY):Number.NEGATIVE_INFINITY,l=this.elevation&&i===Number.NEGATIVE_INFINITY&&this.elevation.visibleDemTiles.length>0&&this.elevation.exaggeration()>
6020&&this._centerAltitudeValidForExaggeration;if(!this._elevation||i===Number.NEGATIVE_INFINITY&&(!l||!this._centerAltitude))return this._centerAltitude=0,this._seaLevelZoom=null,void(this._centerAltitudeValidForExaggeration=void 0);const p=this._elevation;l||this._centerAltitude&&this._centerAltitudeValidForExaggeration&&p.exaggeration()&&this._centerAltitudeValidForExaggeration!==p.exaggeration()?(this._centerAltitude=this._centerAltitude/this._centerAltitudeValidForExaggeration*p.exaggeration(),this._centerAltitudeValidForExaggeration=p.exaggeration()):(this._centerAltitude=i||0,this._centerAltitudeValidForExaggeration=p.exaggeration()),this._updateSeaLevelZoom()}_updateSeaLevelZoom(){this._centerAltitudeValidForExaggeration!==void 0&&(this._seaLevelZoom=this._zoomFromMercatorZ((this.pixelsPerMeter*this._centerAltitude+this.cameraToCenterDistance)/this.worldSize))}sampleAverageElevation(){if(!this._elevation)return 0;const i=this._elevation,l=[[.5,.2],[.3,.5],[.5,.5],[.7,.5],[.5,.8]],p=this.horizonLineFromTop();let y=0,v=0;for(let w=0;w<l.length;w++){const S=new s.P(l[w][0]*this.width,p+l[w][1]*(this.height-p)),C=i.pointCoordinate(S);if(!C)continue;const D=1/Math.hypot(C[0]-this._camera.position[0],C[1]-this._camera.position[1]);y+=C[3]*D,v+=D}return v===0?NaN:y/v}get center(){return this._center}set center(i){i.lat===this._center.lat&&i.lng===this._center.lng||(this._unmodified=!1,this._center=i,this._terrainEnabled()&&(this.cameraElevationReference==="ground"?this._updateCameraOnTerrain():this._updateZoomFromElevation()),this._constrain(),this._calcMatrices())}_updateZoomFromElevation(){if(this._seaLevelZoom==null||!this._elevation)return;const i=this._seaLevelZoom,l=this._elevation.getAtPointOrZero(this.locationCoordinate(this.center)),p=this.pixelsPerMeter/this.worldSize*l,y=this._mercatorZfromZoom(i),v=this._mercatorZfromZoom(this._maxZoom),w=Math.max(y-p,v);this._setZoom(this._zoomFromMercatorZ(w))}get padding(){return this._edgeInsets.toJSON()}set padding(i){this._edgeInsets.equals(i)||(this._unmodified=!1,this._edgeInsets.interpolate(this._edgeInsets,i,1),this._calcMatrices())}computeZoomRelativeTo(i){const l=this.rayIntersectionCoordinate(this.pointRayIntersection(this.centerPoint,i.toAltitude()));let p;p=i.z<this._camera.position[2]?[l.x,l.y,l.z]:[i.x,i.y,i.z];const y=s.ae(s.at([],this._camera.position,p));return s.aD(this._zoomFromMercatorZ(y),this._minZoom,this._maxZoom)}setFreeCameraOptions(i){if(!this.height||!i.position&&!i.orientation)return;this._updateCameraState();let l=!1;if(i.orientation&&!s.ch(i.orientation,this._camera.orientation)&&(l=this._setCameraOrientation(i.orientation)),i.position){const p=[i.position.x,i.position.y,i.position.z];s.ci(p,this._camera.position)||(this._setCameraPosition(p),l=!0)}l&&(this._updateStateFromCamera(),this.recenterOnTerrain())}getFreeCameraOptions(){this._updateCameraState();const i=this._camera.position,l=new jh;return l.position=new s.ac(i[0],i[1],i[2]),l.orientation=this._camera.orientation,l._elevation=this.elevation,l._renderWorldCopies=this.renderWorldCopies,l}_setCameraOrientation(i){if(!s.cj(i))return!1;s.ck(i,i);const l=s.cl([],[0,0,-1],i),p=s.cl([],[0,-1,0],i);if(p[2]<0)return!1;const y=jp(l,p);return!!y&&(this._camera.orientation=y,!0)}_setCameraPosition(i){const l=this.zoomScale(this.minZoom)*this.tileSize,p=this.zoomScale(this.maxZoom)*this.tileSize,y=this.cameraToCenterDistance;i[2]=s.aD(i[2],y/p,y/l),this._camera.position=i}get centerPoint(){return this._edgeInsets.getCenter(this.width,this.height)}get fovAboveCenter(){return this._fov*(.5+this.centerOffset.y/this.height)}isPaddingEqual(i){return this._edgeInsets.equals(i)}interpolatePadding(i,l,p){this._unmodified=!1,this._edgeInsets.interpolate(i,l,p),this._constrain(),this._calcMatrices()}coveringZoomLevel(i){const l=(i.roundZoom?Math.round:Math.floor)(this.zoom+this.scaleZoom(this.tileSize/i.tileSize));return Math.max(0,l)}getVisibleUnwrappedCoordinates(i){const l=[new s.cm(0,i)];if(this.renderWorldCopies){const p=this.pointCoordinate(new s.P(0,0)),y=this.pointCoordinate(new s.P(this.width,0)),v=this.pointCoordinate(new s.P(this.width,this.height)),w=this.pointCoordinate(new s.P(0,this.height)),S=Math.floor(Math.min(p.x,y.x,v.x,w.x)),C=Math.floor(Math.max(p.x,y.x,v.x,w.x)),D=1;for(let L=S-D;L<=C+D;L++)L!==0&&l.push(new s.cm(L,i))}return l}isLODDisabled(i){return(!i||this.pitch<=60)&&this._edgeInsets.top<=this._edgeInsets.bottom&&!this._elevation&&!this.projection.isReprojectedInTileSpace}extendTileCover(i,l,p){let y=[];const v=p!=null,w=!v;if(w&&this.zoom<l||v&&p[0]===0&&p[1]===0)return y;const S=new Set,C=(L,F,O,$,q)=>{const W=s.cK(F,L,O,$,q);S.has(W)||(y.push(new s.aM(L,F,O,$,q)),S.add(W))};for(let L=0;L<i.length;L++){const F=i[L];if(w&&F.canonical.z!==l)continue;
602const O=F.canonical,$=F.overscaledZ,q=F.wrap,W=1<<O.z,K=O.x+1<W,Z=O.x>0,se=O.y+1<W,ue=O.y>0,fe=F.wrap-(Z?0:1),xe=F.wrap+(K?0:1),_e=Z?O.x-1:W-1,ye=K?O.x+1:0;if(v)p[0]<0?(C($,xe,O.z,ye,O.y),p[1]<0&&se&&(C($,q,O.z,O.x,O.y+1),C($,xe,O.z,ye,O.y+1)),p[1]>0&&ue&&(C($,q,O.z,O.x,O.y-1),C($,xe,O.z,ye,O.y-1))):p[0]>0?(C($,fe,O.z,_e,O.y),p[1]<0&&se&&(C($,q,O.z,O.x,O.y+1),C($,fe,O.z,_e,O.y+1)),p[1]>0&&ue&&(C($,q,O.z,O.x,O.y-1),C($,fe,O.z,_e,O.y-1))):p[1]<0&&se?C($,q,O.z,O.x,O.y+1):ue&&C($,q,O.z,O.x,O.y-1);else{const pe=F.visibleQuadrants;1&pe&&(C($,fe,O.z,_e,O.y),ue&&(C($,q,O.z,O.x,O.y-1),C($,fe,O.z,_e,O.y-1))),2&pe&&(C($,xe,O.z,ye,O.y),ue&&(C($,q,O.z,O.x,O.y-1),C($,xe,O.z,ye,O.y-1))),4&pe&&(C($,fe,O.z,_e,O.y),se&&(C($,q,O.z,O.x,O.y+1),C($,fe,O.z,_e,O.y+1))),8&pe&&(C($,xe,O.z,ye,O.y),se&&(C($,q,O.z,O.x,O.y+1),C($,xe,O.z,ye,O.y+1)))}}const D=[];for(const L of y)y.some(F=>L.isChildOf(F))||D.push(L);if(y=D.filter(L=>!i.some(F=>!!(L.overscaledZ<l&&F.isChildOf(L))||L.equals(F)||L.isChildOf(F))),w){const L=1<<l,F=this.projection.name==="globe"?this._camera.mercatorPosition:this.pointCoordinate(this.getCameraPoint()),O=[L*F.x,L*F.y],$=4,q=$*$;y=y.filter(W=>{const K=W.canonical.x+.5-O[0],Z=W.canonical.y+.5-O[1];return K*K+Z*Z<q})}return y}coveringTiles(i){let l=this.coveringZoomLevel(i);const p=l,y=this.elevation&&this.elevation.exaggeration(),v=y&&!i.isTerrainDEM,w=this.projection.name==="mercator";if(i.minzoom!==void 0&&l<i.minzoom)return[];i.maxzoom!==void 0&&l>i.maxzoom&&(l=i.maxzoom);const S=this.locationCoordinate(this.center),C=this.center.lat,D=1<<l,L=[D*S.x,D*S.y,0],F=this.projection.name==="globe",O=!F,$=s.cn.fromInvProjectionMatrix(this.invProjMatrix,this.worldSize,l,O),q=F?this._camera.mercatorPosition:this.pointCoordinate(this.getCameraPoint()),W=D*s.c6(1,this.center.lat),K=this._camera.position[2]/s.c6(1,this.center.lat),Z=[D*q.x,D*q.y,K*(O?1:W)],se=F||y,ue=this.cameraToCenterDistance/i.tileSize*(i.roundZoom?1:.502),fe=this.isLODDisabled(!0)?l:0;let xe;if(this._elevation&&i.isTerrainDEM)xe=1e4*this._elevation.exaggeration();else if(this._elevation){const Re=this._elevation.getMinMaxForVisibleTiles();xe=Re?Re.max:this._centerAltitude}else xe=this._centerAltitude;const _e=i.isTerrainDEM?-xe:this._elevation?this._elevation.getMinElevationBelowMSL():0,ye=this.projection.isReprojectedInTileSpace?s.co(this):1,pe=Re=>{const Xe=new s.ac(Re.x+25e-6,Re.y,Re.z),gt=new s.ac(Re.x,Re.y+25e-6,Re.z),ct=Re.toLngLat(),yt=Xe.toLngLat(),xt=gt.toLngLat(),Qt=this.locationCoordinate(ct),ci=this.locationCoordinate(yt),Kt=this.locationCoordinate(xt),hi=Math.hypot(ci.x-Qt.x,ci.y-Qt.y),ni=Math.hypot(Kt.x-Qt.x,Kt.y-Qt.y);return Math.sqrt(hi*ni)*ye/25e-6},Se=Re=>{const ht=xe,Xe=_e;return{aabb:s.cr(this,D,0,0,0,Re,Xe,ht,this.projection),zoom:0,x:0,y:0,minZ:Xe,maxZ:ht,wrap:Re,fullyVisible:!1}},Ae=[];let Ge=[];const Ne=l,lt=i.reparseOverscaled?p:l,st=(K-this._centerAltitude)*W,Et=Re=>{if(!this._elevation||!Re.tileID||!w)return;const ht=this._elevation.getMinMaxForTile(Re.tileID),Xe=Re.aabb;ht?(Xe.min[2]=ht.min,Xe.max[2]=ht.max,Xe.center[2]=(Xe.min[2]+Xe.max[2])/2):(Re.shouldSplit=We(Re),Re.shouldSplit||(Xe.min[2]=Xe.max[2]=Xe.center[2]=this._centerAltitude))},Be=(Re,ht)=>{if(.707*ht<Re)return 1;const Xe=ht/Re;return Xe/(1.4144271570014144+(Math.pow(1.1,Xe-1.4144271570014144+1)-1)/(1.1-1)-1)},We=Re=>{if(Re.zoom<fe)return!0;if(Re.zoom===Ne)return!1;if(Re.shouldSplit!=null)return Re.shouldSplit;const ht=Re.aabb.distanceX(Z),Xe=Re.aabb.distanceY(Z);let gt=st,ct=1;if(F){gt=Re.aabb.distanceZ(Z);const ni=Math.pow(2,Re.zoom),bi=s.aY((Re.y+1)/ni),Vi=s.aY(Re.y/ni),un=Math.min(Math.max(C,bi),Vi),is=s.cP(un)/s.cP(C);if(ct=un===C?1/Math.max(1,this._mercatorScaleRatio-.3):Math.min(1,is/this._mercatorScaleRatio),this.zoom<=s.cL&&Re.zoom===Ne-1&&is>=.9)return!0}else if(v&&(gt=Re.aabb.distanceZ(Z)*W),this.projection.isReprojectedInTileSpace&&p<=5){const ni=Math.pow(2,Re.zoom),bi=pe(new s.ac((Re.x+.5)/ni,(Re.y+.5)/ni));ct=bi>.85?1:bi}if(!w){const ni=Math.sqrt(ht*ht+Xe*Xe+gt*gt);let bi=(1<<Ne-Re.zoom)*ue*ct;return bi*=Be(Math.max(gt,st),ni),ni<bi}let yt=Number.MAX_VALUE,xt=0;const Qt=Re.aabb.getCorners(),ci=[];for(const ni of Qt){s.at(ci,ni,Z),F||(v?ci[2]*=W:ci[2]=st);const bi=s.bE(ci,this._camera.forward());bi<yt&&(yt=bi,xt=Math.abs(ci[2]))}let Kt=(1<<Ne-Re.zoom)*ue*ct;if(Kt*=Be(Math.max(xt,st),yt),yt<Kt)return!0;const hi=Re.aabb.closestPoint(L);return hi[0]===L[0]&&hi[1]===L[1]};if(this.renderWorldCopies)for(let Re=1;Re<=3;Re++)Ae.push(Se(-Re)),Ae.push(Se(Re));for(Ae.push(Se(0));Ae.length>0;){const Re=Ae.pop(),ht=Re.x,Xe=Re.y;let gt=Re.fullyVisible;const ct=()=>this.projection.name==="globe"&&(Re.y===0||Re.y===(1<<Re.zoom)-1);if(!gt){let yt=se?Re.aabb.intersects($):Re.aabb.intersectsFlat($);if(yt===0&&ct()){const xt=new s.cp(Re.zoom,ht,Xe);yt=s.cq(this,D,xt,!0).intersects($)}if(yt===0)continue;gt=yt===2}if(Re.zoom!==Ne&&We(Re))for(let yt=0;yt<4;yt++){const xt=(ht<<1)+yt%2,Qt=(Xe<<1)+(yt>>1),ci={aabb:w?Re.aabb.quadrant(yt):s.cr(this,D,Re.zoom+1,xt,Qt,Re.wrap,Re.minZ,Re.maxZ,this.projection),zoom:Re.zoom+1,x:xt,y:Qt,wrap:Re.wrap,fullyVisible:gt,tileID:void 0,shouldSplit:void 0,minZ:Re.minZ,maxZ:Re.maxZ};v&&!F&&(ci.tileID=new s.aM(Re.zoom+1===Ne?lt:Re.zoom+1,Re.wrap,Re.zoom+1,xt,Qt),Et(ci)),Ae.push(ci)}else{const yt=Re.zoom===Ne?lt:Re.zoom;if(i.minzoom&&i.minzoom>yt)continue;let xt=0;if(!gt){let hi=se?Re.aabb.intersectsPrecise($):Re.aabb.intersectsPreciseFlat($);
602if(hi===0&&ct()){const ni=new s.cp(Re.zoom,ht,Xe);hi=s.cq(this,D,ni,!0).intersectsPrecise($)}if(hi===0)continue;if(i.calculateQuadrantVisibility)if($.containsPoint(Re.aabb.center))xt=15;else for(let ni=0;ni<4;ni++)Re.aabb.quadrant(ni).intersects($)!==0&&(xt|=1<<ni)}const Qt=L[0]-(.5+ht+(Re.wrap<<Re.zoom))*(1<<l-Re.zoom),ci=L[1]-.5-Xe,Kt=Re.tileID?Re.tileID:new s.aM(yt,Re.wrap,Re.zoom,ht,Xe);i.calculateQuadrantVisibility&&(Kt.visibleQuadrants=xt),Ge.push({tileID:Kt,distanceSq:Qt*Qt+ci*ci})}}if(this.fogCullDistSq){const Re=this.fogCullDistSq,ht=this.horizonLineFromTop();Ge=Ge.filter(Xe=>{const gt=[0,0,0,1],ct=[s.aj,s.aj,0,1],yt=this.calculateFogTileMatrix(Xe.tileID.toUnwrapped());s.aA(gt,gt,yt),s.aA(ct,ct,yt);const xt=s.cs([],gt,ct),Qt=s.ct([],gt,ct),ci=s.cM(xt,Qt);if(ci===0)return!0;let Kt=!1;const hi=this._elevation;if(hi&&ci>Re&&ht!==0){const ni=this.calculateProjMatrix(Xe.tileID.toUnwrapped());let bi;i.isTerrainDEM||(bi=hi.getMinMaxForTile(Xe.tileID)),bi||(bi={min:_e,max:xe});const Vi=s.cu(this.rotation),un=[Vi[0]*s.aj,Vi[1]*s.aj,bi.max];s.ad(un,un,ni),Kt=(1-un[1])*this.height*.5<ht}return ci<Re||Kt})}return Ge.sort((Re,ht)=>Re.distanceSq-ht.distanceSq).map(Re=>Re.tileID)}resize(i,l){this.width=i,this.height=l,this.pixelsToGLUnits=[2/i,-2/l],this._constrain(),this._calcMatrices()}get unmodified(){return this._unmodified}zoomScale(i){return Math.pow(2,i)}scaleZoom(i){return Math.log(i)/Math.LN2}project(i){const l=s.aD(i.lat,-s.cv,s.cv),p=this.projection.project(i.lng,l);return new s.P(p.x*this.worldSize,p.y*this.worldSize)}unproject(i){return this.projection.unproject(i.x/this.worldSize,i.y/this.worldSize)}get point(){return this.project(this.center)}get pointMerc(){return this.point._div(this.worldSize)}get pixelsPerMeterRatio(){return this.pixelsPerMeter/s.c6(1,this.center.lat)/this.worldSize}setLocationAtPoint(i,l){let p,y;const v=this.centerPoint;if(this.projection.name==="globe"){const S=this.worldSize;p=(l.x-v.x)/S,y=(l.y-v.y)/S}else{const S=this.pointCoordinate(l),C=this.pointCoordinate(v);p=S.x-C.x,y=S.y-C.y}const w=this.locationCoordinate(i);this.setLocation(new s.ac(w.x-p,w.y-y))}setLocation(i){this.center=this.coordinateLocation(i),this.projection.wrap&&(this.center=this.center.wrap())}locationPoint(i,l){return this.projection.locationPoint(this,i,l)}locationPoint3D(i,l){return this.projection.locationPoint(this,i,l,!0)}pointLocation(i){return this.coordinateLocation(this.pointCoordinate(i))}pointLocation3D(i,l){return this.coordinateLocation(this.pointCoordinate3D(i,l))}locationCoordinate(i,l){const p=l?s.c6(l,i.lat):void 0,y=this.projection.project(i.lng,i.lat);return new s.ac(y.x,y.y,p)}coordinateLocation(i){return this.projection.unproject(i.x,i.y)}pointRayIntersection(i,l){const p=l??this._centerAltitude,y=[i.x,i.y,0,1],v=[i.x,i.y,1,1];s.aA(y,y,this.pixelMatrixInverse),s.aA(v,v,this.pixelMatrixInverse);const w=v[3];s.cw(y,y,1/y[3]),s.cw(v,v,1/w);const S=y[2],C=v[2];return{p0:y,p1:v,t:S===C?0:(p-S)/(C-S)}}screenPointToMercatorRay(i){const l=[i.x,i.y,0,1],p=[i.x,i.y,1,1];return s.aA(l,l,this.pixelMatrixInverse),s.aA(p,p,this.pixelMatrixInverse),s.cw(l,l,1/l[3]),s.cw(p,p,1/p[3]),l[2]=s.c6(l[2],this._center.lat)*this.worldSize,p[2]=s.c6(p[2],this._center.lat)*this.worldSize,s.cw(l,l,1/this.worldSize),s.cw(p,p,1/this.worldSize),new s.av([l[0],l[1],l[2]],s.au([],s.at([],p,l)))}rayIntersectionCoordinate(i){const{p0:l,p1:p,t:y}=i,v=s.c6(l[2],this._center.lat),w=s.c6(p[2],this._center.lat);return new s.ac(s.ai(l[0],p[0],y)/this.worldSize,s.ai(l[1],p[1],y)/this.worldSize,s.ai(v,w,y))}pointCoordinate(i,l=this._centerAltitude){return this.projection.pointCoordinate(this,i.x,i.y,l)}pointCoordinate3D(i,l){if(!this.elevation)return this.pointCoordinate(i,l);let p=this.projection.pointCoordinate3D(this,i.x,i.y);if(p)return new s.ac(p[0],p[1],p[2]);let y=0,v=this.horizonLineFromTop();if(i.y>v)return this.pointCoordinate(i,l);const w=.02*v,S=i.clone();for(let C=0;C<10&&v-y>w;C++){S.y=s.ai(y,v,.66);const D=this.projection.pointCoordinate3D(this,S.x,S.y);D?(v=S.y,p=D):y=S.y}return p?new s.ac(p[0],p[1],p[2]):this.pointCoordinate(i)}isPointAboveHorizon(i){return this.projection.isPointAboveHorizon(this,i)}isPointOnSurface(i){if(i.y<0||i.y>this.height||i.x<0||i.x>this.width)return!1;if(this.elevation||this.zoom>=s.cx)return!this.isPointAboveHorizon(i);const l=this.pointCoordinate(i);return l.y>=0&&l.y<=1}_coordinatePoint(i,l){const p=l&&this.elevation?this.elevation.getAtPointOrZero(i,this._centerAltitude):this._centerAltitude,y=[i.x*this.worldSize,i.y*this.worldSize,p+i.toAltitude(),1];return s.aA(y,y,this.pixelMatrix),y[3]>
6020?new s.P(y[0]/y[3],y[1]/y[3]):new s.P(Number.MAX_VALUE,Number.MAX_VALUE)}_getBoundsNonRectangular(){const{top:i,left:l}=this._edgeInsets,p=this.height-this._edgeInsets.bottom,y=this.width-this._edgeInsets.right,v=this.pointLocation3D(new s.P(l,i)),w=this.pointLocation3D(new s.P(y,i)),S=this.pointLocation3D(new s.P(y,p)),C=this.pointLocation3D(new s.P(l,p));let D=Math.min(v.lng,w.lng,S.lng,C.lng),L=Math.max(v.lng,w.lng,S.lng,C.lng),F=Math.min(v.lat,w.lat,S.lat,C.lat),O=Math.max(v.lat,w.lat,S.lat,C.lat);const $=Math.pow(2,-this.zoom)/16*270,q=this.projection.name==="globe"?1:4,W=(K,Z,se,ue,fe)=>{const xe=(K+se)/2,_e=(Z+ue)/2,ye=new s.P(xe,_e),{lng:pe,lat:Se}=this.pointLocation3D(ye),Ae=Math.max(0,D-pe,F-Se,pe-L,Se-O);D=Math.min(D,pe),L=Math.max(L,pe),F=Math.min(F,Se),O=Math.max(O,Se),(fe<q||Ae>$)&&(W(K,Z,xe,_e,fe+1),W(xe,_e,se,ue,fe+1))};if(W(l,i,y,i,1),W(y,i,y,p,1),W(y,p,l,p,1),W(l,p,l,i,1),this.projection.name==="globe"){const[K,Z]=s.cy(this);K?(O=90,L=180,D=-180):Z&&(F=-90,L=180,D=-180)}return new s.aG(new s.cd(D,F),new s.cd(L,O))}_getBoundsRectangular(i,l){const{top:p,left:y}=this._edgeInsets,v=this.height-this._edgeInsets.bottom,w=this.width-this._edgeInsets.right,S=new s.P(y,p),C=new s.P(w,p),D=new s.P(w,v),L=new s.P(y,v);let F=this.pointCoordinate(S,i),O=this.pointCoordinate(C,i);const $=this.pointCoordinate(D,l),q=this.pointCoordinate(L,l),W=(K,Z)=>(Z.y-K.y)/(Z.x-K.x);return F.y>1&&O.y>=0?F=new s.ac((1-q.y)/W(q,F)+q.x,1):F.y<0&&O.y<=1&&(F=new s.ac(-q.y/W(q,F)+q.x,0)),O.y>1&&F.y>=0?O=new s.ac((1-$.y)/W($,O)+$.x,1):O.y<0&&F.y<=1&&(O=new s.ac(-$.y/W($,O)+$.x,0)),new s.aG().extend(this.coordinateLocation(F)).extend(this.coordinateLocation(O)).extend(this.coordinateLocation(q)).extend(this.coordinateLocation($))}_getBoundsRectangularTerrain(){const i=this.elevation;if(!i.visibleDemTiles.length||i.isUsingMockSource())return this._getBoundsRectangular(0,0);const l=i.visibleDemTiles.reduce((p,y)=>{if(y.dem){const v=y.dem.tree;p.min=Math.min(p.min,v.minimums[0]),p.max=Math.max(p.max,v.maximums[0])}return p},{min:Number.MAX_VALUE,max:0});return this._getBoundsRectangular(l.min*i.exaggeration(),l.max*i.exaggeration())}getBounds(){return this.projection.name==="mercator"||this.projection.name==="equirectangular"?this._terrainEnabled()?this._getBoundsRectangularTerrain():this._getBoundsRectangular(0,0):this._getBoundsNonRectangular()}horizonLineFromTop(i=!0){const l=this.height/2/Math.tan(this._fov/2)/Math.tan(Math.max(this._pitch,.1))-this.centerOffset.y,p=this.height/2-l*(1-this._horizonShift);return i?Math.max(0,p):p}getMaxBounds(){return this.maxBounds}setMaxBounds(i){this.maxBounds=i,this.minLat=-s.cv,this.maxLat=s.cv,this.minLng=-180,this.maxLng=180,i&&(this.minLat=i.getSouth(),this.maxLat=i.getNorth(),this.minLng=i.getWest(),this.maxLng=i.getEast(),this.maxLng<this.minLng&&(this.maxLng+=360)),this.worldMinX=s.ay(this.minLng)*this.tileSize,this.worldMaxX=s.ay(this.maxLng)*this.tileSize,this.worldMinY=s.aH(this.maxLat)*this.tileSize,this.worldMaxY=s.aH(this.minLat)*this.tileSize,this._constrain()}calculatePosMatrix(i,l){return this.projection.createTileMatrix(this,l,i)}calculateDistanceTileData(i){const l=i.key,p=this._distanceTileDataCache;if(p[l])return p[l];const y=i.canonical,v=1/this.height,w=this.cameraWorldSize,S=w/this.zoomScale(y.z),C=(y.x+Math.pow(2,y.z)*i.wrap)*S,D=y.y*S,L=this.point;L.x*=w/this.worldSize,L.y*=w/this.worldSize;const F=this.angle,O=Math.sin(-F),$=-Math.cos(-F);return p[l]={bearing:[O,$],center:[(L.x-C)*v,(L.y-D)*v],scale:S/s.aj*v},p[l]}calculateFogTileMatrix(i){const l=i.key,p=this._fogTileMatrixCache;if(p[l])return p[l];const y=this.projection.createTileMatrix(this,this.cameraWorldSizeForFog,i);return s.az(y,this.worldToFogMatrix,y),p[l]=new Float32Array(y),p[l]}calculateProjMatrix(i,l=!1,p=!1){const y=i.key;let v;if(v=p?this._expandedProjMatrixCache:l?this._alignedProjMatrixCache:this._projMatrixCache,v[y])return v[y];const w=this.calculatePosMatrix(i,this.worldSize);let S;return S=this.projection.isReprojectedInTileSpace?this.mercatorMatrix:p?this.expandedFarZProjMatrix:l?this.alignedProjMatrix:this.projMatrix,s.az(w,S,w),v[y]=new Float32Array(w),v[y]}calculatePixelsToTileUnitsMatrix(i){const l=i.tileID.key,p=this._pixelsToTileUnitsCache;if(p[l])return p[l];const y=s.cz(i,this);return p[l]=y,p[l]}customLayerMatrix(){return this.mercatorMatrix.slice()}globeToMercatorMatrix(){if(this.projection.name==="globe"){const i=1/this.worldSize,l=s.bn([],[i,i,i]);return s.az(l,l,this.globeMatrix),l}}recenterOnTerrain(){if(!this._elevation||this.projection.name==="globe")return;const i=this._elevation;this._updateCameraState();const l=s.c6(1,this._center.lat)*this.worldSize,p=this._computeCameraPosition(l),y=this._camera.forward(),v=s.c6(1,this._center.lat);p[2]/=v,y[2]/=v,s.au(y,y);const w=i.raycast(p,y,i.exaggeration());if(w){const S=s.bF([],p,y,w),C=new s.ac(S[0],S[1],s.c6(S[2],s.aY(S[1]))),D=(C.z+s.ae([C.x-p[0],C.y-p[1],C.z-p[2]*v]))*this._pixelsPerMercatorPixel;this._seaLevelZoom=this._zoomFromMercatorZ(D),this._centerAltitude=C.toAltitude(),this._center=this.coordinateLocation(C),this._updateZoomFromElevation(),this._constrain(),this._calcMatrices()}}_constrainCamera(i=!1){if(!this._elevation)return;const l=this._elevation,p=s.c6(1,this._center.lat)*this.worldSize,y=this._computeCameraPosition(p),v=l.getAtPointOrZero(new s.ac(...y)),w=this.pixelsPerMeter/this.worldSize*v,S=this._minimumHeightOverTerrain(),C=y[2]-w;if(C<=S)if(C<0||i){const D=this.locationCoordinate(this._center,this._centerAltitude),L=[y[0],y[1],D.z-y[2]],F=s.ae(L);L[2]-=(S-C)/this._pixelsPerMercatorPixel;const O=s.ae(L);if(O===0)return;s.b$(L,L,F/O*this._pixelsPerMercatorPixel),this._camera.position=[y[0],y[1],D.z*this._pixelsPerMercatorPixel-L[2]],this._updateStateFromCamera()}else this._isCameraConstrained=!0}_constrain(){if(!this.center||!this.width||!this.height||this._constraining)return;this._constraining=!0;const i=this.projection.name==="globe"||this.mercatorFromTransition;if(this.projection.isReprojectedInTileSpace||i){const O=this.center;return O.lat=s.aD(O.lat,this.minLat,this.maxLat),(this.maxBounds||!this.renderWorldCopies&&!i)&&(O.lng=s.aD(O.lng,this.minLng,this.maxLng)),this.center=O,void(this._constraining=!1)}const l=this._unmodified,{x:p,y}=this.point;let v=0,w=p,S=y;const C=this.width/2,D=this.height/2,L=this.worldMinY*this.scale,F=this.worldMaxY*this.scale;if(y-D<L&&(S=L+D),y+D>F&&(S=F-D),F-L<this.height&&(v=Math.max(v,this.height/(F-L)),S=(F+L)/2),this.maxBounds||!this._renderWorldCopies||!this.projection.wrap){const O=this.worldMinX*this.scale,$=this.worldMaxX*this.scale,q=this.worldSize/2-(O+$)/2;w=(p+q+this.worldSize)%this.worldSize-q,w-C<O&&(w=O+C),w+C>$&&(w=$-C),$-O<this.width&&(v=Math.max(v,this.width/($-O)),w=($+O)/2)}w===p&&S===y||this._allowWorldUnderZoom||(this.center=this.unproject(new s.P(w,S))),v&&!this._allowWorldUnderZoom&&(this.zoom+=this.scaleZoom(v)),this._constrainCamera(),this._unmodified=l,this._constraining=!1}_minZoomForBounds(){let i=Math.max(0,this.scaleZoom(this.height/(this.worldMaxY-this.worldMinY)));return this.maxBounds&&(i=Math.max(i,this.scaleZoom(this.width/(this.worldMaxX-this.worldMinX)))),i}_maxCameraBoundsDistance(){return this._mercatorZfromZoom(this._minZoomForBounds())}
602_calcMatrices(){if(!this.height)return;const i=this.centerOffset,l=this.projection.name==="globe",p=this.pixelsPerMeter;this.projection.name==="globe"&&(this._mercatorScaleRatio=s.c6(1,this.center.lat)/s.c6(1,s.cN));const y=s.cA(this.projection,this.zoom,this.width,this.height,1024);this._pixelsPerMercatorPixel=this.projection.pixelSpaceConversion(this.center.lat,this.worldSize,y),this.cameraToCenterDistance=.5/Math.tan(.5*this._fov)*this.height*this._pixelsPerMercatorPixel,this._updateCameraState(),this._farZ=this.projection.farthestPixelDistance(this),this._nearZ=this.height/50;const v=this.projection.zAxisUnit==="meters"?p:1,w=this._camera.getWorldToCamera(this.worldSize,v);let S;const C=this._camera.getCameraToClipPerspective(this._fov,this.width/this.height,this._nearZ,this._farZ);if(C[8]=2*-i.x/this.width,C[9]=2*i.y/this.height,this.isOrthographic){let Se=.5*this.height/Math.tan(this._fov/2)*1*Math.tan(.5*this._fov),Ae=Se*this.aspect,Ge=-Ae,Ne=-Se;Ae-=i.x,Ge-=i.x,Se+=i.y,Ne+=i.y,S=this._camera.getCameraToClipOrthographic(Ge,Ae,Ne,Se,this._nearZ,this._farZ),((lt,st,Et,Be)=>{for(let We=0;We<16;We++)lt[We]=s.ai(st[We],Et[We],Be)})(S,S,C,s.cO(this.pitch>=el?1:this.pitch/el))}else S=C;const D=s.cB([],C,w);let L=s.cB([],S,w);if(this.projection.isReprojectedInTileSpace){const Se=this.locationCoordinate(this.center),Ae=s.bx([]);s.bo(Ae,Ae,[Se.x*this.worldSize,Se.y*this.worldSize,0]),s.az(Ae,Ae,s.cC(this)),s.bo(Ae,Ae,[-Se.x*this.worldSize,-Se.y*this.worldSize,0]),s.az(L,L,Ae),s.az(D,D,Ae),this.inverseAdjustmentMatrix=s.cD(this)}else this.inverseAdjustmentMatrix=[1,0,0,1];if(this.mercatorMatrix=s.cE([],L,[this.worldSize,this.worldSize,this.worldSize/v,1]),this.projMatrix=L,this.invProjMatrix=s.bi(new Float64Array(16),this.projMatrix),l){const Se=this._camera.getCameraToClipPerspective(this._fov,this.width/this.height,this._nearZ,1/0);Se[8]=2*-i.x/this.width,Se[9]=2*i.y/this.height,this.expandedFarZProjMatrix=s.cB([],Se,w)}else this.expandedFarZProjMatrix=this.projMatrix;const F=s.bi([],S);this.frustumCorners=s.cF.fromInvProjectionMatrix(F,this.horizonLineFromTop(),this.height),this.cameraFrustum=s.cn.fromInvProjectionMatrix(this.invProjMatrix,this.worldSize,0,!l);const O=new Float32Array(16);s.bx(O),s.cE(O,O,[1,-1,1]),s.cG(O,O,this._pitch),s.by(O,O,this.angle);const $=s.c4(new Float32Array(16),this._fov,this.width/this.height,this._nearZ,this._farZ);this.starsProjMatrix=s.bw($);const q=(Math.PI/2-this._pitch)*(this.height/this._fov)*this._horizonShift;$[8]=2*-i.x/this.width,$[9]=2*(i.y+q)/this.height,this.skyboxMatrix=s.az(O,$,O);const W=this.point,K=W.x,Z=W.y,se=this.width%2/2,ue=this.height%2/2,fe=Math.cos(this.angle),xe=Math.sin(this.angle),_e=K-Math.round(K)+fe*se+xe*ue,ye=Z-Math.round(Z)+fe*ue+xe*se,pe=new Float64Array(L);if(s.bo(pe,pe,[_e>.5?_e-1:_e,ye>.5?ye-1:ye,0]),this.alignedProjMatrix=pe,L=s.bz(),s.cE(L,L,[this.width/2,-this.height/2,1]),s.bo(L,L,[1,-1,0]),this.labelPlaneMatrix=L,L=s.bz(),s.cE(L,L,[1,-1,1]),s.bo(L,L,[-1,-1,0]),s.cE(L,L,[2/this.width,2/this.height,1]),this.glCoordMatrix=L,this.pixelMatrix=s.az(new Float64Array(16),this.labelPlaneMatrix,D),this._calcFogMatrices(),this._distanceTileDataCache={},L=s.bi(new Float64Array(16),this.pixelMatrix),!L)throw new Error("failed to invert matrix");if(this.pixelMatrixInverse=L,this.projection.name==="globe"||this.mercatorFromTransition){this.globeMatrix=s.cH(this);const Se=[this.globeMatrix[12],this.globeMatrix[13],this.globeMatrix[14]];this.globeCenterInViewSpace=s.ad(Se,Se,w),this.globeRadius=this.worldSize/2/Math.PI-1}else this.globeMatrix=L;this._projMatrixCache={},this._alignedProjMatrixCache={},this._pixelsToTileUnitsCache={},this._expandedProjMatrixCache={}}_calcFogMatrices(){this._fogTileMatrixCache={};const i=this.cameraWorldSizeForFog,l=this.cameraPixelsPerMeter,p=this._camera.position,y=1/this.height/this._pixelsPerMercatorPixel,v=[i,i,l];s.b$(v,v,y),s.b$(p,p,-1),s.cI(p,p,v);const w=s.bz();s.bo(w,w,p),s.cE(w,w,v),this.mercatorFogMatrix=w,this.worldToFogMatrix=this._camera.getWorldToCameraPosition(i,l,y)}_computeCameraPosition(i){const l=(i=i||this.pixelsPerMeter)/this.pixelsPerMeter,p=this._camera.forward(),y=this.point,v=this._mercatorZfromZoom(this._seaLevelZoom?this._seaLevelZoom:this._zoom)*l-i/this.worldSize*this._centerAltitude;return[y.x/this.worldSize-p[0]*v,y.y/this.worldSize-p[1]*v,i/this.worldSize*this._centerAltitude-p[2]*v]}_updateCameraState(){this.height&&(this._camera.setPitchBearing(this._pitch,this.angle),this._camera.position=this._computeCameraPosition())}_translateCameraConstrained(i){const l=this._maxCameraBoundsDistance()*Math.cos(this._pitch),p=this._camera.position[2],y=i[2];let v=1;this.projection.wrap&&(this.center=this.center.wrap()),y>0&&(v=Math.min((l-p)/y,1)),this._camera.position=s.bF([],this._camera.position,i,v),this._updateStateFromCamera()}_updateStateFromCamera(){const i=this._camera.position,l=this._camera.forward(),{pitch:p,bearing:y}=this._camera.getPitchBearing(),v=s.c6(this._centerAltitude,this.center.lat)*this._pixelsPerMercatorPixel,w=this._mercatorZfromZoom(this._maxZoom)*Math.cos(s.al(this._maxPitch)),S=Math.max((i[2]-v)/Math.cos(p),w),C=this._zoomFromMercatorZ(S);s.bF(i,i,l,S),this._pitch=s.aD(p,s.al(this.minPitch),s.al(this.maxPitch)),this.angle=s.bX(y,-Math.PI,Math.PI),this._setZoom(s.aD(C,this._minZoom,this._maxZoom)),this._updateSeaLevelZoom(),this._center=this.coordinateLocation(new s.ac(i[0],i[1],i[2])),this._unmodified=!1,this._constrain(),this._calcMatrices()}_worldSizeFromZoom(i){return Math.pow(2,i)*this.tileSize}_mercatorZfromZoom(i){return this.cameraToCenterDistance/this._worldSizeFromZoom(i)}_minimumHeightOverTerrain(){const i=Math.min(this._seaLevelZoom!=null?this._seaLevelZoom:this._zoom,this._maxZoom)+4;return this._mercatorZfromZoom(i)}_zoomFromMercatorZ(i){return this.scaleZoom(this.cameraToCenterDistance/(i*this.tileSize))}zoomFromMercatorZAdjusted(i){let l=0,p=s.cx,y=0,v=1/0;for(;p-l>1e-6&&p>l;){const w=l+.5*(p-l),S=this.tileSize*Math.pow(2,w),C=this.getCameraToCenterDistance(this.projection,w,S),D=this.scaleZoom(C/(i*this.tileSize)),L=Math.abs(w-D);L<v&&(v=L,y=w),w<D?l=w:p=w}return y}_terrainEnabled(){return!(!this._elevation||!this.projection.supportsTerrain&&(s.w("Terrain is not yet supported with alternate projections. Use mercator or globe to enable terrain."),1))}anyCornerOffEdge(i,l){const p=Math.min(i.x,l.x),y=Math.max(i.x,l.x),v=Math.min(i.y,l.y),w=Math.max(i.y,l.y);if(v<this.horizonLineFromTop(!1))return!0;
602if(this.projection.name!=="mercator")return!1;const S=[new s.P(p,v),new s.P(y,w),new s.P(p,w),new s.P(y,v)],C=this.renderWorldCopies?-3:0,D=this.renderWorldCopies?4:1;for(const L of S){const F=this.pointRayIntersection(L);if(F.t<0)return!0;const O=this.rayIntersectionCoordinate(F);if(O.x<C||O.y<0||O.x>D||O.y>1)return!0}return!1}isHorizonVisible(){return this.pitch+s.cJ(this.fovAboveCenter)>88||this.anyCornerOffEdge(new s.P(0,0),new s.P(this.width,this.height))}zoomDeltaToMovement(i,l){const p=s.ae(s.at([],this._camera.position,i)),y=this._zoomFromMercatorZ(p)+l;return p-this._mercatorZfromZoom(y)}getCameraPoint(){if(this.projection.name==="globe"){const i=function([l,p,y],v){const w=[l,p,y,1];s.aA(w,w,v);const S=w[3]=Math.max(w[3],1e-6);return w[0]/=S,w[1]/=S,w[2]/=S,w}([this.globeMatrix[12],this.globeMatrix[13],this.globeMatrix[14]],this.pixelMatrix);return new s.P(i[0],i[1])}{const i=Math.tan(this._pitch)*(this.cameraToCenterDistance||1);return this.centerPoint.add(new s.P(0,i))}}getCameraToCenterDistance(i,l=this.zoom,p=this.worldSize){const y=s.cA(i,l,this.width,this.height,1024),v=i.pixelSpaceConversion(this.center.lat,p,y);let w=.5/Math.tan(.5*this._fov)*this.height*v;return this.isOrthographic&&(w=s.ai(1,w,s.cO(this.pitch>=el?1:this.pitch/el))),w}getWorldToCameraMatrix(){const i=this._camera.getWorldToCamera(this.worldSize,this.projection.zAxisUnit==="meters"?this.pixelsPerMeter:1);return this.projection.name==="globe"&&s.az(i,i,this.globeMatrix),i}getFrustum(i){return s.cn.fromInvProjectionMatrix(this.invProjMatrix,this.worldSize,i,this.projection.zAxisUnit==="meters")}}const Nl=(f,i)=>{if(i>0&&f.terrain&&s.w("Cutoff is currently disabled on terrain"),i<=0||f.terrain)return{shouldRenderCutoff:!1,uniformValues:{u_cutoff_params:[0,0,0,1]}};const l=f.transform,p=Math.max(Math.abs(l._zoom-(f.minCutoffZoom-1)),1),y=l.isLODDisabled(!1)?s.af(60,45,l.pitch):s.af(30,15,l.pitch),v=l._farZ-l._nearZ,w=i*l.height,S=((1-(C=y))*l.cameraToCenterDistance+C*(l._farZ+w))*p;var C;return{shouldRenderCutoff:y<1,uniformValues:{u_cutoff_params:[l._nearZ,l._farZ,(S-l._nearZ)/v,(S-w-l._nearZ)/v]}}},Br={cascadeCount:2,normalOffset:3,shadowMapResolution:2048};class Xc{constructor(i,l){this.aabb=i,this.lastCascade=l}}class mc{add(i,l){const p=this.receivers[i.key];p!==void 0?(p.aabb.min[0]=Math.min(p.aabb.min[0],l.min[0]),p.aabb.min[1]=Math.min(p.aabb.min[1],l.min[1]),p.aabb.min[2]=Math.min(p.aabb.min[2],l.min[2]),p.aabb.max[0]=Math.max(p.aabb.max[0],l.max[0]),p.aabb.max[1]=Math.max(p.aabb.max[1],l.max[1]),p.aabb.max[2]=Math.max(p.aabb.max[2],l.max[2])):this.receivers[i.key]=new Xc(l,null)}clear(){this.receivers={}}get(i){return this.receivers[i.key]}computeRequiredCascades(i,l,p){const y=s.cV.fromPoints(i.points);let v=0;for(const w in this.receivers){const S=this.receivers[w];if(!S||!y.intersectsAabb(S.aabb))continue;S.aabb.min=y.closestPoint(S.aabb.min),S.aabb.max=y.closestPoint(S.aabb.max);const C=S.aabb.getCorners();for(let D=0;D<p.length;D++){let L=!0;for(const F of C){const O=[F[0]*l,F[1]*l,F[2]];if(s.ad(O,O,p[D].matrix),O[0]<-1||O[0]>1||O[1]<-1||O[1]>1){L=!1;break}}if(S.lastCascade=D,v=Math.max(v,D),L)break}}return v+1}}class Qo{constructor(i){this.painter=i,this._enabled=!1,this._shadowLayerCount=0,this._numCascadesToRender=0,this._cascades=[],this._groundShadowTiles=[],this._receivers=new mc,this._depthMode=new Gt(i.context.gl.LEQUAL,Gt.ReadWrite,[0,1]),this._uniformValues={u_light_matrix_0:new Float32Array(16),u_light_matrix_1:new Float32Array(16),u_shadow_intensity:0,u_fade_range:[0,0],u_shadow_normal_offset:[1,1,1],u_shadow_texel_size:1,u_shadow_map_resolution:1,u_shadow_direction:[0,0,1],u_shadow_bias:[36e-5,.0012,.012],u_shadowmap_0:0,u_shadowmap_1:0},this._forceDisable=!1,this.useNormalOffset=!1,i.tp.registerParameter(this,["Shadows"],"_forceDisable",{label:"forceDisable"},()=>{this.painter.style.map.triggerRepaint()}),i.tp.registerParameter(Br,["Shadows"],"cascadeCount",{min:1,max:2,step:1}),i.tp.registerParameter(Br,["Shadows"],"normalOffset",{min:0,max:10,step:.05}),i.tp.registerParameter(Br,["Shadows"],"shadowMapResolution",{min:32,max:2048,step:32}),i.tp.registerBinding(this,["Shadows"],"_numCascadesToRender",{readonly:!0,label:"numCascadesToRender"})}destroy(){for(const i of this._cascades)i.texture.destroy(),i.framebuffer.destroy();this._cascades=[]}updateShadowParameters(i,l){const p=this.painter;if(this._enabled=!1,this._shadowLayerCount=0,this._receivers.clear(),!l||!l.properties)return;const y=l.properties.get("shadow-intensity");if(!l.shadowsEnabled()||y<=0||(this._shadowLayerCount=p.style.order.reduce((q,W)=>{const K=p.style._mergedLayers[W];return q+(K.hasShadowPass()&&!K.isHidden(i.zoom)?1:0)},0),this._enabled=this._shadowLayerCount>0,!this.enabled))return;const v=p.context,w=Br.shadowMapResolution,S=Br.shadowMapResolution;if(this._cascades.length===0||Br.shadowMapResolution!==this._cascades[0].texture.size[0]){this._cascades=[];for(let q=0;q<Br.cascadeCount;++q){const W=p._shadowMapDebug,K=v.gl,Z=v.createFramebuffer(w,S,W,"texture"),se=new s.T(v,{width:w,height:S,data:null},K.DEPTH_COMPONENT16);if(Z.depthAttachment.set(se.texture),W){const ue=new s.T(v,{width:w,height:S,data:null},K.RGBA8);Z.colorAttachment.set(ue.texture)}this._cascades.push({framebuffer:Z,texture:se,matrix:[],far:0,boundingSphereRadius:0,frustum:new s.cn,scale:0})}}this.shadowDirection=mf(l);let C=0;if(i.elevation){const q=i.elevation,W=[1e4,-1e4];q.visibleDemTiles.filter(K=>K.dem).forEach(K=>{const Z=K.dem.tree;W[0]=Math.min(W[0],Z.minimums[0]),W[1]=Math.max(W[1],Z.maximums[0])}),W[0]!==1e4&&(C=(W[1]-W[0])*q.exaggeration())}const D=1.5*i.cameraToCenterDistance,L=3*D,F=new Float64Array(16);for(let q=0;q<this._cascades.length;++q){const W=this._cascades[q];let K=i.height/50,Z=1;Br.cascadeCount===1?Z=L:q===0?Z=D:(K=D,Z=L);const[se,ue]=Uh(i,this.shadowDirection,K,Z,Br.shadowMapResolution,C);W.scale=i.scale,W.matrix=se,W.boundingSphereRadius=ue,s.bi(F,W.matrix),W.frustum=s.cn.fromInvProjectionMatrix(F,1,0,!0),W.far=Z}const O=this._cascades.length-1;this._uniformValues.u_fade_range=[.75*this._cascades[O].far,this._cascades[O].far],this._uniformValues.u_shadow_intensity=y,this._uniformValues.u_shadow_direction=[this.shadowDirection[0],this.shadowDirection[1],this.shadowDirection[2]],this._uniformValues.u_shadow_texel_size=1/Br.shadowMapResolution,this._uniformValues.u_shadow_map_resolution=Br.shadowMapResolution,this._uniformValues.u_shadowmap_0=mo.ShadowMap0,this._uniformValues.u_shadowmap_1=mo.ShadowMap0+1,this._groundShadowTiles=p.transform.coveringTiles({tileSize:512,renderWorldCopies:!0});const $=p.transform.elevation;for(const q of this._groundShadowTiles){let W={min:0,max:0};if($){const K=$.getMinMaxForTile(q);K&&(W=K)}this.addShadowReceiver(q.toUnwrapped(),W.min,W.max)}}get enabled(){return this._enabled&&!this._forceDisable}set enabled(i){this._enabled=i}drawShadowPass(i,l){if(!this.enabled)return;const p=this.painter,y=p.context;this._numCascadesToRender=this._receivers.computeRequiredCascades(p.transform.getFrustum(0),p.transform.worldSize,this._cascades),y.viewport.set([0,0,Br.shadowMapResolution,Br.shadowMapResolution]);for(let v=0;v<this._numCascadesToRender;++v){p.currentShadowCascade=v,y.bindFramebuffer.set(this._cascades[v].framebuffer.framebuffer),y.clear({color:s.am.white,depth:1});for(const w of i.order){const S=i._mergedLayers[w];if(!S.hasShadowPass()||S.isHidden(p.transform.zoom))continue;const C=i.getLayerSourceCache(S),D=C?l[C.id]:void 0;(S.type==="model"||D&&D.length)&&p.renderLayer(p,C,S,D)}}p.currentShadowCascade=0}drawGroundShadows(){if(!this.enabled)return;const i=this.painter,l=i.style,p=i.context,y=l.directionalLight,v=l.ambientLight;if(!y||!v)return;const w=[],S=Nl(i,i.longestCutoffRange);S.shouldRenderCutoff&&w.push("RENDER_CUTOFF"),w.push("RENDER_SHADOWS","DEPTH_TEXTURE"),this.useNormalOffset&&w.push("NORMAL_OFFSET");const C=va(l,y,v),D=new Gt(p.gl.LEQUAL,Gt.ReadOnly,i.depthRangeFor3D);for(const L of this._groundShadowTiles){const F=L.toUnwrapped(),O=i.isTileAffectedByFog(L),$=i.getOrCreateProgram("groundShadow",{defines:w,overrideFog:O});this.setupShadows(F,$),i.uploadCommonUniforms(p,$,F,null,S);const q={u_matrix:i.transform.calculateProjMatrix(F),u_ground_shadow_factor:C};$.draw(i,p.gl.TRIANGLES,D,Ii.disabled,en.multiply,Di.disabled,q,"ground_shadow",i.tileExtentBuffer,i.quadTriangleIndexBuffer,i.tileExtentSegments,null,i.transform.zoom,null,null)}}getShadowPassColorMode(){return this.painter._shadowMapDebug?en.unblended:en.disabled}getShadowPassDepthMode(){return this._depthMode}getShadowCastingLayerCount(){return this._shadowLayerCount}calculateShadowPassMatrixFromTile(i){const l=this.painter.transform,p=l.calculatePosMatrix(i,l.worldSize);return s.az(p,this._cascades[this.painter.currentShadowCascade].matrix,p),Float32Array.from(p)}
602calculateShadowPassMatrixFromMatrix(i){return s.az(i,this._cascades[this.painter.currentShadowCascade].matrix,i),Float32Array.from(i)}setupShadows(i,l,p,y=0){if(!this.enabled)return;const v=this.painter.transform,w=this.painter.context,S=w.gl,C=this._uniformValues,D=new Float64Array(16),L=v.calculatePosMatrix(i,v.worldSize);for(let F=0;F<this._cascades.length;F++)s.az(D,this._cascades[F].matrix,L),C[F===0?"u_light_matrix_0":"u_light_matrix_1"]=Float32Array.from(D),w.activeTexture.set(S.TEXTURE0+mo.ShadowMap0+F),this._cascades[F].texture.bind(S.NEAREST,S.CLAMP_TO_EDGE);if(this.useNormalOffset=!!p,this.useNormalOffset){const F=s.cT(i.canonical),O=2/v.tileSize*s.aj/Br.shadowMapResolution,$=O*this._cascades[0].boundingSphereRadius,q=O*this._cascades[this._cascades.length-1].boundingSphereRadius,W=(p==="vector-tile"?1:3)/Math.pow(2,y-i.canonical.z-(1-v.zoom+Math.floor(v.zoom)));C.u_shadow_normal_offset=[F,$*W,q*W],C.u_shadow_bias=[6e-5,.0012,.012]}else C.u_shadow_bias=[36e-5,.0012,.012];l.setShadowUniformValues(w,C)}setupShadowsFromMatrix(i,l,p=!1){if(!this.enabled)return;const y=this.painter.context,v=y.gl,w=this._uniformValues,S=new Float64Array(16);for(let C=0;C<Br.cascadeCount;C++)s.az(S,this._cascades[C].matrix,i),w[C===0?"u_light_matrix_0":"u_light_matrix_1"]=Float32Array.from(S),y.activeTexture.set(v.TEXTURE0+mo.ShadowMap0+C),this._cascades[C].texture.bind(v.NEAREST,v.CLAMP_TO_EDGE);if(this.useNormalOffset=p,p){const C=Br.normalOffset;w.u_shadow_normal_offset=[1,C,C],w.u_shadow_bias=[6e-5,.0012,.012]}else w.u_shadow_bias=[36e-5,.0012,.012];l.setShadowUniformValues(y,w)}getShadowUniformValues(){return this._uniformValues}getCurrentCascadeFrustum(){return this._cascades[this.painter.currentShadowCascade].frustum}computeSimplifiedTileShadowVolume(i,l,p,y){if(y[2]>=0)return{};const v=function(C,D,L){const F=L/(1<<C.canonical.z);return new s.cV([C.canonical.x*F+C.wrap*L,C.canonical.y*F+C.wrap*L,0],[(C.canonical.x+1)*F+C.wrap*L,(C.canonical.y+1)*F+C.wrap*L,D])}(i,l,p).getCorners(),w=l/-y[2];y[0]<0?(s.cU(v[0],v[0],[y[0]*w,0,0]),s.cU(v[3],v[3],[y[0]*w,0,0])):y[0]>0&&(s.cU(v[1],v[1],[y[0]*w,0,0]),s.cU(v[2],v[2],[y[0]*w,0,0])),y[1]<0?(s.cU(v[0],v[0],[0,y[1]*w,0]),s.cU(v[1],v[1],[0,y[1]*w,0])):y[1]>0&&(s.cU(v[2],v[2],[0,y[1]*w,0]),s.cU(v[3],v[3],[0,y[1]*w,0]));const S={};return S.vertices=v,S.planes=[tl(v[1],v[0],v[4]),tl(v[2],v[1],v[5]),tl(v[3],v[2],v[6]),tl(v[0],v[3],v[7])],S}addShadowReceiver(i,l,p){this._receivers.add(i,s.cV.fromTileIdAndHeight(i,l,p))}getMaxCascadeForTile(i){const l=this._receivers.get(i);return l&&l.lastCascade?l.lastCascade:0}}function tl(f,i,l){const p=s.at([],l,i),y=s.at([],f,i),v=s.bG([],p,y),w=s.ae(v);return w===0?[0,0,1,0]:(s.b$(v,v,1/w),[v[0],v[1],v[2],-s.bE(v,i)])}function mf(f){const i=f.properties.get("direction"),l=s.cR(i.x,i.y,i.z);l[2]=s.aD(l[2],0,75);const p=s.cW([l[0],l[1],l[2]]);return s.cS(p.x,p.y,p.z)}function va(f,i,l){const p=i.properties.get("color-use-theme")==="none",y=i.properties.get("color"),v=i.properties.get("intensity"),w=i.properties.get("direction"),S=[w.x,w.y,w.z],C=l.properties.get("color-use-theme")==="none",D=l.properties.get("color"),L=l.properties.get("intensity"),F=Math.max(s.bE([0,0,1],S),0),O=[0,0,0];s.b$(O,D.toRenderColor(C?null:f.getLut(i.scope)).toArray01Linear().slice(0,3),L);const $=[0,0,0];return s.b$($,y.toRenderColor(p?null:f.getLut(l.scope)).toArray01Linear().slice(0,3),F*v),s.cX([O[0]>0?O[0]/(O[0]+$[0]):0,O[1]>0?O[1]/(O[1]+$[1]):0,O[2]>0?O[2]/(O[2]+$[2]):0])}function Uh(f,i,l,p,y,v){const w=f.zoom,S=f.scale,C=f.worldSize,D=1/C,L=f.aspect,F=Math.sqrt(1+L*L)*Math.tan(.5*f.fovX),O=F*F,$=p-l,q=p+l;let W,K;O>$/q?(W=p,K=p*F):(W=.5*q*(1+O),K=.5*Math.sqrt($*$+2*(p*p+l*l)*O+q*q*O*O));const Z=f.projection.pixelsPerMeter(f.center.lat,C),se=f._camera.getCameraToWorldMercator(),ue=[0,0,-W*D];s.ad(ue,ue,se);let fe=K*D;const xe=f._edgeInsets;if(!(xe.left===0&&xe.top===0&&xe.right===0&&xe.bottom===0||xe.left===xe.right&&xe.top===xe.bottom)){const gt=f._camera.getWorldToCamera(f.worldSize,f.projection.zAxisUnit==="meters"?Z:1),ct=f._camera.getCameraToClipPerspective(f._fov,f.width/f.height,l,p);ct[8]=2*-f.centerOffset.x/f.width,ct[9]=2*f.centerOffset.y/f.height;const yt=new Float64Array(16);s.cB(yt,ct,gt);const xt=new Float64Array(16);s.bi(xt,yt);const Qt=s.cn.fromInvProjectionMatrix(xt,C,w,!0);for(const ci of Qt.points){const Kt=((_e=ci)[0]/=S,_e[1]/=S,_e[2]=s.c6(_e[2],f._center.lat),_e);fe=Math.max(fe,s.c0(s.cY([],ue,Kt)))}}var _e;fe*=y/(y-1);const ye=Math.acos(i[2]),pe=Math.atan2(-i[0],-i[1]),Se=new qr;Se.position=ue,Se.setPitchBearing(ye,pe);const Ae=Se.getWorldToCamera(C,Z),Ge=fe*C,Ne=Math.min(f._mercatorZfromZoom(17)*C*-2,-2*Ge),lt=Se.getCameraToClipOrthographic(-Ge,Ge,-Ge,Ge,Ne,(Ge+v*Z)/i[2]),st=new Float64Array(16);s.az(st,lt,Ae);const Et=s.cS(Math.floor(1e6*ue[0])/1e6*C,Math.floor(1e6*ue[1])/1e6*C,0),Be=.5*y,We=[0,0,0];s.ad(We,Et,st),s.b$(We,We,Be);const Re=[Math.floor(We[0]),Math.floor(We[1]),Math.floor(We[2])],ht=[0,0,0];s.at(ht,We,Re),s.b$(ht,ht,-1/Be);const Xe=new Float64Array(16);return s.bx(Xe),s.bo(Xe,Xe,ht),s.az(st,Xe,st),[st,Ge]}class Vl extends s.E{constructor(i){super(),this.requestManager=i,this.models={"":{}},this.modelUris={"":{}},this.modelByURL={},this.numModelsLoading={}}loadModel(i,l){return s.aS(this.requestManager.transformRequest(l,s.R.Model).url).then(p=>{if(!p)return;const y=s.aT(p),v=new s.aU(i,void 0,void 0,y);return v.computeBoundsAndApplyParent(),v}).catch(p=>{if(p&&p.status===404)return null;this.fire(new s.z(new Error(`Could not load model ${i} from ${l}: ${p.message}`)))})}load(i,l,p={forceReload:!1}){this.models[l]||(this.models[l]={});const y=Object.keys(i),v=[],w=[];for(const S of y){const C=i[S];this.hasURLBeenRequested(C)&&!p.forceReload||(this.modelByURL[C]={modelId:S,scope:l},v.push(this.loadModel(S,C)),w.push(S)),this.models[l][S]||(this.models[l][S]={model:null,numReferences:1})}this.numModelsLoading[l]=(this.numModelsLoading[l]||0)+w.length,Promise.allSettled(v).then(S=>{for(let C=0;C<S.length;C++){const{status:D}=S[C];if(D==="rejected")continue;const{value:L}=S[C];this.models[l][w[C]]||(this.models[l][w[C]]={model:null,numReferences:1}),this.models[l][w[C]].model=L}this.numModelsLoading[l]-=w.length,this.fire(new s.A("data",{dataType:"style"}))}).catch(S=>{this.fire(new s.z(new Error(`Could not load models: ${S.message}`)))})}isLoaded(){for(const i in this.numModelsLoading)if(this.numModelsLoading[i]>0)return!1;return!0}hasModel(i,l,p={exactIdMatch:!1}){return!!(p.exactIdMatch?this.getModel(i,l):this.getModelByURL(this.modelUris[l][i]))}getModel(i,l){return this.models[l]||(this.models[l]={}),this.models[l][i]?this.models[l][i].model:void 0}getModelByURL(i){if(!i)return null;const l=this.modelByURL[i];return l?this.models[l.scope][l.modelId].model:null}hasModelBeenAdded(i,l){return this.models[l]&&this.models[l][i]!==void 0}getModelURIs(i){return this.modelUris[i]||{}}addModel(i,l,p){this.models[p]||(this.models[p]={}),this.modelUris[p]||(this.modelUris[p]={});const y=this.requestManager.normalizeModelURL(l);if((this.hasModel(i,p,{exactIdMatch:!0})||this.hasModelBeenAdded(i,p))&&this.modelUris[p][i]===y)this.models[p][i].numReferences++;else if(this.hasURLBeenRequested(y)){const{scope:v,modelId:w}=this.modelByURL[y];this.models[v][w].numReferences++}else this.modelUris[p][i]=y,this.load({[i]:this.modelUris[p][i]},p)}addModelURLs(i,l){this.models[l]||(this.models[l]={}),this.modelUris[l]||(this.modelUris[l]={});const p=this.modelUris[l];for(const y in i)p[y]=this.requestManager.normalizeModelURL(i[y])}
602reloadModels(i){this.load(this.modelUris[i],i,{forceReload:!0})}addModelsFromBucket(i,l){this.models[l]||(this.models[l]={}),this.modelUris[l]||(this.modelUris[l]={});const p={};for(const y of i)this.hasModel(y,l,{exactIdMatch:!0})||this.hasURLBeenRequested(y)?this.models[l][y].numReferences++:this.modelUris[l][y]&&!this.hasURLBeenRequested(y)?p[y]=this.modelUris[l][y]:!this.hasURLBeenRequested(y)&&s.cZ(y,!1)&&(this.modelUris[l][y]=this.requestManager.normalizeModelURL(y),p[y]=this.modelUris[l][y]);this.load(p,l)}hasURLBeenRequested(i){return this.modelByURL[i]!==void 0}removeModel(i,l,p=!1){if(this.models[l]&&this.models[l][i]&&(this.models[l][i].numReferences--,this.models[l][i].numReferences===0)){const y=this.modelUris[l][i];p||delete this.modelUris[l][i],delete this.modelByURL[y];const v=this.models[l][i].model;if(!v)return;delete this.models[l][i],v.destroy()}}destroy(){for(const i of Object.keys(this.models))for(const l of Object.keys(this.models[i])){const p=this.models[i][l].model;delete this.models[i][l],p&&p.destroy()}this.models={"":{}},this.modelUris={"":{}},this.modelByURL={},this.numModelsLoading={}}listModels(i){return this.models[i]||(this.models[i]={}),Object.keys(this.models[i])}upload(i,l){this.models[l]||(this.models[l]={});for(const p in this.models[l])this.models[l][p].model&&this.models[l][p].model.upload(i.context)}}const Eg=new s.a7({data:new s.a8(s.a5.colorTheme.data)}),Ag={"mbx-indoor-active-floorplans":{default:["literal",[]]},"mbx-indoor-underground":{default:["literal",!1]},"mbx-indoor-loaded-levels":{default:["literal",[]]},"mbx-indoor-level-height":{default:["literal",{}]},"mbx-indoor-level-base":{default:["literal",{}]},"mbx-indoor-level-selected":{default:["literal",{}]},"mbx-indoor-level-overlapped":{default:["literal",{}]}};function Up(f){return f=f||{},Object.assign(f,Ag)}class Hp extends s.E{constructor(i){super(),this.mergeFloors=!0,this._scope=void 0,this._queryFeatureSetId=void 0,this._buildingEntryFeatureSetId=void 0,this._selectedFloorplan=void 0,this._indoorData=void 0,this._selectedLevel=void 0,this._floorplanStates={},s.aV(["_onLoad","_onMove","_checkFloorplanVisible"],this),this._map=i,this._checkFloorplanVisible(!0),this._map.on("load",this._onLoad),this._map.on("move",this._onMove)}destroy(){this._map.indoor.off("load",this._onLoad),this._map.indoor.off("move",this._onMove),this._map=void 0}_onLoad(){this._map.style.forEachFragmentStyle(i=>{i.stylesheet.indoor&&(this._queryFeatureSetId?this.fire(new s.z(new Error("Multiple indoor map styles detected, simultaneous usage is not allowed currently."))):(this._queryFeatureSetId=i.stylesheet.indoor.floorplanFeaturesetId,this._buildingEntryFeatureSetId=i.stylesheet.indoor.buildingFeaturesetId,this._scope=i.scope))}),this._queryFeatureSetId&&this._buildingEntryFeatureSetId&&this._map.addInteraction("mbx-indoor-buildingclick",{type:"click",target:{featuresetId:this._buildingEntryFeatureSetId,importId:this._scope},handler:i=>(i.feature&&i.feature.properties.floorplan&&this.selectFloorplan(i.feature.properties.floorplan),!0)}),this._checkFloorplanVisible(!0)}_onMove(){this._checkFloorplanVisible(!1)}_checkFloorplanVisible(i){if(!this._queryFeatureSetId||!this._map.isStyleLoaded()||this._map.transform.zoom<13)return;this._indoorData&&!function(w,S){const[C,D]=w,{center:L,radius:F}=S,[O,$]=L,q=Math.abs(C-O);return Math.sqrt((q>180?360-q:q)**2+(D-$)**2)<=F}([this._map.getCenter().lng,this._map.getCenter().lat],this._indoorData.circumCircle)&&(this._indoorData=void 0,this._selectedFloorplan=void 0,this._map.setConfigProperty(this._scope,"mbx-indoor-underground",!1),this._map.setConfigProperty(this._scope,"mbx-indoor-active-floorplans",["literal",[]]),this.fire(new s.A("floorplangone")));const l={target:{featuresetId:this._queryFeatureSetId,importId:this._scope}},p=new s.P(this._map.transform.width/2,this._map.transform.height/2),y=[new s.P(0,0),new s.P(this._map.transform.width,this._map.transform.height)],v=this._map.queryRenderedFeatures(i?y:p,l);v.length>0&&(this._selectedFloorplan&&v[0].properties.id===this._selectedFloorplan.properties.id||(this._selectedFloorplan=v[0],this._floorplanSelected(!1)))}
602_floorplanSelected(i){this._indoorData=JSON.parse(this._selectedFloorplan.properties["indoor-data"]),this._indoorData.id=this._selectedFloorplan.properties.id,this._indoorData.circumCircle=function(v){const[[w,S],[C,D]]=v,L=(C-w+360)%360,F=L>180?360-L:L;return{center:[(w+F/2+360)%360,(S+D)/2],radius:Math.sqrt(F**2+(D-S)**2)/2}}(this._indoorData.extent),this._floorplanStates[this._indoorData.id]||(this._floorplanStates[this._indoorData.id]={});const l=this._floorplanStates[this._indoorData.id].selectedBuilding,p=this._floorplanStates[this._indoorData.id].selectedLevel;let y;if(this._map.setConfigProperty(this._scope,"mbx-indoor-active-floorplans",this._indoorData.floorplanIDs),this._selectedLevel)for(const v of this._indoorData.levels)v.id===this._selectedLevel.id&&(y=v.id);if(this.fire(new s.A("floorplanselected",{buildings:this._indoorData.buildings,levels:this._indoorData.levels,selectedLevelId:y})),l){const v=this._indoorData.buildings.find(w=>w.id===l);this._buildingSelected(v,!1)}else this._indoorData.buildings.length>0&&this._buildingSelected(this._indoorData.buildings[0],!1);if(p){const v=this._indoorData.levels.find(w=>w.id===p);this._updateLevels(v,i)}else i&&this._indoorData["default-levels"].length>0&&this.selectLevel(this._indoorData["default-levels"][0])}_buildingSelected(i,l){l&&i&&i.extent&&this._map.fitBounds(i.extent,{pitch:this._map.getPitch(),bearing:this._map.getBearing()}),this._floorplanStates[this._indoorData.id].selectedBuilding=i?i.id:void 0;const p=this._indoorData.levels.filter(y=>i.levels.includes(y.id));this.fire(new s.A("buildingselected",{buildingId:i.id,levels:p}))}_levelSelected(i){if(i==="overview")this._updateLevels(void 0,!0);else{const l=this._indoorData.levels.find(p=>p.id===i);this._updateLevels(l,!0)}this.fire(new s.A("levelselected",{levelId:i==="overview"?void 0:i}))}_updateLevels(i,l){if(!i)return this._map.setConfigProperty(this._scope,"mbx-indoor-loaded-levels",["literal",[]]),this._map.setConfigProperty(this._scope,"mbx-indoor-underground",!1),this._floorplanStates[this._indoorData.id].selectedLevel=void 0,void(l&&this._indoorData.extent&&this._map.fitBounds(this._indoorData.extent,{pitch:this._map.getPitch(),bearing:this._map.getBearing()}));function p(D){const L=D.indexOf("/floor/");if(L===-1)return D;const F=L+7,O=D.indexOf("/",F);return O===-1?D.slice(F):D.slice(F,O)}this._selectedLevel=i,this._floorplanStates[this._indoorData.id].selectedLevel=i?i.id:void 0;const y=[],v={},w={},S={},C={};for(const D of this._indoorData.levels)if(y.push(D.id),v[D.id]=D.height,w[D.id]=D.base,i){if(this.mergeFloors){const L=p(i.id),F=p(D.id);S[D.id]=F===L?"true":"false"}else S[D.id]=D.id===i.id?"true":"false";C[D.id]=D.base<i.base?"true":"false"}else C[D.id]=!0;if(this._map.setConfigProperty(this._scope,"mbx-indoor-loaded-levels",["literal",y]),this._map.setConfigProperty(this._scope,"mbx-indoor-level-height",["literal",v]),this._map.setConfigProperty(this._scope,"mbx-indoor-level-base",["literal",w]),this._map.setConfigProperty(this._scope,"mbx-indoor-level-selected",["literal",S]),this._map.setConfigProperty(this._scope,"mbx-indoor-level-overlapped",["literal",C]),i&&(this._map.setConfigProperty(this._scope,"mbx-indoor-underground",!!i.isUnderground),l&&i.extent)){const D=this._map.cameraForBounds(i.extent,{pitch:this._map.getPitch(),bearing:this._map.getBearing()}),L=this._map.getZoom(),F=D.zoom?Math.abs(L-D.zoom):0;this._map.fitBounds(i.extent,F>=1?{pitch:this._map.getPitch(),bearing:this._map.getBearing()}:{pitch:this._map.getPitch(),bearing:this._map.getBearing(),zoom:L})}}selectFloorplan(i){const l={target:{featuresetId:this._queryFeatureSetId,importId:this._scope}},p=[new s.P(0,0),new s.P(this._map.transform.width,this._map.transform.height)],y=this._map.queryRenderedFeatures(p,l);if(y.length>0){for(const v of y)if(JSON.parse(v.properties["indoor-data"]).floorplanIDs.includes(i)){this._selectedFloorplan=v,this._floorplanSelected(!0);break}}}selectBuilding(i){const l=this._indoorData.buildings.find(p=>p.id===i);this._buildingSelected(l,!0)}selectLevel(i){this._levelSelected(i)}}function Cg(f){if(!f.metadata||!f.metadata.content_area)return;const i=s.q.devicePixelRatio,{left:l,top:p,width:y,height:v}=f.metadata.content_area,w=l*i,S=p*i;return[w,S,w+y*i,S+v*i]}function Vu(f){if(f)return f.map(([i,l])=>[i*s.q.devicePixelRatio,l*s.q.devicePixelRatio])}class gf{constructor(i,l,p){this.id=i,this.scope=l,this.sourceCache=p,this.pendingRequests=new Set,this.missingRequests=new Set}addPendingRequest(i){this.missingRequests.has(i.name)||this.pendingRequests.has(i.name)||this.pendingRequests.add(i.name)}hasPendingRequests(){return this.pendingRequests.size>0}resolvePendingRequests(){const i=new Map;if(!this.sourceCache.loaded())return i;const l=this.sourceCache.getVisibleCoordinates();if(l.length===0)return i;const p=this.sourceCache.getSource();if(!(p instanceof Al))return i;const y=l.map(w=>this.sourceCache.getTile(w)),v=p.getImages(y,Array.from(this.pendingRequests));for(const[w,S]of v)i.set(s.I.from({name:w,iconsetId:this.id}),S),this.pendingRequests.delete(w);for(const w of this.pendingRequests)this.missingRequests.add(w);return this.pendingRequests.clear(),i}}const La=(f,i)=>ke(f,i&&i.filter(l=>
602l.identifier!=="source.canvas")),Gp=s.aF(_n,["addLayer","removeLayer","setLights","setPaintProperty","setLayoutProperty","setSlot","setFilter","addSource","removeSource","setLayerZoomRange","setLight","setTransition","setGeoJSONSourceData","setTerrain","setFog","setSnow","setRain","setProjection","setCamera","addImport","removeImport","updateImport","addIconset","removeIconset"]),Wp=s.aF(_n,["setCenter","setZoom","setBearing","setPitch"]),Eo=new Set(["background","sky","slot","custom"]),Ho={version:8,layers:[],sources:{}},Hh={duration:300,delay:0};class ea extends s.E{constructor(i,l={}){super(),this.map=i,this.scope=l.scope||"",this.globalId=null,this.fragments=[],this.importDepth=l.importDepth||0,this.importsCache=l.importsCache||new Map,this.resolvedImports=l.resolvedImports||new Set,this.transition=s.l({},Hh),this._buildingIndex=new hf(this),this.crossTileSymbolIndex=new _r,this._mergedOrder=[],this._drapedFirstOrder=[],this._mergedLayers={},this._mergedSourceCaches={},this._mergedOtherSourceCaches={},this._mergedSymbolSourceCaches={},this._clipLayerPresent=!1,this._has3DLayers=!1,this._hasCircleLayers=!1,this._hasSymbolLayers=!1,this._changes=l.styleChanges||new Oe,this.dispatcher=l.dispatcher?l.dispatcher:new s.D(s.d0(),this),l.imageManager?this.imageManager=l.imageManager:(this.imageManager=new $t(this.map._spriteFormat),this.imageManager.setEventedParent(this)),this.imageManager.addScope(this.scope),this.glyphManager=l.glyphManager?l.glyphManager:new s.d1(i._requestManager,l.localFontFamily?s.d2.all:l.localIdeographFontFamily?s.d2.ideographs:s.d2.none,l.localFontFamily||l.localIdeographFontFamily),l.modelManager?this.modelManager=l.modelManager:(this.modelManager=new Vl(i._requestManager),this.modelManager.setEventedParent(this)),this._layers={},this._sourceCaches={},this._otherSourceCaches={},this._symbolSourceCaches={},this._loaded=!1,this._precompileDone=!1,this._shouldPrecompile=!1,this._availableImages=[],this._availableModels={},this._order=[],this._markersNeedUpdate=!1,this.options=l.configOptions?l.configOptions:new Map,this._configDependentLayers=l.configDependentLayers?l.configDependentLayers:new Set,this._config=l.config,this._styleColorTheme={lut:null,lutLoading:!1,lutLoadingCorrelationID:0,colorTheme:null,colorThemeOverride:l.colorThemeOverride},this._styleColorThemeForScope={},this._initialConfig=l.initialConfig,this.dispatcher.broadcast("setReferrer",s.d3());const p=this;this._rtlTextPluginCallback=ea.registerForPluginStateChange(y=>{p.dispatcher.broadcast("syncRTLPluginState",{pluginStatus:y.pluginStatus,pluginURL:y.pluginURL},(v,w)=>{if(s.d4(v),w&&w.every(S=>S))for(const S in p._sourceCaches){const C=p._sourceCaches[S],D=C.getSource().type;D!=="vector"&&D!=="geojson"||C.reload()}})}),this.on("data",y=>{if(y.dataType!=="source"||y.sourceDataType!=="metadata")return;const v=this.getOwnSource(y.sourceId);if(v&&v.vectorLayerIds)for(const w in this._layers){const S=this._layers[w];S.source===v.id&&this._validateLayer(S)}})}load(i){return i?(typeof i=="string"?this.loadURL(i):this.loadJSON(i),this):this}_getGlobalId(i){if(!i)return null;if(typeof i=="string"){if(s.f(i))return i;const l=s.d5(i);if(!l.startsWith("http"))try{return new URL(l,location.href).toString()}catch{return l}return l}return`json://${s.d6(JSON.stringify(i))}`}_diffStyle(i,l,p){this.globalId=this._getGlobalId(i);const y=(v,w)=>{try{w(null,this.setState(v,p))}catch(S){w(S,!1)}};if(typeof i=="string"){const v=this.map._requestManager.normalizeStyleURL(i),w=this.map._requestManager.transformRequest(v,s.R.Style);s.n(w,(S,C)=>{S?this.fire(new s.z(S)):C&&y(C,l)})}else typeof i=="object"&&y(i,l)}loadURL(i,l={}){this.fire(new s.A("dataloading",{dataType:"style"}));const p=typeof l.validate=="boolean"?l.validate:!s.f(i);this.globalId=this._getGlobalId(i),i=this.map._requestManager.normalizeStyleURL(i,l.accessToken),this.resolvedImports.add(i);const y=this.importsCache.get(i);if(y)return this._load(y,p);const v=this.map._requestManager.transformRequest(i,s.R.Style);this._request=s.n(v,(w,S)=>{if(this._request=null,w)this.fire(new s.z(w));else if(S)return this.importsCache.set(i,S),this._load(S,p)})}loadJSON(i,l={}){this.fire(new s.A("dataloading",{dataType:"style"})),this.globalId=this._getGlobalId(i),this._request=s.q.frame(()=>{this._request=null,this._load(i,l.validate!==!1)})}loadEmpty(){this.fire(new s.A("dataloading",{dataType:"style"})),this._load(Ho,!1)}_loadImports(i,l,p){if(this.importDepth>=4)return s.w("Style doesn't support nesting deeper than 5"),Promise.resolve();const y=[];for(const v of i){const w=this._createFragmentStyle(v),S=new Promise(L=>{w.once("style.import.load",L),w.once("error",L)}).then(()=>this.mergeAll());if(y.push(S),this.resolvedImports.has(v.url)){w.loadEmpty();continue}const C=v.data||this.importsCache.get(v.url);C?(w.loadJSON(C,{validate:l}),this._isInternalStyle(C)&&(w.globalId=null)):v.url?w.loadURL(v.url,{validate:l}):w.loadEmpty();const D={style:w,id:v.id,config:v.config};if(p){const L=this.fragments.findIndex(({id:F})=>F===p);this.fragments=this.fragments.slice(0,L).concat(D).concat(this.fragments.slice(L))}else this.fragments.push(D)}return Promise.allSettled(y)}getImportGlobalIds(i=this,l=new Set){for(const p of i.fragments)p.style.globalId&&l.add(p.style.globalId),this.getImportGlobalIds(p.style,l);return[...l.values()]}_createFragmentStyle(i){const l=this.scope?s.C(i.id,this.scope):i.id;let p;const y=this._initialConfig&&this._initialConfig[l];(i.config||y)&&(p=s.l({},i.config,y));const v=new ea(this.map,{scope:l,styleChanges:this._changes,importDepth:this.importDepth+1,importsCache:this.importsCache,resolvedImports:new Set(this.resolvedImports),dispatcher:this.dispatcher,imageManager:this.imageManager,glyphManager:this.glyphManager,modelManager:this.modelManager,config:p,configOptions:this.options,colorThemeOverride:i["color-theme"],configDependentLayers:this._configDependentLayers});return v.setEventedParent(this.map,{style:v}),v}_reloadImports(){this.mergeAll(),this._updateMapProjection(),this.updateConfigDependencies(),this.map._triggerCameraUpdate(this.camera),this.dispatcher.broadcast("setLayers",{layers:this._serializeLayers(this._order),scope:this.scope,options:this.options}),this._shouldPrecompile=this.map._precompilePrograms&&this.isRootStyle()}_isInternalStyle(i){return this.isRootStyle()&&(i.fragment||!!i.schema&&i.fragment!==!1)}_load(i,l){const p=i.indoor?Up(i.schema):i.schema;if(this._isInternalStyle(i)){const w=s.l({},Ho,{imports:[{id:"basemap",data:i,url:""}]});return void this._load(w,l)}if(this.updateConfig(this._config,p),l&&La(this,No(i)))return;this._loaded=!0,this.stylesheet=s.d7(i);const y=()=>{for(const D in i.sources)this.addSource(D,i.sources[D],{validate:!1,isInitialLoad:!0});if(i.iconsets)for(const D in i.iconsets)this.addIconset(D,i.iconsets[D]);i.sprite?this._loadIconset(i.sprite):(this.imageManager.setLoaded(!0,this.scope),this.dispatcher.broadcast("spriteLoaded",{scope:this.scope,isLoaded:!0})),this.setGlyphsUrl(i.glyphs);
602const w=Du(this.stylesheet.layers);if(this._order=w.map(D=>D.id),this.stylesheet.light&&s.w("The `light` root property is deprecated, prefer using `lights` with `flat` light type instead."),this.stylesheet.lights)if(this.stylesheet.lights.length===1&&this.stylesheet.lights[0].type==="flat"){const D=this.stylesheet.lights[0];this.light=new Ze(D.properties,D.id)}else this.setLights(this.stylesheet.lights);this.light||(this.light=new Ze(this.stylesheet.light)),this._layers={};for(const D of w){const L=s.dc(D,this.scope,this._styleColorTheme.lut,this.options);L.configDependencies.size!==0&&this._configDependentLayers.add(L.fqid),L.setEventedParent(this,{layer:{id:L.id}}),this._layers[L.id]=L;const F=this.getOwnLayerSourceCache(L),O=!!this.directionalLight&&this.directionalLight.shadowsEnabled();F&&L.canCastShadows()&&O&&(F.castsShadows=!0)}this.stylesheet.featuresets&&this.setFeaturesetSelectors(this.stylesheet.featuresets),this.stylesheet.models&&this.addModelURLs(this.stylesheet.models);const S=this.stylesheet.terrain;S&&(this.checkCanvasFingerprintNoise(),this.disableElevatedTerrain||this.terrainSetForDrapingOnly()||this._createTerrain(S,1)),this.stylesheet.fog&&this._createFog(this.stylesheet.fog),this.stylesheet.snow&&this._createSnow(this.stylesheet.snow),this.stylesheet.rain&&this._createRain(this.stylesheet.rain),this.stylesheet.transition&&this.setTransition(this.stylesheet.transition),this.fire(new s.A("data",{dataType:"style"}));const C=this.isRootStyle();i.imports?this._loadImports(i.imports,l).then(()=>{this._reloadImports(),this.fire(new s.A(C?"style.load":"style.import.load"))}).catch(D=>{this.fire(new s.z(new Error("Failed to load imports",D))),this.fire(new s.A(C?"style.load":"style.import.load"))}):(this._reloadImports(),this.fire(new s.A(C?"style.load":"style.import.load")))};this._styleColorTheme.colorTheme=this.stylesheet["color-theme"];const v=this._styleColorTheme.colorThemeOverride?this._styleColorTheme.colorThemeOverride:this._styleColorTheme.colorTheme;if(v){const w=this._evaluateColorThemeData(v);this._loadColorTheme(w).then(()=>{y()}).catch(S=>{s.w(`Couldn't load color theme from the stylesheet: ${S}`),y()})}else this._styleColorTheme.lut=null,y()}isRootStyle(){return this.importDepth===0}mergeAll(){let i,l,p,y,v,w,S,C,D,L;const F={};this.terrain&&this.terrain.scope!==this.scope&&delete this.terrain,this.forEachFragmentStyle(O=>{if(O.stylesheet){if(O.light!=null&&(i=O.light),O.stylesheet.lights)for(const $ of O.stylesheet.lights)$.type==="ambient"&&O.ambientLight!=null&&(l=O.ambientLight),$.type==="directional"&&O.directionalLight!=null&&(p=O.directionalLight);y=this._prioritizeTerrain(y,O.terrain,O.stylesheet.terrain),O.stylesheet.fog&&O.fog!=null&&(v=O.fog),O.stylesheet.snow&&O.snow!=null&&(w=O.snow),O.stylesheet.rain&&O.rain!=null&&(S=O.rain),O.stylesheet.camera!=null&&(L=O.stylesheet.camera),O.stylesheet.projection!=null&&(C=O.stylesheet.projection),O.stylesheet.transition!=null&&(D=O.stylesheet.transition),F[O.scope]=O._styleColorTheme}}),this.light=i,this.ambientLight=l,this.directionalLight=p,this.fog=v,this.snow=w,this.rain=S,this._styleColorThemeForScope=F,y===null?delete this.terrain:this.terrain=y,this.camera=L||{"camera-projection":"perspective"},this.projection=C||{name:"mercator"},this.transition=s.l({},Hh,D),this.mergeSources(),this.mergeLayers()}forEachFragmentStyle(i){const l=p=>{for(const y of p.fragments)l(y.style);i(p)};l(this)}_prioritizeTerrain(i,l,p){const y=i&&i.drapeRenderMode===0;return p===null?l&&l.drapeRenderMode===0?l:y?i:null:l!=null&&(!i||y||l&&l.drapeRenderMode===1)?l:i}mergeTerrain(){let i;this.terrain&&this.terrain.scope!==this.scope&&delete this.terrain,this.forEachFragmentStyle(l=>{i=this._prioritizeTerrain(i,l.terrain,l.stylesheet.terrain)}),i===null?delete this.terrain:this.terrain=i}mergeProjection(){let i;this.forEachFragmentStyle(l=>{l.stylesheet.projection!=null&&(i=l.stylesheet.projection)}),this.projection=i||{name:"mercator"}}mergeSources(){const i={},l={},p={};this.forEachFragmentStyle(y=>{for(const v in y._sourceCaches){const w=s.C(v,y.scope);i[w]=y._sourceCaches[v]}for(const v in y._otherSourceCaches){const w=s.C(v,y.scope);l[w]=y._otherSourceCaches[v]}for(const v in y._symbolSourceCaches){const w=s.C(v,y.scope);p[w]=y._symbolSourceCaches[v]}}),this._mergedSourceCaches=i,this._mergedOtherSourceCaches=l,this._mergedSymbolSourceCaches=p}mergeLayers(){const i={},l=[],p={};this._mergedSlots=[],this._has3DLayers=!1,this._hasCircleLayers=!1,this._hasSymbolLayers=!1,this.forEachFragmentStyle(v=>{for(const w of v._order){const S=v._layers[w];if(S.type==="slot"){const C=s.d8(w);if(i[C])continue;i[C]=[]}S.slot&&i[S.slot]?i[S.slot].push(S):l.push(S)}}),this._mergedOrder=[];const y=(v=[])=>{for(const w of v)if(w.type==="slot"){const S=s.d8(w.id);i[S]&&y(i[S]),this._mergedSlots.push(S)}else{const S=s.C(w.id,w.scope);this._mergedOrder.push(S),p[S]=w,w.is3D(!!this.terrain)&&(this._has3DLayers=!0),w.type==="circle"&&(this._hasCircleLayers=!0),w.type==="symbol"&&(this._hasSymbolLayers=!0),w.type==="clip"&&(this._clipLayerPresent=!0)}};y(l),this._mergedOrder.sort((v,w)=>{const S=p[v],C=p[w];return S.hasInitialOcclusionOpacityProperties?C.is3D(!!this.terrain)?1:0:S.is3D(!!this.terrain)&&C.hasInitialOcclusionOpacityProperties?-1:0}),this._mergedLayers=p,this.updateDrapeFirstLayers(),this._buildingIndex.processLayersChanged()}terrainSetForDrapingOnly(){return!!this.terrain&&this.terrain.drapeRenderMode===0}getCamera(){return this.stylesheet.camera}setCamera(i){return this.stylesheet.camera=s.l({},this.stylesheet.camera,i),this.camera=this.stylesheet.camera,this}_evaluateColorThemeData(i){return i.data?function(l,p,y){const v=s.l({},p);for(const S of Object.keys(s.a5.colorTheme))v[S]===void 0&&(v[S]=s.a5.colorTheme[S].default);const w=new s.a6(Eg,l,new Map(y));return w.setTransitionOrValue(v,y),w.untransitioned().possiblyEvaluate(new s.aa(0))}(this.scope,i,this.options).get("data"):null}_loadColorTheme(i){this._styleColorTheme.lutLoading=!0,this._styleColorTheme.lutLoadingCorrelationID+=1;const l=this._styleColorTheme.lutLoadingCorrelationID;return new Promise((p,y)=>{const v="data:image/png;base64,";if(!i||i.length===0)return this._styleColorTheme.lut=null,this._styleColorTheme.lutLoading=!1,void p();let w=i;w.startsWith(v)||(w=v+w);const S=s.I.from("mapbox-reserved-lut"),C=new Image;C.src=w,C.onerror=()=>{this._styleColorTheme.lutLoading=!1,y(new Error("Failed to load image data"))},C.onload=()=>
602{if(this._styleColorTheme.lutLoadingCorrelationID!==l)return void p();this._styleColorTheme.lutLoading=!1;const{width:D,height:L,data:F}=s.q.getImageData(C);if(L>32)return void y(new Error("The height of the image must be less than or equal to 32 pixels."));if(D!==L*L)return void y(new Error("The width of the image must be equal to the height squared."));this.getImage(S)&&this.removeImage(S),this.addImage(S,{data:new s.r({width:D,height:L},F),pixelRatio:1,sdf:!1,usvg:!1,version:0});const O=this.imageManager.getImage(S,this.scope);O?(this._styleColorTheme.lut={image:O.data,data:i},p()):y(new Error("Missing LUT image."))}})}getLut(i){const l=this._styleColorThemeForScope[i];return l?l.lut:null}setProjection(i){i?this.stylesheet.projection=i:delete this.stylesheet.projection,this.mergeProjection(),this._updateMapProjection()}applyProjectionUpdate(){this._loaded&&(this.dispatcher.broadcast("setProjection",this.map.transform.projectionOptions),this.map.transform.projection.requiresDraping?(this.getTerrain()||this.stylesheet.terrain)&&!this.disableElevatedTerrain||this.setTerrainForDraping():this.terrainSetForDrapingOnly()&&this.setTerrain(null,0))}_updateMapProjection(){this.isRootStyle()&&(this.map._useExplicitProjection?this.applyProjectionUpdate():this.map._prioritizeAndUpdateProjection(null,this.projection))}_loadSprite(i){this._spriteRequest=function(l,p,y){let v,w,S;const C=s.q.devicePixelRatio>1?"@2x":"";let D=s.n(p.transformRequest(p.normalizeSpriteURL(l,C,".json"),s.R.SpriteJSON),(O,$)=>{D=null,S||(S=O,v=$,F())}),L=s.o(p.transformRequest(p.normalizeSpriteURL(l,C,".png"),s.R.SpriteImage),(O,$)=>{L=null,S||(S=O,w=$,F())});function F(){if(S)y(S);else if(v&&w){const O=s.q.getImageData(w),$={};for(const q in v){const{width:W,height:K,x:Z,y:se,sdf:ue,pixelRatio:fe,stretchX:xe,stretchY:_e,content:ye}=v[q],pe=new s.r({width:W,height:K});s.r.copy(O,pe,{x:Z,y:se},{x:0,y:0},{width:W,height:K},null),$[q]={data:pe,pixelRatio:fe,sdf:ue,stretchX:xe,stretchY:_e,content:ye,usvg:!1}}y(null,$)}}return{cancel(){D&&(D.cancel(),D=null),L&&(L.cancel(),L=null)}}}(i,this.map._requestManager,(l,p)=>{if(this._spriteRequest=null,l)this.fire(new s.z(l));else if(p){const y=new Map;for(const v in p)y.set(s.I.from(v),p[v]);this.addImages(y)}this.imageManager.setLoaded(!0,this.scope),this.dispatcher.broadcast("spriteLoaded",{scope:this.scope,isLoaded:!0}),this.fire(new s.A("data",{dataType:"style"}))})}addIconset(i,l){if(l.type==="sprite")return void this._loadSprite(l.url);const p=this.getOwnSourceCache(l.source);if(!p)return void this.fire(new s.z(new Error(`Source "${l.source}" as specified by iconset "${i}" does not exist and cannot be used as an iconset source`)));const y=p.getSource();if(y.type!=="raster-array")return void this.fire(new s.z(new Error(`Source "${l.source}" as specified by iconset "${i}" is not a "raster-array" source and cannot be used as an iconset source`)));y.partial=!1;const v=new gf(i,this.scope,p);this.imageManager.addImageProvider(v,this.scope)}removeIconset(i){this.imageManager.removeImageProvider(i,this.scope)}_loadIconset(i){if(!s.f(i)&&this.map._spriteFormat!=="icon_set"||this.map._spriteFormat==="raster")return void this._loadSprite(i);const l=this.map._spriteFormat==="auto";var p,y;this._spriteRequest=(y=(v,w)=>{if(this._spriteRequest=null,v)l?this._loadSprite(i):this.fire(new s.z(v));else if(w){const S=new Map;for(const C in w)S.set(s.I.from(C),w[C]);this.addImages(S)}this.imageManager.setLoaded(!0,this.scope),this.dispatcher.broadcast("spriteLoaded",{scope:this.scope,isLoaded:!0}),this.fire(new s.A("data",{dataType:"style"}))},s.br((p=this.map._requestManager).transformRequest(p.normalizeIconsetURL(i),s.R.Iconset),(v,w)=>{if(v)return void y(v);const S={},C=s.c_(new s.bq(w));for(const D of C.icons){const L={version:1,pixelRatio:s.q.devicePixelRatio,content:Cg(D),stretchX:D.metadata?Vu(D.metadata.stretch_x_areas):void 0,stretchY:D.metadata?Vu(D.metadata.stretch_y_areas):void 0,sdf:!1,usvg:!0,icon:D};S[D.name]=L}y(null,S)}))}_validateLayer(i){const l=this.getOwnSource(i.source);if(!l)return;const p=i.sourceLayer;p&&(l.type==="geojson"||l.vectorLayerIds&&l.vectorLayerIds.indexOf(p)===-1)&&this.fire(new s.z(new Error(`Source layer "${p}" does not exist on source "${l.id}" as specified by style layer "${i.id}"`)))}
602loaded(){if(!this._loaded||Object.keys(this._changes.getUpdatedSourceCaches()).length)return!1;for(const i in this._sourceCaches)if(!this._sourceCaches[i].loaded())return!1;if(!this.imageManager.isLoaded()||this.imageManager.hasPatternsInFlight()||!this.modelManager.isLoaded()||this._styleColorTheme.lutLoading)return!1;for(const{style:i}of this.fragments)if(!i.loaded())return!1;return!0}_serializeImports(){if(this.stylesheet.imports)return this.stylesheet.imports.map((i,l)=>{const p=this.fragments[l];return p&&p.style&&(i.data=p.style.serialize()),i})}_serializeSources(){const i={};for(const l in this._sourceCaches){const p=this._sourceCaches[l].getSource();i[p.id]||(i[p.id]=p.serialize())}return i}_serializeLayers(i){const l=[];for(const p of i){const y=this._layers[p];y&&y.type!=="custom"&&l.push(y.serialize())}return l}hasLightTransitions(){return!(!this.light||!this.light.hasTransition())||!(!this.ambientLight||!this.ambientLight.hasTransition())||!(!this.directionalLight||!this.directionalLight.hasTransition())}hasFogTransition(){return!!this.fog&&this.fog.hasTransition()}hasSnowTransition(){return!!this.snow&&this.snow.hasTransition()}hasRainTransition(){return!!this.rain&&this.rain.hasTransition()}hasTransitions(){if(this.hasLightTransitions()||this.hasFogTransition()||this.hasSnowTransition()||this.hasRainTransition())return!0;for(const i in this._sourceCaches)if(this._sourceCaches[i].hasTransition())return!0;for(const i in this._layers)if(this._layers[i].hasTransition())return!0;return!1}get order(){return this.terrain?this._drapedFirstOrder:this._mergedOrder}_getOrder(i){return i?this.order:this._mergedOrder}isLayerDraped(i){return!!this.terrain&&i.isDraped(this.getLayerSourceCache(i))}_checkLoaded(){if(!this._loaded)throw new Error("Style is not done loading")}_checkLayer(i){const l=this.getOwnLayer(i);if(l)return l;this.fire(new s.z(new Error(`The layer '${i}' does not exist in the map's style.`)))}_checkSource(i){const l=this.getOwnSource(i);if(l)return l;this.fire(new s.z(new Error(`The source '${i}' does not exist in the map's style.`)))}precompilePrograms(i,l){const p=this.map.painter;if(p)for(let y=i.minzoom||0;y<(i.maxzoom||25.5);y++){const v=i.getProgramIds();if(v)for(const w of v){const S=i.getDefaultProgramParams(w,l.zoom,this._styleColorTheme.lut);S&&(p.style=this,this.fog&&(p._fogVisible=!0,S.overrideFog=!0,p.getOrCreateProgram(w,S)),p._fogVisible=!1,S.overrideFog=!1,p.getOrCreateProgram(w,S),(this.stylesheet.terrain||this.stylesheet.projection&&this.stylesheet.projection.name==="globe")&&(S.overrideRtt=!0,p.getOrCreateProgram(w,S)))}}}update(i){if(!this._loaded)return;this.ambientLight&&this.ambientLight.recalculate(i),this.directionalLight&&this.directionalLight.recalculate(i);const l=this.calculateLightsBrightness();i.brightness=l||0,l!==this._brightness&&(this._brightness=l,this.dispatcher.broadcast("setBrightness",l));const p=this._changes.isDirty();let y=!1;if(this._changes.isDirty()){const S=this._changes.getLayerUpdatesByScope();for(const C in S){const{updatedIds:D,removedIds:L}=S[C];(D||L)&&(this._updateWorkerLayers(C,D,L),y=!0)}this.updateSourceCaches(),this._updateTilesForChangedImages(),this.updateLayers(i),this.light&&this.light.updateTransitions(i),this.ambientLight&&this.ambientLight.updateTransitions(i),this.directionalLight&&this.directionalLight.updateTransitions(i),this.fog&&this.fog.updateTransitions(i),this.snow&&this.snow.updateTransitions(i),this.rain&&this.rain.updateTransitions(i),this._changes.reset()}const v={};for(const S in this._mergedSourceCaches){const C=this._mergedSourceCaches[S];v[S]=C.used,C.used=!1,C.tileCoverLift=0}for(const S of this._mergedOrder){const C=this._mergedLayers[S];if(C.recalculate(i,this._availableImages),!C.isHidden(i.zoom)){const D=this.getLayerSourceCache(C);D&&(D.used=!0,D.tileCoverLift=Math.max(D.tileCoverLift,C.tileCoverLift()))}!this._precompileDone&&this._shouldPrecompile&&("requestIdleCallback"in window?requestIdleCallback(()=>{this.precompilePrograms(C,i)}):this.precompilePrograms(C,i))}this._shouldPrecompile&&(this._precompileDone=!0),this.terrain&&y&&this.mergeLayers();const w=this.imageManager.getPendingImageProviders();for(const S of w)S.sourceCache.used=!0;for(const S in v){const C=this._mergedSourceCaches[S];v[S]!==C.used&&C.getSource().fire(new s.A("data",{sourceDataType:"visibility",dataType:"source",sourceId:C.getSource().id}))}this.light&&this.light.recalculate(i),this.terrain&&this.terrain.recalculate(i),this.fog&&this.fog.recalculate(i),this.snow&&this.snow.recalculate(i),this.rain&&this.rain.recalculate(i),this.z=i.zoom,this._markersNeedU
602pdate&&(this._updateMarkersOpacity(),this._markersNeedUpdate=!1),this.imageManager.clearUpdatedImages(this.scope),p&&this.fire(new s.A("data",{dataType:"style"}))}updateImageProviders(){const i=this.imageManager.getPendingImageProviders();for(const l of i){const p=l.resolvePendingRequests(),y=this.getFragmentStyle(l.scope);y&&y.addImages(p)}}_updateTilesForChangedImages(){const i={};for(const l in this._mergedSourceCaches){const p=this._mergedSourceCaches[l].getSource().scope;i[p]=i[p]||this._changes.getUpdatedImages(p),i[p].length!==0&&this._mergedSourceCaches[l].reloadTilesForDependencies(["icons","patterns"],i[p])}for(const l in i)this._changes.resetUpdatedImages(l)}_updateWorkerLayers(i,l,p){const y=this.getFragmentStyle(i);y&&this.dispatcher.broadcast("updateLayers",{layers:l?y._serializeLayers(l):[],scope:i,removedIds:p||[],options:y.options})}setState(i,l){if(this._checkLoaded(),La(this,No(i)))return!1;(i=s.d7(i)).layers=Du(i.layers);const p=function(w,S){if(!w)return[{command:_n.setStyle,args:[S]}];let C=[];try{if(!s.bv(w.version,S.version))return[{command:_n.setStyle,args:[S]}];if(s.bv(w.center,S.center)||C.push({command:_n.setCenter,args:[S.center]}),s.bv(w.zoom,S.zoom)||C.push({command:_n.setZoom,args:[S.zoom]}),s.bv(w.bearing,S.bearing)||C.push({command:_n.setBearing,args:[S.bearing]}),s.bv(w.pitch,S.pitch)||C.push({command:_n.setPitch,args:[S.pitch]}),s.bv(w.sprite,S.sprite)||C.push({command:_n.setSprite,args:[S.sprite]}),s.bv(w.glyphs,S.glyphs)||C.push({command:_n.setGlyphs,args:[S.glyphs]}),s.bv(w.imports,S.imports)||function($=[],q=[],W){q=q||[];const K=($=$||[]).map(Ml),Z=q.map(Ml),se=$.reduce(Ka,{}),ue=q.reduce(Ka,{}),fe=K.slice();let xe,_e,ye,pe;for(xe=0,_e=0;xe<K.length;xe++)ye=K[xe],ue.hasOwnProperty(ye)?_e++:(W.push({command:_n.removeImport,args:[ye]}),fe.splice(fe.indexOf(ye,_e),1));for(xe=0,_e=0;xe<Z.length;xe++)ye=Z[Z.length-1-xe],fe[fe.length-1-xe]!==ye&&(se.hasOwnProperty(ye)?(W.push({command:_n.removeImport,args:[ye]}),fe.splice(fe.lastIndexOf(ye,fe.length-_e),1)):_e++,pe=fe[fe.length-xe],W.push({command:_n.addImport,args:[ue[ye],pe]}),fe.splice(fe.length-xe,0,ye));for(const Se of q){const Ae=se[Se.id];Ae&&!s.bv(Ae,Se)&&W.push({command:_n.updateImport,args:[Se.id,Se]})}}(w.imports,S.imports,C),s.bv(w.transition,S.transition)||C.push({command:_n.setTransition,args:[S.transition]}),s.bv(w.light,S.light)||C.push({command:_n.setLight,args:[S.light]}),s.bv(w.fog,S.fog)||C.push({command:_n.setFog,args:[S.fog]}),s.bv(w.snow,S.snow)||C.push({command:_n.setSnow,args:[S.snow]}),s.bv(w.rain,S.rain)||C.push({command:_n.setRain,args:[S.rain]}),s.bv(w.projection,S.projection)||C.push({command:_n.setProjection,args:[S.projection]}),s.bv(w.lights,S.lights)||C.push({command:_n.setLights,args:[S.lights]}),s.bv(w.camera,S.camera)||C.push({command:_n.setCamera,args:[S.camera]}),s.bv(w.iconsets,S.iconsets)||function($,q,W){let K;for(K in q=q||{},$=$||{})$.hasOwnProperty(K)&&(q.hasOwnProperty(K)||W.push({command:_n.removeIconset,args:[K]}));for(K in q){if(!q.hasOwnProperty(K))continue;const Z=q[K];$.hasOwnProperty(K)?s.bv($[K],Z)||(W.push({command:_n.removeIconset,args:[K]}),W.push({command:_n.addIconset,args:[K,Z]})):W.push({command:_n.addIconset,args:[K,Z]})}}(w.iconsets,S.iconsets,C),!s.bv(w["color-theme"],S["color-theme"]))return[{command:_n.setStyle,args:[S]}];const D={},L=[];(function($,q,W,K){let Z;for(Z in q=q||{},$=$||{})$.hasOwnProperty(Z)&&(q.hasOwnProperty(Z)||cc(Z,W,K));for(Z in q){if(!q.hasOwnProperty(Z))continue;const se=q[Z];$.hasOwnProperty(Z)?s.bv($[Z],se)||($[Z].type==="geojson"&&se.type==="geojson"&&ku($,q,Z)?W.push({command:_n.setGeoJSONSourceData,args:[Z,se.data]}):df(Z,q,W,K)):Uc(Z,q,W)}})(w.sources,S.sources,L,D);const F=[];w.layers&&w.layers.forEach($=>{$.source&&D[$.source]?C.push({command:_n.removeLayer,args:[$.id]}):F.push($)});let O=w.terrain;O&&D[O.source]&&(C.push({command:_n.setTerrain,args:[void 0]}),O=void 0),C=C.concat(L),s.bv(O,S.terrain)||C.push({command:_n.setTerrain,args:[S.terrain]}),function($,q,W){q=q||[];const K=($=$||[]).map(Ml),Z=q.map(Ml),se=$.reduce(Ka,{}),ue=q.reduce(Ka,{}),fe=K.slice(),xe=Object.create(null);let _e,ye,pe,Se,Ae,Ge,Ne;for(_e=0,ye=0;_e<K.length;_e++)pe=K[_e],ue.hasOwnProperty(pe)?ye++:(W.push({command:_n.removeLayer,args:[pe]}),fe.splice(fe.indexOf(pe,ye),1));for(_e=0,ye=0;_e<Z.length;_e++)pe=Z[Z.length-1-_e],fe[fe.length-1-_e]!==pe&&(se.hasOwnProperty(pe)?(W.push({command:_n.removeLayer,args:[pe]}),fe.splice(fe.lastIndexOf(pe,fe.length-ye),1)):ye++,Ge=fe[fe.length-_e],W.push({command:_n.addLayer,args:[ue[pe],Ge]}),fe.splice(fe.length-_e,0,pe),xe[pe]=!0);for(_e=0;_e<Z.length;_e++)if(pe=Z[_e],Se=se[pe],Ae=ue[pe],!xe[pe]&&!s.bv(Se,Ae))if(s.bv(Se.source,Ae.source)&&s.bv(Se["source-layer"],Ae["source-layer"])&&s.bv(Se.type,Ae.type)){for(Ne in Ya(Se.layout,Ae.layout,W,pe,null,_n.setLayoutProperty),Ya(Se.paint,Ae.paint,W,pe,null,_n.setPaintProperty),s.bv(Se.slot,Ae.slot)||W.push({command:_n.setSlot,args:[pe,Ae.slot]}),s.bv(Se.filter,Ae.filter)||W.push({command:_n.setFilter,args:[pe,Ae.filter]}),s.bv(Se.minzoom,Ae.minzoom)&&s.bv(Se.maxzoom,Ae.maxzoom)||W.push({command:_n.setLayerZoomRange,args:[pe,Ae.minzoom,Ae.maxzoom]}),Se)Se.hasOwnProperty(Ne)&&Ne!=="layout"&&Ne!=="paint"&&Ne!=="filter"&&Ne!=="metadata"&&Ne!=="minzoom"&&Ne!=="maxzoom"&&Ne!=="slot"&&(Ne.indexOf("paint.")===0?Ya(Se[Ne],Ae[Ne],W,pe,Ne.slice(6),_n.setPaintProperty):s.bv(Se[Ne],Ae[Ne])||W.push({command:_n.setLayerProperty,args:[pe,Ne,Ae[Ne]]}));for(Ne in Ae)Ae.hasOwnProperty(Ne)&&!Se.hasOwnProperty(Ne)&&Ne!=="layout"&&Ne!=="paint"&&Ne!=="filter"&&Ne!=="metadata"&&Ne!=="minzoom"&&Ne!=="maxzoom"&&Ne!=="slot"&&(Ne.indexOf("paint.")===0?Ya(Se[Ne],Ae[Ne],W,pe,Ne.slice(6),_n.setPaintProperty):s.bv(Se[Ne],Ae[Ne])||W.push({command:_n.setLayerProperty,args:[pe,Ne,Ae[Ne]]}))}else W.push({command:_n.removeLayer,args:[pe]}),Ge=fe[fe.lastIndexOf(pe)+1],W.push({command:_n.addLayer,args:[Ae,Ge]})}(F,S.layers,C)}catch(D){console.warn("Unable to compute style diff:",D),C=[{command:_n.setStyle,args:[S]}]}return C}(this.serialize(),i).filter(w=>!(w.command in Wp));if(p.length===0)return!1;const y=p.filter(w=>!(w.command in Gp));if(y.length>0)throw new Error(`Unimplemented: ${y.map(w=>w.command).join(", ")}.`);const v=[];return p.forEach(w=>{v.push(this[w.command](...w.args))}),l&&Promise.all(v).then(l).catch(l),this.stylesheet=i,this.mergeAll(),this.dispatcher.broadcast("setLayers",{layers:this._serializeLayers(this._order),scope:this.scope,options:this.options}),!0}_updateWorkerImages(){this._availableImages=this.imageManager.listImages(this.scope),this.dispatcher.broadcast("setImages",{scope:this.scope,images:this._availableImages})}_updateWorkerModels(){this._availableModels=this.modelManager.getModelURIs(this.scope),this.dispatcher.broadcast("setModels",{scope:this.scope,models:this._availableModels})}addImages(i){for(const[l,p]of i.entries()){if(this.getImage(l))return this.fire(new s.z(new Error(`An image with the name "${l.name}" already exists.`)));this.imageManager.addImage(l,this.scope,p),this._changes.updateImage(l,this.scope)}return this._updateWorkerImages(),this.fire(new s.A("data",{dataType:"style"})),this}addImage(i,l){return this.getImage(i)?this.fire(new s.z(new Error(`An image with the name "${i.name}" already exists.`))):(this.imageManager.addImage(i,this.scope,l),this._changes.updateImage(i,this.scope),this._updateWorkerImages(),this.fire(new s.A("data",{dataType:"style"})),this)}updateImage(i,l,p=!1){this.imageManager.updateImage(i,this.scope,l),p&&(this._changes.updateImage(i,this.scope),this._updateWorkerImages(),this.fire(new s.A("data",{dataType:"style"})))}getImage(i){return this.imageManager.getImage(i,this.scope)}removeImage(i){return this.getImage(i)?(this.imageManager.removeImage(i,this.scope),this._changes.updateImage(i,this.scope),this._updateWorkerImages(),this.fire(new s.A("data",{dataType:"style"})),this):this.fire(new s.z(new Error("No image with this name exists.")))}listImages(){return this._checkLoaded(),this._availableImages.slice()}addModelURLs(i){return this.modelManager.addModelURLs(i,this.scope),this._updateWorkerModels(),this.fire(new s.A("data",{dataType:"style"})),this}addModel(i,l,p={}
602){return this._checkLoaded(),this._validate(Ce,`models.${i}`,l,null,p)||(this.modelManager.addModel(i,l,this.scope),this.fire(new s.A("data",{dataType:"style"}))),this}hasModel(i){return this.modelManager.hasModel(i,this.scope)}removeModel(i){return this.hasModel(i)?(this.modelManager.removeModel(i,this.scope),this.fire(new s.A("data",{dataType:"style"})),this):this.fire(new s.z(new Error("No model with this ID exists.")))}listModels(){return this._checkLoaded(),this.modelManager.listModels(this.scope)}addSource(i,l,p={}){if(this._checkLoaded(),this.getOwnSource(i)!==void 0)throw new Error(`There is already a source with ID "${i}".`);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(Vc,`sources.${i}`,l,null,p))return;this.map&&this.map._collectResourceTiming&&(l.collectResourceTiming=!0);const y=ac(i,l,this.dispatcher,this);y.scope=this.scope,y.setEventedParent(this,()=>({isSourceLoaded:this._isSourceCacheLoaded(y.id),source:y.serialize(),sourceId:y.id}));const v=w=>{const S=(w?"symbol:":"other:")+y.id,C=s.C(S,this.scope),D=this._sourceCaches[S]=new to(C,y,w);(w?this._symbolSourceCaches:this._otherSourceCaches)[y.id]=D,D.onAdd(this.map)};v(!1),l.type!=="vector"&&l.type!=="geojson"||v(!0),y.onAdd&&y.onAdd(this.map),p.isInitialLoad||(this.mergeSources(),this._changes.setDirty())}removeSource(i){this._checkLoaded();const l=this.getOwnSource(i);if(!l)throw new Error("There is no source with this ID");for(const y in this._layers)if(this._layers[y].source===i)return this.fire(new s.z(new Error(`Source "${i}" cannot be removed while layer "${y}" is using it.`)));if(this.terrain&&this.terrain.scope===this.scope&&this.terrain.get().source===i)return this.fire(new s.z(new Error(`Source "${i}" cannot be removed while terrain is using it.`)));if(this.stylesheet.iconsets){const y=Object.entries(this.stylesheet.iconsets).find(([v,w])=>w.type==="source"&&w.source===i);if(y)return this.fire(new s.z(new Error(`Source "${i}" cannot be removed while iconset "${y[0]}" is using it.`)))}const p=this.getOwnSourceCaches(i);for(const y of p){const v=s.d8(y.id);delete this._sourceCaches[v],this._changes.discardSourceCacheUpdate(y.id),y.fire(new s.A("data",{sourceDataType:"metadata",dataType:"source",sourceId:y.getSource().id})),y.setEventedParent(null),y.clearTiles()}return delete this._otherSourceCaches[i],delete this._symbolSourceCaches[i],this.mergeSources(),l.setEventedParent(null),l.onRemove&&l.onRemove(this.map),this._changes.setDirty(),this}setGeoJSONSourceData(i,l){this._checkLoaded(),this.getOwnSource(i).setData(l),this._changes.setDirty()}getOwnSource(i){const l=this.getOwnSourceCache(i);return l&&l.getSource()}getOwnSources(){const i=[];for(const l in this._otherSourceCaches){const p=this.getOwnSourceCache(l);p&&i.push(p.getSource())}return i}areTilesLoaded(){const i=this._mergedSourceCaches;for(const l in i){const p=i[l]._tiles;for(const y in p){const v=p[y];if(v.state!=="loaded"&&v.state!=="errored")return!1}}return!0}setLights(i){if(this._checkLoaded(),!i)return delete this.ambientLight,void delete this.directionalLight;const l=this._getTransitionParameters();for(const y of i){if(this._validate(Cu,"lights",y))return;switch(y.type){case"ambient":if(this.ambientLight){const v=this.ambientLight;v.set(y),v.updateTransitions(l)}else this.ambientLight=new Hs(y,jn||(jn=new s.a7({color:new s.a8(s.a5.properties_light_ambient.color),"color-use-theme":new s.a8({type:"string",default:"default","property-type":"data-constant"}),intensity:new s.a8(s.a5.properties_light_ambient.intensity)})),this.scope,this.options);break;case"directional":if(this.directionalLight){const v=this.directionalLight;v.set(y),v.updateTransitions(l)}else this.directionalLight=new Hs(y,Tn||(Tn=new s.a7({direction:new s.an(s.a5.properties_light_directional.direction),color:new s.a8(s.a5.properties_light_directional.color),"color-use-theme":new s.a8({type:"string",default:"default","property-type":"data-constant"}),intensity:new s.a8(s.a5.properties_light_directional.intensity),"cast-shadows":new s.a8(s.a5.properties_light_directional["cast-shadows"]),"shadow-quality":new s.a8(s.a5.properties_light_directional["shadow-quality"]),"shadow-intensity":new s.a8(s.a5.properties_light_directional["shadow-intensity"])})),this.scope,this.options)}}const p=new s.aa(this.z||0,l);this.ambientLight&&this.ambientLight.recalculate(p),this.directionalLight&&this.directionalLight.recalculate(p),this._brightness=this.calculateLightsBrightness(),this.dispatcher.broadcast("setBrightness",this._brightness)}calculateLightsBrightness(){const i=this.directionalLight,l=this.ambientLight;if(!i||!l)return;const p=O=>.2126*(O[0]<=.03928?O[0]/12.92:Math.pow((O[0]+.055)/1.055,2.4))+.7152*(O[1]<=.03928?O[1]/12.92:Math.pow((O[1]+.055)/1.055,2.4))+.0722*(O[2]<=.03928?O[2]/12.92:Math.pow((O[2]+.055)/1.055,2.4)),y=i.properties.get("color").toRenderColor(null).toArray01(),v=i.properties.get("intensity"),w=i.properties.get("direction"),S=1-s.cR(w.x,w.y,w.z)[2]/90,C=p(y)*v*S,D=l.properties.get("color").toRenderColor(null).toArray01(),L=l.properties.get("intensity"),F=p(D)*L;return Number(((C+F)/2).toFixed(6))}getBrightness(){return this._brightness}getLights(){if(!this.enable3dLights())return null;const i=[];return this.directionalLight&&i.push(this.directionalLight.get()),this.ambientLight&&i.push(this.ambientLight.get()),i}enable3dLights(){return!!this.ambientLight&&!!this.directionalLight}getFragmentStyle(i){if(i==null||i===""&&this.isRootStyle())return this;if(s.d9(i)){const l=s.da(i),p=this.fragments.find(({id:v})=>v===l);if(!p)return;const y=s.d8(i);return p.style.getFragmentStyle(y)}{const l=this.fragments.find(({id:p})=>p===i);return l?l.style:void 0}}setFeaturesetSelectors(i){if(!i)return;const l={},p=(y,v="")=>`${y}::${v}`;this._featuresetSelectors={};for(const y in i){const v=this._featuresetSelectors[y]=[];
602for(const w of i[y].selectors){if(w.featureNamespace){const C=this.getOwnLayer(w.layer);if(!C){s.w(`Layer is undefined for selector: ${w.layer}`);continue}const D=p(C.source,C.sourceLayer);if(D in l&&l[D]!==w.featureNamespace){s.w(`"featureNamespace ${w.featureNamespace} of featureset ${y}'s selector is not associated to the same source, skip this selector`);continue}l[D]=w.featureNamespace}let S;if(w.properties)for(const C in w.properties){const D=s.X(w.properties[C]);D.result==="success"&&(S=S||{},S[C]=D.value)}v.push({layerId:w.layer,namespace:w.featureNamespace,properties:S,uniqueFeatureID:w._uniqueFeatureID})}}}getFeaturesetDescriptors(i){const l=this.getFragmentStyle(i);if(!l||!l.stylesheet.featuresets)return[];const p=[];for(const y in l.stylesheet.featuresets)p.push({featuresetId:y,importId:l.scope?l.scope:void 0});return p}getFeaturesetLayers(i,l){const p=this.getFragmentStyle(l),y=p.stylesheet.featuresets;if(!y||!y[i])return this.fire(new s.z(new Error(`The featureset '${i}' does not exist in the map's style and cannot be queried.`))),[];const v=[];for(const w of y[i].selectors){const S=p.getOwnLayer(w.layer);S&&v.push(S)}return v}getConfigProperty(i,l){const p=this.getFragmentStyle(i);if(!p)return null;const y=s.C(l,p.scope),v=p.options.get(y),w=v?v.value||v.default:null;return w?w.serialize():null}setConfigProperty(i,l,p){const y=this.getFragmentStyle(i);if(!y)return;const v=y.stylesheet.indoor?Up(y.stylesheet.schema):y.stylesheet.schema;if(!v||!v[l])return;const w=s.X(p);if(w.result!=="success")return void La(this,w.value);const S=w.value.expression,C=s.C(l,y.scope),D=y.options.get(C);if(!D)return;let L;const{minValue:F,maxValue:O,stepValue:$,type:q,values:W}=v[l],K=s.X(v[l].default);K.result==="success"&&(L=K.value.expression),L?(this.options.set(C,Object.assign({},D,{value:S,default:L,minValue:F,maxValue:O,stepValue:$,type:q,values:W})),this.updateConfigDependencies(l)):this.fire(new s.z(new Error(`No schema defined for the config option "${l}" in the "${i}" fragment.`)))}getConfig(i){const l=this.getFragmentStyle(i);if(!l)return null;const p=l.stylesheet.schema;if(!p)return null;const y={};for(const v in p){const w=s.C(v,l.scope),S=l.options.get(w),C=S?S.value||S.default:null;y[v]=C?C.serialize():null}return y}setConfig(i,l){const p=this.getFragmentStyle(i);p&&(p.updateConfig(l,p.stylesheet.schema),this.updateConfigDependencies())}getSchema(i){const l=this.getFragmentStyle(i);return l?l.stylesheet.schema:null}setSchema(i,l){const p=this.getFragmentStyle(i);p&&(p.stylesheet.schema=l,p.updateConfig(p._config,l),this.updateConfigDependencies())}updateConfig(i,l){if(this._config=i,i||l)if(l)for(const p in l){let y,v;const w=s.X(l[p].default);if(w.result==="success"&&(y=w.value.expression),i&&i[p]!==void 0){const O=s.X(i[p]);O.result==="success"&&(v=O.value.expression)}const{minValue:S,maxValue:C,stepValue:D,type:L,values:F}=l[p];if(y){const O=s.C(p,this.scope);this.options.set(O,{default:y,value:v,minValue:S,maxValue:C,stepValue:D,type:L,values:F})}else this.fire(new s.z(new Error(`No schema defined for config option "${p}".`)))}else this.fire(new s.z(new Error("Attempting to set config for a style without schema.")))}updateConfigDependencies(i){for(const l of this._configDependentLayers){const p=this.getLayer(l);if(p){if(i&&!p.configDependencies.has(i))continue;p.possiblyEvaluateVisibility(),this._updateLayer(p)}}this.ambientLight&&this.ambientLight.updateConfig(this.options),this.directionalLight&&this.directionalLight.updateConfig(this.options),this.fog&&this.fog.updateConfig(this.options),this.snow&&this.snow.updateConfig(this.options),this.rain&&this.rain.updateConfig(this.options),this.forEachFragmentStyle(l=>{const p=l._styleColorTheme.colorThemeOverride?l._styleColorTheme.colorThemeOverride:l._styleColorTheme.colorTheme;if(p){const y=l._evaluateColorThemeData(p);(!l._styleColorTheme.lut&&y!==""||l._styleColorTheme.lut&&y!==l._styleColorTheme.lut.data)&&l.setColorTheme(p)}}),this._changes.setDirty()}addLayer(i,l,p={}){this._checkLoaded();const y=i.id;if(this._layers[y])return void this.fire(new s.z(new Error(`Layer with i
602d "${y}" already exists on this map`)));let v;if(i.type==="custom"){if(La(this,s.db(i)))return;v=s.dc(i,this.scope,this._styleColorTheme.lut,this.options)}else{if(typeof i.source=="object"&&(this.addSource(y,i.source),i=s.d7(i),i=s.l(i,{source:y})),this._validate(X,`layers.${y}`,i,{arrayIndex:-1},p))return;v=s.dc(i,this.scope,this._styleColorTheme.lut,this.options),this._validateLayer(v),v.setEventedParent(this,{layer:{id:y}})}v.configDependencies.size!==0&&this._configDependentLayers.add(v.fqid);let w=this._order.length;if(l){const L=this._order.indexOf(l);if(L===-1)return void this.fire(new s.z(new Error(`Layer with id "${l}" does not exist on this map.`)));v.slot===this._layers[l].slot?w=L:s.w(`Layer with id "${l}" has a different slot. Layers can only be rearranged within the same slot.`)}this._order.splice(w,0,y),this._layerOrderChanged=!0,this._layers[y]=v;const S=this.getOwnLayerSourceCache(v),C=!!this.directionalLight&&this.directionalLight.shadowsEnabled();S&&v.canCastShadows()&&C&&(S.castsShadows=!0);const D=this._changes.getRemovedLayer(v);if(D&&v.source&&S&&v.type!=="custom"){this._changes.discardLayerRemoval(v);const L=s.C(v.source,v.scope);D.type!==v.type?this._changes.updateSourceCache(L,"clear"):(this._changes.updateSourceCache(L,"reload"),S.pause())}this._updateLayer(v),v.onAdd&&v.onAdd(this.map),v.scope=this.scope,this.mergeLayers()}moveLayer(i,l){this._checkLoaded();const p=this._checkLayer(i);if(!p||i===l)return;const y=this._order.indexOf(i);this._order.splice(y,1);let v=this._order.length;if(l){const w=this._order.indexOf(l);
602if(w===-1)return void this.fire(new s.z(new Error(`Layer with id "${l}" does not exist on this map.`)));p.slot===this._layers[l].slot?v=w:s.w(`Layer with id "${l}" has a different slot. Layers can only be rearranged within the same slot.`)}this._order.splice(v,0,i),this._changes.setDirty(),this._layerOrderChanged=!0,this.mergeLayers()}removeLayer(i){this._checkLoaded();const l=this._checkLayer(i);if(!l)return;l.setEventedParent(null);const p=this._order.indexOf(i);this._order.splice(p,1),delete this._layers[i],this._changes.setDirty(),this._layerOrderChanged=!0,this._configDependentLayers.delete(l.fqid),this._changes.removeLayer(l);const y=this.getOwnLayerSourceCache(l);if(y&&y.castsShadows){let v=!1;for(const w in this._layers)if(this._layers[w].source===l.source&&this._layers[w].canCastShadows()){v=!0;break}y.castsShadows=v}l.onRemove&&l.onRemove(this.map),this.mergeLayers()}getOwnLayer(i){return this._layers[i]}hasLayer(i){return i in this._mergedLayers}hasLayerType(i){for(const l in this._layers)if(this._layers[l].type===i)return!0;return!1}setLayerZoomRange(i,l,p){this._checkLoaded();const y=this._checkLayer(i);y&&(y.minzoom===l&&y.maxzoom===p||(l!=null&&(y.minzoom=l),p!=null&&(y.maxzoom=p),this._updateLayer(y)))}getSlots(){return this._checkLoaded(),this._mergedSlots}setSlot(i,l){this._checkLoaded();const p=this._checkLayer(i);p&&p.slot!==l&&(p.slot=l,this._updateLayer(p))}setFilter(i,l,p={}){this._checkLoaded();const y=this._checkLayer(i);if(y&&!s.bv(y.filter,l))return l==null?(y.filter=void 0,void this._updateLayer(y)):void(this._validate(ie,`layers.${y.id}.filter`,l,{layerType:y.type},p)||(y.filter=s.d7(l),this._updateLayer(y)))}getFilter(i){const l=this._checkLayer(i);if(l)return s.d7(l.filter)}setLayoutProperty(i,l,p,y={}){this._checkLoaded();const v=this._checkLayer(i);if(v&&!s.bv(v.getLayoutProperty(l),p)){if(p!=null&&(!y||y.validate!==!1)&&La(v,Ie.call(No,{key:`layers.${i}.layout.${l}`,layerType:v.type,objectKey:l,value:p,styleSpec:s.a5,style:{glyphs:!0,sprite:!0}})))return;v.setLayoutProperty(l,p),v.configDependencies.size!==0&&this._configDependentLayers.add(v.fqid),this._updateLayer(v)}}getLayoutProperty(i,l){const p=this._checkLayer(i);if(p)return p.getLayoutProperty(l)}setPaintProperty(i,l,p,y={}){this._checkLoaded();const v=this._checkLayer(i);if(!v||s.bv(v.getPaintProperty(l),p)||p!=null&&(!y||y.validate!==!1)&&La(v,ge.call(No,{key:`layers.${i}.paint.${l}`,layerType:v.type,objectKey:l,value:p,styleSpec:s.a5})))return;const w=v.setPaintProperty(l,p);v.configDependencies.size!==0&&this._configDependentLayers.add(v.fqid),w&&this._updateLayer(v),this._changes.updatePaintProperties(v)}getPaintProperty(i,l){const p=this._checkLayer(i);if(p)return p.getPaintProperty(l)}setFeatureState(i,l){if(this._checkLoaded(),"target"in i){if("featuresetId"in i.target){const{featuresetId:C,importId:D}=i.target,L=this.getFragmentStyle(D),F=L.getFeaturesetLayers(C);for(const{source:O,sourceLayer:$}of F)L.setFeatureState({id:i.id,source:O,sourceLayer:$},l)}else if("layerId"in i.target){const{layerId:C}=i.target,D=this.getLayer(C);this.setFeatureState({id:i.id,source:D.source,sourceLayer:D.sourceLayer},l)}return}const p=i.source,y=i.sourceLayer,v=this._checkSource(p);if(!v)return;const w=v.type;if(w==="geojson"&&y)return void this.fire(new s.z(new Error("GeoJSON sources cannot have a sourceLayer parameter.")));if(w==="vector"&&!y)return void this.fire(new s.z(new Error("The sourceLayer parameter must be provided for vector source types.")));i.id===void 0&&this.fire(new s.z(new Error("The feature id parameter must be provided.")));const S=this.getOwnSourceCaches(p);for(const C of S)C.setFeatureState(y,i.id,l)}removeFeatureState(i,l){if(this._checkLoaded(),"target"in i){if("featuresetId"in i.target){const{featuresetId:C,importId:D}=i.target,L=this.getFragmentStyle(D),F=L.getFeaturesetLayers(C);for(const{source:O,sourceLayer:$}of F)L.removeFeatureState({id:i.id,source:O,sourceLayer:$},l)}else if("layerId"in i.target){const{layerId:C}=i.target,D=this.getLayer(C);this.removeFeatureState({id:i.id,source:D.source,sourceLayer:D.sourceLayer},l)}return}const p=i.source,y=this._checkSource(p);if(!y)return;const v=y.type,w=v==="vector"?i.sourceLayer:void 0;if(v==="vector"&&!w)return void this.fire(new s.z(new Error("The sourceLayer parameter must be provided for vector source types.")));if(l&&typeof i.id!="string"&&typeof i.id!="number")return void this.fire(new s.z(new Error("A feature id is required to remove its specific state property.")));const S=this.getOwnSourceCaches(p);for(const C of S)C.removeFeatureState(w,i.id,l)}getFeatureState(i){if(this._checkLoaded(),"target"in i){let v;if("featuresetId"in i.target){const{featuresetId:w,importId:S}=i.target,C=this.getFragmentStyle(S),D=C.getFeaturesetLayers(w);for(const{source:L,sourceLayer:F}of D){const O=C.getFeatureState({id:i.id,source:L,sourceLayer:F});if(O&&!v)v=O;else if(!s.bv(v,O))return void this.fire(new s.z(new Error("The same feature id exists in multiple sources in the featureset, but their feature states are not consistent through the sources.")))}}else if("layerId"in i.target){const{layerId:w}=i.target,S=this.getLayer(w);v=this.getFeatureState({id:i.id,source:S.source,sourceLayer:S.sourceLayer})}return v}
vendor: 5,552 bytes, line 602
602const l=i.source,p=i.sourceLayer,y=this._checkSource(l);if(y){if(y.type!=="vector"||p)return i.id===void 0&&this.fire(new s.z(new Error("The feature id parameter must be provided."))),this.getOwnSourceCaches(l)[0].getFeatureState(p,i.id);this.fire(new s.z(new Error("The sourceLayer parameter must be provided for vector source types.")))}}setTransition(i){return this.stylesheet.transition=s.l({},this.stylesheet.transition,i),this.transition=this.stylesheet.transition,this}getTransition(){return s.l({},this.stylesheet.transition)}serialize(){this._checkLoaded();const i=this.getTerrain(),l=i&&this.terrain&&this.terrain.scope===this.scope?i:this.stylesheet.terrain;return s.dd({version:this.stylesheet.version,name:this.stylesheet.name,metadata:this.stylesheet.metadata,fragment:this.stylesheet.fragment,iconsets:this.stylesheet.iconsets,imports:this._serializeImports(),schema:this.stylesheet.schema,camera:this.stylesheet.camera,light:this.stylesheet.light,lights:this.stylesheet.lights,terrain:l,fog:this.stylesheet.fog,snow:this.stylesheet.snow,rain:this.stylesheet.rain,center:this.stylesheet.center,"color-theme":this.stylesheet["color-theme"],zoom:this.stylesheet.zoom,bearing:this.stylesheet.bearing,pitch:this.stylesheet.pitch,sprite:this.stylesheet.sprite,glyphs:this.stylesheet.glyphs,transition:this.stylesheet.transition,projection:this.stylesheet.projection,sources:this._serializeSources(),layers:this._serializeLayers(this._order)},p=>p!==void 0)}_updateFilteredLayers(i){for(const l of Object.values(this._mergedLayers))i(l)&&this._updateLayer(l)}_updateLayer(i){this._changes.updateLayer(i);const l=this.getLayerSourceCache(i),p=s.C(i.source,i.scope),y=this._changes.getUpdatedSourceCaches();i.source&&!y[p]&&l&&l.getSource().type!=="raster"&&(this._changes.updateSourceCache(p,"reload"),l.pause()),i.invalidateCompiledFilter()}_flattenAndSortRenderedFeatures(i){const l=S=>this._mergedLayers[S].is3D(!!this.terrain),p=this.order,y={},v=[];for(let S=p.length-1;S>=0;S--){const C=p[S];if(l(C)){y[C]=S;for(const D of i){const L=D[C];if(L)for(const F of L)v.push(F)}}}v.sort((S,C)=>C.intersectionZ-S.intersectionZ);const w=[];for(let S=p.length-1;S>=0;S--){const C=p[S];if(l(C))for(let D=v.length-1;D>=0;D--){const L=v[D].feature;if(L.layer&&y[L.layer.id]<S)break;w.push(L),v.pop()}else for(const D of i){const L=D[C];if(L)for(const F of L)w.push(F.feature)}}return w}queryRenderedFeatures(i,l,p){let y;l&&!Array.isArray(l)&&l.filter&&(this._validate(ie,"queryRenderedFeatures.filter",l.filter,null,l),y=s.b3(l.filter));const v={},w=L=>{if(Eo.has(L.type))return;const F=this.getOwnLayerSourceCache(L),O=v[F.id]=v[F.id]||{sourceCache:F,layers:{},has3DLayers:!1};L.is3D(!!this.terrain)&&(O.has3DLayers=!0),O.layers[L.fqid]=O.layers[L.fqid]||{styleLayer:L,targets:[]},O.layers[L.fqid].targets.push({filter:y})};if(l&&l.layers){if(!Array.isArray(l.layers))return this.fire(new s.z(new Error("parameters.layers must be an Array."))),[];for(const L of l.layers){const F=this._layers[L];if(!F)return this.fire(new s.z(new Error(`The layer '${L}' does not exist in the map's style and cannot be queried for features.`))),[];w(F)}}else for(const L in this._layers)w(this._layers[L]);const S=this._queryRenderedFeatures(i,v,p),C=this._flattenAndSortRenderedFeatures(S),D=[];for(const L of C)s.de(L.layer.id)===this.scope&&D.push(L);return D}queryRenderedFeatureset(i,l,p){let y;l&&!Array.isArray(l)&&l.filter&&(this._validate(ie,"queryRenderedFeatures.filter",l.filter,null,l),y=s.b3(l.filter));const v="mock",w=[];if(l&&l.target)w.push(Object.assign({},l,{targetId:v,filter:y}));else{const L=this.getFeaturesetDescriptors();for(const F of L)w.push({targetId:v,filter:y,target:F});for(const{style:F}of this.fragments){const O=F.getFeaturesetDescriptors();for(const $ of O)w.push({targetId:v,filter:y,target:$})}}const S=this.queryRenderedTargets(i,w,p),C=[],D=new Set;for(const L of S)for(const F of L.variants[v])Jr(F,L,D)||C.push(new s.df(L,F));return C}queryRenderedTargets(i,l,p){const y={},v=(S,C,D,L)=>{const F=y[C.id]=y[C.id]||{sourceCache:C,layers:{},has3DLayers:!1};if(F.layers[S.fqid]=F.layers[S.fqid]||{styleLayer:S,targets:[]},S.is3D(!!this.terrain)&&(F.has3DLayers=!0),!L)return D.uniqueFeatureID=!1,void F.layers[S.fqid].targets.push(D);F.layers[S.fqid].targets.push(Object.assign({},D,{namespace:L.namespace,properties:L.properties,uniqueFeatureID:L.uniqueFeatureID}))};for(const S of l)if("featuresetId"in S.target){const{featuresetId:C,importId:D}=S.target,L=this.getFragmentStyle(D);if(!L||!L._featuresetSelectors)continue;const F=L._featuresetSelectors[C];if(!F){this.fire(new s.z(new Error(`The featureset '${C}' does not exist in the map's style and cannot be queried for features.`)));continue}for(const O of F){const $=L.getOwnLayer(O.layerId);$&&!Eo.has($.type)&&v($,L.getOwnLayerSourceCache($),S,O)}}else if("layerId"in S.target){const{layerId:C}=S.target,D=this.getLayer(C);if(!D||Eo.has(D.type))continue;v(D,this.getLayerSourceCache(D),S)}const w=this._queryRenderedFeatures(i,y,p);return this._flattenAndSortRenderedFeatures(w)}_queryRenderedFeatures(i,l,p){const y=[],v=!!this.map._showQueryGeometry,w=ir.createFromScreenPoints(i,p);for(const S in l){const C=$o(w,l[S],this._availableImages,p,v);Object.keys(C).length&&y.push(C)}if(this.placement)for(const S in l){if(!l[S].sourceCache._onlySymbols)continue;const C=co(w.screenGeometry,l[S],this._availableImages,this.placement.collisionIndex,this.placement.retainedQueryData);Object.keys(C).length&&y.push(C)}return y}querySourceFeatures(i,l){const p=l&&l.filter;
602p&&this._validate(ie,"querySourceFeatures.filter",p,null,l);let y=[];const v=this.getOwnSourceCaches(i);for(const w of v)y=y.concat(Iu(w,l));return y}addSourceType(i,l,p){return ea.getSourceType(i)?p(new Error(`A source type called "${i}" already exists.`)):(ea.setSourceType(i,l),l.workerSourceURL?void this.dispatcher.broadcast("loadWorkerSource",{name:i,url:l.workerSourceURL},p):p(null,null))}getFlatLight(){return this.light.getLight()}setFlatLight(i,l,p={}){this._checkLoaded();const y=this.light.getLight();let v=!1;for(const S in i)if(!s.bv(i[S],y[S])){v=!0;break}if(!v)return;const w=this._getTransitionParameters();this.light.setLight(i,l,p),this.light.updateTransitions(w)}getTerrain(){return this.terrain&&this.terrain.drapeRenderMode===1?this.terrain.get():null}setTerrainForDraping(){this.setTerrain({source:"",exaggeration:0},0)}checkCanvasFingerprintNoise(){this.disableElevatedTerrain===void 0&&(this.disableElevatedTerrain=s.q.hasCanvasFingerprintNoise(),this.disableElevatedTerrain&&s.w("Terrain and hillshade are disabled because of Canvas2D limitations when fingerprinting protection is enabled (e.g. in private browsing mode)."))}setTerrain(i,l=1){if(this._checkLoaded(),!i)return this.terrainSetForDrapingOnly()||(delete this.terrain,this.map.transform.projection.requiresDraping&&this.setTerrainForDraping()),l===0&&delete this.terrain,i===null?this.stylesheet.terrain=null:delete this.stylesheet.terrain,this._force3DLayerUpdate(),void(this._markersNeedUpdate=!0);this.checkCanvasFingerprintNoise();let p=i;const y=i.source==null;if(l===1){if(this.disableElevatedTerrain)return;if(typeof p.source=="object"){const S="terrain-dem-src";this.addSource(S,p.source),p=s.d7(p),p=s.l(p,{source:S})}const v=s.l({},p),w={};if(this.terrain&&y){v.source=this.terrain.get().source;const S=this.terrain?this.getFragmentStyle(this.terrain.scope):null;S&&(w.style=S.serialize())}if(this._validate(kt,"terrain",v,w))return}if(!this.terrain||this.terrain.scope!==this.scope&&!y||this.terrain&&l!==this.terrain.drapeRenderMode){if(!p)return;this._createTerrain(p,l),this.fire(new s.A("data",{dataType:"style"}))}else{const v=this.terrain,w=v.get();for(const S of Object.keys(s.a5.terrain))!p.hasOwnProperty(S)&&s.a5.terrain[S].default&&(p[S]=s.a5.terrain[S].default);for(const S in i)if(!s.bv(i[S],w[S])){v.set(i,this.options),this.stylesheet.terrain=i;const C=this._getTransitionParameters({duration:0});v.updateTransitions(C),this.fire(new s.A("data",{dataType:"style"}));break}}this.mergeTerrain(),this.updateDrapeFirstLayers(),this._markersNeedUpdate=!0}_createFog(i){const l=this.fog=new Qi(i,this.map.transform,this.scope,this.options);this.stylesheet.fog=l.get();const p=this._getTransitionParameters({duration:0});l.updateTransitions(p)}_createSnow(i){const l=this.snow=new Jn(i,this.map.transform,this.scope,this.options);this.stylesheet.snow=l.get();const p=this._getTransitionParameters({duration:0});l.updateTransitions(p)}_createRain(i){const l=this.rain=new Gn(i,this.map.transform,this.scope,this.options);this.stylesheet.rain=l.get();const p=this._getTransitionParameters({duration:0});l.updateTransitions(p)}_updateMarkersOpacity(){this.map._markers.length!==0&&this.map._requestDomTask(()=>{for(const i of this.map._markers)i._evaluateOpacity()})}getFog(){return this.fog?this.fog.get():null}setFog(i){if(this._checkLoaded(),!i)return delete this.fog,delete this.stylesheet.fog,void(this._markersNeedUpdate=!0);if(this.fog){const l=this.fog;if(!s.bv(l.get(),i)){l.set(i,this.options),this.stylesheet.fog=l.get();const p=this._getTransitionParameters({duration:0});l.updateTransitions(p)}}else this._createFog(i);this._markersNeedUpdate=!0}getSnow(){return this.snow?this.snow.get():null}setSnow(i){if(this._checkLoaded(),!i)return delete this.snow,void delete this.stylesheet.snow;if(this.snow){const l=this.snow;if(!s.bv(l.get(),i)){l.set(i,this.options),this.stylesheet.snow=l.get();const p=this._getTransitionParameters({duration:0});l.updateTransitions(p)}}else this._createSnow(i);this._markersNeedUpdate=!0}getRain(){return this.rain?this.rain.get():null}setRain(i){if(this._checkLoaded(),!i)return delete this.rain,void delete this.stylesheet.rain;if(this.rain){const l=this.rain;
602if(!s.bv(l.get(),i)){l.set(i,this.options),this.stylesheet.rain=l.get();const p=this._getTransitionParameters({duration:0});l.updateTransitions(p)}}else this._createRain(i);this._markersNeedUpdate=!0}_reloadColorTheme(){const i=()=>{for(const y in this._layers)this._layers[y].lut=this._styleColorTheme.lut;for(const y in this._sourceCaches)this._sourceCaches[y].clearTiles()},l=this._styleColorTheme.colorThemeOverride?this._styleColorTheme.colorThemeOverride:this._styleColorTheme.colorTheme;if(!l)return this._styleColorTheme.lut=null,void i();const p=this._evaluateColorThemeData(l);this._loadColorTheme(p).then(()=>{this.fire(new s.A("colorthemeset")),i()}).catch(y=>{s.w(`Couldn't set color theme: ${y}`)})}setColorTheme(i){this._checkLoaded(),this._styleColorTheme.colorThemeOverride&&s.w("Note: setColorTheme is called on a style with a color-theme override, the passed color-theme won't be visible."),this._styleColorTheme.colorTheme=i,this._reloadColorTheme()}setImportColorTheme(i,l){const p=this.getFragmentStyle(i);p&&(p._styleColorTheme.colorThemeOverride=l,p._reloadColorTheme())}_getTransitionParameters(i){return{now:s.q.now(),transition:s.l(this.transition,i)}}updateDrapeFirstLayers(){if(!this.terrain)return;const i=[],l=[];for(const p of this._mergedOrder)this.isLayerDraped(this._mergedLayers[p])?i.push(p):l.push(p);this._drapedFirstOrder=[],this._drapedFirstOrder.push(...i),this._drapedFirstOrder.push(...l)}_createTerrain(i,l){const p=this.terrain=new rt(i,l,this.scope,this.options);l===1&&(this.stylesheet.terrain=i),this.mergeTerrain(),this.updateDrapeFirstLayers(),this._force3DLayerUpdate();const y=this._getTransitionParameters({duration:0});p.updateTransitions(y)}_force3DLayerUpdate(){for(const i in this._layers){const l=this._layers[i];l.type==="fill-extrusion"&&this._updateLayer(l)}}_forceSymbolLayerUpdate(){for(const i in this._layers){const l=this._layers[i];l.type==="symbol"&&this._updateLayer(l)}}_validate(i,l,p,y,v={}){if(v&&v.validate===!1)return!1;const w=s.l({},this.serialize());return La(this,i.call(No,s.l({key:l,style:w,value:p,styleSpec:s.a5},y)))}_remove(){this._request&&(this._request.cancel(),this._request=null),this._spriteRequest&&(this._spriteRequest.cancel(),this._spriteRequest=null),s.dg.off("pluginStateChange",this._rtlTextPluginCallback);for(const i in this._mergedLayers)this._mergedLayers[i].setEventedParent(null);for(const i in this._mergedSourceCaches)this._mergedSourceCaches[i].clearTiles(),this._mergedSourceCaches[i].setEventedParent(null);this.imageManager.removeScope(this.scope),this.setEventedParent(null),delete this.fog,delete this.snow,delete this.rain,delete this.terrain,delete this.ambientLight,delete this.directionalLight,this.isRootStyle()&&(this.imageManager.setEventedParent(null),this.modelManager.setEventedParent(null),this.modelManager.destroy(),this.dispatcher.remove())}clearSource(i){const l=this.getSourceCaches(i);for(const p of l)p.clearTiles()}clearSources(){for(const i in this._mergedSourceCaches)this._mergedSourceCaches[i].clearTiles()}reloadSource(i){const l=this.getSourceCaches(i);for(const p of l)p.resume(),p.reload()}
602reloadSources(){for(const i of this.getSources())i.reload&&i.reload()}reloadModels(){this.modelManager.reloadModels(""),this.forEachFragmentStyle(i=>{i.modelManager.reloadModels(i.scope)})}updateSources(i){let l;this.directionalLight&&(l=mf(this.directionalLight));const p=new Set;for(const y in this._mergedLayers){const v=this._mergedLayers[y];v.hasElevation()&&!p.has(v.source)&&p.add(v.source)}for(const y in this._mergedSourceCaches){const v=this._mergedSourceCaches[y],w=p.has(v._source.id);v.update(i,void 0,void 0,l,w)}}_generateCollisionBoxes(){for(const i in this._sourceCaches){const l=this._sourceCaches[i];l.resume(),l.reload()}}_updatePlacement(i,l,p,y,v,w,S=!1){let C=!1,D=!1;const L={},F={};for(const O of this._mergedOrder){const $=this._mergedLayers[O];if($.type!=="symbol")continue;const q=s.C($.source,$.scope);let W=L[q];if(!W){const Z=this.getLayerSourceCache($);if(!Z)continue;const se=Z.getRenderableIds(!0).map(ue=>Z.getTileByID(ue));F[q]=se.slice(),W=L[q]=se.sort((ue,fe)=>fe.tileID.overscaledZ-ue.tileID.overscaledZ||(ue.tileID.isLessThan(fe.tileID)?-1:1))}const K=this.crossTileSymbolIndex.addLayer($,W,l.center.lng,l.projection);C=C||K}if(this.crossTileSymbolIndex.pruneUnusedLayers(this._mergedOrder),S=S||this._layerOrderChanged||y===0,this._layerOrderChanged&&this.fire(new s.A("neworder")),(S||!this.pauseablePlacement||this.pauseablePlacement.isDone()&&!this.placement.stillRecent(s.q.now(),l.zoom))&&(this.pauseablePlacement=new fo(l,this._mergedOrder,S,p,y,v,this.placement,this.fog&&l.projection.supportsFog?this.fog.state:null,this._buildingIndex),this._layerOrderChanged=!1),this.pauseablePlacement.isDone()?this.placement.setStale():(this.pauseablePlacement.continuePlacement(this._mergedOrder,this._mergedLayers,L,F,this.map.painter.scaleFactor),this.pauseablePlacement.isDone()&&(this.placement=this.pauseablePlacement.commit(s.q.now()),D=!0),C&&this.pauseablePlacement.placement.setStale()),D||C){this._buildingIndex.onNewFrame(l.zoom);for(let O=0;O<this._mergedOrder.length;O++){const $=this._mergedLayers[this._mergedOrder[O]];if($.type!=="symbol")continue;const q=this.isLayerClipped($);this.placement.updateLayerOpacities($,L[s.C($.source,$.scope)],O,q?w:null)}}return{needsRerender:!this.pauseablePlacement.isDone()||this.placement.hasTransitions(s.q.now())}}_releaseSymbolFadeTiles(){for(const i in this._sourceCaches)this._sourceCaches[i].releaseSymbolFadeTiles()}addImport(i,l){this._checkLoaded();const p=this.stylesheet.imports=this.stylesheet.imports||[];if(p.findIndex(({id:v})=>v===i.id)!==-1)return void this.fire(new s.z(new Error(`Import with id '${i.id}' already exists in the map's style.`)));if(!l)return p.push(i),this._loadImports([i],!0);const y=p.findIndex(({id:v})=>v===l);return y===-1&&this.fire(new s.z(new Error(`Import with id "${l}" does not exist on this map.`))),this.stylesheet.imports=p.slice(0,y).concat(i).concat(p.slice(y)),this._loadImports([i],!0,l)}updateImport(i,l){this._checkLoaded();const p=this.stylesheet.imports||[],y=this.getImportIndex(i);return y===-1?this:typeof l=="string"?(this.setImportUrl(i,l),this):(l.url&&l.url!==p[y].url&&this.setImportUrl(i,l.url),s.bv(l.config,p[y].config)||this.setImportConfig(i,l.config,l.data.schema),s.bv(l.data,p[y].data)||this.setImportData(i,l.data),this)}moveImport(i,l){this._checkLoaded();let p=this.stylesheet.imports||[];const y=this.getImportIndex(i);if(y===-1)return this;const v=this.getImportIndex(l);if(v===-1)return this;const w=p[y],S=this.fragments[y];return p=p.filter(({id:C})=>C!==i),this.fragments=this.fragments.filter(({id:C})=>
602C!==i),this.stylesheet.imports=p.slice(0,v).concat(w).concat(p.slice(v)),this.fragments=this.fragments.slice(0,v).concat(S).concat(this.fragments.slice(v)),this.mergeLayers(),this}setImportUrl(i,l){this._checkLoaded();const p=this.stylesheet.imports||[],y=this.getImportIndex(i);if(y===-1)return this;p[y].url=l;const v=this.fragments[y];return v.style=this._createFragmentStyle(p[y]),v.style.on("style.import.load",()=>this.mergeAll()),v.style.loadURL(l),this}setImportData(i,l){this._checkLoaded();const p=this.getImportIndex(i),y=this.stylesheet.imports||[];return p===-1?this:l?(this.fragments[p].style.setState(l),this._reloadImports(),this):(delete y[p].data,this.setImportUrl(i,y[p].url))}setImportConfig(i,l,p){this._checkLoaded();const y=this.getImportIndex(i),v=this.stylesheet.imports||[];if(y===-1)return this;l?v[y].config=l:delete v[y].config;const w=this.fragments[y];p&&w.style.stylesheet&&(w.style.stylesheet.schema=p);const S=w.style.stylesheet&&w.style.stylesheet.schema;return w.config=l,w.style.updateConfig(l,S),this.updateConfigDependencies(),this}removeImport(i){this._checkLoaded();const l=this.stylesheet.imports||[],p=this.getImportIndex(i);p!==-1&&(l.splice(p,1),this.fragments[p].style._remove(),this.fragments.splice(p,1),this._reloadImports())}getImportIndex(i){const l=(this.stylesheet.imports||[]).findIndex(p=>p.id===i);return l===-1&&this.fire(new s.z(new Error(`Import '${i}' does not exist in the map's style and cannot be updated.`))),l}getLayer(i){return this._mergedLayers[i]}getSources(){const i=[];for(const l in this._mergedOtherSourceCaches){const p=this._mergedOtherSourceCaches[l];p&&i.push(p.getSource())}return i}getSource(i,l){const p=this.getSourceCache(i,l);return p&&p.getSource()}getLayerSource(i){const l=this.getLayerSourceCache(i);return l&&l.getSource()}getSourceCache(i,l){const p=s.C(i,l);return this._mergedOtherSourceCaches[p]}getLayerSourceCache(i){const l=s.C(i.source,i.scope);return i.type==="symbol"?this._mergedSymbolSourceCaches[l]:this._mergedOtherSourceCaches[l]}getSourceCaches(i){if(i==null)return Object.values(this._mergedSourceCaches);const l=[];return this._mergedOtherSourceCaches[i]&&l.push(this._mergedOtherSourceCaches[i]),this._mergedSymbolSourceCaches[i]&&l.push(this._mergedSymbolSourceCaches[i]),l}updateSourceCaches(){const i=this._changes.getUpdatedSourceCaches();for(const l in i){const p=i[l];p==="reload"?this.reloadSource(l):p==="clear"&&this.clearSource(l)}}updateLayers(i){const l=this._changes.getUpdatedPaintProperties();for(const p of l){const y=this.getLayer(p);y&&y.updateTransitions(i)}}getGlyphsUrl(){return this.stylesheet.glyphs}setGlyphsUrl(i){this.stylesheet.glyphs=i,this.glyphManager.setURL(i,this.scope)}getImages(i,l,p){this.imageManager.getImages(l.images,l.scope,p),this._updateTilesForChangedImages();const y=w=>{if(w){const S=l.images.map(C=>s.I.toString(C));w.setDependencies(l.tileID.key,l.type,S)}},v=s.C(l.source,l.scope);y(this._mergedOtherSourceCaches[v]),y(this._mergedSymbolSourceCaches[v])}rasterizeImages(i,l,p){this.imageManager.rasterizeImages(l,p)}getGlyphs(i,l,p){this.glyphManager.getGlyphs(l.stacks,l.scope,p)}getResource(i,l,p){return s.dh(l,p)}getOwnSourceCache(i){return this._otherSourceCaches[i]}getOwnLayerSourceCache(i){return i.type==="symbol"?this._symbolSourceCaches[i.source]:this._otherSourceCaches[i.source]}getOwnSourceCaches(i){const l=[];return this._otherSourceCaches[i]&&l.push(this._otherSourceCaches[i]),this._symbolSourceCaches[i]&&l.push(this._symbolSourceCaches[i]),l}_isSourceCacheLoaded(i){const l=this.getOwnSourceCaches(i);return l.length===0?(this.fire(new s.z(new Error(`There is no source with ID '${i}'`))),!1):l.every(p=>p.loaded())}has3DLayers(){return this._has3DLayers}hasSymbolLayers(){return this._hasSymbolLayers}hasCircleLayers(){return this._hasCircleLayers}isLayerClipped(i,l){if(!this._clipLayerPresent&&i.type!=="fill-extrusion")return!1;const p=i.type==="fill-extrusion"&&i.sourceLayer==="building";if(i.is3D(!!this.terrain)){if(p||l&&l.type==="batched-model"||i.type==="model")return!0}else if(i.type==="symbol")return!0;return!1}_clearWorkerCaches(){this.dispatcher.broadcast("clearCaches")}
602destroy(){this._clearWorkerCaches(),this.fragments.forEach(i=>{i.style._remove()}),this.terrainSetForDrapingOnly()&&(delete this.terrain,delete this.stylesheet.terrain)}}ea.getSourceType=function(f){return $c[f]},ea.setSourceType=function(f,i){$c[f]=i},ea.registerForPluginStateChange=s.c$;var gc=` 603#define EPSILON 0.0000001 604#define PI 3.141592653589793 605#ifdef RENDER_CUTOFF 606float cutoff_opacity(vec4 cutoff_params,float depth) {float near=cutoff_params.x;float far=cutoff_params.y;float cutoffStart=cutoff_params.z;float cutoffEnd=cutoff_params.w;float linearDepth=(depth-near)/(far-near);return clamp((linearDepth-cutoffStart)/(cutoffEnd-cutoffStart),0.0,1.0);} 607#endif`,_c=` 608out vec4 glFragColor;highp float unpack_depth(highp vec4 rgba_depth) 609{const highp vec4 bit_shift=vec4(1.0/(255.0*255.0*255.0),1.0/(255.0*255.0),1.0/255.0,1.0);return dot(rgba_depth,bit_shift)*2.0-1.0;}highp vec4 pack_depth(highp float ndc_z) {highp float depth=ndc_z*0.5+0.5;const highp vec4 bit_shift=vec4(255.0*255.0*255.0,255.0*255.0,255.0,1.0);const highp vec4 bit_mask =vec4(0.0,1.0/255.0,1.0/255.0,1.0/255.0);highp vec4 res=fract(depth*bit_shift);res-=res.xxyz*bit_mask;return res;} 610#ifdef INDICATOR_CUTOUT 611uniform vec3 u_indicator_cutout_centers;uniform vec4 u_indicator_cutout_params; 612#endif 613vec4 applyCutout(vec4 color,float height) { 614#ifdef INDICATOR_CUTOUT 615float verticalFadeRange=u_indicator_cutout_centers.z*0.25;float holeMinOpacity=mix(1.0,u_indicator_cutout_params.x,smoothstep(u_indicator_cutout_centers.z,u_indicator_cutout_centers.z+verticalFadeRange,height));float holeRadius=max(u_indicator_cutout_params.y,0.0);float holeAspectRatio=u_indicator_cutout_params.z;float fadeStart=u_indicator_cutout_params.w;float distA=distance(vec2(gl_FragCoord.x,gl_FragCoord.y*holeAspectRatio),vec2(u_indicator_cutout_centers[0],u_indicator_cutout_centers[1]*holeAspectRatio));return color*min(smoothstep(fadeStart,holeRadius,distA)+holeMinOpacity,1.0); 616#else 617return color; 618#endif 619} 620#ifdef DEBUG_WIREFRAME 621#define HANDLE_WIREFRAME_DEBUG \\ 622glFragColor=vec4(0.7,0.0,0.0,0.7); \\ 623gl_FragDepth=gl_FragCoord.z-0.0001; 624#else 625#define HANDLE_WIREFRAME_DEBUG 626#endif 627#ifdef RENDER_CUTOFF 628uniform highp vec4 u_cutoff_params;in float v_cutoff_opacity; 629#endif 630vec4 textureLodCustom(sampler2D image,highp vec2 pos,highp vec2 lod_coord) {highp vec2 size=vec2(textureSize(image,0));highp vec2 dx=dFdx(lod_coord.xy*size);highp vec2 dy=dFdy(lod_coord.xy*size);highp float delta_max_sqr=max(dot(dx,dx),dot(dy,dy));highp float lod=0.5*log2(delta_max_sqr);return textureLod(image,pos,lod);}vec4 applyLUT(highp sampler3D lut,vec4 col) {vec3 size=vec3(textureSize(lut,0));vec3 uvw=(col.rbg*float(size-1.0)+0.5)/size;return vec4(texture(lut,uvw).rgb,col.a);}vec3 applyLUT(highp sampler3D lut,vec3 col) {return applyLUT(lut,vec4(col,1.0)).rgb;}`,Gh=` 631#define EXTENT 8192.0 632#define RAD_TO_DEG 180.0/PI 633#define DEG_TO_RAD PI/180.0 634#define GLOBE_RADIUS EXTENT/PI/2.0 635float wrap(float n,float min,float max) {float d=max-min;float w=mod(mod(n-min,d)+d,d)+min;return (w==min) ? max : w;} 636#ifdef PROJECTION_GLOBE_VIEW 637vec3 mercator_tile_position(mat4 matrix,vec2 tile_anchor,vec3 tile_id,vec2 mercator_center) { 638#ifndef PROJECTED_POS_ON_VIEWPORT 639float tiles=tile_id.z;vec2 mercator=(tile_anchor/EXTENT+tile_id.xy)/tiles;mercator-=mercator_center;mercator.x=wrap(mercator.x,-0.5,0.5);vec4 mercator_tile=vec4(mercator.xy*EXTENT,EXTENT/(2.0*PI),1.0);mercator_tile=matrix*mercator_tile;return mercator_tile.xyz; 640#else 641return vec3(0.0); 642#endif 643}vec3 mix_globe_mercator(vec3 globe,vec3 mercator,float t) {return mix(globe,mercator,t);}mat3 globe_mercator_surface_vectors(vec3 pos_normal,vec3 up_dir,float zoom_transition) {vec3 normal=zoom_transition==0.0 ? pos_normal : normalize(mix(pos_normal,up_dir,zoom_transition));vec3 xAxis=normalize(vec3(normal.z,0.0,-normal.x));vec3 yAxis=normalize(cross(normal,xAxis));return mat3(xAxis,yAxis,normal);} 644#endif 645vec2 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( 646unpack_float(encodedColor[0])/255.0,unpack_float(encodedColor[1])/255.0 647);}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 vec2 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);
647return (units_to_pixels*pos+offset)/pattern_size;}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) {return get_pattern_pos(pixel_coord_upper,pixel_coord_lower,pattern_size,vec2(tile_units_to_pixels),pos);}float mercatorXfromLng(float lng) {return (180.0+lng)/360.0;}float mercatorYfromLat(float lat) {return (180.0-(RAD_TO_DEG*log(tan(PI/4.0+lat/2.0*DEG_TO_RAD))))/360.0;}vec3 latLngToECEF(vec2 latLng) {latLng=DEG_TO_RAD*latLng;float cosLat=cos(latLng[0]);float sinLat=sin(latLng[0]);float cosLng=cos(latLng[1]);float sinLng=sin(latLng[1]);float sx=cosLat*sinLng*GLOBE_RADIUS;float sy=-sinLat*GLOBE_RADIUS;float sz=cosLat*cosLng*GLOBE_RADIUS;return vec3(sx,sy,sz);} 648#ifdef RENDER_CUTOFF 649uniform vec4 u_cutoff_params;out float v_cutoff_opacity; 650#endif 651const vec4 AWAY=vec4(-1000.0,-1000.0,-1000.0,1);const float skirtOffset=24575.0;vec3 decomposeToPosAndSkirt(vec2 posWithComposedSkirt) 652{float skirt=float(posWithComposedSkirt.x >=skirtOffset);vec2 pos=posWithComposedSkirt-vec2(skirt*skirtOffset,0.0);return vec3(pos,skirt);}`,$u="in highp vec3 a_pos_3f;uniform lowp mat4 u_matrix;out highp vec3 v_uv;void main() {const mat3 half_neg_pi_around_x=mat3(1.0,0.0, 0.0,0.0,0.0,-1.0,0.0,1.0, 0.0);v_uv=half_neg_pi_around_x*a_pos_3f;vec4 pos=u_matrix*vec4(a_pos_3f,1.0);gl_Position=pos.xyww;}",Go=` 653#define ELEVATION_SCALE 7.0 654#define ELEVATION_OFFSET 450.0 655#ifdef PROJECTION_GLOBE_VIEW 656uniform vec3 u_tile_tl_up;uniform vec3 u_tile_tr_up;uniform vec3 u_tile_br_up;uniform vec3 u_tile_bl_up;uniform float u_tile_up_scale;vec3 elevationVector(vec2 pos) {vec2 uv=pos/EXTENT;vec3 up=normalize(mix( 657mix(u_tile_tl_up,u_tile_tr_up,uv.xxx),mix(u_tile_bl_up,u_tile_br_up,uv.xxx),uv.yyy));return up*u_tile_up_scale;} 658#else 659vec3 elevationVector(vec2 pos) { return vec3(0,0,1); } 660#endif 661#ifdef TERRAIN 662uniform highp sampler2D u_dem;uniform highp sampler2D u_dem_prev;uniform vec2 u_dem_tl;uniform vec2 u_dem_tl_prev;uniform float u_dem_scale;uniform float u_dem_scale_prev;uniform float u_dem_size;uniform float u_dem_lerp;uniform float u_exaggeration;uniform float u_meter_to_dem;uniform mat4 u_label_plane_matrix_inv;vec4 tileUvToDemSample(vec2 uv,float dem_size,float dem_scale,vec2 dem_tl) {vec2 pos=dem_size*(uv*dem_scale+dem_tl)+1.0;vec2 f=fract(pos);return vec4((pos-f+0.5)/(dem_size+2.0),f);}float currentElevation(vec2 apos) { 663#ifdef TERRAIN_DEM_FLOAT_FORMAT 664vec2 pos=(u_dem_size*(apos/8192.0*u_dem_scale+u_dem_tl)+1.5)/(u_dem_size+2.0);return u_exaggeration*texture(u_dem,pos).r; 665#else 666float dd=1.0/(u_dem_size+2.0);vec4 r=tileUvToDemSample(apos/8192.0,u_dem_size,u_dem_scale,u_dem_tl);vec2 pos=r.xy;vec2 f=r.zw;float tl=texture(u_dem,pos).r;float tr=texture(u_dem,pos+vec2(dd,0)).r;float bl=texture(u_dem,pos+vec2(0,dd)).r;float br=texture(u_dem,pos+vec2(dd,dd)).r;return u_exaggeration*mix(mix(tl,tr,f.x),mix(bl,br,f.x),f.y); 667#endif 668}float prevElevation(vec2 apos) { 669#ifdef TERRAIN_DEM_FLOAT_FORMAT 670vec2 pos=(u_dem_size*(apos/8192.0*u_dem_scale_prev+u_dem_tl_prev)+1.5)/(u_dem_size+2.0);return u_exaggeration*texture(u_dem_prev,pos).r; 671#else 672float dd=1.0/(u_dem_size+2.0);vec4 r=tileUvToDemSample(apos/8192.0,u_dem_size,u_dem_scale_prev,u_dem_tl_prev);vec2 pos=r.xy;vec2 f=r.zw;float tl=texture(u_dem_prev,pos).r;float tr=texture(u_dem_prev,pos+vec2(dd,0)).r;float bl=texture(u_dem_prev,pos+vec2(0,dd)).r;float br=texture(u_dem_prev,pos+vec2(dd,dd)).r;return u_exaggeration*mix(mix(tl,tr,f.x),mix(bl,br,f.x),f.y); 673#endif 674} 675#ifdef TERRAIN_VERTEX_MORPHING 676float elevation(vec2 apos) { 677#ifdef ZERO_EXAGGERATION 678return 0.0; 679#endif 680float nextElevation=currentElevation(apos);float prevElevation=prevElevation(apos);return mix(prevElevation,nextElevation,u_dem_lerp);} 681#else 682float elevation(vec2 apos) { 683#ifdef ZERO_EXAGGERATION 684return 0.0; 685#endif 686return currentElevation(apos);} 687#endif 688vec4 fourSample(vec2 pos,vec2 off) {float tl=texture(u_dem,pos).r;float tr=texture(u_dem,pos+vec2(off.x,0.0)).r;float bl=texture(u_dem,pos+vec2(0.0,off.y)).r;float br=texture(u_dem,pos+off).r;return vec4(tl,tr,bl,br);}float flatElevation(vec2 pack) {vec2 apos=floor(pack/8.0);vec2 span=10.0*(pack-apos*8.0);vec2 uvTex=(apos-vec2(1.0,1.0))/8190.0;float size=u_dem_size+2.0;float dd=1.0/size;vec2 pos=u_dem_size*(uvTex*u_dem_scale+u_dem_tl)+1.0;vec2 f=fract(pos);pos=(pos-f+0.5)*dd;vec4 h=fourSample(pos,vec2(dd));float z=mix(mix(h.x,h.y,f.x),mix(h.z,h.w,f.x),f.y);vec2 w=floor(0.5*(span*u_meter_to_dem-1.0));vec2 d=dd*w;h=fourSample(pos-d,2.0*d+vec2(dd));vec4 diff=abs(h.xzxy-h.ywzw);vec2 slope=min(vec2(0.25),u_meter_to_dem*0.5*(diff.xz+diff.yw)/(2.0*w+vec2(1.0)));vec2 fix=slope*span;float base=z+max(fix.x,fix.y);return u_exaggeration*base;}float elevationFromUint16(float word) {return u_exaggeration*(word/ELEVATION_SCALE-ELEVATION_OFFSET);} 689#else 690float elevation(vec2 pos) { return 0.0; } 691#endif 692#ifdef DEPTH_OCCLUSION 693uniform highp sampler2D u_depth;uniform highp vec2 u_depth_size_inv;uniform highp vec2 u_depth_range_unpack;uniform highp float u_occluder_half_size;uniform highp float u_occlusion_depth_offset; 694#ifdef DEPTH_D24 695float unpack_depth(float depth) {return depth*u_depth_range_unpack.x+u_depth_range_unpack.y;}vec4 unpack_depth4(vec4 depth) {return depth*u_depth_range_unpack.x+vec4(u_depth_range_unpack.y);} 696#else 697highp float unpack_depth_rgba(vec4 rgba_depth) 698{const highp vec4 bit_shift=vec4(1.0/(255.0*255.0*255.0),1.0/(255.0*255.0),1.0/255.0,1.0);return dot(rgba_depth,bit_shift)*2.0-1.0;} 699#endif 700bool isOccluded(vec4 frag) {vec3 coord=frag.xyz/frag.w; 701#ifdef DEPTH_D24 702float depth=unpack_depth(texture(u_depth,(coord.xy+1.0)*0.5).r); 703#else 704float depth=unpack_depth_rgba(texture(u_depth,(coord.xy+1.0)*0.5)); 705#endif 706return coord.z+u_occlusion_depth_offset > depth;}highp vec4 getCornerDepths(vec2 coord) {highp vec3 df=vec3(u_occluder_half_size*u_depth_
706size_inv,0.0);highp vec2 uv=0.5*coord.xy+0.5; 707#ifdef DEPTH_D24 708highp vec4 depth=vec4( 709texture(u_depth,uv-df.xz).r,texture(u_depth,uv+df.xz).r,texture(u_depth,uv-df.zy).r,texture(u_depth,uv+df.zy).r 710);depth=unpack_depth4(depth); 711#else 712highp vec4 depth=vec4( 713unpack_depth_rgba(texture(u_depth,uv-df.xz)),unpack_depth_rgba(texture(u_depth,uv+df.xz)),unpack_depth_rgba(texture(u_depth,uv-df.zy)),unpack_depth_rgba(texture(u_depth,uv+df.zy)) 714); 715#endif 716return depth;}highp float occlusionFadeMultiSample(vec4 frag) {highp vec3 coord=frag.xyz/frag.w;highp vec2 uv=0.5*coord.xy+0.5;int NX=3;int NY=4;highp vec2 df=u_occluder_half_size*u_depth_size_inv;highp vec2 oneStep=2.0*u_occluder_half_size*u_depth_size_inv/vec2(NX-1,NY-1);highp float res=0.0;for (int y=0; y < NY;++y) {for (int x=0; x < NX;++x) { 717#ifdef DEPTH_D24 718highp float depth=unpack_depth(texture(u_depth,uv-df+vec2(float(x)*oneStep.x,float(y)*oneStep.y)).r); 719#else 720highp float depth=unpack_depth_rgba(texture(u_depth,uv-df+vec2(float(x)*oneStep.x,float(y)*oneStep.y))); 721#endif 722res+=1.0-clamp(300.0*(coord.z+u_occlusion_depth_offset-depth),0.0,1.0);}}res=clamp(2.0*res/float(NX*NY)-0.5,0.0,1.0);return res;}highp float occlusionFade(vec4 frag) {highp vec3 coord=frag.xyz/frag.w;highp vec4 depth=getCornerDepths(coord.xy);return dot(vec4(0.25),vec4(1.0)-clamp(300.0*(vec4(coord.z+u_occlusion_depth_offset)-depth),0.0,1.0));} 723#else 724bool isOccluded(vec4 frag) { return false; }highp float occlusionFade(vec4 frag) { return 1.0; }highp float occlusionFadeMultiSample(vec4 frag) { return 1.0; } 725#endif//DEPTH_OCCLUSION`,Wh=`#ifdef FOG 726uniform mediump vec4 u_fog_color;uniform mediump vec2 u_fog_range;uniform mediump float u_fog_horizon_blend;uniform mediump mat4 u_fog_matrix;out vec3 v_fog_pos;float fog_range(float depth) {return (depth-u_fog_range[0])/(u_fog_range[1]-u_fog_range[0]);}float fog_horizon_blending(vec3 camera_dir) {float t=max(0.0,camera_dir.z/u_fog_horizon_blend);return u_fog_color.a*exp(-3.0*t*t);}float fog_opacity(float t) {const float decay=6.0;float falloff=1.0-min(1.0,exp(-decay*t));falloff*=falloff*falloff;return u_fog_color.a*min(1.0,1.00747*falloff);}vec3 fog_position(vec3 pos) {return (u_fog_matrix*vec4(pos,1.0)).xyz;}vec3 fog_position(vec2 pos) {return fog_position(vec3(pos,0.0));}float fog(vec3 pos) {float depth=length(pos);float opacity=fog_opacity(fog_range(depth));return opacity*fog_horizon_blending(pos/depth);} 727#endif`,Rt=`#ifdef FOG 728uniform mediump vec4 u_fog_color;uniform mediump vec2 u_fog_range;uniform mediump float u_fog_horizon_blend;uniform mediump vec2 u_fog_vertical_limit;uniform mediump float u_fog_temporal_offset;in vec3 v_fog_pos;uniform highp vec3 u_frustum_tl;uniform highp vec3 u_frustum_tr;uniform highp vec3 u_frustum_br;uniform highp vec3 u_frustum_bl;uniform highp vec3 u_globe_pos;uniform highp float u_globe_radius;uniform highp vec2 u_viewport;uniform float u_globe_transition;uniform int u_is_globe;float fog_range(float depth) {return (depth-u_fog_range[0])/(u_fog_range[1]-u_fog_range[0]);}float fog_horizon_blending(vec3 camera_dir) {float t=max(0.0,camera_dir.z/u_fog_horizon_blend);return u_fog_color.a*exp(-3.0*t*t);}float fog_opacity(float t) {const float decay=6.0;float falloff=1.0-min(1.0,exp(-decay*t));falloff*=falloff*falloff;return u_fog_color.a*min(1.0,1.00747*falloff);}float globe_glow_progress() {highp vec2 uv=gl_FragCoord.xy/u_viewport;highp vec3 ray_dir=mix( 729mix(u_frustum_tl,u_frustum_tr,uv.x),mix(u_frustum_bl,u_frustum_br,uv.x),1.0-uv.y);highp vec3 dir=normalize(ray_dir);highp vec3 closest_point=dot(u_globe_pos,dir)*dir;highp float sdf=length(closest_point-u_globe_pos)/u_globe_radius;return sdf+PI*0.5;}float fog_opacity(vec3 pos) {float depth=length(pos);return fog_opacity(fog_range(depth));}vec3 fog_apply(vec3 color,vec3 pos,float opacity_limit) {float depth=length(pos);float opacity;if (u_is_globe==1) {float glow_progress=globe_glow_progress();float t=mix(glow_progress,depth,u_globe_transition);opacity=fog_opacity(fog_range(t));} else {opacity=fog_opacity(fog_range(depth));opacity*=fog_horizon_blending(pos/depth);}return mix(color,u_fog_color.rgb,min(opacity,opacity_limit));}vec3 fog_apply(vec3 color,vec3 pos) {return fog_apply(color,pos,1.0);}vec4 fog_apply_from_vert(vec4 color,float fog_opac) {float alpha=EPSILON+color.a;color.rgb=mix(color.rgb/alpha,u_fog_color.rgb,fog_opac)*alpha;return color;}
729vec3 fog_apply_sky_gradient(vec3 camera_ray,vec3 sky_color) {float horizon_blend=fog_horizon_blending(normalize(camera_ray));return mix(sky_color,u_fog_color.rgb,horizon_blend);}vec4 fog_apply_premultiplied(vec4 color,vec3 pos) {float alpha=EPSILON+color.a;color.rgb=fog_apply(color.rgb/alpha,pos)*alpha;return color;}vec4 fog_apply_premultiplied(vec4 color,vec3 pos,float heightMeters) {float verticalProgress=(u_fog_vertical_limit.x > 0.0 || u_fog_vertical_limit.y > 0.0) ? smoothstep(u_fog_vertical_limit.x,u_fog_vertical_limit.y,heightMeters) : 0.0;float opacityLimit=1.0-smoothstep(0.9,1.0,fog_opacity(pos));return mix(fog_apply_premultiplied(color,pos),color,min(verticalProgress,opacityLimit));}vec3 fog_dither(vec3 color) {return color;}vec4 fog_dither(vec4 color) {return vec4(fog_dither(color.rgb),color.a);} 730#endif`,qh=`#ifdef RASTER_ARRAY 731uniform highp sampler2D u_image0;uniform sampler2D u_image1;const vec4 NODATA=vec4(1);ivec4 _raTexLinearCoord(highp vec2 texCoord,highp vec2 texResolution,out highp vec2 fxy) {texCoord=texCoord*texResolution-0.5;fxy=fract(texCoord);texCoord-=fxy;return ivec4(texCoord.xxyy+vec2(1.5,0.5).xyxy);}vec2 _raTexLinearMix(highp vec2 fxy,highp vec4 colorMix,highp float colorOffset,highp vec4 t00,highp vec4 t10,highp vec4 t01,highp vec4 t11) {vec2 c00=t00==NODATA ? vec2(0) : vec2(colorOffset+dot(t00,colorMix),1);vec2 c10=t10==NODATA ? vec2(0) : vec2(colorOffset+dot(t10,colorMix),1);vec2 c01=t01==NODATA ? vec2(0) : vec2(colorOffset+dot(t01,colorMix),1);vec2 c11=t11==NODATA ? vec2(0) : vec2(colorOffset+dot(t11,colorMix),1);return mix(mix(c01,c11,fxy.x),mix(c00,c10,fxy.x),fxy.y);}vec2 raTexture2D_image0_linear(highp vec2 texCoord,highp vec2 texResolution,highp vec4 colorMix,highp float colorOffset) {vec2 fxy;ivec4 c=_raTexLinearCoord(texCoord,texResolution,fxy);return _raTexLinearMix(fxy,colorMix,colorOffset,texelFetch(u_image0,c.yz,0),texelFetch(u_image0,c.xz,0),texelFetch(u_image0,c.yw,0),texelFetch(u_image0,c.xw,0) 732);}vec2 raTexture2D_image1_linear(highp vec2 texCoord,highp vec2 texResolution,highp vec4 colorMix,highp float colorOffset) {vec2 fxy;ivec4 c=_raTexLinearCoord(texCoord,texResolution,fxy);return _raTexLinearMix(fxy,colorMix,colorOffset,texelFetch(u_image1,c.yz,0),texelFetch(u_image1,c.xz,0),texelFetch(u_image1,c.yw,0),texelFetch(u_image1,c.xw,0) 733);}vec2 raTexture2D_image0_nearest(highp vec2 texCoord,highp vec2 texResolution,highp vec4 colorMix,highp float colorOffset) {vec4 t=texelFetch(u_image0,ivec2(texCoord*texResolution),0);return t==NODATA ? vec2(0) : vec2(colorOffset+dot(t,colorMix),1);}vec2 raTexture2D_image1_nearest(highp vec2 texCoord,highp vec2 texResolution,highp vec4 colorMix,highp float colorOffset) {vec4 t=texelFetch(u_image1,ivec2(texCoord*texResolution),0);return t==NODATA ? vec2(0) : vec2(colorOffset+dot(t,colorMix),1);} 734#endif`,ju=`#ifdef RASTER_ARRAY 735uniform sampler2D u_velocity;uniform mediump vec2 u_velocity_res;uniform mediump float u_max_speed;const vec4 NO_DATA=vec4(1);const vec2 INVALID_VELOCITY=vec2(-1);uniform highp vec2 u_uv_offset;uniform highp float u_data_offset;uniform highp vec2 u_data_scale;ivec4 rasterArrayLinearCoord(highp vec2 texCoord,highp vec2 texResolution,out highp vec2 fxy) {texCoord=texCoord*texResolution-0.5;fxy=fract(texCoord);texCoord-=fxy;return ivec4(texCoord.xxyy+vec2(1.5,0.5).xyxy);}highp vec2 lookup_velocity(highp vec2 uv) {uv=u_uv_offset.x+u_uv_offset.y*uv;highp vec2 fxy;ivec4 c=rasterArrayLinearCoord(uv,u_velocity_res,fxy);highp vec4 tl=texelFetch(u_velocity,c.yz,0);highp vec4 tr=texelFetch(u_velocity,c.xz,0);highp vec4 bl=texelFetch(u_velocity,c.yw,0);highp vec4 br=texelFetch(u_velocity,c.xw,0);if (tl==NO_DATA) {return INVALID_VELOCITY;}if (tr==NO_DATA) {return INVALID_VELOCITY;}if (bl==NO_DATA) {return INVALID_VELOCITY;}if (br==NO_DATA) {return INVALID_VELOCITY;}highp vec4 t=mix(mix(bl,br,fxy.x),mix(tl,tr,fxy.x),fxy.y);highp vec2 velocity=u_data_offset+vec2(dot(t.rg,u_data_scale),dot(t.ba,u_data_scale));velocity.y=-velocity.y;velocity/=max(u_max_speed,length(velocity));return velocity;} 736#endif 737uniform highp float u_particle_pos_scale;uniform highp vec2 u_particle_pos_offset;highp vec4 pack_pos_to_rgba(highp vec2 p) {highp vec2 v=(p+u_particle_pos_offset)/u_particle_pos_scale;highp vec4 r=vec4(v.x,fract(v.x*255.0),v.y,fract(v.y*255.0));return vec4(r.x-r.y/255.0,r.y,r.z-r.w/255.0,r.w);}highp vec2 unpack_pos_from_rgba(highp vec4 v) {v=floor(v*255.0+0.5)/255.0;highp vec2 p=vec2(v.x+(v.y/255.0),v.z+(v.w/255.0));return u_particle_pos_scale*p-u_particle_pos_offset;}`,Zh=`#ifdef RENDER_SHADOWS 738uniform mediump vec3 u_shadow_direction;uniform highp vec3 u_shadow_normal_offset;vec3 shadow_normal_offset(vec3 normal) {float tileInMeters=u_shadow_normal_offset[0];vec3 n=vec3(-normal.xy,tileInMeters*normal.z);float dotScale=min(1.0-dot(normal,u_shadow_direction),1.0)*0.5+0.5;return n*dotScale;}vec3 shadow_normal_offset_model(vec3 normal) {vec3 transformed_normal=vec3(-normal.xy,normal.z);float NDotL=dot(normalize(transformed_normal),u_shadow_direction);float dotScale=min(1.0-NDotL,1.0)*0.5+0.5;return normal*dotScale;}float shadow_normal_offset_multiplier0() {return u_shadow_normal_offset[1];}float shadow_normal_offset_multiplier1() {return u_shadow_normal_offset[2];} 739#endif//RENDER_SHADOWS`,_f=`#ifdef RENDER_SHADOWS 740#ifdef DEPTH_TEXTURE 741uniform highp sampler2D u_shadowmap_0;uniform highp sampler2D u_shadowmap_1; 742#else 743uniform sampler2D u_shadowmap_0;uniform sampler2D u_shadowmap_1; 744#endif 745uniform float u_shadow_intensity;uniform float u_shadow_map_resolution;uniform float u_shadow_texel_size;uniform highp vec3 u_shadow_normal_offset;uniform vec2 u_fade_range;uniform mediump vec3 u_shadow_direction;uniform highp vec3 u_shadow_bias;highp float shadow_sample_1(highp vec2 uv,highp float compare) {highp float shadow_depth; 746#ifdef DEPTH_TEXTURE
747shadow_depth=texture(u_shadowmap_1,uv).r; 748#else 749shadow_depth=unpack_depth(texture(u_shadowmap_1,uv))*0.5+0.5; 750#endif 751return step(shadow_depth,compare);}highp float shadow_sample_0(highp vec2 uv,highp float compare) {highp float shadow_depth; 752#ifdef DEPTH_TEXTURE 753shadow_depth=texture(u_shadowmap_0,uv).r; 754#else 755shadow_depth=unpack_depth(texture(u_shadowmap_0,uv))*0.5+0.5; 756#endif 757return step(shadow_depth,compare);}float shadow_occlusion_1(highp vec4 pos,highp float bias) {highp vec2 uv=pos.xy;return shadow_sample_1(uv,pos.z-bias);}float shadow_occlusion_0(highp vec4 pos,highp float bias) {highp float compare0=pos.z-bias; 758#ifdef TEXTURE_GATHER 759highp vec2 uv=pos.xy;highp vec4 samples=textureGather(u_shadowmap_0,uv,0);lowp vec4 stepSamples=step(samples,vec4(compare0)); 760#else 761highp vec2 uv00=pos.xy-vec2(0.5*u_shadow_texel_size);highp vec2 uv10=uv00+vec2(u_shadow_texel_size,0.0);highp vec2 uv01=uv00+vec2(0.0,u_shadow_texel_size);highp vec2 uv11=uv01+vec2(u_shadow_texel_size,0.0);lowp vec4 stepSamples=vec4( 762shadow_sample_0(uv01,compare0),shadow_sample_0(uv11,compare0),shadow_sample_0(uv10,compare0),shadow_sample_0(uv00,compare0) 763); 764#endif 765vec2 f=fract(pos.xy*u_shadow_map_resolution-vec2(0.5));lowp vec2 lerpx=mix(stepSamples.wx,stepSamples.zy,f.xx);return clamp(mix(lerpx.x,lerpx.y,f.y),0.0,1.0);}float shadow_occlusion(highp vec4 light_view_pos0,highp vec4 light_view_pos1,float view_depth,highp float bias) { 766#ifdef SHADOWS_SINGLE_CASCADE 767light_view_pos0.xyz/=light_view_pos0.w;vec2 abs_bounds=abs(light_view_pos0.xy);if (abs_bounds.x >=1.0 || abs_bounds.y >=1.0) {return 0.0;}light_view_pos0.xyz=light_view_pos0.xyz*0.5+0.5;return shadow_occlusion_0(light_view_pos0,bias); 768#else 769light_view_pos0.xyz/=light_view_pos0.w;light_view_pos1.xyz/=light_view_pos1.w;vec4 uv=vec4(light_view_pos0.xy,light_view_pos1.xy);vec4 abs_bounds=abs(uv);if (abs_bounds.x < 1.0 && abs_bounds.y < 1.0) {light_view_pos0.xyz=light_view_pos0.xyz*0.5+0.5;return shadow_occlusion_0(light_view_pos0,bias);}if (abs_bounds.z >=1.0 || abs_bounds.w >=1.0) {return 0.0;}light_view_pos1.xyz=light_view_pos1.xyz*0.5+0.5;float occlusion1=shadow_occlusion_1(light_view_pos1,bias);return clamp(mix(occlusion1,0.0,smoothstep(u_fade_range.x,u_fade_range.y,view_depth)),0.0,1.0); 770#endif 771}highp float calculate_shadow_bias(float NDotL) { 772#ifdef NORMAL_OFFSET 773return 0.5*u_shadow_bias.x; 774#else 775return 0.5*(u_shadow_bias.x+clamp(u_shadow_bias.y*tan(acos(NDotL)),0.0,u_shadow_bias.z)); 776#endif 777}float shadowed_light_factor_normal(vec3 N,highp vec4 light_view_pos0,highp vec4 light_view_pos1,float view_depth) {float NDotL=dot(N,u_shadow_direction);float bias=calculate_shadow_bias(NDotL);float occlusion=shadow_occlusion(light_view_pos0,light_view_pos1,view_depth,bias);return mix(0.0,(1.0-(u_shadow_intensity*occlusion))*NDotL,step(0.0,NDotL));}float shadowed_light_factor_normal_opacity(vec3 N,highp vec4 light_view_pos0,highp vec4 light_view_pos1,float view_depth,float shadow_opacity) {float NDotL=dot(N,u_shadow_direction);float bias=calculate_shadow_bias(NDotL);float occlusion=shadow_occlusion(light_view_pos0,light_view_pos1,view_depth,bias)*shadow_opacity;return mix(0.0,(1.0-(u_shadow_intensity*occlusion))*NDotL,step(0.0,NDotL));}float shadowed_light_factor_normal_unbiased(vec3 N,highp vec4 light_view_pos0,highp vec4 light_view_pos1,float view_depth) {float NDotL=dot(N,u_shadow_direction);float bias=0.0;float occlusion=shadow_occlusion(light_view_pos0,light_view_pos1,view_depth,bias);return mix(0.0,(1.0-(u_shadow_intensity*occlusion))*NDotL,step(0.0,NDotL));}highp vec2 compute_receiver_plane_depth_bias(highp vec3 pos_dx,highp vec3 pos_dy) 778{highp vec2 biasUV=vec2( 779pos_dy.y*pos_dx.z-pos_dx.y*pos_dy.z,pos_dx.x*pos_dy.z-pos_dy.x*pos_dx.z);biasUV*=1.0/((pos_dx.x*pos_dy.y)-(pos_dx.y*pos_dy.x));return biasUV;}float shadowed_light_factor_plane_bias(highp vec4 light_view_pos0,highp vec4 light_view_pos1,float view_depth) {highp vec3 light_view_pos0_xyz=light_view_pos0.xyz/light_view_pos0.w*0.5+0.5;highp vec3 light_view_pos0_ddx=dFdx(light_view_pos0_xyz);highp vec3 light_view_pos0_ddy=dFdy(light_view_pos0_xyz);highp vec2 plane_depth_bias=compute_receiver_plane_depth_bias(light_view_pos0_ddx,light_view_pos0_ddy);highp float bias=dot(vec2(u_shadow_texel_size,u_shadow_texel_size),plane_depth_bias)+0.0001;float occlusion=shadow_occlusion(light_view_pos0,light_view_pos1,view_depth,bias);return 1.0-(u_shadow_intensity*occlusion);}float shadowed_light_factor(highp vec4 light_view_pos0,highp vec4 light_view_pos1,float view_depth) {float bias=0.0;float occlusion=shadow_occlusion(light_view_pos0,light_view_pos1,view_depth,bias);return 1.0-(u_shadow_intensity*occlusion);}float shadow_occlusion(float ndotl,highp vec4 light_view_pos0,highp vec4 light_view_pos1,float view_depth) {float bias=calculate_shadow_bias(ndotl);return shadow_occlusion(light_view_pos0,light_view_pos1,view_depth,bias);} 780#endif`;const yc=[];Jc(gc,yc),Jc(Gh,yc),Jc(_c,yc);const ta={"_prelude_fog.vertex.glsl":Wh,"_prelude_terrain.vertex.glsl":Go,"_prelude_shadow.vertex.glsl":Zh,"_prelude_fog.fragment.glsl":Rt,"_prelude_shadow.fragment.glsl":_f,"_prelude_lighting.glsl":` 781#ifdef LIGHTING_3D_MODE 782uniform mediump vec3 u_lighting_ambient_color;uniform mediump vec3 u_lighting_directional_dir;uniform mediump vec3 u_lighting_directional_color;uniform mediump vec3 u_ground_radiance;float calculate_ambient_directional_factor(vec3 normal) {float NdotL=dot(normal,u_lighting_directional_dir);const float factor_reduction_max=0.3;float dir_luminance=dot(u_lighting_directional_color,vec3(0.2126,0.7152,0.0722));float directional_factor_min=1.0-factor_reduction_max*min(dir_luminance,1.0);float ambient_directional_factor=mix(directional_factor_min,1.0,min((NdotL+1.0),1.0
782));const float vertical_factor_min=0.92;float vertical_factor=mix(vertical_factor_min,1.0,normal.z*0.5+0.5);return vertical_factor*ambient_directional_factor;}vec3 linearProduct(vec3 srgbIn,vec3 k) {return srgbIn*pow(k,vec3(1./2.2));}vec3 apply_lighting(vec3 color,vec3 normal,float dir_factor) {float ambient_directional_factor=calculate_ambient_directional_factor(normal);vec3 ambient_contrib=ambient_directional_factor*u_lighting_ambient_color;vec3 directional_contrib=u_lighting_directional_color*dir_factor;return linearProduct(color,ambient_contrib+directional_contrib);}vec4 apply_lighting(vec4 color,vec3 normal,float dir_factor) {return vec4(apply_lighting(color.rgb,normal,dir_factor),color.a);}vec3 apply_lighting(vec3 color,vec3 normal) {float dir_factor=max(dot(normal,u_lighting_directional_dir),0.0);return apply_lighting(color.rgb,normal,dir_factor);}vec4 apply_lighting(vec4 color,vec3 normal) {float dir_factor=max(dot(normal,u_lighting_directional_dir),0.0);return vec4(apply_lighting(color.rgb,normal,dir_factor),color.a);}vec3 apply_lighting_ground(vec3 color) {return color*u_ground_radiance;}vec4 apply_lighting_ground(vec4 color) {return vec4(apply_lighting_ground(color.rgb),color.a);}float calculate_NdotL(vec3 normal) {const float ext=0.70710678118;return (clamp(dot(normal,u_lighting_directional_dir),-ext,1.0)+ext)/(1.0+ext);}vec4 apply_lighting_with_emission_ground(vec4 color,float emissive_strength) {return mix(apply_lighting_ground(color),color,emissive_strength);}vec3 compute_flood_lighting(vec3 flood_light_color,float fully_occluded_factor,float occlusion,vec3 ground_shadow_factor) {vec3 fully_occluded_color=flood_light_color*mix(ground_shadow_factor,vec3(1.0),fully_occluded_factor);float occlusion_ramp=smoothstep(0.0,0.2,1.0-occlusion);return mix(fully_occluded_color,flood_light_color,occlusion_ramp);}vec3 compute_emissive_draped(vec3 unlit_color,float fully_occluded_factor,float occlusion,vec3 ground_shadow_factor) {vec3 fully_occluded_color=unlit_color*mix(ground_shadow_factor,vec3(1.0),fully_occluded_factor);return mix(fully_occluded_color,unlit_color,1.0-occlusion);} 783#endif//LIGHTING_3D_MODE`,"_prelude_raster_array.glsl":qh,"_prelude_raster_particle.glsl":ju},Yc={};vn("",Go),vn(Rt,Wh),vn(_f,Zh),vn(qh,""),vn(ju,"");const go=vn(_c,Gh),Kc=gc;var vc={background:vn(`#include "_prelude_fog.fragment.glsl" 784#include "_prelude_lighting.glsl" 785uniform vec4 u_color;uniform float u_opacity; 786#ifdef LIGHTING_3D_MODE 787in vec4 v_color; 788#endif 789void main() {vec4 out_color; 790#ifdef LIGHTING_3D_MODE 791out_color=v_color; 792#else 793out_color=u_color; 794#endif 795#ifdef FOG 796out_color=fog_dither(fog_apply_premultiplied(out_color,v_fog_pos)); 797#endif 798glFragColor=out_color*u_opacity; 799#ifdef OVERDRAW_INSPECTOR 800glFragColor=vec4(1.0); 801#endif 802HANDLE_WIREFRAME_DEBUG;}`,`#include "_prelude_fog.vertex.glsl" 803#include "_prelude_lighting.glsl" 804in vec2 a_pos;uniform mat4 u_matrix; 805#ifdef LIGHTING_3D_MODE 806uniform mediump vec4 u_color;out vec4 v_color;uniform float u_emissive_strength; 807#endif 808void main() {gl_Position=u_matrix*vec4(a_pos,0,1); 809#ifdef LIGHTING_3D_MODE 810v_color=apply_lighting_with_emission_ground(u_color,u_emissive_strength); 811#endif 812#ifdef FOG 813v_fog_pos=fog_position(a_pos); 814#endif 815}`),backgroundPattern:vn(`#include "_prelude_fog.fragment.glsl" 816#include "_prelude_lighting.glsl" 817uniform vec2 u_pattern_tl;uniform vec2 u_pattern_br;uniform vec2 u_texsize;uniform float u_opacity;uniform float u_emissive_strength;uniform sampler2D u_image;in highp vec2 v_pos;void main() {highp vec2 imagecoord=mod(v_pos,1.0);highp vec2 pos=mix(u_pattern_tl/u_texsize,u_pattern_br/u_texsize,imagecoord);vec4 out_color=textureLodCustom(u_image,pos,v_pos); 818#ifdef LIGHTING_3D_MODE 819out_color=apply_lighting_with_emission_ground(out_color,u_emissive_strength); 820#endif 821#ifdef FOG 822out_color=fog_dither(fog_apply_premultiplied(out_color,v_fog_pos)); 823#endif 824glFragColor=out_color*u_opacity; 825#ifdef OVERDRAW_INSPECTOR 826glFragColor=vec4(1.0); 827#endif 828HANDLE_WIREFRAME_DEBUG;}`,`#include "_prelude_fog.vertex.glsl" 829uniform mat4 u_matrix;uniform vec2 u_pattern_size;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform vec2 u_pattern_units_to_pixels;in vec2 a_pos;out highp vec2 v_pos;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);v_pos=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,u_pattern_size,u_pattern_units_to_pixels,a_pos); 830#ifdef FOG 831v_fog_pos=fog_position(a_pos); 832#endif 833}`),building:vn(`#include "_prelude_fog.fragment.glsl" 834#include "_prelude_shadow.fragment.glsl" 835#include "_prelude_lighting.glsl" 836in vec4 v_color;in highp vec3 v_normal;in highp float v_height; 837#ifdef RENDER_SHADOWS 838in highp vec4 v_pos_light_view_0;in highp vec4 v_pos_light_view_1;in float v_depth_shadows; 839#endif 840uniform lowp float u_opacity;vec3 linearTosRGB(vec3 color) {return pow(color,vec3(1./2.2));}
840vec3 apply_lighting_linear(vec3 color,vec3 normal,float dir_factor) {float ambient_directional_factor=calculate_ambient_directional_factor(normal);vec3 ambient_contrib=ambient_directional_factor*u_lighting_ambient_color;vec3 directional_contrib=u_lighting_directional_color*dir_factor;return color*(ambient_contrib+directional_contrib);}void main() {vec4 color=vec4(v_color.rgb,1.0);vec3 normal=normalize(v_normal);vec3 xy_flipped_normal=vec3(-normal.xy,normal.z);float shadowed_lighting_factor=0.0; 841#ifdef RENDER_SHADOWS 842shadowed_lighting_factor=shadowed_light_factor_normal(xy_flipped_normal,v_pos_light_view_0,v_pos_light_view_1,v_depth_shadows); 843#else 844shadowed_lighting_factor=dot(normal,u_lighting_directional_dir); 845#endif 846color.rgb=apply_lighting_linear(color.rgb,xy_flipped_normal,shadowed_lighting_factor);color.rgb=mix(color.rgb,v_color.rgb,v_color.a);color*=u_opacity; 847#ifdef FOG 848color=fog_dither(fog_apply_premultiplied(color,v_fog_pos,v_height)); 849#endif 850#ifdef RENDER_CUTOFF 851color*=v_cutoff_opacity; 852#endif 853#ifdef INDICATOR_CUTOUT 854color=applyCutout(color,v_height); 855#endif 856glFragColor=vec4(linearTosRGB(color.rgb),color.a); 857#ifdef DEBUG_SHOW_NORMALS 858color.rgb=xy_flipped_normal*0.5+vec3(0.5,0.5,0.5);color.a=1.0;glFragColor=color; 859#endif 860#ifdef OVERDRAW_INSPECTOR 861glFragColor=vec4(1.0); 862#endif 863HANDLE_WIREFRAME_DEBUG;}`,`#include "_prelude_fog.vertex.glsl" 864#include "_prelude_shadow.vertex.glsl" 865in vec3 a_pos_3f;in vec3 a_normal_3f;out vec4 v_color;out highp vec3 v_normal;out highp float v_height;uniform mat4 u_matrix;uniform mat4 u_normal_matrix; 866#ifdef RENDER_SHADOWS 867uniform mat4 u_light_matrix_0;uniform mat4 u_light_matrix_1;out highp vec4 v_pos_light_view_0;out highp vec4 v_pos_light_view_1;out float v_depth_shadows; 868#endif 869vec3 sRGBToLinear(vec3 srgbIn) {return pow(srgbIn,vec3(2.2));} 870#pragma mapbox: define-attribute-vertex-shader-only highp vec2 part_color_emissive 871void main() { 872#pragma mapbox: initialize-attribute-custom highp vec2 part_color_emissive 873vec4 color_emissive=decode_color(part_color_emissive);v_color=vec4(sRGBToLinear(color_emissive.rgb),color_emissive.a);v_normal=vec3(u_normal_matrix*vec4(a_normal_3f,0.0));vec3 pos=a_pos_3f;v_height=pos.z;gl_Position=u_matrix*vec4(pos,1.0); 874#ifdef RENDER_SHADOWS 875vec3 shadow_pos=pos; 876#ifdef NORMAL_OFFSET 877vec3 offset=shadow_normal_offset_model(v_normal);shadow_pos+=offset*shadow_normal_offset_multiplier0(); 878#endif 879v_pos_light_view_0=u_light_matrix_0*vec4(shadow_pos,1.0);v_pos_light_view_1=u_light_matrix_1*vec4(shadow_pos,1.0);v_depth_shadows=gl_Position.w; 880#endif 881#ifdef FOG 882v_fog_pos=fog_position(pos); 883#endif 884#ifdef RENDER_CUTOFF 885v_cutoff_opacity=cutoff_opacity(u_cutoff_params,gl_Position.z); 886#endif 887}`),buildingDepth:vn(`in highp float v_depth;void main() { 888#ifndef DEPTH_TEXTURE 889glFragColor=pack_depth(v_depth); 890#endif 891}`,"in vec3 a_pos_3f;uniform mat4 u_matrix;out highp float v_depth;void main() {gl_Position=u_matrix*vec4(a_pos_3f,1.0);v_depth=gl_Position.z/gl_Position.w;}"),circle:vn(`#include "_prelude_fog.fragment.glsl" 892#include "_prelude_lighting.glsl" 893in vec3 v_data;in float v_visibility; 894#pragma mapbox: define highp vec4 color 895#pragma mapbox: define mediump float radius 896#pragma mapbox: define lowp float blur 897#pragma mapbox: define lowp float opacity 898#pragma mapbox: define highp vec4 stroke_color 899#pragma mapbox: define mediump float stroke_width 900#pragma mapbox: define lowp float stroke_opacity 901uniform float u_emissive_strength;void main() { 902#pragma mapbox: initialize highp vec4 color 903#pragma mapbox: initialize mediump float radius 904#pragma mapbox: initialize lowp float blur 905#pragma mapbox: initialize lowp float opacity 906#pragma mapbox: initialize highp vec4 stroke_color 907#pragma mapbox: initialize mediump float stroke_width 908#pragma mapbox: initialize lowp float stroke_opacity 909vec2 extrude=v_data.xy;float blur_positive=blur < 0.0 ? 0.0 : 1.0;lowp float antialiasblur=v_data.z;float extrude_length=length(extrude)+antialiasblur*(1.0-blur_positive);float antialiased_blur=-max(abs(blur),antialiasblur);float antialiase_blur_opacity=smoothstep(0.0,antialiasblur,extrude_length-1.0);float opacity_t=blur_positive==1.0 ? 910smoothstep(0.0,-antialiased_blur,1.0-extrude_length) : 911smoothstep(antialiased_blur,0.0,extrude_length-1.0)-antialiase_blur_op
911acity;float color_t=stroke_width < 0.01 ? 0.0 : smoothstep( 912antialiased_blur,0.0,extrude_length-radius/(radius+stroke_width) 913);vec4 out_color=mix(color*opacity,stroke_color*stroke_opacity,color_t); 914#ifdef LIGHTING_3D_MODE 915out_color=apply_lighting_with_emission_ground(out_color,u_emissive_strength); 916#endif 917#ifdef FOG 918out_color=fog_apply_premultiplied(out_color,v_fog_pos); 919#endif 920glFragColor=out_color*(v_visibility*opacity_t); 921#ifdef OVERDRAW_INSPECTOR 922glFragColor=vec4(1.0); 923#endif 924}`,`#include "_prelude_fog.vertex.glsl" 925#include "_prelude_terrain.vertex.glsl" 926#define NUM_VISIBILITY_RINGS 2 927#define INV_SQRT2 0.70710678 928#define ELEVATION_BIAS 0.0001 929#define NUM_SAMPLES_PER_RING 16 930uniform mat4 u_matrix;uniform mat2 u_extrude_scale;uniform lowp float u_device_pixel_ratio;uniform highp float u_camera_to_center_distance;in vec2 a_pos; 931#ifdef PROJECTION_GLOBE_VIEW 932in vec3 a_pos_3;in vec3 a_pos_normal_3;uniform mat4 u_inv_rot_matrix;uniform vec2 u_merc_center;uniform vec3 u_tile_id;uniform float u_zoom_transition;uniform vec3 u_up_dir; 933#endif 934#ifdef ELEVATED_ROADS 935in float a_circle_z_offset; 936#endif 937out vec3 v_data;out float v_visibility; 938#pragma mapbox: define highp vec4 color 939#pragma mapbox: define mediump float radius 940#pragma mapbox: define lowp float blur 941#pragma mapbox: define lowp float opacity 942#pragma mapbox: define highp vec4 stroke_color 943#pragma mapbox: define mediump float stroke_width 944#pragma mapbox: define lowp float stroke_opacity 945vec2 calc_offset(vec2 extrusion,float radius,float stroke_width, float view_scale) {return extrusion*(radius+stroke_width)*u_extrude_scale*view_scale;}float cantilevered_elevation(vec2 pos,float radius,float stroke_width,float view_scale) {vec2 c1=pos+calc_offset(vec2(-1,-1),radius,stroke_width,view_scale);vec2 c2=pos+calc_offset(vec2(1,-1),radius,stroke_width,view_scale);vec2 c3=pos+calc_offset(vec2(1,1),radius,stroke_width,view_scale);vec2 c4=pos+calc_offset(vec2(-1,1),radius,stroke_width,view_scale);float h1=elevation(c1)+ELEVATION_BIAS;float h2=elevation(c2)+ELEVATION_BIAS;float h3=elevation(c3)+ELEVATION_BIAS;float h4=elevation(c4)+ELEVATION_BIAS;return max(h4,max(h3,max(h1,h2)));}float circle_elevation(vec2 pos) { 946#if defined(TERRAIN) 947return elevation(pos)+ELEVATION_BIAS; 948#else 949return 0.0; 950#endif 951}vec4 project_vertex(vec2 extrusion,vec4 world_center,vec4 projected_center,float radius,float stroke_width, float view_scale,mat3 surface_vectors) {vec2 sample_offset=calc_offset(extrusion,radius,stroke_width,view_scale); 952#ifdef PITCH_WITH_MAP 953#ifdef PROJECTION_GLOBE_VIEW 954return u_matrix*( world_center+vec4(sample_offset.x*surface_vectors[0]+sample_offset.y*surface_vectors[1],0) ); 955#else 956return u_matrix*( world_center+vec4(sample_offset,0,0) ); 957#endif 958#else 959return projected_center+vec4(sample_offset,0,0); 960#endif 961}float get_sample_step() { 962#ifdef PITCH_WITH_MAP 963return 2.0*PI/float(NUM_SAMPLES_PER_RING); 964#else 965return PI/float(NUM_SAMPLES_PER_RING); 966#endif 967}void main(void) { 968#pragma mapbox: initialize highp vec4 color 969#pragma mapbox: initialize mediump float radius 970#pragma mapbox: initialize lowp float blur 971#pragma mapbox: initialize lowp float opacity 972#pragma mapbox: initialize highp vec4 stroke_color 973#pragma mapbox: initialize mediump float stroke_width 974#pragma mapbox: initialize lowp float stroke_opacity 975vec2 extrude=vec2(mod(a_pos,2.0)*2.0-1.0);vec2 circle_center=floor(a_pos*0.5);vec4 world_center;mat3 surface_vectors; 976#ifdef PROJECTION_GLOBE_VIEW 977vec3 pos_normal_3=a_pos_normal_3/16384.0;surface_vectors=globe_mercator_surface_vectors(pos_normal_3,u_up_dir,u_zoom_transition);vec3 surface_extrusion=extrude.x*surface_vectors[0]+extrude.y*surface_vectors[1];vec3 globe_elevation=elevationVector(circle_center)*circle_elevation(circle_center);vec3 globe_pos=a_pos_3+surface_extrusion+globe_elevation;vec3 mercator_elevation=u_up_dir*u_tile_up_scale*circle_elevation(circle_center);vec3 merc_pos=mercator_tile_position(u_inv_rot_matrix,circle_center,u_tile_id,u_merc_center)+surface_extrusion+mercator_elevation;vec3 pos=mix_globe_mercator(globe_pos,merc_pos,u_zoom_transition);world_center=vec4(pos,1); 978#else
979surface_vectors=mat3(1.0);float height=circle_elevation(circle_center);world_center=vec4(circle_center,height,1); 980#endif 981#ifdef ELEVATED_ROADS 982world_center.z+=a_circle_z_offset+ELEVATION_BIAS; 983#endif 984vec4 projected_center=u_matrix*world_center;float view_scale=0.0; 985#ifdef PITCH_WITH_MAP 986#ifdef SCALE_WITH_MAP 987view_scale=1.0; 988#else 989view_scale=projected_center.w/u_camera_to_center_distance; 990#endif 991#else 992#ifdef SCALE_WITH_MAP 993view_scale=u_camera_to_center_distance; 994#else 995view_scale=projected_center.w; 996#endif 997#endif 998gl_Position=project_vertex(extrude,world_center,projected_center,radius,stroke_width,view_scale,surface_vectors);float visibility=0.0; 999#ifdef TERRAIN 1000float step=get_sample_step();vec4 occlusion_world_center;vec4 occlusion_projected_center; 1001#ifdef PITCH_WITH_MAP 1002float cantilevered_height=cantilevered_elevation(circle_center,radius,stroke_width,view_scale);occlusion_world_center=vec4(circle_center,cantilevered_height,1);occlusion_projected_center=u_matrix*occlusion_world_center; 1003#else 1004occlusion_world_center=world_center;occlusion_projected_center=projected_center; 1005#endif 1006for(int ring=0; ring < NUM_VISIBILITY_RINGS; ring++) {float scale=(float(ring)+1.0)/float(NUM_VISIBILITY_RINGS);for(int i=0; i < NUM_SAMPLES_PER_RING; i++) {vec2 extrusion=vec2(cos(step*float(i)),-sin(step*float(i)))*scale;vec4 frag_pos=project_vertex(extrusion,occlusion_world_center,occlusion_projected_center,radius,stroke_width,view_scale,surface_vectors);visibility+=float(!isOccluded(frag_pos));}}visibility/=float(NUM_VISIBILITY_RINGS)*float(NUM_SAMPLES_PER_RING); 1007#else 1008visibility=1.0; 1009#endif 1010#ifdef PROJECTION_GLOBE_VIEW 1011visibility=1.0; 1012#endif 1013v_visibility=visibility;lowp float antialiasblur=1.0/u_device_pixel_ratio/(radius+stroke_width);v_data=vec3(extrude.x,extrude.y,antialiasblur); 1014#ifdef FOG 1015v_fog_pos=fog_position(world_center.xyz); 1016#endif 1017}`),clippingMask:vn("void main() {glFragColor=vec4(1.0);}","in vec2 a_pos;uniform mat4 u_matrix;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);}"),heatmap:vn(`#include "_prelude_fog.fragment.glsl" 1018uniform highp float u_intensity;in vec2 v_extrude; 1019#pragma mapbox: define highp float weight 1020#define GAUSS_COEF 0.3989422804014327 1021void main() { 1022#pragma mapbox: initialize highp float weight 1023float d=-0.5*3.0*3.0*dot(v_extrude,v_extrude);float val=weight*u_intensity*GAUSS_COEF*exp(d);glFragColor=vec4(val,1.0,1.0,1.0); 1024#ifdef FOG 1025if (u_is_globe==0) {glFragColor.r*=pow(1.0-fog_opacity(v_fog_pos),2.0);} 1026#endif 1027#ifdef OVERDRAW_INSPECTOR 1028glFragColor=vec4(1.0); 1029#endif 1030HANDLE_WIREFRAME_DEBUG;}`,`#include "_prelude_terrain.vertex.glsl" 1031#include "_prelude_fog.vertex.glsl" 1032uniform mat4 u_matrix;uniform float u_extrude_scale;uniform float u_opacity;uniform float u_intensity;in vec2 a_pos; 1033#ifdef PROJECTION_GLOBE_VIEW 1034in vec3 a_pos_3;in vec3 a_pos_normal_3;uniform mat4 u_inv_rot_matrix;uniform vec2 u_merc_center;uniform vec3 u_tile_id;uniform float u_zoom_transition;uniform vec3 u_up_dir; 1035#endif 1036out vec2 v_extrude; 1037#pragma mapbox: define highp float weight 1038#pragma mapbox: define mediump float radius 1039const highp float ZERO=1.0/255.0/16.0; 1040#define GAUSS_COEF 0.3989422804014327 1041void main(void) { 1042#pragma mapbox: initialize highp float weight 1043#pragma mapbox: initialize mediump float radius 1044vec2 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;vec2 tilePos=floor(a_pos*0.5);vec3 pos; 1045#ifdef PROJECTION_GLOBE_VIEW 1046vec3 pos_normal_3=a_pos_normal_3/16384.0;mat3 surface_vectors=globe_mercator_surface_vectors(pos_normal_3,u_up_dir,u_zoom_transition);vec3 surface_extrusion=extrude.x*surface_vectors[0]+extrude.y*surface_vectors[1];vec3 globe_elevation=elevationVector(tilePos)*elevation(tilePos);vec3 globe_pos=a_pos_3+surface_extrusion+globe_elevation;vec3 mercator_elevation=u_up_dir*u_tile_up_scale*elevation(tilePos);vec3 merc_pos=mercator_tile_position(u_inv_rot_matrix,tilePos,u_tile_id,u_merc_center)+surface_extrusion+mercator_elevation;pos=mix_globe_mercator(globe_pos,merc_pos,u_zoom_transition); 1047#else 1048pos=vec3(tilePos+extrude,elevation(tilePos)); 1049#endif 1050gl_Position=u_matrix*vec4(pos,1); 1051#ifdef FOG 1052v_fog_pos=fog_position(pos); 1053#endif 1054}`),heatmapTexture:vn(`uniform sampler2D u_image;uniform sampler2D u_color_ramp;uniform float u_opacity;in vec2 v_pos;void main() {float t=texture(u_image,v_pos).r;vec4 color=texture(u_color_ramp,vec2(t,0.5));glFragColor=color*u_opacity; 1055#ifdef OVERDRAW_INSPECTOR 1056glFragColor=vec4(0.0); 1057#endif 1058HANDLE_WIREFRAME_DEBUG;}`,"in vec2 a_pos;out vec2 v_pos;void main() {gl_Position=vec4(a_pos,0,1);v_pos=a_pos*0.5+0.5;}"),collisionBox:vn("in float v_placed;in float v_notUsed;void main() {vec4 red =vec4(1.0,0.0,0.0,1.0);vec4 blue=vec4(0.0,0.0,1.0,0.5);glFragColor =mix(red,blue,step(0.5,v_placed))*0.5;glFragColor*=mix(1.0,0.1,step(0.5,v_notUsed));}",`#include "_prelude_terrain.vertex.glsl" 1059in vec3 a_pos;in vec2 a_anchor_pos;in vec2 a_extrude;in vec2 a_placed;in vec2 a_shift;in vec2 a_elevation_from_sea;in float a_size_scale;in vec2 a_padding;in float a_auto_z_offset;uniform mat4 u_matrix;uniform vec2 u_extrude_scale;uniform float u_camera_to_center_distance;out float v_placed;out float v_notUsed;void main() {float feature_elevation=a_elevation_from_sea.x+a_auto_z_offset;float terrain_elevation=(a_elevation_from_sea.y==1.0 ? 0.0 : elevation(a_anchor_pos));vec4 projectedPoint=u_matrix*vec4(a_pos+elevationVector(a_anchor_pos)*(feature_elevation+terrain_elevation),1);highp float camera_to_anchor_distance=projectedPoint.w;highp float collision_perspective_ratio=clamp( 10600.5+0.5*(u_camera_to_center_distance/camera_to_anchor_distance),0.0,1.5);gl_Position=projectedPoint;gl_Position.xy+=(a_extrude*a_size_scale+a_shift+a_padding)*u_extrude_scale*gl_Position.w*collision_perspective_ratio;v_placed=a_placed.x;v_notUsed=a_placed.y;}`),collisionCircle:vn("in float v_radius;in vec2 v_extrude;in float v_perspective_ratio;in 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);glFragColor=color*alpha*opacity_t;}",`in vec2 a_pos_2f;in float a_radius;in vec2 a_flags;uniform mat4 u_matrix;uniform mat4 u_inv_matrix;uniform vec2 u_viewport_size;uniform float u_camera_to_center_distance;out float v_radius;out vec2 v_extrude;out float v_perspective_ratio;out 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_2f;float radius=a_radius;float collision=a_flags.x;float vertexIdx=a_flags.y;vec2 quadVertexOffset=vec2( 1061mix(-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( 10620.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:vn("uniform highp vec4 u_color;uniform sampler2D u_overlay;in vec2 v_uv;void main() {vec4 overlay_color=texture(u_overlay,v_uv);glFragColor=mix(u_color,overlay_color,overlay_color.a);}",`#include "_prelude_terrain.vertex.glsl" 1063in vec2 a_pos; 1064#ifdef PROJECTION_GLOBE_VIEW 1065in vec3 a_pos_3; 1066#endif 1067out vec2 v_uv;uniform mat4 u_matrix;uniform float u_overlay_scale;void main() {float h=elevation(a_pos);v_uv=a_pos/8192.0; 1068#ifdef PROJECTION_GLOBE_VIEW
1069gl_Position=u_matrix*vec4(a_pos_3+elevationVector(a_pos)*h,1); 1070#else 1071gl_Position=u_matrix*vec4(a_pos*u_overlay_scale,h,1); 1072#endif 1073}`),elevatedStructuresDepth:vn(`void main() { 1074#ifndef DEPTH_TEXTURE 1075glFragColor=vec4(0.); 1076#endif 1077}`,"in vec2 a_pos;in float a_height;uniform mat4 u_matrix;uniform float u_depth_bias;void main() {gl_Position=u_matrix*vec4(a_pos,a_height,1);gl_Position.z=gl_Position.z+u_depth_bias;}"),elevatedStructuresDepthReconstruct:vn(`#ifdef DEPTH_RECONSTRUCTION 1078in float v_height; 1079#endif 1080void main() { 1081#ifdef DEPTH_RECONSTRUCTION 1082if (v_height >=0.0) 1083discard; 1084#endif 1085glFragColor=vec4(1.0,0.0,0.0,1.0);}`,`in vec2 a_pos;in float a_height;uniform mat4 u_matrix;uniform vec3 u_camera_pos;uniform highp float u_depth_bias;uniform lowp float u_height_scale;uniform lowp float u_reset_depth; 1086#ifdef DEPTH_RECONSTRUCTION 1087out float v_height; 1088#endif 1089void main() {vec3 vpos=vec3(a_pos,a_height*u_height_scale); 1090#ifdef DEPTH_RECONSTRUCTION 1091if (u_camera_pos.z > vpos.z) {vpos-=(u_camera_pos-vpos)*(vpos.z/(u_camera_pos.z-vpos.z));}v_height=a_height; 1092#endif 1093gl_Position=u_matrix*vec4(vpos,1);gl_Position.z=u_reset_depth==1.0 ? gl_Position.w : gl_Position.z+u_depth_bias;}`),elevatedStructures:vn(`#include "_prelude_fog.fragment.glsl" 1094#include "_prelude_lighting.glsl" 1095#include "_prelude_shadow.fragment.glsl" 1096in vec3 v_normal;in float v_height; 1097#ifdef RENDER_SHADOWS 1098in highp vec4 v_pos_light_view_0;in highp vec4 v_pos_light_view_1;in float v_depth; 1099#endif 1100void main() {vec3 color=vec3(241.0/255.0,236.0/255.0,225.0/255.0); 1101#ifdef LIGHTING_3D_MODE 1102vec3 normal=normalize(v_normal); 1103#ifdef RENDER_SHADOWS 1104float shadowed_lighting_factor=shadowed_light_factor_normal(normal,v_pos_light_view_0,v_pos_light_view_1,v_depth);color.rgb=apply_lighting(color.rgb,normal,shadowed_lighting_factor); 1105#else 1106color=apply_lighting(color,normal); 1107#endif 1108if (v_height < 0.0) {float penetration=max(v_height+7.5,0.0);float occlusion=1.0-1.0/PI*acos(1.0-penetration/4.0);color=color*(1.0-pow(occlusion,2.0)*0.3);} 1109#endif 1110#ifdef FOG 1111color=fog_apply(color,v_fog_pos); 1112#endif 1113vec4 out_color=vec4(color,1.0); 1114#ifdef INDICATOR_CUTOUT 1115out_color=applyCutout(out_color,v_height); 1116#endif 1117glFragColor=out_color;HANDLE_WIREFRAME_DEBUG;}`,`#include "_prelude_fog.vertex.glsl" 1118#include "_prelude_shadow.vertex.glsl" 1119in vec2 a_pos;in float a_height;in vec3 a_pos_normal_3;uniform mat4 u_matrix;out vec3 v_normal;out float v_height; 1120#ifdef RENDER_SHADOWS 1121uniform mat4 u_light_matrix_0;uniform mat4 u_light_matrix_1;out highp vec4 v_pos_light_view_0;out highp vec4 v_pos_light_view_1;out float v_depth; 1122#endif 1123void main() {v_normal=a_pos_normal_3/16384.0;v_height=a_height;vec3 pos=vec3(a_pos,a_height);gl_Position=u_matrix*vec4(pos,1); 1124#ifdef RENDER_SHADOWS 1125vec3 shd_pos0=pos;vec3 shd_pos1=pos; 1126#ifdef NORMAL_OFFSET 1127vec3 offset=shadow_normal_offset(v_normal);shd_pos0+=offset*shadow_normal_offset_multiplier0();shd_pos1+=offset*shadow_normal_offset_multiplier1(); 1128#endif 1129v_pos_light_view_0=u_light_matrix_0*vec4(shd_pos0,1);v_pos_light_view_1=u_light_matrix_1*vec4(shd_pos1,1);v_depth=gl_Position.w; 1130#endif 1131#ifdef FOG 1132v_fog_pos=fog_position(a_pos); 1133#endif 1134}`),fill:vn(`#include "_prelude_fog.fragment.glsl" 1135#include "_prelude_lighting.glsl" 1136#include "_prelude_shadow.fragment.glsl" 1137#pragma mapbox: define highp vec4 color 1138#pragma mapbox: define lowp float opacity 1139uniform float u_emissive_strength; 1140#ifdef RENDER_SHADOWS 1141uniform vec3 u_ground_shadow_factor;in highp vec4 v_pos_light_view_0;in highp vec4 v_pos_light_view_1;in highp float v_depth; 1142#endif 1143#ifdef INDICATOR_CUTOUT 1144in highp float v_z_offset; 1145#endif 1146void main() { 1147#pragma mapbox: initialize highp vec4 color 1148#pragma mapbox: initialize lowp float opacity 1149vec4 out_color=color; 1150#ifdef LIGHTING_3D_MODE 1151out_color=apply_lighting_with_emission_ground(out_color,u_emissive_strength); 1152#ifdef RENDER_SHADOWS 1153float light=shadowed_light_factor(v_pos_light_view_0,v_pos_light_view_1,v_depth);out_color.rgb*=mix(u_ground_shadow_factor,vec3(1.0),light); 1154#endif 1155#endif 1156#ifdef FOG 1157out_color=fog_dither(fog_apply_premultiplied(out_color,v_fog_pos)); 1158#endif 1159out_color*=opacity; 1160#ifdef INDICATOR_CUTOUT 1161if (v_z_offset >=0.0) {out_color=applyCutout(out_color,v_z_offset);} 1162#endif 1163glFragColor=out_color; 1164#ifdef OVERDRAW_INSPECTOR 1165glFragColor=vec4(1.0); 1166#endif 1167HANDLE_WIREFRAME_DEBUG;}`,`#include "_prelude_fog.vertex.glsl" 1168#include "_prelude_shadow.vertex.glsl" 1169in vec2 a_pos; 1170#ifdef ELEVATED_ROADS 1171in float a_road_z_offset; 1172#endif 1173#ifdef RENDER_SHADOWS 1174uniform mat4 u_light_matrix_0;uniform mat4 u_light_matrix_1;out highp vec4 v_pos_light_view_0;out highp vec4 v_pos_light_view_1;out highp float v_depth; 1175#endif 1176#ifdef INDICATOR_CUTOUT 1177out highp float v_z_offset; 1178#endif 1179uniform mat4 u_matrix; 1180#pragma mapbox: define highp vec4 color 1181#pragma mapbox: define lowp float opacity 1182#pragma mapbox: define highp float z_offset 1183void main() { 1184#pragma mapbox: initialize highp vec4 color 1185#pragma mapbox: initialize lowp float opacity 1186#pragma mapbox: initialize highp float z_offset 1187#ifdef ELEVATED_ROADS 1188z_offset+=a_road_z_offset; 1189#endif 1190float hidden=float(opacity==0.0);gl_Position=mix(u_matrix*vec4(a_pos,z_offset,1),AWAY,hidden); 1191#ifdef RENDER_SHADOWS 1192vec3 shd_pos0=vec3(a_pos,z_offset);vec3 shd_pos1=vec3(a_pos,z_offset); 1193#ifdef NORMAL_OFFSET 1194vec3 offset=shadow_normal_offset(vec3(0.0,0.0,1.0));shd_pos0+=offset*shadow_normal_offset_multiplier0();shd_pos1+=offset*shadow_normal_offset_multiplier1(); 1195#endif 1196v_pos_light_view_0=u_light_matrix_0*vec4(shd_pos0,1);v_pos_light_view_1=u_light_matrix_1*vec4(shd_pos1,1);v_depth=gl_Position.w; 1197#endif 1198#ifdef FOG 1199v_fog_pos=fog_position(a_pos); 1200#endif 1201#ifdef INDICATOR_CUTOUT 1202v_z_offset=z_offset; 1203#endif 1204}`),fillOutline:vn(`#include "_prelude_fog.fragment.glsl" 1205#include "_prelude_lighting.glsl" 1206#include "_prelude_shadow.fragment.glsl" 1207in highp vec2 v_pos;uniform float u_emissive_strength; 1208#ifdef RENDER_SHADOWS 1209uniform vec3 u_ground_shadow_factor;in highp vec4 v_pos_light_view_0;in highp vec4 v_pos_light_view_1;in highp float v_depth; 1210#endif 1211#pragma mapbox: define highp vec4 outline_color 1212#pragma mapbox: define lowp float opacity 1213void main() { 1214#pragma mapbox: initialize highp vec4 outline_color 1215#pragma mapbox: initialize lowp float opacity 1216float dist=length(v_pos-gl_FragCoord.xy);float alpha=1.0-smoothstep(0.0,1.0,dist);vec4 out_color=outline_color; 1217#ifdef LIGHTING_3D_MODE 1218out_color=apply_lighting_with_emission_ground(out_color,u_emissive_strength); 1219#ifdef RENDER_SHADOWS 1220float light=shadowed_light_factor(v_pos_light_view_0,v_pos_light_view_1,v_depth);out_color.rgb*=mix(u_ground_shadow_factor,vec3(1.0),light); 1221#endif 1222#endif 1223#ifdef FOG 1224out_color=fog_dither(fog_apply_premultiplied(out_color,v_fog_pos)); 1225#endif 1226glFragColor=out_color*(alpha*opacity); 1227#ifdef OVERDRAW_INSPECTOR 1228glFragColor=vec4(1.0); 1229#endif 1230HANDLE_WIREFRAME_DEBUG;}`,`#include "_prelude_fog.vertex.glsl" 1231#include "_prelude_shadow.vertex.glsl" 1232in vec2 a_pos; 1233#ifdef ELEVATED_ROADS 1234in float a_road_z_offset; 1235#endif 1236#ifdef RENDER_SHADOWS 1237uniform mat4 u_light_matrix_0;uniform mat4 u_light_matrix_1;out highp vec4 v_pos_light_view_0;out highp vec4 v_pos_light_view_1;out highp float v_depth; 1238#endif 1239uniform mat4 u_matrix;uniform vec2 u_world;out highp vec2 v_pos; 1240#pragma mapbox: define highp vec4 outline_color 1241#pragma mapbox: define lowp float opacity 1242#pragma mapbox: define highp float z_offset 1243void main() { 1244#pragma mapbox: initialize highp vec4 outline_color 1245#pragma mapbox: initialize lowp float opacity 1246#pragma mapbox: initialize highp float z_offset 1247#ifdef ELEVATED_ROADS 1248z_offset+=a_road_z_offset; 1249#endif 1250float hidden=float(opacity==0.0);gl_Position=mix(u_matrix*vec4(a_pos,z_offset,1),AWAY,hidden);v_pos=(gl_Position.xy/gl_Position.w+1.0)/2.0*u_world; 1251#ifdef RENDER_SHADOWS 1252vec3 shd_pos0=vec3(a_pos,z_offset);vec3 shd_pos1=vec3(a_pos,z_offset); 1253#ifdef NORMAL_OFFSET 1254vec3 offset=shadow_normal_offset(vec3(0.0,0.0,1.0));shd_pos0+=offset*shadow_normal_offset_multiplier0();shd_pos1+=offset*shadow_normal_offset_multiplier1(); 1255#endif 1256v_pos_light_view_0=u_light_matrix_0*vec4(shd_pos0,1);v_pos_light_view_1=u_light_matrix_1*vec4(shd_pos1,1);v_depth=gl_Position.w; 1257#endif 1258#ifdef FOG 1259v_fog_pos=fog_position(a_pos); 1260#endif 1261}`),fillOutlinePattern:vn(`#include "_prelude_fog.fragment.glsl" 1262#include "_prelude_lighting.glsl" 1263#include "_prelude_shadow.fragment.glsl" 1264uniform vec2 u_texsize;uniform sampler2D u_image; 1265#ifdef FILL_PATTERN_TRANSITION 1266uniform float u_pattern_transition; 1267#endif 1268uniform float u_emissive_strength; 1269#ifdef RENDER_SHADOWS 1270uniform vec3 u_ground_shadow_factor;in highp vec4 v_pos_light_view_0;in highp vec4 v_pos_light_view_1;in highp float v_depth; 1271#endif 1272in highp vec2 v_pos;in highp vec2 v_pos_world; 1273#pragma mapbox: define lowp float opacity 1274#pragma mapbox: define lowp vec4 pattern 1275#ifdef FILL_PATTERN_TRANSITION 1276#pragma mapbox: define mediump vec4 pattern_b 1277#endif 1278void main() { 1279#pragma mapbox: initialize lowp float opacity 1280#pragma mapbox: initialize mediump vec4 pattern 1281#ifdef FILL_PATTERN_TRANSITION 1282#pragma mapbox: initialize mediump vec4 pattern_b 1283#endif 1284vec2 pattern_tl=pattern.xy;vec2 pattern_br=pattern.zw;highp vec2 imagecoord=mod(v_pos,1.0);highp vec2 pos=mix(pattern_tl/u_texsize,pattern_br/u_texsize,imagecoord);highp vec2 lod_pos=mix(pattern_tl/u_texsize,pattern_br/u_texsize,v_pos);float dist=length(v_pos_world-gl_FragCoord.xy);float alpha=1.0-smoothstep(0.0,1.0,dist);vec4 out_color=textureLodCustom(u_image,pos,lod_pos); 1285#ifdef FILL_PATTERN_TRANSITION 1286vec2 pattern_b_tl=pattern_b.xy;vec2 pattern_b_br=pattern_b.zw;highp vec2 pos_b=mix(pattern_b_tl/u_texsize,pattern_b_br/u_texsize,imagecoord);vec4 color_b=textureLodCustom(u_image,pos_b,lod_pos);out_color=out_color*(1.0-u_pattern_transition)+color_b*u_pattern_transition; 1287#endif 1288#ifdef LIGHTING_3D_MODE 1289out_color=apply_lighting_with_emission_ground(out_color,u_emissive_strength); 1290#ifdef RENDER_SHADOWS 1291float light=shadowed_light_factor(v_pos_light_view_0,v_pos_light_view_1,v_depth);out_color.rgb*=mix(u_ground_shadow_factor,vec3(1.0),light); 1292#endif 1293#endif 1294#ifdef FOG 1295out_color=fog_dither(fog_apply_premultiplied(out_color,v_fog_pos)); 1296#endif 1297glFragColor=out_color*(alpha*opacity); 1298#ifdef OVERDRAW_INSPECTOR 1299glFragColor=vec4(1.0); 1300#endif 1301HANDLE_WIREFRAME_DEBUG;}`,`#include "_prelude_fog.vertex.glsl" 1302#include "_prelude_shadow.vertex.glsl" 1303uniform mat4 u_matrix;uniform vec2 u_world;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform float u_tile_units_to_pixels;in vec2 a_pos; 1304#ifdef ELEVATED_ROADS 1305in float a_road_z_offset; 1306#endif 1307#ifdef RENDER_SHADOWS 1308uniform mat4 u_light_matrix_0;uniform mat4 u_light_matrix_1;out highp vec4 v_pos_light_view_0;out highp vec4 v_pos_light_view_1;out highp float v_depth; 1309#endif 1310out highp vec2 v_pos;out highp vec2 v_pos_world; 1311#pragma mapbox: define lowp float opacity 1312#pragma mapbox: define lowp vec4 pattern 1313#ifdef FILL_PATTERN_TRANSITION 1314#pragma mapbox: define mediump vec4 pattern_b 1315#endif 1316#pragma mapbox: define lowp float pixel_ratio 1317#pragma mapbox: define highp float z_offset 1318void main() { 1319#pragma mapbox: initialize lowp float opacity 1320#pragma mapbox: initialize mediump vec4 pattern 1321#ifdef FILL_PATTERN_TRANSITION 1322#pragma mapbox: initialize mediump vec4 pattern_b 1323#endif 1324#pragma mapbox: initialize lowp float pixel_ratio 1325#pragma mapbox: initialize highp float z_offset 1326vec2 pattern_tl=pattern.xy;vec2 pattern_br=pattern.zw; 1327#ifdef ELEVATED_ROADS 1328z_offset+=a_road_z_offset; 1329#endif 1330float hidden=float(opacity==0.0);gl_Position=mix(u_matrix*vec4(a_pos,z_offset,1),AWAY,hidden);vec2 display_size=(pattern_br-pattern_tl)/pixel_ratio;v_pos=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,display_size,u_tile_units_to_pixels,a_pos);v_pos_world=(gl_Position.xy/gl_Position.w+1.0)/2.0*u_world; 1331#ifdef RENDER_SHADOWS 1332vec3 shd_pos0=vec3(a_pos,z_offset);vec3 shd_pos1=vec3(a_pos,z_offset); 1333#ifdef NORMAL_OFFSET 1334vec3 offset=shadow_normal_offset(vec3(0.0,0.0,1.0));shd_pos0+=offset*shadow_normal_offset_multiplier0();shd_pos1+=offset*shadow_normal_offset_multiplier1(); 1335#endif 1336v_pos_light_view_0=u_light_matrix_0*vec4(shd_pos0,1);v_pos_light_view_1=u_light_matrix_1*vec4(shd_pos1,1);v_depth=gl_Position.w; 1337#endif 1338#ifdef FOG 1339v_fog_pos=fog_position(a_pos); 1340#endif 1341}`),fillPattern:vn(`#include "_prelude_fog.fragment.glsl" 1342#include "_prelude_lighting.glsl" 1343#include "_prelude_shadow.fragment.glsl" 1344uniform vec2 u_texsize;uniform sampler2D u_image; 1345#ifdef FILL_PATTERN_TRANSITION 1346uniform float u_pattern_transition; 1347#endif 1348in highp vec2 v_pos;uniform float u_emissive_strength; 1349#ifdef RENDER_SHADOWS 1350uniform vec3 u_ground_shadow_factor;in highp vec4 v_pos_light_view_0;in highp vec4 v_pos_light_view_1;in highp float v_depth; 1351#endif 1352#pragma mapbox: define lowp float opacity 1353#pragma mapbox: define lowp vec4 pattern 1354#ifdef FILL_PATTERN_TRANSITION 1355#pragma mapbox: define mediump vec4 pattern_b 1356#endif 1357void main() { 1358#pragma mapbox: initialize lowp float opacity 1359#pragma mapbox: initialize mediump vec4 pattern 1360#ifdef FILL_PATTERN_TRANSITION 1361#pragma mapbox: initialize mediump vec4 pattern_b 1362#endif 1363vec2 pattern_tl=pattern.xy;vec2 pattern_br=pattern.zw;highp vec2 imagecoord=mod(v_pos,1.0);highp vec2 pos=mix(pattern_tl/u_texsize,pattern_br/u_texsize,imagecoord);highp vec2 lod_pos=mix(pattern_tl/u_texsize,pattern_br/u_texsize,v_pos);vec4 out_color=textureLodCustom(u_image,pos,lod_pos); 1364#ifdef FILL_PATTERN_TRANSITION 1365vec2 pattern_b_tl=pattern_b.xy;vec2 pattern_b_br=pattern_b.zw;highp vec2 pos_b=mix(pattern_b_tl/u_texsize,pattern_b_br/u_texsize,imagecoord);vec4 color_b=textureLodCustom(u_image,pos_b,lod_pos);out_color=out_color*(1.0-u_pattern_transition)+color_b*u_pattern_transition; 1366#endif 1367#ifdef LIGHTING_3D_MODE 1368out_color=apply_lighting_with_emission_ground(out_color,u_emissive_strength); 1369#ifdef RENDER_SHADOWS 1370float light=shadowed_light_factor(v_pos_light_view_0,v_pos_light_view_1,v_depth);out_color.rgb*=mix(u_ground_shadow_factor,vec3(1.0),light); 1371#endif 1372#endif 1373#ifdef FOG 1374out_color=fog_dither(fog_apply_premultiplied(out_color,v_fog_pos)); 1375#endif 1376glFragColor=out_color*opacity; 1377#ifdef OVERDRAW_INSPECTOR 1378glFragColor=vec4(1.0); 1379#endif 1380HANDLE_WIREFRAME_DEBUG;}`,`#include "_prelude_fog.vertex.glsl" 1381#include "_prelude_shadow.vertex.glsl" 1382uniform mat4 u_matrix;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform float u_tile_units_to_pixels;in vec2 a_pos; 1383#ifdef ELEVATED_ROADS 1384in float a_road_z_offset; 1385#endif 1386#ifdef RENDER_SHADOWS 1387uniform mat4 u_light_matrix_0;uniform mat4 u_light_matrix_1;out highp vec4 v_pos_light_view_0;out highp vec4 v_pos_light_view_1;out highp float v_depth; 1388#endif 1389out highp vec2 v_pos; 1390#pragma mapbox: define lowp float opacity 1391#pragma mapbox: define lowp vec4 pattern 1392#ifdef FILL_PATTERN_TRANSITION 1393#pragma mapbox: define mediump vec4 pattern_b 1394#endif 1395#pragma mapbox: define lowp float pixel_ratio 1396#pragma mapbox: define highp float z_offset 1397void main() { 1398#pragma mapbox: initialize lowp float opacity 1399#pragma mapbox: initialize mediump vec4 pattern 1400#pragma mapbox: initialize lowp float pixel_ratio 1401#pragma mapbox: initialize highp float z_offset 1402#ifdef FILL_PATTERN_TRANSITION 1403#pragma mapbox: initialize mediump vec4 pattern_b 1404#endif 1405vec2 pattern_tl=pattern.xy;vec2 pattern_br=pattern.zw;vec2 display_size=(pattern_br-pattern_tl)/pixel_ratio; 1406#ifdef ELEVATED_ROADS 1407z_offset+=a_road_z_offset; 1408#endif 1409float hidden=float(opacity==0.0);gl_Position=mix(u_matrix*vec4(a_pos,z_offset,1),AWAY,hidden);v_pos=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,display_size,u_tile_units_to_pixels,a_pos); 1410#ifdef RENDER_SHADOWS 1411vec3 shd_pos0=vec3(a_pos,z_offset);vec3 shd_pos1=vec3(a_pos,z_offset); 1412#ifdef NORMAL_OFFSET 1413vec3 offset=shadow_normal_offset(vec3(0.0,0.0,1.0));shd_pos0+=offset*shadow_normal_offset_multiplier0();shd_pos1+=offset*shadow_normal_offset_multiplier1(); 1414#endif 1415v_pos_light_view_0=u_light_matrix_0*vec4(shd_pos0,1);v_pos_light_view_1=u_light_matrix_1*vec4(shd_pos1,1);v_depth=gl_Position.w; 1416#endif 1417#ifdef FOG 1418v_fog_pos=fog_position(a_pos); 1419#endif 1420}`),fillExtrusion:vn(`#include "_prelude_fog.fragment.glsl" 1421#include "_prelude_shadow.fragment.glsl" 1422#include "_prelude_lighting.glsl" 1423in vec4 v_color;in vec4 v_flat; 1424#ifdef RENDER_SHADOWS 1425in highp vec4 v_pos_light_view_0;in highp vec4 v_pos_light_view_1; 1426#endif 1427uniform lowp float u_opacity; 1428#ifdef FAUX_AO 1429uniform lowp vec2 u_ao;in vec2 v_ao; 1430#endif 1431#if defined(ZERO_ROOF_RADIUS) && !defined(LIGHTING_3D_MODE) 1432in vec4 v_roof_color; 1433#endif 1434#if defined(ZERO_ROOF_RADIUS) || de
1434fined(RENDER_SHADOWS) || defined(LIGHTING_3D_MODE) 1435in highp vec3 v_normal; 1436#endif 1437uniform vec3 u_flood_light_color;uniform highp float u_vertical_scale;uniform float u_flood_light_intensity;uniform vec3 u_ground_shadow_factor; 1438#if defined(LIGHTING_3D_MODE) && defined(FLOOD_LIGHT) 1439in float v_flood_radius;in float v_has_floodlight; 1440#endif 1441in float v_height; 1442#pragma mapbox: define highp float emissive_strength 1443void main() { 1444#pragma mapbox: initialize highp float emissive_strength 1445#if defined(ZERO_ROOF_RADIUS) || defined(RENDER_SHADOWS) || defined(LIGHTING_3D_MODE) 1446vec3 normal=normalize(v_normal); 1447#endif 1448float z;vec4 color=v_color; 1449#ifdef ZERO_ROOF_RADIUS 1450z=float(normal.z > 0.00001); 1451#ifdef LIGHTING_3D_MODE 1452normal=mix(normal,vec3(0.0,0.0,1.0),z); 1453#else 1454color=mix(v_color,v_roof_color,z); 1455#endif 1456#endif 1457float h=max(0.0,v_height);float ao_shade=1.0; 1458#ifdef FAUX_AO 1459float intensity=u_ao[0];float h_floors=h/(u_ao[1]*u_vertical_scale);float y_shade=1.0-0.9*intensity*min(v_ao.y,1.0);ao_shade=(1.0-0.08*intensity)*(y_shade+(1.0-y_shade)*(1.0-pow(1.0-min(h_floors/16.0,1.0),16.0)))+0.08*intensity*min(h_floors/160.0,1.0);float concave=v_ao.x*v_ao.x; 1460#ifdef ZERO_ROOF_RADIUS 1461concave*=(1.0-z); 1462#endif 1463float x_shade=mix(1.0,mix(0.6,0.75,min(h_floors/30.0,1.0)),intensity)+0.1*intensity*min(h,1.0);ao_shade*=mix(1.0,x_shade*x_shade*x_shade,concave); 1464#ifdef LIGHTING_3D_MODE 1465#ifdef FLOOD_LIGHT 1466color.rgb*=mix(ao_shade,1.0,v_has_floodlight); 1467#else 1468color.rgb*=ao_shade; 1469#endif 1470#else 1471color.rgb*=ao_shade; 1472#endif 1473#endif 1474#ifdef LIGHTING_3D_MODE 1475float flood_radiance=0.0; 1476#ifdef FLOOD_LIGHT 1477flood_radiance=(1.0-min(h/v_flood_radius,1.0))*u_flood_light_intensity*v_has_floodlight; 1478#endif 1479#ifdef RENDER_SHADOWS 1480#ifdef FLOOD_LIGHT 1481float ndotl_unclamped=dot(normal,u_shadow_direction);float ndotl=max(0.0,ndotl_unclamped);float occlusion=ndotl_unclamped < 0.0 ? 1.0 : shadow_occlusion(ndotl,v_pos_light_view_0,v_pos_light_view_1,1.0/gl_FragCoord.w);vec3 litColor=apply_lighting(color.rgb,normal,(1.0-u_shadow_intensity*occlusion)*ndotl);vec3 floodLitColor=compute_flood_lighting(u_flood_light_color*u_opacity,1.0-u_shadow_intensity,occlusion,u_ground_shadow_factor);color.rgb=mix(litColor,floodLitColor,flood_radiance); 1482#else 1483float shadowed_lighting_factor; 1484#ifdef RENDER_CUTOFF 1485shadowed_lighting_factor=shadowed_light_factor_normal_opacity(normal,v_pos_light_view_0,v_pos_light_view_1,1.0/gl_FragCoord.w,v_cutoff_opacity);if (v_cutoff_opacity==0.0) {discard;} 1486#else 1487shadowed_lighting_factor=shadowed_light_factor_normal(normal,v_pos_light_view_0,v_pos_light_view_1,1.0/gl_FragCoord.w); 1488#endif 1489color.rgb=apply_lighting(color.rgb,normal,shadowed_lighting_factor); 1490#endif 1491#else 1492color.rgb=apply_lighting(color.rgb,normal); 1493#ifdef FLOOD_LIGHT 1494color.rgb=mix(color.rgb,u_flood_light_color*u_opacity,flood_radiance); 1495#endif 1496#endif 1497color.rgb=mix(color.rgb,v_flat.rgb,emissive_strength);color*=u_opacity; 1498#endif 1499#ifdef FOG 1500color=fog_dither(fog_apply_premultiplied(color,v_fog_pos,h)); 1501#endif 1502#ifdef INDICATOR_CUTOUT 1503color=applyCutout(color,h); 1504#endif 1505glFragColor=color; 1506#ifdef OVERDRAW_INSPECTOR 1507glFragColor=vec4(1.0); 1508#endif 1509HANDLE_WIREFRAME_DEBUG;}`,`#include "_prelude_fog.vertex.glsl" 1510#include "_prelude_terrain.vertex.glsl" 1511#include "_prelude_shadow.vertex.glsl" 1512#include "_prelude_lighting.glsl" 1513uniform 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;uniform float u_edge_radius;uniform float u_width_scale;in vec4 a_pos_normal_ed;in vec2 a_centroid_pos; 1514#ifdef RENDER_WALL_MODE 1515in vec3 a_join_normal_inside; 1516#endif 1517#ifdef PROJECTION_GLOBE_VIEW 1518in vec3 a_pos_3;in vec3 a_pos_normal_3;uniform mat4 u_inv_rot_matrix;uniform vec2 u_merc_center;uniform vec3 u_tile_id;uniform float u_zoom_transition;uniform vec3 u_up_dir;uniform float u_height_lift; 1519#endif 1520#ifdef TERRAIN 1521uniform int u_height_type;uniform int u_base_type; 1522#endif 1523uniform highp float u_vertical_scale;out vec4 v_color;out vec4 v_flat; 1524#ifdef RENDER_SHADOWS 1525uniform mat4 u_light_matrix_0;uniform mat4 u_light_matrix_1;out highp vec4 v_pos_light_view_0;out highp vec4 v_pos_light_view_1; 1526#endif 1527#if defined(ZERO_ROOF_RADIUS) && !defined(LIGHTING_3D_MODE) 1528out vec4 v_roof_color; 1529#endif 1530#if defined(ZERO_ROOF_RADIUS) || defined(RENDER_SHADOWS) || defined(LIGHTING_3D_MODE) 1531out highp vec3 v_normal; 1532#endif 1533#ifdef FAUX_AO 1534uniform lowp vec2 u_ao;out vec2 v_ao; 1535#endif 1536#if defined(LIGHTING_3D_MODE) && defined(FLOOD_LIGHT)
1537out float v_flood_radius;out float v_has_floodlight; 1538#endif 1539out float v_height;vec3 linearTosRGB(vec3 color) {return pow(color,vec3(1./2.2));}vec3 sRGBToLinear(vec3 srgbIn) {return pow(srgbIn,vec3(2.2));} 1540#pragma mapbox: define highp float base 1541#pragma mapbox: define highp float height 1542#pragma mapbox: define highp vec4 color 1543#pragma mapbox: define highp float flood_light_wall_radius 1544#pragma mapbox: define highp float line_width 1545#pragma mapbox: define highp float emissive_strength 1546void main() { 1547#pragma mapbox: initialize highp float base 1548#pragma mapbox: initialize highp float height 1549#pragma mapbox: initialize highp vec4 color 1550#pragma mapbox: initialize highp float flood_light_wall_radius 1551#pragma mapbox: initialize highp float line_width 1552#pragma mapbox: initialize highp float emissive_strength 1553base*=u_vertical_scale;height*=u_vertical_scale;vec4 pos_nx=floor(a_pos_normal_ed*0.5);vec4 top_up_ny_start=a_pos_normal_ed-2.0*pos_nx;vec3 top_up_ny=top_up_ny_start.xyz;float x_normal=pos_nx.z/8192.0;vec3 normal=top_up_ny.y==1.0 ? vec3(0.0,0.0,1.0) : normalize(vec3(x_normal,(2.0*top_up_ny.z-1.0)*(1.0-abs(x_normal)),0.0)); 1554#if defined(ZERO_ROOF_RADIUS) || defined(RENDER_SHADOWS) || defined(LIGHTING_3D_MODE) 1555v_normal=normal; 1556#endif 1557base=max(0.0,base);float attr_height=height;height=max(0.0,top_up_ny.y==0.0 && top_up_ny.x==1.0 ? height-u_edge_radius : height);float t=top_up_ny.x;vec2 centroid_pos=vec2(0.0); 1558#if defined(HAS_CENTROID) || defined(TERRAIN) 1559centroid_pos=a_centroid_pos; 1560#endif 1561float ele=0.0;float h=0.0;float c_ele=0.0;vec3 pos; 1562#ifdef TERRAIN 1563bool is_flat_height=centroid_pos.x !=0.0 && u_height_type==1;bool is_flat_base=centroid_pos.x !=0.0 && u_base_type==1;ele=elevation(pos_nx.xy);c_ele=is_flat_height || is_flat_base ? (centroid_pos.y==0.0 ? elevationFromUint16(centroid_pos.x) : flatElevation(centroid_pos)) : ele;float h_height=is_flat_height ? max(c_ele+height,ele+base+2.0) : ele+height;float h_base=is_flat_base ? max(c_ele+base,ele+base) : ele+(base==0.0 ?-5.0 : base);h=t > 0.0 ? max(h_base,h_height) : h_base;pos=vec3(pos_nx.xy,h); 1564#else 1565h=t > 0.0 ? height : base;pos=vec3(pos_nx.xy,h); 1566#endif 1567#ifdef PROJECTION_GLOBE_VIEW 1568float lift=float((t+base) > 0.0)*u_height_lift;h+=lift;vec3 globe_normal=normalize(mix(a_pos_normal_3/16384.0,u_up_dir,u_zoom_transition));vec3 globe_pos=a_pos_3+globe_normal*(u_tile_up_scale*h);vec3 merc_pos=mercator_tile_position(u_inv_rot_matrix,pos.xy,u_tile_id,u_merc_center)+u_up_dir*u_tile_up_scale*pos.z;pos=mix_globe_mercator(globe_pos,merc_pos,u_zoom_transition); 1569#endif 1570float cutoff=1.0;vec3 scaled_pos=pos; 1571#ifdef RENDER_CUTOFF 1572vec3 centroid_random=vec3(centroid_pos.xy,centroid_pos.x+centroid_pos.y+1.0);vec3 ground_pos=centroid_pos.x==0.0 ? pos.xyz : (centroid_random/8.0);vec4 ground=u_matrix*vec4(ground_pos.xy,ele,1.0);cutoff=cutoff_opacity(u_cutoff_params,ground.z);if (centroid_pos.y !=0.0 && centroid_pos.x !=0.0) {vec3 g=floor(ground_pos);vec3 mod_=centroid_random-g*8.0;float seed=min(1.0,0.1*(min(3.5,max(mod_.x+mod_.y,0.2*attr_height))*0.35+mod_.z));if (cutoff < 0.8-seed) {cutoff=0.0;}}float cutoff_scale=cutoff;v_cutoff_opacity=cutoff;scaled_pos.z=mix(c_ele,h,cutoff_scale); 1573#endif 1574float hidden=float((centroid_pos.x==0.0 && centroid_pos.y==1.0) || (cutoff==0.0 && centroid_pos.x !=0.0) || (color.a==0.0)); 1575#ifdef RENDER_WALL_MODE 1576vec2 wall_offset=u_width_scale*line_width*(a_join_normal_inside.xy/EXTENT);scaled_pos.xy+=(1.0-a_join_normal_inside.z)*wall_offset*0.5;scaled_pos.xy-=a_join_normal_inside.z*wall_offset*0.5; 1577#endif 1578gl_Position=mix(u_matrix*vec4(scaled_pos,1),AWAY,hidden);h=h-ele;v_height=h; 1579#ifdef RENDER_SHADOWS 1580vec3 shd_pos0=pos;vec3 shd_pos1=pos; 1581#ifdef NORMAL_OFFSET 1582vec3 offset=shadow_normal_offset(normal);shd_pos0+=offset*shadow_normal_offset_multiplier0();shd_pos1+=offset*shadow_normal_offset_multiplier1(); 1583#endif 1584v_pos_light_view_0=u_light_matrix_0*vec4(shd_pos0,1);v_pos_light_view_1=u_light_matrix_1*vec4(shd_pos1,1); 1585#endif 1586float NdotL=0.0;float colorvalue=0.0; 1587#ifndef LIGHTING_3D_MODE 1588colorvalue=color.r*0.2126+color.g*0.7152+color.b*0.0722;vec4 ambientlight=vec4(0.03,0.03,0.03,1.0);color+=ambientlight;NdotL=clamp(dot(normal,u_lightpos),0.0,1.0);NdotL=mix((1.0-u_lightintensity),max((1.0-colorvalue+u_lightintensity),1.0),NdotL);if (normal.y !=0.0) {float r=0.84;r=mix(0.7,0.98,1.0-u_lightintensity);NdotL*=( 1589(1.0-u_vertical_gradient)+(u_vertical_gradient*clamp((t+base)*pow(height/150.0,0.5),r,1.0)));} 1590#endif 1591#ifdef FAUX_AO
1592float concave=pos_nx.w-floor(pos_nx.w*0.5)*2.0;float start=top_up_ny_start.w;float y_ground=1.0-clamp(t+base,0.0,1.0);float top_height=height; 1593#ifdef TERRAIN 1594top_height=mix(max(c_ele+height,ele+base+2.0),ele+height,float(centroid_pos.x==0.0))-ele;y_ground+=y_ground*5.0/max(3.0,top_height); 1595#endif 1596v_ao=vec2(mix(concave,-concave,start),y_ground);NdotL*=(1.0+0.05*(1.0-top_up_ny.y)*u_ao[0]); 1597#ifdef PROJECTION_GLOBE_VIEW 1598top_height+=u_height_lift; 1599#endif 1600gl_Position.z-=(0.0000006*(min(top_height,500.)+2.0*min(base,500.0)+60.0*concave+3.0*start))*gl_Position.w; 1601#endif 1602#ifdef LIGHTING_3D_MODE 1603#ifdef FLOOD_LIGHT 1604float is_wall=1.0-float(t > 0.0 && top_up_ny.y > 0.0);v_has_floodlight=float(flood_light_wall_radius > 0.0 && is_wall > 0.0);v_flood_radius=flood_light_wall_radius*u_vertical_scale; 1605#endif 1606v_color=vec4(color.rgb,1.0);float ndotl=calculate_NdotL(normal);v_flat.rgb=sRGBToLinear(color.rgb);v_flat.rgb=v_flat.rgb*(ndotl+(1.0-min(ndotl*57.29,1.0))*emissive_strength);v_flat=vec4(linearTosRGB(v_flat.rgb),1.0); 1607#else 1608v_color=vec4(0.0,0.0,0.0,1.0);v_color.rgb+=clamp(color.rgb*NdotL*u_lightcolor,mix(vec3(0.0),vec3(0.3),1.0-u_lightcolor),vec3(1.0));v_color*=u_opacity; 1609#endif 1610#if defined(ZERO_ROOF_RADIUS) && !defined(LIGHTING_3D_MODE) 1611float roofNdotL=clamp(u_lightpos.z,0.0,1.0);roofNdotL=mix((1.0-u_lightintensity),max((1.0-colorvalue+u_lightintensity),1.0),roofNdotL);v_roof_color=vec4(0.0,0.0,0.0,1.0);v_roof_color.rgb+=clamp(color.rgb*roofNdotL*u_lightcolor,mix(vec3(0.0),vec3(0.3),1.0-u_lightcolor),vec3(1.0));v_roof_color*=u_opacity; 1612#endif 1613#ifdef FOG 1614v_fog_pos=fog_position(pos); 1615#endif 1616}`),fillExtrusionDepth:vn(`in highp float v_depth;void main() { 1617#ifndef DEPTH_TEXTURE 1618glFragColor=pack_depth(v_depth); 1619#endif 1620}`,`#include "_prelude_terrain.vertex.glsl" 1621uniform mat4 u_matrix;uniform float u_edge_radius;uniform float u_width_scale;uniform float u_vertical_scale; 1622#ifdef TERRAIN 1623uniform int u_height_type;uniform int u_base_type; 1624#endif 1625in vec4 a_pos_normal_ed;in vec2 a_centroid_pos; 1626#ifdef RENDER_WALL_MODE 1627in vec3 a_join_normal_inside; 1628#endif 1629#pragma mapbox: define highp float base 1630#pragma mapbox: define highp float height 1631#pragma mapbox: define highp float line_width 1632#pragma mapbox: define highp vec4 color 1633out highp float v_depth;void main() { 1634#pragma mapbox: initialize highp float base 1635#pragma mapbox: initialize highp float height 1636#pragma mapbox: initialize highp float line_width 1637#pragma mapbox: initialize highp vec4 color 1638base*=u_vertical_scale;height*=u_vertical_scale;vec3 pos_nx=floor(a_pos_normal_ed.xyz*0.5);mediump vec3 top_up_ny=a_pos_normal_ed.xyz-2.0*pos_nx;base=max(0.0,base);height=max(0.0,top_up_ny.y==0.0 && top_up_ny.x==1.0 ? height-u_edge_radius : height);float t=top_up_ny.x;vec2 centroid_pos=vec2(0.0); 1639#if defined(HAS_CENTROID) || defined(TERRAIN) 1640centroid_pos=a_centroid_pos; 1641#endif 1642vec3 pos; 1643#ifdef TERRAIN 1644bool is_flat_height=centroid_pos.x !=0.0 && u_height_type==1;bool is_flat_base=centroid_pos.x !=0.0 && u_base_type==1;float ele=elevation(pos_nx.xy);float c_ele=is_flat_height || is_flat_base ? (centroid_pos.y==0.0 ? elevationFromUint16(centroid_pos.x) : flatElevation(centroid_pos)) : ele;float h_height=is_flat_height ? max(c_ele+height,ele+base+2.0) : ele+height;float h_base=is_flat_base ? max(c_ele+base,ele+base) : ele+(base==0.0 ?-5.0 : base);float h=t > 0.0 ? max(h_base,h_height) : h_base;pos=vec3(pos_nx.xy,h); 1645#else 1646pos=vec3(pos_nx.xy,t > 0.0 ? height : base); 1647#endif 1648#ifdef RENDER_WALL_MODE 1649vec2 wall_offset=u_width_scale*line_width*(a_join_normal_inside.xy/EXTENT);pos.xy+=(1.0-a_join_normal_inside.z)*wall_offset*0.5;pos.xy-=a_join_normal_inside.z*wall_offset*0.5; 1650#endif 1651float hidden=float((centroid_pos.x==0.0 && centroid_pos.y==1.0) || (color.a==0.0));gl_Position=mix(u_matrix*vec4(pos,1),AWAY,hidden);v_depth=gl_Position.z/gl_Position.w;}`),fillExtrusionPattern:vn(`#include "_prelude_fog.fragment.glsl" 1652#include "_prelude_lighting.glsl" 1653uniform vec2 u_texsize;uniform sampler2D u_image; 1654#ifdef FILL_EXTRUSION_PATTERN_TRANSITION 1655uniform float u_pattern_transition; 1656#endif 1657#ifdef FAUX_AO 1658uniform lowp vec2 u_ao;in vec3 v_ao; 1659#endif 1660#ifdef LIGHTING_3D_MODE 1661in vec3 v_normal; 1662#endif 1663in highp vec2 v_pos;in vec4 v_lighting;uniform lowp float u_opacity; 1664#pragma mapbox: define highp float base 1665#pragma mapbox: define highp float height 1666#pragma mapbox: define mediump vec4 pattern 1667#ifdef FILL_EXTRUSION_PATTERN_TRANSITION 1668#pragma mapbox: define mediump vec4 pattern_b 1669#endif 1670#pragma mapbox: define highp float pixel_ratio 1671void main() { 1672#pragma mapbox: initialize highp float base 1673#pragma mapbox: initialize highp float height 1674#pragma mapbox: initialize mediump vec4 pattern 1675#ifdef FILL_EXTRUSION_PATTERN_TRANSITION 1676#pragma mapbox: initialize mediump vec4 pattern_b 1677#endif 1678#pragma mapbox: initialize highp float pixel_ratio 1679vec2 pattern_tl=pattern.xy;vec2 pattern_br=pattern.zw;highp vec2 imagecoord=mod(v_pos,1.0);highp vec2 pos=mix(pattern_tl/u_texsize,pattern_br/u_texsize,imagecoord);highp vec2 lod_pos=mix(pattern_tl/u_texsize,pattern_br/u_texsize,v_pos);vec4 out_color=textureLodCustom(u_image,pos,lod_pos); 1680#ifdef FILL_EXTRUSION_PATTERN_TRANSITION 1681vec2 pattern_b_tl=pattern_b.xy;vec2 pattern_b_br=pattern_b.zw;highp vec2 pos_b=mix(pattern_b_tl/u_texsize,pattern_b_br/u_texsize,imagecoord);vec4 color_b=textureLodCustom(u_image,pos_b,lod_pos);out_color=out_color*(1.0-u_pattern_transition)+color_b*u_pattern_transition; 1682#endif 1683#ifdef LIGHTING_3D_MODE 1684out_color=apply_lighting(out_color,normalize(v_normal))*u_opacity; 1685#else 1686out_color=out_color*v_lighting; 1687#endif 1688#ifdef FAUX_AO 1689float intensity=u_ao[0];float h=max(0.0,v_ao.z);float h_floors=h/u_ao[1];float y_shade=1.0-0.9*intensity*min(v_ao.y,1.0);float shade=(1.0-0.08*intensity)*(y_shade+(1.0-y_shade)*(1.0-pow(1.0-min(h_floors/16.0,1.0
1689),16.0)))+0.08*intensity*min(h_floors/160.0,1.0);float concave=v_ao.x*v_ao.x;float x_shade=mix(1.0,mix(0.6,0.75,min(h_floors/30.0,1.0)),intensity)+0.1*intensity*min(h,1.0);shade*=mix(1.0,x_shade*x_shade*x_shade,concave);out_color.rgb=out_color.rgb*shade; 1690#endif 1691#ifdef FOG 1692out_color=fog_dither(fog_apply_premultiplied(out_color,v_fog_pos)); 1693#endif 1694#ifdef INDICATOR_CUTOUT 1695out_color=applyCutout(out_color,height); 1696#endif 1697glFragColor=out_color; 1698#ifdef OVERDRAW_INSPECTOR 1699glFragColor=vec4(1.0); 1700#endif 1701HANDLE_WIREFRAME_DEBUG;}`,`#include "_prelude_fog.vertex.glsl" 1702#include "_prelude_terrain.vertex.glsl" 1703#include "_prelude_lighting.glsl" 1704uniform mat4 u_matrix;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform float u_height_factor;uniform float u_tile_units_to_pixels;uniform float u_vertical_gradient;uniform lowp float u_opacity;uniform float u_width_scale;uniform vec3 u_lightcolor;uniform lowp vec3 u_lightpos;uniform lowp float u_lightintensity;in vec4 a_pos_normal_ed;in vec2 a_centroid_pos; 1705#ifdef RENDER_WALL_MODE 1706in vec3 a_join_normal_inside; 1707#endif 1708#ifdef PROJECTION_GLOBE_VIEW 1709in vec3 a_pos_3;in vec3 a_pos_normal_3;uniform mat4 u_inv_rot_matrix;uniform vec2 u_merc_center;uniform vec3 u_tile_id;uniform float u_zoom_transition;uniform vec3 u_up_dir;uniform float u_height_lift; 1710#endif 1711#ifdef TERRAIN 1712uniform int u_height_type;uniform int u_base_type; 1713#endif 1714out highp vec2 v_pos;out vec4 v_lighting; 1715#ifdef FAUX_AO 1716uniform lowp vec2 u_ao;out vec3 v_ao; 1717#endif 1718#ifdef LIGHTING_3D_MODE 1719out vec3 v_normal; 1720#endif 1721#pragma mapbox: define highp float base 1722#pragma mapbox: define highp float height 1723#pragma mapbox: define highp vec4 color 1724#pragma mapbox: define mediump vec4 pattern 1725#ifdef FILL_EXTRUSION_PATTERN_TRANSITION 1726#pragma mapbox: define mediump vec4 pattern_b 1727#endif 1728#pragma mapbox: define highp float pixel_ratio 1729#pragma mapbox: define highp float line_width 1730void main() { 1731#pragma mapbox: initialize highp float base 1732#pragma mapbox: initialize highp float height 1733#pragma mapbox: initialize highp vec4 color 1734#pragma mapbox: initialize mediump vec4 pattern 1735#ifdef FILL_EXTRUSION_PATTERN_TRANSITION 1736#pragma mapbox: initialize mediump vec4 pattern_b 1737#endif 1738#pragma mapbox: initialize highp float pixel_ratio 1739#pragma mapbox: initialize highp float line_width 1740vec2 pattern_tl=pattern.xy;vec2 pattern_br=pattern.zw;vec4 pos_nx=floor(a_pos_normal_ed*0.5);mediump vec4 top_up_ny_start=a_pos_normal_ed-2.0*pos_nx;mediump vec3 top_up_ny=top_up_ny_start.xyz;float x_normal=pos_nx.z/8192.0;vec3 normal=top_up_ny.y==1.0 ? vec3(0.0,0.0,1.0) : normalize(vec3(x_normal,(2.0*top_up_ny.z-1.0)*(1.0-abs(x_normal)),0.0));float edgedistance=a_pos_normal_ed.w;vec2 display_size=(pattern_br-pattern_tl)/pixel_ratio;base=max(0.0,base);height=max(0.0,height);float t=top_up_ny.x;float z=t > 0.0 ? height : base;vec2 centroid_pos=vec2(0.0); 1741#if defined(HAS_CENTROID) || defined(TERRAIN) 1742centroid_pos=a_centroid_pos; 1743#endif 1744float ele=0.0;float h=z;vec3 p;float c_ele; 1745#ifdef TERRAIN 1746bool is_flat_height=centroid_pos.x !=0.0 && u_height_type==1;bool is_flat_base=centroid_pos.x !=0.0 && u_base_type==1;ele=elevation(pos_nx.xy);c_ele=is_flat_height || is_flat_base ? (centroid_pos.y==0.0 ? elevationFromUint16(centroid_pos.x) : flatElevation(centroid_pos)) : ele;float h_height=is_flat_height ? max(c_ele+height,ele+base+2.0) : ele+height;float h_base=is_flat_base ? max(c_ele+base,ele+base) : ele+(base==0.0 ?-5.0 : base);h=t > 0.0 ? max(h_base,h_height) : h_base;p=vec3(pos_nx.xy,h); 1747#else 1748p=vec3(pos_nx.xy,z); 1749#endif 1750#ifdef PROJECTION_GLOBE_VIEW 1751float lift=float((t+base) > 0.0)*u_height_lift;h+=lift;vec3 globe_normal=normalize(mix(a_pos_normal_3/16384.0,u_up_dir,u_zoom_transition));vec3 globe_pos=a_pos_3+globe_normal*(u_tile_up_scale*(p.z+lift));vec3 merc_pos=mercator_tile_position(u_inv_rot_matrix,p.xy,u_tile_id,u_merc_center)+u_up_dir*u_tile_up_scale*p.z;p=mix_globe_mercator(globe_pos,merc_pos,u_zoom_transition); 1752#endif 1753#ifdef RENDER_WALL_MODE 1754vec2 wall_offset=u_width_scale*line_width*(a_join_normal_inside.xy/EXTENT);p.xy+=(1.0-a_join_normal_inside.z)*wall_offset*0.5;p.xy-=a_join_normal_inside.z*wall_offset*0.5; 1755#endif 1756float hidden=float((centroid_pos.x==0.0 && centroid_pos.y==1.0) || (color.a==0.0));gl_Position=mix(u_matrix*vec4(p,1),AWAY,hidden);vec2 pos=normal.z==1.0 1757? pos_nx.xy 1758: vec2(edgedistance,z*u_height_factor);v_pos=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,display_size,u_tile_units_to_pixels,pos);v_lighting=vec4(0.0,0.0,0.0,1.0);float NdotL=0.0; 1759#ifdef LIGHTING_3D_MODE 1760NdotL=calculate_NdotL(normal); 1761#else 1762NdotL=clamp(dot(normal,u_lightpos),0.0,1.0);NdotL=mix((1.0-u_lightintensity),max((0.5+u_lightintensity),1.0),NdotL); 1763#endif 1764if (normal.y !=0.0) {float r=0.84; 1765#ifndef LIGHTING_3D_MODE 1766r=mix(0.7,0.98,1.0-u_lightintensity); 1767#endif 1768NdotL*=( 1769(1.0-u_vertical_gradient)+(u_vertical_gradient*clamp((t+base)*pow(height/150.0,0.5),r,1.0)));} 1770#ifdef FAUX_AO
1771float concave=pos_nx.w-floor(pos_nx.w*0.5)*2.0;float start=top_up_ny_start.w;float y_ground=1.0-clamp(t+base,0.0,1.0);float top_height=height; 1772#ifdef TERRAIN 1773top_height=mix(max(c_ele+height,ele+base+2.0),ele+height,float(centroid_pos.x==0.0))-ele;y_ground+=y_ground*5.0/max(3.0,top_height); 1774#endif 1775v_ao=vec3(mix(concave,-concave,start),y_ground,h-ele);NdotL*=(1.0+0.05*(1.0-top_up_ny.y)*u_ao[0]); 1776#ifdef PROJECTION_GLOBE_VIEW 1777top_height+=u_height_lift; 1778#endif 1779gl_Position.z-=(0.0000006*(min(top_height,500.)+2.0*min(base,500.0)+60.0*concave+3.0*start))*gl_Position.w; 1780#endif 1781#ifdef LIGHTING_3D_MODE 1782v_normal=normal; 1783#else 1784v_lighting.rgb+=clamp(NdotL*u_lightcolor,mix(vec3(0.0),vec3(0.3),1.0-u_lightcolor),vec3(1.0));v_lighting*=u_opacity; 1785#endif 1786#ifdef FOG 1787v_fog_pos=fog_position(p); 1788#endif 1789}`),groundShadow:vn(`#include "_prelude_shadow.fragment.glsl" 1790precision highp float;uniform vec3 u_ground_shadow_factor;in vec4 v_pos_light_view_0;in vec4 v_pos_light_view_1; 1791#ifdef FOG 1792in float v_fog_opacity; 1793#endif 1794void main() {float light=shadowed_light_factor_plane_bias(v_pos_light_view_0,v_pos_light_view_1,1.0/gl_FragCoord.w);vec3 shadow=mix(u_ground_shadow_factor,vec3(1.0),light); 1795#ifdef RENDER_CUTOFF 1796shadow=mix(vec3(1.0),shadow,cutoff_opacity(u_cutoff_params,1.0/gl_FragCoord.w)); 1797#endif 1798#ifdef FOG 1799shadow=mix(shadow,vec3(1.0),v_fog_opacity); 1800#endif 1801#ifdef INDICATOR_CUTOUT 1802shadow=mix(shadow,vec3(1.0),1.0-applyCutout(vec4(1.0),0.0).r); 1803#endif 1804glFragColor=vec4(shadow,1.0);}`,`#include "_prelude_fog.vertex.glsl" 1805uniform mat4 u_matrix;uniform mat4 u_light_matrix_0;uniform mat4 u_light_matrix_1;in vec2 a_pos;out vec4 v_pos_light_view_0;out vec4 v_pos_light_view_1; 1806#ifdef FOG 1807out float v_fog_opacity; 1808#endif 1809void main() {gl_Position=u_matrix*vec4(a_pos,0.0,1.0);v_pos_light_view_0=u_light_matrix_0*vec4(a_pos,0.0,1.0);v_pos_light_view_1=u_light_matrix_1*vec4(a_pos,0.0,1.0); 1810#ifdef FOG 1811v_fog_pos=fog_position(a_pos);v_fog_opacity=fog(v_fog_pos); 1812#endif 1813}`),fillExtrusionGroundEffect:vn(`uniform highp float u_ao_pass;uniform highp float u_opacity;uniform highp float u_flood_light_intensity;uniform highp vec3 u_flood_light_color;uniform highp float u_attenuation;uniform sampler2D u_fb;uniform float u_fb_size; 1814#ifdef SDF_SUBPASS 1815in highp vec2 v_pos;in highp vec4 v_line_segment;in highp float v_flood_light_radius_tile;in highp vec2 v_ao;float line_df(highp vec2 a,highp vec2 b,highp vec2 p) {highp vec2 ba=b-a;highp vec2 pa=p-a;highp float r=clamp(dot(pa,ba)/dot(ba,ba),0.0,1.0);return length(pa-r*ba);} 1816#ifdef FOG 1817in highp float v_fog; 1818#endif 1819#endif 1820void main() { 1821#ifdef CLEAR_SUBPASS 1822vec4 color=vec4(1.0); 1823#ifdef CLEAR_FROM_TEXTURE 1824color=texture(u_fb,gl_FragCoord.xy/vec2(u_fb_size)); 1825#endif 1826glFragColor=color; 1827#else 1828#ifdef SDF_SUBPASS 1829highp float d=line_df(v_line_segment.xy,v_line_segment.zw,v_pos);highp float effect_radius=mix(v_flood_light_radius_tile,v_ao.y,u_ao_pass);d/=effect_radius;d=min(d,1.0);d=1.0-pow(1.0-d,u_attenuation);highp float effect_intensity=mix(u_flood_light_intensity,v_ao.x,u_ao_pass);highp float fog=1.0; 1830#ifdef FOG 1831fog=v_fog; 1832#endif 1833#ifdef RENDER_CUTOFF 1834fog*=v_cutoff_opacity; 1835#endif 1836glFragColor=vec4(vec3(0.0),mix(1.0,d,effect_intensity*u_opacity*fog)); 1837#else 1838vec4 color=mix(vec4(u_flood_light_color,1.0),vec4(vec3(0.0),1.0),u_ao_pass); 1839#ifdef OVERDRAW_INSPECTOR 1840color=vec4(1.0); 1841#endif 1842glFragColor=color; 1843#endif 1844HANDLE_WIREFRAME_DEBUG; 1845#endif 1846}`,`#include "_prelude_fog.vertex.glsl" 1847in highp vec4 a_pos_end;in highp float a_angular_offset_factor;in highp float a_hidden_by_landmark; 1848#ifdef SDF_SUBPASS 1849out highp vec2 v_pos;out highp vec4 v_line_segment;out highp float v_flood_light_radius_tile;out highp vec2 v_ao; 1850#ifdef FOG 1851out highp float v_fog; 1852#endif 1853#endif 1854uniform highp float u_flood_light_intensity;uniform highp mat4 u_matrix;uniform highp float u_ao_pass;uniform highp float u_meter_to_tile;uniform highp float u_edge_radius;uniform highp float u_dynamic_offset;uniform highp vec2 u_ao; 1855#pragma mapbox: define highp float flood_light_ground_radius 1856const float TANGENT_CUTOFF=4.0;const float NORM=32767.0;void main() {
1857#pragma mapbox: initialize highp float flood_light_ground_radius 1858vec2 p=a_pos_end.xy;vec2 q=floor(a_pos_end.zw*0.5);vec2 start_bottom=a_pos_end.zw-q*2.0;float fl_ground_radius=flood_light_ground_radius;fl_ground_radius=abs(flood_light_ground_radius);float direction=flood_light_ground_radius < 0.0 ?-1.0 : 1.0;float flood_radius_tile=fl_ground_radius*u_meter_to_tile;vec2 v=normalize(q-p);float ao_radius=u_ao.y/3.5;float effect_radius=mix(flood_radius_tile,ao_radius,u_ao_pass)+u_edge_radius;float angular_offset_factor=a_angular_offset_factor/NORM*TANGENT_CUTOFF;float angular_offset=direction*angular_offset_factor*effect_radius;float top=1.0-start_bottom.y;float side=(0.5-start_bottom.x)*2.0;vec2 extrusion_parallel=v*side*mix(u_dynamic_offset,angular_offset,top);vec2 perp=vec2(v.y,-v.x);vec2 extrusion_perp=direction*perp*effect_radius*top;vec3 pos=vec3(mix(q,p,start_bottom.x),0.0);pos.xy+=extrusion_parallel+extrusion_perp; 1859#ifdef SDF_SUBPASS 1860v_pos=pos.xy;v_line_segment=vec4(p,q)+perp.xyxy*u_edge_radius;v_flood_light_radius_tile=flood_radius_tile;v_ao=vec2(u_ao.x,ao_radius); 1861#ifdef FOG 1862v_fog_pos=fog_position(pos);v_fog=1.0-fog(v_fog_pos); 1863#endif 1864#endif 1865float hidden_by_landmark=0.0; 1866#ifdef HAS_CENTROID 1867hidden_by_landmark=a_hidden_by_landmark; 1868#endif 1869float isFloodlit=float(fl_ground_radius > 0.0 && u_flood_light_intensity > 0.0);float hidden=mix(1.0-isFloodlit,isFloodlit,u_ao_pass);hidden+=hidden_by_landmark;gl_Position=mix(u_matrix*vec4(pos,1.0),AWAY,float(hidden > 0.0)); 1870#ifdef RENDER_CUTOFF 1871v_cutoff_opacity=cutoff_opacity(u_cutoff_params,gl_Position.z); 1872#endif 1873}`),hillshadePrepare:vn(`precision highp float;uniform sampler2D u_image;in vec2 v_pos;uniform vec2 u_dimension;uniform float u_zoom;float getElevation(vec2 coord) {return texture(u_image,coord).r/4.0;}void main() {vec2 epsilon=1.0/u_dimension;float a=getElevation(v_pos+vec2(-epsilon.x,-epsilon.y));float b=getElevation(v_pos+vec2(0,-epsilon.y));float c=getElevation(v_pos+vec2(epsilon.x,-epsilon.y));float d=getElevation(v_pos+vec2(-epsilon.x,0));float e=getElevation(v_pos+vec2(epsilon.x,0));float f=getElevation(v_pos+vec2(-epsilon.x,epsilon.y));float g=getElevation(v_pos+vec2(0,epsilon.y));float h=getElevation(v_pos+vec2(epsilon.x,epsilon.y));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( 1874(c+e+e+h)-(a+d+d+f),(f+g+g+h)-(a+b+b+c) 1875)/pow(2.0,exaggeration+(19.2562-u_zoom));glFragColor=clamp(vec4( 1876deriv.x/2.0+0.5,deriv.y/2.0+0.5,1.0,1.0),0.0,1.0);}`,"uniform mat4 u_matrix;uniform vec2 u_dimension;in vec2 a_pos;in vec2 a_texture_pos;out 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:vn(`#include "_prelude_fog.fragment.glsl" 1877#include "_prelude_lighting.glsl" 1878uniform sampler2D u_image;in vec2 v_pos;uniform vec2 u_latrange;uniform vec2 u_light;uniform vec4 u_shadow;uniform vec4 u_highlight;uniform vec4 u_accent;uniform float u_emissive_strength;void main() {vec4 pixel=texture(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);glFragColor=accent_color*(1.0-shade_color.a)+shade_color; 1879#ifdef LIGHTING_3D_MODE 1880glFragColor=apply_lighting_with_emission_ground(glFragColor,u_emissive_strength); 1881#endif 1882#ifdef FOG 1883glFragColor=fog_dither(fog_apply_premultiplied(glFragColor,v_fog_pos)); 1884#endif 1885#ifdef OVERDRAW_INSPECTOR 1886glFragColor=vec4(1.0); 1887#endif 1888HANDLE_WIREFRAME_DEBUG;}`,`#include "_prelude_fog.vertex.glsl" 1889uniform mat4 u_matrix;in vec2 a_pos;in vec2 a_texture_pos;out vec2 v_pos;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);v_pos=a_texture_pos/8192.0; 1890#ifdef FOG 1891v_fog_pos=fog_position(a_pos); 1892#endif 1893}`),line:vn(`#include "_prelude_fog.fragment.glsl" 1894#include "_prelude_lighting.glsl" 1895#include "_prelude_shadow.fragment.glsl" 1896uniform lowp float u_device_pixel_ratio;uniform highp float u_width_scale;uniform highp float u_floor_width_scale;
1896uniform float u_alpha_discard_threshold;uniform highp vec2 u_trim_offset;uniform highp vec2 u_trim_fade_range;uniform lowp vec4 u_trim_color;in vec2 v_width2;in vec2 v_normal;in float v_gamma_scale;in highp vec3 v_uv; 1897#ifdef ELEVATED_ROADS 1898in highp float v_road_z_offset; 1899#endif 1900#ifdef RENDER_LINE_DASH 1901uniform sampler2D u_dash_image;in vec2 v_tex; 1902#endif 1903#ifdef RENDER_LINE_GRADIENT 1904uniform sampler2D u_gradient_image; 1905#endif 1906#ifdef INDICATOR_CUTOUT 1907in highp float v_z_offset; 1908#endif 1909#ifdef RENDER_SHADOWS 1910uniform vec3 u_ground_shadow_factor;in highp vec4 v_pos_light_view_0;in highp vec4 v_pos_light_view_1;in highp float v_depth; 1911#endif 1912float luminance(vec3 c) {return (c.r+c.r+c.b+c.g+c.g+c.g)*0.1667;}uniform float u_emissive_strength; 1913#pragma mapbox: define highp vec4 color 1914#pragma mapbox: define lowp float floorwidth 1915#pragma mapbox: define lowp vec4 dash 1916#pragma mapbox: define lowp float blur 1917#pragma mapbox: define lowp float opacity 1918#pragma mapbox: define lowp float border_width 1919#pragma mapbox: define lowp vec4 border_color 1920float linearstep(float edge0,float edge1,float x) {return clamp((x-edge0)/(edge1-edge0),0.0,1.0);}void main() { 1921#pragma mapbox: initialize highp vec4 color 1922#pragma mapbox: initialize lowp float floorwidth 1923#pragma mapbox: initialize lowp vec4 dash 1924#pragma mapbox: initialize lowp float blur 1925#pragma mapbox: initialize lowp float opacity 1926#pragma mapbox: initialize lowp float border_width 1927#pragma mapbox: initialize lowp vec4 border_color 1928float dist=length(v_normal)*v_width2.s;float blur2=(u_width_scale*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); 1929#ifdef RENDER_LINE_DASH 1930float sdfdist=texture(u_dash_image,v_tex).r;
1930float sdfgamma=1.0/(2.0*u_device_pixel_ratio)/dash.z;float scaled_floorwidth=(floorwidth*u_floor_width_scale);alpha*=linearstep(0.5-sdfgamma/scaled_floorwidth,0.5+sdfgamma/scaled_floorwidth,sdfdist); 1931#endif 1932highp vec4 out_color; 1933#ifdef RENDER_LINE_GRADIENT 1934out_color=texture(u_gradient_image,v_uv.xy); 1935#else 1936out_color=color; 1937#endif 1938float trim_alpha=1.0; 1939#ifdef RENDER_LINE_TRIM_OFFSET 1940highp float trim_start=u_trim_offset[0];highp float trim_end=u_trim_offset[1];highp float line_progress=v_uv[2];if (trim_end > trim_start) {highp float start_transition=max(0.0,min(1.0,(line_progress-trim_start)/max(u_trim_fade_range[0],1.0e-9)));highp float end_transition=max(0.0,min(1.0,(trim_end-line_progress)/max(u_trim_fade_range[1],1.0e-9)));highp float transition_factor=min(start_transition,end_transition);out_color=mix(out_color,u_trim_color,transition_factor);trim_alpha=1.0-transition_factor;} 1941#endif 1942if (u_alpha_discard_threshold !=0.0) {if (alpha < u_alpha_discard_threshold) {discard;}} 1943#ifdef RENDER_LINE_BORDER 1944float edgeBlur=((border_width*u_width_scale)+1.0/u_device_pixel_ratio);float alpha2=clamp(min(dist-(v_width2.t-edgeBlur),v_width2.s-dist)/edgeBlur,0.0,1.0);if (alpha2 < 1.) {float smoothAlpha=smoothstep(0.6,1.0,alpha2);if (border_color.a==0.0) {float Y=(out_color.a > 0.01) ? luminance(out_color.rgb/out_color.a) : 1.;float adjustment=(Y > 0.) ? 0.5/Y : 0.45;if (out_color.a > 0.25 && Y < 0.25) {vec3 borderColor=(Y > 0.) ? out_color.rgb : vec3(1,1,1)*out_color.a;out_color.rgb=out_color.rgb+borderColor*(adjustment*(1.0-smoothAlpha));} else {out_color.rgb*=(0.6 +0.4*smoothAlpha);}} else {out_color=mix(border_color*trim_alpha,out_color,smoothAlpha);}} 1945#endif 1946#ifdef LIGHTING_3D_MODE 1947out_color=apply_lighting_with_emission_ground(out_color,u_emissive_strength); 1948#ifdef RENDER_SHADOWS 1949float light=shadowed_light_factor(v_pos_light_view_0,v_pos_light_view_1,v_depth); 1950#ifdef ELEVATED_ROADS 1951out_color.rgb*=mix(v_road_z_offset !=0.0 ? u_ground_shadow_factor : vec3(1.0),vec3(1.0),light); 1952#else 1953out_color.rgb*=mix(u_ground_shadow_factor,vec3(1.0),light); 1954#endif 1955#endif 1956#endif 1957#ifdef FOG 1958out_color=fog_dither(fog_apply_premultiplied(out_color,v_fog_pos)); 1959#endif 1960out_color*=(alpha*opacity); 1961#ifdef INDICATOR_CUTOUT 1962out_color=applyCutout(out_color,v_z_offset); 1963#endif 1964glFragColor=out_color; 1965#ifdef OVERDRAW_INSPECTOR 1966glFragColor=vec4(1.0); 1967#endif 1968HANDLE_WIREFRAME_DEBUG;}`,`#include "_prelude_fog.vertex.glsl" 1969#include "_prelude_shadow.vertex.glsl" 1970#include "_prelude_terrain.vertex.glsl" 1971#define EXTRUDE_SCALE 0.015873016 1972in vec2 a_pos_normal;in vec4 a_data; 1973#if defined(ELEVATED) || defined(ELEVATED_ROADS) || defined(VARIABLE_LINE_WIDTH) 1974in vec3 a_z_offset_width; 1975#endif 1976#if defined(RENDER_LINE_GRADIENT) || defined(RENDER_LINE_TRIM_OFFSET) 1977in highp vec3 a_packed; 1978#endif 1979#ifdef RENDER_LINE_DASH 1980in float a_linesofar; 1981#endif 1982uniform mat4 u_matrix;uniform mat2 u_pixels_to_tile_units;uniform vec2 u_units_to_pixels;uniform lowp float u_device_pixel_ratio;uniform float u_width_scale;uniform highp float u_floor_width_scale; 1983#ifdef ELEVATED 1984uniform lowp float u_zbias_factor;uniform lowp float u_tile_to_meter;float sample_elevation(vec2 apos) { 1985#ifdef ELEVATION_REFERENCE_SEA 1986return 0.0; 1987#else 1988return elevation(apos); 1989#endif 1990} 1991#endif 1992out vec2 v_normal;out vec2 v_width2;out float v_gamma_scale;out highp vec3 v_uv; 1993#ifdef ELEVATED_ROADS 1994out highp float v_road_z_offset; 1995#endif 1996#ifdef RENDER_LINE_DASH 1997uniform vec2 u_texsize;uniform float u_tile_units_to_pixels;out vec2 v_tex; 1998#endif 1999#ifdef RENDER_LINE_GRADIENT 2000uniform float u_image_height; 2001#endif 2002#ifdef INDICATOR_CUTOUT 2003out highp float v_z_offset; 2004#endif 2005#ifdef RENDER_SHADOWS 2006uniform mat4 u_light_matrix_0;uniform mat4 u_light_matrix_1;out highp vec4 v_pos_light_view_0;out highp vec4 v_pos_light_view_1;out highp float v_depth; 2007#endif 2008#pragma mapbox: define highp vec4 color 2009#pragma mapbox: define lowp float floorwidth 2010#pragma mapbox: define lowp vec4 dash 2011#pragma mapbox: define lowp float blur 2012#pragma mapbox: define lowp float opacity 2013#pragma mapbox: define mediump float gapwidth 2014#pragma mapbox: define lowp float offset 2015#pragma mapbox: define mediump float width 2016#pragma mapbox: define lowp float border_width 2017#pragma mapbox: define lowp vec4 border_color 2018void main() { 2019#pragma mapbox: initialize highp vec4 color 2020#pragma mapbox: initialize lowp float floorwidth 2021#pragma mapbox: initialize lowp vec4 dash 2022#pragma mapbox: initialize lowp float blur 2023#pragma mapbox: initialize lowp float opacity 2024#pragma mapbox: initialize mediump float gapwidth 2025#pragma mapbox: initialize lowp float offset 2026#pragma mapbox: initialize mediump float width 2027#pragma mapbox: initialize lowp float border_width 2028#pragma mapbox: initialize lowp vec4 border_color 2029float a_z_offset; 2030#if defined(ELEVATED) || defined(ELEVATED_ROADS) 2031a_z_offset=a_z_offset_width.x; 2032#endif 2033float 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;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; 2034#ifdef VARIABLE_LINE_WIDTH 2035float left=a_pos_normal.y-2.0*floor(a_pos_normal.y*0.5);halfwidth=(u_width_scale*(left==1.0 ? a_z_offset_width.y : a_z_offset_width.z))/2.0; 2036#else 2037halfwidth=(u_width_scale*width)/2.0; 2038#endif 2039offset=-1.0*offset*u_width_scale;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*EXTRUDE_SCALE;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*EXTRUDE_SCALE*normal.y*mat2(t,-u,u,t);float hidden=float(opacity==0.0);vec2 extrude=dist*u_pixels_to_tile_units;
2039vec4 projected_extrude=u_matrix*vec4(extrude,0.0,0.0);vec2 projected_extrude_xy=projected_extrude.xy; 2040#ifdef ELEVATED_ROADS 2041v_road_z_offset=a_z_offset;gl_Position=u_matrix*vec4(pos+offset2*u_pixels_to_tile_units,a_z_offset,1.0)+projected_extrude; 2042#else 2043#ifdef ELEVATED 2044vec2 offsetTile=offset2*u_pixels_to_tile_units;vec2 offset_pos=pos+offsetTile;float ele=0.0; 2045#ifdef CROSS_SLOPE_VERTICAL 2046float top=a_pos_normal.y-2.0*floor(a_pos_normal.y*0.5);float line_height=2.0*u_tile_to_meter*outset*top*u_pixels_to_tile_units[1][1]+a_z_offset;ele=sample_elevation(offset_pos)+line_height;projected_extrude=vec4(0); 2047#else 2048#ifdef CROSS_SLOPE_HORIZONTAL 2049float ele0=sample_elevation(offset_pos);float ele1=max(sample_elevation(offset_pos+extrude),sample_elevation(offset_pos+extrude/2.0));float ele2=max(sample_elevation(offset_pos-extrude),sample_elevation(offset_pos-extrude/2.0));float ele_max=max(ele0,max(ele1,ele2));ele=ele_max+a_z_offset; 2050#else 2051float ele0=sample_elevation(offset_pos);float ele1=max(sample_elevation(offset_pos+extrude),sample_elevation(offset_pos+extrude/2.0));float ele2=max(sample_elevation(offset_pos-extrude),sample_elevation(offset_pos-extrude/2.0));float ele_max=max(ele0,0.5*(ele1+ele2));ele=ele_max-ele0+ele1+a_z_offset; 2052#endif 2053#endif 2054gl_Position=u_matrix*vec4(offset_pos,ele,1.0)+projected_extrude;float z=clamp(gl_Position.z/gl_Position.w,0.5,1.0);float zbias=max(0.00005,(pow(z,0.8)-z)*u_zbias_factor*u_exaggeration);gl_Position.z-=(gl_Position.w*zbias);gl_Position=mix(gl_Position,AWAY,hidden); 2055#else 2056gl_Position=mix(u_matrix*vec4(pos+offset2*u_pixels_to_tile_units,0.0,1.0)+projected_extrude,AWAY,hidden); 2057#endif 2058#endif 2059#ifdef ELEVATED_ROADS 2060#ifdef RENDER_SHADOWS 2061vec3 shd_pos=vec3(pos+(offset2+dist)*u_pixels_to_tile_units,a_z_offset);vec3 shd_pos0=shd_pos;vec3 shd_pos1=shd_pos; 2062#ifdef NORMAL_OFFSET 2063vec3 shd_pos_offset=shadow_normal_offset(vec3(0.0,0.0,1.0));shd_pos0+=shd_pos_offset*shadow_normal_offset_multiplier0();shd_pos1+=shd_pos_offset*shadow_normal_offset_multiplier1(); 2064#endif 2065v_pos_light_view_0=u_light_matrix_0*vec4(shd_pos0,1);v_pos_light_view_1=u_light_matrix_1*vec4(shd_pos1,1);v_depth=gl_Position.w; 2066#endif 2067#endif 2068#ifndef RENDER_TO_TEXTURE 2069float epsilon=0.0001;float extrude_length_without_perspective=max(length(dist),epsilon);float extrude_length_with_perspective=max(length(projected_extrude_xy/gl_Position.w*u_units_to_pixels),epsilon);v_gamma_scale=mix(extrude_length_without_perspective/extrude_length_with_perspective,1.0,step(0.01,blur)); 2070#else 2071v_gamma_scale=1.0; 2072#endif 2073#if defined(RENDER_LINE_GRADIENT) || defined(RENDER_LINE_TRIM_OFFSET) 2074highp float a_uv_x=a_packed[0];float a_split_index=a_packed[1];highp float line_progress=a_packed[2]; 2075#ifdef RENDER_LINE_GRADIENT 2076highp float texel_height=1.0/u_image_height;highp float half_texel_height=0.5*texel_height;v_uv=vec3(a_uv_x,a_split_index*texel_height-half_texel_height,line_progress); 2077#else 2078v_uv=vec3(a_uv_x,0.0,line_progress); 2079#endif 2080#endif 2081#ifdef RENDER_LINE_DASH 2082float scale=dash.z==0.0 ? 0.0 : u_tile_units_to_pixels/dash.z;float height=dash.y;v_tex=vec2(a_linesofar*scale/(floorwidth*u_floor_width_scale),(-normal.y*height+dash.x+0.5)/u_texsize.y); 2083#endif 2084v_width2=vec2(outset,inset); 2085#ifdef FOG 2086v_fog_pos=fog_position(pos); 2087#endif 2088#ifdef INDICATOR_CUTOUT 2089v_z_offset=a_z_offset; 2090#endif 2091}`),linePattern:vn(`#include "_prelude_fog.fragment.glsl" 2092#include "_prelude_lighting.glsl" 2093#include "_prelude_shadow.fragment.glsl" 2094uniform highp float u_device_pixel_ratio;uniform highp float u_width_scale;uniform highp float u_alpha_discard_threshold;uniform highp vec2 u_texsize;uniform highp float u_tile_units_to_pixels;uniform highp vec2 u_trim_offset;uniform highp vec2 u_trim_fade_range;uniform lowp vec4 u_trim_color;uniform sampler2D u_image; 2095#ifdef LINE_PATTERN_TRANSITION 2096uniform float u_pattern_transition; 2097#endif 2098in vec2 v_normal;in vec2 v_width2;in highp float v_linesofar;in float v_gamma_scale;in float v_width; 2099#ifdef RENDER_LINE_TRIM_OFFSET 2100in highp vec3 v_uv; 2101#endif 2102#ifdef ELEVATED_ROADS 2103in highp float v_road_z_offset; 2104#endif 2105#ifdef LINE_JOIN_NONE 2106in vec2 v_pattern_data; 2107#endif 2108#ifdef INDICATOR_CUTOUT 2109in highp float v_z_offset; 2110#endif 2111#ifdef RENDER_SHADOWS 2112uniform vec3 u_ground_shadow_factor;in highp vec4 v_pos_light_view_0;in highp vec4 v_pos_light_view_1;in highp float v_depth; 2113#endif 2114uniform float u_emissive_strength; 2115#pragma mapbox: define mediump vec4 pattern 2116#ifdef LINE_PATTERN_TRANSITION 2117#pragma mapbox: define mediump vec4 pattern_b 2118#endif 2119#pragma mapbox: define mediump float pixel_ratio 2120#pragma mapbox: define mediump float blur 2121#pragma mapbox: define mediump float opacity 2122void main() { 2123#pragma mapbox: initialize mediump vec4 pattern 2124#ifdef LINE_PATTERN_TRANSITION 2125#pragma mapbox: initialize mediump vec4 pattern_b 2126#endif 2127#pragma mapbox: initialize mediump float pixel_ratio 2128#pragma mapbox: initialize mediump float blur 2129#pragma mapbox: initialize mediump float opacity 2130vec2 pattern_tl=pattern.xy;vec2 pattern_br=pattern.zw;vec2 display_size=(pattern_br-pattern_tl)/pixel_ratio;highp float pattern_size=display_size.x/u_tile_units_to_pixels;float aspect=display_size.y/v_width;float dist=length(v_normal)*v_width2.s;float blur2=(u_width_scale*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);highp float pattern_x=v_linesofar/pattern_size*aspect;highp float x=mod(pattern_x,1.0);highp float y=0.5*v_normal.y+0.5;vec2 texel_size=1.0/u_texsize;highp vec2 pos=mix(pattern_tl*texel_size-texel_size,pattern_br*texel_size+texel_size,vec2(x,y));highp vec2 lod_pos=mix(pattern_tl*texel_size-texel_size,pattern_br*texel_size+texel_size,vec2(pattern_x,y));vec4 color=textureLodCustom(u_image,pos,lod_pos); 2131#ifdef LINE_PATTERN_TRANSITION 2132vec2 pattern_b_tl=pattern_b.xy;vec2 pattern_b_br=pattern_b.zw;highp vec2 pos_b=mix(pattern_b_tl*texel_size-texel_size,pattern_b_br*texel_size+texel_size,vec2(x,y));vec4 color_b=textureLodCustom(u_image,pos_b,lod_pos);color=color*(1.0-u_pattern_transition)+color_b*u_pattern_transition; 2133#endif 2134#ifdef RENDER_LINE_TRIM_OFFSET 2135highp float trim_start=u_trim_offset[0];highp float trim_end=u_trim_offset[1];highp float line_progress=v_uv[2];if (trim_end > trim_start) {highp float start_transition=max(0.0,min(1.0,(line_progress-trim_start)/max(u_trim_fade_range[0],1.0e-9)));highp float end_transition=max(0.0,min(1.0,(trim_end-line_progress)/max(u_trim_fade_range[1],1.0e-9)));highp float transition_factor=min(start_transition,end_transition);color=mix(color,color.a*u_trim_color,transition_factor);} 2136#endif 2137#ifdef LINE_JOIN_NONE 2138highp float pattern_len=pattern_size/aspect;highp float segment_phase=pattern_len-mod(v_linesofar-v_pattern_data.x+pattern_len,pattern_len);highp float visible_start=segment_phase-step(pattern_len*0.5,segment_phase)*pattern_len;highp float visible_end=floor((v_pattern_data.y-segment_phase)/pattern_len)*pattern_len+segment_phase;visible_end+=step(pattern_len*0.5,v_pattern_data.y-visible_end)*pattern_len;if (v_pattern_data.x < visible_start || v_pattern_data.x >=visible_end) {color=vec4(0.0);} 2139#endif 2140#ifdef LIGHTING_3D_MODE 2141color=apply_lighting_with_emission_ground(color,u_emissive_strength); 2142#ifdef RENDER_SHADOWS 2143float light=shadowed_light_factor(v_pos_light_view_0,v_pos_light_view_1,v_depth); 2144#ifdef ELEVATED_ROADS 2145color.rgb*=mix(v_road_z_offset !=0.0 ? u_ground_shadow_factor : vec3(1.0),vec3(1.0),light); 2146#else 2147color.rgb*=mix(u_ground_shadow_factor,vec3(1.0),light); 2148#endif 2149#endif 2150#endif 2151#ifdef FOG 2152color=fog_dither(fog_apply_premultiplied(color,v_fog_pos)); 2153#endif 2154color*=(alpha*opacity);if (u_alpha_discard_threshold !=0.0) {if (color.a < u_alpha_discard_threshold) {discard;}} 2155#ifdef INDICATOR_CUTOUT 2156color=applyCutout(color,v_z_offset); 2157#endif 2158glFragColor=color; 2159#ifdef OVERDRAW_INSPECTOR 2160glFragColor=vec4(1.0); 2161#endif 2162HANDLE_WIREFRAME_DEBUG;}`,`#include "_prelude_fog.vertex.glsl" 2163#include "_prelude_shadow.vertex.glsl" 2164#include "_prelude_terrain.vertex.glsl" 2165#define scale 0.015873016 2166in vec2 a_pos_normal;in vec4 a_data; 2167#if defined(ELEVATED) || defined(ELEVATED_ROADS) 2168in vec3 a_z_offset_width; 2169#endif 2170#ifdef RENDER_LINE_TRIM_OFFSET 2171in highp vec3 a_packed; 2172#endif 2173in highp float a_linesofar; 2174#ifdef LINE_JOIN_NONE 2175in highp vec3 a_pattern_data;out vec2 v_pattern_data; 2176#endif 2177#ifdef INDICATOR_CUTOUT 2178out highp float v_z_offset; 2179#endif 2180uniform mat4 u_matrix;uniform float u_tile_units_to_pixels;uniform vec2 u_units_to_pixels;uniform mat2 u_pixels_to_tile_units;uniform float u_device_pixel_ratio;uniform float u_width_scale;uniform float u_floor_width_scale; 2181#ifdef ELEVATED 2182uniform lowp float u_zbias_factor;uniform lowp float u_tile_to_meter;float sample_elevation(vec2 apos) { 2183#ifdef ELEVATION_REFERENCE_SEA 2184return 0.0; 2185#else 2186return elevation(apos); 2187#endif 2188} 2189#endif 2190out vec2 v_normal;out vec2 v_width2;out highp float v_linesofar;out float v_gamma_scale;out float v_width; 2191#ifdef RENDER_LINE_TRIM_OFFSET 2192out highp vec3 v_uv; 2193#endif 2194#ifdef ELEVATED_ROADS 2195out highp float v_road_z_offset; 2196#endif 2197#ifdef RENDER_SHADOWS 2198uniform mat4 u_light_matrix_0;uniform mat4 u_light_matrix_1;out highp vec4 v_pos_light_view_0;out highp vec4 v_pos_light_view_1;out highp float v_depth; 2199#endif 2200#pragma mapbox: define mediump float blur 2201#pragma mapbox: define mediump float opacity 2202#pragma mapbox: define mediump float offset 2203#pragma mapbox: define mediump float gapwidth 2204#pragma mapbox: define mediump float width 2205#pragma mapbox: define mediump float floorwidth 2206#pragma mapbox: define mediump vec4 pattern 2207#ifdef LINE_PATTERN_TRANSITION 2208#pragma mapbox: define mediump vec4 pattern_b 2209#endif 2210#pragma mapbox: define mediump float pixel_ratio 2211void main() { 2212#pragma mapbox: initialize mediump float blur 2213#pragma mapbox: initialize mediump float opacity 2214#pragma mapbox: initialize mediump float offset 2215#pragma mapbox: initialize mediump float gapwidth 2216#pragma mapbox: initialize mediump float width 2217#pragma mapbox: initialize mediump float floorwidth 2218#pragma mapbox: initialize mediump vec4 pattern 2219#ifdef LINE_PATTERN_TRANSITION 2220#pragma mapbox: initialize mediump vec4 pattern_b 2221#endif 2222#pragma mapbox: initialize mediump float pixel_ratio 2223float a_z_offset; 2224#if defined(ELEVATED) || defined(ELEVATED_ROADS) 2225a_z_offset=a_z_offset_width.x; 2226#endif 2227float 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;vec2 pos=floor(a_pos_normal*0.5);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=(u_width_scale*width)/2.0;offset=-1.0*offset*u_width_scale;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);vec2 dist=outset*a_extrude*scale;float u=0.5*a_direction;float t=1.0-abs(u);vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);float hidden=float(opacity==0.0);vec2 extrude=dist*u_pixels_to_tile_units;
2227vec4 projected_extrude=u_matrix*vec4(extrude,0.0,0.0);vec2 projected_extrude_xy=projected_extrude.xy; 2228#ifdef ELEVATED_ROADS 2229v_road_z_offset=a_z_offset;gl_Position=u_matrix*vec4(pos+offset2*u_pixels_to_tile_units,a_z_offset,1.0)+projected_extrude; 2230#else 2231#ifdef ELEVATED 2232vec2 offsetTile=offset2*u_pixels_to_tile_units;vec2 offset_pos=pos+offsetTile;float ele=0.0; 2233#ifdef CROSS_SLOPE_VERTICAL 2234float top=a_pos_normal.y-2.0*floor(a_pos_normal.y*0.5);float line_height=2.0*u_tile_to_meter*outset*top*u_pixels_to_tile_units[1][1]+a_z_offset;ele=sample_elevation(offset_pos)+line_height;projected_extrude=vec4(0); 2235#else 2236#ifdef CROSS_SLOPE_HORIZONTAL 2237float ele0=sample_elevation(offset_pos);float ele1=max(sample_elevation(offset_pos+extrude),sample_elevation(offset_pos+extrude/2.0));float ele2=max(sample_elevation(offset_pos-extrude),sample_elevation(offset_pos-extrude/2.0));float ele_max=max(ele0,max(ele1,ele2));ele=ele_max+a_z_offset; 2238#else 2239float ele0=sample_elevation(offset_pos);float ele1=max(sample_elevation(offset_pos+extrude),sample_elevation(offset_pos+extrude/2.0));float ele2=max(sample_elevation(offset_pos-extrude),sample_elevation(offset_pos-extrude/2.0));float ele_max=max(ele0,0.5*(ele1+ele2));ele=ele_max-ele0+ele1+a_z_offset; 2240#endif 2241#endif 2242gl_Position=u_matrix*vec4(offset_pos,ele,1.0)+projected_extrude;float z=clamp(gl_Position.z/gl_Position.w,0.5,1.0);float zbias=max(0.00005,(pow(z,0.8)-z)*u_zbias_factor*u_exaggeration);gl_Position.z-=(gl_Position.w*zbias);gl_Position=mix(gl_Position,AWAY,hidden); 2243#else 2244gl_Position=mix(u_matrix*vec4(pos+offset2*u_pixels_to_tile_units,0.0,1.0)+projected_extrude,AWAY,hidden); 2245#endif 2246#endif 2247#ifdef ELEVATED_ROADS 2248#ifdef RENDER_SHADOWS 2249vec3 shd_pos=vec3(pos+(offset2+dist)*u_pixels_to_tile_units,a_z_offset);vec3 shd_pos0=shd_pos;vec3 shd_pos1=shd_pos; 2250#ifdef NORMAL_OFFSET 2251vec3 shd_pos_offset=shadow_normal_offset(vec3(0.0,0.0,1.0));shd_pos0+=shd_pos_offset*shadow_normal_offset_multiplier0();shd_pos1+=shd_pos_offset*shadow_normal_offset_multiplier1(); 2252#endif 2253v_pos_light_view_0=u_light_matrix_0*vec4(shd_pos0,1);v_pos_light_view_1=u_light_matrix_1*vec4(shd_pos1,1);v_depth=gl_Position.w; 2254#endif 2255#endif 2256#ifndef RENDER_TO_TEXTURE 2257float 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=mix(extrude_length_without_perspective/extrude_length_with_perspective,1.0,step(0.01,blur)); 2258#else 2259v_gamma_scale=1.0; 2260#endif 2261#ifdef RENDER_LINE_TRIM_OFFSET 2262highp float a_uv_x=a_packed[0];highp float line_progress=a_packed[2];v_uv=vec3(a_uv_x,0.0,line_progress); 2263#endif 2264v_linesofar=a_linesofar;v_width2=vec2(outset,inset);v_width=(floorwidth*u_floor_width_scale); 2265#ifdef LINE_JOIN_NONE 2266v_width=(floorwidth*u_floor_width_scale)+ANTIALIASING;mediump float pixels_to_tile_units=1.0/u_tile_units_to_pixels;mediump float pixel_ratio_inverse=1.0/pixel_ratio;mediump float aspect=v_width/((pattern.w-pattern.y)*pixel_ratio_inverse);highp float subt_multiple=(pattern.z-pattern.x)*pixel_ratio_inverse*pixels_to_tile_units*aspect*32.0;highp float subt=floor(a_pattern_data.z/subt_multiple)*subt_multiple;float offset_sign=(fract(a_pattern_data.x)-0.5)*4.0;float line_progress_offset=offset_sign*v_width*0.5*pixels_to_tile_units;v_linesofar=(a_pattern_data.z-subt)+a_linesofar+line_progress_offset;v_pattern_data=vec2(a_pattern_data.x+line_progress_offset,a_pattern_data.y); 2267#endif 2268#ifdef FOG 2269v_fog_pos=fog_position(pos); 2270#endif 2271#ifdef INDICATOR_CUTOUT 2272v_z_offset=a_z_offset; 2273#endif 2274}`),raster:vn(`#include "_prelude_fog.fragment.glsl" 2275#include "_prelude_lighting.glsl" 2276#include "_prelude_raster_array.glsl" 2277uniform float u_fade_t;uniform float u_opacity;uniform highp float u_raster_elevation;uniform highp float u_zoom_transition;in vec2 v_pos0;in vec2 v_pos1;in float v_depth; 2278#ifdef PROJECTION_GLOBE_VIEW 2279in float v_split_fade; 2280#endif 2281uniform float u_brightness_low;uniform float u_brightness_high;uniform float u_saturation_factor;uniform float u_contrast_factor;uniform vec3 u_spin_weights;uniform float u_emissive_strength; 2282#ifndef RASTER_ARRAY 2283uniform highp sampler2D u_image0;uniform sampler2D u_image1; 2284#endif 2285#ifdef RASTER_COLOR 2286uniform sampler2D u_color_ramp;uniform highp vec4 u_colorization_mix;uniform highp float u_colorization_offset;uniform vec2 u_texture_res; 2287#endif 2288void main() {vec4 color0,color1,color;vec2 value; 2289#ifdef RASTER_COLOR 2290#ifdef RASTER_ARRAY 2291#ifdef RASTER_ARRAY_LINEAR 2292value=mix( 2293raTexture2D_image0_linear(v_pos0,u_texture_res,u_colorization_mix,u_colorization_offset),raTexture2D_image1_linear(v_pos1,u_texture_res,u_colorization_mix,u_colorization_offset),u_fade_t 2294); 2295#else 2296value=mix( 2297raTexture2D_image0_nearest(v_pos0,u_texture_res,u_colorization_mix,u_colorization_offset),raTexture2D_image1_nearest(v_pos1,u_texture_res,u_colorization_mix,u_colorization_offset),u_fade_t 2298); 2299#endif 2300if (value.y > 0.0) value.x/=value.y; 2301#else 2302color=mix(texture(u_image0,v_pos0),texture(u_image1,v_pos1),u_fade_t);value=vec2(u_colorization_offset+dot(color.rgb,u_colorization_mix.rgb),color.a); 2303#endif 2304color=texture(u_color_ramp,vec2(value.x,0.5));if (color.a > 0.0) color.rgb/=color.a;color.a*=value.y; 2305#else 2306color0=texture(u_image0,v_pos0);color1=texture(u_image1,v_pos1);if (color0.a > 0.0) color0.rgb/=color0.a;if (color1.a > 0.0) color1.rgb/=color1.a;color=mix(color0,color1,u_fade_t); 2307#endif 2308color.a*=u_opacity; 2309#ifdef GLOBE_POLES 2310color.a*=1.0-smoothstep(0.0,0.05,u_zoom_transition); 2311#endif 2312vec3 rgb=color.rgb;rgb=vec3( 2313dot(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);vec3 out_color=mix(u_high_vec,u_low_vec,rgb); 2314#ifdef LIGHTING_3D_MODE 2315out_color=apply_lighting_with_emission_ground(vec4(out_color,1.0),u_emissive_strength).rgb; 2316#endif 2317#ifdef FOG 2318highp float fog_limit_high_meters=1000000.0;highp float fog_limit_low_meters=600000.0;float fog_limit=1.0-smoothstep(fog_limit_low_meters,fog_limit_high_meters,u_raster_elevation);out_color=fog_dither(fog_apply(out_color,v_fog_pos,fog_limit)); 2319#endif 2320glFragColor=vec4(out_color*color.a,color.a); 2321#ifdef PROJECTION_GLOBE_VIEW 2322glFragColor*=mix(1.0,1.0-smoothstep(0.0,0.05,u_zoom_transition),smoothstep(0.8,0.9,v_split_fade)); 2323#endif 2324#ifdef RENDER_CUTOFF 2325glFragColor=glFragColor*cutoff_opacity(u_cutoff_params,v_depth); 2326#endif 2327#ifdef OVERDRAW_INSPECTOR 2328glFragColor=vec4(1.0); 2329#endif 2330HANDLE_WIREFRAME_DEBUG;}`,`#include "_prelude_fog.vertex.glsl" 2331uniform mat4 u_matrix;uniform mat4 u_normalize_matrix;uniform mat4 u_globe_matrix;uniform mat4 u_merc_matrix;uniform mat3 u_grid_matrix;uniform vec2 u_tl_parent;uniform float u_scale_parent;uniform vec2 u_perspective_transform;uniform vec2 u_texture_offset;uniform float u_raster_elevation;uniform float u_zoom_transition;uniform vec2 u_merc_center; 2332#define GLOBE_UPSCALE GLOBE_RADIUS/6371008.8 2333#ifdef GLOBE_POLES 2334in vec3 a_globe_pos;in vec2 a_uv; 2335#else 2336in vec2 a_pos;in vec2 a_texture_pos; 2337#endif 2338out vec2 v_pos0;out vec2 v_pos1;out float v_depth; 2339#ifdef PROJECTION_GLOBE_VIEW 2340out float v_split_fade; 2341#endif 2342void main() {vec2 uv; 2343#ifdef GLOBE_POLES 2344vec3 globe_pos=a_globe_pos;globe_pos+=normalize(globe_pos)*u_raster_elevation*GLOBE_UPSCALE;gl_Position=u_matrix*u_globe_matrix*vec4(globe_pos ,1.0);uv=a_uv; 2345#ifdef FOG 2346v_fog_pos=fog_position((u_normalize_matrix*vec4(a_globe_pos,1.0)).xyz); 2347#endif 2348#else 2349float w=1.0+dot(a_texture_pos,u_perspective_transform);uv=a_texture_pos/8192.0; 2350#ifdef PROJECTION_GLOBE_VIEW 2351vec3 decomposed_pos_and_skirt=decomposeToPosAndSkirt(a_pos);vec3 latLng=u_grid_matrix*vec3(decomposed_pos_and_skirt.xy,1.0);vec3 globe_pos=latLngToECEF(latLng.xy);globe_pos+=normalize(globe_pos)*u_raster_elevation*GLOBE_UPSCALE;vec4 globe_world_pos=u_globe_matrix*vec4(globe_pos,1.0);vec4 merc_world_pos=vec4(0.0);float mercatorY=mercatorYfromLat(latLng[0]);float mercatorX=mercatorXfromLng(latLng[1]); 2352v_split_fade=0.0;if (u_zoom_transition > 0.0) {vec2 merc_pos=vec2(mercatorX,mercatorY);merc_world_pos=vec4(merc_pos,u_raster_elevation,1.0);merc_world_pos.xy-=u_merc_center;merc_world_pos.x=wrap(merc_world_pos.x,-0.5,0.5);merc_world_pos=u_merc_matrix*merc_world_pos;float opposite_merc_center=mod(u_merc_center.x+0.5,1.0);float dist_from_poles=(abs(mercatorY-0.5)*2.0);float range=0.1;v_split_fade=abs(opposite_merc_center-mercatorX);v_split_fade=clamp(1.0-v_split_fade,0.0,1.0);v_split_fade=max(smoothstep(1.0-range,1.0,dist_from_poles),max(smoothstep(1.0-range,1.0,v_split_fade),smoothstep(1.0-range,1.0,1.0-v_split_fade)));}float tiles=u_grid_matrix[0][2];
2352if (tiles > 0.0) {float idx=u_grid_matrix[1][2];float idy=u_grid_matrix[2][2];float uvY=mercatorY*tiles-idy;float uvX=mercatorX*tiles-idx;uv=vec2(uvX,uvY);}vec4 interpolated_pos=vec4(mix(globe_world_pos.xyz,merc_world_pos.xyz,u_zoom_transition)*w,w);gl_Position=u_matrix*interpolated_pos; 2353#ifdef FOG 2354v_fog_pos=fog_position((u_normalize_matrix*vec4(globe_pos,1.0)).xyz); 2355#endif 2356#else 2357gl_Position=u_matrix*vec4(a_pos*w,u_raster_elevation*w,w); 2358#ifdef FOG 2359v_fog_pos=fog_position(a_pos); 2360#endif 2361#endif 2362#endif 2363v_pos0=uv;v_pos1=(v_pos0*u_scale_parent)+u_tl_parent;v_pos0=u_texture_offset.x+u_texture_offset.y*v_pos0;v_pos1=u_texture_offset.x+u_texture_offset.y*v_pos1; 2364#ifdef RENDER_CUTOFF 2365v_depth=gl_Position.z; 2366#endif 2367}`),rasterParticle:vn(`#include "_prelude_fog.fragment.glsl" 2368#include "_prelude_lighting.glsl" 2369uniform float u_fade_t;uniform float u_opacity;uniform highp float u_raster_elevation;in vec2 v_pos0;in vec2 v_pos1;uniform sampler2D u_image0;uniform sampler2D u_image1;void main() {vec4 color0,color1,color;color0=texture(u_image0,v_pos0);color1=texture(u_image1,v_pos1);if (color0.a > 0.0) color0.rgb/=color0.a;if (color1.a > 0.0) color1.rgb/=color1.a;color=mix(color0,color1,u_fade_t);color.a*=u_opacity;vec3 out_color=color.rgb; 2370#ifdef LIGHTING_3D_MODE 2371out_color=apply_lighting_with_emission_ground(vec4(out_color,1.0),0.0).rgb; 2372#endif 2373#ifdef FOG 2374highp float fog_limit_high_meters=1000000.0;highp float fog_limit_low_meters=600000.0;float fog_limit=1.0-smoothstep(fog_limit_low_meters,fog_limit_high_meters,u_raster_elevation);out_color=fog_dither(fog_apply(out_color,v_fog_pos,fog_limit)); 2375#endif 2376glFragColor=vec4(out_color*color.a,color.a); 2377#ifdef OVERDRAW_INSPECTOR 2378glFragColor=vec4(1.0); 2379#endif 2380HANDLE_WIREFRAME_DEBUG;}`,`#include "_prelude_fog.vertex.glsl" 2381uniform mat4 u_matrix;uniform mat4 u_normalize_matrix;uniform mat4 u_globe_matrix;uniform mat4 u_merc_matrix;uniform mat3 u_grid_matrix;uniform vec2 u_tl_parent;uniform float u_scale_parent;uniform float u_raster_elevation;uniform float u_zoom_transition;uniform vec2 u_merc_center; 2382#define GLOBE_UPSCALE GLOBE_RADIUS/6371008.8 2383in vec2 a_pos;in vec2 a_texture_pos;out vec2 v_pos0;out vec2 v_pos1;void main() {float w=1.0;vec2 uv; 2384#ifdef PROJECTION_GLOBE_VIEW 2385vec3 decomposed_pos_and_skirt=decomposeToPosAndSkirt(a_pos);vec3 latLng=u_grid_matrix*vec3(decomposed_pos_and_skirt.xy,1.0);float mercatorY=mercatorYfromLat(latLng[0]);float mercatorX=mercatorXfromLng(latLng[1]);float tiles=u_grid_matrix[0][2];float idx=u_grid_matrix[1][2];float idy=u_grid_matrix[2][2];float uvX=mercatorX*tiles-idx;float uvY=mercatorY*tiles-idy;uv=vec2(uvX,uvY);vec3 globe_pos=latLngToECEF(latLng.xy);globe_pos+=normalize(globe_pos)*u_raster_elevation*GLOBE_UPSCALE;vec4 globe_world_pos=u_globe_matrix*vec4(globe_pos,1.0);vec4 merc_world_pos=vec4(0.0);if (u_zoom_transition > 0.0) {vec2 merc_pos=vec2(mercatorX,mercatorY);merc_world_pos=vec4(merc_pos,u_raster_elevation,1.0);merc_world_pos.xy-=u_merc_center;merc_world_pos.x=wrap(merc_world_pos.x,-0.5,0.5);merc_world_pos=u_merc_matrix*merc_world_pos;}vec4 interpolated_pos=vec4(mix(globe_world_pos.xyz,merc_world_pos.xyz,u_zoom_transition)*w,w);gl_Position=u_matrix*interpolated_pos; 2386#ifdef FOG 2387v_fog_pos=fog_position((u_normalize_matrix*vec4(globe_pos,1.0)).xyz); 2388#endif 2389#else 2390uv=a_texture_pos/8192.0;gl_Position=u_matrix*vec4(a_pos*w,u_raster_elevation*w,w); 2391#ifdef FOG 2392v_fog_pos=fog_position(a_pos); 2393#endif 2394#endif 2395v_pos0=uv;v_pos1=(v_pos0*u_scale_parent)+u_tl_parent;}`),rasterParticleDraw:vn("uniform sampler2D u_color_ramp;in float v_particle_speed;void main() {glFragColor=texture(u_color_ramp,vec2(v_particle_speed,0.5));}",`#include "_prelude_raster_particle.glsl" 2396in float a_index;uniform sampler2D u_particle_texture;uniform float u_particle_texture_side_len;uniform vec2 u_tile_offset;out float v_particle_speed;void main() {ivec2 pixel_coord=ivec2( 2397mod(a_index,u_particle_texture_side_len),a_index/u_particle_texture_side_len);vec4 pixel=texelFetch(u_particle_texture,pixel_coord,0);vec2 pos=unpack_pos_from_rgba(pixel)+u_tile_offset;vec2 tex_coord=fract(pos);vec2 velocity=lookup_velocity(tex_coord);if (velocity==INVALID_VELOCITY) {gl_Position=AWAY;v_particle_speed=0.0;} else {gl_Position=vec4(2.0*pos-1.0,0,1);v_particle_speed=length(velocity);}gl_PointSize=1.0;}`),rasterParticleTexture:vn("uniform sampler2D u_texture;uniform float u_opacity;in vec2 v_tex_pos;void main() {vec4 color=texture(u_texture,v_tex_pos);glFragColor=vec4(floor(255.0*color*u_opacity)/255.0);}","in vec2 a_pos;out vec2 v_tex_pos;void main() {vec2 uv=0.5*a_pos+vec2(0.5);v_tex_pos=uv;gl_Position=vec4(a_pos,0.0,1.0);}"),rasterParticleUpdate:vn(`#include "_prelude_raster_particle.glsl" 2398uniform sampler2D u_particle_texture;uniform mediump float u_particle_texture_side_len;uniform mediump float u_speed_factor;uniform highp float u_reset_rate;uniform highp float u_rand_seed;in highp vec2 v_tex_coord;
2398vec2 linearstep(vec2 edge0,vec2 edge1,vec2 x) {return clamp((x-edge0)/(edge1-edge0),vec2(0),vec2(1));}const highp vec3 rand_constants=vec3(12.9898,78.233,4375.85453);highp float rand(const highp vec2 co) {highp float t=dot(rand_constants.xy,co);return fract(sin(t)*(rand_constants.z+t));}void main() {ivec2 pixel_coord=ivec2(v_tex_coord*u_particle_texture_side_len);highp vec4 pixel=texelFetch(u_particle_texture,pixel_coord,0);highp vec2 pos=unpack_pos_from_rgba(pixel);highp vec2 velocity=lookup_velocity(clamp(pos,0.0,1.0));highp vec2 dp=velocity==INVALID_VELOCITY ? vec2(0) : velocity*u_speed_factor;pos=pos+dp;highp vec2 seed=(pos+v_tex_coord)*u_rand_seed;highp vec2 random_pos=vec2(rand(seed+1.3),rand(seed+2.1));highp vec2 persist_rate=pow( 2399linearstep(vec2(-u_particle_pos_offset),vec2(0),pos)*linearstep(vec2(1.0+u_particle_pos_offset),vec2(1),pos),vec2(4) 2400);highp vec2 per_frame_persist=pow(persist_rate,abs(dp)/u_particle_pos_offset);highp float drop_rate=1.0-per_frame_persist.x*per_frame_persist.y;drop_rate=any(greaterThanEqual(abs(pos-0.5),vec2(0.5+u_particle_pos_offset))) ? 1.0 : drop_rate;highp float drop=step(1.0-drop_rate-u_reset_rate,rand(seed));highp vec2 next_pos=mix(pos,random_pos,drop);glFragColor=pack_pos_to_rgba(next_pos);}`,"in vec2 a_pos;out vec2 v_tex_coord;void main() {v_tex_coord=0.5*(a_pos+vec2(1.0));gl_Position=vec4(a_pos,0.0,1.0);}"),symbol:vn(`#include "_prelude_lighting.glsl" 2401#include "_prelude_shadow.fragment.glsl" 2402#define SDF_PX 8.0 2403#define SDF 1.0 2404#define ICON 0.0 2405uniform sampler2D u_texture;uniform sampler2D u_texture_icon;uniform highp float u_gamma_scale;uniform lowp float u_device_pixel_ratio;uniform bool u_is_text;uniform bool u_is_halo;uniform lowp float u_scale_factor; 2406#ifdef ICON_TRANSITION 2407uniform float u_icon_transition; 2408#endif 2409#ifdef COLOR_ADJUSTMENT 2410uniform mat4 u_color_adj_mat; 2411#endif 2412#ifdef INDICATOR_CUTOUT 2413in highp float v_z_offset; 2414#else 2415#ifdef Z_OFFSET 2416#ifdef RENDER_SHADOWS 2417in highp float v_z_offset; 2418#endif 2419#endif 2420#endif 2421in vec2 v_tex_a; 2422#ifdef ICON_TRANSITION 2423in vec2 v_tex_b; 2424#endif 2425in float v_draw_halo;in vec3 v_gamma_scale_size_fade_opacity; 2426#ifdef RENDER_TEXT_AND_SYMBOL 2427in float is_sdf;in vec2 v_tex_a_icon; 2428#endif 2429#ifdef Z_OFFSET 2430#ifdef RENDER_SHADOWS 2431uniform vec3 u_ground_shadow_factor;in highp vec4 v_pos_light_view_0;in highp vec4 v_pos_light_view_1;in highp float v_depth; 2432#endif 2433#endif 2434#pragma mapbox: define highp vec4 fill_color 2435#pragma mapbox: define highp vec4 halo_color 2436#pragma mapbox: define lowp float opacity 2437#pragma mapbox: define lowp float halo_width 2438#pragma mapbox: define lowp float halo_blur 2439#pragma mapbox: define lowp float emissive_strength 2440void main() { 2441#pragma mapbox: initialize highp vec4 fill_color 2442#pragma mapbox: initialize highp vec4 halo_color 2443#pragma mapbox: initialize lowp float opacity 2444#pragma mapbox: initialize lowp float halo_width 2445#pragma mapbox: initialize lowp float halo_blur 2446#pragma mapbox: initialize lowp float emissive_strength 2447vec4 out_color;float fade_opacity=v_gamma_scale_size_fade_opacity[2]; 2448#ifdef RENDER_TEXT_AND_SYMBOL 2449if (is_sdf==ICON) {vec2 tex_icon=v_tex_a_icon;lowp float alpha=opacity*fade_opacity;glFragColor=texture(u_texture_icon,tex_icon)*alpha; 2450#ifdef OVERDRAW_INSPECTOR 2451glFragColor=vec4(1.0); 2452#endif 2453return;} 2454#endif 2455#ifdef RENDER_SDF 2456float EDGE_GAMMA=0.105/u_device_pixel_ratio;float gamma_scale=v_gamma_scale_size_fade_opacity.x;float size=v_gamma_scale_size_fade_opacity.y;float fontScale=u_is_text ? size/24.0 : size;out_color=fill_color;highp float gamma=EDGE_GAMMA/(fontScale*u_gamma_scale);lowp float buff=(256.0-64.0)/256.0;bool draw_halo=v_draw_halo > 0.0;if (draw_halo) {out_color=halo_color;gamma=(halo_blur*u_scale_factor*1.19/SDF_PX+EDGE_GAMMA)/(fontScale*u_gamma_scale);buff=(6.0-halo_width*u_scale_factor/fontScale)/SDF_PX;}lowp float dist=texture(u_texture,v_tex_a).r;highp float gamma_scaled=gamma*gamma_scale;highp float alpha=smoothstep(buff-gamma_scaled,buff+gamma_scaled,dist);out_color*=alpha; 2457#else 2458#ifdef ICON_TRANSITION 2459vec4 a=texture(u_texture,v_tex_a)*(1.0-u_icon_transition);vec4 b=texture(u_texture,v_tex_b)*u_icon_transition;out_color=(a+b); 2460#else 2461out_color=texture(u_texture,v_tex_a); 2462#endif 2463#ifdef COLOR_ADJUSTMENT 2464out_color=u_color_adj_mat*out_color; 2465#endif 2466#endif 2467out_color*=opacity*fade_opacity; 2468#ifdef LIGHTING_3D_MODE 2469out_color=apply_lighting_with_emission_ground(out_color,emissive_strength); 2470#ifdef Z_OFFSET 2471#ifdef RENDER_SHADOWS 2472float light=shadowed_light_factor(v_pos_light_view_0,v_pos_light_view_1,v_depth);out_color.rgb*=mix(abs(v_z_offset) > 0.0 ? u_ground_shadow_factor : vec3(1.0),vec3(1.0),light); 2473#endif 2474#endif 2475#endif 2476#ifdef INDICATOR_CUTOUT 2477out_color=applyCutout(out_color,v_z_offset); 2478#endif 2479glFragColor=out_color; 2480#ifdef OVERDRAW_INSPECTOR 2481glFragColor=vec4(1.0); 2482#endif 2483HANDLE_WIREFRAME_DEBUG;}`,`#include "_prelude_terrain.vertex.glsl" 2484#include "_prelude_shadow.vertex.glsl" 2485in vec4 a_pos_offset;in vec4 a_tex_size;in vec4 a_pixeloffset;in vec4 a_projected_pos;in float a_fade_opacity; 2486#ifdef Z_OFFSET 2487in float a_auto_z_offset; 2488#endif 2489#ifdef PROJECTION_GLOBE_VIEW 2490in vec3 a_globe_anchor;in vec3 a_globe_normal; 2491#endif 2492#ifdef ICON_TRANSITION 2493in vec2 a_texb; 2494#endif 2495#ifdef OCCLUSION_QUERIES 2496in float a_occlusion_query_opacity; 2497#endif 2498#ifdef ELEVATED_ROADS 2499in vec3 a_x_axis;in vec3 a_y_axis;uniform float u_normal_scale; 2500#endif 2501#ifdef INDICATOR_CUTOUT 2502out highp float v_z_offset; 2503#else 2504#ifdef Z_OFFSET 2505#ifdef RENDER_SHADOWS 2506out highp float v_z_offset; 2507#endif 2508#endif 2509#endif 2510uniform 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_inv_matrix;uniform mat4 u_label_plane_matrix;uniform mat4 u_coord_matrix;uniform bool u_is_text;uniform bool u_elevation_from_sea;uniform bool u_pitch_with_map;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 vec3 u_up_vector;uniform vec2 u_texsize_icon;uniform bool u_is_halo; 2511#ifdef PROJECTION_GLOBE_VIEW 2512uniform vec3 u_tile_id;uniform mat4 u_inv_rot_matrix;uniform vec2 u_merc_center;uniform vec3 u_camera_forward;uniform float u_zoom_transition;uniform vec3 u_ecef_origin;uniform mat4 u_tile_matrix; 2513#endif 2514out vec2 v_tex_a; 2515#ifdef ICON_TRANSITION 2516out vec2 v_tex_b; 2517#endif 2518out float v_draw_halo;out vec3 v_gamma_scale_size_fade_opacity; 2519#ifdef RENDER_TEXT_AND_SYMBOL 2520out float is_sdf;out vec2 v_tex_a_icon; 2521#endif 2522#ifdef Z_OFFSET 2523#ifdef RENDER_SHADOWS 2524uniform mat4 u_light_matrix_0;uniform mat4 u_light_matrix_1;out highp vec4 v_pos_light_view_0;out highp vec4 v_pos_light_view_1;out highp float v_depth; 2525#endif 2526#endif 2527#pragma mapbox: define highp vec4 fill_color 2528#pragma mapbox: define highp vec4 halo_color 2529#pragma mapbox: define lowp float opacity 2530#pragma mapbox: define lowp float halo_width 2531#pragma mapbox: define lowp float halo_blur 2532#pragma mapbox: define lowp float emissive_strength 2533#pragma mapbox: define lowp float occlusion_opacity 2534#pragma mapbox: define lowp float z_offset 2535void main() { 2536#pragma mapbox: initialize highp vec4 fill_color 2537#pragma mapbox: initialize highp vec4 halo_color 2538#pragma mapbox: initialize lowp float opacity 2539#pragma mapbox: initialize lowp float halo_width 2540#pragma mapbox: initialize lowp float halo_blur 2541#pragma mapbox: initialize lowp float emissive_strength 2542#pragma mapbox: initialize lowp float occlusion_opacity 2543#pragma mapbox: initialize lowp float z_offset 2544vec2 a_pos=a_pos_offset.xy;vec2 a_offset=a_pos_offset.zw;vec2 a_tex=a_tex_size.xy;vec2 a_size=a_tex_size.zw;float a_size_min=floor(a_size[0]*0.5);vec2 a_pxoffset=a_pixeloffset.xy;vec2 a_min_font_scale=a_pixeloffset.zw/256.0;highp float segment_angle=-a_projected_pos[3];float size;if (!u_is_size_zoom_constant && !u_is_size_feature_constant) {size=mix(a_size_min,a_size[1],u_size_t)/128.0;} else if (u_is_size_zoom_constant && !u_is_size_feature_constant) {size=a_size_min/128.0;} else {size=u_size;}vec2 tile_anchor=a_pos;float e=u_elevation_from_sea ? z_offset : z_offset+elevation(tile_anchor); 2545#ifdef Z_OFFSET 2546e+=a_auto_z_offset; 2547#endif 2548vec3 h=elevationVector(tile_anchor)*e;float globe_occlusion_fade;vec3 world_pos;vec3 mercator_pos;vec3 world_pos_globe; 2549#ifdef PROJECTION_GLOBE_VIEW 2550mercator_pos=mercator_tile_position(u_inv_rot_matrix,tile_anchor,u_tile_id,u_merc_center);world_pos_globe=a_globe_anchor+h;world_pos=mix_globe_mercator(world_pos_globe,mercator_pos,u_zoom_transition);vec4 ecef_point=u_tile_matrix*vec4(world_pos,1.0);vec3 origin_to_point=ecef_point.xyz-u_ecef_origin;globe_occlusion_fade=dot(origin_to_point,u_camera_forward) >=0.0 ? 0.0 : 1.0; 2551#else 2552world_pos=vec3(tile_anchor,0)+h;globe_occlusion_fade=1.0; 2553#endif 2554vec4 projected_point=u_matrix*vec4(world_pos,1);highp float camera_to_anchor_distance=projected_point.w;highp float distance_ratio=u_pitch_with_map ? 2555camera_to_anchor_distance/u_camera_to_center_distance : 2556u_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp( 25570.5+0.5*distance_ratio,0.0,1.5);size*=perspective_ratio;float font_scale=u_is_text ? size/24.0 : size;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offsetprojected_point;vec2 a; 2558#ifdef PROJECTION_GLOBE_VIEW 2559vec3 displacement=vec3(a_globe_normal.z,0,-a_globe_normal.x);offsetprojected_point=u_matrix*vec4(a_globe_anchor+displacement,1);vec4 projected_point_globe=u_matrix*vec4(world_pos_globe,1);a=projected_point_globe.xy/projected_point_globe.w; 2560#else 2561offsetprojected_point=u_matrix*vec4(tile_anchor+vec2(1,0),0,1);a=projected_point.xy/projected_point.w; 2562#endif 2563vec2 b=offsetprojected_point.xy/offsetprojected_point.w;symbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);}vec4 projected_pos; 2564#ifdef PROJECTION_GLOBE_VIEW 2565#ifdef PROJECTED_POS_ON_VIEWPORT 2566projected_pos=u_label_plane_matrix*vec4(a_projected_pos.xyz+h,1.0); 2567#else 2568vec3 proj_pos=mix_globe_mercator(a_projected_pos.xyz,mercator_pos,u_zoom_transition)+h;projected_pos=u_label_plane_matrix*vec4(proj_pos,1.0); 2569#endif 2570#else 2571projected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy,h.z,1.0); 2572#endif 2573highp 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);float z=0.0;vec2 offset=rotation_matrix*(a_offset/32.0*max(a_min_font_scale,font_scale)+a_pxoffset/16.0); 2574#ifdef TERRAIN 2575#ifdef PITCH_WITH_MAP_TERRAIN 2576vec4 tile_pos=u_label_plane_matrix_inv*vec4(a_projected_pos.xy+offset,0.0,1.0);z=elevation(tile_pos.xy); 2577#endif 2578#endif 2579#ifdef Z_OFFSET 2580z+=u_pitch_with_map ? a_auto_z_offset+z_offset : 0.0; 2581#else 2582z+=u_pitch_with_map ? z_offset : 0.0; 2583#endif 2584float occlusion_fade=globe_occlusion_fade;vec2 fade_opacity=unpack_opacity(a_fade_opacity);float fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;float out_fade_opacity=max(0.0,min(occlusion_fade,fade_opacity[0]+fade_change)); 2585#ifdef DEPTH_OCCLUSION 2586float depth_occlusion=occlusionFadeMultiSample(projected_point);float depth_occlusion_multplier=mix(occlusion_opacity,1.0,depth_occlusion);out_fade_opacity*=depth_occlusion_multplier; 2587#endif 2588#ifdef OCCLUSION_QUERIES 2589float occludedFadeMultiplier=mix(occlusion_opacity,1.0,a_occlusion_query_opacity);out_fade_opacity*=occludedFadeMultiplier; 2590#endif 2591float alpha=opacity*out_fade_opacity;float hidden=float(alpha==0.0 || projected_point.w <=0.0 || occlusion_fade==0.0);vec3 pos; 2592#ifdef PROJECTION_GLOBE_VIEW 2593vec3 xAxis=u_pitch_with_map ? normalize(cross(a_globe_normal,u_up_vector)) : vec3(1,0,0);vec3 yAxis=u_pitch_with_map ? normalize(cross(a_globe_normal,xAxis)) : vec3(0,1,0);pos=projected_pos.xyz/projected_pos.w+xAxis*offset.x+yAxis*offset.y; 2594#else 2595#ifdef ELEVATED_ROADS 2596vec3 xAxis=vec3(a_x_axis.xy,a_x_axis.z*u_normal_scale);vec3 yAxis=vec3(a_y_axis.xy,a_y_axis.z*u_normal_scale);pos=projected_pos.xyz/projected_pos.w+xAxis*offset.x+yAxis*offset.y; 2597#else 2598pos=vec3(projected_pos.xy/projected_pos.w+offset,z); 2599#endif 2600#endif 2601gl_Position=mix(u_coord_matrix*vec4(pos,1.0),AWAY,hidden);float gamma_scale=gl_Position.w;v_draw_halo=(u_is_halo && float(gl_InstanceID)==0.0) ? 1.0 : 0.0;v_gamma_scale_size_fade_opacity=vec3(gamma_scale,size,out_fade_opacity);v_tex_a=a_tex/u_texsize; 2602#ifdef RENDER_TEXT_AND_SYMBOL 2603is_sdf=a_size[0]-2.0*a_size_min;v_tex_a_icon=a_tex/u_texsize_icon; 2604#endif 2605#ifdef ICON_TRANSITION 2606v_tex_b=a_texb/u_texsize; 2607#endif 2608#ifdef Z_OFFSET 2609#ifdef RENDER_SHADOWS 2610vec4 shd_pos=u_inv_matrix*vec4(pos,1.0);vec3 shd_pos0=shd_pos.xyz;vec3 shd_pos1=shd_pos.xyz; 2611#ifdef NORMAL_OFFSET 2612vec3 shd_pos_offset=shadow_normal_offset(vec3(0.0,0.0,1.0));shd_pos0+=shd_pos_offset*shadow_normal_offset_multiplier0();shd_pos1+=shd_pos_offset*shadow_normal_offset_multiplier1(); 2613#endif 2614v_pos_light_view_0=u_light_matrix_0*vec4(shd_pos0,1);v_pos_light_view_1=u_light_matrix_1*vec4(shd_pos1,1);v_depth=gl_Position.w; 2615#endif 2616#endif 2617#ifdef INDICATOR_CUTOUT 2618v_z_offset=e; 2619#else 2620#ifdef Z_OFFSET 2621#ifdef RENDER_SHADOWS 2622v_z_offset=e; 2623#endif 2624#endif 2625#endif 2626}`),terrainRaster:vn(`#include "_prelude_fog.fragment.glsl" 2627#include "_prelude_shadow.fragment.glsl" 2628#include "_prelude_lighting.glsl" 2629uniform sampler2D u_image0;in vec2 v_pos0; 2630#ifdef FOG 2631in float v_fog_opacity; 2632#endif 2633#ifdef RENDER_SHADOWS 2634in vec4 v_pos_light_view_0;in vec4 v_pos_light_view_1; 2635#endif 2636uniform vec3 u_ground_shadow_factor;void main() {vec4 image_color=texture(u_image0,v_pos0);vec4 color; 2637#ifdef LIGHTING_3D_MODE 2638const vec3 normal=vec3(0.0,0.0,1.0); 2639#ifdef RENDER_SHADOWS 2640float cutoffOpacity=1.0; 2641#ifdef RENDER_CUTOFF 2642cutoffOpacity=cutoff_opacity(u_cutoff_params,1.0/gl_FragCoord.w); 2643#endif 2644#ifdef LIGHTING_3D_ALPHA_EMISSIVENESS 2645vec3 unlit_base=image_color.rgb*(1.0-image_color.a);vec3 emissive_base=image_color.rgb*image_color.a;float ndotl=u_shadow_direction.z;float occlusion=ndotl < 0.0 ? 1.0 : shadow_occlusion(v_pos_light_view_0,v_pos_light_view_1,1.0/gl_FragCoord.w,0.0);ndotl=max(0.0,ndotl);vec3 lit=apply_lighting(unlit_base,normal,mix(1.0,(1.0-(u_shadow_intensity*occlusion))*ndotl,cutoffOpacity));vec3 emissive=compute_emissive_draped(emissive_base,1.0-u_shadow_intensity,occlusion,u_ground_shadow_factor);color.rgb=lit+emissive;color.a=1.0; 2646#else 2647float lighting_factor=shadowed_light_factor_normal_unbiased(normal,v_pos_light_view_0,v_pos_light_view_1,1.0/gl_FragCoord.w);color=apply_lighting(image_color,normal,mix(1.0,lighting_factor,cutoffOpacity)); 2648#endif 2649#else 2650float lighting_factor=u_lighting_directional_dir.z;color=apply_lighting(image_color,normal,lighting_factor); 2651#ifdef LIGHTING_3D_ALPHA_EMISSIVENESS 2652color.rgb=mix(color.rgb,image_color.rgb,image_color.a);color.a=1.0; 2653#endif 2654#endif 2655#else 2656color=image_color; 2657#endif 2658#ifdef FOG 2659#ifdef ZERO_EXAGGERATION 2660color=fog_dither(fog_apply_premultiplied(color,v_fog_pos)); 2661#else 2662color=fog_dither(fog_apply_from_vert(color,v_fog_opacity)); 2663#endif 2664#endif 2665glFragColor=color; 2666#ifdef OVERDRAW_INSPECTOR 2667glFragColor=vec4(1.0); 2668#endif 2669HANDLE_WIREFRAME_DEBUG;}`,`#include "_prelude_fog.vertex.glsl" 2670#include "_prelude_terrain.vertex.glsl" 2671uniform mat4 u_matrix;uniform float u_skirt_height;in vec2 a_pos;out vec2 v_pos0; 2672#ifdef FOG 2673out float v_fog_opacity; 2674#endif 2675#ifdef RENDER_SHADOWS 2676uniform mat4 u_light_matrix_0;uniform mat4 u_light_matrix_1;out vec4 v_pos_light_view_0;out vec4 v_pos_light_view_1;out float v_depth; 2677#endif 2678void main() {vec3 decomposedPosAndSkirt=decomposeToPosAndSkirt(a_pos);float skirt=decomposedPosAndSkirt.z;vec2 decodedPos=decomposedPosAndSkirt.xy;float elevation=elevation(decodedPos)-skirt*u_skirt_height;v_pos0=decodedPos/8192.0;gl_Position=u_matrix*vec4(decodedPos,elevation,1.0); 2679#ifdef FOG 2680#ifdef ZERO_EXAGGERATION 2681v_fog_pos=fog_position(decodedPos); 2682#else 2683v_fog_opacity=fog(fog_position(vec3(decodedPos,elevation))); 2684#endif 2685#endif 2686#ifdef RENDER_SHADOWS 2687vec3 pos=vec3(decodedPos,elevation);v_pos_light_view_0=u_light_matrix_0*vec4(pos,1.);v_pos_light_view_1=u_light_matrix_1*vec4(pos,1.); 2688#endif 2689}`),terrainDepth:vn("precision highp float;in float v_depth;void main() {glFragColor=pack_depth(v_depth);}",`#include "_prelude_terrain.vertex.glsl" 2690uniform mat4 u_matrix;in vec2 a_pos;out float v_depth;void main() {float elevation=elevation(a_pos);gl_Position=u_matrix*vec4(a_pos,elevation,1.0);v_depth=gl_Position.z/gl_Position.w;}`),skybox:vn(`#include "_prelude_fog.fragment.glsl" 2691in lowp vec3 v_uv;uniform lowp samplerCube u_cubemap;uniform lowp float u_opacity;uniform highp float u_temporal_offset;uniform highp
2691 vec3 u_sun_direction;float sun_disk(highp vec3 ray_direction,highp vec3 sun_direction) {highp float cos_angle=dot(normalize(ray_direction),sun_direction);const highp float cos_sun_angular_diameter=0.99996192306;const highp float smoothstep_delta=1e-5;return smoothstep( 2692cos_sun_angular_diameter-smoothstep_delta,cos_sun_angular_diameter+smoothstep_delta,cos_angle);}float map(float value,float start,float end,float new_start,float new_end) {return ((value-start)*(new_end-new_start))/(end-start)+new_start;}void main() {vec3 uv=v_uv;const float y_bias=0.015;uv.y+=y_bias;uv.y=pow(abs(uv.y),1.0/5.0);uv.y=map(uv.y,0.0,1.0,-1.0,1.0);vec3 sky_color=texture(u_cubemap,uv).rgb; 2693#ifdef FOG 2694sky_color=fog_apply_sky_gradient(v_uv.xzy,sky_color); 2695#endif 2696sky_color+=0.1*sun_disk(v_uv,u_sun_direction);glFragColor=vec4(sky_color*u_opacity,u_opacity); 2697#ifdef OVERDRAW_INSPECTOR 2698glFragColor=vec4(1.0); 2699#endif 2700}`,$u),skyboxGradient:vn(`#include "_prelude_fog.fragment.glsl" 2701in highp vec3 v_uv;uniform lowp sampler2D u_color_ramp;uniform highp vec3 u_center_direction;uniform lowp float u_radius;uniform lowp float u_opacity;uniform highp float u_temporal_offset;void main() {float progress=acos(dot(normalize(v_uv),u_center_direction))/u_radius;vec4 color=texture(u_color_ramp,vec2(progress,0.5)); 2702#ifdef FOG 2703color.rgb=fog_apply_sky_gradient(v_uv.xzy,color.rgb/color.a)*color.a; 2704#endif 2705color*=u_opacity;glFragColor=color; 2706#ifdef OVERDRAW_INSPECTOR 2707glFragColor=vec4(1.0); 2708#endif 2709}`,$u),skyboxCapture:vn
vendor: 3,792 bytes, lines 2709-2720
2709(` 2710in highp vec3 v_position;uniform highp float u_sun_intensity;uniform highp float u_luminance;uniform lowp vec3 u_sun_direction;uniform highp vec4 u_color_tint_r;uniform highp vec4 u_color_tint_m;precision highp float; 2711#define BETA_R vec3(5.5e-6,13.0e-6,22.4e-6) 2712#define BETA_M vec3(21e-6,21e-6,21e-6) 2713#define MIE_G 0.76 2714#define DENSITY_HEIGHT_SCALE_R 8000.0 2715#define DENSITY_HEIGHT_SCALE_M 1200.0 2716#define PLANET_RADIUS 6360e3 2717#define ATMOSPHERE_RADIUS 6420e3 2718#define SAMPLE_STEPS 10 2719#define DENSITY_STEPS 4 2720float ray_sphere_exit(vec3 orig,vec3 dir,float radius) {float a=dot(dir,dir);float b=2.0*dot(dir,orig);float c=dot(orig,orig)-radius*radius;float d=sqrt(b*b-4.0*a*c);return (-b+d)/(2.0*a);}vec3 extinction(vec2 density) {return exp(-vec3(BETA_R*u_color_tint_r.a*density.x+BETA_M*u_color_tint_m.a*density.y));}vec2 local_density(vec3 point) {float height=max(length(point)-PLANET_RADIUS,0.0);float exp_r=exp(-height/DENSITY_HEIGHT_SCALE_R);float exp_m=exp(-height/DENSITY_HEIGHT_SCALE_M);return vec2(exp_r,exp_m);}float phase_ray(float cos_angle) {return (3.0/(16.0*PI))*(1.0+cos_angle*cos_angle);}float phase_mie(float cos_angle) {return (3.0/(8.0*PI))*((1.0-MIE_G*MIE_G)*(1.0+cos_angle*cos_angle))/((2.0+MIE_G*MIE_G)*pow(1.0+MIE_G*MIE_G-2.0*MIE_G*cos_angle,1.5));}vec2 density_to_atmosphere(vec3 point,vec3 light_dir) {float ray_len=ray_sphere_exit(point,light_dir,ATMOSPHERE_RADIUS);float step_len=ray_len/float(DENSITY_STEPS);vec2 density_point_to_atmosphere=vec2(0.0);for (int i=0; i < DENSITY_STEPS;++i) {vec3 point_on_ray=point+light_dir*((float(i)+0.5)*step_len);density_point_to_atmosphere+=local_density(point_on_ray)*step_len;;}return density_point_to_atmosphere;}vec3 atmosphere(vec3 ray_dir,vec3 sun_direction,float sun_intensity) {vec2 density_orig_to_point=vec2(0.0);vec3 scatter_r=vec3(0.0);vec3 scatter_m=vec3(0.0);vec3 origin=vec3(0.0,PLANET_RADIUS,0.0);float ray_len=ray_sphere_exit(origin,ray_dir,ATMOSPHERE_RADIUS);float step_len=ray_len/float(SAMPLE_STEPS);for (int i=0; i < SAMPLE_STEPS;++i) {vec3 point_on_ray=origin+ray_dir*((float(i)+0.5)*step_len);vec2 density=local_density(point_on_ray)*step_len;density_orig_to_point+=density;vec2 density_point_to_atmosphere=density_to_atmosphere(point_on_ray,sun_direction);vec2 density_orig_to_atmosphere=density_orig_to_point+density_point_to_atmosphere;vec3 extinction=extinction(density_orig_to_atmosphere);scatter_r+=density.x*extinction;scatter_m+=density.y*extinction;}float cos_angle=dot(ray_dir,sun_direction);float phase_r=phase_ray(cos_angle);float phase_m=phase_mie(cos_angle);vec3 beta_r=BETA_R*u_color_tint_r.rgb*u_color_tint_r.a;vec3 beta_m=BETA_M*u_color_tint_m.rgb*u_color_tint_m.a;return (scatter_r*phase_r*beta_r+scatter_m*phase_m*beta_m)*sun_intensity;}const float A=0.15;const float B=0.50;const float C=0.10;const float D=0.20;const float E=0.02;const float F=0.30;vec3 uncharted2_tonemap(vec3 x) {return ((x*(A*x+C*B)+D*E)/(x*(A*x+B)+D*F))-E/F;}void main() {vec3 ray_direction=v_position;ray_direction.y=pow(ray_direction.y,5.0);const float y_bias=0.015;ray_direction.y+=y_bias;vec3 color=atmosphere(normalize(ray_direction),u_sun_direction,u_sun_intensity);float white_scale=1.0748724675633854;color=uncharted2_tonemap((log2(2.0/pow(u_luminance,4.0)))*color)*white_scale;glFragColor=vec4(color,1.0);}`,"in highp vec3 a_pos_3f;uniform mat3 u_matrix_3f;out highp vec3 v_position;float map(float value,float start,float end,float new_start,float new_end) {return ((value-start)*(new_end-new_start))/(end-start)+new_start;}void main() {vec4 pos=vec4(u_matrix_3f*a_pos_3f,1.0);v_position=pos.xyz;v_position.y*=-1.0;v_position.y=map(v_position.y,-1.0,1.0,0.0,1.0);gl_Position=vec4(a_pos_3f.xy,0.0,1.0);}"),globe
2720Raster:vn(`#include "_prelude_fog.fragment.glsl" 2721#include "_prelude_lighting.glsl" 2722uniform sampler2D u_image0;uniform float u_far_z_cutoff;in vec2 v_pos0; 2723#ifndef FOG 2724uniform highp vec3 u_frustum_tl;uniform highp vec3 u_frustum_tr;uniform highp vec3 u_frustum_br;uniform highp vec3 u_frustum_bl;uniform highp vec3 u_globe_pos;uniform highp float u_globe_radius;uniform vec2 u_viewport; 2725#endif 2726void main() {vec4 color; 2727#ifdef CUSTOM_ANTIALIASING 2728highp vec2 uv=gl_FragCoord.xy/u_viewport;highp vec3 ray_dir=mix( 2729mix(u_frustum_tl,u_frustum_tr,uv.x),mix(u_frustum_bl,u_frustum_br,uv.x),1.0-uv.y);highp vec3 dir=normalize(ray_dir);highp vec3 closest_point=dot(u_globe_pos,dir)*dir;highp float norm_dist_from_center=1.0-length(closest_point-u_globe_pos)/u_globe_radius;const float antialias_pixel=2.0;highp float antialias_factor=antialias_pixel*fwidth(norm_dist_from_center);highp float antialias=smoothstep(0.0,antialias_factor,norm_dist_from_center);vec4 raster=texture(u_image0,v_pos0); 2730#ifdef LIGHTING_3D_MODE 2731#ifdef LIGHTING_3D_ALPHA_EMISSIVENESS 2732raster=apply_lighting_with_emission_ground(raster,raster.a);color=vec4(clamp(raster.rgb,vec3(0),vec3(1))*antialias,antialias); 2733#else 2734raster=apply_lighting_ground(raster);color=vec4(raster.rgb*antialias,raster.a*antialias); 2735#endif 2736#else 2737color=vec4(raster.rgb*antialias,raster.a*antialias); 2738#endif 2739#else 2740color=texture(u_image0,v_pos0); 2741#ifdef LIGHTING_3D_MODE 2742#ifdef LIGHTING_3D_ALPHA_EMISSIVENESS 2743color=apply_lighting_with_emission_ground(color,color.a);color.a=1.0; 2744#else 2745color=apply_lighting_ground(color); 2746#endif 2747#endif 2748#endif 2749#ifdef FOG 2750color=fog_dither(fog_apply_premultiplied(color,v_fog_pos)); 2751#endif 2752color*=1.0-step(u_far_z_cutoff,1.0/gl_FragCoord.w);glFragColor=color; 2753#ifdef OVERDRAW_INSPECTOR 2754glFragColor=vec4(1.0); 2755#endif 2756HANDLE_WIREFRAME_DEBUG;}`,`#include "_prelude_fog.vertex.glsl" 2757#include "_prelude_terrain.vertex.glsl" 2758uniform mat4 u_proj_matrix;uniform mat4 u_normalize_matrix;uniform mat4 u_globe_matrix;uniform mat4 u_merc_matrix;uniform float u_zoom_transition;uniform vec2 u_merc_center;uniform mat3 u_grid_matrix;uniform float u_skirt_height; 2759#ifdef GLOBE_POLES 2760in vec3 a_globe_pos;in vec2 a_uv; 2761#else 2762in vec2 a_pos; 2763#endif 2764out vec2 v_pos0;void main() { 2765#ifdef GLOBE_POLES 2766vec3 globe_pos=a_globe_pos;vec2 uv=a_uv; 2767#else 2768float tiles=u_grid_matrix[0][2];float idx=u_grid_matrix[1][2];float idy=u_grid_matrix[2][2];vec3 decomposed_pos_and_skirt=decomposeToPosAndSkirt(a_pos);vec3 latLng=u_grid_matrix*vec3(decomposed_pos_and_skirt.xy,1.0);float mercatorY=mercatorYfromLat(latLng[0]);float uvY=mercatorY*tiles-idy;float mercatorX=mercatorXfromLng(latLng[1]);float uvX=mercatorX*tiles-idx;vec3 globe_pos=latLngToECEF(latLng.xy);vec2 merc_pos=vec2(mercatorX,mercatorY);vec2 uv=vec2(uvX,uvY); 2769#endif 2770v_pos0=uv;vec2 tile_pos=uv*EXTENT;vec3 globe_derived_up_vector=normalize(globe_pos)*u_tile_up_scale; 2771#ifdef GLOBE_POLES 2772vec3 up_vector=globe_derived_up_vector; 2773#else 2774vec3 up_vector=elevationVector(tile_pos); 2775#endif 2776float height=elevation(tile_pos);globe_pos+=up_vector*height; 2777#ifndef GLOBE_POLES 2778globe_pos-=globe_derived_up_vector*u_skirt_height*decomposed_pos_and_skirt.z; 2779#endif 2780#ifdef GLOBE_POLES 2781vec4 interpolated_pos=u_globe_matrix*vec4(globe_pos,1.0); 2782#else 2783vec4 globe_world_pos=u_globe_matrix*vec4(globe_pos,1.0);vec4 merc_world_pos=vec4(0.0);if (u_zoom_transition > 0.0) {merc_world_pos=vec4(merc_pos,height-u_skirt_height*decomposed_pos_and_skirt.z,1.0);merc_world_pos.xy-=u_merc_center;merc_world_pos.x=wrap(merc_world_pos.x,-0.5,0.5);merc_world_pos=u_merc_matrix*merc_world_pos;}vec4 interpolated_pos=vec4(mix(globe_world_pos.xyz,merc_world_pos.xyz,u_zoom_transition),1.0); 2784#endif 2785gl_Position=u_proj_matrix*interpolated_pos; 2786#ifdef FOG 2787v_fog_pos=fog_position((u_normalize_matrix*vec4(globe_pos,1.0)).xyz); 2788#endif 2789}`),globeAtmosphere:vn(`#include "_prelude_fog.fragment.glsl" 2790uniform float u_transition;uniform highp float u_fadeout_range;uniform highp float u_temporal_offset;uniform vec4 u_color;uniform vec4 u_high_color;uniform vec4 u_space_color;uniform float u_horizon_angle;in highp vec3 v_ray_dir;in highp vec3 v_horizon_dir;void main() {highp vec3 dir=normalize(v_ray_dir);float globe_pos_dot_dir; 2791#ifdef PROJECTION_GLOBE_VIEW 2792globe_pos_dot_dir=dot(u_globe_pos,dir);highp vec3 closest_point_forward=abs(globe_pos_dot_dir)*dir;float norm_dist_from_center=length(closest_point_forward-u_globe_pos)/u_globe_radius;if (norm_dist_from_center < 0.98) { 2793#ifdef ALPHA_PASS 2794glFragColor=vec4(0,0,0,0);return; 2795#else 2796#ifdef NATIVE 2797glFragColor=vec4(1,1,1,1); 2798#else 2799glFragColor=vec4(0,0,0,1); 2800#endif 2801return; 2802#endif 2803} 2804#endif 2805highp vec3 horizon_dir=normalize(v_horizon_dir);float horizon_angle_mercator=dir.y < horizon_dir.y ? 28060.0 : max(acos(clamp(dot(dir,horizon_dir),-1.0,1.0)),0.0);float horizon_angle; 2807#ifdef PROJECTION_GLOBE_VIEW 2808highp vec3 closest_point=globe_pos_dot_dir*dir;highp float closest_point_to_center=length(closest_point-u_globe_pos);highp float theta=asin(clamp(closest_point_to_center/length(u_globe_pos),-1.0,1.0));horizon_angle=globe_pos_dot_dir < 0.0 ? 2809PI-theta-u_horizon_angle : theta-u_horizon_angle;float angle_t=pow(u_transition,10.0);horizon_angle=mix(horizon_angle,horizon_angle_mercator,angle_t); 2810#else 2811horizon_angle=horizon_angle_mercator; 2812#endif 2813horizon_angle/=PI;float t=exp(-horizon_angle/u_fadeout_range);float alpha_0=u_color.a;float alpha_1=u_high_color.a;float alpha_2=u_space_color.a;vec3 color_stop_0=u_color.rgb;vec3 color_stop_1=u_high_color.rgb;
2813vec3 color_stop_2=u_space_color.rgb; 2814#ifdef ALPHA_PASS 2815float a0=mix(alpha_2,1.0,alpha_1);float a1=mix(a0,1.0,alpha_0);float a2=mix(a0,a1,t);float a =mix(alpha_2,a2,t);glFragColor=vec4(1.0,1.0,1.0,a); 2816#else 2817vec3 c0=mix(color_stop_2,color_stop_1,alpha_1);vec3 c1=mix(c0,color_stop_0,alpha_0);vec3 c2=mix(c0,c1,t);vec3 c=c2;glFragColor=vec4(c*t,t); 2818#endif 2819}`,`in vec3 a_pos;in vec2 a_uv;uniform vec3 u_frustum_tl;uniform vec3 u_frustum_tr;uniform vec3 u_frustum_br;uniform vec3 u_frustum_bl;uniform float u_horizon;out highp vec3 v_ray_dir;out highp vec3 v_horizon_dir;void main() {v_ray_dir=mix( 2820mix(u_frustum_tl,u_frustum_tr,a_uv.x),mix(u_frustum_bl,u_frustum_br,a_uv.x),a_uv.y);v_horizon_dir=mix( 2821mix(u_frustum_tl,u_frustum_bl,u_horizon),mix(u_frustum_tr,u_frustum_br,u_horizon),a_uv.x);gl_Position=vec4(a_pos,1.0);}`),model:vn(`#include "_prelude_fog.fragment.glsl" 2822#include "_prelude_shadow.fragment.glsl" 2823#include "_prelude_lighting.glsl" 2824uniform float u_opacity;uniform vec3 u_lightcolor;uniform vec3 u_lightpos;uniform float u_lightintensity;uniform vec4 u_baseColorFactor;uniform vec4 u_emissiveFactor;uniform float u_metallicFactor;uniform float u_roughnessFactor;uniform float u_emissive_strength;in highp vec4 v_position_height;in lowp vec4 v_color_mix; 2825#ifdef RENDER_SHADOWS 2826in highp vec4 v_pos_light_view_0;in highp vec4 v_pos_light_view_1;in float v_depth_shadows; 2827#endif 2828#ifdef OCCLUSION_TEXTURE_TRANSFORM 2829uniform vec4 u_occlusionTextureTransform; 2830#endif 2831#pragma mapbox: define-attribute highp vec3 normal_3f 2832#pragma mapbox: define-attribute highp vec3 color_3f 2833#pragma mapbox: define-attribute highp vec4 color_4f 2834#pragma mapbox: define-attribute highp vec2 uv_2f 2835#pragma mapbox: initialize-attribute highp vec3 normal_3f 2836#pragma mapbox: initialize-attribute highp vec3 color_3f 2837#pragma mapbox: initialize-attribute highp vec4 color_4f 2838#pragma mapbox: initialize-attribute highp vec2 uv_2f 2839#ifdef HAS_ATTRIBUTE_a_pbr 2840in lowp vec4 v_roughness_metallic_emissive_alpha;in mediump vec4 v_height_based_emission_params; 2841#endif 2842#ifdef HAS_TEXTURE_u_baseColorTexture 2843uniform sampler2D u_baseColorTexture;uniform bool u_baseTextureIsAlpha;uniform bool u_alphaMask;uniform float u_alphaCutoff; 2844#endif 2845#ifdef HAS_TEXTURE_u_metallicRoughnessTexture 2846uniform sampler2D u_metallicRoughnessTexture; 2847#endif 2848#ifdef HAS_TEXTURE_u_occlusionTexture 2849uniform sampler2D u_occlusionTexture;uniform float u_aoIntensity; 2850#endif 2851#ifdef HAS_TEXTURE_u_normalTexture 2852uniform sampler2D u_normalTexture; 2853#endif 2854#ifdef HAS_TEXTURE_u_emissionTexture 2855uniform sampler2D u_emissionTexture; 2856#endif 2857#ifdef APPLY_LUT_ON_GPU 2858uniform highp sampler3D u_lutTexture; 2859#endif 2860#ifdef TERRAIN_FRAGMENT_OCCLUSION 2861in highp float v_depth;uniform highp sampler2D u_depthTexture;uniform highp vec2 u_inv_depth_size;uniform highp vec2 u_depth_range_unpack; 2862#ifdef DEPTH_D24 2863highp float unpack_depth(highp float depth) {return depth*u_depth_range_unpack.x+u_depth_range_unpack.y;} 2864#else 2865highp float unpack_depth_rgba(highp vec4 rgba_depth) 2866{const highp vec4 bit_shift=vec4(1.0/(255.0*255.0*255.0),1.0/(255.0*255.0),1.0/255.0,1.0);return dot(rgba_depth,bit_shift)*2.0-1.0;} 2867#endif 2868bool isOccluded() {highp vec2 coord=gl_FragCoord.xy*u_inv_depth_size; 2869#ifdef DEPTH_D24 2870highp float depth=unpack_depth(texture(u_depthTexture,coord).r); 2871#else 2872highp float depth=unpack_depth_rgba(texture(u_depthTexture,coord)); 2873#endif 2874return v_depth > depth+0.0005;} 2875#endif 2876#define saturate(_x) clamp(_x,0.,1.) 2877vec3 linearTosRGB(vec3 color) {return pow(color,vec3(1./2.2));}vec3 sRGBToLinear(vec3 srgbIn) {return pow(srgbIn,vec3(2.2));}float calculate_NdotL(vec3 normal,vec3 lightDir) {const float ext=0.70710678118;return (clamp(dot(normal,lightDir),-ext,1.0)+ext)/(1.0+ext);}vec3 getDiffuseShadedColor(vec3 albedo,vec3 normal,vec3 lightDir,vec3 lightColor) 2878{ 2879#ifdef LIGHTING_3D_MODE 2880vec3 transformed_normal=vec3(-normal.xy,normal.z);float lighting_factor; 2881#ifdef RENDER_SHADOWS 2882lighting_factor=shadowed_light_factor_normal(transformed_normal,v_pos_light_view_0,v_pos_light_view_1,v_depth_shadows); 2883#else 2884lighting_factor=saturate(dot(transformed_normal,u_lighting_directional_dir)); 2885#endif 2886return apply_lighting(albedo,transformed_normal,lighting_factor); 2887#else 2888vec3 n=normal;float colorvalue=((albedo.x*0.2126)+(albedo.y*0.7152))+(albedo.z*0.0722);vec3 c=vec3(0.03,0.03,0.03);float directional=clamp(dot(n,vec3(lightDir)),0.0,1.0);directional=mix(1.0-u_lightintensity,max((1.0-colorvalue)+u_lightintensity,1.0),directional);vec3 c3=c+clamp((albedo*directional)*lightColor,mix(vec3(0.0),vec3(0.3),vec3(1.0)-light
2888Color),vec3(1.0));return c3; 2889#endif 2890}vec4 getBaseColor() {vec4 albedo=u_baseColorFactor; 2891#ifdef HAS_ATTRIBUTE_a_color_3f 2892albedo*=vec4(color_3f,1.0); 2893#endif 2894#ifdef HAS_ATTRIBUTE_a_pbr 2895#else 2896#ifdef HAS_ATTRIBUTE_a_color_4f 2897albedo*=color_4f; 2898#endif 2899#endif 2900#if defined (HAS_TEXTURE_u_baseColorTexture) && defined (HAS_ATTRIBUTE_a_uv_2f) 2901vec4 texColor=texture(u_baseColorTexture,uv_2f);if(u_alphaMask) {if (texColor.w < u_alphaCutoff) {discard;}} 2902#ifdef UNPREMULT_TEXTURE_IN_SHADER 2903if(texColor.w > 0.0) {texColor.rgb/=texColor.w;}texColor.w=1.0; 2904#endif 2905if(u_baseTextureIsAlpha) {if (texColor.r < 0.5) {discard;}} else {texColor.rgb=sRGBToLinear(texColor.rgb);albedo*=texColor;} 2906#endif 2907vec4 color=vec4(mix(albedo.rgb,v_color_mix.rgb,v_color_mix.a),albedo.a); 2908#ifdef APPLY_LUT_ON_GPU 2909color=applyLUT(u_lutTexture,color); 2910#endif 2911return color;}highp mat3 cotangentFrame(highp vec3 N,highp vec3 p,highp vec2 uv ) { 2912#ifdef HAS_TEXTURE_u_normalTexture 2913highp vec3 dp1=vec3(dFdx(p.x),dFdx(p.y),dFdx(p.z));highp vec3 dp2=vec3(dFdy(p.x),dFdy(p.y),dFdy(p.z));highp vec2 duv1=vec2(dFdx(uv.x),dFdx(uv.y));highp vec2 duv2=vec2(dFdy(uv.x),dFdy(uv.y));highp vec3 dp2perp=cross( dp2,N );highp vec3 dp1perp=cross( N,dp1 );highp vec3 T=dp2perp*duv1.x+dp1perp*duv2.x;highp vec3 B=dp2perp*duv1.y+dp1perp*duv2.y;highp float lengthT=dot(T,T);highp float lengthB=dot(B,B);highp float maxLength=max(lengthT,lengthB);highp float invmax=inversesqrt( maxLength );highp mat3 res=mat3( T*invmax,B*invmax,N );return res; 2914#else 2915return mat3(1.0); 2916#endif 2917}highp vec3 getNormal(){highp vec3 n; 2918#ifdef HAS_ATTRIBUTE_a_normal_3f 2919n=normalize(normal_3f); 2920#else 2921highp vec3 fdx=vec3(dFdx(v_position_height.x),dFdx(v_position_height.y),dFdx(v_position_height.z));highp vec3 fdy=vec3(dFdy(v_position_height.x),dFdy(v_position_height.y),dFdy(v_position_height.z));n=normalize(cross(fdx,fdy))*-1.0; 2922#endif 2923#if defined(HAS_TEXTURE_u_normalTexture) && defined(HAS_ATTRIBUTE_a_uv_2f) 2924vec3 nMap=texture( u_normalTexture,uv_2f).xyz;nMap=normalize(2.0*nMap-vec3(1.0));highp vec3 v=normalize(-v_position_height.xyz);highp mat3 TBN=cotangentFrame(n,v,uv_2f);n=normalize(TBN*nMap); 2925#endif 2926return n;}struct Material {float perceptualRoughness;float alphaRoughness;float metallic;vec3 f90;vec4 baseColor;vec3 diffuseColor;vec3 specularColor;highp vec3 normal;};Material getPBRMaterial() {Material mat;mat.baseColor=getBaseColor();mat.perceptualRoughness=u_roughnessFactor;mat.metallic=u_metallicFactor; 2927#ifdef HAS_ATTRIBUTE_a_pbr 2928mat.perceptualRoughness=v_roughness_metallic_emissive_alpha.x;mat.metallic=v_roughness_metallic_emissive_alpha.y;mat.baseColor.w*=v_roughness_metallic_emissive_alpha.w; 2929#endif 2930#if defined(HAS_TEXTURE_u_metallicRoughnessTexture) && defined(HAS_ATTRIBUTE_a_uv_2f) 2931vec4 mrSample=texture(u_metallicRoughnessTexture,uv_2f);mat.perceptualRoughness*=mrSample.g;mat.metallic*=mrSample.b; 2932#endif 2933const float c_minRoughness=0.04;mat.perceptualRoughness=clamp(mat.perceptualRoughness,c_minRoughness,1.0);mat.metallic=saturate(mat.metallic);mat.alphaRoughness=mat.perceptualRoughness*mat.perceptualRoughness;const vec3 f0=vec3(0.04);mat.diffuseColor=mat.baseColor.rgb*(vec3(1.0)-f0);mat.diffuseColor*=1.0-mat.metallic;mat.specularColor=mix(f0,mat.baseColor.rgb,mat.metallic);highp float reflectance=max(max(mat.specularColor.r,mat.specularColor.g),mat.specularColor.b);highp float reflectance90=saturate(reflectance*25.0);mat.f90=vec3(reflectance90);mat.normal=getNormal();return mat;}float V_GGX(float NdotL,float NdotV,float roughness) 2934{float a2=roughness*roughness;float GGXV=NdotL*sqrt(NdotV*NdotV*(1.0-a2)+a2);float GGXL=NdotV*sqrt(NdotL*NdotL*(1.0-a2)+a2);return 0.5/(GGXV+GGXL);}float V_GGXFast(float NdotL,float NdotV,float roughness) {float a=roughness;float GGXV=NdotL*(NdotV*(1.0-a)+a);float GGXL=NdotV*(NdotL*(1.0-a)+a);return 0.5/(GGXV+GGXL);}vec3 F_Schlick(vec3 specularColor,vec3 f90,float VdotH) 2935{return specularColor+(f90-specularColor)*pow(clamp(1.0-VdotH,0.0,1.0),5.0);}vec3 F_SchlickFast(vec3 specularColor,float VdotH) 2936{float x=1.0-VdotH;float x4=x*x*x*x;return specularColor+(1.0-specularColor)*x4*x;}float D_GGX(highp float NdotH,float alphaRoughness) 2937{highp float a4=alphaRoughness*alphaRoughness;highp float f=(NdotH*a4-NdotH)*NdotH+1.0;return a4/(PI*f*f);}vec3 diffuseBurley(Material mat,float LdotH,float NdotL,float NdotV) 2938{float f90=2.0*LdotH*LdotH*mat.alphaRoughness-0.5;return (mat.diffuseColor/PI)*(1.0+f90*pow((1.0-NdotL),5.0))*(1.0+f90*pow((1.0-NdotV),5.0));}vec3 diffuseLambertian(Material mat) 2939{ 2940#ifdef LIGHTING_3D_MODE 2941return mat.diffuseColor; 2942#else 2943return mat.diffuseColor/PI; 2944#endif 2945}vec3 EnvBRDFApprox(vec3 specularColor,float roughness,highp float NdotV) 2946{vec4 c0=vec4(-1,-0.0275,-0.572,0.022);vec4 c1=vec4(1,0.0425,1.04,-0.04);highp vec4 r=roughness*c0+c1;highp float a004=min(r.x*r.x,exp2(-9.28*NdotV))*r.x+r.y;vec2 AB=vec2(-1.04,1.04)*a004+r.zw;return specularColor*AB.x+AB.y;}vec3 computeIndirectLightContribution(Material mat,float NdotV,vec3 normal) 2947{vec3 env_light=vec3(0.65,0.65,0.65); 2948#ifdef LIGHTING_3D_MODE 2949float ambient_factor=calculate_ambient_directional_factor(normal);env_light=u_lighting_ambient_color*ambient_factor; 2950#endif 2951vec3 envBRDF=EnvBRDFApprox(mat.specularColor,mat.perceptualRoughness,NdotV);vec3 indirectSpecular= envBRDF*env_light;vec3 indirectDiffuse=mat.diffuseColor*env_light;return indirectSpecular+indirectDiffuse;}vec3 computeLightContribution(Material mat,vec3 lightPosition,vec3 lightColor) 2952{highp vec3 n=mat.normal;highp vec3 v=normalize(-v_position_height.xyz);highp vec3 l=normalize(lightPosition);highp vec3 h=normalize(v+l);float NdotV=clamp(abs(dot(n,v)),0.001,1.0);float NdotL=saturate(dot(n,l));highp float NdotH=saturate(dot(n,h));float VdotH=saturate(dot(v,h));vec3 f=F_SchlickFast(mat.specularColor,VdotH);float g=V_GGXFast(NdotL,NdotV,mat.alphaRoughness);float d=D_GGX(NdotH,mat.alphaRoughness);vec3 diffuseTerm=(1.0-f)*diffuseLambertian(mat);vec3 specularTerm=f*g*d;vec3 transformed_normal=vec3(-n.xy,n.z);float lighting_factor; 2953#ifdef RENDER_SHADOWS 2954lighting_factor=shadowed_light_factor_normal(transformed_normal,v_pos_light_view_0,v_pos_light_view_1,v_depth_shadows); 2955#else 2956lighting_factor=NdotL; 2957#endif 2958vec3 directLightColor=(specularTerm+diffuseTerm)*lighting_factor*light
2958Color;vec3 indirectLightColor=computeIndirectLightContribution(mat,NdotV,transformed_normal);vec3 color=(saturate(directLightColor)+indirectLightColor);float intensityFactor=1.0; 2959#if !defined(LIGHTING_3D_MODE) 2960const vec3 luminosityFactor=vec3(0.2126,0.7152,0.0722);float luminance=dot(diffuseTerm,luminosityFactor);intensityFactor=mix((1.0-u_lightintensity),max((1.0-luminance+u_lightintensity),1.0),NdotL); 2961#endif 2962color*=intensityFactor;return color;}void main() { 2963#ifdef TERRAIN_FRAGMENT_OCCLUSION 2964if (isOccluded()) {discard;} 2965#endif 2966vec3 lightDir=u_lightpos;vec3 lightColor=u_lightcolor; 2967#ifdef LIGHTING_3D_MODE 2968lightDir=u_lighting_directional_dir;lightDir.xy=-lightDir.xy;lightColor=u_lighting_directional_color; 2969#endif 2970vec4 finalColor; 2971#ifdef DIFFUSE_SHADED 2972vec3 N=getNormal();vec3 baseColor=getBaseColor().rgb;vec3 diffuse=getDiffuseShadedColor(baseColor,N,lightDir,lightColor); 2973#ifdef HAS_TEXTURE_u_occlusionTexture 2974float ao=(texture(u_occlusionTexture,uv_2f).r-1.0)*u_aoIntensity+1.0;diffuse*=ao; 2975#endif 2976finalColor=vec4(mix(diffuse,baseColor,u_emissive_strength),1.0)*u_opacity; 2977#else 2978Material mat=getPBRMaterial();vec3 color=computeLightContribution(mat,lightDir,lightColor);float ao=1.0; 2979#if defined (HAS_TEXTURE_u_occlusionTexture) && defined(HAS_ATTRIBUTE_a_uv_2f) 2980#ifdef OCCLUSION_TEXTURE_TRANSFORM 2981vec2 uv=uv_2f.xy*u_occlusionTextureTransform.zw+u_occlusionTextureTransform.xy; 2982#else 2983vec2 uv=uv_2f; 2984#endif 2985ao=(texture(u_occlusionTexture,uv).x-1.0)*u_aoIntensity+1.0;color*=ao; 2986#endif 2987vec4 emissive=u_emissiveFactor; 2988#if defined(HAS_TEXTURE_u_emissionTexture) && defined(HAS_ATTRIBUTE_a_uv_2f) 2989emissive.rgb*=sRGBToLinear(texture(u_emissionTexture,uv_2f).rgb); 2990#endif 2991#ifdef APPLY_LUT_ON_GPU 2992float emissiveFactorLength=max(length(u_emissiveFactor.rgb),0.001);emissive.rgb=sRGBToLinear(applyLUT(u_lutTexture,linearTosRGB(emissive.rgb/emissiveFactorLength).rbg))*emissiveFactorLength; 2993#endif 2994color+=emissive.rgb;float opacity=mat.baseColor.w*u_opacity; 2995#ifdef HAS_ATTRIBUTE_a_pbr 2996float resEmission=v_roughness_metallic_emissive_alpha.z;resEmission*=v_height_based_emission_params.z+v_height_based_emission_params.w*pow(clamp(v_height_based_emission_params.x,0.0,1.0),v_height_based_emission_params.y);vec3 color_mix=v_color_mix.rgb; 2997#ifdef APPLY_LUT_ON_GPU 2998color_mix=applyLUT(u_lutTexture,color_mix); 2999#endif 3000color=mix(color,color_mix,min(1.0,resEmission)); 3001#ifdef HAS_ATTRIBUTE_a_color_4f 3002float distance=length(vec2(1.3*max(0.0,abs(color_4f.x)-color_4f.z),color_4f.
3002y));distance+= mix(0.5,0.0,clamp(resEmission-1.0,0.0,1.0));opacity*=v_roughness_metallic_emissive_alpha.w*saturate(1.0-distance*distance); 3003#endif 3004#endif 3005vec3 unlitColor=mat.baseColor.rgb*ao+emissive.rgb;color=mix(color,unlitColor,u_emissive_strength);color=linearTosRGB(color);color*=opacity;finalColor=vec4(color,opacity); 3006#endif 3007#ifdef FOG 3008finalColor=fog_dither(fog_apply_premultiplied(finalColor,v_fog_pos,v_position_height.w)); 3009#endif 3010#ifdef RENDER_CUTOFF 3011finalColor*=v_cutoff_opacity; 3012#endif 3013#ifdef INDICATOR_CUTOUT 3014finalColor=applyCutout(finalColor,v_position_height.w); 3015#endif 3016glFragColor=finalColor; 3017#ifdef OVERDRAW_INSPECTOR 3018glFragColor=vec4(1.0); 3019#endif 3020HANDLE_WIREFRAME_DEBUG;}`,`#include "_prelude_fog.vertex.glsl" 3021#include "_prelude_shadow.vertex.glsl" 3022in vec3 a_pos_3f; 3023#pragma mapbox: define-attribute highp vec3 normal_3f 3024#pragma mapbox: define-attribute highp vec2 uv_2f 3025#pragma mapbox: define-attribute highp vec3 color_3f 3026#pragma mapbox: define-attribute highp vec4 color_4f 3027#pragma mapbox: define-attribute-vertex-shader-only highp vec4 pbr 3028#pragma mapbox: define-attribute-vertex-shader-only highp vec3 heightBasedEmissiveStrength 3029uniform mat4 u_matrix;uniform mat4 u_node_matrix;uniform mat4 u_lighting_matrix;uniform vec3 u_camera_pos;uniform vec4 u_color_mix; 3030#ifdef INSTANCED_ARRAYS 3031in vec4 a_normal_matrix0;in vec4 a_normal_matrix1;in vec4 a_normal_matrix2;in vec4 a_normal_matrix3; 3032#else 3033uniform highp mat4 u_normal_matrix; 3034#endif 3035#ifdef RENDER_SHADOWS 3036uniform mat4 u_light_matrix_0;uniform mat4 u_light_matrix_1;out highp vec4 v_pos_light_view_0;out highp vec4 v_pos_light_view_1;out float v_depth_shadows; 3037#endif 3038out vec4 v_position_height;out lowp vec4 v_color_mix; 3039#ifdef TERRAIN_FRAGMENT_OCCLUSION 3040out highp float v_depth; 3041#endif 3042#ifdef HAS_ATTRIBUTE_a_pbr 3043out lowp vec4 v_roughness_metallic_emissive_alpha;out mediump vec4 v_height_based_emission_params; 3044#endif 3045vec3 sRGBToLinear(vec3 srgbIn) {return pow(srgbIn,vec3(2.2));}void main() { 3046#pragma mapbox: initialize-attribute highp vec3 normal_3f 3047#pragma mapbox: initialize-attribute highp vec2 uv_2f 3048#pragma mapbox: initialize-attribute highp vec3 color_3f 3049#pragma mapbox: initialize-attribute highp vec4 color_4f 3050#pragma mapbox: initialize-attribute-custom highp vec4 pbr 3051#pragma mapbox: initialize-attribute-custom highp vec3 heightBasedEmissiveStrength 3052highp mat4 normal_matrix; 3053#ifdef INSTANCED_ARRAYS 3054normal_matrix=mat4(a_normal_matrix0,a_normal_matrix1,a_normal_matrix2,a_normal_matrix3); 3055#else 3056normal_matrix=u_normal_matrix; 3057#endif 3058vec3 local_pos;mat3 rs; 3059#ifdef MODEL_POSITION_ON_GPU 3060vec3 pos_color=normal_matrix[0].xyz;vec4 translate=normal_matrix[1];vec3 pos_a=floor(pos_color);vec3 rgb=1.05*(pos_color-pos_a);float hidden=float(pos_a.x > EXTENT);float color_mix=pos_a.z/100.0;v_color_mix=vec4(sRGBToLinear(rgb),color_mix);float meter_to_tile=normal_matrix[0].w;vec4 pos=vec4(pos_a.xy,translate.z,1.0);rs[0].x=normal_matrix[1].w;rs[0].yz=normal_matrix[2].xy;rs[1].xy=normal_matrix[2].zw;rs[1].z=normal_matrix[3].x;rs[2].xyz=normal_matrix[3].yzw;vec4 pos_node=u_lighting_matrix*vec4(a_pos_3f,1.0);vec3 rotated_pos_node=rs*pos_node.xyz;vec3 pos_model_tile=(rotated_pos_node+vec3(translate.xy,0.0))*vec3(meter_to_tile,meter_to_tile,1.0);pos.xyz+=pos_model_tile;local_pos=pos.xyz;gl_Position=mix(u_matrix*pos,AWAY,hidden);pos.z*=meter_to_tile;v_position_height.xyz=pos.xyz-u_camera_pos; 3061#else 3062local_pos=a_pos_3f;gl_Position=u_matrix*vec4(a_pos_3f,1);v_position_height.xyz=vec3(u_lighting_matrix*vec4(a_pos_3f,1));v_color_mix=vec4(sRGBToLinear(u_color_mix.rgb),u_color_mix.a); 3063#endif 3064v_position_height.w=a_pos_3f.z; 3065#ifdef HAS_ATTRIBUTE_a_pbr 3066vec4 albedo_c=decode_color(pbr.xy);vec2 e_r_m=unpack_float(pbr.z);vec2 r_m= unpack_float(e_r_m.y*16.0);r_m.r=r_m.r*16.0;v_color_mix=vec4(albedo_c.rgb,1.0);v_roughness_metallic_emissive_alpha=vec4(vec3(r_m,e_r_m.x)/255.0,albedo_c.a);v_roughness_metallic_emissive_alpha.z*=2.0;float heightBasedRelativeIntepolation=a_pos_3f.z*heightBasedEmissiveStrength.x+heightBasedEmissiveStrength.y;v_height_based_emission_params.x=heightBasedRelativeIntepolation;v_height_based_emission_params.y=heightBasedEmissiveStrength.z;vec2 emissionMultiplierValues=unpack_float(pbr.w)/256.0;v_height_based_emission_params.z=emissionMultiplierValues.x;v_height_based_emission_params.w=emissionMultiplierValues.y-emissionMultiplierValues.x; 3067#endif 3068#ifdef FOG 3069v_fog_pos=fog_position(local_pos); 3070#endif 3071#ifdef RENDER_CUTOFF 3072v_cutoff_opacity=cutoff_opacity(u_cutoff_params,gl_Position.z); 3073#endif 3074#ifdef TERRAIN_FRAGMENT_OCCLUSION 3075v_depth=gl_Position.z/gl_Position.w; 3076#endif 3077#ifdef HAS_ATTRIBUTE_a_normal_3f 3078#ifdef MODEL_POSITION_ON_GPU 3079float x_squared_scale=dot(rs[0],rs[0]);float y_squared_scale=dot(rs[1],rs[1]);float z_squared_scale=dot(rs[2],rs[2]);vec3 squared_scale=vec3(x_squared_scale,y_squared_scale,z_squared_scale);normal_3f=rs*((u_lighting_matrix*vec4(normal_3f,0.0)).xyz/squared_scale);normal_3f=normalize(normal_3f); 3080#else
3081normal_3f=vec3(normal_matrix*vec4(normal_3f,0)); 3082#endif 3083#endif 3084#ifdef HAS_ATTRIBUTE_a_pbr 3085#ifdef HAS_ATTRIBUTE_a_color_4f 3086v_roughness_metallic_emissive_alpha.w=clamp(color_4f.a*v_roughness_metallic_emissive_alpha.w*(v_roughness_metallic_emissive_alpha.z-1.0),0.0,1.0); 3087#endif 3088#endif 3089#ifdef RENDER_SHADOWS 3090vec4 shadow_pos=u_node_matrix*vec4(local_pos,1.0); 3091#ifdef NORMAL_OFFSET 3092#ifdef HAS_ATTRIBUTE_a_normal_3f 3093#ifdef MODEL_POSITION_ON_GPU 3094vec3 offset=shadow_normal_offset(vec3(-normal_3f.xy,normal_3f.z));shadow_pos.xyz+=offset*shadow_normal_offset_multiplier0(); 3095#else 3096vec3 offset=shadow_normal_offset_model(normal_3f);shadow_pos.xyz+=offset*shadow_normal_offset_multiplier0(); 3097#endif 3098#endif 3099#endif 3100v_pos_light_view_0=u_light_matrix_0*shadow_pos;v_pos_light_view_1=u_light_matrix_1*shadow_pos;v_depth_shadows=gl_Position.w; 3101#endif 3102}`),modelDepth:vn(`in highp float v_depth;void main() { 3103#ifndef DEPTH_TEXTURE 3104glFragColor=pack_depth(v_depth); 3105#endif 3106}`,`in vec3 a_pos_3f;uniform mat4 u_matrix;out highp float v_depth; 3107#ifdef MODEL_POSITION_ON_GPU 3108#ifdef INSTANCED_ARRAYS 3109in vec4 a_normal_matrix0;in vec4 a_normal_matrix1;in vec4 a_normal_matrix2;in vec4 a_normal_matrix3; 3110#else 3111uniform highp mat4 u_instance; 3112#endif 3113uniform highp mat4 u_node_matrix; 3114#endif 3115void main() { 3116#ifdef MODEL_POSITION_ON_GPU 3117highp mat4 instance; 3118#ifdef INSTANCED_ARRAYS 3119instance=mat4(a_normal_matrix0,a_normal_matrix1,a_normal_matrix2,a_normal_matrix3); 3120#else 3121instance=u_instance; 3122#endif 3123vec3 pos_color=instance[0].xyz;vec4 translate=instance[1];vec3 pos_a=floor(pos_color);float hidden=float(pos_a.x > EXTENT);float meter_to_tile=instance[0].w;vec4 pos=vec4(pos_a.xy,translate.z,1.0);mat3 rs;rs[0].x=instance[1].w;rs[0].yz=instance[2].xy;
3123rs[1].xy=instance[2].zw;rs[1].z=instance[3].x;rs[2].xyz=instance[3].yzw;vec4 pos_node=u_node_matrix*vec4(a_pos_3f,1.0);vec3 rotated_pos_node=rs*pos_node.xyz;vec3 pos_model_tile=(rotated_pos_node+vec3(translate.xy,0.0))*vec3(meter_to_tile,meter_to_tile,1.0);pos.xyz+=pos_model_tile;gl_Position=mix(u_matrix*pos,AWAY,hidden); 3124#else 3125gl_Position=u_matrix*vec4(a_pos_3f,1); 3126#endif 3127v_depth=gl_Position.z/gl_Position.w;}`),stars:vn(`in highp vec2 v_uv;in mediump float v_intensity;float shapeCircle(in vec2 uv) 3128{float beginFade=0.6;float lengthFromCenter=length(v_uv);return 1.0-clamp((lengthFromCenter-beginFade)/(1.0-beginFade),0.0,1.0);}void main() {float alpha=shapeCircle(v_uv);vec3 color=vec3(1.0,1.0,1.0);alpha*=v_intensity;glFragColor=vec4(color*alpha,alpha);HANDLE_WIREFRAME_DEBUG;}`,` 3129in vec3 a_pos_3f;in vec2 a_uv;in float a_size_scale;in float a_fade_opacity;uniform mat4 u_matrix;uniform vec3 u_up;uniform vec3 u_right;uniform float u_intensity_multiplier;out highp vec2 v_uv;out mediump float v_intensity;void main() {v_uv=a_uv;v_intensity=a_fade_opacity*u_intensity_multiplier;vec3 pos=a_pos_3f;pos+=a_uv.x*u_right*a_size_scale;pos+=a_uv.y*u_up*a_size_scale;gl_Position=u_matrix*vec4(pos,1.0);}`),snowParticle:vn("in highp vec2 uv;in highp float alphaMultiplier;uniform vec4 u_particleColor;uniform vec2 u_simpleShapeParameters;void main() {float t=clamp((length(uv)-u_simpleShapeParameters.x)/(1.0-u_simpleShapeParameters.x),0.0,1.0);float alpha=1.0-pow(t,pow(10.0,u_simpleShapeParameters.y));alpha*=alphaMultiplier;alpha*=u_particleColor.a;vec3 color=u_particleColor.rgb*alpha;glFragColor=vec4(color,alpha) ;HANDLE_WIREFRAME_DEBUG;}",` 3130in highp vec3 a_pos_3f;in highp vec2 a_uv;in highp vec4 a_snowParticleData;in highp vec4 a_snowParticleDataHorizontalOscillation;uniform mat4 u_modelview;uniform mat4 u_projection;uniform vec3 u_cam_pos;uniform vec2 u_screenSize;uniform float u_time;uniform float u_boxSize;uniform float u_velocityConeAperture; 3131uniform float u_velocity;uniform vec3 u_direction;uniform float u_horizontalOscillationRadius; 3132uniform float u_horizontalOscillationRate; 3133uniform float u_billboardSize;uniform vec2 u_thinningCenterPos;uniform vec3 u_thinningShape;uniform float u_thinningAffectedRatio;uniform float u_thinningParticleOffset;out highp vec2 uv;out highp float alphaMultiplier;void main() {vec3 pos=a_pos_3f;float halfBoxSize=0.5*u_boxSize;pos.xyz*=halfBoxSize;pos+=u_cam_pos;float velocityConeApertureRad=radians(u_velocityConeAperture*0.5);float coneAnglePichRad=velocityConeApertureRad*a_snowParticleData.z;float coneAngleHeadingRad=a_snowParticleData.w*radians(360.0);vec3 localZ=normalize(u_direction);vec3 localX=normalize(cross(localZ,vec3(1,0,0)));vec3 localY=normalize(cross(localZ,localX));vec3 direction;direction.x=cos(coneAngleHeadingRad)*sin(coneAnglePichRad);direction.y=sin(coneAngleHeadingRad)*sin(coneAnglePichRad);direction.z=cos(coneAnglePichRad);direction=normalize(direction);vec3 simPosLocal=vec3(0,0,0);float velocityScale=(1.0+3.0*a_snowParticleData.y)*u_velocity;simPosLocal+=direction*velocityScale*u_time;float horizontalOscillationRadius=u_horizontalOscillationRadius*a_snowParticleDataHorizontalOscillation.x;float horizontalOscillationAngle=u_horizontalOscillationRate*u_time*(-1.0+2.0*a_snowParticleDataHorizontalOscillation.y);simPosLocal.xy+=horizontalOscillationRadius*vec2(cos(horizontalOscillationAngle),sin(horizontalOscillationAngle));vec3 simPos=localX*simPosLocal.x+ 3134localY*simPosLocal.y+localZ*simPosLocal.z;pos+=simPos;pos=fract((pos+vec3(halfBoxSize))/vec3(u_boxSize))*u_boxSize-vec3(halfBoxSize);float clipZ=-u_cam_pos.z+pos.z;vec4 posView=u_modelview*vec4(pos,1.0);float size=u_billboardSize;alphaMultiplier=1.0;vec4 posScreen=u_projection*posView;posScreen/=posScreen.w;posScreen.xy=vec2(0.5)+posScreen.xy*0.5;posScreen.xy*=u_screenSize;vec2 thinningCenterPos=u_thinningCenterPos.xy;thinningCenterPos.y=u_screenSize.y-thinningCenterPos.y;float screenDist=length((thinningCenterPos-posScreen.xy)/(0.5*u_screenSize));screenDist+=a_snowParticleData.x*u_thinningParticleOffset;float scaleFactorMode=0.0;float thinningShapeDist=u_thinningShape.x+u_thinningShape.y;if (screenDist < thinningShapeDist) {float thinningFadeRatio=clamp((screenDist-u_thinningShape.x)/u_thinningShape.y,0.0,1.0);thinningFadeRatio=pow(thinningFadeRatio,u_thinningShape.z);if (a_snowParticleData.x < u_thinningAffectedRatio) {scaleFactorMode=1.0-thinningFadeRatio;alphaMultiplier=thinningFadeRatio;}}vec4 posScreen1=u_projection*vec4(posView.x-size,posView.yzw);posScreen1/=posScreen1.w;vec4 posScreen2=u_projection*vec4(posView.x+size,posView.yzw);posScreen2/=posScreen2.w;posScreen1.xy=vec2(0.5)+posScreen1.xy*0.5;posScreen1.xy*=u_screenSize;posScreen2.xy=vec2(0.5)+posScreen2.xy*0.5;posScreen2.xy*=u_screenSize;float screenLength=length(posScreen1.xy-posScreen2.xy);float screenEpsilon=3.0;float scaleFactor=1.0;if (screenLength < screenEpsilon) {scaleFactor=screenEpsilon/max(screenLength,0.01);scaleFactor=mix(scaleFactor,1.0,scaleFactorMode);}float screenEpsilon2=15.0;if (screenLength > screenEpsilon2) {scaleFactor=screenEpsilon2/max(screenLength,0.01);}size*=scaleFactor;vec2 right=size*vec2(1,0);vec2 up=size*vec2(0,1);posView.xy+=right*a_uv.x;posView.xy+=up*a_uv.y;uv=a_uv;gl_Position=u_projection*posView;}`),rainParticle:vn("in highp vec2 uv;in highp float particleRandomValue;uniform sampler2D u_texScreen;uniform float u_distortionStrength;uniform vec4 u_color;uniform vec2 u_thinningCenterPos;uniform vec3 u_thinningShape;uniform float u_thinningAffectedRatio;uniform float u_thinningParticleOffset;uniform float u_shapeDirectionalPower;uniform float u_mode;void main() {vec2 st=uv*0.5+vec2(0.5);vec2 uvm=uv;uvm.y=-1.0+2.0*pow(st.y,u_shapeDirectionalPower);float shape=clamp(1.0-length(uvm),0.0,1.0);float alpha=abs(shape)*u_color.a;vec2 screenSize=vec2(textureSize(u_texScreen,0));vec2 thinningCenterPos=u_thinningCenterPos.xy;thinningCenterPos.y=screenSize.y-thinningCenterPos.y;float screenDist=length((thinningCenterPos-gl_FragCoord.xy)/(0.5*screenSize));screenDist+=(0.5+0.5*particleRandomValue)*u_thinningParticleOffset;float thinningShapeDist=u_thinningShape.x+u_thinningShape.y;float thinningAlpha=1.0;if (screenDist < thinningShapeDist) {float thinningFadeRatio=clamp((screenDist-u_thinningShape.x)/u_thinningShape.y,0.0,1.0);thinningFadeRatio=pow(thinningFadeRatio,u_thinningShape.z);thinningAlpha*=thinningFadeRatio;}vec2 offsetXY=normalize(uvm)*abs(shape);vec2 stScreen=(gl_FragCoord.xy+offsetXY*u_distortionStrength*thinningAlpha)/screenSize;vec3 colorScreen=texture(u_texScreen,stScreen).rgb;alpha*=thinningAlpha;glFragColor=mix(vec4(colorScreen,1.0),vec4(u_color.rgb*alpha,alpha),u_mode);HANDLE_WIREFRAME_DEBUG;}",` 3135in highp vec3 a_pos_3f;in highp vec2 a_uv;in highp vec4 a_rainParticleData;uniform mat4 u_modelview;uniform mat4 u_projection;uniform vec3 u_cam_pos;uniform float u_time;uniform float u_boxSize;uniform float u_velocityConeAperture; 3136uniform float u_velocity; 3137uniform vec2 u_rainDropletSize;uniform vec3 u_rainDirection;out highp vec2 uv;out highp float particleRandomValue;void main() {vec3 pos=a_pos_3f;float halfBoxSize=0.5*u_boxSize;
3137pos*=halfBoxSize; 3138pos+=u_cam_pos;float velocityConeApertureRad=radians(u_velocityConeAperture*0.5);float coneAnglePichRad=velocityConeApertureRad*a_rainParticleData.z;float coneAngleHeadingRad=a_rainParticleData.w*radians(360.0);vec3 localZ=normalize(u_rainDirection);vec3 localX=normalize(cross(localZ,vec3(1,0,0)));vec3 localY=normalize(cross(localZ,localX));vec3 directionLocal;directionLocal.x=cos(coneAngleHeadingRad)*sin(coneAnglePichRad);directionLocal.y=sin(coneAngleHeadingRad)*sin(coneAnglePichRad);directionLocal.z=cos(coneAnglePichRad);directionLocal=normalize(directionLocal);vec3 directionWorld=localX*directionLocal.x+localY*directionLocal.y+localZ*directionLocal.z;float velocityScale=(1.0+3.0*a_rainParticleData.y)*u_velocity;vec3 simPosLocal=vec3(0,0,0);simPosLocal+=directionLocal*velocityScale*u_time;vec3 simPos=localX*simPosLocal.x+ 3139localY*simPosLocal.y+localZ*simPosLocal.z;pos+=simPos;pos=fract((pos+vec3(halfBoxSize))/vec3(u_boxSize))*u_boxSize-vec3(halfBoxSize);vec4 posView=u_modelview*vec4(pos,1.0);vec3 directionView=normalize((u_modelview*vec4(directionWorld,0.0)).xyz);vec3 side=cross(directionView,normalize(posView.xyz));posView.xyz+=side*a_uv.x*u_rainDropletSize.x;posView.xyz+=directionView*a_uv.y*u_rainDropletSize.y;uv=a_uv;particleRandomValue=a_rainParticleData.x;gl_Position=u_projection*posView;}`),vignette:vn("uniform vec3 u_vignetteShape;uniform vec4 u_vignetteColor;in vec2 st;void main() {float screenDist=length(st);float alpha=clamp((screenDist-u_vignetteShape.x)/u_vignetteShape.y,0.0,1.0);alpha=pow(alpha,u_vignetteShape.z)*u_vignetteColor.a;vec3 color=u_vignetteColor.rgb;glFragColor=vec4(color*alpha,alpha) ;}","in vec2 a_pos_2f;out vec2 st;void main() {st=a_pos_2f;gl_Position=vec4(a_pos_2f,0,1);}"),occlusion:vn("uniform vec4 u_color;void main() {glFragColor=u_color;}",`#include "_prelude_terrain.vertex.glsl" 3140in highp vec2 a_offset_xy;uniform highp vec3 u_anchorPos;uniform mat4 u_matrix;uniform vec2 u_screenSizePx;uniform vec2 u_occluderSizePx;void main() {vec3 world_pos=u_anchorPos; 3141#ifdef TERRAIN 3142float e=elevation(world_pos.xy);world_pos.z+=e; 3143#endif 3144vec4 projected_point=u_matrix*vec4(world_pos,1.0);projected_point.xy+=projected_point.w*a_offset_xy*0.5*u_occluderSizePx/u_screenSizePx;gl_Position=projected_point;}`)};function Jc(f,i){const l=f.replace(/\s*\/\/[^\n]*\n/g,` 3145`).split(` 3146`);for(let p of l)if(p=p.trim(),p[0]==="#"&&p.includes("if")&&!p.includes("endif")){p=p.replace("#","").replace(/ifdef|ifndef|elif|if/g,"").replace(/!|defined|\(|\)|\|\||&&/g,"").replace(/\s+/g," ").trim();const y=p.split(" ");for(const v of y)i.includes(v)||i.push(v)}}function vn(f,i){const l=/#include\s+"([^"]+)"/g,p=/#pragma mapbox: ([\w\-]+) ([\w]+) ([\w]+) ([\w]+)/g;let y=i.match(/(attribute(\S*)|(^\s*|;)in) (highp |mediump |lowp )?([\w]+) ([\w]+)/gm);y&&(y=y.map(D=>{const L=D.split(" ");return L[L.length-1]}),y=[...new Set(y)]);const v={},w=[],S=[];if(f=f.replace(l,(D,L)=>(S.push(L),"")),(i=i.replace(l,(D,L)=>(w.push(L),""))).includes("flat out"))return void console.error('The usage of "flat" qualifier is disallowed, see: https://bugs.webkit.org/show_bug.cgi?id=268071');let C=[...yc];Jc(f,C),Jc(i,C);for(const D of[...w,...S])ta[D]||console.error(`Undefined include: ${D}`),Yc[D]||(Yc[D]=[],Jc(ta[D],Yc[D])),C=[...C,...Yc[D]];return{fragmentSource:f=f.replace(p,(D,L,F,O,$)=>(v[$]=!0,L==="define"?` 3147#ifndef HAS_UNIFORM_u_${$} 3148in ${F} ${O} ${$}; 3149#else 3150uniform ${F} ${O} u_${$}; 3151#endif 3152`:L==="initialize"?` 3153#ifdef HAS_UNIFORM_u_${$} 3154 ${F} ${O} ${$} = u_${$}; 3155#endif 3156`:L==="define-attribute"?` 3157#ifdef HAS_ATTRIBUTE_a_${$} 3158 in ${F} ${O} ${$}; 3159#endif 3160`:L==="initialize-attribute"?"":void 0)),vertexSource:i=i.replace(p,(D,L,F,O,$)=>{const q=O==="float"?"vec2":O,W=$.match(/color/)?"color":q;return L==="define-attribute-vertex-shader-only"?` 3161#ifdef HAS_ATTRIBUTE_a_${$} 3162in ${F} ${O} a_${$}; 3163#endif 3164`:v[$]?L==="define"?` 3165#ifndef HAS_UNIFORM_u_${$} 3166uniform lowp float u_${$}_t; 3167in ${F} ${q} a_${$}; 3168out ${F} ${O} ${$}; 3169#else 3170uniform ${F} ${O} u_${$}; 3171#endif 3172`:L==="initialize"?W==="vec4"?` 3173#ifndef HAS_UNIFORM_u_${$} 3174 ${$} = a_${$}; 3175#else 3176 ${F} ${O} ${$} = u_${$}; 3177#endif 3178`:` 3179#ifndef HAS_UNIFORM_u_${$} 3180 ${$} = unpack_mix_${W}(a_${$}, u_${$}_t); 3181#else 3182 ${F} ${O} ${$} = u_${$}; 3183#endif 3184`:L==="define-attribute"?` 3185#ifdef HAS_ATTRIBUTE_a_${$} 3186 in ${F} ${O} a_${$}; 3187 out ${F} ${O} ${$}; 3188#endif 3189`:L==="initialize-attribute"?` 3190#ifdef HAS_ATTRIBUTE_a_${$} 3191 ${$} = a_${$}; 3192#endif 3193`:void 0:L==="define"?` 3194#ifndef HAS_UNIFORM_u_${$} 3195uniform lowp float u_${$}_t; 3196in ${F} ${q} a_${$}; 3197#else 3198uniform ${F} ${O} u_${$}; 3199#endif 3200`:L==="define-instanced"?W==="mat4"?` 3201#ifdef INSTANCED_ARRAYS 3202in vec4 a_${$}0; 3203in vec4 a_${$}1; 3204in vec4 a_${$}2; 3205in vec4 a_${$}3; 3206#else 3207uniform ${F} ${O} u_${$}; 3208#endif 3209`:` 3210#ifdef INSTANCED_ARRAYS 3211in ${F} ${q} a_${$}; 3212#else 3213uniform ${F} ${O} u_${$}; 3214#endif 3215`:L==="initialize-attribute-custom"?` 3216#ifdef HAS_ATTRIBUTE_a_${$} 3217 ${F} ${O} ${$} = a_${$}; 3218#endif 3219`:W==="vec4"?` 3220#ifndef HAS_UNIFORM_u_${$} 3221 ${F} ${O} ${$} = a_${$}; 3222#else 3223 ${F} ${O} ${$} = u_${$}; 3224#endif 3225`:` 3226#ifndef HAS_UNIFORM_u_${$} 3227 ${F} ${O} ${$} = unpack_mix_${W}(a_${$}, u_${$}_t); 3228#else 3229 ${F} ${O} ${$} = u_${$}; 3230#endif 3231`}),staticAttributes:y,usedDefines:C,vertexIncludes:w,fragmentIncludes:S}}class yf{constructor(){this.boundProgram=null,this.boundLayoutVertexBuffer=null,this.boundPaintVertexBuffers=[],this.boundIndexBuffer=null,this.boundVertexOffset=null,this.boundDynamicVertexBuffers=[],this.vao=null}bind(i,l,p,y,v,w,S,C){this.context=i;let D=this.boundPaintVertexBuffers.length!==y.length;for(let F=0;!D&&F<y.length;F++)this.boundPaintVertexBuffers[F]!==y[F]&&(D=!0);let L=this.boundDynamicVertexBuffers.length!==S.length;for(let F=0;!L&&F<S.length;F++)this.boundDynamicVertexBuffers[F]!==S[F]&&(L=!0);if(!this.vao||this.boundProgram!==l||this.boundLayoutVertexBuffer!==p||D||L||this.boundIndexBuffer!==v||this.boundVertexOffset!==w)this.freshBind(l,p,y,v,w,S,C);else{i.bindVertexArrayOES.set(this.vao);for(const F of S)F&&(F.bind(),C&&F.instanceCount&&F.setVertexAttribDivisor(i.gl,l,C));v&&v.dynamicDraw&&v.bind()}}freshBind(i,l,p,y,v,w,S){const C=i.numAttributes,D=this.context,L=D.gl;this.vao&&this.destroy(),this.vao=D.gl.createVertexArray(),D.bindVertexArrayOES.set(this.vao),this.boundProgram=i,this.boundLayoutVertexBuffer=l,this.boundPaintVertexBuffers=p,this.boundIndexBuffer=y,this.boundVertexOffset=v,this.boundDynamicVertexBuffers=w,l.enableAttributes(L,i),l.bind(),l.setVertexAttribPointers(L,i,v);for(const F of p)F.enableAttributes(L,i),F.bind(),F.setVertexAttribPointers(L,i,v);for(const F of w)F&&(F.enableAttributes(L,i),F.bind(),F.setVertexAttribPointers(L,i,v),S&&F.instanceCount&&F.setVertexAttribDivisor(L,i,S));y&&y.bind(),D.currentNumAttributes=C}destroy(){this.vao&&(this.context.gl.deleteVertexArray(this.vao),this.vao=null)}}function Ig(f,i){const l=Math.pow(2,i.canonical.z),p=i.canonical.y;return[new s.ac(0,p/l).toLngLat().lat,new s.ac(0,(p+1)/l).toLngLat().lat]}function qp(f,i,l,p,y,v,w){const S=f.context,C=S.gl,D=l.hillshadeFBO;if(!D)return;f.prepareDrawTile();const L=f.isTileAffectedByFog(i),F=f.getOrCreateProgram("hillshade",{overrideFog:L});S.activeTexture.set(C.TEXTURE0),C.bindTexture(C.TEXTURE_2D,D.colorAttachment.get());const O=((K,Z,se,ue)=>{const fe=se.paint.get("hillshade-shadow-color"),xe=se.paint.get("hillshade-shadow-color-use-theme").
vendor: 7,432 bytes, line 3231
3231constantOr("default")==="none",_e=se.paint.get("hillshade-highlight-color"),ye=se.paint.get("hillshade-highlight-color-use-theme").constantOr("default")==="none",pe=se.paint.get("hillshade-accent-color"),Se=se.paint.get("hillshade-accent-color-use-theme").constantOr("default")==="none",Ae=se.paint.get("hillshade-emissive-strength");let Ge=s.al(se.paint.get("hillshade-illumination-direction"));if(se.paint.get("hillshade-illumination-anchor")==="viewport")Ge-=K.transform.angle;else if(K.style&&K.style.enable3dLights()&&K.style.directionalLight){const lt=K.style.directionalLight.properties.get("direction"),st=s.cR(lt.x,lt.y,lt.z);Ge=s.al(st[1])}const Ne=!K.options.moving;return{u_matrix:ue||K.transform.calculateProjMatrix(Z.tileID.toUnwrapped(),Ne),u_image:0,u_latrange:Ig(0,Z.tileID),u_light:[se.paint.get("hillshade-exaggeration"),Ge],u_shadow:fe.toRenderColor(xe?null:se.lut),u_highlight:_e.toRenderColor(ye?null:se.lut),u_emissive_strength:Ae,u_accent:pe.toRenderColor(Se?null:se.lut)}})(f,l,p,f.terrain?i.projMatrix:null);f.uploadCommonUniforms(S,F,i.toUnwrapped());const{tileBoundsBuffer:$,tileBoundsIndexBuffer:q,tileBoundsSegments:W}=f.getTileBoundsBuffers(l);F.draw(f,C.TRIANGLES,y,v,w,Di.disabled,O,p.id,$,q,W)}function vf(f,i,l){if(!i.needsDEMTextureUpload)return;const p=f.context,y=p.gl;p.pixelStoreUnpackPremultiplyAlpha.set(!1),i.demTexture=i.demTexture||f.getTileTexture(l.stride);const v=l.getPixels();i.demTexture?i.demTexture.update(v,{premultiply:!1}):i.demTexture=new s.T(p,v,y.R32F,{premultiply:!1}),i.needsDEMTextureUpload=!1}function xf(f,i,l){const p=f.context,y=p.gl;if(!i.dem)return;const v=i.dem;if(p.activeTexture.set(y.TEXTURE1),vf(f,i,v),!i.demTexture)return;i.demTexture.bind(y.NEAREST,y.CLAMP_TO_EDGE);const w=v.dim;p.activeTexture.set(y.TEXTURE0);let S=i.hillshadeFBO;if(!S){const O=new s.T(p,{width:w,height:w,data:null},y.RGBA8);O.bind(y.LINEAR,y.CLAMP_TO_EDGE),S=i.hillshadeFBO=p.createFramebuffer(w,w,!0,"renderbuffer"),S.colorAttachment.set(O.texture)}p.bindFramebuffer.set(S.framebuffer),p.viewport.set([0,0,w,w]);const{tileBoundsBuffer:C,tileBoundsIndexBuffer:D,tileBoundsSegments:L}=f.getMercatorTileBoundsBuffers(),F=[];f.linearFloatFilteringSupported()&&F.push("TERRAIN_DEM_FLOAT_FORMAT"),f.getOrCreateProgram("hillshadePrepare",{defines:F}).draw(f,y.TRIANGLES,Gt.disabled,Ii.disabled,en.unblended,Di.disabled,((O,$)=>{const q=$.stride,W=s.bz();return s.c5(W,0,s.aj,-s.aj,0,0,1),s.bo(W,W,[0,-s.aj,0]),{u_matrix:W,u_image:1,u_dimension:[q,q],u_zoom:O.overscaledZ}})(i.tileID,v),l.id,C,D,L),i.needsHillshadePrepare=!1}class Es{constructor(i){this.gl=i.gl,this.default=this.getDefault(),this.current=this.default,this.dirty=!1}get(){return this.current}set(i){}getDefault(){return this.default}setDefault(){this.set(this.default)}}class Xh extends Es{getDefault(){return s.am.transparent}set(i){const l=this.current;(i.r!==l.r||i.g!==l.g||i.b!==l.b||i.a!==l.a||this.dirty)&&(this.gl.clearColor(i.r,i.g,i.b,i.a),this.current=i,this.dirty=!1)}}class Zp extends Es{getDefault(){return 1}set(i){(i!==this.current||this.dirty)&&(this.gl.clearDepth(i),this.current=i,this.dirty=!1)}}class Xp extends Es{getDefault(){return 0}set(i){(i!==this.current||this.dirty)&&(this.gl.clearStencil(i),this.current=i,this.dirty=!1)}}class Qc extends Es{getDefault(){return[!0,!0,!0,!0]}set(i){const l=this.current;(i[0]!==l[0]||i[1]!==l[1]||i[2]!==l[2]||i[3]!==l[3]||this.dirty)&&(this.gl.colorMask(i[0],i[1],i[2],i[3]),this.current=i,this.dirty=!1)}}class bf extends Es{getDefault(){return!0}set(i){(i!==this.current||this.dirty)&&(this.gl.depthMask(i),this.current=i,this.dirty=!1)}}class Yh extends Es{getDefault(){return 255}set(i){(i!==this.current||this.dirty)&&(this.gl.stencilMask(i),this.current=i,this.dirty=!1)}}class Mg extends Es{getDefault(){return{func:this.gl.ALWAYS,ref:0,mask:255}}set(i){const l=this.current;(i.func!==l.func||i.ref!==l.ref||i.mask!==l.mask||this.dirty)&&(this.gl.stencilFunc(i.func,i.ref,i.mask),this.current=i,this.dirty=!1)}}class Yp extends Es{getDefault(){const i=this.gl;return[i.KEEP,i.KEEP,i.KEEP]}set(i){const l=this.current;(i[0]!==l[0]||i[1]!==l[1]||i[2]!==l[2]||this.dirty)&&(this.gl.stencilOp(i[0],i[1],i[2]),this.current=i,this.dirty=!1)}}class il extends Es{getDefault(){return!1}set(i){if(i===this.current&&!this.dirty)return;const l=this.gl;i?l.enable(l.STENCIL_TEST):l.disable(l.STENCIL_TEST),this.current=i,this.dirty=!1}}class Kh extends Es{getDefault(){return[0,1]}set(i){const l=this.current;(i[0]!==l[0]||i[1]!==l[1]||this.dirty)&&(this.gl.depthRange(i[0],i[1]),this.current=i,this.dirty=!1)}}class wf extends Es{getDefault(){return!1}set(i){if(i===this.current&&!this.dirty)return;const l=this.gl;i?l.enable(l.DEPTH_TEST):l.disable(l.DEPTH_TEST),this.current=i,this.dirty=!1}}class Ra extends Es{getDefault(){return this.gl.LESS}set(i){(i!==this.current||this.dirty)&&(this.gl.depthFunc(i),this.current=i,this.dirty=!1)}}class Uu extends Es{getDefault(){return!1}set(i){if(i===this.current&&!this.dirty)return;const l=this.gl;i?l.enable(l.BLEND):l.disable(l.BLEND),this.current=i,this.dirty=!1}}class Kp extends Es{getDefault(){const i=this.gl;return[i.ONE,i.ZERO,i.ONE,i.ZERO]}set(i){const l=this.current;(i[0]!==l[0]||i[1]!==l[1]||i[2]!==l[2]||i[3]!==l[3]||this.dirty)&&(this.gl.blendFuncSeparate(i[0],i[1],i[2],i[3]),this.current=i,this.dirty=!1)}}class xc extends Es{getDefault(){return s.am.transparent}set(i){const l=this.current;(i.r!==l.r||i.g!==l.g||i.b!==l.b||i.a!==l.a||this.dirty)&&(this.gl.blendColor(i.r,i.g,i.b,i.a),this.current=i,this.dirty=!1)}}class Hu extends Es{getDefault(){return this.gl.FUNC_ADD}set(i){(i!==this.current||this.dirty)&&(this.gl.blendEquationSeparate(i,i),this.current=i,this.dirty=!1)}}class nl extends Es{getDefault(){return!1}set(i){if(i===this.current&&!this.dirty)return;const l=this.gl;i?l.enable(l.CULL_FACE):l.disable(l.CULL_FACE),this.current=i,this.dirty=!1}}class eu extends Es{getDefault(){return this.gl.BACK}set(i){(i!==this.current||this.dirty)&&(this.gl.cullFace(i),this.current=i,this.dirty=!1)}}class bc extends Es{getDefault(){return this.gl.CCW}set(i){(i!==this.current||this.dirty)&&(this.gl.frontFace(i),this.current=i,this.dirty=!1)}}let Jh=class extends Es{getDefault(){return null}set(f){(f!==this.current||this.dirty)&&(this.gl.useProgram(f),this.current=f,this.dirty=!1)}};class Tf extends Es{getDefault(){return this.gl.TEXTURE0}set(i){(i!==this.current||this.dirty)&&(this.gl.activeTexture(i),this.current=i,this.dirty=!1)}}class Jp extends Es{getDefault(){const i=this.gl;return[0,0,i.drawingBufferWidth,i.drawingBufferHeight]}set(i){const l=this.current;(i[0]!==l[0]||i[1]!==l[1]||i[2]!==l[2]||i[3]!==l[3]||this.dirty)&&(this.gl.viewport(i[0],i[1],i[2],i[3]),this.current=i,this.dirty=!1)}}class wc extends Es{getDefault(){return null}set(i){if(i===this.current&&!this.dirty)return;const l=this.gl;l.bindFramebuffer(l.FRAMEBUFFER,i),this.current=i,this.dirty=!1}}class Oa extends Es{getDefault(){return null}set(i){if(i===this.current&&!this.dirty)return;const l=this.gl;l.bindRenderbuffer(l.RENDERBUFFER,i),this.current=i,this.dirty=!1}}class Gu extends Es{getDefault(){return null}set(i){if(i===this.current&&!this.dirty)return;const l=this.gl;l.bindTexture(l.TEXTURE_2D,i),this.current=i,this.dirty=!1}}class Qp extends Es{getDefault(){return null}set(i){if(i===this.current&&!this.dirty)return;const l=this.gl;l.bindBuffer(l.ARRAY_BUFFER,i),this.current=i,this.dirty=!1}}
3231class em extends Es{getDefault(){return null}set(i){const l=this.gl;l.bindBuffer(l.ELEMENT_ARRAY_BUFFER,i),this.current=i,this.dirty=!1}}class tm extends Es{getDefault(){return null}set(i){this.gl&&(i!==this.current||this.dirty)&&(this.gl.bindVertexArray(i),this.current=i,this.dirty=!1)}}class tu extends Es{getDefault(){return 4}set(i){if(i===this.current&&!this.dirty)return;const l=this.gl;l.pixelStorei(l.UNPACK_ALIGNMENT,i),this.current=i,this.dirty=!1}}class im extends Es{getDefault(){return!1}set(i){if(i===this.current&&!this.dirty)return;const l=this.gl;l.pixelStorei(l.UNPACK_PREMULTIPLY_ALPHA_WEBGL,i),this.current=i,this.dirty=!1}}class Pg extends Es{getDefault(){return!1}set(i){if(i===this.current&&!this.dirty)return;const l=this.gl;l.pixelStorei(l.UNPACK_FLIP_Y_WEBGL,i),this.current=i,this.dirty=!1}}class Sf extends Es{constructor(i,l){super(i),this.context=i,this.parent=l}getDefault(){return null}}class nm extends Sf{setDirty(){this.dirty=!0}set(i){if(i===this.current&&!this.dirty)return;this.context.bindFramebuffer.set(this.parent);const l=this.gl;l.framebufferTexture2D(l.FRAMEBUFFER,l.COLOR_ATTACHMENT0,l.TEXTURE_2D,i,0),this.current=i,this.dirty=!1}}class Qh extends Sf{attachment(){return this.gl.DEPTH_ATTACHMENT}set(i){if(i===this.current&&!this.dirty)return;this.context.bindFramebuffer.set(this.parent);const l=this.gl;l.framebufferRenderbuffer(l.FRAMEBUFFER,this.attachment(),l.RENDERBUFFER,i),this.current=i,this.dirty=!1}}class ed extends Sf{attachment(){return this.gl.DEPTH_ATTACHMENT}set(i){if(i===this.current&&!this.dirty)return;this.context.bindFramebuffer.set(this.parent);const l=this.gl;l.framebufferTexture2D(l.FRAMEBUFFER,this.attachment(),l.TEXTURE_2D,i,0),this.current=i,this.dirty=!1}}class Wu extends Qh{attachment(){return this.gl.DEPTH_STENCIL_ATTACHMENT}}const td=(f,i,l)=>({u_matrix:f,u_image0:0,u_skirt_height:i,u_ground_shadow_factor:l}),sl=(f,i,l,p,y,v,w,S,C,D,L,F,O,$,q,W)=>({u_proj_matrix:Float32Array.from(f),u_globe_matrix:i,u_normalize_matrix:Float32Array.from(p),u_merc_matrix:l,u_zoom_transition:y,u_merc_center:v,u_image0:0,u_frustum_tl:w,u_frustum_tr:S,u_frustum_br:C,u_frustum_bl:D,u_globe_pos:L,u_globe_radius:F,u_viewport:O,u_grid_matrix:W?Float32Array.from(W):new Float32Array(9),u_skirt_height:$,u_far_z_cutoff:q});function id(f,i){return f!=null&&i!=null&&!(!f.hasData()||!i.hasData())&&f.demTexture!=null&&i.demTexture!=null&&f.tileID.key!==i.tileID.key}const $l=new class{constructor(){this.operations={}}newMorphing(f,i,l,p,y){if(f in this.operations){const v=this.operations[f];v.to.tileID.key!==l.tileID.key&&(v.queued=l)}else this.operations[f]={startTime:p,phase:0,duration:y,from:i,to:l,queued:null}}getMorphValuesForProxy(f){if(!(f in this.operations))return null;const i=this.operations[f];return{from:i.from,to:i.to,phase:i.phase}}update(f){for(const i in this.operations){const l=this.operations[i];for(l.phase=(f-l.startTime)/l.duration;l.phase>=1||!this._validOp(l);)if(!this._nextOp(l,f)){delete this.operations[i];break}}}_nextOp(f,i){return!!f.queued&&(f.from=f.to,f.to=f.queued,f.queued=null,f.phase=0,f.startTime=i,!0)}_validOp(f){return f.from.hasData()&&f.to.hasData()}},Tc={0:null,1:"TERRAIN_VERTEX_MORPHING"};function jl(f,i,l){if(i===0)return 0;const p=i<1&&l===514?.25/i:1;return 6*Math.pow(1.5,22-f)*Math.max(i,1)*p}function Ef(f,i){const l=1<<f.z;return!i&&(f.x===0||f.x===l-1)||f.y===0||f.y===l-1}const no=f=>({u_matrix:f});function qu(f,i,l,p,y){if(y>0){const v=s.q.now(),w=(v-f.timeAdded)/y,S=i?(v-i.timeAdded)/y:-1,C=l.getSource(),D=p.coveringZoomLevel({tileSize:C.tileSize,roundZoom:C.roundZoom}),L=!i||Math.abs(i.tileID.overscaledZ-D)>Math.abs(f.tileID.overscaledZ-D),F=L&&f.refreshedUponExpiration?1:s.aD(L?w:1-S,0,1);return f.refreshedUponExpiration&&w>=1&&(f.refreshedUponExpiration=!1),i?{opacity:1,mix:1-F}:{opacity:F,mix:0}}return{opacity:1,mix:0}}class za extends to{constructor(i){const l={type:"raster-dem",maxzoom:i.transform.maxZoom},p=new s.D(s.d0(),null),y=ac("mock-dem",l,p,i.style);super("mock-dem",y,!1),y.setEventedParent(this),this._sourceLoaded=!0}
3231_loadTile(i,l){i.state="loaded",l(null)}}class xa extends to{constructor(i){const l=ac("proxy",{type:"geojson",maxzoom:i.transform.maxZoom},new s.D(s.d0(),null),i.style);super("proxy",l,!1),l.setEventedParent(this),this.map=this.getSource().map=i,this.used=this._sourceLoaded=!0,this.renderCache=[],this.renderCachePool=[],this.proxyCachedFBO={}}update(i,l,p){if(i.freezeTileCoverage)return;this.transform=i;const y=i.coveringTiles({tileSize:this._source.tileSize,minzoom:this._source.minzoom,maxzoom:this._source.maxzoom,roundZoom:this._source.roundZoom,reparseOverscaled:this._source.reparseOverscaled}).reduce((v,w)=>{if(v[w.key]="",!this._tiles[w.key]){const S=new eo(w,this._source.tileSize*w.overscaleFactor(),i.tileZoom);S.state="loaded",this._tiles[w.key]=S}return v},{});for(const v in this._tiles)v in y||(this.freeFBO(v),this._tiles[v].unloadVectorData(),delete this._tiles[v])}freeFBO(i){const l=this.proxyCachedFBO[i];if(l!==void 0){const p=Object.values(l);this.renderCachePool.push(...p),delete this.proxyCachedFBO[i]}}deallocRenderCache(){this.renderCache.forEach(i=>i.fb.destroy()),this.renderCache=[],this.renderCachePool=[],this.proxyCachedFBO={}}}class nd extends s.aM{constructor(i,l,p){super(i.overscaledZ,i.wrap,i.canonical.z,i.canonical.x,i.canonical.y),this.proxyTileKey=l,this.projMatrix=p}}class sd extends s.dt{constructor(i,l){super(),this._debugParams={sortTilesHiZFirst:!0,disableRenderCache:!1},i.tp.registerParameter(this._debugParams,["Terrain"],"sortTilesHiZFirst",{},()=>{this._style.map.triggerRepaint()}),i.tp.registerParameter(this._debugParams,["Terrain"],"disableRenderCache",{},()=>{this._style.map.triggerRepaint()}),i.tp.registerButton(["Terrain"],"Invalidate Render Cache",()=>{this.invalidateRenderCache=!0,this._style.map.triggerRepaint()}),this.painter=i,this.terrainTileForTile={},this.prevTerrainTileForTile={};const[p,y,v]=function(C){const D=new s.ba,L=new s.a_,F=131;D.reserve(17161),L.reserve(33800);const O=s.aj/128,$=s.aj+O/2,q=$+O;for(let K=-O;K<q;K+=O)for(let Z=-O;Z<q;Z+=O){const se=Z<0||Z>$||K<0||K>$?24575:0,ue=s.aD(Math.round(Z),0,s.aj),fe=s.aD(Math.round(K),0,s.aj);D.emplaceBack(ue+se,fe)}const W=(K,Z)=>{const se=Z*F+K;L.emplaceBack(se+1,se,se+F),L.emplaceBack(se+F,se+F+1,se+1)};for(let K=1;K<129;K++)for(let Z=1;Z<129;Z++)W(Z,K);return[0,129].forEach(K=>{for(let Z=0;Z<130;Z++)W(Z,K),W(K,Z)}),[D,L,32768]}(),w=i.context;this.gridBuffer=w.createVertexBuffer(p,s.bc.members),this.gridIndexBuffer=w.createIndexBuffer(y),this.gridSegments=s.bd.simpleSegment(0,0,p.length,y.length),this.gridNoSkirtSegments=s.bd.simpleSegment(0,0,p.length,v),this.proxyCoords=[],this.proxiedCoords={},this._visibleDemTiles=[],this._drapedRenderBatches=[],this._sourceTilesOverlap={},this.proxySourceCache=new xa(l.map),this.orthoMatrix=s.bz(),s.c5(this.orthoMatrix,this.painter.transform.projection.name==="globe"?.015:0,s.aj,0,s.aj,0,1);const S=w.gl;this._overlapStencilMode=new Ii({func:S.GEQUAL,mask:255},0,255,S.KEEP,S.KEEP,S.REPLACE),this._previousZoom=i.transform.zoom,this.pool=[],this._findCoveringTileCache={},this._tilesDirty={},this.style=l,this._useVertexMorphing=!0,this._exaggeration=1,this._mockSourceCache=new za(l.map),this._pendingGroundEffectLayers=[]}set style(i){i.on("data",this._onStyleDataEvent.bind(this)),this._style=i,this._style.map.on("moveend",()=>{this._clearLineLayersFromRenderCache()})}update(i,l,p){if(i&&i.terrain){this._style!==i&&(this.style=i,this._evaluationZoom=void 0);const y=i.terrain.properties,v=i.terrain.drapeRenderMode===0,w=i.terrain.isZoomDependent();this._previousUpdateTimestamp=this.enabled?this._updateTimestamp:void 0,this._updateTimestamp=s.q.now();const S=i.terrain&&i.terrain.scope,C=y.get("source"),D=v?this._mockSourceCache:i.getSourceCache(C,S);if(!D)return void s.w(`Couldn't find terrain source "${C}".`);if(this.sourceCache=D,this._attenuationRange=i.terrain.getAttenuationRange(),this._exaggeration=w?this.calculateExaggeration(l):y.get("exaggeration"),!l.projection.requiresDraping&&w&&this._exaggeration===0)return void this._disable();this.enabled=!0;const L=()=>{this.sourceCache.used&&s.w(`Raster DEM source '${this.sourceCache.id}' is used both for terrain and as layer source. 3232This leads to lower resolution of hillshade. For full hillshade resolution but higher memory consumption, define another raster DEM source.`);const F=this.getScaledDemTileSize();this.sourceCache.update(l,F,!0),this.resetTileLookupCache(this.sourceCache.id)};this.sourceCache.usedForTerrain||(this.resetTileLookupCache(this.sourceCache.id),this.sourceCache.usedForTerrain=!0,L(),this._initializing=!0),L(),l.updateElevation(!0,p),this.resetTileLookupCache(this.proxySourceCache.id),this.proxySourceCache.update(l),this._emptyDEMTextureDirty=!0,this._previousZoom=l.zoom}else this._disable()}calculateExaggeration(i){if(this._attenuationRange&&i.zoom>=Math.ceil(this._attenuationRange[1]))return this._style.terrain.getExaggeration(i.zoom);const l=this._previousCameraAltitude,p=i.getFreeCameraOptions().position.z/i.pixelsPerMeter*i.worldSize;this._previousCameraAltitude=p;const y=l!=null?p-l:Number.MAX_VALUE;if(Math.abs(y)<2)return this._exaggeration;const v=i.zoom,w=this._style.terrain;if(!this._previousUpdateTimestamp)return w.getExaggeration(v);let S=v-this._previousZoom;const C=this._previousUpdateTimestamp;let D=v;this._evaluationZoom!=null&&(D=this._evaluationZoom,Math.abs(v-D)>.5&&(S=.5*(v-D+S)),S*y<0&&(D+=S)),this._evaluationZoom=D;const L=w.getExaggeration(D),F=L===w.getExaggeration(Math.max(0,D-.1));if(F&&Math.abs(L-this._exaggeration)<.01)return L;let O=Math.min(.1,.00375*(this._updateTimestamp-C));return(F||L<.1||Math.abs(S)<1e-4)&&(O=Math.min(.2,4*O)),s.ai(this._exaggeration,L,O)}resetTileLookupCache(i){this._findCoveringTileCache[i]={}}attenuationRange(){return this._attenuationRange}getDemUpscale(){return this.proxySourceCache.getSource().tileSize/128}getScaledDemTileSize(){return this.sourceCache.getSource().tileSize/128*this.proxySourceCache.getSource().tileSize}_onStyleDataEvent(i){i.coord&&i.dataType==="source"?this._clearRenderCacheForTile(i.sourceCacheId,i.coord):i.dataType==="style"&&(this.invalidateRenderCache=!0,this._evaluationZoom=void 0,this._previousUpdateTimestamp=void 0,this._previousCameraAltitude=void 0)}_disable(){if(this.enabled&&(this.enabled=!1,this._emptyDEMTextureDirty=!0,this._sharedDepthStencil=void 0,this._evaluationZoom=void 0,this._previousUpdateTimestamp=void 0,this.proxySourceCache.deallocRenderCache(),this._style))for(const i in this._style._mergedSourceCaches)this._style._mergedSourceCaches[i].usedForTerrain=!1}destroy(){this._disable(),this._emptyDEMTexture&&this._emptyDEMTexture.destroy(),this.pool.forEach(i=>
vendor: 19,987 bytes, line 3232
3232i.fb.destroy()),this.pool=[],this.framebufferCopyTexture&&this.framebufferCopyTexture.destroy()}_source(){return this.enabled?this.sourceCache:null}isUsingMockSource(){return this.sourceCache===this._mockSourceCache}exaggeration(){return this.enabled?this._exaggeration:0}get visibleDemTiles(){return this._visibleDemTiles}get drapeBufferSize(){const i=2*this.proxySourceCache.getSource().tileSize;return[i,i]}set useVertexMorphing(i){this._useVertexMorphing=i}updateTileBinding(i){if(!this.enabled)return;this.prevTerrainTileForTile=this.terrainTileForTile;const l=this.proxySourceCache,p=this.painter.transform;this._initializing&&(this._initializing=p._centerAltitude===0&&this.getAtPointOrZero(s.ac.fromLngLat(p.center),-1)===-1,this._emptyDEMTextureDirty=!this._initializing);const y=this.proxyCoords=l.getIds().map(C=>{const D=l.getTileByID(C).tileID;return D.projMatrix=p.calculateProjMatrix(D.toUnwrapped()),D});(function(C,D){const L=D.transform.pointCoordinate(D.transform.getCameraPoint()),F=new s.P(L.x,L.y);C.sort((O,$)=>{if($.overscaledZ-O.overscaledZ)return $.overscaledZ-O.overscaledZ;const q=new s.P(O.canonical.x+(1<<O.canonical.z)*O.wrap,O.canonical.y),W=new s.P($.canonical.x+(1<<$.canonical.z)*$.wrap,$.canonical.y),K=F.mult(1<<O.canonical.z);return K.x-=.5,K.y-=.5,K.distSqr(q)-K.distSqr(W)})})(y,this.painter);const v=this.proxyToSource||{};this.proxyToSource={},y.forEach(C=>{this.proxyToSource[C.key]={}}),this.terrainTileForTile={};const w=this._style._mergedSourceCaches;for(const C in w){const D=w[C];if(!D.used||(D!==this.sourceCache&&this.resetTileLookupCache(D.id),this._setupProxiedCoordsForOrtho(D,i[C],v),D.usedForTerrain))continue;const L=i[C];D.getSource().reparseOverscaled&&this._assignTerrainTiles(L)}this.proxiedCoords[l.id]=y.map(C=>new nd(C,C.key,this.orthoMatrix)),this._assignTerrainTiles(y),this._prepareDEMTextures(),this._setupDrapedRenderBatches(),this._initFBOPool(),this._setupRenderCache(v),this.renderingToTexture=!1;const S={};this._visibleDemTiles=[];for(const C of this.proxyCoords){const D=this.terrainTileForTile[C.key];if(!D)continue;const L=D.tileID.key;L in S||(this._visibleDemTiles.push(D),S[L]=L)}}_assignTerrainTiles(i){this._initializing||i.forEach(l=>{if(this.terrainTileForTile[l.key])return;const p=this._findTileCoveringTileID(l,this.sourceCache);p&&(this.terrainTileForTile[l.key]=p)})}_prepareDEMTextures(){const i=this.painter.context,l=i.gl;for(const p in this.terrainTileForTile){const y=this.terrainTileForTile[p],v=y.dem;!v||y.demTexture&&!y.needsDEMTextureUpload||(i.activeTexture.set(l.TEXTURE1),vf(this.painter,y,v))}}_prepareDemTileUniforms(i,l,p,y){if(!l||l.demTexture==null)return!1;const v=i.tileID.canonical,w=Math.pow(2,l.tileID.canonical.z-v.z),S=y||"";return p[`u_dem_tl${S}`]=[v.x*w%1,v.y*w%1],p[`u_dem_scale${S}`]=w,!0}get emptyDEMTexture(){return!this._emptyDEMTextureDirty&&this._emptyDEMTexture?this._emptyDEMTexture:this._updateEmptyDEMTexture()}_getLoadedAreaMinimum(){if(!this.enabled)return 0;let i=0;const l=this._visibleDemTiles.reduce((p,y)=>{if(!y.dem)return p;const v=y.dem.tree.minimums[0];return v>0&&i++,p+v},0);return i?l/i:0}_updateEmptyDEMTexture(){const i=this.painter.context,l=i.gl;i.activeTexture.set(l.TEXTURE2);const p=this._getLoadedAreaMinimum(),y=new s.du({width:1,height:1},new Float32Array([p]));this._emptyDEMTextureDirty=!1;let v=this._emptyDEMTexture;return v?v.update(y,{premultiply:!1}):v=this._emptyDEMTexture=new s.T(i,y,l.R32F,{premultiply:!1}),v}setupElevationDraw(i,l,p){const y=this.painter.context,v=y.gl,w={u_dem:2,u_dem_prev:4,u_dem_tl:[0,0],u_dem_tl_prev:[0,0],u_dem_scale:0,u_dem_scale_prev:0,u_dem_size:0,u_dem_lerp:1,u_depth:3,u_depth_size_inv:[0,0],u_depth_range_unpack:[0,1],u_occluder_half_size:16,u_occlusion_depth_offset:-1e-4,u_exaggeration:0};w.u_exaggeration=this.exaggeration();let S=null,C=null,D=1;if(p&&p.morphing&&this._useVertexMorphing){const $=p.morphing.srcDemTile,q=p.morphing.dstDemTile;D=p.morphing.phase,$&&q&&(this._prepareDemTileUniforms(i,$,w,"_prev")&&(C=$),this._prepareDemTileUniforms(i,q,w)&&(S=q))}const L=$=>$&&$.demTexture&&this.painter.linearFloatFilteringSupported()?v.LINEAR:v.NEAREST;let F=null;var O;if(this.enabled?C&&S?(F=S.demTexture,y.activeTexture.set(v.TEXTURE4),C.demTexture.bind(L(C),v.CLAMP_TO_EDGE),w.u_dem_lerp=D):(S=this.terrainTileForTile[i.tileID.key],F=this._prepareDemTileUniforms(i,S,w)?S.demTexture:this.emptyDEMTexture):F=this.emptyDEMTexture,y.activeTexture.set(v.TEXTURE2),F&&(w.u_dem_size=(O=F).size[0]===1?1:O.size[0]-2,F.bind(L(S),v.CLAMP_TO_EDGE)),this.painter.setupDepthForOcclusion(p&&p.useDepthForOcclusion,l,w),p&&p.useMeterToDem&&S){const $=(1<<S.tileID.canonical.z)*s.c6(1,this.painter.transform.center.lat)*this.sourceCache.getSource().tileSize;w.u_meter_to_dem=$}if(p&&p.labelPlaneMatrixInv&&(w.u_label_plane_matrix_inv=p.labelPlaneMatrixInv),l.setTerrainUniformValues(y,w),this.painter.transform.projection.name==="globe"){const $=this.globeUniformValues(this.painter.transform,i.tileID.canonical,p&&p.useDenormalizedUpVectorScale);l.setGlobeUniformValues(y,$)}}globeUniformValues(i,l,p){const y=i.projection;return{u_tile_tl_up:y.upVector(l,0,0),u_tile_tr_up:y.upVector(l,s.aj,0),u_tile_br_up:y.upVector(l,s.aj,s.aj),u_tile_bl_up:y.upVector(l,0,s.aj),u_tile_up_scale:p?s.dv(1):y.upVectorScale(l,i.center.lat,i.worldSize).metersToTile}}renderToBackBuffer(i){const l=this.painter,p=this.painter.context;i.length!==0&&(p.bindFramebuffer.set(null),p.viewport.set([0,0,l.width,l.height]),l.gpuTimingDeferredRenderStart(),this.renderingToTexture=!1,function(y,v,w,S,C){if(y.transform.projection.name==="globe")(function(D,L,F,O,$){const q=D.context,W=q.gl;let K,Z;const se=D.transform,ue=s.dl(D,q,se),fe=(lt,st)=>{if(Z===st)return;const Et=[Tc[st],"PROJECTION_GLOBE_VIEW"];ue&&Et.push("CUSTOM_ANTIALIASING");const Be=D.isTileAffectedByFog(lt);K=D.getOrCreateProgram("globeRaster",{defines:Et,overrideFog:Be}),Z=st},xe=D.colorModeForRenderPass(),_e=new Gt(W.LEQUAL,Gt.ReadWrite,D.depthRangeFor3D);$l.update($);const ye=s.dm(se),pe=[s.ay(se.center.lng),s.aH(se.center.lat)],Se=D.globeSharedBuffers,Ae=[se.width*s.q.devicePixelRatio,se.height*s.q.devicePixelRatio],Ge=Float32Array.from(se.globeMatrix),Ne={useDenormalizedUpVectorScale:!0};{const lt=D.transform,st=jl(lt.zoom,L.exaggeration(),L.sourceCache._source.tileSize);Z=-1;const Et=W.TRIANGLES;for(const Be of O){const We=F.getTile(Be),Re=Ii.disabled,ht=L.prevTerrainTileForTile[Be.key],Xe=L.terrainTileForTile[Be.key];id(ht,Xe)&&$l.newMorphing(Be.key,ht,Xe,$,250),q.activeTexture.set(W.TEXTURE0),We.texture&&We.texture.bind(W.LINEAR,W.CLAMP_TO_EDGE);const gt=$l.getMorphValuesForProxy(Be.key),ct=gt?1:0;gt&&s.L(Ne,{morphing:{srcDemTile:gt.from,dstDemTile:gt.to,phase:s.dk(gt.phase)}});const yt=s.dn(Be.canonical),xt=s.dp(yt.getCenter().lat),Qt=s.dq(Be.canonical,yt,xt,lt.worldSize/lt._pixelsPerMercatorPixel),ci=s.bh(s.dr(Be.canonical)),Kt=sl(lt.expandedFarZProjMatrix,Ge,ye,ci,s.ah(lt.zoom),pe,lt.frustumCorners.TL,lt.frustumCorners.TR,lt.frustumCorners.BR,lt.frustumCorners.BL,lt.globeCenterInViewSpace,lt.globeRadius,Ae,st,lt._farZ,Qt);if(fe(Be,ct),K&&(L.setupElevationDraw(We,K,Ne),D.uploadCommonUniforms(q,K,Be.toUnwrapped()),Se)){const[hi,ni,bi]=Se.getGridBuffers(xt,st!==0);K.draw(D,Et,_e,Re,xe,Di.backCCW,Kt,"globe_raster",hi,ni,bi)}}}if(Se&&(D.renderDefaultNorthPole||D.renderDefaultSouthPole)){const lt=["GLOBE_POLES","PROJECTION_GLOBE_VIEW"];ue&<.push("CUSTOM_ANTIALIASING"),K=D.getOrCreateProgram("globeRaster",{defines:lt});for(const st of O){const{x:Et,y:Be,z:We}=st.canonical,Re=Be===0,ht=Be===(1<<We)-1,[Xe,gt,ct,yt]=Se.getPoleBuffers(We,!1);if(yt&&(Re||ht)){const xt=F.getTile(st);q.activeTexture.set(W.TEXTURE0),xt.texture&&xt.texture.bind(W.LINEAR,W.CLAMP_TO_EDGE);let Qt=s.ds(We,Et,se);const ci=s.bh(s.dr(st.canonical)),Kt=(hi,ni)=>hi.draw(D,W.TRIANGLES,_e,Ii.disabled,xe,Di.disabled,sl(se.expandedFarZProjMatrix,Qt,Qt,ci,0,pe,se.frustumCorners.TL,se.frustumCorners.TR,se.frustumCorners.BR,se.frustumCorners.BL,se.globeCenterInViewSpace,se.globeRadius,Ae,0,se._farZ),"globe_pole_raster",ni,ct,yt);L.setupElevationDraw(xt,K,Ne),D.uploadCommonUniforms(q,K,st.toUnwrapped()),Re&&D.renderDefaultNorthPole&&Kt(K,Xe),ht&&D.renderDefaultSouthPole&&(Qt=s.cE(s.bz(),Qt,[1,-1,1]),Kt(K,gt))}}}})(y,v,w,S,C);else{const D=y.context,L=D.gl;let F,O;const $=y.shadowRenderer,q=Nl(y,y.longestCutoffRange),W=xe=>{if(O===xe)return;const _e=[];_e.push(Tc[xe]),q.shouldRenderCutoff&&_e.push("RENDER_CUTOFF"),$&&(_e.push("RENDER_SHADOWS","DEPTH_TEXTURE"),$.useNormalOffset&&_e.push("NORMAL_OFFSET")),F=y.getOrCreateProgram("terrainRaster",{defines:_e}),O=xe},K=y.colorModeForRenderPass(),Z=new Gt(L.LEQUAL,Gt.ReadWrite,y.depthRangeFor3D);$l.update(C);const se=y.transform,ue=jl(se.zoom,v.exaggeration(),v.sourceCache._source.tileSize);let fe=[0,0,0];if($){const xe=y.style.directionalLight,_e=y.style.ambientLight;xe&&_e&&(fe=va(y.style,xe,_e))}{O=-1;const xe=L.TRIANGLES,[_e,ye]=[v.gridIndexBuffer,v.gridSegments];for(const pe of S){const Se=w.getTile(pe),Ae=Ii.disabled,Ge=v.prevTerrainTileForTile[pe.key],Ne=v.terrainTileForTile[pe.key];id(Ge,Ne)&&$l.newMorphing(pe.key,Ge,Ne,C,250),D.activeTexture.set(L.TEXTURE0),Se.texture&&Se.texture.bind(L.LINEAR,L.CLAMP_TO_EDGE);const lt=$l.getMorphValuesForProxy(pe.key),st=lt?1:0;let Et;lt&&(Et={morphing:{srcDemTile:lt.from,dstDemTile:lt.to,phase:s.dk(lt.phase)}});const Be=td(pe.projMatrix,Ef(pe.canonical,se.renderWorldCopies)?ue/10:ue,fe);if(W(st),!F)continue;v.setupElevationDraw(Se,F,Et);const We=pe.toUnwrapped();$&&$.setupShadows(We,F),y.uploadCommonUniforms(D,F,We,null,q),F.draw(y,xe,Z,Ae,K,Di.backCCW,Be,"terrain_raster",v.gridBuffer,_e,ye)}}}}(l,this,this.proxySourceCache,i,this._updateTimestamp),this.renderingToTexture=!0,l.gpuTimingDeferredRenderEnd(),i.splice(0,i.length))}renderBatch(i){if(this._drapedRenderBatches.length===0)return i+1;this.renderingToTexture=!0;const l=this.painter,p=this.painter.context,y=this.proxySourceCache,v=this.proxiedCoords[y.id],w=this._drapedRenderBatches.shift(),S=l.style.order,C=[];let D=0;for(const L of v){const F=y.getTileByID(L.proxyTileKey),O=y.proxyCachedFBO[L.key]?y.proxyCachedFBO[L.key][i]:void 0,$=O!==void 0?y.renderCache[O]:this.pool[D++],q=O!==void 0;if(F.texture=$.tex,q&&!$.dirty){C.push(F.tileID);continue}let W;p.bindFramebuffer.set($.fb.framebuffer),this.renderedToTile=!1,$.dirty&&(p.clear({color:s.am.transparent,stencil:0}),$.dirty=!1);for(let K=w.start;K<=w.end;++K){const Z=l.style._mergedLayers[S[K]];if(Z.isHidden(l.transform.zoom))continue;const se=l.style.getLayerSourceCache(Z),ue=se?this.proxyToSource[L.key][se.id]:[L];if(!ue)continue;const fe=ue;p.viewport.set([0,0,$.fb.width,$.fb.height]),W!==(se?se.id:null)&&(this._setupStencil($,ue,Z,se),W=se?se.id:null),l.renderLayer(l,se,Z,fe)}if(this._drapedRenderBatches.length===0)for(const K of this._pendingGroundEffectLayers){const Z=l.style._mergedLayers[S[K]];if(Z.isHidden(l.transform.zoom))continue;const se=l.style.getLayerSourceCache(Z),ue=se?this.proxyToSource[L.key][se.id]:[L];if(!ue)continue;const fe=ue;p.viewport.set([0,0,$.fb.width,$.fb.height]),W!==(se?se.id:null)&&(this._setupStencil($,ue,Z,se),W=se?se.id:null),l.renderLayer(l,se,Z,fe)}this.renderedToTile?($.dirty=!0,C.push(F.tileID)):q||--D,D===5&&(D=0,this.renderToBackBuffer(C))}return this.renderToBackBuffer(C),this.renderingToTexture=!1,p.bindFramebuffer.set(null),p.viewport.set([0,0,l.width,l.height]),w.end+1}postRender(){}isLayerOrderingCorrect(i){const l=i.order.length;let p=-1,y=l;for(let v=0;v<l;++v)this._style.isLayerDraped(i._mergedLayers[i.order[v]])?p=Math.max(p,v):y=Math.min(y,v);return y>p}getMinElevationBelowMSL(){let i=0;return this._visibleDemTiles.filter(l=>l.dem).forEach(l=>{i=Math.min(i,l.dem.tree.minimums[0])}),i===0?i:(i-30)*this._exaggeration}raycast(i,l,p){if(!this._visibleDemTiles)return null;const y=this._visibleDemTiles.filter(v=>v.dem).map(v=>{const w=v.tileID,S=1<<w.overscaledZ,{x:C,y:D}=w.canonical,L=C/S,F=(C+1)/S,O=D/S,$=(D+1)/S;return{minx:L,miny:O,maxx:F,maxy:$,t:v.dem.tree.raycastRoot(L,O,F,$,i,l,p),tile:v}});y.sort((v,w)=>(v.t!==null?v.t:Number.MAX_VALUE)-(w.t!==null?w.t:Number.MAX_VALUE));for(const v of y){if(v.t==null)return null;const w=v.tile.dem.tree.raycast(v.minx,v.miny,v.maxx,v.maxy,i,l,p);if(w!=null)return w}return null}_createFBO(){const i=this.painter.context,l=i.gl,p=this.drapeBufferSize;i.activeTexture.set(l.TEXTURE0);const y=new s.T(i,{width:p[0],height:p[1],data:null},l.RGBA8);y.bind(l.LINEAR,l.CLAMP_TO_EDGE);const v=i.createFramebuffer(p[0],p[1],!0,null);return v.colorAttachment.set(y.texture),v.depthAttachment=new Wu(i,v.framebuffer),this._sharedDepthStencil===void 0?(this._sharedDepthStencil=i.createRenderbuffer(i.gl.DEPTH_STENCIL,p[0],p[1]),this._stencilRef=0,v.depthAttachment.set(this._sharedDepthStencil),i.clear({stencil:0})):v.depthAttachment.set(this._sharedDepthStencil),i.extTextureFilterAnisotropic&&l.texParameterf(l.TEXTURE_2D,i.extTextureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,i.extTextureFilterAnisotropicMax),{fb:v,tex:y,dirty:!1}}_initFBOPool(){for(;this.pool.length<Math.min(5,this.proxyCoords.length);)this.pool.push(this._createFBO())}_shouldDisableRenderCache(){if(this._debugParams.disableRenderCache||this._style.hasLightTransitions())return!0;for(const i in this._style._mergedSourceCaches)if(this._style._mergedSourceCaches[i].hasTransition())return!0;return this._style.order.some(i=>{const l=this._style._mergedLayers[i],p=l.isHidden(this.painter.transform.zoom);return l.type==="hillshade"||l.type==="custom"?!p&&l.shouldRedrape():!p&&l.hasTransition()})}_clearLineLayersFromRenderCache(){let i=!1;for(const p of this._style.getSources())if(p instanceof Fr){i=!0;break}if(!i)return;const l={};for(let p=0;p<this._style.order.length;++p){const y=this._style._mergedLayers[this._style.order[p]],v=this._style.getLayerSourceCache(y);if(v&&!l[v.id]&&!y.isHidden(this.painter.transform.zoom)&&y.type==="line"&&y.widthExpression()instanceof s.ab){l[v.id]=!0;for(const w of this.proxyCoords){const S=this.proxyToSource[w.key][v.id];if(S)for(const C of S)this._clearRenderCacheForTile(v.id,C)}}}}_clearRasterLayersFromRenderCache(){let i=!1;for(const p in this._style._mergedSourceCaches)if(this._style._mergedSourceCaches[p]._source instanceof _a){i=!0;break}if(!i)return;const l={};for(let p=0;p<this._style.order.length;++p){const y=this._style._mergedLayers[this._style.order[p]],v=this._style.getLayerSourceCache(y);if(!v||l[v.id]||y.isHidden(this.painter.transform.zoom)||y.type!=="raster")continue;const w=y.paint.get("raster-fade-duration");for(const S of this.proxyCoords){const C=this.proxyToSource[S.key][v.id];if(C)for(const D of C){const L=qu(v.getTile(D),v.findLoadedParent(D,0),v,this.painter.transform,w);(L.opacity!==1||L.mix!==0)&&this._clearRenderCacheForTile(v.id,D)}}}}_setupDrapedRenderBatches(){this._style.updateDrapeFirstLayers();const i=this._style.order,l=i.length;if(l===0)return;const p=[];this._pendingGroundEffectLayers=[];let y,v=0,w=this._style._mergedLayers[i[v]];for(;!this._style.isLayerDraped(w)&&w.isHidden(this.painter.transform.zoom)&&++v<l;)w=this._style._mergedLayers[i[v]];for(;v<l;++v){const S=this._style._mergedLayers[i[v]];S.isHidden(this.painter.transform.zoom)||(this._style.isLayerDraped(S)?y===void 0&&(y=v):(S.type==="fill-extrusion"&&this._pendingGroundEffectLayers.push(v),y!==void 0&&(p.push({start:y,end:v-1}),y=void 0)))}if(y!==void 0&&p.push({start:y,end:v-1}),p.length!==0){const S=p[p.length-1];this._pendingGroundEffectLayers.every(C=>C>S.end)||s.w("fill-extrusion with flood lighting and/or ground ambient occlusion should be moved to be on top of all draped layers.")}this._drapedRenderBatches=p}_setupRenderCache(i){const l=this.proxySourceCache;if(this._shouldDisableRenderCache()||this.invalidateRenderCache){if(this.invalidateRenderCache=!1,l.renderCache.length>l.renderCachePool.length){const w=Object.values(l.proxyCachedFBO);l.proxyCachedFBO={};for(let S=0;S<w.length;++S){const C=Object.values(w[S]);l.renderCachePool.push(...C)}}return}this._clearRasterLayersFromRenderCache();const p=this.proxyCoords,y=this._tilesDirty;for(let w=p.length-1;w>=0;w--){const S=p[w];if(l.getTileByID(S.key),l.proxyCachedFBO[S.key]!==void 0){const C=i[S.key],D=this.proxyToSource[S.key];let L=0;for(const F in D){const O=D[F],$=C[F];if(!$||$.length!==O.length||O.some((q,W)=>q!==$[W]||y[F]&&y[F].hasOwnProperty(q.key))){L=-1;break}++L}for(const F in l.proxyCachedFBO[S.key])l.renderCache[l.proxyCachedFBO[S.key][F]].dirty=L<0||L!==Object.values(C).length}}const v=[...this._drapedRenderBatches];v.sort((w,S)=>S.end-S.start-(w.end-w.start));for(const w of v)for(const S of p){if(l.proxyCachedFBO[S.key])continue;let C=l.renderCachePool.pop();C===void 0&&l.renderCache.length<50&&(C=l.renderCache.length,l.renderCache.push(this._createFBO())),C!==void 0&&(l.proxyCachedFBO[S.key]={},l.proxyCachedFBO[S.key][w.start]=C,l.renderCache[C].dirty=!0)}this._tilesDirty={}}_setupStencil(i,l,p,y){if(!y||!this._sourceTilesOverlap[y.id])return void(this._overlapStencilType&&(this._overlapStencilType=!1));const v=this.painter.context,w=v.gl;if(l.length<=1)return void(this._overlapStencilType=!1);let S;if(p.isTileClipped())S=l.length,this._overlapStencilMode.test={func:w.EQUAL,mask:255},this._overlapStencilType="Clip";else{if(!(l[0].overscaledZ>l[l.length-1].overscaledZ))return void(this._overlapStencilType=!1);S=1,this._overlapStencilMode.test={func:w.GREATER,mask:255},this._overlapStencilType="Mask"}this._stencilRef+S>255&&(v.clear({stencil:0}),this._stencilRef=0),this._stencilRef+=S,this._overlapStencilMode.ref=this._stencilRef,p.isTileClipped()&&this._renderTileClippingMasks(l,this._overlapStencilMode.ref)}clipOrMaskOverlapStencilType(){return this._overlapStencilType==="Clip"||this._overlapStencilType==="Mask"}stencilModeForRTTOverlap(i){return this.renderingToTexture&&this._overlapStencilType?(this._overlapStencilType==="Clip"&&(this._overlapStencilMode.ref=this.painter._tileClippingMaskIDs[i.key]),this._overlapStencilMode):Ii.disabled}_renderTileClippingMasks(i,l){const p=this.painter,y=this.painter.context,v=y.gl;p._tileClippingMaskIDs={},y.setColorMode(en.disabled),y.setDepthMode(Gt.disabled);const w=p.getOrCreateProgram("clippingMask");for(const S of i){const C=p._tileClippingMaskIDs[S.key]=--l;w.draw(p,v.TRIANGLES,Gt.disabled,new Ii({func:v.ALWAYS,mask:0},C,255,v.KEEP,v.KEEP,v.REPLACE),en.disabled,Di.disabled,no(S.projMatrix),"$clipping",p.tileExtentBuffer,p.quadTriangleIndexBuffer,p.tileExtentSegments)}}pointCoordinate(i){const l=this.painter.transform;if(i.x<0||i.x>l.width||i.y<0||i.y>l.height)return null;const p=[i.x,i.y,1,1];s.aA(p,p,l.pixelMatrixInverse),s.cw(p,p,1/p[3]),p[0]/=l.worldSize,p[1]/=l.worldSize;const y=l._camera.position,v=s.c6(1,l.center.lat),w=[y[0],y[1],y[2]/v,0],S=s.cY([],p.slice(0,3),w);s.au(S,S);const C=this.raycast(w,S,this._exaggeration);return C!==null&&C?(s.bF(w,w,S,C),w[3]=w[2],w[2]*=v,w):null}_setupProxiedCoordsForOrtho(i,l,p){if(i.getSource()instanceof s.aP)return this._setupProxiedCoordsForImageSource(i,l,p);this._findCoveringTileCache[i.id]=this._findCoveringTileCache[i.id]||{};const y=this.proxiedCoords[i.id]=[],v=this.proxyCoords;for(let C=0;C<v.length;C++){const D=v[C],L=this._findTileCoveringTileID(D,i);if(L){const F=this._createProxiedId(D,L,p[D.key]&&p[D.key][i.id]);y.push(F),this.proxyToSource[D.key][i.id]=[F]}}let w=!1;const S=new Set;for(let C=0;C<l.length;C++){const D=i.getTile(l[C]);if(!D||!D.hasData())continue;const L=this._findTileCoveringTileID(D.tileID,this.proxySourceCache);if(L&&L.tileID.canonical.z!==D.tileID.canonical.z){const F=this.proxyToSource[L.tileID.key][i.id],O=this._createProxiedId(L.tileID,D,p[L.tileID.key]&&p[L.tileID.key][i.id]);F?F.splice(F.length-1,0,O):this.proxyToSource[L.tileID.key][i.id]=[O];const $=this.proxyToSource[L.tileID.key][i.id];S.has($)||S.add($),y.push(O),w=!0}}if(this._sourceTilesOverlap[i.id]=w,w&&this._debugParams.sortTilesHiZFirst)for(const C of S)C.sort((D,L)=>L.overscaledZ-D.overscaledZ)}
3232_setupProxiedCoordsForImageSource(i,l,p){if(!i.getSource().loaded())return;const y=this.proxiedCoords[i.id]=[],v=this.proxyCoords,w=i.getSource(),S=w.tileID;if(!S)return;const C=new s.P(S.x,S.y)._div(1<<S.z),D=w.coordinates.map(s.ac.fromLngLat).reduce((F,O)=>(F.min.x=Math.min(F.min.x,O.x-C.x),F.min.y=Math.min(F.min.y,O.y-C.y),F.max.x=Math.max(F.max.x,O.x-C.x),F.max.y=Math.max(F.max.y,O.y-C.y),F),{min:new s.P(Number.MAX_VALUE,Number.MAX_VALUE),max:new s.P(-Number.MAX_VALUE,-Number.MAX_VALUE)}),L=(F,O)=>{const $=F.wrap+F.canonical.x/(1<<F.canonical.z),q=F.canonical.y/(1<<F.canonical.z),W=s.aj/(1<<F.canonical.z),K=O.wrap+O.canonical.x/(1<<O.canonical.z),Z=O.canonical.y/(1<<O.canonical.z);return $+W<K+D.min.x||$>K+D.max.x||q+W<Z+D.min.y||q>Z+D.max.y};for(let F=0;F<v.length;F++){const O=v[F];for(let $=0;$<l.length;$++){const q=i.getTile(l[$]);if(!q||!q.hasData()||L(O,q.tileID))continue;const W=this._createProxiedId(O,q,p[O.key]&&p[O.key][i.id]),K=this.proxyToSource[O.key][i.id];K?K.push(W):this.proxyToSource[O.key][i.id]=[W],y.push(W)}}}_createProxiedId(i,l,p){let y=this.orthoMatrix;if(p){const v=p.find(w=>w.key===l.tileID.key);if(v)return v}if(l.tileID.key!==i.key){const v=i.canonical.z-l.tileID.canonical.z;let w,S,C;y=s.bz();const D=l.tileID.wrap-i.wrap<<i.overscaledZ;v>0?(w=s.aj>>v,S=w*((l.tileID.canonical.x<<v)-i.canonical.x+D),C=w*((l.tileID.canonical.y<<v)-i.canonical.y)):(w=s.aj<<-v,S=s.aj*(l.tileID.canonical.x-(i.canonical.x+D<<-v)),C=s.aj*(l.tileID.canonical.y-(i.canonical.y<<-v))),s.c5(y,0,w,0,w,0,1),s.bo(y,y,[S,C,0])}return new nd(l.tileID,i.key,y)}_findTileCoveringTileID(i,l){let p=l.getTile(i);if(p&&p.hasData())return p;const y=this._findCoveringTileCache[l.id],v=y[i.key];if(p=v?l.getTileByID(v):null,p&&p.hasData()||v===null)return p;let w=p?p.tileID:i,S=w.overscaledZ;const C=l.getSource().minzoom,D=[];if(!v){const F=l.getSource().maxzoom;if(i.canonical.z>=F){const O=i.canonical.z-F;l.getSource().reparseOverscaled?(S=Math.max(i.canonical.z+2,l.transform.tileZoom),w=new s.aM(S,i.wrap,F,i.canonical.x>>O,i.canonical.y>>O)):O!==0&&(S=F,w=new s.aM(S,i.wrap,F,i.canonical.x>>O,i.canonical.y>>O))}w.key!==i.key&&(D.push(w.key),p=l.getTile(w))}const L=F=>{D.forEach(O=>{y[O]=F}),D.length=0};for(S-=1;S>=C&&(!p||!p.hasData());S--){p&&L(p.tileID.key);const F=w.calculateScaledKey(S);if(p=l.getTileByID(F),p&&p.hasData())break;const O=y[F];if(O===null)break;O===void 0?D.push(F):p=l.getTileByID(O)}return L(p?p.tileID.key:null),p&&p.hasData()?p:null}findDEMTileFor(i){return this.enabled?this._findTileCoveringTileID(i,this.sourceCache):null}prepareDrawTile(){this.renderedToTile=!0}_clearRenderCacheForTile(i,l){let p=this._tilesDirty[i];p||(p=this._tilesDirty[i]={}),p[l.key]=!0}}function Af(f,i,l){const p=function(S,C,D){const L=s.bE(C,S),F=s.bE(D,[.2126,.7152,.0722]),O=(q,W,K)=>(1-K)*q+K*W,$=O(1-.3*Math.min(F,1),1,Math.min(L+1,1));return O(.92,1,Math.asin(s.aD(C[2],-1,1))/Math.PI+.5)*$}(f,[0,0,1],i),y=[0,0,0];s.b$(y,l.slice(0,3),p);const v=[0,0,0];s.b$(v,i.slice(0,3),f[2]);const w=[0,0,0];return s.cU(w,y,v),s.cX(w)}const rd=["fill","fillOutline","fillPattern","line","linePattern","background","backgroundPattern","hillshade","raster"],Cf=["stars","rainParticle","snowParticle","fillExtrusion","fillExtrusionGroundEffect","elevatedStructures","model","symbol"];class od{static cacheKey(i,l,p,y){let v=`${l}${y?y.cacheKey:""}`;for(const w of p)i.usedDefines.includes(w)&&(v+=`/${w}`);return v}constructor(i,l,p,y,v,w){const S=i.gl;this.program=S.createProgram(),this.configuration=y,this.name=l,this.fixedDefines=[...w];const C=y?y.getBinderAttributes():[],D=(p.staticAttributes||[]).concat(C);let L=y?y.defines():[];L=L.concat(w.map(K=>`#define ${K}`));const F=`#version 300 es 3233`;let O=F+L.concat("precision mediump float;",Kc,go.fragmentSource).join(` 3234`);for(const K of p.fragmentIncludes)O+=` 3235${ta[K]}`;O+=` 3236${p.fragmentSource}`;let $=F+L.concat("precision highp float;",Kc,go.vertexSource).join(` 3237`);for(const K of p.vertexIncludes)$+=` 3238${ta[K]}`;this.forceManualRenderingForInstanceIDShaders=i.forceManualRenderingForInstanceIDShaders&&p.vertexSource.indexOf("gl_InstanceID")!==-1,this.forceManualRenderingForInstanceIDShaders&&($+=` 3239uniform int u_instanceID; 3240`),$+=` 3241${p.vertexSource}`,this.forceManualRenderingForInstanceIDShaders&&($=$.replaceAll("gl_InstanceID","u_instanceID"));const q=S.createShader(S.FRAGMENT_SHADER);if(S.isContextLost())return void(this.failedToCreate=!0);S.shaderSource(q,O),S.compileShader(q),S.attachShader(this.program,q);const W=S.createShader(S.VERTEX_SHADER);if(S.isContextLost())this.failedToCreate=!0;else{S.shaderSource(W,$),S.compileShader(W),S.attachShader(this.program,W),this.attributes={},this.numAttributes=D.length;for(let K=0;K<this.numAttributes;K++)if(D[K]){const Z=D[K].startsWith("a_")?D[K]:`a_${D[K]}`;S.bindAttribLocation(this.program,K,Z),this.attributes[Z]=K}S.linkProgram(this.program),S.deleteShader(W),S.deleteShader(q),this.fixedUniforms=v(i),this.binderUniforms=y?y.getUniforms(i):[],this.forceManualRenderingForInstanceIDShaders&&(this.instancingUniforms=(K=>({u_instanceID:new s.cc(K)}))(i)),(w.includes("TERRAIN")||l.indexOf("symbol")!==-1||l.indexOf("circle")!==-1)&&(this.terrainUniforms=(K=>({u_dem:new s.cc(K),u_dem_prev:new s.cc(K),u_dem_tl:new s.c9(K),u_dem_scale:new s.cb(K),u_dem_tl_prev:new s.c9(K),u_dem_scale_prev:new s.cb(K),u_dem_size:new s.cb(K),u_dem_lerp:new s.cb(K),u_exaggeration:new s.cb(K),u_depth:new s.cc(K),u_depth_size_inv:new s.c9(K),u_depth_range_unpack:new s.c9(K),u_occluder_half_size:new s.cb(K),u_occlusion_depth_offset:new s.cb(K),u_meter_to_dem:new s.cb(K),u_label_plane_matrix_inv:new s.c8(K)}))(i)),w.includes("GLOBE")&&(this.globeUniforms=(K=>({u_tile_tl_up:new s.ca(K),u_tile_tr_up:new s.ca(K),u_tile_br_up:new s.ca(K),u_tile_bl_up:new s.ca(K),u_tile_up_scale:new s.cb(K)}))(i)),w.includes("FOG")&&(this.fogUniforms=(K=>({u_fog_matrix:new s.c8(K),u_fog_range:new s.c9(K),u_fog_color:new s.cQ(K),u_fog_horizon_blend:new s.cb(K),u_fog_vertical_limit:new s.c9(K),u_fog_temporal_offset:new s.cb(K),u_frustum_tl:new s.ca(K),u_frustum_tr:new s.ca(K),u_frustum_br:new s.ca(K),u_frustum_bl:new s.ca(K),u_globe_pos:new s.ca(K),u_globe_radius:new s.cb(K),u_globe_transition:new s.cb(K),u_is_globe:new s.cc(K),u_viewport:new s.c9(K)}))(i)),w.includes("RENDER_CUTOFF")&&(this.cutoffUniforms=(K=>({u_cutoff_params:new s.cQ(K)}))(i)),w.includes("LIGHTING_3D_MODE")&&(this.lightsUniforms=(K=>({u_lighting_ambient_color:new s.ca(K),u_lighting_directional_dir:new s.ca(K),u_lighting_directional_color:new s.ca(K),u_ground_radiance:new s.ca(K)}))(i)),w.includes("RENDER_SHADOWS")&&(this.shadowUniforms=(K=>({u_light_matrix_0:new s.c8(K),u_light_matrix_1:new s.c8(K),u_fade_range:new s.c9(K),u_shadow_normal_offset:new s.ca(K),u_shadow_intensity:new s.cb(K),u_shadow_texel_size:new s.cb(K),u_shadow_map_resolution:new s.cb(K),u_shadow_direction:new s.ca(K),u_shadow_bias:new s.ca(K),u_shadowmap_0:new s.cc(K),u_shadowmap_1:new s.cc(K)}))(i))}}setTerrainUniformValues(i,l){if(!this.terrainUniforms)return;const p=this.terrainUniforms;if(!this.failedToCreate){i.program.set(this.program);for(const y in l)p[y]&&p[y].set(this.program,y,l[y])}}setGlobeUniformValues(i,l){if(!this.globeUniforms)return;const p=this.globeUniforms;if(!this.failedToCreate){i.program.set(this.program);for(const y in l)p[y]&&p[y].set(this.program,y,l[y])}}setFogUniformValues(i,l){if(!this.fogUniforms)return;const p=this.fogUniforms;if(!this.failedToCreate){i.program.set(this.program);for(const y in l)p[y].set(this.program,y,l[y])}}setCutoffUniformValues(i,l){if(!this.cutoffUniforms)return;const p=this.cutoffUniforms;if(!this.failedToCreate){i.program.set(this.program);for(const y in l)p[y].set(this.program,y,l[y])}}setLightsUniformValues(i,l){if(!this.lightsUniforms)return;const p=this.lightsUniforms;if(!this.failedToCreate){i.program.set(this.program);for(const y in l)p[y].set(this.program,y,l[y])}}setShadowUniformValues(i,l){if(this.failedToCreate||!this.shadowUniforms)return;const p=this.shadowUniforms;i.program.set(this.program);for(const y in l)p[y].set(this.program,y,l[y])}_drawDebugWireframe(i,l,p,y,v,w,S,C,D,L){const F=i.options.wireframe;if(F.terrain===!1&&F.layers2D===!1&&F.layers3D===!1)return;const O=i.context;
3241if(!(!(!F.terrain||this.name!=="terrainRaster"&&this.name!=="globeRaster")||!(!F.layers2D||i._terrain&&i._terrain.renderingToTexture||!rd.includes(this.name))||!(!F.layers3D||!Cf.includes(this.name))))return;const $=O.gl,q=i.wireframeDebugCache.getLinesFromTrianglesBuffer(i.frameCounter,v,O);if(!q)return;const W=[...this.fixedDefines];W.push("DEBUG_WIREFRAME");const K=i.getOrCreateProgram(this.name,{config:this.configuration,defines:W});O.program.set(K.program);const Z=(fe,xe,_e)=>{if(xe[fe]&&_e[fe])for(const ye in xe[fe])_e[fe][ye]&&_e[fe][ye].set(_e.program,ye,xe[fe][ye].current)};D&&D.setUniforms(K.program,O,K.binderUniforms,S,{zoom:C}),Z("fixedUniforms",this,K),Z("terrainUniforms",this,K),Z("globeUniforms",this,K),Z("fogUniforms",this,K),Z("lightsUniforms",this,K),Z("shadowUniforms",this,K),q.bind(),O.setColorMode(new en([$.ONE,$.ONE_MINUS_SRC_ALPHA,$.ZERO,$.ONE],s.am.transparent,[!0,!0,!0,!1])),O.setDepthMode(new Gt(l.func===$.LESS?$.LEQUAL:l.func,Gt.ReadOnly,l.range)),O.setStencilMode(Ii.disabled);const se=3*w.primitiveLength*2,ue=3*w.primitiveOffset*2*2;if(this.forceManualRenderingForInstanceIDShaders){const fe=L||1;for(let xe=0;xe<fe;++xe)K.instancingUniforms.u_instanceID.set(this.program,"u_instanceID",xe),$.drawElements($.LINES,se,$.UNSIGNED_SHORT,ue)}else L&&L>1?$.drawElementsInstanced($.LINES,se,$.UNSIGNED_SHORT,ue,L):$.drawElements($.LINES,se,$.UNSIGNED_SHORT,ue);v.bind(),O.program.set(this.program),O.setDepthMode(l),O.setStencilMode(p),O.setColorMode(y)}checkUniforms(i,l,p){if(this.fixedDefines.includes(l)){for(const y of Object.keys(p))if(!p[y].initialized)throw new Error(`Program '${this.name}', from draw '${i}': uniform ${y} not set but required by ${l} being defined`)}}draw(i,l,p,y,v,w,S,C,D,L,F,O,$,q,W,K){const Z=i.context,se=Z.gl;if(this.failedToCreate)return;Z.program.set(this.program),Z.setDepthMode(p),Z.setStencilMode(y),Z.setColorMode(v),Z.setCullFace(w);for(const xe of Object.keys(this.fixedUniforms))this.fixedUniforms[xe].set(this.program,xe,S[xe]);q&&q.setUniforms(this.program,Z,this.binderUniforms,O,{zoom:$});const ue={[se.POINTS]:1,[se.LINES]:2,[se.TRIANGLES]:3,[se.LINE_STRIP]:1}[l];this.checkUniforms(C,"RENDER_SHADOWS",this.shadowUniforms);const fe=K&&K>0?1:void 0;for(const xe of F.get()){const _e=xe.vaos||(xe.vaos={});if((_e[C]||(_e[C]=new yf)).bind(Z,this,D,q?q.getPaintVertexBuffers():[],L,xe.vertexOffset,W||[],fe),this.forceManualRenderingForInstanceIDShaders){const ye=K||1;for(let pe=0;pe<ye;++pe)this.instancingUniforms.u_instanceID.set(this.program,"u_instanceID",pe),L?se.drawElements(l,xe.primitiveLength*ue,se.UNSIGNED_SHORT,xe.primitiveOffset*ue*2):se.drawArrays(l,xe.vertexOffset,xe.vertexLength)}else K&&K>1?se.drawElementsInstanced(l,xe.primitiveLength*ue,se.UNSIGNED_SHORT,xe.primitiveOffset*ue*2,K):L?se.drawElements(l,xe.primitiveLength*ue,se.UNSIGNED_SHORT,xe.primitiveOffset*ue*2):se.drawArrays(l,xe.vertexOffset,xe.vertexLength);l===se.TRIANGLES&&L&&this._drawDebugWireframe(i,p,y,v,L,xe,O,$,q,K)}}}function Zu(f,i,l=0){const p=Math.pow(2,i.tileID.overscaledZ),y=i.tileSize*Math.pow(2,f.transform.tileZoom)/p,v=y*(i.tileID.canonical.x+i.tileID.wrap*p),w=y*i.tileID.canonical.y;return{u_image:0,u_texsize:i.imageAtlasTexture?i.imageAtlasTexture.size:[0,0],u_tile_units_to_pixels:1/s.aw(i,1,f.transform.tileZoom),u_pixel_coord_upper:[v>>16,w>>16],u_pixel_coord_lower:[65535&v,65535&w],u_pattern_transition:l}}const Xu={terrain:0,flat:1},If=s.bz(),Fa=(f,i,l,p,y,v,w,S,C,D,L,F,O,$,q,W,K,Z)=>{const se=i.style.light,ue=se.properties.get("position"),fe=[ue.x,ue.y,ue.z],xe=s.dx();se.properties.get("anchor")==="viewport"&&(s.dy(xe,-i.transform.angle),s.dz(fe,fe,xe));const _e=se.properties.get("color"),ye=i.transform,pe={u_matrix:f,u_lightpos:fe,u_lightintensity:se.properties.get("intensity"),u_lightcolor:[_e.r,_e.g,_e.b],u_vertical_gradient:+l,u_opacity:p,u_tile_id:[0,0,0],u_zoom_transition:0,u_inv_rot_matrix:If,u_merc_center:[0,0],u_up_dir:[0,0,0],u_height_lift:0,u_height_type:Xu[D],u_base_type:Xu[L],u_ao:y,u_edge_radius:v,u_width_scale:w,u_flood_light_color:q,u_vertical_scale:W,u_flood_light_intensity:K,u_ground_shadow_factor:Z};return ye.projection.name==="globe"&&(pe.u_tile_id=[S.canonical.x,S.canonical.y,1<<S.canonical.z],pe.u_zoom_transition=F,pe.u_inv_rot_matrix=$,pe.u_merc_center=O,pe.u_up_dir=ye.projection.upVector(new s.cp(0,0,0),O[0]*s.aj,O[1]*s.aj),pe.u_height_lift=C),pe},ad=(f,i,l,p,y,v)=>({u_matrix:f,u_edge_radius:i,u_width_scale:l,u_vertical_scale:p,u_height_type:Xu[y],u_base_type:Xu[v]}),Dg=(f,i,l,p,y,v,w,S,C,D,L,F,O,$,q,W,K,Z)=>{const se=Fa(f,i,l,p,y,v,w,S,D,L,F,O,$,q,W,K,1,[0,0,0]),ue={u_height_factor:-Math.pow(2,S.overscaledZ
3241)/C.tileSize/8};return s.l(se,Zu(i,C,Z),ue)},sm=(f,i,l)=>({u_matrix:f,u_emissive_strength:i,u_ground_shadow_factor:l}),iu=(f,i,l,p,y,v=0)=>s.l(sm(f,i,y),Zu(l,p,v)),ce=(f,i,l,p)=>({u_matrix:f,u_world:l,u_emissive_strength:i,u_ground_shadow_factor:p}),z=(f,i,l,p,y,v,w=0)=>s.l(iu(f,i,l,p,v,w),{u_world:y}),ee=(f,i)=>({u_matrix:f,u_ground_shadow_factor:i}),we=(f,i,l,p,y)=>({u_matrix:f,u_camera_pos:[i[0],i[1],i[2]],u_depth_bias:l,u_height_scale:p,u_reset_depth:y}),ot=(f,i,l,p)=>{const y=s.aj/l.tileSize;return{u_matrix:f,u_camera_to_center_distance:i.getCameraToCenterDistance(p),u_extrude_scale:[i.pixelsToGLUnits[0]/y,i.pixelsToGLUnits[1]/y]}},at=(f,i,l=1)=>({u_matrix:f,u_color:i.toRenderColor(null),u_overlay:0,u_overlay_scale:l}),Ot=s.bz(),ii=(f,i,l,p,y,v,w)=>{const S=f.transform,C=S.projection.name==="globe",D=C?s.dA(S.zoom,i.canonical)*S._pixelsPerMercatorPixel:s.aw(l,1,v),L={u_matrix:i.projMatrix,u_extrude_scale:D,u_intensity:w,u_inv_rot_matrix:Ot,u_merc_center:[0,0],u_tile_id:[0,0,0],u_zoom_transition:0,u_up_dir:[0,0,0]};if(C){L.u_inv_rot_matrix=p,L.u_merc_center=y,L.u_tile_id=[i.canonical.x,i.canonical.y,1<<i.canonical.z],L.u_zoom_transition=s.ah(S.zoom);const F=y[0]*s.aj,O=y[1]*s.aj;L.u_up_dir=S.projection.upVector(new s.cp(0,0,0),F,O)}return L};function Si(f,[i,l,p,y],[v,w]){if(v===w)return[0,0,0,0];const S=255*(f-1)/(f*(w-v));return[i*S,l*S,p*S,y*S]}function Wi(f,i,[l,p]){return l===p?0:.5/f+(i-l)*(f-1)/(f*(p-l))}const Ui=(f,i,l,p,y,v,w,S,C,D,L,F,O,$,q,W,K,Z,se,ue,fe)=>({u_matrix:f,u_normalize_matrix:i,u_globe_matrix:l,u_merc_matrix:p,u_grid_matrix:y,u_tl_parent:v,u_scale_parent:D,u_fade_t:L.mix,u_opacity:L.opacity*F.paint.get("raster-opacity"),u_image0:0,u_image1:1,u_brightness_low:F.paint.get("raster-brightness-min"),u_brightness_high:F.paint.get("raster-brightness-max"),u_saturation_factor:s.dB(F.paint.get("raster-saturation")),u_contrast_factor:s.dC(F.paint.get("raster-contrast")),u_spin_weights:$i(F.paint.get("raster-hue-rotate")),u_perspective_transform:O,u_raster_elevation:$,u_zoom_transition:w,u_merc_center:S,u_cutoff_params:C,u_colorization_mix:Si(s.dD,W,Z),u_colorization_offset:Wi(s.dD,K,Z),u_color_ramp:q,u_texture_offset:[ue/(se+2*ue),se/(se+2*ue)],u_texture_res:[se+2*ue,se+2*ue],u_emissive_strength:fe});function $i(f){f*=Math.PI/180;const i=Math.sin(f),l=Math.cos(f);return[(2*l+1)/3,(-Math.sqrt(3)*i-l+1)/3,(Math.sqrt(3)*i-l+1)/3]}const xn=.05,wn=(f,i,l,p,y,v,w,S,C,D,L,F)=>({u_matrix:f,u_normalize_matrix:i,u_globe_matrix:l,u_merc_matrix:p,u_grid_matrix:y,u_tl_parent:v,u_scale_parent:D,u_fade_t:L.mix,u_opacity:L.opacity,u_image0:0,u_image1:1,u_raster_elevation:F,u_zoom_transition:w,u_merc_center:S,u_cutoff_params:C}),kn=(f,i,l,p,y,v,w,S,C,D)=>({u_particle_texture:f,u_particle_texture_side_len:i,u_tile_offset:l,u_velocity:p,u_color_ramp:v,u_velocity_res:y,u_max_speed:w,u_uv_offset:S,u_data_scale:[255*C[0],255*C[1]],u_data_offset:D,u_particle_pos_scale:1.1,u_particle_pos_offset:[xn,xn]}),Ln=(f,i,l,p,y,v,w,S,C,D)=>({u_particle_texture:f,u_particle_texture_side_len:i,u_velocity:l,u_velocity_res:p,u_max_speed:y,u_speed_factor:v,u_reset_rate:w,u_rand_seed:Math.random(),u_uv_offset:S,u_data_scale:[255*C[0],255*C[1]],u_data_offset:D,u_particle_pos_scale:1.1,u_particle_pos_offset:[xn,xn]}),Fn=s.bz(),Ns=(f,i,l,p,y,v,w,S,C,D,L,F,O,$,q,W,K,Z,se,ue,fe,xe,_e)=>{const ye=y.transform,pe={u_is_size_zoom_constant:+(f==="constant"||f==="source"),u_is_size_feature_constant:+(f==="constant"||f==="camera"),u_size_t:i?i.uSizeT:0,u_size:i?i.uSize:0,u_camera_to_center_distance:ye.getCameraToCenterDistance(se),u_rotate_symbol:+l,u_aspect_ratio:ye.width/ye.height,u_fade_change:y.options.fadeDuration?y.symbolFadeChange:1,u_matrix:v,u_label_plane_matrix:w,u_coord_matrix:S,u_is_text:+D,u_elevation_from_sea:C?1:0,u_pitch_with_map:+p,u_texsize:L,u_texsize_icon:F,u_texture:0,u_texture_icon:1,u_tile_id:[0,0,0],u_zoom_transition:0,u_inv_rot_matrix:Fn,u_merc_center:[0,0],u_camera_forward:[0,0,0],u_ecef_origin:[0,0,0],u_tile_matrix:Fn,u_up_vector:[0,-1,0],u_color_adj_mat:fe,u_icon_transition:xe||0,u_gamma_scale:p?y.transform.getCameraToCenterDistance(se)*Math.cos(y.terrain?0:y.transform._pitch):1,u_device_pixel_ratio:s.q.devicePixelRatio,u_is_halo:1,u_scale_factor:_e||1,u_ground_shadow_factor:ue,u_inv_matrix:s.bi(s.bz(),w)};return se.name==="globe"&&(pe.u_tile_id=[$.canonical.x,$.canonical.y,1<<$.canonical.z],pe.u_zoom_transition=q,pe.u_inv_rot_matrix=K,pe.u_merc_center=W,pe.u_camera_forward=ye._camera.forward(),pe.u_ecef_origin=s.dE(ye.globeMatrix,$.toUnwrapped()),pe.u_tile_matrix=Float32Array.from(ye.globeMatrix),pe.u_up_vector=Z),pe},Gs=(f,i,l,p)=>({u_matrix:f,u_emissive_strength:i,u_opacity:l,u_color:p}),os=(f,i,l,p,y,v,w,S,C)=>s.l(function(D,L,F,O,$,q){const{width:W,height:K}=O.imageManager.getPixelSize(L),Z=Math.pow(2,q.tileID.overscaledZ
3241),se=q.tileSize*Math.pow(2,O.transform.tileZoom)/Z,ue=se*(q.tileID.canonical.x+q.tileID.wrap*Z),fe=se*q.tileID.canonical.y;return{u_image:0,u_pattern_tl:F.tl,u_pattern_br:F.br,u_texsize:[W,K],u_pattern_size:F.displaySize,u_pattern_units_to_pixels:$?[O.transform.width,-1*O.transform.height]:[1/s.aw(q,1,O.transform.tileZoom),1/s.aw(q,1,O.transform.tileZoom)],u_pixel_coord_upper:[ue>>16,fe>>16],u_pixel_coord_lower:[65535&ue,65535&fe]}}(0,v,w,p,S,C),{u_matrix:f,u_emissive_strength:i,u_opacity:l}),As=new Float32Array(s.bx([])),Bn=(f,i,l,p,y,v,w,S,C,D,L,F,O,$=[0,0,0],q)=>{const W=y.style.light,K=W.properties.get("position"),Z=[-K.x,-K.y,K.z],se=s.dx();W.properties.get("anchor")==="viewport"&&(s.dy(se,-y.transform.angle),s.dz(Z,Z,se));const ue=L.alphaMode==="MASK",fe=W.properties.get("color").toRenderColor(null),xe=O.paint.get("model-ambient-occlusion-intensity"),_e=O.paint.get("model-color").constantOr(s.am.white).toRenderColor(null),ye=O.paint.get("model-color-mix-intensity").constantOr(0);return{u_matrix:f,u_lighting_matrix:i,u_normal_matrix:l,u_node_matrix:p||As,u_lightpos:Z,u_lightintensity:W.properties.get("intensity"),u_lightcolor:[fe.r,fe.g,fe.b],u_camera_pos:$,u_opacity:v,u_baseTextureIsAlpha:0,u_alphaMask:+ue,u_alphaCutoff:L.alphaCutoff,u_baseColorFactor:[w.r,w.g,w.b,w.a],u_emissiveFactor:[S[0],S[1],S[2],1],u_metallicFactor:C,u_roughnessFactor:D,u_baseColorTexture:mo.BaseColor,u_metallicRoughnessTexture:mo.MetallicRoughness,u_normalTexture:mo.Normal,u_occlusionTexture:mo.Occlusion,u_emissionTexture:mo.Emission,u_lutTexture:mo.LUT,u_color_mix:[_e.r,_e.g,_e.b,ye],u_aoIntensity:xe,u_emissive_strength:F,u_occlusionTextureTransform:q||[0,0,0,0]}},ms=(f,i=As,l=As)=>({u_matrix:f,u_instance:i,u_node_matrix:l}),Ws={fillExtrusion:f=>({u_matrix:new s.c8(f),u_lightpos:new s.ca(f),u_lightintensity:new s.cb(f),u_lightcolor:new s.ca(f),u_vertical_gradient:new s.cb(f),u_opacity:new s.cb(f),u_edge_radius:new s.cb(f),u_width_scale:new s.cb(f),u_ao:new s.c9(f),u_height_type:new s.cc(f),u_base_type:new s.cc(f),u_tile_id:new s.ca(f),u_zoom_transition:new s.cb(f),u_inv_rot_matrix:new s.c8(f),u_merc_center:new s.c9(f),u_up_dir:new s.ca(f),u_height_lift:new s.cb(f),u_flood_light_color:new s.ca(f),u_vertical_scale:new s.cb(f),u_flood_light_intensity:new s.cb(f),u_ground_shadow_factor:new s.ca(f)}),fillExtrusionDepth:f=>({u_matrix:new s.c8(f),u_edge_radius:new s.cb(f),u_width_scale:new s.cb(f),u_vertical_scale:new s.cb(f),u_height_type:new s.cc(f),u_base_type:new s.cc(f)}),fillExtrusionPattern:f=>({u_matrix:new s.c8(f),u_lightpos:new s.ca(f),u_lightintensity:new s.cb(f),u_lightcolor:new s.ca(f),u_vertical_gradient:new s.cb(f),u_height_factor:new s.cb(f),u_edge_radius:new s.cb(f),u_width_scale:new s.cb(f),u_ao:new s.c9(f),u_height_type:new s.cc(f),u_base_type:new s.cc(f),u_tile_id:new s.ca(f),u_zoom_transition:new s.cb(f),u_inv_rot_matrix:new s.c8(f),u_merc_center:new s.c9(f),u_up_dir:new s.ca(f),u_height_lift:new s.cb(f),u_image:new s.cc(f),u_texsize:new s.c9(f),u_pixel_coord_upper:new s.c9(f),u_pixel_coord_lower:new s.c9(f),u_tile_units_to_pixels:new s.cb(f),u_opacity:new s.cb(f),u_pattern_transition:new s.cb(f)}),fillExtrusionGroundEffect:f=>({u_matrix:new s.c8(f),u_opacity:new s.cb(f),u_ao_pass:new s.cb(f),u_meter_to_tile:new s.cb(f),u_ao:new s.c9(f),u_flood_light_intensity:new s.cb(f),u_flood_light_color:new s.ca(f),u_attenuation:new s.cb(f),u_edge_radius:new s.cb(f),u_fb:new s.cc(f),u_fb_size:new s.cb(f),u_dynamic_offset:new s.cb(f)}),fill:f=>({u_matrix:new s.c8(f),u_emissive_strength:new s.cb(f),u_ground_shadow_factor:new s.ca(f)}),fillPattern:f=>({u_matrix:new s.c8(f),u_emissive_strength:new s.cb(f),u_image:new s.cc(f),u_texsize:new s.c9(f),u_pixel_coord_upper:new s.c9(f),u_pixel_coord_lower:new s.c9(f),u_tile_units_to_pixels:new s.cb(f),u_ground_shadow_factor:new s.ca(f),u_pattern_transition:new s.cb(f)}),fillOutline:f=>({u_matrix:new s.c8(f),u_emissive_strength:new s.cb(f),u_world:new s.c9(f),u_ground_shadow_factor:new s.ca(f)}),fillOutlinePattern:f=>({u_matrix:new s.c8(f),u_emissive_strength:new s.cb(f),u_world:new s.c9(f),u_image:new s.cc(f),u_texsize:new s.c9(f),u_pixel_coord_upper:new s.c9(f),u_pixel_coord_lower:new s.c9(f),u_tile_units_to_pixels:new s.cb(f),u_ground_shadow_factor:new s.ca(f),u_pattern_transition:new s.cb(f)}),building:f=>({u_matrix:new s.c8(f),u_normal_matrix:new s.c8(f),u_opacity:new s.cb(f)}),buildingDepth:f=>({u_matrix:new s.c8(f)}),elevatedStructuresDepth:f=>({u_matrix:new s.c8(f),u_depth_bias:new s.cb(f)}),elevatedStructures:f=>({u_matrix:new s.c8(f),u_ground_shadow_factor:new s.ca(f)}),elevatedStructuresDepthReconstruct:f=>({u_matrix:new s.c8(f),u_camera_pos:new s.ca(f),u_depth_bias:new s.cb(f),u_height_scale:new s.cb(f),u_reset_depth:new s.cb(f)}),circle:s.dF,collisionBox:f=>({u_matrix:new s.c8(f),u_camera_to_center_distance:new s.cb(f),u_extrude_scale:new s.c9(f)}
3241),collisionCircle:f=>({u_matrix:new s.c8(f),u_inv_matrix:new s.c8(f),u_camera_to_center_distance:new s.cb(f),u_viewport_size:new s.c9(f)}),debug:f=>({u_color:new s.di(f),u_matrix:new s.c8(f),u_overlay:new s.cc(f),u_overlay_scale:new s.cb(f)}),clippingMask:f=>({u_matrix:new s.c8(f)}),heatmap:f=>({u_extrude_scale:new s.cb(f),u_intensity:new s.cb(f),u_matrix:new s.c8(f),u_inv_rot_matrix:new s.c8(f),u_merc_center:new s.c9(f),u_tile_id:new s.ca(f),u_zoom_transition:new s.cb(f),u_up_dir:new s.ca(f)}),heatmapTexture:f=>({u_image:new s.cc(f),u_color_ramp:new s.cc(f),u_opacity:new s.cb(f)}),hillshade:f=>({u_matrix:new s.c8(f),u_image:new s.cc(f),u_latrange:new s.c9(f),u_light:new s.c9(f),u_shadow:new s.di(f),u_highlight:new s.di(f),u_emissive_strength:new s.cb(f),u_accent:new s.di(f)}),hillshadePrepare:f=>({u_matrix:new s.c8(f),u_image:new s.cc(f),u_dimension:new s.c9(f),u_zoom:new s.cb(f)}),line:s.dG,linePattern:s.dH,raster:f=>({u_matrix:new s.c8(f),u_normalize_matrix:new s.c8(f),u_globe_matrix:new s.c8(f),u_merc_matrix:new s.c8(f),u_grid_matrix:new s.dj(f),u_tl_parent:new s.c9(f),u_scale_parent:new s.cb(f),u_fade_t:new s.cb(f),u_opacity:new s.cb(f),u_image0:new s.cc(f),u_image1:new s.cc(f),u_brightness_low:new s.cb(f),u_brightness_high:new s.cb(f),u_saturation_factor:new s.cb(f),u_contrast_factor:new s.cb(f),u_spin_weights:new s.ca(f),u_perspective_transform:new s.c9(f),u_raster_elevation:new s.cb(f),u_zoom_transition:new s.cb(f),u_merc_center:new s.c9(f),u_cutoff_params:new s.cQ(f),u_colorization_mix:new s.cQ(f),u_colorization_offset:new s.cb(f),u_color_ramp:new s.cc(f),u_texture_offset:new s.c9(f),u_texture_res:new s.c9(f),u_emissive_strength:new s.cb(f)}),rasterParticle:f=>({u_matrix:new s.c8(f),u_normalize_matrix:new s.c8(f),u_globe_matrix:new s.c8(f),u_merc_matrix:new s.c8(f),u_grid_matrix:new s.dj(f),u_tl_parent:new s.c9(f),u_scale_parent:new s.cb(f),u_fade_t:new s.cb(f),u_opacity:new s.cb(f),u_image0:new s.cc(f),u_image1:new s.cc(f),u_raster_elevation:new s.cb(f),u_zoom_transition:new s.cb(f),u_merc_center:new s.c9(f),u_cutoff_params:new s.cQ(f)}),rasterParticleTexture:f=>({u_texture:new s.cc(f),u_opacity:new s.cb(f)}),rasterParticleDraw:f=>({u_particle_texture:new s.cc(f),u_particle_texture_side_len:new s.cb(f),u_tile_offset:new s.c9(f),u_velocity:new s.cc(f),u_color_ramp:new s.cc(f),u_velocity_res:new s.c9(f),u_max_speed:new s.cb(f),u_uv_offset:new s.c9(f),u_data_scale:new s.c9(f),u_data_offset:new s.cb(f),u_particle_pos_scale:new s.cb(f),u_particle_pos_offset:new s.c9(f)}),rasterParticleUpdate:f=>({u_particle_texture:new s.cc(f),u_particle_texture_side_len:new s.cb(f),u_velocity:new s.cc(f),u_velocity_res:new s.c9(f),u_max_speed:new s.cb(f),u_speed_factor:new s.cb(f),u_reset_rate:new s.cb(f),u_rand_seed:new s.cb(f),u_uv_offset:new s.c9(f),u_data_scale:new s.c9(f),u_data_offset:new s.cb(f),u_particle_pos_scale:new s.cb(f),u_particle_pos_offset:new s.c9(f)}),symbol:f=>({u_is_size_zoom_constant:new s.cc(f),u_is_size_feature_constant:new s.cc(f),u_size_t:new s.cb(f),u_size:new s.cb(f),u_camera_to_center_distance:new s.cb(f),u_rotate_symbol:new s.cc(f),u_aspect_ratio:new s.cb(f),u_fade_change:new s.cb(f),u_matrix:new s.c8(f),u_label_plane_matrix:new s.c8(f),u_coord_matrix:new s.c8(f),u_is_text:new s.cc(f),u_elevation_from_sea:new s.cc(f),u_pitch_with_map:new s.cc(f),u_texsize:new s.c9(f),u_texsize_icon:new s.c9(f),u_texture:new s.cc(f),u_texture_icon:new s.cc(f),u_gamma_scale:new s.cb(f),u_device_pixel_ratio:new s.cb(f),u_tile_id:new s.ca(f),u_zoom_transition:new s.cb(f),u_inv_rot_matrix:new s.c8(f),u_merc_center:new s.c9(f),u_camera_forward:new s.ca(f),u_tile_matrix:new s.c8(f),u_up_vector:new s.ca(f),u_ecef_origin:new s.ca(f),u_is_halo:new s.cc(f),u_icon_transition:new s.cb(f),u_color_adj_mat:new s.c8(f),u_scale_factor:new s.cb(f),u_ground_shadow_factor:new s.ca(f),u_inv_matrix:new s.c8(f)}),background:f=>({u_matrix:new s.c8(f),u_emissive_strength:new s.cb(f),u_opacity:new s.cb(f),u_color:new s.di(f)}),backgroundPattern:f=>({u_matrix:new s.c8(f),u_emissive_strength:new s.cb(f),u_opacity:new s.cb(f),u_image:new s.cc(f),u_pattern_tl:new s.c9(f),u_pattern_br:new s.c9(f),u_texsize:new s.c9(f),u_pattern_size:new s.c9(f),u_pixel_coord_upper:new s.c9(f),u_pixel_coord_lower:new s.c9(f),u_pattern_units_to_pixels:new s.c9(f)}
vendor: 5,087 bytes, line 3241
3241),terrainRaster:f=>({u_matrix:new s.c8(f),u_image0:new s.cc(f),u_skirt_height:new s.cb(f),u_ground_shadow_factor:new s.ca(f)}),skybox:f=>({u_matrix:new s.c8(f),u_sun_direction:new s.ca(f),u_cubemap:new s.cc(f),u_opacity:new s.cb(f),u_temporal_offset:new s.cb(f)}),skyboxGradient:f=>({u_matrix:new s.c8(f),u_color_ramp:new s.cc(f),u_center_direction:new s.ca(f),u_radius:new s.cb(f),u_opacity:new s.cb(f),u_temporal_offset:new s.cb(f)}),skyboxCapture:f=>({u_matrix_3f:new s.dj(f),u_sun_direction:new s.ca(f),u_sun_intensity:new s.cb(f),u_color_tint_r:new s.cQ(f),u_color_tint_m:new s.cQ(f),u_luminance:new s.cb(f)}),globeRaster:f=>({u_proj_matrix:new s.c8(f),u_globe_matrix:new s.c8(f),u_normalize_matrix:new s.c8(f),u_merc_matrix:new s.c8(f),u_zoom_transition:new s.cb(f),u_merc_center:new s.c9(f),u_image0:new s.cc(f),u_grid_matrix:new s.dj(f),u_skirt_height:new s.cb(f),u_far_z_cutoff:new s.cb(f),u_frustum_tl:new s.ca(f),u_frustum_tr:new s.ca(f),u_frustum_br:new s.ca(f),u_frustum_bl:new s.ca(f),u_globe_pos:new s.ca(f),u_globe_radius:new s.cb(f),u_viewport:new s.c9(f)}),globeAtmosphere:f=>({u_frustum_tl:new s.ca(f),u_frustum_tr:new s.ca(f),u_frustum_br:new s.ca(f),u_frustum_bl:new s.ca(f),u_horizon:new s.cb(f),u_transition:new s.cb(f),u_fadeout_range:new s.cb(f),u_color:new s.cQ(f),u_high_color:new s.cQ(f),u_space_color:new s.cQ(f),u_temporal_offset:new s.cb(f),u_horizon_angle:new s.cb(f)}),model:f=>({u_matrix:new s.c8(f),u_lighting_matrix:new s.c8(f),u_normal_matrix:new s.c8(f),u_node_matrix:new s.c8(f),u_lightpos:new s.ca(f),u_lightintensity:new s.cb(f),u_lightcolor:new s.ca(f),u_camera_pos:new s.ca(f),u_opacity:new s.cb(f),u_baseColorFactor:new s.cQ(f),u_emissiveFactor:new s.cQ(f),u_metallicFactor:new s.cb(f),u_roughnessFactor:new s.cb(f),u_baseTextureIsAlpha:new s.cc(f),u_alphaMask:new s.cc(f),u_alphaCutoff:new s.cb(f),u_baseColorTexture:new s.cc(f),u_metallicRoughnessTexture:new s.cc(f),u_normalTexture:new s.cc(f),u_occlusionTexture:new s.cc(f),u_emissionTexture:new s.cc(f),u_lutTexture:new s.cc(f),u_color_mix:new s.cQ(f),u_aoIntensity:new s.cb(f),u_emissive_strength:new s.cb(f),u_occlusionTextureTransform:new s.cQ(f)}),modelDepth:f=>({u_matrix:new s.c8(f),u_instance:new s.c8(f),u_node_matrix:new s.c8(f)}),groundShadow:f=>({u_matrix:new s.c8(f),u_ground_shadow_factor:new s.ca(f)}),stars:f=>({u_matrix:new s.c8(f),u_up:new s.ca(f),u_right:new s.ca(f),u_intensity_multiplier:new s.cb(f)}),snowParticle:f=>({u_modelview:new s.c8(f),u_projection:new s.c8(f),u_time:new s.cb(f),u_cam_pos:new s.ca(f),u_velocityConeAperture:new s.cb(f),u_velocity:new s.cb(f),u_horizontalOscillationRadius:new s.cb(f),u_horizontalOscillationRate:new s.cb(f),u_boxSize:new s.cb(f),u_billboardSize:new s.cb(f),u_simpleShapeParameters:new s.c9(f),u_screenSize:new s.c9(f),u_thinningCenterPos:new s.c9(f),u_thinningShape:new s.ca(f),u_thinningAffectedRatio:new s.cb(f),u_thinningParticleOffset:new s.cb(f),u_particleColor:new s.cQ(f),u_direction:new s.ca(f)}),rainParticle:f=>({u_modelview:new s.c8(f),u_projection:new s.c8(f),u_time:new s.cb(f),u_cam_pos:new s.ca(f),u_texScreen:new s.cc(f),u_velocityConeAperture:new s.cb(f),u_velocity:new s.cb(f),u_boxSize:new s.cb(f),u_rainDropletSize:new s.c9(f),u_distortionStrength:new s.cb(f),u_rainDirection:new s.ca(f),u_color:new s.cQ(f),u_screenSize:new s.c9(f),u_thinningCenterPos:new s.c9(f),u_thinningShape:new s.ca(f),u_thinningAffectedRatio:new s.cb(f),u_thinningParticleOffset:new s.cb(f),u_shapeDirectionalPower:new s.cb(f),u_shapeNormalPower:new s.cb(f),u_mode:new s.cb(f)}),vignette:f=>({u_vignetteShape:new s.ca(f),u_vignetteColor:new s.cQ(f)}),occlusion:f=>({u_matrix:new s.c8(f),u_anchorPos:new s.ca(f),u_screenSizePx:new s.c9(f),u_occluderSizePx:new s.c9(f),u_color:new s.cQ(f)})};class gs{constructor(i,l,p,y){this.id=gs.uniqueIdxCounter,gs.uniqueIdxCounter++,this.context=i;const v=i.gl;this.buffer=v.createBuffer(),this.dynamicDraw=!!p,this.context.unbindVAO(),i.bindElementBuffer.set(this.buffer),v.bufferData(v.ELEMENT_ARRAY_BUFFER,l.arrayBuffer,this.dynamicDraw?v.DYNAMIC_DRAW:v.STATIC_DRAW),this.dynamicDraw||y||l.destroy()}bind(){this.context.bindElementBuffer.set(this.buffer)}updateData(i){this.id=gs.uniqueIdxCounter,gs.uniqueIdxCounter++;const l=this.context.gl;this.context.unbindVAO(),this.bind(),l.bufferSubData(l.ELEMENT_ARRAY_BUFFER,0,i.arrayBuffer)}destroy(){this.buffer&&(this.context.gl.deleteBuffer(this.buffer),delete this.buffer)}}gs.uniqueIdxCounter=0;const qs={Int8:"BYTE",Uint8:"UNSIGNED_BYTE",Int16:"SHORT",Uint16:"UNSIGNED_SHORT",Int32:"INT",Uint32:"UNSIGNED_INT",Float32:"FLOAT"};class dr{constructor(i,l,p,y,v,w){this.length=l.length,this.attributes=p,this.itemSize=l.bytesPerElement,this.dynamicDraw=y,this.instanceCount=w,this.context=i;const S=i.gl;this.buffer=S.createBuffer(),i.bindVertexBuffer.set(this.buffer),S.bufferData(S.ARRAY_BUFFER,l.arrayBuffer,this.dynamicDraw?S.DYNAMIC_DRAW:S.STATIC_DRAW),this.dynamicDraw||v||l.destroy()}bind(){this.context.bindVertexBuffer.set(this.buffer)}updateData(i){const l=this.context.gl;this.bind(),l.bufferSubData(l.ARRAY_BUFFER,0,i.arrayBuffer)}
3241enableAttributes(i,l){for(let p=0;p<this.attributes.length;p++){const y=l.attributes[this.attributes[p].name];y!==void 0&&i.enableVertexAttribArray(y)}}setVertexAttribPointers(i,l,p){for(let y=0;y<this.attributes.length;y++){const v=this.attributes[y],w=l.attributes[v.name];w!==void 0&&i.vertexAttribPointer(w,v.components,i[qs[v.type]],!1,this.itemSize,v.offset+this.itemSize*(p||0))}}setVertexAttribDivisor(i,l,p){for(let y=0;y<this.attributes.length;y++){const v=l.attributes[this.attributes[y].name];v!==void 0&&this.instanceCount&&this.instanceCount>0&&i.vertexAttribDivisor(v,p)}}destroy(){this.buffer&&(this.context.gl.deleteBuffer(this.buffer),delete this.buffer)}}class _o{constructor(i,l,p,y,v){this.context=i,this.width=l,this.height=p;const w=this.framebuffer=i.gl.createFramebuffer();y&&(this.colorAttachment=new nm(i,w)),v&&(this.depthAttachmentType=v,this.depthAttachment=v==="renderbuffer"?new Qh(i,w):new ed(i,w))}destroy(){const i=this.context.gl;if(this.colorAttachment){const l=this.colorAttachment.get();l&&i.deleteTexture(l)}if(this.depthAttachment&&this.depthAttachmentType)if(this.depthAttachmentType==="renderbuffer"){const l=this.depthAttachment.get();l&&i.deleteRenderbuffer(l)}else{const l=this.depthAttachment.get();l&&i.deleteTexture(l)}i.deleteFramebuffer(this.framebuffer)}}class yo{constructor(i,l){this.gl=i,this.clearColor=new Xh(this),this.clearDepth=new Zp(this),this.clearStencil=new Xp(this),this.colorMask=new Qc(this),this.depthMask=new bf(this),this.stencilMask=new Yh(this),this.stencilFunc=new Mg(this),this.stencilOp=new Yp(this),this.stencilTest=new il(this),this.depthRange=new Kh(this),this.depthTest=new wf(this),this.depthFunc=new Ra(this),this.blend=new Uu(this),this.blendFunc=new Kp(this),this.blendColor=new xc(this),this.blendEquation=new Hu(this),this.cullFace=new nl(this),this.cullFaceSide=new eu(this),this.frontFace=new bc(this),this.program=new Jh(this),this.activeTexture=new Tf(this),this.viewport=new Jp(this),this.bindFramebuffer=new wc(this),this.bindRenderbuffer=new Oa(this),this.bindTexture=new Gu(this),this.bindVertexBuffer=new Qp(this),this.bindElementBuffer=new em(this),this.bindVertexArrayOES=new tm(this),this.pixelStoreUnpack=new tu(this),this.pixelStoreUnpackPremultiplyAlpha=new im(this),this.pixelStoreUnpackFlipY=new Pg(this),this.options=l?Object.assign({},l):{},this.options.extTextureFilterAnisotropicForceOff||(this.extTextureFilterAnisotropic=i.getExtension("EXT_texture_filter_anisotropic")||i.getExtension("MOZ_EXT_texture_filter_anisotropic")||i.getExtension("WEBKIT_EXT_texture_filter_anisotropic"),this.extTextureFilterAnisotropic&&(this.extTextureFilterAnisotropicMax=i.getParameter(this.extTextureFilterAnisotropic.MAX_TEXTURE_MAX_ANISOTROPY_EXT))),this.extDebugRendererInfo=i.getExtension("WEBGL_debug_renderer_info"),this.extDebugRendererInfo&&(this.renderer=i.getParameter(this.extDebugRendererInfo.UNMASKED_RENDERER_WEBGL),this.vendor=i.getParameter(this.extDebugRendererInfo.UNMASKED_VENDOR_WEBGL)),this.forceManualRenderingForInstanceIDShaders=l&&!!l.forceManualRenderingForInstanceIDShaders||this.renderer&&this.renderer.indexOf("PowerVR")!==-1,this.options.extTextureFloatLinearForceOff||(this.extTextureFloatLinear=i.getExtension("OES_texture_float_linear")),this.extRenderToTextureHalfFloat=i.getExtension("EXT_color_buffer_half_float"),this.extTimerQuery=i.getExtension("EXT_disjoint_timer_query_webgl2"),this.maxTextureSize=i.getParameter(i.MAX_TEXTURE_SIZE),this.maxPointSize=i.getParameter(i.ALIASED_POINT_SIZE_RANGE)[1]}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.bindVertexArrayOES.dirty=!0,this.pixelStoreUnpack.dirty=!0,this.pixelStoreUnpackPremultiplyAlpha.dirty=!0,this.pixelStoreUnpackFlipY.dirty=!0}createIndexBuffer(i,l,p){return new gs(this,i,l,p)}createVertexBuffer(i,l,p,y,v){return new dr(this,i,l,p,y,v)}createRenderbuffer(i,l,p){const y=this.gl,v=y.createRenderbuffer();return this.bindRenderbuffer.set(v),y.renderbufferStorage(y.RENDERBUFFER,i,l,p),this.bindRenderbuffer.set(null),v}createFramebuffer(i,l,p,y){return new _o(this,i,l,p,y)}clear({color:i,depth:l,stencil:p,colorMask:y}){const v=this.gl;let w=0;i&&(w|=v.COLOR_BUFFER_BIT,this.clearColor.set(i),this.colorMask.set(y||[!0,!0,!0,!0])),l!==void 0&&(w|=v.DEPTH_BUFFER_BIT,this.depthRange.set([0,1]),this.clearDepth.set(l),this.depthMask.set(!0)),p!==void 0&&(w|=v.STENCIL_BUFFER_BIT,this.clearStencil.set(p),this.stencilMask.set(255)),v.clear(w)}setCullFace(i){i.enable===!1?this.cullFace.set(!1):(this.cullFace.set(!0),this.cullFaceSide.set(i.mode),this.frontFace.set(i.frontFace))}setDepthMode(i){i.func!==this.gl.ALWAYS||i.mask?(this.depthTest.set(!0),this.depthFunc.set(i.func),this.depthMask.set(i.mask),this.depthRange.set(i.range)):this.depthTest.set(!1)}setStencilMode(i){i.test.func!==this.gl.ALWAYS||i.mask?(this.stencilTest.set(!0),this.stencilMask.set(i.mask),this.stencilOp.set([i.fail,i.depthFail,i.pass
3241]),this.stencilFunc.set({func:i.test.func,ref:i.ref,mask:i.test.mask})):this.stencilTest.set(!1)}setColorMode(i){s.bv(i.blendFunction,en.Replace)?this.blend.set(!1):(this.blend.set(!0),this.blendFunc.set(i.blendFunction),this.blendColor.set(i.blendColor),i.blendEquation?this.blendEquation.set(i.blendEquation):this.blendEquation.setDefault()),this.colorMask.set(i.mask)}unbindVAO(){this.bindVertexArrayOES.set(null)}}let Sr;function so(f,i,l,p,y,v,w){const S=f.context,C=S.gl,D=f.transform,L=f.getOrCreateProgram("collisionBox"),F=[];let O=0,$=0;for(let fe=0;fe<p.length;fe++){const xe=p[fe],_e=i.getTile(xe),ye=_e.getBucket(l);if(!ye)continue;const pe=zu(xe,ye,D);let Se=pe;y[0]===0&&y[1]===0||(Se=f.translatePosMatrix(pe,_e,y,v));const Ae=w?ye.textCollisionBox:ye.iconCollisionBox,Ge=ye.collisionCircleArray;if(Ge.length>0){const Ne=s.bz(),lt=Se;s.cB(Ne,ye.placementInvProjMatrix,D.glCoordMatrix),s.cB(Ne,Ne,ye.placementViewportMatrix),F.push({circleArray:Ge,circleOffset:$,transform:lt,invTransform:Ne,projection:ye.getProjection()}),O+=Ge.length/4,$=O}Ae&&(f.terrain&&f.terrain.setupElevationDraw(_e,L),L.draw(f,C.LINES,Gt.disabled,Ii.disabled,f.colorModeForRenderPass(),Di.disabled,ot(Se,D,_e,ye.getProjection()),l.id,Ae.layoutVertexBuffer,Ae.indexBuffer,Ae.segments,null,D.zoom,null,[Ae.collisionVertexBuffer,Ae.collisionVertexBufferExt]))}if(!w||!F.length)return;const q=f.getOrCreateProgram("collisionCircle"),W=new s.dI;W.resize(4*O),W._trim();let K=0;for(const fe of F)for(let xe=0;xe<fe.circleArray.length/4;xe++){const _e=4*xe,ye=fe.circleArray[_e+0],pe=fe.circleArray[_e+1],Se=fe.circleArray[_e+2],Ae=fe.circleArray[_e+3];W.emplace(K++,ye,pe,Se,Ae,0),W.emplace(K++,ye,pe,Se,Ae,1),W.emplace(K++,ye,pe,Se,Ae,2),W.emplace(K++,ye,pe,Se,Ae,3)}(!Sr||Sr.length<2*O)&&(Sr=function(fe){const xe=2*fe,_e=new s.a_;_e.resize(xe),_e._trim();for(let ye=0;ye<xe;ye++){const pe=6*ye;_e.uint16[pe+0]=4*ye+0,_e.uint16[pe+1]=4*ye+1,_e.uint16[pe+2]=4*ye+2,_e.uint16[pe+3]=4*ye+2,_e.uint16[pe+4]=4*ye+3,_e.uint16[pe+5]=4*ye+0}return _e}(O));const Z=S.createIndexBuffer(Sr,!0),se=S.createVertexBuffer(W,s.dJ.members,!0);for(const fe of F){const xe={u_matrix:fe.transform,u_inv_matrix:fe.invTransform,u_camera_to_center_distance:(ue=D).getCameraToCenterDistance(fe.projection),u_viewport_size:[ue.width,ue.height]};q.draw(f,C.TRIANGLES,Gt.disabled,Ii.disabled,f.colorModeForRenderPass(),Di.disabled,xe,l.id,se,Z,s.bd.simpleSegment(0,2*fe.circleOffset,fe.circleArray.length,fe.circleArray.length/2),null,D.zoom)}var ue;se.destroy(),Z.destroy()}const vo=s.bz();function nr(f){const i=f._camera.getWorldToCamera(f.worldSize,1),l=s.az([],i,f.globeMatrix);s.bi(l,l);const p=[0,0,0],y=[0,1,0,0];return s.aA(y,y,l),p[0]=y[0],p[1]=y[1],p[2]=y[2],s.au(p,p),p}function Wo({width:f,height:i,anchor:l,textOffset:p,textScale:y},v){const{horizontalAlign:w,verticalAlign:S}=s.bV(l),C=-(w-.5)*f,D=-(S-.5)*i,L=s.bU(l,p);return new s.P((C/y+L[0])*v,(D/y+L[1])*v)}function ia(f,i,l,p,y,v,w,S,C,D){const L=f.text.placedSymbolArray,F=f.text.dynamicLayoutVertexArray,O=f.icon.dynamicLayoutVertexArray,$={},q=f.getProjection(),W=Ll(w,q,y),K=y.elevation,Z=q.upVectorScale(w.canonical,y.center.lat,y.worldSize).metersToTile;F.clear();for(let se=0;se<L.length;se++){const ue=L.get(se),{tileAnchorX:fe,tileAnchorY:xe,numGlyphs:_e}=ue,ye=ue.hidden||!ue.crossTileID||f.allowVerticalPlacement&&!ue.placedOrientation?null:p[ue.crossTileID];if(ye){let pe=0,Se=0,Ae=0;if(K){const ht=K?K.getAtTileOffset(w,fe,xe):0,[Xe,gt,ct]=q.upVector(w.canonical,fe,xe);pe=ht*Xe*Z,Se=ht*gt*Z,Ae=ht*ct*Z}let[Ge,Ne,lt,st]=uo(ue.projectedAnchorX+pe,ue.projectedAnchorY+Se,ue.projectedAnchorZ+Ae,l?W:v);const Et=Qa(y.getCameraToCenterDistance(q),st);let Be=s.bJ(f.textSizeData,C,ue)*Et/s.bO;l&&(Be*=f.tilePixelRatio/S);const We=Wo(ye,Be);l?({x:Ge,y:Ne,z:lt}=q.projectTilePoint(fe+We.x,xe+We.y,w.canonical),[Ge,Ne,lt]=uo(Ge+pe,Ne+Se,lt+Ae,v)):(i&&We._rotate(-y.angle),Ge+=We.x,Ne+=We.y,lt=0);const Re=f.allowVerticalPlacement&&ue.placedOrientation===s.bI.vertical?Math.PI/2:0;for(let ht=0;ht<_e;ht++)s.bL(F,Ge,Ne,lt,Re);D&&ue.associatedIconIndex>=0&&($[ue.associatedIconIndex]={x:Ge,y:Ne,z:lt,angle:Re})}else Cn(_e,F)}if(D){O.clear();const se=f.icon.placedSymbolArray;for(let ue=0;ue<se.length;ue++){const fe=se.get(ue),{numGlyphs:xe}=fe,_e=$[ue];if(fe.hidden||!_e)Cn(xe,O);else{const{x:ye,y:pe,z:Se,angle:Ae}=_e;for(let Ge=0;Ge<xe;Ge++)s.bL(O,ye,pe,Se,Ae)}}f.icon.dynamicLayoutVertexBuffer.updateData(O)}f.text.dynamicLayoutVertexBuffer.updateData(F)}function rl(f,i,l,p,y,v,w={}){const S=l.paint.get("icon-translate"),C=l.paint.get("text-translate"),D=l.paint.get("icon-translate-anchor"),L=l.paint.get("text-translate-anchor"),F=l.layout.get("icon-rotation-alignment"),O=l.layout.get("text-rotation-alignment"),$=l.layout.get("icon-pitch-alignment"),q=l.layout.get("text-pitch-alignment"),W=l.layout.get("icon-keep-upright"),K=l.layout.get("text-keep-upright"),Z=l.paint.get("icon-color-saturation"),se=l.paint.get("icon-color-contrast"),ue=l.paint.get("icon-color-brightness-min"),fe=l.paint.get("icon-color-brightness-max"),xe=l.layout.get("symbol-elevation-reference")==="sea",_e=f.context,ye=_e.gl,pe=f.transform,Se=F==="map",Ae=O==="map",Ge=$==="map",Ne=q==="map",lt=l.layout.get("symbol-sort-key").constantOr(1)!==void 0;let st=!1;const Et=f.depthModeForSublayer(0,Gt.ReadOnly),Be=new Gt(f.context.gl.LEQUAL,Gt.ReadOnly,f.depthRangeFor3D),We=[s.ay(pe.center.lng),s.aH(pe.center.lat)],Re=l.layout.get("text-variable-anchor"),ht=pe.projection.name==="globe",Xe=[],gt=[0,-1,0];for(const ct of p){const yt=i.getTile(ct),xt=yt.getBucket(l);if(!xt||xt.projection.name==="mercator"&&ht||xt.fullyClipped)continue;const Qt=xt.projection.name==="globe",ci=Qt?s.ah(pe.zoom):0,Kt=Ll(ct,xt.getProjection(),pe),hi=
3241pe.calculatePixelsToTileUnitsMatrix(yt),ni=Re&&xt.hasTextData(),bi=xt.hasIconTextFit()&&ni&&xt.hasIconData(),Vi=xt.elevationType==="road"?Be:Et,un=xt.getProjection().createInversionMatrix(pe,ct.canonical),is=f.shadowRenderer,Zn=xt.elevationType==="road"&&!!is&&is.enabled;let dn=[0,0,0];if(Zn){const ks=f.style.directionalLight,tn=f.style.ambientLight;ks&&tn&&(dn=va(f.style,ks,tn))}const Zs=ks=>{pe.depthOcclusionForSymbolsAndCircles&&(l.hasInitialOcclusionOpacityProperties||f.terrain)&&(ks.push("DEPTH_D24"),ks.push("DEPTH_OCCLUSION"))},zs=()=>{const ks=Se&&l.layout.get("symbol-placement")!=="point",tn=[];Zs(tn);const Cs=ks||bi,In=l.paint.get("icon-image-cross-fade");f.terrainRenderModeElevated()&&Ge&&tn.push("PITCH_WITH_MAP_TERRAIN"),Qt&&(tn.push("PROJECTION_GLOBE_VIEW"),Cs&&tn.push("PROJECTED_POS_ON_VIEWPORT")),In>0&&tn.push("ICON_TRANSITION"),xt.icon.zOffsetVertexBuffer&&tn.push("Z_OFFSET"),Z===0&&se===0&&ue===0&&fe===1||tn.push("COLOR_ADJUSTMENT"),xt.sdfIcons&&tn.push("RENDER_SDF"),Zn&&tn.push("RENDER_SHADOWS","DEPTH_TEXTURE","NORMAL_OFFSET");const Is=xt.icon.programConfigurations.get(l.id),Nn=f.getOrCreateProgram("symbol",{config:Is,defines:tn}),Ls=yt.imageAtlasTexture?yt.imageAtlasTexture.size:[0,0],$r=xt.iconSizeData,_s=s.bH($r,pe.zoom),Zr=Ge||pe.pitch!==0,ar=Pl(Kt,yt.tileID.canonical,Ge,Se,pe,xt.getProjection(),hi),ro=hc(Kt,yt.tileID.canonical,Ge,Se,pe,xt.getProjection(),hi),fl=f.translatePosMatrix(ro,yt,S,D,!0),Ic=f.translatePosMatrix(Kt,yt,S,D),ra=Cs?vo:ar,$a=Se&&!Ge&&!ks;let ql=gt;!ht&&!pe.mercatorFromTransition||Se||(ql=nr(pe));const Zl=Qt?ql:gt,pl=l.getColorAdjustmentMatrix(Z,se,ue,fe),vd=Ns($r.kind,_s,$a,Ge,f,Ic,ra,fl,xe,!1,Ls,[0,0],!0,ct,ci,We,un,Zl,xt.getProjection(),dn,pl,In),oh=yt.imageAtlasTexture?yt.imageAtlasTexture:null,bm=l.layout.get("icon-size").constantOr(0)!==1||xt.iconsNeedLinear,wm=xt.sdfIcons||f.options.rotating||f.options.zooming||bm||Zr?ye.LINEAR:ye.NEAREST,Tm=xt.sdfIcons&&l.paint.get("icon-halo-width").constantOr(1)!==0,Hf=f.terrain&&Ge&&ks?s.bi(s.bz(),ar):vo;if(ks&&xt.icon){const Ms=pe.elevation,xd=Ms?Ms.getAtTileOffsetFunc(ct,pe.center.lat,pe.worldSize,xt.getProjection()):null,Jg=Lu(Kt,yt.tileID.canonical,Ge,Se,pe,xt.getProjection(),hi);Dl(xt,Kt,f,!1,Jg,ro,Ge,W,xd,ct)}return{program:Nn,buffers:xt.icon,uniformValues:vd,atlasTexture:oh,atlasTextureIcon:null,atlasInterpolation:wm,atlasInterpolationIcon:null,isSDF:xt.sdfIcons,hasHalo:Tm,depthMode:Vi,tile:yt,renderWithShadows:Zn,labelPlaneMatrixInv:Hf}},Zi=()=>{const ks=Ae&&l.layout.get("symbol-placement")!=="point",tn=[],Cs=ks||Re||bi;f.terrainRenderModeElevated()&&Ne&&tn.push("PITCH_WITH_MAP_TERRAIN"),Qt&&(tn.push("PROJECTION_GLOBE_VIEW"),Cs&&tn.push("PROJECTED_POS_ON_VIEWPORT")),xt.text.zOffsetVertexBuffer&&tn.push("Z_OFFSET"),xt.iconsInText&&tn.push("RENDER_TEXT_AND_SYMBOL"),tn.push("RENDER_SDF"),Zn&&tn.push("RENDER_SHADOWS","DEPTH_TEXTURE","NORMAL_OFFSET"),Zs(tn);const In=xt.text.programConfigurations.get(l.id),Is=f.getOrCreateProgram("symbol",{config:In,defines:tn});let Nn,Ls=[0,0],$r=null;const _s=xt.textSizeData;xt.iconsInText&&(Ls=yt.imageAtlasTexture?yt.imageAtlasTexture.size:[0,0],$r=yt.imageAtlasTexture?yt.imageAtlasTexture:null,Nn=Ne||pe.pitch!==0||f.options.rotating||f.options.zooming||_s.kind==="composite"||_s.kind==="camera"?ye.LINEAR:ye.NEAREST);const Zr=yt.glyphAtlasTexture?yt.glyphAtlasTexture.size:[0,0],ar=l.layout.get("text-size-scale-range"),ro=s.aD(f.scaleFactor,ar[0],ar[1]),fl=s.bH(_s,pe.zoom,ro),Ic=Pl(Kt,yt.tileID.canonical,Ne,Ae,pe,xt.getProjection(),hi),ra=hc(Kt,yt.tileID.canonical,Ne,Ae,pe,xt.getProjection(),hi),$a=f.translatePosMatrix(ra,yt,C,L,!0),ql=f.translatePosMatrix(Kt,yt,C,L),Zl=Cs?vo:Ic,pl=Ae&&!Ne&&!ks;let vd=gt;!ht&&!pe.mercatorFromTransition||Ae||(vd=nr(pe));const oh=Ns(_s.kind,fl,pl,Ne,f,ql,Zl,$a,xe,!0,Zr,Ls,!0,ct,ci,We,un,Qt?vd:gt,xt.getProjection(),dn,null,null,ro),bm=yt.glyphAtlasTexture?yt.glyphAtlasTexture:null,wm=ye.LINEAR,Tm=l.paint.get("text-halo-width").constantOr(1)!==0,Hf=f.terrain&&Ne&&ks?s.bi(s.bz(),Ic):vo;if(ks&&xt.text){const Ms=pe.elevation,xd=Ms?Ms.getAtTileOffsetFunc(ct,pe.center.lat,pe.worldSize,xt.getProjection()):null,Jg=Lu(Kt,yt.tileID.canonical,Ne,Ae,pe,xt.getProjection(),hi);Dl(xt,Kt,f,!0,Jg,ra,Ne,K,xd,ct)}return{program:Is,buffers:xt.text,uniformValues:oh,atlasTexture:bm,atlasTextureIcon:$r,atlasInterpolation:wm,atlasInterpolationIcon:Nn,isSDF:!0,hasHalo:Tm,depthMode:Vi,tile:yt,renderWithShadows:Zn,labelPlaneMatr
3241ixInv:Hf}},bn=xt.icon.segments.get().length,Dn=xt.text.segments.get().length,ns=bn&&!w.onlyText?zs():null,fr=Dn&&!w.onlyIcons?Zi():null,Ks=l.paint.get("icon-opacity").constantOr(1),ur=l.paint.get("text-opacity").constantOr(1);if(lt&&xt.canOverlap){st=!0;const ks=Ks&&!w.onlyText?xt.icon.segments.get():[],tn=ur&&!w.onlyIcons?xt.text.segments.get():[];for(const Cs of ks)Xe.push({segments:new s.bd([Cs]),sortKey:Cs.sortKey,state:ns});for(const Cs of tn)Xe.push({segments:new s.bd([Cs]),sortKey:Cs.sortKey,state:fr})}else w.onlyText||Xe.push({segments:Ks?xt.icon.segments:new s.bd([]),sortKey:0,state:ns}),w.onlyIcons||Xe.push({segments:ur?xt.text.segments:new s.bd([]),sortKey:0,state:fr})}st&&Xe.sort((ct,yt)=>ct.sortKey-yt.sortKey);for(const ct of Xe){const yt=ct.state;if(yt)if(f.terrain?f.terrain.setupElevationDraw(yt.tile,yt.program,{useDepthForOcclusion:pe.depthOcclusionForSymbolsAndCircles,labelPlaneMatrixInv:yt.labelPlaneMatrixInv}):f.setupDepthForOcclusion(pe.depthOcclusionForSymbolsAndCircles,yt.program),_e.activeTexture.set(ye.TEXTURE0),yt.atlasTexture&&yt.atlasTexture.bind(yt.atlasInterpolation,ye.CLAMP_TO_EDGE,!0),yt.atlasTextureIcon&&(_e.activeTexture.set(ye.TEXTURE1),yt.atlasTextureIcon&&yt.atlasTextureIcon.bind(yt.atlasInterpolationIcon,ye.CLAMP_TO_EDGE,!0)),yt.renderWithShadows&&f.shadowRenderer.setupShadows(yt.tile.tileID.toUnwrapped(),yt.program,"vector-tile",yt.tile.tileID.overscaledZ),f.uploadCommonLightUniforms(f.context,yt.program),yt.hasHalo){const xt=yt.uniformValues;xt.u_is_halo=1,Lr(yt.buffers,ct.segments,l,f,yt.program,yt.depthMode,y,v,xt,2),xt.u_is_halo=0}else{if(yt.isSDF){const xt=yt.uniformValues;yt.hasHalo&&(xt.u_is_halo=1,Lr(yt.buffers,ct.segments,l,f,yt.program,yt.depthMode,y,v,xt,1)),xt.u_is_halo=0}Lr(yt.buffers,ct.segments,l,f,yt.program,yt.depthMode,y,v,yt.uniformValues,1)}}}function Lr(f,i,l,p,y,v,w,S,C,D){const L=[f.dynamicLayoutVertexBuffer,f.opacityVertexBuffer,f.iconTransitioningVertexBuffer,f.globeExtVertexBuffer,f.zOffsetVertexBuffer];y.draw(p,p.context.gl.TRIANGLES,v,w,S,Di.disabled,C,l.id,f.layoutVertexBuffer,f.indexBuffer,i,l.paint,p.transform.zoom,f.programConfigurations.get(l.id),L,D)}function Os(f,i){const l=1<<f.canonical.z,p=(i.x*l-f.canonical.x-f.wrap*l)*s.aj,y=(i.y*l-f.canonical.y)*s.aj,v=s.dS(i.z,i.y);return s.cS(p,y,v)}function Nr(f,i,l,p,y){if(!l.layout||l.layout.get("fill-elevation-reference")==="none")return;const v=f.context.gl,w=new Gt(f.context.gl.LEQUAL,Gt.ReadWrite,f.depthRangeFor3D),S=new Gt(f.context.gl.GREATER,Gt.ReadWrite,f.depthRangeFor3D),C=function($){const q=s.cJ($.pitch);let W=.01;return $.isOrthographic&&(W=s.ai(1e-4,W,s.cO(q>=el?1:q/el))),2*W}(f.transform),D=f.transform.getFreeCameraOptions().position,L="elevatedStructuresDepthReconstruct",F=f.getOrCreateProgram(L,{defines:["DEPTH_RECONSTRUCTION"]}),O=f.getOrCreateProgram(L);for(const $ of p){const q=i.getTile($),W=q.getBucket(l);if(!W)continue;const K=W.elevatedStructures;if(!K)continue;const Z=W.elevationBufferData.heightRange,se=Os($.toUnwrapped(),D),ue=f.translatePosMatrix($.projMatrix,q,l.paint.get("fill-translate"),l.paint.get("fill-translate-anchor"));let fe,xe,_e,ye;if(y==="initialize"){if(!Z||Z.min>=1||K.depthSegments.segments[0].primitiveLength===0)continue;fe=we(ue,se,C,1,0),xe=w,_e=K.depthSegments,ye=F}else if(y==="reset"){if(!Z||Z.min>=0||K.maskSegments.segments[0].primitiveLength===0)continue;fe=we(ue,se,0,0,1),xe=S,_e=K.maskSegments,ye=F}else if(y==="geometry"){if(K.depthSegments.segments[0].primitiveLength===0)continue;fe=we(ue,se,C,1,0),xe=w,_e=K.depthSegments,ye=O}ye.draw(f,v.TRIANGLES,xe,Ii.disabled,en.disabled,Di.disabled,fe,l.id,K.vertexBuffer,K.indexBuffer,_e,l.paint,f.transform.zoom)}}function Vt(f,i,l){const{painter:p,sourceCache:y,layer:v,coords:w,colorMode:S,elevationType:C,terrainEnabled:D,pass:L}=f,F=p.context.gl,O=v.paint.get("fill-pattern"),$=v.paint.get("fill-pattern-cross-fade"),q=O.constantOr(null);let W=C;C!=="road"||i&&!D||(W="none");const K=W==="road",Z=f.painter.shadowRenderer,se=K&&!!Z&&Z.enabled,ue=new Gt(p.context.gl.LEQUAL,Gt.ReadOnly,p.depthRangeFor3D);let fe=[0,0,0];if(se){const ye=p.style.directionalLight,pe=p.style.ambientLight;ye&&pe&&(fe=va(p.style,ye,pe))}const xe=O&&O.constantOr(1),_e=(ye,pe)=>{let Se,Ae,Ge,Ne,lt;pe?(Se=xe&&!v.getPaintProperty("fill-outline-color")?"fillOutlinePattern":"fillOutline",Ge=F.LINES):(Se=xe?"fillPattern":"fill",Ge=F.TRIANGLES);for(const st of w){const Et=y.getTile(st);
3241if(xe&&!Et.patternsLoaded())continue;const Be=Et.getBucket(v);if(!Be)continue;const We=i?Be.elevationBufferData:Be.bufferData;if(We.isEmpty())continue;p.prepareDrawTile();const Re=We.programConfigurations.get(v.id),ht=p.isTileAffectedByFog(st),Xe=[],gt=[];K&&(Xe.push("ELEVATED_ROADS"),gt.push(We.elevatedLayoutVertexBuffer)),se&&Xe.push("RENDER_SHADOWS","DEPTH_TEXTURE","NORMAL_OFFSET"),xe&&(p.context.activeTexture.set(F.TEXTURE0),Et.imageAtlasTexture&&Et.imageAtlasTexture.bind(F.LINEAR,F.CLAMP_TO_EDGE),Re.updatePaintBuffers());let ct=!1;if(q&&Et.imageAtlas){const Kt=Et.imageAtlas,hi=s.dN.from(q),ni=hi.getPrimary().scaleSelf(s.q.devicePixelRatio).toString(),bi=hi.getSecondary(),Vi=Kt.patternPositions.get(ni),un=bi?Kt.patternPositions.get(bi.scaleSelf(s.q.devicePixelRatio).toString()):null;ct=!!Vi&&!!un,Vi&&Re.setConstantPatternPositions(Vi,un)}$>0&&(ct||Re.getPatternTransitionVertexBuffer("fill-pattern"))&&Xe.push("FILL_PATTERN_TRANSITION");const yt=p.getOrCreateProgram(Se,{config:Re,overrideFog:ht,defines:Xe}),xt=p.translatePosMatrix(st.projMatrix,Et,v.paint.get("fill-translate"),v.paint.get("fill-translate-anchor"));se&&Z.setupShadows(Et.tileID.toUnwrapped(),yt,"vector-tile",Et.tileID.overscaledZ);const Qt=v.paint.get("fill-emissive-strength");if(pe){Ne=We.lineIndexBuffer,lt=We.lineSegments;const Kt=p.terrain&&p.terrain.renderingToTexture?p.terrain.drapeBufferSize:[F.drawingBufferWidth,F.drawingBufferHeight];Ae=Se==="fillOutlinePattern"&&xe?z(xt,Qt,p,Et,Kt,fe,$):ce(xt,Qt,Kt,fe)}else Ne=We.indexBuffer,lt=We.triangleSegments,Ae=xe?iu(xt,Qt,p,Et,fe,$):sm(xt,Qt,fe);p.uploadCommonUniforms(p.context,yt,st.toUnwrapped());let ci=ye;(C==="road"&&!D||C==="offset")&&(ci=ue),yt.draw(p,Ge,ci,l||p.stencilModeForClipping(st),S,Di.disabled,Ae,v.id,We.layoutVertexBuffer,Ne,lt,v.paint,p.transform.zoom,Re,gt)}};p.renderPass===L&&_e(p.depthModeForSublayer(1,p.renderPass==="opaque"?Gt.ReadWrite:Gt.ReadOnly),!1),W==="none"&&p.renderPass==="translucent"&&v.paint.get("fill-antialias")&&_e(p.depthModeForSublayer(v.getPaintProperty("fill-outline-color")?2:0,Gt.ReadOnly),!0)}function na(f,i,l,p,y,v,w,S){l.resetLayerRenderingStats(f);const C=f.context,D=C.gl,L=f.transform,F=l.paint.get("fill-extrusion-pattern"),O=l.paint.get("fill-extrusion-pattern-cross-fade"),$=F.constantOr(null),q=F.constantOr(1),W=l.paint.get("fill-extrusion-opacity"),K=f.style.enable3dLights(),Z=l.paint.get(K&&!q?"fill-extrusion-ambient-occlusion-wall-radius":"fill-extrusion-ambient-occlusion-radius"),se=[l.paint.get("fill-extrusion-ambient-occlusion-intensity"),Z],ue=l.layout.get("fill-extrusion-edge-radius"),fe=ue>0&&!l.paint.get("fill-extrusion-rounded-roof"),xe=fe?0:ue,_e=L.projection.name==="globe"?s.dT():0,ye=L.projection.name==="globe",pe=ye?s.ah(L.zoom):0,Se=[s.ay(L.center.lng),s.aH(L.center.lat)],Ae=l.paint.get("fill-extrusion-flood-light-color-use-theme").constantOr("default")==="none",Ge=l.paint.get("fill-extrusion-flood-light-color").toRenderColor(Ae?null:l.lut).toArray01().slice(0,3),Ne=l.paint.get("fill-extrusion-flood-light-intensity"),lt=l.paint.get("fill-extrusion-vertical-scale"),st=l.paint.get("fill-extrusion-line-width").constantOr(1)!==0,Et=l.paint.get("fill-extrusion-height-alignment"),Be=l.paint.get("fill-extrusion-base-alignment"),We=Nl(f,l.paint.get("fill-extrusion-cutoff-fade-range")),Re=[];let ht;ye&&Re.push("PROJECTION_GLOBE_VIEW"),se[0]>0&&Re.push("FAUX_AO"),fe&&Re.push("ZERO_ROOF_RADIUS"),S&&Re.push("HAS_CENTROID"),Ne>0&&Re.push("FLOOD_LIGHT"),We.shouldRenderCutoff&&Re.push("RENDER_CUTOFF"),st&&Re.push("RENDER_WALL_MODE");const Xe=f.renderPass==="shadow",gt=f.shadowRenderer,ct=Xe&&!!gt,yt=Xe?Di.disabled:Di.backCCW;f.shadowRenderer&&(f.shadowRenderer.useNormalOffset=!0);let xt=[0,0,0];if(gt){const Kt=f.style.directionalLight,hi=f.style.ambientLight;Kt&&hi&&(xt=va(f.style,Kt,hi)),Xe||(Re.push("RENDER_SHADOWS","DEPTH_TEXTURE"),gt.useNormalOffset&&Re.push("NORMAL_OFFSET")),ht=Re.concat(["SHADOWS_SINGLE_CASCADE"])}const Qt=ct?"fillExtrusionDepth":q?"fillExtrusionPattern":"fillExtrusion",ci=l.getLayerRenderingStats();for(const Kt of p){const hi=i.getTile(Kt),ni=hi.getBucket(l);if(!ni||ni.projection.name!==L.projection.name)continue;let bi=!1;gt&&(bi=gt.getMaxCascadeForTile(Kt.toUnwrapped())===0);const Vi=f.isTileAffectedByFog(Kt),un=ni.programConfigurations.get(l.id);let is=!1;if($&&hi.imageAtlas){const Dn=hi.imageAtlas,ns=s.dN.from($),fr=ns.getPrimary().scaleSelf(s.q.devicePixelRatio).toString(),Ks=ns.getSecondary(),ur=Dn.patternPositions.get(fr),ks=Ks?Dn.patternPositions.get(Ks.scaleSelf(s.q.devicePixelRatio).toString()):null;is=!!ur&&!!ks,ur&&un.setConstantPatternPositions(ur,ks)}O>0&&(is||un.getPatternTransitionVertexBuffer("fill-extrusion-pattern"))&&Re.push("FILL_EXTRUSION_PATTERN_TRANSITION");const Zn=f.getOrCreateProgram(Qt,{config:un,defines:bi?ht:Re,overrideFog:Vi});if(f.terrain&&f.terrain.setupElevationDraw(hi,Zn,{useMeterToDem:!0}),!ni.centroidVertexBuffer){const Dn=Zn.attributes.a_centroid_pos;Dn!==void 0&&D.vertexAttrib2f(Dn,0,0)}!Xe&>&>.setupShadows(hi.tileID.toUnwrapped(),Zn,"vector-tile",hi.tileID.overscaledZ
3241),q&&(f.context.activeTexture.set(D.TEXTURE0),hi.imageAtlasTexture&&hi.imageAtlasTexture.bind(D.LINEAR,D.CLAMP_TO_EDGE),un.updatePaintBuffers());const dn=l.paint.get("fill-extrusion-vertical-gradient"),Zs=1/ni.tileToMeter;let zs;if(Xe&>){if(kg(hi.tileID,ni,f))continue;const Dn=gt.calculateShadowPassMatrixFromTile(hi.tileID.toUnwrapped());zs=ad(Dn,xe,Zs,lt,Et,Be)}else{const Dn=f.translatePosMatrix(Kt.expandedProjMatrix,hi,l.paint.get("fill-extrusion-translate"),l.paint.get("fill-extrusion-translate-anchor")),ns=L.projection.createInversionMatrix(L,Kt.canonical);zs=q?Dg(Dn,f,dn,W,se,xe,Zs,Kt,hi,_e,Et,Be,pe,Se,ns,Ge,lt,O):Fa(Dn,f,dn,W,se,xe,Zs,Kt,_e,Et,Be,pe,Se,ns,Ge,lt,Ne,xt)}f.uploadCommonUniforms(C,Zn,Kt.toUnwrapped(),null,We);let Zi=ni.segments;if(L.projection.name==="mercator"&&!Xe&&(Zi=ni.getVisibleSegments(hi.tileID,f.terrain,f.transform.getFrustum(0)),!Zi.get().length))continue;if(ci)if(Xe)for(const Dn of Zi.get())ci.numRenderedVerticesInShadowPass+=Dn.primitiveLength;else for(const Dn of Zi.get())ci.numRenderedVerticesInTransparentPass+=Dn.primitiveLength;const bn=[];(f.terrain||S)&&bn.push(ni.centroidVertexBuffer),ye&&bn.push(ni.layoutVertexExtBuffer),st&&bn.push(ni.wallVertexBuffer),Zn.draw(f,C.gl.TRIANGLES,y,v,w,yt,zs,l.id,ni.layoutVertexBuffer,ni.indexBuffer,Zi,l.paint,f.transform.zoom,un,bn)}f.shadowRenderer&&(f.shadowRenderer.useNormalOffset=!1)}function Ba(f,i,l,p,y,v,w,S,C,D,L,F,O,$,q,W,K,Z,se){const ue=f.context,fe=ue.gl,xe=f.transform,_e=f.transform.zoom,ye=[],pe=Nl(f,l.paint.get("fill-extrusion-cutoff-fade-range"));D==="clear"?(ye.push("CLEAR_SUBPASS"),se&&(ye.push("CLEAR_FROM_TEXTURE"),ue.activeTexture.set(fe.TEXTURE0),se.bind(fe.LINEAR,fe.CLAMP_TO_EDGE))):D==="sdf"&&ye.push("SDF_SUBPASS"),K&&ye.push("HAS_CENTROID"),pe.shouldRenderCutoff&&ye.push("RENDER_CUTOFF");const Se=l.layout.get("fill-extrusion-edge-radius"),Ae=(Ge,Ne,lt,st,Et)=>{const Be=Ne.programConfigurations.get(l.id),We=f.isTileAffectedByFog(Ge),Re=f.getOrCreateProgram("fillExtrusionGroundEffect",{config:Be,defines:ye,overrideFog:We}),ht=((gt,ct,yt,xt,Qt,ci,Kt,hi,ni,bi,Vi)=>({u_matrix:ct,u_opacity:yt,u_ao_pass:xt?1:0,u_meter_to_tile:Qt,u_ao:ci,u_flood_light_intensity:Kt,u_flood_light_color:hi,u_attenuation:ni,u_edge_radius:bi,u_fb:0,u_fb_size:Vi,u_dynamic_offset:1}))(0,st,L,C,Et,[F,O*Et],$,q,W,_e>=17?0:Se*Et,se?se.size[0]:0),Xe=[];K&&Xe.push(Ne.hiddenByLandmarkVertexBuffer),f.uploadCommonUniforms(ue,Re,Ge.toUnwrapped(),null,pe),Re.draw(f,ue.gl.TRIANGLES,y,v,w,S,ht,l.id,Ne.vertexBuffer,Ne.indexBuffer,lt,l.paint,_e,Be,Xe)};for(const Ge of p){const Ne=i.getTile(Ge),lt=Ne.getBucket(l);if(!lt||lt.projection.name!==xe.projection.name||!lt.groundEffect||lt.groundEffect&&!lt.groundEffect.hasData())continue;const st=lt.groundEffect,Et=1/lt.tileToMeter;{const Be=f.translatePosMatrix(Ge.projMatrix,Ne,l.paint.get("fill-extrusion-translate"),l.paint.get("fill-extrusion-translate-anchor")),We=st.getDefaultSegment();Ae(Ge,st,We,Be,Et)}
vendor: 13,144 bytes, line 3241
3241if(Z)for(let Be=0;Be<4;Be++){const We=s.dU[Be](Ge),Re=i.getTile(We);if(!Re)continue;const ht=Re.getBucket(l);if(!ht||ht.projection.name!==xe.projection.name||!ht.groundEffect||ht.groundEffect&&!ht.groundEffect.hasData())continue;const Xe=ht.groundEffect;let gt,ct;Be===0?(gt=[-s.aj,0,0],ct=1):Be===1?(gt=[s.aj,0,0],ct=0):Be===2?(gt=[0,-s.aj,0],ct=3):(gt=[0,s.aj,0],ct=2);const yt=Xe.regionSegments[ct];if(!yt)continue;const xt=new Float32Array(16);s.bo(xt,Ge.projMatrix,gt),Ae(Ge,Xe,yt,f.translatePosMatrix(xt,Ne,l.paint.get("fill-extrusion-translate"),l.paint.get("fill-extrusion-translate-anchor")),Et)}}}function ol(f,i,l,p,y,v,w){p.centroidVertexArray.length===0&&p.createCentroidsBuffer();const S=v?v.findDEMTileFor(l):null;if(!(S&&S.dem||w))return;v&&S&&S.dem&&p.selfDEMTileTimestamp!==S.dem._timestamp&&(p.borderDoneWithNeighborZ=[-1,-1,-1,-1],p.selfDEMTileTimestamp=S.dem._timestamp);const C=Z=>new s.P(Math.ceil((Z+s.dX)*s.dY),0),D=Z=>{const se=i.getSource().minzoom,ue=xe=>{const _e=i.getTileByID(xe);if(_e&&_e.hasData())return _e.getBucket(y)},fe=[0,-1,1];for(const xe of fe){if(Z.overscaledZ+xe<se)continue;const _e=ue(Z.calculateScaledKey(Z.overscaledZ+xe));if(_e)return _e}},L=[0,0,0],F=(Z,se)=>(L[0]=Math.min(Z.min.y,se.min.y),L[1]=Math.max(Z.max.y,se.max.y),L[2]=s.aj-se.min.x>Z.max.x?se.min.x-s.aj:Z.max.x,L),O=(Z,se)=>(L[0]=Math.min(Z.min.x,se.min.x),L[1]=Math.max(Z.max.x,se.max.x),L[2]=s.aj-se.min.y>Z.max.y?se.min.y-s.aj:Z.max.y,L),$=[(Z,se)=>F(Z,se),(Z,se)=>F(se,Z),(Z,se)=>O(Z,se),(Z,se)=>O(se,Z)],q=(Z,se,ue,fe,xe,_e,ye)=>{if(!v)return 0;const pe=[[_e?ue:Z,_e?Z:ue,0],[_e?ue:se,_e?se:ue,0]],Se=ye<0?s.aj+ye:ye,Ae=[_e?Se:(Z+se)/2,_e?(Z+se)/2:Se,0];return ue===0&&ye<0||ue!==0&&ye>0?v.getForTilePoints(xe,[Ae],!0,fe):pe.push(Ae),v.getForTilePoints(l,pe,!0,S),Math.max(pe[0][2],pe[1][2],Ae[2])/v.exaggeration()};for(let Z=0;Z<4;Z++){const se=p.borderFeatureIndices[Z];if(se.length===0)continue;const ue=s.dU[Z](l),fe=D(ue);if(!(fe&&fe instanceof s.dV))continue;const xe=v?v.findDEMTileFor(ue):null;if(!(xe&&xe.dem||w)||(v&&xe&&xe.dem&&p.borderDEMTileTimestamp[Z]!==xe.dem._timestamp&&(p.borderDoneWithNeighborZ[Z]=-1,p.borderDEMTileTimestamp[Z]=xe.dem._timestamp),p.borderDoneWithNeighborZ[Z]===fe.canonical.z))continue;fe.centroidVertexArray.length===0&&fe.createCentroidsBuffer();const _e=(Z<2?1:5)-Z,ye=fe.borderDoneWithNeighborZ[_e]!==p.canonical.z,pe=fe.borderFeatureIndices[_e];let Se=0;if(p.canonical.z!==fe.canonical.z){for(const Ae of se)p.showCentroid(p.featuresOnBorder[Ae]);if(ye)for(const Ae of pe)fe.showCentroid(fe.featuresOnBorder[Ae]);p.borderDoneWithNeighborZ[Z]=fe.canonical.z,fe.borderDoneWithNeighborZ[_e]=p.canonical.z}for(const Ae of se){const Ge=p.featuresOnBorder[Ae],Ne=p.centroidData[Ge.centroidDataIndex],lt=Ge.borders[Z];let st;for(;Se<pe.length;){st=fe.featuresOnBorder[pe[Se]];const Et=st.borders[_e];if(Et[1]>lt[0]+3||Et[0]>lt[0]-3)break;fe.showCentroid(st),Se++}if(st&&Se<pe.length){const Et=Se;let Be=0;for(;!(st.borders[_e][0]>lt[1]-3)&&(Be++,++Se!==pe.length);)st=fe.featuresOnBorder[pe[Se]];st=fe.featuresOnBorder[pe[Et]];let We=!1;if(Be>=1){const Xe=st.borders[_e];Math.abs(lt[0]-Xe[0])<3&&Math.abs(lt[1]-Xe[1])<3&&(Be=1,We=!0,Se=Et+1)}else if(Be===0){p.showCentroid(Ge);continue}const Re=fe.centroidData[st.centroidDataIndex];w&&We&&(((W=Ne).flags|(K=Re).flags)&s.dW?(W.flags|=s.dW,K.flags|=s.dW):(W.flags&=~s.dW,K.flags&=~s.dW));const ht=Ge.intersectsCount()>1||st.intersectsCount()>1;if(Be>1)Se=Et,Ne.centroidXY=Re.centroidXY=new s.P(0,0);else if(xe&&xe.dem&&!ht){const Xe=$[Z](Ne,Re),gt=Z%2?s.aj-1:0,ct=q(Xe[0],Math.min(s.aj-1,Xe[1]),gt,xe,ue,Z<2,Xe[2]);Ne.centroidXY=Re.centroidXY=C(ct)}else ht?Ne.centroidXY=Re.centroidXY=new s.P(0,0):(Ne.centroidXY=p.encodeBorderCentroid(Ge),Re.centroidXY=fe.encodeBorderCentroid(st));p.writeCentroidToBuffer(Ne),fe.writeCentroidToBuffer(Re)}else p.showCentroid(Ge)}p.borderDoneWithNeighborZ[Z]=fe.canonical.z,fe.borderDoneWithNeighborZ[_e]=p.canonical.z}var W,K;(p.needsCentroidUpdate||!p.centroidVertexBuffer&&p.centroidVertexArray.length!==0)&&p.uploadCentroid(f)}const al=[1,0,0],mi=[0,1,0],Mf=[0,0,1];function kg(f,i,l){const p=l.transform,y=l.shadowRenderer;if(!y)return!0;const v=f.toUnwrapped(),w=p.tileSize*y._cascades[l.currentShadowCascade].scale;let S=i.maxHeight;if(p.elevation){const W=p.elevation.getMinMaxForTile(f);W&&(S+=W.max)}const C=[...y.shadowDirection];C[2]=-C[2];const D=y.computeSimplifiedTileShadowVolume(v,S,w,C);if(!D)return!1;const L=[al,mi,Mf,C,[C[0],0,C[2]],[0,C[1],C[2]]],F=p.projection.name==="globe",O=p.scaleZoom(w),$=s.cn.fromInvProjectionMatrix(p.invProjMatrix,p.worldSize,O,!F),q=y.getCurrentCascadeFrustum();return $.intersectsPrecise(D.vertices,D.planes,L)===0||q.intersectsPrecise(D.vertices,D.planes,L)===0}function ld(f){return[f[0]*s.dZ,f[1]*s.dZ,f[2]*s.dZ,0]}function Yu(f,i,l,p,y,v,w,S,C){const D=p.getSource(),L=l.globeSharedBuffers;if(!L)return;let F,O,$;if(i&&(F=p.getTile(i)),D instanceof s.aP?(O=D.texture,$=s.ds(0,0,l.transform)):F&&i&&(O=F.texture,$=s.ds(i.canonical.z,i.canonical.x,l.transform)),!O||!$)return;f||($=s.cE(s.bz(),$,[1,-1,1]));const q=l.context,W=q.gl,K=y.paint.get("raster-resampling")==="nearest"?W.NEAREST:W.LINEAR,Z=l.colorModeForDrapableLayerRenderPass(v),se=w.defines;se.push("GLOBE_POLES");const ue=new Gt(W.LEQUAL,Gt.ReadWrite,l.depthRangeFor3D),fe=Float32Array.from(l.transform.expandedFarZProjMatrix),xe=Float32Array.from(s.bh(s.dr(new s.cp(0,0,0))));l.terrain&&l.terrain.prepareDrawTile(),q.activeTexture.set(W.TEXTURE0),O.bind(K,W.CLAMP_TO_EDGE),q.activeTexture.set(W.TEXTURE1),O.bind(K,W.CLAMP_TO_EDGE),"useMipmap"in O&&q.extTextureFilterAnisotropic&&l.transform.pitch>20&&W.texParameterf(W.TEXTURE_2D,q.extTextureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,q.extTextureFilterAnisotropicMax);const[_e,ye,pe,Se]=i?L.getPoleBuffers(i.canonical.z,!1):L.getPoleBuffers(0,!0),Ae=y.paint.get("raster-elevation");let Ge;f?(Ge=_e,l.renderDefaultNorthPole=Ae!==0):(Ge=ye,l.renderDefaultSouthPole=Ae!==0);const Ne=ld(w.mix),lt=((Et,Be,We,Re,ht,Xe,gt,ct,yt,xt,Qt,ci,Kt)=>Ui(Et,Be,We,new Float32Array(16),new Float32Array(9),[0,0],Re,[0,0],[0,0,0,0],1,{opacity:1,mix:0},Xe,[0,0],ct,2,xt,Qt,ci,1,0,Kt))(fe,xe,$,s.ah(l.transform.zoom),0,y,0,Ae,0,Ne,w.offset,w.range,v),st=l.getOrCreateProgram("raster",{defines:se});l.uploadCommonUniforms(q,st,null),st.draw(l,W.TRIANGLES,ue,C,Z,S,lt,y.id,Ge,pe,Se)}function Pf(f){const i=f._nearZ,l=f.projection.farthestPixelDistance(f),p=l-i,y=.2*f.height,v=i+y;return[i,l,(v-y-i)/p,(v-i)/p]}function Lg(f,i,l,p){if(f)return i instanceof Al&&f instanceof Mu?i.getTextureDescriptor(f,l,!0):{texture:f.texture,mix:ld(p.mix),offset:p.offset,buffer:0,tileSize:1}}var Df=s.d_([{name:"a_index",type:"Int16",components:1}]);class rm{constructor(i,l,p,y){const v={width:p[0],height:p[1],data:null},w=i.gl;this.targetColorTexture=new s.T(i,v,w.RGBA8,{useMipmap:!1}),this.backgroundColorTexture=new s.T(i,v,w.RGBA8,{useMipmap:!1}),this.context=i,this.updateParticleTexture(l,y),this.lastInvalidatedAt=0}updateParticleTexture(i,l){if(this.particleTextureDimension===l.width)return;(this.particleTexture0||this.particleTexture1||this.particleIndexBuffer||this.particleSegment)&&(this.particleTexture0.destroy(),this.particleTexture1.destroy(),this.particleIndexBuffer.destroy(),this.particleSegment.destroy());const p=this.context.gl,y=l.width*l.height;this.particleTexture0=new s.T(this.context,l,p.RGBA8,{premultiply:!1,useMipmap:!1}),this.particleTexture1=new s.T(this.context,l,p.RGBA8,{premultiply:!1,useMipmap:!1});const v=new s.d$;v.reserve(y);for(let w=0;w<y;w++)v.emplaceBack(w);this.particleIndexBuffer=this.context.createVertexBuffer(v,Df.members,!0),this.particleSegment=s.bd.simpleSegment(0,0,this.particleIndexBuffer.length,0),this.particleTextureDimension=l.width}update(i){return!(this.lastInvalidatedAt<i&&(this.lastInvalidatedAt=s.q.now(),1))}destroy(){this.targetColorTexture.destroy(),this.backgroundColorTexture.destroy(),this.particleIndexBuffer.destroy(),this.particleTexture0.destroy(),this.particleTexture1.destroy(),this.particleSegment.destroy()}}function Rg(f,i,l){if(!f)return null;const p=i.getTextureDescriptor(f,l,!0);if(!p)return null;let{texture:y,mix:v,offset:w,tileSize:S,buffer:C,format:D}=p;if(!y||!D)return null;let L=!1;return D==="uint32"&&(L=!0,v[3]=0,v=Si(s.e0,v,[0,l.paint.get("raster-particle-max-speed")]),w=Wi(s.e0,w,[0,l.paint.get("raster-particle-max-speed")])),{texture:y,textureOffset:[C/(S+2*C),S/(S+2*C)],tileSize:S,scalarData:L,scale:v,offset:w,defines:["RASTER_ARRAY",{uint8:"DATA_FORMAT_UINT8",uint16:"DATA_FORMAT_UINT16",uint32:"DATA_FORMAT_UINT32"}[D]]}}function kf(f){const i=f._nearZ,l=f.projection.farthestPixelDistance(f),p=l-i,y=.2*f.height,v=i+y;return[i,l,(v-y-i)/p,(v-i)/p]}const ll=new s.am(1,0,0,1),nu=new s.am(0,1,0,1),cd=new s.am(0,0,1,1),Ao=new s.am(1,0,1,1),Na=new s.am(0,1,1,1);function Ul(f,i,l,p,y,v,w){const S=f.context,C=f.transform,D=S.gl,L=C.projection.name==="globe",F=L?["PROJECTION_GLOBE_VIEW"]:[];let O=s.bw(l.projMatrix);if(L&&s.ah(C.zoom)>0){const Ne=s.bg(l.canonical,C),lt=s.e1(Ne);O=s.az(new Float32Array(16),C.globeMatrix,lt),s.az(O,C.projMatrix,O)}const $=s.bz();$[12]+=2*y/(s.q.devicePixelRatio*C.width),$[13]+=2*v/(s.q.devicePixelRatio*C.height),s.az(O,$,O);const q=f.getOrCreateProgram("debug",{defines:F}),W=i.getTileByID(l.key);f.terrain&&f.terrain.setupElevationDraw(W,q);const K=Gt.disabled,Z=Ii.disabled,se=f.colorModeForRenderPass(),ue="$debug";S.activeTexture.set(D.TEXTURE0),f.emptyTexture.bind(D.LINEAR,D.CLAMP_TO_EDGE),L?W._makeGlobeTileDebugBuffers(f.context,C):W._makeDebugTileBoundsBuffers(f.context,C.projection);const fe=W._tileDebugBuffer||f.debugBuffer,xe=W._tileDebugIndexBuffer||f.debugIndexBuffer,_e=W._tileDebugSegments||f.debugSegments;if(q.draw(f,D.LINE_STRIP,K,Z,se,Di.disabled,at(O,p),ue,fe,xe,_e,null,null,null,[W._globeTileDebugBorderBuffer]),w){const Ne=W.latestRawTileData,lt=Math.floor((Ne&&Ne.byteLength||0)/1024);let st=l.canonical.toString();l.overscaledZ!==l.canonical.z&&(st+=` => ${l.overscaledZ}`),st+=` ${W.state}`,st+=` ${lt}kb`,function(Et,Be){Et.initDebugOverlayCanvas();const We=Et.debugOverlayCanvas,Re=Et.context.gl,ht=Et.debugOverlayCanvas.getContext("2d");ht.clearRect(0,0,We.width,We.height),ht.shadowColor="white",ht.shadowBlur=2,ht.lineWidth=1.5,ht.strokeStyle="white",ht.textBaseline="top",ht.font="bold 36px Open Sans, sans-serif",ht.fillText(Be,5,5),ht.strokeText(Be,5,5),Et.debugOverlayTexture.update(We),Et.debugOverlayTexture.bind(Re.LINEAR,Re.CLAMP_TO_EDGE)}(f,st)}const ye=i.getTile(l).tileSize,pe=512/Math.min(ye,512)*(l.overscaledZ/C.zoom)*.5,Se=W._tileDebugTextBuffer||f.debugBuffer,Ae=W._tileDebugTextIndexBuffer||f.quadTriangleIndexBuffer,Ge=W._tileDebugTextSegments||f.debugSegments;q.draw(f,D.TRIANGLES,K,Z,en.alphaBlended,Di.disabled,at(O,s.am.transparent,pe),ue,Se,Ae,Ge,null,null,null,[W._globeTileDebugTextBuffer])}function Ku(f,i,l,p){Sc(f,0,i+l/2,f.transform.width,l,p)}function Ju(f,i,l,p){Sc(f,i-l/2,0,l,f.transform.height,p)}function Sc(f,i,l,p,y,v){const w=f.context,S=w.gl;S.enable(S.SCISSOR_TEST),S.scissor(i*s.q.devicePixelRatio,l*s.q.devicePixelRatio,p*s.q.devicePixelRatio,y*s.q.devicePixelRatio),w.clear({color:v}),S.disable(S.SCISSOR_TEST)}const om=s.d_([{name:"a_pos_3f",components:3,type:"Float32"}]),{members:sa}=om;function Un(f,i,l,p){f.emplaceBack(i,l,p)}class su{constructor(i){this.vertexArray=new s.e2,this.indices=new s.a_,Un(this.vertexArray,-1,-1,1),Un(this.vertexArray,1,-1,1),Un(this.vertexArray,-1,1,1),Un(this.vertexArray,1,1,1),Un(this.vertexArray,-1,-1,-1),Un(this.vertexArray,1,-1,-1),Un(this.vertexArray,-1,1,-1),Un(this.vertexArray,1,1,-1),this.indices.emplaceBack(5,1,3),this.indices.emplaceBack(3,7,5),this.indices.emplaceBack(6,2,0),this.indices.emplaceBack(0,4,6),this.indices.emplaceBack(2,6,7),this.indices.emplaceBack(7,3,2),this.indices.emplaceBack(5,4,0),this.indices.emplaceBack(0,1,5),this.indices.emplaceBack(0,2,3),this.indices.emplaceBack(3,1,0),this.indices.emplaceBack(7,6,4),this.indices.emplaceBack(4,5,7),this.vertexBuffer=i.createVertexBuffer(this.vertexArray,sa),this.indexBuffer=i.createIndexBuffer(this.indices),this.segment=s.bd.simpleSegment(0,0,36,12)}}function ru(f,i,l,p,y,v){const w=f.context.gl,S=i.paint.get("sky-atmosphere-color"),C=i.paint.get("sky-atmosphere-halo-color"),D=i.paint.get("sky-atmosphere-sun-intensity"),L=((F,O,$,q,W)=>({u_matrix_3f:F,u_sun_direction:O,u_sun_intensity:$,u_color_tint_r:[q.r,q.g,q.b,q.a],u_color_tint_m:[W.r,W.g,W.b,W.a],u_luminance:5e-5}))(s.e4(s.dx(),p),y,D,S,C);w.framebufferTexture2D(w.FRAMEBUFFER,w.COLOR_ATTACHMENT0,w.TEXTURE_CUBE_MAP_POSITIVE_X+v,i.skyboxTexture,0),l.draw(f,w.TRIANGLES,Gt.disabled,Ii.disabled,en.unblended,Di.frontCW,L,"skyboxCapture",i.skyboxGeometry.vertexBuffer,i.skyboxGeometry.indexBuffer,i.skyboxGeometry.segment)}const e0=s.d_([{type:"Float32",name:"a_pos",components:3},{type:"Float32",name:"a_uv",components:2}]);class t0{constructor(i){const l=new s.e5;l.emplaceBack(-1,1,1,0,0),l.emplaceBack(1,1,1,1,0),l.emplaceBack(1,-1,1,1,1),l.emplaceBack(-1,-1,1,0,1);const p=new s.a_;p.emplaceBack(0,1,2),p.emplaceBack(2,3,0),this.vertexBuffer=i.createVertexBuffer(l,e
32410.members),this.indexBuffer=i.createIndexBuffer(p),this.segments=s.bd.simpleSegment(0,0,4,2)}destroy(){this.vertexBuffer.destroy(),this.indexBuffer.destroy(),this.segments.destroy()}}const i0=s.d_([{type:"Float32",name:"a_pos_3f",components:3},{type:"Float32",name:"a_uv",components:2},{type:"Float32",name:"a_size_scale",components:1},{type:"Float32",name:"a_fade_opacity",components:1}]);class A1{constructor(){this.starsCount=16e3,this.sizeMultiplier=.15,this.sizeRange=100,this.intensityRange=200}}class ud{constructor(i){this.colorModeAlphaBlendedWriteRGB=new en([1,po,1,po],s.am.transparent,[!0,!0,!0,!1]),this.colorModeWriteAlpha=new en([1,0,1,0],s.am.transparent,[!1,!1,!1,!0]),this.params=new A1,this.updateNeeded=!0,i.tp.registerParameter(this.params,["Stars"],"starsCount",{min:100,max:16e3,step:1},()=>{this.updateNeeded=!0}),i.tp.registerParameter(this.params,["Stars"],"sizeMultiplier",{min:.01,max:2,step:.01}),i.tp.registerParameter(this.params,["Stars"],"sizeRange",{min:0,max:200,step:1},()=>{this.updateNeeded=!0}),i.tp.registerParameter(this.params,["Stars"],"intensityRange",{min:0,max:200,step:1},()=>{this.updateNeeded=!0})}update(i){const l=i.context;if(!this.atmosphereBuffer||this.updateNeeded){this.updateNeeded=!1,this.atmosphereBuffer=new t0(l);const p=this.params.sizeRange,y=this.params.intensityRange,v=function(L){const F=s.ea(30),O=[];for(let $=0;$<L;++$){const q=2*Math.PI*F(),W=Math.acos(1-2*F())-.5*Math.PI;O.push(s.cS(Math.cos(W)*Math.cos(q),Math.cos(W)*Math.sin(q),Math.sin(W)))}return O}(this.params.starsCount),w=s.ea(300),S=new s.e6,C=new s.a_;let D=0;for(let L=0;L<v.length;++L){const F=s.b$([],v[L],200),O=Math.max(0,1+.01*p*(1*w()-.5)),$=Math.max(0,1+.01*y*(1*w()-.5));S.emplaceBack(F[0],F[1],F[2],-1,-1,O,$),S.emplaceBack(F[0],F[1],F[2],1,-1,O,$),S.emplaceBack(F[0],F[1],F[2],1,1,O,$),S.emplaceBack(F[0],F[1],F[2],-1,1,O,$),C.emplaceBack(D+0,D+1,D+2),C.emplaceBack(D+0,D+2,D+3),D+=4}this.starsVx=l.createVertexBuffer(S,i0.members),this.starsIdx=l.createIndexBuffer(C),this.starsSegments=s.bd.simpleSegment(0,0,S.length,C.length)}}destroy(){this.atmosphereBuffer&&this.atmosphereBuffer.destroy(),this.starsVx&&this.starsVx.destroy(),this.starsIdx&&this.starsIdx.destroy()}drawAtmosphereGlow(i,l){const p=i.context,y=p.gl,v=i.transform,w=new Gt(y.LEQUAL,Gt.ReadOnly,[0,1]),S=s.ah(v.zoom),C=i.style.getLut(l.scope),D=l.properties.get("color-use-theme")==="none",L=l.properties.get("color").toRenderColor(D?null:C).toArray01(),F=l.properties.get("high-color-use-theme")==="none",O=l.properties.get("high-color").toRenderColor(F?null:C).toArray01(),$=l.properties.get("space-color-use-theme")==="none",q=l.properties.get("space-color").toRenderColor($?null:C).toArray01PremultipliedAlpha(),W=5e-4,K=s.e7(l.properties.get("horizon-blend"),0,1,W,.25),Z=s.dl(i,p,v)&&K===W?v.worldSize/(2*Math.PI*1.025)-1:v.globeRadius,se=i.frameCounter/1e3%1,ue=s.ae(v.globeCenterInViewSpace),fe=Math.sqrt(Math.pow(ue,2)-Math.pow(Z,2)),xe=Math.acos(fe/ue),_e=ye=>{const pe=v.projection.name==="globe"?["PROJECTION_GLOBE_VIEW","FOG"]:["FOG"];ye&&pe.push("ALPHA_PASS");const Se=i.getOrCreateProgram("globeAtmosphere",{defines:pe}),Ae=((Ne,lt,st,Et,Be,We,Re,ht,Xe,gt,ct,yt)=>({u_frustum_tl:Ne,u_frustum_tr:lt,u_frustum_br:st,u_frustum_bl:Et,u_horizon:Be,u_transition:We,u_fadeout_range:Re,u_color:ht,u_high_color:Xe,u_space_color:gt,u_temporal_offset:ct,u_horizon_angle:yt}))(v.frustumCorners.TL,v.frustumCorners.TR,v.frustumCorners.BR,v.frustumCorners.BL,v.frustumCorners.horizon,S,K,L,O,q,se,xe);i.uploadCommonUniforms(p,Se);const Ge=this.atmosphereBuffer;Ge&&Se.draw(i,y.TRIANGLES,w,Ii.disabled,ye?this.colorModeWriteAlpha:this.colorModeAlphaBlendedWriteRGB,Di.backCW,Ae,ye?"atmosphere_glow_alpha":"atmosphere_glow",Ge.vertexBuffer,Ge.indexBuffer,Ge.segments)};_e(!1),_e(!0)}drawStars(i,l){const p=s.aD(l.properties.get("star-intensity"),0,1);if(p===0)return;const y=i.context,v=y.gl,w=i.transform,S=i.getOrCreateProgram("stars"),C=s.bY([]);s.b_(C,C,-w._pitch),s.bZ(C,C,-w.angle),s.b_(C,C,s.al(w._center.lat)),s.e8(C,C,-s.al(w._center.lng));const D=s.c3(new Float32Array(16),C),L=s.az([],w.starsProjMatrix,D),F=s.e4([],D),O=s.e9([],F),$=[0,1,0];s.dz($,$,O),s.b$($,$,this.params.sizeMultiplier);const q=[1,0,0];s.dz(q,q,O),s.b$(q,q,this.params.sizeMultiplier);const W=(K=$,Z=q,se=p,{u_matrix:Float32Array.from(L),u_up:K,u_right:Z,u_intensity_multiplier:se});var K,Z,se;i.uploadCommonUniforms(y,S),this.starsVx&&this.starsIdx&&S.draw(i,v.TRIANGLES,Gt.disabled,Ii.disabled,this.colorModeAlphaBlendedWriteRGB,Di.disabled,W,"atmosphere_stars",this.starsVx,this.starsIdx,this.starsSegments)}}function Qu(f,i){const l=[...f],p=i.cameraWorldSizeForFog/i.worldSize,y=s.bx([]);return s.cE(y,y,[p,p,1]),s.az(l,y,l),s.az(l,i.worldToFogMatrix,l),l}function It(f,i,l,p,y){const v=l.material,w=p.context,{baseColorTexture:S,metallicRoughnessTexture:C}=v.pbrMetallicRoughness,{normalTexture:D,occlusionTexture:L,emissionTexture:F}=v;function O(q,W,K){if(q&&(f.push(W),w.activeTexture.set(w.gl.TEXTURE0+K),q.gfxTexture)){const{minFilter:Z,magFilter:se,wrapS:ue,wrapT:fe}=q.sampler;q.gfxTexture.bindExtraParam(Z,se,ue,fe)}}O(S,"HAS_TEXTURE_u_baseColorTexture",mo.BaseColor),O(C,"HAS_TEXTURE_u_metallicRoughnessTexture",mo.MetallicRoughness),O(D,"HAS_TEXTURE_u_normalTexture",mo.Normal),O(L,"HAS_TEXTURE_u_occlusionTexture",mo.Occlusion),O(F,"HAS_TEXTURE_u_emissionTexture",mo.Emission),y&&(y.texture||(y.texture=new s.ed(p.context,y.image,[y.image.height,y.image.height,y.image.height],w.gl.RGBA8)),w.activeTexture.set(w.gl.TEXTURE0+mo.LUT),y.texture&&y.texture.bind(w.gl.LINEAR,w.gl.CLAMP_TO_EDGE),f.push("APPLY_LUT_ON_GPU")),l.texcoordBuffer&&(f.push("HAS_ATTRIBUTE_a_uv_2f"),i.push(l.texcoordBuffer)),l.colorBuffer&&(f.push(l.colorBuffer.itemSize===12?"HAS_ATTRIBUTE_a_color_3f":"HAS_ATTRIBUTE_a_color_4f"),i.push(l.colorBuffer)),l.normalBuffer&&(f.push("HAS_ATTRIBUTE_a_normal_3f"),i.push(l.normalBuffer)),l.pbrBuffer&&(f.push("HAS_ATTRIBUTE_a_pbr"),f.push("HAS_ATTRIBUTE_a_heightBasedEmissiveStrength"),i.push(l.pbrBuffer)),v.alphaMode!=="OPAQUE"&&v.alphaMode!=="MASK"||f.pu
3241sh("UNPREMULT_TEXTURE_IN_SHADER"),v.defined||f.push("DIFFUSE_SHADED");const $=p.shadowRenderer;$&&(f.push("RENDER_SHADOWS","DEPTH_TEXTURE"),$.useNormalOffset&&f.push("NORMAL_OFFSET"))}function Xt(f,i,l,p,y,v){const w=l.paint.get("model-opacity").constantOr(1),S=i.context,C=new Gt(i.context.gl.LEQUAL,Gt.ReadWrite,i.depthRangeFor3D),D=i.transform,L=f.mesh,F=L.material,O=F.pbrMetallicRoughness,$=i.style.fog;let q;q=i.transform.projection.zAxisUnit==="pixels"?[...f.nodeModelMatrix]:s.az([],p.zScaleMatrix,f.nodeModelMatrix),s.az(q,p.negCameraPosMatrix,q);const W=s.bi([],q);s.ee(W,W);const K=l.paint.get("model-color-use-theme").constantOr("default")==="none",Z=l.paint.get("model-emissive-strength").constantOr(0),se=Bn(new Float32Array(f.worldViewProjection),new Float32Array(q),new Float32Array(W),null,i,w,O.baseColorFactor.toRenderColor(null),F.emissiveFactor,O.metallicFactor,O.roughnessFactor,F,Z,l),ue={defines:[]},fe=[],xe=i.shadowRenderer;xe&&(xe.useNormalOffset=!1),It(ue.defines,fe,L,i,K?null:l.lut);let _e=null;if($){const Se=Qu(f.nodeModelMatrix,i.transform);if(_e=new Float32Array(Se),D.projection.name!=="globe"){const Ae=L.aabb.min,Ge=L.aabb.max,[Ne,lt]=$.getOpacityForBounds(Se,Ae[0],Ae[1],Ge[0],Ge[1]);ue.overrideFog=Ne>=Ht||lt>=Ht}}const ye=Nl(i,l.paint.get("model-cutoff-fade-range"));ye.shouldRenderCutoff&&ue.defines.push("RENDER_CUTOFF");const pe=i.getOrCreateProgram("model",ue);i.uploadCommonUniforms(S,pe,null,_e,ye),i.renderPass!=="shadow"&&xe&&xe.setupShadowsFromMatrix(f.nodeModelMatrix,pe),pe.draw(i,S.gl.TRIANGLES,C,y,v,L.material.doubleSided?Di.disabled:Di.backCCW,se,l.id,L.vertexBuffer,L.indexBuffer,L.segments,l.paint,i.transform.zoom,void 0,fe)}function eh(f,i,l,p,y,v,w){let S;S=f.projection.name==="globe"?s.ef(l,f):[...l],s.az(S,S,i.matrix);const C=s.az([],p,S);if(i.meshes)for(const D of i.meshes){if(D.material.alphaMode!=="BLEND"){w.push({mesh:D,depth:0,modelIndex:y,worldViewProjection:C,nodeModelMatrix:S});continue}const L=s.ad([],D.centroid,C);!f.isOrthographic&&L[2]<=0||v.push({mesh:D,depth:L[2],modelIndex:y,worldViewProjection:C,nodeModelMatrix:S})}if(i.children)for(const D of i.children)eh(f,D,l,p,y,v,w)}function Ys(f,i,l,p){const y=l.shadowRenderer;if(!y)return;const v=y.getShadowPassDepthMode(),w=y.getShadowPassColorMode(),S=y.calculateShadowPassMatrixFromMatrix(i),C=ms(S);l.getOrCreateProgram("modelDepth",{defines:l._shadowMapDebug?[]:["DEPTH_TEXTURE"]}).draw(l,l.context.gl.TRIANGLES,v,Ii.disabled,w,Di.backCCW,C,p.id,f.vertexBuffer,f.indexBuffer,f.segments,p.paint,l.transform.zoom,void 0,void 0)}function $e(f,i,l){const p=i.updateZoomBasedPaintProperties(),y=function(v,w,S){let C,D,L,F=v.terrain?v.terrain.exaggeration():0;if(v.terrain&&F>0){const O=v.terrain,$=O.findDEMTileFor(S);$&&$.dem?C=s.el.create(O,S,$):F=0}if(F===0&&(w.terrainElevationMin=0,w.terrainElevationMax=0),F===w.validForExaggeration&&(F===0||C&&C._demTile&&C._demTile.tileID===w.validForDEMTile.id&&C._dem._timestamp===w.validForDEMTile.timestamp))return!1;for(const O in w.instancesPerModel){const $=w.instancesPerModel[O];for(let q=0;q<$.instancedDataArray.length;++q){const W=(C?F*C.getElevationAt(0|$.instancedDataArray.float32[16*q],0|$.instancedDataArray.float32[16*q+1],!0,!0):0)+$.instancesEvaluatedElevation[q];$.instancedDataArray.float32[16*q+6]=W,D=D?Math.min(w.terrainElevationMin,W):W,L=L?Math.max(w.terrainElevationMax,W):W}}return w.terrainElevationMin=D||0,w.terrainElevationMax=L||0,w.validForExaggeration=F,w.validForDEMTile=C&&C._demTile?{id:C._demTile.tileID,timestamp:C._dem._timestamp}:{id:void 0,timestamp:0},!0}(f,i,l);(p||y)&&(i.uploaded=!1,i.upload(f.context))}const cl={shadowUniformsInitialized:!1,useSingleShadowCascade:!1,tileMatrix:new Float64Array(16),shadowTileMatrix:new Float32Array(16),aabb:new s.cV([0,0,0],[s.aj,s.aj,0])};function am(f,i){const l=1<<f.canonical.z,p=i.getFreeCameraOptions().position,y=i.elevation,v=f.canonical.x/l,w=(f.canonical.x+1)/l,S=f.canonical.y/l,C=(f.canonical.y+1)/l;let D=i._centerAltitude;if(y){const $=y.getMinMaxForTile(f);$&&$.max>D&&(D=$.max)}const L=s.aD(p.x,v,w)-p.x,F=s.aD(p.y,S,C)-p.y,O=s.c6(D,i.center.lat)-p.z;return i._zoomFromMercatorZ(Math.sqrt(L*L+F*F+O*O))}function lm(f,i,l,p,y,v,w){const S=f.context,C=f.renderPass==="shadow",D=f.shadowRenderer,L=C&&D?D.getShadowPassDepthMode():new Gt(S.gl.LEQUAL,Gt.ReadWrite,f.depthRangeFor3D),F=f.isTileAffectedByFog(v);
3241if(l.meshes)for(const O of l.meshes){const $=["MODEL_POSITION_ON_GPU"],q=[];let W,K,Z;p.instancedDataArray.length>20&&$.push("INSTANCED_ARRAYS");const se=Nl(f,i.paint.get("model-cutoff-fade-range"));if(se.shouldRenderCutoff&&$.push("RENDER_CUTOFF"),C&&D)W=f.getOrCreateProgram("modelDepth",{defines:$}),K=ms(w.shadowTileMatrix,w.shadowTileMatrix,Float32Array.from(l.matrix)),Z=D.getShadowPassColorMode();else{It($,q,O,f,i.paint.get("model-color-use-theme").constantOr("default")==="none"?null:i.lut),W=f.getOrCreateProgram("model",{defines:$,overrideFog:F});const fe=O.material,xe=fe.pbrMetallicRoughness,_e=i.paint.get("model-opacity").constantOr(1),ye=i.paint.get("model-emissive-strength").constantOr(0);K=Bn(v.expandedProjMatrix,Float32Array.from(l.matrix),new Float32Array(16),null,f,_e,xe.baseColorFactor.toRenderColor(null),fe.emissiveFactor,xe.metallicFactor,xe.roughnessFactor,fe,ye,i,y),D&&(w.shadowUniformsInitialized?W.setShadowUniformValues(S,D.getShadowUniformValues()):(D.setupShadows(v.toUnwrapped(),W,"model-tile",v.overscaledZ),w.shadowUniformsInitialized=!0)),Z=se.shouldRenderCutoff||_e<1||fe.alphaMode!=="OPAQUE"?en.alphaBlended:en.unblended}f.uploadCommonUniforms(S,W,v.toUnwrapped(),null,se);const ue=O.material.doubleSided?Di.disabled:Di.backCCW;if(p.instancedDataArray.length>20)q.push(p.instancedDataBuffer),W.draw(f,S.gl.TRIANGLES,L,Ii.disabled,Z,ue,K,i.id,O.vertexBuffer,O.indexBuffer,O.segments,i.paint,f.transform.zoom,void 0,q,p.instancedDataArray.length);else{const fe=C?"u_instance":"u_normal_matrix";for(let xe=0;xe<p.instancedDataArray.length;++xe)K[fe]=new Float32Array(p.instancedDataArray.arrayBuffer,64*xe,16),W.draw(f,S.gl.TRIANGLES,L,Ii.disabled,Z,ue,K,i.id,O.vertexBuffer,O.indexBuffer,O.segments,i.paint,f.transform.zoom,void 0,q)}}if(l.children)for(const O of l.children)lm(f,i,O,p,y,v,w)}const Og=[1,-1,1];function n0(f,i,l,p){if(!l.modelManager)return!0;const y=l.modelManager;if(!l.shadowRenderer)return!0;const v=l.shadowRenderer,w=i.aabb;let S=!0,C=f.maxHeight;if(C===0){let L=0;for(const F in f.instancesPerModel){const O=y.getModel(F,p);O?L=Math.max(L,Math.max(Math.max(O.aabb.max[0],O.aabb.max[1]),O.aabb.max[2])):S=!1}C=f.maxScale*L*1.41+f.maxVerticalOffset,S&&(f.maxHeight=C)}w.max[2]=C,w.min[2]+=f.terrainElevationMin,w.max[2]+=f.terrainElevationMax,s.ad(w.min,w.min,i.tileMatrix),s.ad(w.max,w.max,i.tileMatrix);const D=w.intersects(v.getCurrentCascadeFrustum());return l.currentShadowCascade===0&&(f.isInsideFirstShadowMapFrustum=D===2),D===0}function s0(f,i){const l=f.uniformValues.u_cutoff_params[0],p=f.uniformValues.u_cutoff_params[1],y=f.uniformValues.u_cutoff_params[2],v=f.uniformValues.u_cutoff_params[3];return p===l||v===y?1:s.aD(((i-l)/(p-l)-y)/(v-y),0,1)}function hd(f,i,l,p){if(i.pitch<20)return 1;const y=i.getWorldToCameraMatrix();s.az(y,y,f);const v=s.ei(l.min[0],l.min[1],l.min[2],1);let w=s.aA(s.ej(),v,y),S=w,C=w;v[1]=l.max[1],w=s.aA(s.ej(),v,y),S=w[1]<S[1]?w:S,C=w[1]>C[1]?w:C,v[0]=l.max[0],w=s.aA(s.ej(),v,y),S=w[1]<S[1]?w:S,C=w[1]>C[1]?w:C,v[1]=l.min[1],w=s.aA(s.ej(),v,y),S=w[1]<S[1]?w:S,C=w[1]>C[1]?w:C;const D=s.aD(p[0],0,1),L=100*i.pixelsPerMeter*s.aD(p[1],0,1),F=s.aD(p[2],0,1),O=s.ek(s.ej(),S,C,D),$=Math.tan(.5*i.fovX),q=-O[2]*$;if(L===0)return O[1]<-Math.abs(q)?F:1;const W=(-Math.abs(q)-O[1])/L,K=(se,ue,fe)=>(1-fe)*se+fe*ue,Z=s.aD(K(1,F,W),F,1);return K(1,Z,s.aD((i.pitch-20)/20,0,1))}class C1{}class I1{constructor(){this._storage=new Map}getLinesFromTrianglesBuffer(i,l,p){{const F=this._storage.get(l.id);if(F)return F.lastUsedFrameIdx=i,F.buf}const y=p.gl,v=y.getBufferParameter(y.ELEMENT_ARRAY_BUFFER,y.BUFFER_SIZE),w=new ArrayBuffer(v),S=new Int16Array(w);y.getBufferSubData(y.ELEMENT_ARRAY_BUFFER,0,new Int16Array(w));const C=new s.en;for(let F=0;F<v/2;F+=3){const O=S[F],$=S[F+1],q=S[F+2];C.emplaceBack(O,$),C.emplaceBack($,q),C.emplaceBack(q,O)}const D=p.bindVertexArrayOES.current,L=new C1;return L.buf=new gs(p,C),L.lastUsedFrameIdx=i,this._storage.set(l.id,L),p.bindVertexArrayOES.set(D),L.buf}update(i){for(const[l,p]of this._storage)i-p.lastUsedFrameIdx>30&&(p.buf.destroy(),this._storage.delete(l))}destroy(){for(const[i,l]of this._storage)l.buf.destroy(),this._storage.delete(i)}}class r0{constructor(i){this.occluderSize=30,this.depthOffset=-1e-4,i.registerParameter(this,["Occlusion"],"occluderSize",{min:1,max:100,step:1}),i.registerParameter(this,["Occlusion"],"depthOffset",{min:-.05,max:0,step:1e-5})}}const cm=s.d_([{type:"Float32",name:"a_pos_3f",components:3},{type:"Float32",name:"a_uv",components:2},{type:"Float32",name:"a_rainParticleData",components:4}]);class zg{registerParameter(){}registerButton(){}registerBinding(){}refreshUI(){}}class Fg{constructor(i,l){this.revealStart=11,this.revealRange=2,i.registerParameter(this,[...l,"Reveal"],"revealStart",{min:0,max:17,step:.05}
3241),i.registerParameter(this,[...l,"Reveal"],"revealRange",{min:.1,max:5.1,step:.05})}}const o0=s.d_([{type:"Float32",name:"a_pos_2f",components:2}]);class um{destroy(){this.vignetteVx&&this.vignetteVx.destroy(),this.vignetteIdx&&this.vignetteIdx.destroy()}draw(i,l){const p=i.getOrCreateProgram("vignette");if(!this.vignetteVx||!this.vignetteIdx){const w=new s.eo,S=new s.a_;w.emplaceBack(-1,-1),w.emplaceBack(1,-1),w.emplaceBack(1,1),w.emplaceBack(-1,1),S.emplaceBack(0,1,2),S.emplaceBack(0,2,3),this.vignetteVx=i.context.createVertexBuffer(w,o0.members),this.vignetteIdx=i.context.createIndexBuffer(S)}const y=s.bd.simpleSegment(0,0,4,6);if(this.vignetteVx&&this.vignetteIdx){i.uploadCommonUniforms(i.context,p);const w={u_vignetteShape:(v={vignetteShape:[l.start,l.range,Math.pow(10,l.fadePower)],vignetteColor:[l.color.r,l.color.g,l.color.b,l.color.a*l.strength]}).vignetteShape,u_vignetteColor:v.vignetteColor};p.draw(i,i.context.gl.TRIANGLES,Gt.disabled,Ii.disabled,en.alphaBlended,Di.disabled,w,"vignette",this.vignetteVx,this.vignetteIdx,y)}var v}}class Lf{constructor(){this._accumulatedOffsetX=0,this._accumulatedOffsetY=0,this._accumulatedElevation=0}update(i,l){const p=i.getFreeCameraOptions().position,y=p.toAltitude(),v=p.toLngLat(),w=s.al(v.lng),S=s.al(v.lat),C=i.pixelsPerMeter/l,D=w*s.eq,L=s.eq*Math.log(Math.tan(Math.PI/4+S/2));if(this._offsetXPrev===void 0)this._offsetXPrev=0,this._offsetYPrev=0,this._elevationPrev=0,this._accumulatedOffsetX=0,this._accumulatedOffsetY=0,this._accumulatedElevation=0;else{const F=-this._offsetYPrev+L,O=-this._elevationPrev+y;this._accumulatedOffsetX+=(-this._offsetXPrev+D)*C,this._accumulatedOffsetY+=F*C,this._accumulatedElevation+=O*C,this._offsetXPrev=D,this._offsetYPrev=L,this._elevationPrev=y}}getPosition(){return[this._accumulatedOffsetX,this._accumulatedOffsetY,this._accumulatedElevation]}}function th(f,i){return[-(f[0]-Math.floor(f[0]/i)*i),-(f[1]-Math.floor(f[1]/i)*i),-(f[2]-Math.floor(f[2]/i)*i)]}function Bg(f){const i=s.ea(1323123451230),l=[];for(let p=0;p<f;++p){const y=2*i()-1,v=2*i()-1,w=2*i()-1;l.push(s.cS(y,v,w))}return l}function ou(f,i,l,p,y){const v=s.aD((y-l)/(p-l),0,1);return(1-v)*f+v*i}class Lo{constructor(i){this._movement=new Lf,this._accumulatedTimeFromStart=0,this._prevTime=Date.now()/1e3,this._vignette=new um,this._ppmScaleFactor=i}destroy(){this.particlesVx&&this.particlesVx.destroy(),this.particlesIdx&&this.particlesIdx.destroy(),this._vignette&&this._vignette.destroy()}updateOnRender(i,l){const p=i.transform;this._movement.update(p,this._ppmScaleFactor);const y=p.starsProjMatrix,v=s.bY([]);s.b_(v,v,s.al(90)-p._pitch),s.bZ(v,v,-p.angle);const w=s.c3(new Float32Array(16),v),S=s.ep(1,0,0,0,0,0,1,0,0,-1,0,0,0,0,0,1),C=s.ee([],S),D=s.az([],C,w),L=Date.now()/1e3;return this._accumulatedTimeFromStart+=(L-this._prevTime)*l,this._prevTime=L,{projectionMatrix:y,modelviewMatrix:D}}}class M1 extends Lo{constructor(i){super(4.25),this._params={overrideStyleParameters:!1,intensity:.5,timeFactor:1,velocityConeAperture:0,velocity:300,boxSize:2500,dropletSizeX:1,dropletSizeYScale:10,distortionStrength:70,screenThinning:{intensity:.57,start:.46,range:1.17,fadePower:.17,affectedRatio:1,particleOffset:-.2},color:{r:.66,g:.68,b:.74,a:.7},direction:{x:-50,y:-35},shapeDirPower:2,shapeNormalPower:1},this._revealParams=new Fg(i.tp,["Precipitation","Rain"]),this._vignetteParams={strength:1,start:.7,range:1,fadePower:.4,color:{r:.27,g:.27,b:.27,a:1}},this.particlesCount=16e3}update(i){const l=i.context;if(!this.particlesVx){const p=Bg(this.particlesCount),y=new s.er,v=new s.a_;let w=0;const S=s.ea(1323123451230);for(let C=0;C<p.length;++C){const D=p[C],L=[2*S()-1,S(),S(),S()];y.emplaceBack(D[0],D[1],D[2],-1,-1,...L),y.emplaceBack(D[0],D[1],D[2],1,-1,...L),y.emplaceBack(D[0],D[1],D[2],1,1,...L
3241),y.emplaceBack(D[0],D[1],D[2],-1,1,...L),v.emplaceBack(w+0,w+1,w+2),v.emplaceBack(w+0,w+2,w+3),w+=4}this.particlesVx=l.createVertexBuffer(y,cm.members),this.particlesIdx=l.createIndexBuffer(v)}}draw(i){if(!this._params.overrideStyleParameters&&!i.style.rain)return;const l=this._params.overrideStyleParameters?this._revealParams:{revealStart:0,revealRange:.01},p=i.transform.zoom;if(l.revealStart>p)return;const y=ou(0,1,l.revealStart,l.revealStart+l.revealRange,p);if(!this.particlesVx||!this.particlesIdx)return;const v=structuredClone(this._params);let w=[-v.direction.x,v.direction.y,-100];s.au(w,w);const S=structuredClone(this._vignetteParams);S.strength*=y,v.overrideStyleParameters||(v.intensity=i.style.rain.state.density,v.timeFactor=i.style.rain.state.intensity,v.color=structuredClone(i.style.rain.state.color),w=structuredClone(i.style.rain.state.direction),v.screenThinning.intensity=i.style.rain.state.centerThinning,v.dropletSizeX=i.style.rain.state.dropletSize[0],v.dropletSizeYScale=i.style.rain.state.dropletSize[1]/i.style.rain.state.dropletSize[0],v.distortionStrength=100*i.style.rain.state.distortionStrength,S.strength=1,S.color=structuredClone(i.style.rain.state.vignetteColor));const C=this.updateOnRender(i,v.timeFactor),D=i.context,L=D.gl,F=i.transform;this.screenTexture&&this.screenTexture.size[0]===i.width&&this.screenTexture.size[1]===i.height||(this.screenTexture=new s.T(D,{width:i.width,height:i.height,data:null},L.RGBA8)),v.distortionStrength>0&&(D.activeTexture.set(L.TEXTURE0),this.screenTexture.bind(L.LINEAR,L.CLAMP_TO_EDGE),L.copyTexSubImage2D(L.TEXTURE_2D,0,0,0,0,0,i.width,i.height));const O=i.getOrCreateProgram("rainParticle");i.uploadCommonUniforms(D,O),D.activeTexture.set(L.TEXTURE0),this.screenTexture.bind(L.LINEAR,L.CLAMP_TO_EDGE);const $=[v.color.r,v.color.g,v.color.b,v.color.a],q=(W,K)=>{const Z=th(this._movement.getPosition(),W),se=v.dropletSizeX,ue=v.dropletSizeX*v.dropletSizeYScale,fe=i.width/2,xe=i.height/2,_e=ou(0,v.screenThinning.start,0,1,v.screenThinning.intensity),ye=ou(.001,v.screenThinning.range,0,1,v.screenThinning.intensity),pe=ou(0,v.screenThinning.particleOffset,0,1,v.screenThinning.intensity),Se=(Ae={modelview:C.modelviewMatrix,projection:C.projectionMatrix,time:this._accumulatedTimeFromStart,camPos:Z,velocityConeAperture:v.velocityConeAperture,velocity:v.velocity,boxSize:W,rainDropletSize:[se,ue],distortionStrength:v.distortionStrength,rainDirection:w,color:$,screenSize:[F.width,F.height],thinningCenterPos:[fe,xe],thinningShape:[_e,ye,Math.pow(10,v.screenThinning.fadePower)],thinningAffectedRatio:v.screenThinning.affectedRatio,thinningParticleOffset:pe,shapeDirectionalPower:v.shapeDirPower,shapeNormalPower:v.shapeNormalPower,mode:K?0:1},{u_modelview:Float32Array.from(Ae.modelview),u_projection:Float32Array.from(Ae.projection),u_time:Ae.time,u_cam_pos:Ae.camPos,u_texScreen:0,u_velocityConeAperture:Ae.velocityConeAperture,u_velocity:Ae.velocity,u_boxSize:Ae.boxSize,u_rainDropletSize:Ae.rainDropletSize,u_distortionStrength:Ae.distortionStrength,u_rainDirection:Ae.rainDirection,u_color:Ae.color,u_screenSize:Ae.screenSize,u_thinningCenterPos:Ae.thinningCenterPos,u_thinningShape:Ae.thinningShape,u_thinningAffectedRatio:Ae.thinningAffectedRatio,u_thinningParticleOffset:Ae.thinningParticleOffset,u_shapeDirectionalPower:Ae.shapeDirectionalPower,u_shapeNormalPower:Ae.shapeNormalPower,u_mode:Ae.mode});var Ae;const Ge=Math.round(v.intensity*this.particlesCount),Ne=s.bd.simpleSegment(0,0,4*Ge,2*Ge);O.draw(i,L.TRIANGLES,Gt.disabled,Ii.disabled,en.alphaBlended,Di.disabled,Se,"rain_particles",this.particlesVx,this.particlesIdx,Ne)};v.distortionStrength>0&&q(v.boxSize,!0),q(v.boxSize,!1),this._vignette.draw(i,S)}}const Rf=s.d_([{type:"Float32",name:"a_pos_3f",components:3},{type:"Float32",name:"a_uv",components:2},{type:"Float32",name:"a_snowParticleData",components:4},{type:"Float32",name:"a_snowParticleDataHorizontalOscillation",components:2}]);class Ds extends Lo{constructor(i){super(2.25),this._params={overrideStyleParameters:!1,intensity:.85,timeFactor:.75,velocityConeAperture:70,velocity:40,horizontalOscillationRadius:4,horizontalOscillationRate:1.5,boxSize:2e3,billboardSize:2,shapeFadeStart:.27,shapeFadePower:.21,screenThinning:{intensity:.4,start:.15,range:1.4,fadePower:.24,affectedRatio:1,particleOffset:-.2},color:{r:1,g:1,b:1,a:1},direction:{x:-50,y:-35}},this._revealParams=new Fg(i.tp,["Precipitation","Snow"]),this._vignetteParam
3241s={strength:.3,start:.78,range:.46,fadePower:.2,color:{r:1,g:1,b:1,a:1}},this.particlesCount=16e3}update(i){const l=i.context;if(!this.particlesVx){const p=Bg(this.particlesCount),y=new s.es,v=new s.a_;let w=0;const S=s.ea(1323123451230);for(let C=0;C<p.length;++C){const D=p[C],L=S(),F=S(),O=S(),$=[C/p.length,L,F,O],q=[S(),S()];y.emplaceBack(D[0],D[1],D[2],-1,-1,...$,...q),y.emplaceBack(D[0],D[1],D[2],1,-1,...$,...q),y.emplaceBack(D[0],D[1],D[2],1,1,...$,...q),y.emplaceBack(D[0],D[1],D[2],-1,1,...$,...q),v.emplaceBack(w+0,w+1,w+2),v.emplaceBack(w+0,w+2,w+3),w+=4}this.particlesVx=l.createVertexBuffer(y,Rf.members),this.particlesIdx=l.createIndexBuffer(v)}}draw(i){if(!this._params.overrideStyleParameters&&!i.style.snow)return;const l=structuredClone(this._params);let p=[-l.direction.x,l.direction.y,-100];s.au(p,p);const y=structuredClone(this._vignetteParams),v=l.overrideStyleParameters?this._revealParams:{revealStart:0,revealRange:.01},w=i.transform.zoom;if(v.revealStart>w)return;const S=ou(0,1,v.revealStart,v.revealStart+v.revealRange,w);y.strength*=S,l.overrideStyleParameters||(l.intensity=i.style.snow.state.density,l.timeFactor=i.style.snow.state.intensity,l.color=structuredClone(i.style.snow.state.color),p=stru
3241cturedClone(i.style.snow.state.direction),l.screenThinning.intensity=i.style.snow.state.centerThinning,l.billboardSize=2.79*i.style.snow.state.flakeSize,y.strength=1,y.color=structuredClone(i.style.snow.state.vignetteColor));const C=this.updateOnRender(i,l.timeFactor);if(!this.particlesVx||!this.particlesIdx)return;const D=i.context,L=D.gl,F=i.transform,O=i.getOrCreateProgram("snowParticle");i.uploadCommonUniforms(D,O),(($,q,W)=>{const K=th(this._movement.getPosition(),$),Z=F.width/2,se=F.height/2,ue=ou(0,W.screenThinning.start,0,1,W.screenThinning.intensity),fe=ou(.001,W.screenThinning.range,0,1,W.screenThinning.intensity),xe=ou(0,W.screenThinning.particleOffset,0,1,W.screenThinning.intensity),_e=(ye={modelview:C.modelviewMatrix,projection:C.projectionMatrix,time:this._accumulatedTimeFromStart,camPos:K,velocityConeAperture:W.velocityConeAperture,velocity:W.velocity,horizontalOscillationRadius:W.horizontalOscillationRadius,horizontalOscillationRate:W.horizontalOscillationRate,boxSize:$,billboardSize:1*W.billboardSize,simpleShapeParameters:[W.shapeFadeStart,W.shapeFadePower],screenSize:[F.width,F.height],thinningCenterPos:[Z,se],thinningShape:[ue,fe,Math.pow(10,W.screenThinning.fadePower)],thinningAffectedRatio:W.screenThinning.affectedRatio,thinningParticleOffset:xe,color:[W.color.r,W.color.g,W.color.b,W.color.a],direction:p},{u_modelview:Float32Array.from(ye.modelview),u_projection:Float32Array.from(ye.projection),u_time:ye.time,u_cam_pos:ye.camPos,u_velocityConeAperture:ye.velocityConeAperture,u_velocity:ye.velocity,u_horizontalOscillationRadius:ye.horizontalOscillationRadius,u_horizontalOscillationRate:ye.horizontalOscillationRate,u_boxSize:ye.boxSize,u_billboardSize:ye.billboardSize,u_simpleShapeParameters:ye.simpleShapeParameters,u_screenSize:ye.screenSize,u_thinningCenterPos:ye.thinningCenterPos,u_thinningShape:ye.thinningShape,u_thinningAffectedRatio:ye.thinningAffectedRatio,u_thinningParticleOffset:ye.thinningParticleOffset,u_particleColor:ye.color,u_direction:ye.direction});var ye;const pe=Math.round(W.intensity*this.particlesCount),Se=s.bd.simpleSegment(0,0,4*pe,2*pe);this.particlesVx&&this.particlesIdx&&O.draw(i,L.TRIANGLES,Gt.disabled,Ii.disabled,en.alphaBlended,Di.disabled,_e,"snow_particles",this.particlesVx,this.particlesIdx,Se)})(l.boxSize,0,l),this._vignette.draw(i,y)}}const Rn={symbol:function(f,i,l,p,y){if(f.renderPass!=="translucent")return;const v=Ii.disabled,w=f.colorModeForRenderPass(),S=l.layout.get("text-variable-anchor"),C=l.layout.get("text-size-scale-range"),D=s.aD(f.scaleFactor,C[0],C[1]);S&&function(O,$,q,W,K,Z,se,ue){const fe=$.transform,xe=K==="map",_e=Z==="map";for(const ye of O){const pe=W.getTile(ye),Se=pe.getBucket(q);if(!Se||!Se.text||!Se.text.segments.get().length)continue;const Ae=s.bH(Se.textSizeData,fe.zoom,ue),Ge=Ll(ye,Se.getProjection(),fe),Ne=fe.calculatePixelsToTileUnitsMatrix(pe),lt=Pl(Ge,pe.tileID.canonical,_e,xe,fe,Se.getProjection(),Ne),st=Se.hasIconTextFit()&&Se.hasIconData();Ae&&ia(Se,xe,_e,se,fe,lt,ye,Math.pow(2,fe.zoom-pe.tileID.overscaledZ),Ae,st)}}(p,f,l,i,l.layout.get("text-rotation-alignment"),l.layout.get("text-pitch-alignment"),y,D);const L=l.paint.get("icon-opacity").constantOr(1)!==0,F=l.paint.get("text-opacity").constantOr(1)!==0;l.layout.get("symbol-sort-key").constantOr(1)!==void 0&&(L||F)?rl(f,i,l,p,v,w):(L&&rl(f,i,l,p,v,w,{onlyIcons:!0}),F&&rl(f,i,l,p,v,w,{onlyText:!0})),i.map.showCollisionBoxes&&(so(f,i,l,p,l.paint.get("text-translate"),l.paint.get("text-translate-anchor"),!0),so(f,i,l,p,l.paint.get("icon-translate"),l.paint.get("icon-translate-anchor"),!1))},circle:function(f,i,l,p){if(f.renderPass!=="translucent")return;const y=l.paint.get("circle-opacity"),v=l.paint.get("circle-stroke-width"),w=l.paint.get("circle-stroke-opacity"),S=l.layout.get("circle-sort-key").constantOr(1)!==void 0,C=l.paint.get("circle-emissive-strength");if(y.constantOr(1)===0&&(v.constantOr(1)===0||w.constantOr(1)===0))return;const D=f.context,L=D.gl,F=f.transform,O=f.depthModeForSublayer(0,Gt.ReadOnly),$=Ii.disabled,q=f.colorModeForDrapableLayerRenderPass(C),W=F.projection.name==="globe",K=[s.ay(F.center.lng),s.aH(F.center.lat)],Z=[];for(let ue=0;ue<p.length;ue++){const fe=p[ue],xe=i.getTile(fe),_e=xe.getBucket(l);if(!_e||_e.projection.name!==F.projection.name)continue;const ye=_e.programConfigurations.get(l.id),pe=s.dK(l),Se=f.isTileAffectedByFog(fe);W&&pe.push("PROJECTION_GLOBE_VIEW"),pe.push("DEPTH_D24"),f.terrain&&F.depthOcclusionForSymbolsAndCircles&&pe.push("DEPTH_OCCLUSION");const Ae=f.getOrCreateProgram("circle",{config:ye,defines:pe,overrideFog:Se}),Ge=_e.layoutVertexBuffer,Ne=_e.globeExtVertexBuffer,lt=_e.indexBuffer,st=F.projection.createInversionMatrix(F,fe.canonical),Et={programConfiguration:ye,program:Ae,layoutVertexBuffer:Ge,globeExtVertexBuffer:Ne,indexBuffer:lt,uniformValues:s.dL(f,fe,xe,st,K,l),tile:xe};if(S){const Be=_e.segments.get();for(const We of Be)Z.push({segments:new s.bd([We]),sortKey:We.sortKey,state:Et})}
3241else Z.push({segments:_e.segments,sortKey:0,state:Et})}S&&Z.sort((ue,fe)=>ue.sortKey-fe.sortKey);const se={useDepthForOcclusion:F.depthOcclusionForSymbolsAndCircles};for(const ue of Z){const{programConfiguration:fe,program:xe,layoutVertexBuffer:_e,globeExtVertexBuffer:ye,indexBuffer:pe,uniformValues:Se,tile:Ae}=ue.state,Ge=ue.segments;f.terrain&&f.terrain.setupElevationDraw(Ae,xe,se),f.uploadCommonUniforms(D,xe,Ae.tileID.toUnwrapped()),xe.draw(f,L.TRIANGLES,O,$,q,Di.disabled,Se,l.id,_e,pe,Ge,l.paint,F.zoom,fe,[ye])}},heatmap:function(f,i,l,p){if(l.paint.get("heatmap-opacity")!==0)if(f.renderPass==="offscreen"){const y=f.context,v=y.gl,w=Ii.disabled,S=new en([v.ONE,v.ONE,v.ONE,v.ONE],s.am.transparent,[!0,!0,!0,!0]);(function($,q,W,K){const Z=$.gl,se=q.width*K,ue=q.height*K;$.activeTexture.set(Z.TEXTURE1),$.viewport.set([0,0,se,ue]);let fe=W.heatmapFbo;if(!fe||fe&&(fe.width!==se||fe.height!==ue)){fe&&fe.destroy();const xe=Z.createTexture();Z.bindTexture(Z.TEXTURE_2D,xe),Z.texParameteri(Z.TEXTURE_2D,Z.TEXTURE_WRAP_S,Z.CLAMP_TO_EDGE),Z.texParameteri(Z.TEXTURE_2D,Z.TEXTURE_WRAP_T,Z.CLAMP_TO_EDGE),Z.texParameteri(Z.TEXTURE_2D,Z.TEXTURE_MIN_FILTER,Z.LINEAR),Z.texParameteri(Z.TEXTURE_2D,Z.TEXTURE_MAG_FILTER,Z.LINEAR),fe=W.heatmapFbo=$.createFramebuffer(se,ue,!0,null),function(_e,ye,pe,Se,Ae,Ge){const Ne=_e.gl;Ne.texImage2D(Ne.TEXTURE_2D,0,_e.extRenderToTextureHalfFloat?Ne.RGBA16F:Ne.RGBA,Ae,Ge,0,Ne.RGBA,_e.extRenderToTextureHalfFloat?Ne.HALF_FLOAT:Ne.UNSIGNED_BYTE,null),Se.colorAttachment.set(pe)}($,0,xe,fe,se,ue)}else Z.bindTexture(Z.TEXTURE_2D,fe.colorAttachment.get()),$.bindFramebuffer.set(fe.framebuffer)})(y,f,l,f.transform.projection.name==="globe"?.5:.25),y.clear({color:s.am.transparent});const C=f.transform,D=C.projection.name==="globe",L=D?["PROJECTION_GLOBE_VIEW"]:[],F=D?Di.frontCCW:Di.disabled,O=[s.ay(C.center.lng),s.aH(C.center.lat)];for(let $=0;$<p.length;$++){const q=p[$];if(i.hasRenderableParent(q))continue;const W=i.getTile(q),K=W.getBucket(l);if(!K||K.projection.name!==C.projection.name)continue;const Z=f.isTileAffectedByFog(q),se=K.programConfigurations.get(l.id),ue=f.getOrCreateProgram("heatmap",{config:se,defines:L,overrideFog:Z}),{zoom:fe}=f.transform;f.terrain&&f.terrain.setupElevationDraw(W,ue),f.uploadCommonUniforms(y,ue,q.toUnwrapped());const xe=C.projection.createInversionMatrix(C,q.canonical);ue.draw(f,v.TRIANGLES,Gt.disabled,w,S,F,ii(f,q,W,xe,O,fe,l.paint.get("heatmap-intensity")),l.id,K.layoutVertexBuffer,K.indexBuffer,K.segments,l.paint,f.transform.zoom,se,D?[K.globeExtVertexBuffer]:null)}y.viewport.set([0,0,f.width,f.height])}else f.renderPass==="translucent"&&(f.context.setColorMode(f.colorModeForRenderPass()),function(y,v){const w=y.context,S=w.gl,C=v.heatmapFbo;if(!C)return;w.activeTexture.set(S.TEXTURE0),S.bindTexture(S.TEXTURE_2D,C.colorAttachment.get()),w.activeTexture.set(S.TEXTURE1);let D=v.colorRampTexture;D||(D=v.colorRampTexture=new s.T(w,v.colorRamp,S.RGBA8)),D.bind(S.LINEAR,S.CLAMP_TO_EDGE),y.getOrCreateProgram("heatmapTexture").draw(y,S.TRIANGLES,Gt.disabled,Ii.disabled,y.colorModeForRenderPass(),Di.disabled,((L,F,O,$)=>({u_image:0,u_color_ramp:1,u_opacity:F.paint.get("heatmap-opacity")}))(0,v),v.id,y.viewportBuffer,y.quadTriangleIndexBuffer,y.viewportSegments,v.paint,y.transform.zoom)}(f,l))},line:function(f,i,l,p){if(f.renderPass!=="translucent")return;const y=l.paint.get("line-opacity"),v=l.paint.get("line-width");if(y.constantOr(1)===0||v.constantOr(1)===0)return;const w=l.paint.get("line-emissive-strength"),S=l.paint.get("line-occlusion-opacity"),C=l.layout.get("line-elevation-reference"),D=l.layout.get("line-width-unit")==="meters",L=C==="sea",F=!(!f.terrain||!f.terrain.enabled),O=f.context,$=O.gl;if(l.hasElevatedBuckets&&f.transform.projection.name==="globe")return;const q=l.layout.get("line-cross-slope"),W=q!==void 0,K=q<1,Z=f.colorModeForDrapableLayerRenderPass(w),se=f.terrain&&f.terrain.renderingToTexture,ue=se?1:s.q.devicePixelRatio,fe=l.paint.get("line-dasharray"),xe=fe.constantOr(1),_e=l.layout.get("line-cap"),ye=fe.constantOr(null),pe=_e.constantOr(null),Se=l.paint.get("line-pattern"),Ae=Se.constantOr(1),Ge=l.paint.get("line-pattern-cross-fade"),Ne=Se.constantOr(null),lt=l.paint.get("line-opacity").constantOr(1);let st=!Ae&<!==1||f.depthOcclusion&&S>0&&S<1;const Et=l.paint.get("line-gradient"),Be=Ae?"linePattern":"line",We=s.dM(l);let Re;if(se&&f.terrain&&f.terrain.clipOrMaskOverlapStencilType()&&(st=!1),S!==0&&f.depthOcclusion){const ct=l.paint._values["line-opacity"];ct&&ct.value&&ct.value.kind==="constant"?Re=ct.value:s.w(`Occlusion opacity for layer ${l.id} is supported only when line-opacity isn't data-driven.`)}v.value.kind!=="constant"&&v.value.isLineProgressConstant===!1&&We.push("VARIABLE_LINE_WIDTH");const ht=(ct,yt,xt,Qt,ci,Kt)=>{for(const hi of ct){const ni=i.getTile(hi);if(Ae&&!ni.patternsLoaded())continue;const bi=ni.getBucket(l);if(!bi||bi.elevationType!=="none"&&!ci||bi.elevationType==="none"&&ci)continue;f.prepareDrawTile();const Vi=[...yt],un=f.shadowRenderer,is=bi.elevationType==="road"&&!!un&&un.enabled;let Zn=[0,0,0];if(is){const tn=f.style.directionalLight,Cs=f.style.ambientLight;tn&&Cs&&(Zn=va(f.style,tn,Cs)),Vi.push("RENDER_SHADOWS","DEPTH_TEXTURE","NORMAL_OFFSET")}const dn=bi.programConfigurations.get(l.id);let Zs=!1;if(Ne&&ni.imageAtlas){const tn=s.dN.from(Ne),Cs=tn.getPrimary().scaleSelf(ue).toString(),In=ni.imageAtlas.patternPositions.get(Cs),Is=tn.getSecondary(),Nn=Is?ni.imageAtlas.patternPositions.get(Is.scaleSelf(ue).toString()):null;Zs=!!In&&!!Nn,In&&dn.setConstantPatternPositions(In,Nn)}Ge>0&&(Zs||dn.getPatternTransitionVertexBuffer("line-pattern"))&&Vi.push("LINE_PATTERN_TRANSITION");const zs=f.isTileAffectedByFog(hi),Zi=f.getOrCreateProgram(Be,{config:dn,defines:Vi,overrideFog:zs,overrideRtt:!ci&&void 0});if(!Ae&&ye&&pe&&ni.lineAtlas){const tn=ni.lineAtlas.getDash(ye,pe);tn&&dn.setConstantPatternPositions(tn)}is&&un.setupShadows(ni.tileID.toUnwrapped(),Zi,"vector-tile",ni.tileID.overscaledZ
3241);let[bn,Dn]=l.paint.get("line-trim-offset");(pe==="round"||pe==="square")&&bn!==Dn&&(bn===0&&(bn-=1),Dn===1&&(Dn+=1));const ns=se?hi.projMatrix:null,fr=D?1/bi.tileToMeter/s.aw(ni,1,f.transform.zoom):1,Ks=D?1/bi.tileToMeter/s.aw(ni,1,Math.floor(f.transform.zoom)):1,ur=Ae?s.dO(f,ni,l,ns,ue,fr,Ks,[bn,Dn],Zn,Ge):s.dP(f,ni,l,ns,bi.lineClipsArray.length,ue,fr,Ks,[bn,Dn],Zn);if(Et){const tn=bi.gradients[l.id];let Cs=tn.texture;if(l.gradientVersion!==tn.version){let In=256;if(l.stepInterpolant){const Is=i.getSource().maxzoom,Nn=hi.canonical.z===Is?Math.ceil(1<<f.transform.maxZoom-hi.canonical.z):1;In=s.aD(s.dQ(bi.maxLineLength/s.aj*1024*Nn),256,O.maxTextureSize)}tn.gradient=s.dR({expression:l.gradientExpression(),evaluationKey:"lineProgress",resolution:In,image:tn.gradient||void 0,clips:bi.lineClipsArray}),tn.texture?tn.texture.update(tn.gradient):tn.texture=new s.T(O,tn.gradient,$.RGBA8),tn.version=l.gradientVersion,Cs=tn.texture}O.activeTexture.set($.TEXTURE1),Cs.bind(l.stepInterpolant?$.NEAREST:$.LINEAR,$.CLAMP_TO_EDGE)}xe&&(O.activeTexture.set($.TEXTURE0),ni.lineAtlasTexture&&ni.lineAtlasTexture.bind($.LINEAR,$.REPEAT),dn.updatePaintBuffers()),Ae&&(O.activeTexture.set($.TEXTURE0),ni.imageAtlasTexture&&ni.imageAtlasTexture.bind($.LINEAR,$.CLAMP_TO_EDGE),dn.updatePaintBuffers()),ci&&!L&&f.terrain.setupElevationDraw(ni,Zi),f.uploadCommonUniforms(O,Zi,hi.toUnwrapped());const ks=tn=>{Re!=null&&(Re.value=lt*S),Zi.draw(f,$.TRIANGLES,xt,tn,Z,Di.disabled,ur,l.id,bi.layoutVertexBuffer,bi.indexBuffer,bi.segments,l.paint,f.transform.zoom,dn,[bi.layoutVertexBuffer2,bi.patternVertexBuffer,bi.zOffsetVertexBuffer]),Re!=null&&(Re.value=lt)};if(st&&!ci){const tn=f.stencilModeForClipping(hi).ref;tn===0&&se&&O.clear({stencil:0});const Cs={func:$.EQUAL,mask:255};ur.u_alpha_discard_threshold=.8,ks(new Ii(Cs,tn,255,$.KEEP,$.KEEP,$.INVERT)),ur.u_alpha_discard_threshold=0,ks(new Ii(Cs,tn,255,$.KEEP,$.KEEP,$.KEEP))}else ur.u_alpha_discard_threshold=st&&ci&&Kt?.8:0,ks(ci?Qt:f.stencilModeForClipping(hi))}};let Xe=f.depthModeForSublayer(0,Gt.ReadOnly);const gt=new Gt(f.depthOcclusion?$.GREATER:$.LEQUAL,Gt.ReadOnly,f.depthRangeFor3D);if(l.hasNonElevatedBuckets){const ct=!se&&f.terrain;S!==0&&ct?s.w(`Occlusion opacity for layer ${l.id} is supported on terrain only if the layer has line-z-offset enabled.`):ct?s.w(`Cannot render non-elevated lines in immediate mode when terrain is enabled. Layer: ${l.id}.`):ht(p,We,Xe,Ii.disabled,!1,!0)}if(l.hasElevatedBuckets){C==="hd-road-markup"?F||(Xe=gt,We.push("ELEVATED_ROADS")):(We.push("ELEVATED"),Xe=gt,W&&We.push(K?"CROSS_SLOPE_HORIZONTAL":"CROSS_SLOPE_VERTICAL"),L&&We.push("ELEVATION_REFERENCE_SEA"));const ct=st?f.stencilModeFor3D():Ii.disabled;f.forceTerrainMode=!0,ht(p,We,Xe,ct,!0,!0),st&&ht(p,We,Xe,ct,!0,!1),f.forceTerrainMode=!1}st&&(f.resetStencilClippingMasks(),se&&O.clear({stencil:0})),S===0||f.depthOcclusion||se||f.layersWithOcclusionOpacity.push(f.currentLayer)},fill:function(f,i,l,p){const y=l.paint.get("fill-color"),v=l.paint.get("fill-opacity");if(v.constantOr(1)===0)return;const w=l.paint.get("fill-emissive-strength"),S=f.colorModeForDrapableLayerRenderPass(w),C=l.paint.get("fill-pattern"),D=f.opaquePassEnabledForLayer()&&!C.constantOr(1)&&y.constantOr(s.am.transparent).a===1&&v.constantOr(0)===1?"opaque":"translucent";let L="none";l.layout.get("fill-elevation-reference")!=="none"?L="road":l.paint.get("fill-z-offset").constantOr(1)!==0&&(L="offset");const F=!(!f.terrain||!f.terrain.enabled),O={painter:f,sourceCache:i,layer:l,coords:p,colorMode:S,elevationType:L,terrainEnabled:F,pass:D};if(f.renderPass!=="shadow")if(L!=="offset"){if(Vt(O,!1),L==="road"){const $=!F&&f.renderPass==="translucent";$&&Nr(f,i,l,p,"geometry"),Vt(O,!0,Ii.disabled),$&&function(q){const{painter:W,sourceCache:K,layer:Z,coords:se,colorMode:ue}=q,fe=W.context.gl,xe=q.painter.shadowRenderer,_e=!!xe&&xe.enabled,ye=new Gt(W.context.gl.LEQUAL,Gt.ReadOnly,W.depthRangeFor3D);let pe=[0,0,0];if(_e){const Se=W.style.directionalLight,Ae=W.style.ambientLight;Se&&Ae&&(pe=va(W.style,Se,Ae))}for(const Se of se){const Ae=K.getTile(Se),Ge=Ae.getBucket(Z);if(!Ge)continue;const Ne=Ge.elevatedStructures;if(!Ne||!Ne.renderableSegments||Ne.renderableSegments.segments[0].primitiveLength===0)continue;W.prepareDrawTile();const lt=Ge.bufferData.programConfigurations.get(Z.id),st=W.isTileAffectedByFog(Se),Et=[];_e&&Et.push("RENDER_SHADOWS","DEPTH_TEXTURE","NORMAL_OFFSET");const Be=W.getOrCreateProgram("elevatedStructures",{config:lt,overrideFog:st,defines:Et}),We=W.translatePosMatrix(Se.projMatrix,Ae,Z.paint.get("fill-translate"),Z.paint.get("fill-translate-anchor"));_e&&xe.setupShadows(Ae.tileID.toUnwrapped(),Be,"vector-tile",Ae.tileID.overscaledZ
3241);const Re=ee(We,pe);W.uploadCommonUniforms(W.context,Be,Se.toUnwrapped()),Be.draw(W,fe.TRIANGLES,ye,Ii.disabled,ue,Di.backCCW,Re,Z.id,Ne.vertexBuffer,Ne.indexBuffer,Ne.renderableSegments,Z.paint,W.transform.zoom,lt,[Ne.vertexBufferNormal])}}(O)}}else Vt(O,!1,f.stencilModeFor3D());else f.shadowRenderer&&L==="road"&&!F&&function($){const{painter:q,sourceCache:W,layer:K,coords:Z}=$,se=q.context.gl,ue=$.painter.shadowRenderer;for(const fe of Z){const xe=W.getTile(fe),_e=xe.getBucket(K);if(!_e)continue;const ye=_e.elevatedStructures;if(!ye||!ye.shadowCasterSegments||ye.shadowCasterSegments.segments[0].primitiveLength===0)continue;q.prepareDrawTile();const pe=_e.bufferData.programConfigurations.get(K.id),Se=q.isTileAffectedByFog(fe),Ae=q.getOrCreateProgram("elevatedStructuresDepth",{config:pe,overrideFog:Se}),Ge=ue.calculateShadowPassMatrixFromTile(xe.tileID.toUnwrapped());q.uploadCommonUniforms(q.context,Ae,fe.toUnwrapped());const Ne={u_matrix:Ge,u_depth_bias:.001};Ae.draw(q,se.TRIANGLES,ue.getShadowPassDepthMode(),Ii.disabled,ue.getShadowPassColorMode(),Di.disabled,Ne,K.id,ye.vertexBuffer,ye.indexBuffer,ye.shadowCasterSegments,K.paint,q.transform.zoom,pe)}}(O)},"fill-extrusion":function(f,i,l,p){const y=l.paint.get("fill-extrusion-opacity"),v=f.context,w=v.gl,S=f.terrain,C=S&&S.renderingToTexture;if(y===0)return;const D=f.conflationActive&&f.style.isLayerClipped(l,i.getSource()),L=f.style.order.indexOf(l.fqid);if(D&&function(F,O,$,q,W){for(const K of q){const Z=O.getTile(K).getBucket($);Z&&(Z.updateReplacement(K,F.replacementSource,W),Z.uploadCentroid(F.context))}}(f,i,l,p,L),S||D)for(const F of p){const O=i.getTile(F).getBucket(l);O&&ol(f.context,i,F,O,l,S,D)}if(f.renderPass==="shadow"&&f.shadowRenderer){const F=f.shadowRenderer;if(S&&y<.65&&l._transitionablePaint._values["fill-extrusion-opacity"].value.expression instanceof s.ab)return;const O=F.getShadowPassDepthMode(),$=F.getShadowPassColorMode();na(f,i,l,p,O,Ii.disabled,$,D)}else if(f.renderPass==="translucent"){const F=!l.paint.get("fill-extrusion-pattern").constantOr(1),O=l.paint.get("fill-extrusion-color").constantOr(s.am.white);if(!C&&O.a!==0){const $=new Gt(f.context.gl.LEQUAL,Gt.ReadWrite,f.depthRangeFor3D);y===1&&F?na(f,i,l,p,$,Ii.disabled,en.unblended,D):(na(f,i,l,p,$,Ii.disabled,en.disabled,D),na(f,i,l,p,$,f.stencilModeFor3D(),f.colorModeForRenderPass(),D),f.resetStencilClippingMasks())}if(f.style.enable3dLights()&&F&&(!S&&f.transform.projection.name!=="globe"||C)){const $=l.paint.get("fill-extrusion-opacity"),q=l.paint.get("fill-extrusion-ambient-occlusion-intensity"),W=l.paint.get("fill-extrusion-ambient-occlusion-ground-radius"),K=l.paint.get("fill-extrusion-flood-light-intensity"),Z=l.paint.get("fill-extrusion-flood-light-color-use-theme").constantOr("default")==="none",se=l.paint.get("fill-extrusion-flood-light-color").toRenderColor(Z?null:l.lut).toArray01().slice(0,3),ue=q>0&&W>0,fe=K>0,xe=(ye,pe,Se)=>(1-Se)*ye+Se*pe,_e=ye=>{const pe=f.depthModeForSublayer(1,Gt.ReadOnly,w.LEQUAL,!0),Se=l.paint.get(ye?"fill-extrusion-ambient-occlusion-ground-attenuation":"fill-extrusion-flood-light-ground-attenuation"),Ae=xe(.1,3,Se),Ge=f._showOverdrawInspector;if(!Ge){const Ne=new Ii({func:w.ALWAYS,mask:255},255,255,w.KEEP,w.KEEP,w.REPLACE),lt=new en([w.ONE,w.ONE,w.ONE,w.ONE],s.am.transparent,[!1,!1,!1,!0],w.MIN);Ba(f,i,l,p,pe,Ne,lt,Di.disabled,ye,"sdf",$,q,W,K,se,Ae,D,!1)}{const Ne=Ge?Ii.disabled:new Ii({func:w.EQUAL,mask:255},255,255,w.KEEP,w.DECR,w.DECR),lt=Ge?f.colorModeForRenderPass():new en([w.ONE_MINUS_DST_ALPHA,w.DST_ALPHA,w.ONE,w.ONE],s.am.transparent,[!0,!0,!0,!0]);Ba(f,i,l,p,pe,Ne,lt,Di.disabled,ye,"color",$,q,W,K,se,Ae,D,!1)}};if(C){const ye=(pe,Se,Ae)=>{const Ge=f.depthModeForSublayer(1,Gt.ReadOnly,w.LEQUAL,!1),Ne=l.paint.get(pe?"fill-extrusion-ambient-occlusion-ground-attenuation":"fill-extrusion-flood-light-ground-attenuation"),lt=xe(.1,3,Ne);{const st=new en([w.ONE,w.ONE,w.ONE,w.ONE],s.am.transparent,[!1,!1,!1,!0]);Ba(f,i,l,p,Ge,Ii.disabled,st,Di.disabled,pe,"clear",$,q,W,K,se,lt,D,Se)}{const st=new Ii({func:w.ALWAYS,mask:255},255,255,w.KEEP,w.KEEP,w.REPLACE),Et=new en([w.ONE,w.ONE,w.ONE,w.ONE],s.am.transparent,[!1,!1,!1,!0],w.MIN);Ba(f,i,l,p,Ge,st,Et,Di.disabled,pe,"sdf",$,q,W,K,se,lt,D,Se)}{const st=pe?w.ZERO:w.ONE_MINUS_DST_ALPHA,Et=new Ii({func:w.EQUAL,mask:255},255,255,w.KEEP,w.DECR,w.DECR),Be=new en([st,w.DST_ALPHA,w.ONE_MINUS_DST_ALPHA,w.ZERO],s.am.transparent,[!0,!0,!0,!0]);Ba(f,i,l,p,Ge,Et,Be,Di.disabled,pe,"color",$,q,W,K,se,lt,D,Se)}{const st=new en([w.ONE,w.ONE,w.ONE,pe?w.ZERO:w.ONE],s.am.transparent,[!1,!1,!1,!0],pe?w.FUNC_ADD:w.MAX);Ba(f,i,l,p,Ge,Ii.disabled,st,Di.disabled,pe,"clear",$,q,W,K,se,lt,D,Se,Ae)}};if(ue||fe){let pe;if(f.prepareDrawTile(),S){const Se=S.drapeBufferSize[0],Ae=S.drapeBufferSize[1];pe=S.framebufferCopyTexture,pe&&(!pe||pe.size[0]===Se&&pe.size[1]===Ae)||(pe&&pe.destroy(),pe
3241=S.framebufferCopyTexture=new s.T(v,new s.r({width:Se,height:Ae}),w.RGBA8)),pe.bind(w.LINEAR,w.CLAMP_TO_EDGE),w.copyTexSubImage2D(w.TEXTURE_2D,0,0,0,0,0,Se,Ae)}ue&&ye(!0,!1,pe),fe&&ye(!1,!0,pe)}}else ue&&_e(!0),fe&&_e(!1),(ue||fe)&&f.resetStencilClippingMasks()}}},hillshade:function(f,i,l,p){if(f.renderPass!=="offscreen"&&f.renderPass!=="translucent"||f.style.disableElevatedTerrain)return;const y=f.context,v=f.terrain&&f.terrain.renderingToTexture,[w,S]=f.renderPass!=="translucent"||v?[{},p]:f.stencilConfigForOverlap(p);for(const C of S){const D=i.getTile(C);if(D.needsHillshadePrepare&&f.renderPass==="offscreen")xf(f,D,l);else if(f.renderPass==="translucent"){const L=f.depthModeForSublayer(0,Gt.ReadOnly),F=l.paint.get("hillshade-emissive-strength"),O=f.colorModeForDrapableLayerRenderPass(F),$=v&&f.terrain?f.terrain.stencilModeForRTTOverlap(C):w[C.overscaledZ];qp(f,C,D,l,L,$,O)}}y.viewport.set([0,0,f.width,f.height]),f.resetStencilClippingMasks()},raster:function(f,i,l,p,y,v){if(f.renderPass!=="translucent"||l.paint.get("raster-opacity")===0)return;const w=f.transform.projection.name==="globe",S=l.paint.get("raster-elevation")!==0,C=S&&w;if(f.renderElevatedRasterBackface&&!C)return;const D=f.context,L=D.gl,F=i.getSource(),O=function(_e,ye,pe,Se){const Ae=ye.paint.get("raster-color"),Ge=_e.type==="raster-array",Ne=[],lt=ye.paint.get("raster-resampling"),st=ye.paint.get("raster-color-mix");let Et=ye.paint.get("raster-color-range");const Be=[st[0],st[1],st[2],0],We=st[3];let Re=lt==="nearest"?Se.NEAREST:Se.LINEAR;if(Ge&&(Ne.push("RASTER_ARRAY"),Ae||Ne.push("RASTER_COLOR"),lt==="linear"&&Ne.push("RASTER_ARRAY_LINEAR"),Re=Se.NEAREST,!Et&&_e.rasterLayers)){const ht=_e.rasterLayers.find(({id:Xe})=>Xe===ye.sourceLayer);ht&&ht.fields&&ht.fields.range&&(Et=ht.fields.range)}if(Et=Et||[0,1],Ae){Ne.push("RASTER_COLOR"),pe.activeTexture.set(Se.TEXTURE2),ye.updateColorRamp(Et);let ht=ye.colorRampTexture;ht||(ht=ye.colorRampTexture=new s.T(pe,ye.colorRamp,Se.RGBA8)),ht.bind(Se.LINEAR,Se.CLAMP_TO_EDGE)}return{mix:Be,range:Et,offset:We,defines:Ne,resampling:Re}}
3241(F,l,D,L);if(F instanceof s.aP&&!p.length&&!w)return;const $=l.paint.get("raster-emissive-strength"),q=f.colorModeForDrapableLayerRenderPass($),W=f.terrain&&f.terrain.renderingToTexture,K=!f.options.moving,Z=l.paint.get("raster-resampling")==="nearest"?L.NEAREST:L.LINEAR;if(F instanceof s.aP&&!p.length&&(F.onNorthPole||F.onSouthPole)){const _e=S?f.stencilModeFor3D():Ii.disabled;return void Yu(!!F.onNorthPole,null,f,i,l,$,O,Di.disabled,_e)}if(!p.length)return;const[se,ue]=F instanceof s.aP||W?[{},p]:f.stencilConfigForOverlap(p),fe=ue[ue.length-1].overscaledZ;C&&O.defines.push("PROJECTION_GLOBE_VIEW"),S&&O.defines.push("RENDER_CUTOFF");const xe=(_e,ye,pe)=>{for(const Se of _e){const Ae=Se.toUnwrapped(),Ge=i.getTile(Se);if(W&&(!Ge||!Ge.hasData()))continue;D.activeTexture.set(L.TEXTURE0);const Ne=Lg(Ge,F,l,O);if(!Ne||!Ne.texture)continue;const{texture:lt,mix:st,offset:Et,tileSize:Be,buffer:We}=Ne;let Re,ht;W?(Re=Gt.disabled,ht=Se.projMatrix):S?(Re=new Gt(L.LEQUAL,Gt.ReadWrite,f.depthRangeFor3D),ht=w?Float32Array.from(f.transform.expandedFarZProjMatrix):f.transform.calculateProjMatrix(Ae,K)):(Re=f.depthModeForSublayer(Se.overscaledZ-fe,l.paint.get("raster-opacity")===1?Gt.ReadWrite:Gt.ReadOnly,L.LESS),ht=f.transform.calculateProjMatrix(Ae,K));const Xe=f.terrain&&W?f.terrain.stencilModeForRTTOverlap(Se):se[Se.overscaledZ],gt=v?0:l.paint.get("raster-fade-duration");Ge.registerFadeDuration(gt);const ct=i.findLoadedParent(Se,0),yt=qu(Ge,ct,i,f.transform,gt);let xt,Qt;f.terrain&&f.terrain.prepareDrawTile(),D.activeTexture.set(L.TEXTURE0),lt.bind(Z,L.CLAMP_TO_EDGE),D.activeTexture.set(L.TEXTURE1),ct?(ct.texture&&ct.texture.bind(Z,L.CLAMP_TO_EDGE),xt=Math.pow(2,ct.tileID.overscaledZ-Ge.tileID.overscaledZ),Qt=[Ge.tileID.canonical.x*xt%1,Ge.tileID.canonical.y*xt%1]):lt.bind(Z,L.CLAMP_TO_EDGE),"useMipmap"in lt&&D.extTextureFilterAnisotropic&&f.transform.pitch>20&&L.texParameterf(L.TEXTURE_2D,D.extTextureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,D.extTextureFilterAnisotropicMax);const ci=f.transform;let Kt;const hi=S?Pf(ci):[0,0,0,0];let ni,bi,Vi,un,is,Zn=0;if(C&&F instanceof s.aP&&F.coordinates.length>3)ni=Float32Array.from(s.bh(s.dr(new s.cp(0,0,0)))),bi=Float32Array.from(ci.globeMatrix),Vi=Float32Array.from(s.dm(ci)),un=[s.ay(ci.center.lng),s.aH(ci.center.lat)],Kt=F.elevatedGlobePerspectiveTransform,is=F.elevatedGlobeGridMatrix||new Float32Array(9);else if(C){const Zi=s.dn(Se.canonical);Zn=s.dp(Zi.getCenter().lat),ni=Float32Array.from(s.bh(s.dr(Se.canonical))),bi=Float32Array.from(ci.globeMatrix),Vi=Float32Array.from(s.dm(ci)),un=[s.ay(ci.center.lng),s.aH(ci.center.lat)],Kt=[0,0],is=Float32Array.from(s.dq(Se.canonical,Zi,Zn,ci.worldSize/ci._pixelsPerMercatorPixel))}else Kt=F instanceof s.aP?F.perspectiveTransform:[0,0],ni=new Float32Array(16),bi=new Float32Array(9),Vi=new Float32Array(16),un=[0,0],is=new Float32Array(9);const dn=Ui(ht,ni,bi,Vi,is,Qt||[0,0],s.ah(f.transform.zoom),un,hi,xt||1,yt,l,Kt,S?l.paint.get("raster-elevation"):0,2,st,Et,O.range,Be,We,$),Zs=f.isTileAffectedByFog(Se),zs=f.getOrCreateProgram("raster",{defines:O.defines,overrideFog:Zs});if(f.uploadCommonUniforms(D,zs,Ae),F instanceof s.aP){const Zi=F.elevatedGlobeVertexBuffer,bn=F.elevatedGlobeIndexBuffer;if(W||!w)F.boundsBuffer&&F.boundsSegments&&zs.draw(f,L.TRIANGLES,Re,Ii.disabled,q,Di.disabled,dn,l.id,F.boundsBuffer,f.quadTriangleIndexBuffer,F.boundsSegments);else if(Zi&&bn){const Dn=ci.zoom<=s.cL?F.elevatedGlobeSegments:F.getSegmentsForLongitude(ci.center.lng);Dn&&zs.draw(f,L.TRIANGLES,Re,Ii.disabled,q,ye,dn,l.id,Zi,bn,Dn)}}else if(C){Re=new Gt(L.LEQUAL,Gt.ReadOnly,f.depthRangeFor3D);const Zi=f.globeSharedBuffers;if(Zi){const[bn,Dn,ns]=Zi.getGridBuffers(Zn,!1);zs.draw(f,L.TRIANGLES,Re,pe||Xe,f.colorModeForRenderPass(),ye,dn,l.id,bn,Dn,ns)}}else{const{tileBoundsBuffer:Zi,tileBoundsIndexBuffer:bn,tileBoundsSegments:Dn}=f.getTileBoundsBuffers(Ge);zs.draw(f,L.TRIANGLES,Re,Xe,q,Di.disabled,dn,l.id,Zi,bn,Dn)}}if(!(F instanceof s.aP)&&C)for(const Se of _e){const Ae=Se.canonical.y===(1<<Se.canonical.z)-1;Se.canonical.y===0&&Yu(!0,Se,f,i,l,$,O,ye,pe||Ii.disabled),Ae&&Yu(!1,Se,f,i,l,$,O,ye===Di.frontCW?Di.backCW:Di.frontCW,pe||Ii.disabled)}};C?xe(ue,f.renderElevatedRasterBackface?Di.backCW:Di.frontCW,f.stencilModeFor3D()):xe(ue,Di.disabled,void 0),f.resetStencilClippingMasks()},"raster-particle":function(f,i,l,p,y,v){f.renderPass==="offscreen"&&function(w,S,C,D){if(!D.length)return;const L=w.context,F=L.gl,O=S.getSource();if(!(O instanceof Al))return;const $=Math.ceil(Math.sqrt(C.paint.get("raster-particle-count")));let q=C.particlePositionRGBAImage;if(!q||q.width!==$){const ue=function(fe){const xe=fe*fe,_e=new Uint8Array(4*xe),ye=function(Se){return Se|=0,Se=Math.imul(2747636419^Se,2654435769),Se=Math.imul(Se^Se>>>16,2654435769),((Se=Math.imul(Se^Se>>>16,2654435769))>>>0)/4294967296},pe=1/1.1;for(let Se=0;Se<xe;Se++){const Ae=pe*(ye(2*Se+0)+xn),Ge=pe*(ye(2*Se+1)+xn),Ne=255*Ae%1,lt=255*Ge%1,st=Ne,Et=Ge-lt/255,Be=lt;
3241_e[4*Se+0]=255*(Ae-Ne/255),_e[4*Se+1]=255*st,_e[4*Se+2]=255*Et,_e[4*Se+3]=255*Be}return _e}($);q=C.particlePositionRGBAImage=new s.r({width:$,height:$},ue)}let W=C.particleFramebuffer;W?W.width!==$&&(W.destroy(),W=C.particleFramebuffer=L.createFramebuffer($,$,!0,null)):W=C.particleFramebuffer=L.createFramebuffer($,$,!0,null);const K=[];for(const ue of D){const fe=S.getTile(ue);if(!(fe instanceof Mu))continue;const xe=Rg(fe,O,C);if(!xe)continue;const _e=[fe.tileSize,fe.tileSize];let ye=C.tileFramebuffer;ye||(ye=C.tileFramebuffer=L.createFramebuffer(_e[0],_e[1],!0,null));let pe=fe.rasterParticleState;pe||(pe=fe.rasterParticleState=new rm(L,ue,_e,q));const Se=pe.update(C.lastInvalidatedAt);pe.particleTextureDimension!==$&&pe.updateParticleTexture(ue,q);const Ae=pe.targetColorTexture;pe.targetColorTexture=pe.backgroundColorTexture,pe.backgroundColorTexture=Ae;const Ge=pe.particleTexture0;pe.particleTexture0=pe.particleTexture1,pe.particleTexture1=Ge,K.push([ue,xe,pe,Se])}if(K.length===0)return;const Z=s.q.now(),se=C.previousDrawTimestamp?.001*(Z-C.previousDrawTimestamp):.0167;if(C.previousDrawTimestamp=Z,C.hasColorMap()){L.activeTexture.set(F.TEXTURE0+2);let ue=C.colorRampTexture;ue||(ue=C.colorRampTexture=new s.T(L,C.colorRamp,F.RGBA8)),ue.bind(F.LINEAR,F.CLAMP_TO_EDGE)}L.bindFramebuffer.set(C.tileFramebuffer.framebuffer),function(ue,fe,xe){const _e=ue.context,ye=_e.gl,pe=fe.tileFramebuffer;_e.activeTexture.set(ye.TEXTURE0);const Se={u_texture:0,u_opacity:1.05*(Ge=fe.paint.get("raster-particle-fade-opacity-factor"))/(Ge+.05)},Ae=ue.getOrCreateProgram("rasterParticleTexture",{defines:[],overrideFog:!1});var Ge;for(const Ne of xe){const[,,lt,st]=Ne;pe.colorAttachment.set(lt.targetColorTexture.texture),_e.viewport.set([0,0,pe.width,pe.height]),_e.clear({color:s.am.transparent}),st&&(lt.backgroundColorTexture.bind(ye.NEAREST,ye.CLAMP_TO_EDGE),Ae.draw(ue,ye.TRIANGLES,Gt.disabled,Ii.disabled,en.alphaBlended,Di.disabled,Se,fe.id,ue.viewportBuffer,ue.quadTriangleIndexBuffer,ue.viewportSegments))}}(w,C,K),function(ue,fe,xe,_e){const ye=ue.context,pe=ye.gl,Se=xe.tileFramebuffer,Ae=ue.transform.projection.name==="globe",Ge=xe.paint.get("raster-particle-max-speed");for(const Ne of _e){const[lt,st,Et]=Ne;ye.activeTexture.set(pe.TEXTURE0+0),st.texture.bind(pe.LINEAR,pe.CLAMP_TO_EDGE),Se.colorAttachment.set(Et.targetColorTexture.texture);const Be=ue.getOrCreateProgram("rasterParticleDraw",{defines:st.defines,overrideFog:!1});ye.activeTexture.set(pe.TEXTURE0+1);const We=st.scalarData?[]:[0,1,2,3].map(Xe=>s.dU[Xe](lt));We.push(lt);const Re=lt.canonical.x,ht=lt.canonical.y;for(const Xe of We){const gt=fe.getTile(Ae?Xe.wrapped():Xe);if(!gt)continue;const ct=gt.rasterParticleState;if(!ct)continue;const yt=Xe.canonical.x+(1<<Xe.canonical.z)*(Xe.wrap-lt.wrap),xt=Xe.canonical.y;ct.particleTexture0.bind(pe.NEAREST,pe.CLAMP_TO_EDGE);const Qt=kn(1,ct.particleTexture0.size[0],[yt-Re,xt-ht],0,st.texture.size,2,Ge,st.textureOffset,st.scale,st.offset);Be.draw(ue,pe.POINTS,Gt.disabled,Ii.disabled,en.alphaBlended,Di.disabled,Qt,xe.id,ct.particleIndexBuffer,void 0,ct.particleSegment)}}}(w,S,C,K),L.bindFramebuffer.set(C.particleFramebuffer.framebuffer),function(ue,fe,xe,_e){const ye=ue.context,pe=ye.gl,Se=fe.paint.get("raster-particle-max-speed"),Ae=_e*fe.paint.get("raster-particle-speed-factor")*.15,Ge=function(lt){return Math.pow(lt,6)}(.01+1*fe.paint.get("raster-particle-reset-rate-factor")),Ne=fe.particleFramebuffer;ye.viewport.set([0,0,Ne.width,Ne.height]);for(const lt of xe){const[,st,Et]=lt;ye.activeTexture.set(pe.TEXTURE0+0),st.texture.bind(pe.LINEAR,pe.CLAMP_TO_EDGE),ye.activeTexture.set(pe.TEXTURE0+1);const Be=Et.particleTexture0;Be.bind(pe.NEAREST,pe.CLAMP_TO_EDGE);const We=Ln(1,Be.size[0],0,st.texture.size,Se,Ae,Ge,st.textureOffset,st.scale,st.offset);Ne.colorAttachment.set(Et.particleTexture1.texture),ye.clear({color:s.am.transparent}),ue.getOrCreateProgram("rasterParticleUpdate",{defines:st.defines}).draw(ue,pe.TRIANGLES,Gt.disabled,Ii.disabled,en.unblended,Di.disabled,We,fe.id,ue.viewportBuffer,ue.quadTriangleIndexBuffer,ue.viewportSegments)}}(w,C,K,se)}(f,i,l,p),f.renderPass==="translucent"&&(function(w,S,C,D,L){const F=w.context,O=F.gl,$=S.getSource().tileSize,q=5*(1-s.af(s.cx,s.cx+1,w.transform.zoom))*$+C.paint.get("raster-particle-elevation"),W=!w.options.moving,K=w.transform.projection.name==="globe";if(!D.length)return;const[Z,se]=w.stencilConfigForOverlap(D),ue=[];K&&ue.push("PROJECTION_GLOBE_VIEW");const fe=w.stencilModeFor3D();for(const xe of se){const _e=xe.toUnwrapped(),ye=S.getTile(xe);if(!ye.rasterParticleState)continue;const pe=ye.rasterParticleState,Se=100;ye.registerFadeDuration(Se);const Ae=S.findLoadedParent(xe,0),Ge=qu(ye,Ae,S,w.transform,Se);let Ne,lt;w.terrain&&w.terrain.prepareDrawTile(),F.activeTexture.set(O.TEXTURE0),pe.targetColorTexture.bind(O.LINEAR,O.CLAMP_TO_EDGE),F.activeTexture.set(O.TEXTURE1),Ae&&Ae.rasterParticleState?(Ae.rasterParticleState.targetColorTexture.bind(O.LINEAR,O.CLAMP_TO_EDGE),Ne=Math.pow(2,Ae.tileID.overscaledZ-ye.tileID.overscaledZ
3241),lt=[ye.tileID.canonical.x*Ne%1,ye.tileID.canonical.y*Ne%1]):pe.targetColorTexture.bind(O.LINEAR,O.CLAMP_TO_EDGE);const st=K?Float32Array.from(w.transform.expandedFarZProjMatrix):w.transform.calculateProjMatrix(_e,W),Et=w.transform,Be=kf(Et),We=s.dn(xe.canonical),Re=s.dp(We.getCenter().lat);let ht,Xe,gt,ct,yt;K?(ht=Float32Array.from(s.bh(s.dr(xe.canonical))),Xe=Float32Array.from(Et.globeMatrix),gt=Float32Array.from(s.dm(Et)),ct=[s.ay(Et.center.lng),s.aH(Et.center.lat)],yt=Float32Array.from(s.dq(xe.canonical,We,Re,Et.worldSize/Et._pixelsPerMercatorPixel))):(ht=new Float32Array(16),Xe=new Float32Array(9),gt=new Float32Array(16),ct=[0,0],yt=new Float32Array(9));const xt=wn(st,ht,Xe,gt,yt,lt||[0,0],s.ah(w.transform.zoom),ct,Be,Ne||1,Ge,q),Qt=w.isTileAffectedByFog(xe),ci=w.getOrCreateProgram("rasterParticle",{defines:ue,overrideFog:Qt});if(w.uploadCommonUniforms(F,ci,_e),K){const Kt=new Gt(O.LEQUAL,Gt.ReadOnly,w.depthRangeFor3D),hi=0,ni=w.globeSharedBuffers;if(ni){const[bi,Vi,un]=ni.getGridBuffers(Re,hi!==0);ci.draw(w,O.TRIANGLES,Kt,fe,en.alphaBlended,w.renderElevatedRasterBackface?Di.frontCCW:Di.backCCW,xt,C.id,bi,Vi,un)}}else{const Kt=w.depthModeForSublayer(0,Gt.ReadOnly),hi=Z[xe.overscaledZ],{tileBoundsBuffer:ni,tileBoundsIndexBuffer:bi,tileBoundsSegments:Vi}=w.getTileBoundsBuffers(ye);ci.draw(w,O.TRIANGLES,Kt,hi,en.alphaBlended,Di.disabled,xt,C.id,ni,bi,Vi)}}w.resetStencilClippingMasks()}(f,i,l,p),f.style.map.triggerRepaint())},background:function(f,i,l,p){const y=l.paint.get("background-color"),v=l.paint.get("background-color-use-theme").constantOr("default")==="none",w=l.paint.get("background-opacity"),S=l.paint.get("background-emissive-strength"),C=l.paint.get("background-pitch-alignment")==="viewport";if(w===0)return;const D=f.context,L=D.gl,F=f.transform,O=F.tileSize,$=l.paint.get("background-pattern");let q;if($!==void 0&&($===null||(q=f.imageManager.getPattern(s.I.from($.toString()),l.scope,f.style.getLut(l.scope)),!q)))return;const W=!$&&y.a===1&&w===1&&f.opaquePassEnabledForLayer()?"opaque":"translucent";if(f.renderPass!==W)return;const K=Ii.disabled,Z=f.depthModeForSublayer(0,W==="opaque"?Gt.ReadWrite:Gt.ReadOnly),se=f.colorModeForDrapableLayerRenderPass(S),ue=$?"backgroundPattern":"background";let fe,xe=p;if(xe||(fe=f.getBackgroundTiles(),xe=Object.values(fe).map(_e=>_e.tileID)),$&&(D.activeTexture.set(L.TEXTURE0),f.imageManager.bind(f.context,l.scope)),C){const _e=f.getOrCreateProgram(ue,{overrideFog:!1,overrideRtt:!0}),ye=new Float32Array(s.bx([])),pe=new s.aM(0,0,0,0,0),Se=$?os(ye,S,w,f,0,l.scope,q,C,{tileID:pe,tileSize:O}):Gs(ye,S,w,y.toRenderColor(v?null:l.lut));_e.draw(f,L.TRIANGLES,Z,K,se,Di.disabled,Se,l.id,f.viewportBuffer,f.quadTriangleIndexBuffer,f.viewportSegments)}else for(const _e of xe){const ye=f.isTileAffectedByFog(_e),pe=f.getOrCreateProgram(ue,{overrideFog:ye}),Se=_e.toUnwrapped(),Ae=p?_e.projMatrix:f.transform.calculateProjMatrix(Se);f.prepareDrawTile();const Ge=i?i.getTile(_e):fe?fe[_e.key]:new eo(_e,O,F.zoom,f),Ne=$?os(Ae,S,w,f,0,l.scope,q,C,{tileID:_e,tileSize:O}):Gs(Ae,S,w,y.toRenderColor(v?null:l.lut));f.uploadCommonUniforms(D,pe,Se);const{tileBoundsBuffer:lt,tileBoundsIndexBuffer:st,tileBoundsSegments:Et}=f.getTileBoundsBuffers(Ge);pe.draw(f,L.TRIANGLES,Z,K,se,Di.disabled,Ne,l.id,lt,st,Et)}},sky:function(f,i,l){const p=f._atmosphere?s.ah(f.transform.zoom):1,y=l.paint.get("sky-opacity")*p;if(y===0)return;const v=f.context,w=l.paint.get("sky-type"),S=new Gt(v.gl.LEQUAL,Gt.ReadOnly,[0,1]),C=f.frameCounter/1e3%1;w==="atmosphere"?f.renderPass==="offscreen"?l.needsSkyboxCapture(f)&&(function(D,L,F,O){const $=D.context,q=$.gl;let W=L.skyboxFbo;if(!W){W=L.skyboxFbo=$.createFramebuffer(32,32,!0,null),L.skyboxGeometry=new su($),L.skyboxTexture=$.gl.createTexture(),q.bindTexture(q.TEXTURE_CUBE_MAP,L.skyboxTexture),q.texParameteri(q.TEXTURE_CUBE_MAP,q.TEXTURE_WRAP_S,q.CLAMP_TO_EDGE),q.texParameteri(q.TEXTURE_CUBE_MAP,q.TEXTURE_WRAP_T,q.CLAMP_TO_EDGE),q.texParameteri(q.TEXTURE_CUBE_MAP,q.TEXTURE_MIN_FILTER,q.LINEAR),q.texParameteri(q.TEXTURE_CUBE_MAP,q.TEXTURE_MAG_FILTER,q.LINEAR);for(let ue=0;ue<6;++ue)q.texImage2D(q.TEXTURE_CUBE_MAP_POSITIVE_X+ue,0,q.RGBA,32,32,0,q.RGBA,q.UNSIGNED_BYTE,null)}$.bindFramebuffer.set(W.framebuffer),$.viewport.set([0,0,32,32]);const K=L.getCenter(D,!0),Z=D.getOrCreateProgram("skyboxCapture"),se=new Float64Array(16);s.bx(se),s.e3(se,se,.5*-Math.PI),ru(D,L,Z,se,K,0),s.bx(se),s.e3(se,se,.5*Math.PI),ru(D,L,Z,se,K,1),s.bx(se),s.cG(se,se,.5*-Math.PI),ru(D,L,Z,se,K,2),s.bx(se),s.cG(se,se,.5*Math.PI),ru(D,L,Z,se,K,3),s.bx(se),ru(D,L,Z,se,K,4),s.bx(se),s.e3(se,se,Math.PI),ru(D,L,Z,se,K,5),$.viewport.set([0,0,D.width,D.height])}(f,l),l.markSkyboxValid(f)):f.renderPass==="sky"&&function(D,L,F,O,$){const q=D.context,W=q.gl,K=D.transform,Z=D.getOrCreateProgram("skybox");q.activeTexture.set(W.TEXTURE0),W.bindTexture(W.TEXTURE_CUBE_MAP,L.skyboxTexture);const se=((ue,fe,xe,_e,ye)=>({u_matrix:ue,u_sun_direction:fe,u_cubemap:0,u_opacity:_e,u_temporal_offset:ye}))(K.skyboxMatrix,L.getCenter(D,!1),0,O,$);D.uploadCommonUniforms(q,Z),Z.draw(D,W.TRIANGLES,F,Ii.disabled,D.colorModeForRenderPass(),Di.backCW,se,"skybox",L.skyboxGeometry.vertexBuffer,L.skyboxGeometry.indexBuffer,L.skyboxGeometry.segment)}(f,l,S,y,C):w==="gradient"&&f.renderPass==="sky"&&function(D,L,F,O,$){const q=D.context,W=q.gl,K=D.transform,Z=D.getOrCreateProgram("skyboxGradient");L.skyboxGeometry||(L.skyboxGeometry=new su(q)),q.activeTexture.set(W.TEXTURE0);let se=L.colorRampTexture;se||(se=L.colorRampTexture=new s.T(q,L.colorRamp,W.RGBA8)),se.bind(W.LINEAR,W.CLAMP_TO_EDGE);const ue=((fe,xe,_e,ye,pe)=>({u_matrix:fe,u_color_ramp:0,u_center_direction:xe,u_radius:s.al(_e),u_opacity:ye,u_temporal_offset:pe}))(K.skyboxMatrix,L.getCenter(D,!1),L.paint.get("sky-gradient-radius"),O,$);D.uploadCommonUniforms(q,Z),Z.draw(D,W.TRIANGLES,F,Ii.disabled,D.colorModeForRenderPass(),Di.backCW,ue,"skyboxGradient",L.skyboxGeometry.vertexBuffer,L.skyboxGeometry.indexBuffer,L.skyboxGeometry.segment)}(f,l,S,y,C)},debug:function(f,i,l,p,y,v){for(let w=0;w<l.length;w++)if(y){const D=new s.am(p.r*.8,p.g*.8,p.b*.8,1);Ul(f,i,l[w],p,-1,-1,v),Ul(f,i,l[w],p,-1,1,v),Ul(f,i,l[w],p,1,1,v),Ul(f,i,l[w],p,1,-1,v),Ul(f,i,l[w],D,0,0,v)}else Ul(f,i,l[w],p,0,0,v)},custom:function(f,i,l,p){const y=f.context,v=l.implementation;if(!f.transform.projection.unsupportedLayers||!f.transform.projection.unsupportedLayers.includes("custom")||f.terrain&&(f.terrain.renderingToTexture||f.renderPass==="offscreen")&&l.isDraped(i)){if(f.renderPass==="offscreen"){const w=v.prerender;if(w){if(f.setCustomLayerDefaults(),y.setColorMode(f.colorModeForRenderPass()),f.transform.projection.name==="globe"){const S=f.transform.pointMerc;w.call(v,y.gl,f.transform.customLayerMatrix(),f.transform.getProjection(),f.transform.globeToMercatorMatrix(),s.ah(f.transform.zoom),[S.x,S.y],f.transform.pixelsPerMeterRatio)}else w.call(v,y.gl,f.transform.customLayerMatrix());y.setDirty(),f.setBaseState()}}else if(f.renderPass==="translucent"){if(f.terrain&&f.terrain.renderingToTexture){const S=v.renderToTile;if(S){const C=p[0].canonical,D={x:C.x+p[0].wrap*(v.wrapTileId?0:1<<C.z),y:C.y,z:C.z};y.setDepthMode(Gt.disabled),y.setStencilMode(Ii.disabled),y.setColorMode(f.colorModeForRenderPass()),f.setCustomLayerDefaults(),S.call(v,y.gl,D),y.setDirty(),f.setBaseState()}return}f.setCustomLayerDefaults(),y.setColorMode(f.colorModeForRenderPass()),y.setStencilMode(Ii.disabled);const w=v.renderingMode==="3d"?new Gt(f.context.gl.LEQUAL,Gt.ReadWrite,f.depthRangeFor3D):f.depthModeForSublayer(0,Gt.ReadOnly);if(y.setDepthMode(w),f.transform.projection.name==="globe"){const S=f.transform.pointMerc;v.render(y.gl,f.transform.customLayerMatrix(),f.transform.getProjection(),f.transform.globeToMercatorMatrix(),s.ah(f.transform.zoom),[S.x,S.y],f.transform.pixelsPerMeterRatio)}else v.render(y.gl,f.transform.customLayerMatrix());y.setDirty(),f.setBaseState(),y.bindFramebuffer.set(null)}}else s.w("Custom layers are not yet supported with this projection. Use mercator or globe to enable usage of custom layers.")},model:function(f,i,l,p){if(f.renderPass==="opaque")return;const y=l.paint.get("model-opacity").constantOr(1);if(y===0)return;const v=l.paint.get("model-cast-shadows");
3241if(f.renderPass==="shadow"&&(!v||f.terrain&&y<.65&&l._transitionablePaint._values["model-opacity"].value.expression instanceof s.ab))return;const w=f.shadowRenderer,S=l.paint.get("model-receive-shadows");w&&(w.useNormalOffset=!0,S||(w.enabled=!1));const C=()=>{w&&(w.useNormalOffset=!0,S||(w.enabled=!0))},D=i.getSource();if(f.renderPass==="light-beam"&&D.type!=="batched-model")return;if(D.type==="vector"||D.type==="geojson")return function(Z,se,ue,fe,xe){const _e=Z.transform;if(_e.projection.name!=="mercator")return void s.w(`Drawing 3D models for ${_e.projection.name} projection is not yet implemented`);const ye=_e.getFreeCameraOptions().position;if(!Z.modelManager)return;const pe=Z.modelManager;ue.modelManager=pe;const Se=Z.shadowRenderer;if(!ue._unevaluatedLayout._values.hasOwnProperty("model-id"))return;const Ae=ue._unevaluatedLayout._values["model-id"],Ge=Object.assign({},ue.layout.get("model-id").parameters),Ne=Z.style.order.indexOf(ue.fqid);for(const lt of fe){const st=se.getTile(lt).getBucket(ue);if(!st||st.projection.name!==_e.projection.name)continue;const Et=st.getModelUris();Et&&!st.modelsRequested&&(pe.addModelsFromBucket(Et,xe),st.modelsRequested=!0);const Be=am(lt,_e);Ge.zoom=Be;const We=Ae.possiblyEvaluate(Ge);if($e(Z,st,lt),cl.shadowUniformsInitialized=!1,cl.useSingleShadowCascade=!!Se&&Se.getMaxCascadeForTile(lt.toUnwrapped())===0,Z.renderPass==="shadow"&&Se){if(Z.currentShadowCascade===1&&st.isInsideFirstShadowMapFrustum)continue;const Xe=_e.calculatePosMatrix(lt.toUnwrapped(),_e.worldSize);if(cl.tileMatrix.set(Xe),cl.shadowTileMatrix=Float32Array.from(Se.calculateShadowPassMatrixFromMatrix(Xe)),cl.aabb.min.fill(0),cl.aabb.max[0]=cl.aabb.max[1]=s.aj,cl.aabb.max[2]=0,n0(st,cl,Z,ue.scope))continue}const Re=1<<lt.canonical.z,ht=[((ye.x-lt.wrap)*Re-lt.canonical.x)*s.aj,(ye.y*Re-lt.canonical.y)*s.aj,ye.z*Re*s.aj];Z.conflationActive&&Object.keys(st.instancesPerModel).length>0&&Z.style.isLayerClipped(ue,se.getSource())&&st.updateReplacement(lt,Z.replacementSource,Ne,xe)&&(st.uploaded=!1,st.upload(Z.context));for(let Xe in st.instancesPerModel){const gt=st.instancesPerModel[Xe];gt.features.length>0&&(Xe=We.evaluate(gt.features[0].feature,{}));const ct=pe.getModel(Xe,xe);if(ct||pe.hasURLBeenRequested(Xe)||st.modelUris.includes(Xe)||(st.modelUris.push(Xe),st.modelsRequested=!1),ct&&ct.uploaded)for(const yt of ct.nodes)lm(Z,ue,yt,gt,ht,lt,cl)}}}(f,i,l,p,D.type==="vector"?l.scope:""),void C();if(!D.loaded())return;if(D.type==="batched-model")return function(Z,se,ue,fe){ue.resetLayerRenderingStats(Z);const xe=Z.context,_e=Z.transform,ye=Z.style.fog,pe=Z.shadowRenderer;if(_e.projection.name!=="mercator")return void s.w(`Drawing 3D landmark models for ${_e.projection.name} projection is not yet implemented`);const Se=Z.transform.getFreeCameraOptions().position,Ae=s.b$([],[Se.x,Se.y,Se.z],Z.transform.worldSize),Ge=s.eb([],Ae),Ne=s.bx([]),lt=s.ec(_e.center.lat,_e.zoom),st=s.bn([],[1,1,1/lt]);s.bo(Ne,Ne,Ge);const Et=ue.paint.get("model-opacity").constantOr(1),Be=new Gt(xe.gl.LEQUAL,Gt.ReadWrite,Z.depthRangeFor3D),We=new Gt(xe.gl.LEQUAL,Gt.ReadOnly,Z.depthRangeFor3D),Re=new s.cV([1/0,1/0,1/0],[-1/0,-1/0,-1/0]),ht=Z.renderPass==="shadow",Xe=ht&&pe?pe.getCurrentCascadeFrustum():_e.getFrustum(_e.scaleZoom(_e.worldSize)),gt=ue.paint.get("model-front-cutoff"),ct=gt[2]<1,yt=Nl(Z,ue.paint.get("model-cutoff-fade-range")),xt=ue.getLayerRenderingStats();(function(Qt,ci,Kt,hi){const ni=Qt.terrain?Qt.terrain.exaggeration():0,bi=Qt.transform.zoom;for(const Vi of hi){const un=ci.getTile(Vi).getBucket(Kt);un&&(un.setFilter(Kt.filter),Qt.conflationActive&&un.updateReplacement(Vi,Qt.replacementSource),un.evaluateScale(Qt,Kt),Qt.terrain&&ni>0&&un.elevationUpdate(Qt.terrain,ni,Vi,Kt.source),un.needsReEvaluation(Qt,bi,Kt)&&un.evaluate(Kt))}})(Z,se,ue,fe),function(){let Qt,ci,Kt;ct?(Qt=fe.length-1,ci=-1,Kt=-1):(Qt=0,ci=fe.length,Kt=1);const hi=new Float64Array(16),ni=s.eg(),bi=new s.P(0,0);for(let Vi=Qt;Vi!==ci;Vi+=Kt){const un=fe[Vi],is=se.getTile(un).getBucket(ue);if(!is||!is.uploaded)continue;let Zn=!1;pe&&(Zn=pe.getMaxCascadeForTile(un.toUnwrapped())===0);const dn=_e.calculatePosMatrix(un.toUnwrapped(),_e.worldSize),Zs=is.modelTraits;!ht&&ct&&(s.bi(hi,dn),s.ad(ni,Ae,hi),bi.x=ni[0],bi.y=ni[1]);const zs=[];is.setFilter(ue.filter);
3241for(const Zi of is.getNodesInfo()){if(Zi.hiddenByReplacement||!Zi.node.meshes)continue;const bn=Zi.node;let Dn=0;Z.terrain&&bn.elevation&&(Dn=bn.elevation*Z.terrain.exaggeration());const ns=(()=>{const Ls=Zi.aabb;return Re.min=[...Ls.min],Re.max=[...Ls.max],Re.min[2]+=Dn,Re.max[2]+=Dn,s.ad(Re.min,Re.min,dn),s.ad(Re.max,Re.max,dn),Re})(),fr=Zi.evaluatedScale;if(fr[0]<=1&&fr[1]<=1&&fr[2]<=1&&ns.intersects(Xe)===0)continue;if(!ht&&ct){const Ls=.16666666666666666;Zi.cameraCollisionOpacity=Ae[0]>ns.min[0]&&Ae[0]<ns.max[0]&&Ae[1]>ns.min[1]&&Ae[1]<ns.max[1]&&Ae[2]*lt<ns.max[2]&&bn.footprint&&s.bS(bi,bn.footprint)?Math.max(Zi.cameraCollisionOpacity-Ls,0):Math.min(1,Zi.cameraCollisionOpacity+Ls)}const Ks=[...dn],ur=bn.anchor?bn.anchor[0]:0,ks=bn.anchor?bn.anchor[1]:0;s.bo(Ks,Ks,[ur*(fr[0]-1),ks*(fr[1]-1),Dn]),s.ci(fr,s.eh)||s.cE(Ks,Ks,fr);const tn=s.az([],Ks,bn.matrix),Cs=s.az([],_e.expandedFarZProjMatrix,tn),In=s.az([],_e.expandedFarZProjMatrix,Ks),Is=s.aA([],[ur,ks,Dn,1],Cs)[2];bn.hidden=!1;let Nn=Et;ht||(ct&&(Nn*=Zi.cameraCollisionOpacity,Nn*=hd(Ks,_e,Zi.aabb,gt)),Nn*=s0(yt,Is)),Nn!==0?zs.push({nodeInfo:Zi,depth:Is,opacity:Nn,wvpForNode:Cs,wvpForTile:In,nodeModelMatrix:tn,tileModelMatrix:Ks}):bn.hidden=!0}ht||zs.sort((Zi,bn)=>!ct||Zi.opacity===1&&bn.opacity===1?Zi.depth<bn.depth?-1:1:Zi.opacity===1?-1:bn.opacity===1?1:Zi.depth>bn.depth?-1:1);for(const Zi of zs){const bn=Zi.nodeInfo,Dn=bn.node;let ns=s.az([],st,Zi.tileModelMatrix);s.az(ns,Ne,ns);const fr=s.bi([],ns);s.ee(fr,fr),s.cE(fr,fr,Og),ns=s.az(ns,ns,Dn.matrix);const Ks=Z.renderPass==="light-beam",ur=ue.paint.get("model-color-use-theme").constantOr("default")==="none",ks=Zs&s.em.HasMapboxMeshFeatures,tn=ks?0:bn.evaluatedRMEA[0][2];for(let Cs=0;Cs<Dn.meshes.length;++Cs){const In=Dn.meshes[Cs],Is=Cs===Dn.lightMeshIndex;let Nn=Zi.wvpForNode;if(Is){if(!Ks&&!Z.terrain&&Z.shadowRenderer){Z.currentLayer<Z.firstLightBeamLayer&&(Z.firstLightBeamLayer=Z.currentLayer);continue}Nn=Zi.wvpForTile}else if(Ks)continue;const Ls={defines:[]},$r=[];if(!ht&&pe&&(pe.useNormalOffset=!!In.normalBuffer),It(Ls.defines,$r,In,Z,ur?null:ue.lut),ks||Ls.defines.push("DIFFUSE_SHADED"),Zn&&Ls.defines.push("SHADOWS_SINGLE_CASCADE"),xt&&(ht?xt.numRenderedVerticesInShadowPass+=In.vertexArray.length:xt.numRenderedVerticesInTransparentPass+=In.vertexArray.length),ht){Ys(In,Zi.nodeModelMatrix,Z,ue);continue}let _s=null;if(ye){const ra=Qu(Zi.nodeModelMatrix,Z.transform);if(_s=new Float32Array(ra),_e.projection.name!=="globe"){const $a=In.aabb.min,ql=In.aabb.max,[Zl,pl]=ye.getOpacityForBounds(ra,$a[0],$a[1],ql[0],ql[1]);Ls.overrideFog=Zl>=Ht||pl>=Ht}}const Zr=In.material;let ar;Zr.occlusionTexture&&Zr.occlusionTexture.offsetScale&&(ar=Zr.occlusionTexture.offsetScale,Ls.defines.push("OCCLUSION_TEXTURE_TRANSFORM"));const ro=Z.getOrCreateProgram("model",Ls);!ht&&pe&&pe.setupShadowsFromMatrix(Zi.tileModelMatrix,ro,pe.useNormalOffset),Z.uploadCommonUniforms(xe,ro,null,_s);const fl=Zr.pbrMetallicRoughness;fl.metallicFactor=.9,fl.roughnessFactor=.5;const Ic=Bn(new Float32Array(Nn),new Float32Array(ns),new Float32Array(fr),new Float32Array(Dn.matrix),Z,Zi.opacity,fl.baseColorFactor.toRenderColor(null),Zr.emissiveFactor,fl.metallicFactor,fl.roughnessFactor,Zr,tn,ue,[0,0,0],ar);!Is&&(bn.hasTranslucentParts||Zi.opacity<1)&&ro.draw(Z,xe.gl.TRIANGLES,Be,Ii.disabled,en.disabled,Di.backCCW,Ic,ue.id,In.vertexBuffer,In.indexBuffer,In.segments,ue.paint,Z.transform.zoom,void 0,$r),ro.draw(Z,xe.gl.TRIANGLES,Is?We:Be,Ii.disabled,Is||Zi.opacity<1||bn.hasTranslucentParts?en.alphaBlended:en.unblended,Di.backCCW,Ic,ue.id,In.vertexBuffer,In.indexBuffer,In.segments,ue.paint,Z.transform.zoom,void 0,$r)}}}}()}(f,i,l,p),void C();if(D.type!=="model")return;const L=D.getModels(),F=[],O=f.transform.getFreeCameraOptions().position,$=s.b$([],[O.x,O.y,O.z],f.transform.worldSize);s.eb($,$);const q=[],W=[];let K=0;for(const Z of L){const se=l.paint.get("model-rotation").constantOr(null),ue=l.paint.get("model-scale").constantOr(null),fe=l.paint.get("model-translation").constantOr(null);Z.computeModelMatrix(f,se,ue,fe,!0,!0,!1);const xe=s.bx([]),_e=s.ec(Z.position.lat,f.transform.zoom),ye=s.bn([],[1,1,1/_e]);s.bo(xe,xe,$),F.push({zScaleMatrix:ye,negCameraPosMatrix:xe});for(const pe of Z.nodes)eh(f.transform,pe,Z.matrix,f.transform.expandedFarZProjMatrix,K,q,W);K++}if(q.sort((Z,se)=>se.depth-Z.depth),f.renderPass!=="shadow"){if(y===1)for(const Z of W)Xt(Z,f,l,F[Z.modelIndex],Ii.disabled,f.colorModeForRenderPass());else{for(const Z of W)Xt(Z,f,l,F[Z.modelIndex],Ii.disabled,en.disabled);for(const Z of W)Xt(Z,f,l,F[Z.modelIndex],f.stencilModeFor3D(),f.colorModeForRenderPass());f.resetStencilClippingMasks()}for(const Z of q)Xt(Z,f,l,F[Z.modelIndex],Ii.disabled,f.colorModeForRenderPass());C()}else{for(const Z of W)Ys(Z.mesh,Z.nodeModelMatrix,f,l);for(const Z of q)Ys(Z.mesh,Z.nodeModelMatrix,f,l);C()}}},Ng={line:function(f,i,l){if(f.hasElevatedBuckets=!1,f.hasNonElevatedBuckets=!1,f._unevaluatedLayout.getValue("line-elevation-reference")!==void 0||f._unevaluatedLayout.getValue("line-z-offset")!==void 0){if(i){const p=i.getVisibleCoordinates();for(const y of p){const v=i.getTile(y).getBucket(f);if(v&&(v.elevationType!=="none"?f.hasElevatedBuckets=!0:f.hasNonElevatedBuckets=!0,f.hasElevatedBuckets&&f.hasNonElevatedBuckets))break}}}else f.hasNonElevatedBuckets=!0}
3241,model:function(f,i,l){const p=i.getSource();if(!p.loaded())return;if(p.type==="vector"||p.type==="geojson")return void(l.modelManager&&l.modelManager.upload(l,p.type==="vector"?f.scope:""));if(p.type==="batched-model"||p.type!=="model")return;const y=p.getModels();for(const v of y)v.upload(l.context)},raster:function(f,i,l){const p=i.getSource();if(!(p instanceof Al&&p.loaded()))return;const y=f.sourceLayer||p.rasterLayerIds&&p.rasterLayerIds[0];if(!y)return;const v=f.paint.get("raster-array-band")||p.getInitialBand(y);if(v==null)return;const w=i.getIds().map(S=>i.getTileByID(S));for(const S of w)S.updateNeeded(y,v)&&p.prepareTile(S,y,v)},"raster-particle":function(f,i,l){const p=i.getSource();if(!(p instanceof Al&&p.loaded()))return;const y=f.sourceLayer||p.rasterLayerIds&&p.rasterLayerIds[0];if(!y)return;const v=f.paint.get("raster-particle-array-band")||p.getInitialBand(y);if(v==null)return;const w=i.getIds().map(S=>i.getTileByID(S));for(const S of w)S.updateNeeded(y,v)&&p.prepareTile(S,y,v)}},Ec={fill:Nr};class hm{constructor(i,l,p,y,v){this.context=new yo(i,l),this.transform=p,this._tileTextures={},this.frameCopies=[],this.loadTimeStamps=[],this.tp=v,this._timeStamp=s.q.now(),this._averageFPS=0,this._fpsHistory=[],this._dt=0,this._debugParams={forceEnablePrecipitation:!1,showTerrainProxyTiles:!1,fpsWindow:30,continousRedraw:!1,enabledLayers:{}};const w=["fill","line","symbol","circle","heatmap","fill-extrusion","raster","raster-particle","hillshade","model","background","sky"];for(const C of w)this._debugParams.enabledLayers[C]=!0;v.registerParameter(this._debugParams,["Terrain"],"showTerrainProxyTiles",{},()=>{this.style.map.triggerRepaint()}),v.registerParameter(this._debugParams,["Precipitation"],"forceEnablePrecipitation"),v.registerParameter(this._debugParams,["FPS"],"fpsWindow",{min:1,max:100,step:1}),v.registerBinding(this._debugParams,["FPS"],"continousRedraw",{readonly:!0,label:"continuous redraw"}),v.registerBinding(this,["FPS"],"_averageFPS",{readonly:!0,label:"value"}),v.registerBinding(this,["FPS"],"_averageFPS",{readonly:!0,label:"graph",view:"graph",min:0,max:200});for(const C of w)v.registerParameter(this._debugParams.enabledLayers,["Debug","Layers"],C);this.occlusionParams=new r0(v),this.setup(),this.numSublayers=to.maxUnderzooming+to.maxOverzooming+1,this.depthEpsilon=1/Math.pow(2,16),this.deferredRenderGpuTimeQueries=[],this.gpuTimers={},this.frameCounter=0,this._backgroundTiles={},this.conflationActive=!1,this.replacementSource=new s.et,this.longestCutoffRange=0,this.minCutoffZoom=0,this._fogVisible=!1,this._cachedTileFogOpacities={},this._shadowRenderer=new Qo(this),this._wireframeDebugCache=new I1,this.renderDefaultNorthPole=!0,this.renderDefaultSouthPole=!0,this.layersWithOcclusionOpacity=[];const S=new s.r({width:1,height:1},Uint8Array.of(0,0,0,0));this.emptyDepthTexture=new s.T(this.context,S,i.RGBA8),this._clippingActiveLastFrame=!1,this.scaleFactor=y}updateTerrain(i,l){const p=!!i&&!!i.terrain&&this.transform.projection.supportsTerrain;if(!(p||this._terrain&&this._terrain.enabled))return;this._terrain||(this._terrain=new sd(this,i));const y=this._terrain;this.transform.elevation=p?y:null,y.update(i,this.transform,l),this.transform.elevation&&!y.enabled&&(this.transform.elevation=null)}_updateFog(i){const l=i.fog;if(!l||this.transform.projection.name==="globe"||l.getOpacity(this.transform.pitch)<1||l.properties.get("horizon-blend")<.03)return void(this.transform.fogCullDistSq=null);const[p,y]=l.getFovAdjustedRange(this.transform._fov);if(p>y)return void(this.transform.fogCullDistSq=null);const v=p+.78*(y-p);this.transform.fogCullDistSq=v*v}get terrain(){return this.transform._terrainEnabled()&&this._terrain&&this._terrain.enabled||this._forceTerrainMode?this._terrain:null}get forceTerrainMode(){return this._forceTerrainMode}set forceTerrainMode(i){i&&!this._terrain&&(this._terrain=new sd(this,this.style)),this._forceTerrainMode=i}get shadowRenderer(){return this._shadowRenderer&&this._shadowRenderer.enabled?this._shadowRenderer:null}get wireframeDebugCache(){return this._wireframeDebugCache}resize(i,l){if(this.width=i*s.q.devicePixelRatio,this.height=l*s.q.devicePixelRatio,this.context.viewport.set([0,0,this.width,this.height]),this.style)for(const p of this.style.order)this.style._mergedLayers[p].resize()}setup(){const i=this.context,l=new s.ba;l.emplaceBack(0,0),l.emplaceBack(s.aj,0),l.emplaceBack(0,s.aj),l.emplaceBack(s.aj,s.aj),this.tileExtentBuffer=i.createVertexBuffer(l,s.bc.members),this.tileExtentSegments=s.bd.simpleSegment(0,0,4,2);const p=new s.ba;p.emplaceBack(0,0),p.emplaceBack(s.aj,0),p.emplaceBack(0,s.aj),p.emplaceBack(s.aj,s.aj),this.debugBuffer=i.createVertexBuffer(p,s.bc.members),this.debugSegments=s.bd.simpleSegment(0,0,4,5);const y=new s.ba;y.emplaceBack(-1,-1),y.emplaceBack(1,-1),y.emplaceBack(-1,1),y.emplaceBack(1,1),this.viewportBuffer=i.createVertexBuffer(y,s.bc.members),this.viewportSegments=s.bd.simpleSegment(0,0,4,2);const v=new s.aZ;v.emplaceBack(0,0,0,0),v.emplaceBack(s.aj,0,s.aj,0),v.emplaceBack(0,s.aj,0,s.aj),v.emplaceBack(s.aj,s.aj,s.aj,s.aj),this.mercatorBoundsBuffer=i.createVertexBuffer(v,s.bf.members),this.mercatorBoundsSegments=s.bd.simpleSegment(0,0,4,2);const w=new s.a_;w.emplaceBack(0,1,2),w.emplaceBack(2,1,3),this.quadTriangleIndexBuffer=i.createIndexBuffer(w);const S=new s.bb;for(const D of[0,1,3,2,0])S.emplaceBack(D);this.debugIndexBuffer=i.createIndexBuffer(S),this.emptyTexture=new s.T(i,new s.r({width:1,height:1},Uint8Array.of(0,0,0,0)),i.gl.RGBA8),this.identityMat=s.bz();const C=this.context.gl;this.stencilClearMode=new Ii({func:C.ALWAYS,mask:0},0,255,C.ZERO,C.ZERO,C.ZERO),this.loadTimeStamps.push(performance.now())}getMercatorTileBoundsBuffers(){return{tileBoundsBuffer:this.mercatorBoundsBuffer,tileBoundsIndexBuffer:this.quadTriangleIndexBuffer,tileBoundsSegments:this.mercatorBoundsSegments}}getTileBoundsBuffers(i){return i._makeTileBoundsBuffers(this.context,this.transform.projection),i._tileBoundsBuffer?{tileBoundsBuffer:i._tileBoundsBuffer,tileBoundsIndexBuffer:i._tileBoundsIndexBuffer,tileBoundsSegments:i._tileBoundsSegments}:this.getMercatorTileBoundsBuffers()}clearStencil(){const i=this.context.gl;this.nextStencilID=1,this.currentStencilSource=void 0,this._tileClippingMaskIDs={},this.getOrCreateProgram("clippingMask").draw(this,i.TRIANGLES,Gt.disabled,this.stencilClearMode,en.disabled,Di.disabled,no(this.identityMat),"$clipping",this.viewportBuffer,this.quadTriangleIndexBuffer,this.viewportSegments)}resetStencilClippingMasks(){this.terrain||(this.currentStencilSource=void 0,this._tileClippingMaskIDs={})}_renderTileClippingMasks(i,l,p){if(!l||this.currentStencilSource===l.id||!i.isTileClipped()||!p||p.length===0)return;if(this._tileClippingMaskIDs&&!this.terrain){let S=!1;for(const C of p)if(this._tileClippingMaskIDs[C.key]===void 0){S=!0;break}if(!S)return}this.currentStencilSource=l.id;const y=this.context,v=y.gl;this.nextStencilID+p.length>256&&this.clearStencil(),y.setColorMode(en.disabled),y.setDepthMode(Gt.disabled);const w=this.getOrCreateProgram("clippingMask");this._tileClippingMaskIDs={};for(const S of p){const C=l.getTile(S),D=this._tileClippingMaskIDs[S.key]=this.nextStencilID++,{tileBoundsBuffer:L,tileBoundsIndexBuffer:F,tileBoundsSegments:O}=this.getTileBoundsBuffers(C);w.draw(this,v.TRIANGLES,Gt.disabled,new Ii({func:v.ALWAYS,mask:0},D,255,v.KEEP,v.KEEP,v.REPLACE),en.disabled,Di.disabled,no(S.projMatrix),"$clipping",L,F,O)}}stencilModeFor3D(){this.currentStencilSource=void 0,this.nextStencilID+1>256&&this.clearStencil();const i=this.nextStencilID++,l=this.context.gl;return new Ii({func:l.NOTEQUAL,mask:255},i,255,l.KEEP,l.KEEP,l.REPLACE)}stencilModeForClipping(i){if(this.terrain)return this.terrain.stencilModeForRTTOverlap(i);const l=this.context.gl;return new Ii({func:l.EQUAL,mask:255},this._tileClippingMaskIDs[i.key],0,l.KEEP,l.KEEP,l.REPLACE)}stencilConfigForOverlap(i){const l=this.context.gl,p=i.sort((w,S)=>
3241S.overscaledZ-w.overscaledZ),y=p[p.length-1].overscaledZ,v=p[0].overscaledZ-y+1;if(v>1){this.currentStencilSource=void 0,this.nextStencilID+v>256&&this.clearStencil();const w={};for(let S=0;S<v;S++)w[S+y]=new Ii({func:l.GEQUAL,mask:255},S+this.nextStencilID,255,l.KEEP,l.KEEP,l.REPLACE);return this.nextStencilID+=v,[w,p]}return[{[y]:Ii.disabled},p]}colorModeForRenderPass(){const i=this.context.gl;return this._showOverdrawInspector?new en([i.CONSTANT_COLOR,i.ONE,i.CONSTANT_COLOR,i.ONE],new s.am(.125,.125,.125,0),[!0,!0,!0,!0]):this.renderPass==="opaque"?en.unblended:en.alphaBlended}colorModeForDrapableLayerRenderPass(i){const l=this.context.gl;return this.style&&this.style.enable3dLights()&&this.terrain&&this.terrain.renderingToTexture&&this.renderPass==="translucent"?new en([l.ONE,l.ONE_MINUS_SRC_ALPHA,l.CONSTANT_ALPHA,l.ONE_MINUS_SRC_ALPHA],new s.am(0,0,0,i===void 0?0:i),[!0,!0,!0,!0]):this.colorModeForRenderPass()}depthModeForSublayer(i,l,p,y=!1){if(this.depthOcclusion)return new Gt(this.context.gl.GREATER,Gt.ReadOnly,this.depthRangeFor3D);if(!this.opaquePassEnabledForLayer()&&!y)return Gt.disabled;const v=1-((1+this.currentLayer)*this.numSublayers+i)*this.depthEpsilon;return new Gt(p||this.context.gl.LEQUAL,l,[v,v])}opaquePassEnabledForLayer(){return this.currentLayer<this.opaquePassCutoff}blitDepth(){const i=this.context.gl,l=Math.ceil(this.width),p=Math.ceil(this.height),y=this.context.bindFramebuffer.get(),v=i.getParameter(i.TEXTURE_BINDING_2D);this.depthFBO&&this.depthFBO.width===l&&this.depthFBO.height===p||(this.depthFBO&&(this.depthFBO.destroy(),this.depthFBO=void 0,this.depthTexture=void 0),l!==0&&p!==0&&(this.depthFBO=new _o(this.context,l,p,!1,"texture"),this.depthTexture=new s.T(this.context,{width:l,height:p,data:null},i.DEPTH24_STENCIL8),this.depthFBO.depthAttachment.set(this.depthTexture.texture))),this.context.bindFramebuffer.set(y),i.bindTexture(i.TEXTURE_2D,v),this.depthFBO&&(i.bindFramebuffer(i.READ_FRAMEBUFFER,null),i.bindFramebuffer(i.DRAW_FRAMEBUFFER,this.depthFBO.framebuffer),i.blitFramebuffer(0,0,l,p,0,0,l,p,i.DEPTH_BUFFER_BIT,i.NEAREST),i.bindFramebuffer(i.FRAMEBUFFER,this.context.bindFramebuffer.current))}updateAverageFPS(){this._fpsHistory.push(this._dt===0?0:1e3/this._dt),this._fpsHistory.length>this._debugParams.fpsWindow&&this._fpsHistory.splice(0,this._fpsHistory.length-this._debugParams.fpsWindow),this._averageFPS=Math.round(this._fpsHistory.reduce((i,l)=>i+l/this._fpsHistory.length,0))}render(i,l){const p=s.q.now();this._dt=p-this._timeStamp,this._timeStamp=p,this._wireframeDebugCache.update(this.frameCounter),this._debugParams.continousRedraw=i.map.repaint,this.style=i,this.options=l;const y=this.style._mergedLayers,v=!(!this.terrain||!this.terrain.enabled),w=()=>this.style._getOrder(v).filter(Be=>{const We=y[Be];return!(We.type in this._debugParams.enabledLayers)||this._debugParams.enabledLayers[We.type]});let S=w(),C=!1,D=!1;for(const Be of S){const We=y[Be];We.type==="circle"&&(C=!0),We.type==="symbol"&&(We.hasInitialOcclusionOpacityProperties?D=!0:C=!0)}let L=S.map(Be=>y[Be]);const F=this.style._mergedSourceCaches;this.imageManager=i.imageManager,this.modelManager=i.modelManager,this.symbolFadeChange=i.placement.symbolFadeChange(s.q.now()),this.imageManager.beginFrame();let O=0,$=!1;for(const Be in F){const We=F[Be];We.used&&(We.prepare(this.context),We.getSource().usedInConflation&&++O)}let q=!1;for(const Be of L)Be.isHidden(this.transform.zoom)||(Be.type==="clip"&&(q=!0),this.prepareLayer(Be));const W={},K={},Z={},se={},ue={};for(const Be in F){const We=F[Be];W[Be]=We.getVisibleCoordinates(),K[Be]=W[Be].slice().reverse(),Z[Be]=We.getVisibleCoordinates(!0).reverse(),se[Be]=We.getShadowCasterCoordinates(),ue[Be]=We.sortCoordinatesByDistance(W[Be])}const fe=Be=>{const We=this.style.getLayerSourceCache(Be);return We&&We.used?We.getSource():null};if(O||q||this._clippingActiveLastFrame){const Be=[],We=[];let Re=0;for(const ht of L)this.isSourceForClippingOrConflation(ht,fe(ht))&&(Be.push(ht),We.push(Re)),Re++;if(q||Be.length>1||this._clippingActiveLastFrame){q=!1;const ht=[];for(let Xe=0;Xe<Be.length;Xe++){const gt=Be[Xe],ct=We[Xe],yt=this.style.getLayerSourceCache(gt);if(!yt||!yt.used||!yt.getSource().usedInConflation&>.type!=="clip")continue;let xt=s.ev,Qt=s.bQ.None;const ci=[];let Kt=!0;if(gt.type==="clip"){xt=ct;
3241for(const hi of gt.layout.get("clip-layer-types"))Qt|=hi==="model"?s.bQ.Model:hi==="symbol"?s.bQ.Symbol:s.bQ.FillExtrusion;for(const hi of gt.layout.get("clip-layer-scope"))ci.push(hi);gt.isHidden(this.transform.zoom)?Kt=!1:q=!0}Kt&&ht.push({layer:gt.fqid,cache:yt,order:xt,clipMask:Qt,clipScope:ci})}this.replacementSource.setSources(ht),$=!0}}this._clippingActiveLastFrame=q,$||this.replacementSource.clear(),this.conflationActive=$,this.minCutoffZoom=0,this.longestCutoffRange=0,this.opaquePassCutoff=1/0,this._lastOcclusionLayer=-1,this.layersWithOcclusionOpacity=[];for(let Be=0;Be<L.length;Be++){const We=L[Be],Re=We.cutoffRange();if(this.longestCutoffRange=Math.max(Re,this.longestCutoffRange),Re>0){const ht=fe(We);ht&&(this.minCutoffZoom=Math.max(ht.minzoom,this.minCutoffZoom)),We.minzoom&&(this.minCutoffZoom=Math.max(We.minzoom,this.minCutoffZoom))}We.is3D(v)&&(this.opaquePassCutoff===1/0&&(this.opaquePassCutoff=Be),this._lastOcclusionLayer=Be)}const xe=this.style&&this.style.fog;xe?(this._fogVisible=xe.getOpacity(this.transform.pitch)!==0,this._fogVisible&&this.transform.projection.name!=="globe"&&(this._fogVisible=xe.isVisibleOnFrustum(this.transform.cameraFrustum))):this._fogVisible=!1,this._cachedTileFogOpacities={},this.terrain&&(this.terrain.updateTileBinding(Z),this.opaquePassCutoff=0,S=w(),L=S.map(Be=>y[Be]));const _e=this._shadowRenderer;if(_e){_e.updateShadowParameters(this.transform,this.style.directionalLight);for(const Be in F)for(const We of W[Be]){let Re={min:0,max:0};this.terrain&&(Re=this.terrain.getMinMaxForTile(We)||Re),_e.addShadowReceiver(We.toUnwrapped(),Re.min,Re.max)}}this.transform.projection.name!=="globe"||this.globeSharedBuffers||(this.globeSharedBuffers=new s.eu(this.context)),this.style.fog&&this.transform.projection.supportsFog?(this._atmosphere||(this._atmosphere=new ud(this)),this._atmosphere.update(this)):this._atmosphere&&(this._atmosphere.destroy(),this._atmosphere=void 0);const ye=this._debugParams.forceEnablePrecipitation||!(!this.style||!this.style.snow),pe=this._debugParams.forceEnablePrecipitation||!(!this.style||!this.style.rain);if(ye&&!this._snow&&(this._snow=new Ds(this)),!ye&&this._snow&&(this._snow.destroy(),delete this._snow),pe&&!this._rain&&(this._rain=new M1(this)),!pe&&this._rain&&(this._rain.destroy(),delete this._rain),this._snow&&this._snow.update(this),this._rain&&this._rain.update(this),!ts.has(this.context.gl))return;this.renderPass="offscreen";for(const Be of L){const We=i.getLayerSourceCache(Be);if(!Be.hasOffscreenPass()||Be.isHidden(this.transform.zoom))continue;const Re=We?K[We.id]:void 0;(Be.type==="custom"||Be.type==="raster"||Be.type==="raster-particle"||Be.isSky()||Re&&Re.length)&&this.renderLayer(this,We,Be,Re)}this.depthRangeFor3D=[0,1-(L.length+2)*this.numSublayers*this.depthEpsilon],this._shadowRenderer&&(this.renderPass="shadow",this._shadowRenderer.drawShadowPass(this.style,se)),this.context.bindFramebuffer.set(null),this.context.viewport.set([0,0,this.width,this.height]);const Se=this.transform.projection.name==="globe"||this.transform.isHorizonVisible(),Ae=(()=>{if(l.showOverdrawInspector)return s.am.black;const Be=this.style.fog;if(Be&&this.transform.projection.supportsFog){const We=this.style.getLut(Be.scope);if(!Se){const Re=Be.properties.get("color-use-theme")==="none",ht=Be.properties.get("color").toRenderColor(Re?null:We).toArray01();return new s.am(...ht)}if(Se){const Re=Be.properties.get("space-color-use-theme")==="none",ht=Be.properties.get("space-color").toRenderColor(Re?null:We).toArray01();return new s.am(...ht)}}return s.am.transparent})();if(this.context.clear({color:Ae,depth:1}),this.clearStencil(),this._showOverdrawInspector=l.showOverdrawInspector,this.renderPass="opaque",this.style.fog&&this.transform.projection.supportsFog&&this._atmosphere&&!this._showOverdrawInspector&&Se&&this._atmosphere.drawStars(this,this.style.fog),!this.terrain)for(this.currentLayer=S.length-1;this.currentLayer>=0;this.currentLayer--){const Be=L[this.currentLayer],We=i.getLayerSourceCache(Be);if(Be.isSky())continue;const Re=We?(Be.is3D(v)?ue:K)[We.id]:void 0;this._renderTileClippingMasks(Be,We,Re),this.renderLayer(this,We,Be,Re)}if(this.style.fog&&this.transform.projection.supportsFog&&this._atmosphere&&!this._showOverdrawInspector&&Se&&this._atmosphere.drawAtmosphereGlow(this,this.style.fog),this.renderPass="sky",(!this._atmosphere||s.ah(this.transform.zoom)>0)&&(this.transform.projection.name==="globe"||this.transform.isH
3241orizonVisible()))for(this.currentLayer=0;this.currentLayer<S.length;this.currentLayer++){const Be=L[this.currentLayer],We=i.getLayerSourceCache(Be);Be.isSky()&&this.renderLayer(this,We,Be,We?K[We.id]:void 0)}function Ge(Be,We){let Re;return We&&(Re=(Be.type==="symbol"?Z:Be.is3D(v)?ue:K)[We.id]),Re}if(this.renderPass="translucent",this.transform.projection.name==="globe"){for(this.renderElevatedRasterBackface=!0,this.currentLayer=0;this.currentLayer<S.length;){const Be=L[this.currentLayer];if(Be.type==="raster"||Be.type==="raster-particle"){const We=i.getLayerSourceCache(Be);this.renderLayer(this,We,Be,Ge(Be,We))}++this.currentLayer}this.renderElevatedRasterBackface=!1}this.currentLayer=0,this.firstLightBeamLayer=Number.MAX_SAFE_INTEGER;let Ne=0;_e&&(Ne=_e.getShadowCastingLayerCount());let lt=!1,st=-1;for(let Be=0;Be<S.length;++Be){const We=L[Be];We.isHidden(this.transform.zoom)||We.is3D(v)&&(st=Be)}D&&st===-1&&(C=!0);let Et=!1;for(;this.currentLayer<S.length;){const Be=L[this.currentLayer],We=i.getLayerSourceCache(Be);if(Be.isSky())++this.currentLayer;else if(this.terrain&&this.style.isLayerDraped(Be)){if(Be.isHidden(this.transform.zoom)){++this.currentLayer;continue}this.currentLayer=this.terrain.renderBatch(this.currentLayer),this._lastOcclusionLayer=Math.max(this.currentLayer,this._lastOcclusionLayer)}else{if(!Et&&Be.is3D(v)&&!v){const Re=this.currentLayer,ht=Xe=>{for(this.currentLayer=0;this.currentLayer<L.length;this.currentLayer++){const gt=L[this.currentLayer];if(Ec[gt.type]){const ct=this.style.getLayerSourceCache(gt);Ec[gt.type](this,ct,gt,Ge(gt,ct),Xe)}}};ht("initialize"),ht("reset"),this.currentLayer=Re,Et=!0}if(C&&!lt&&this.terrain&&!this.transform.isOrthographic&&(lt=!0,this.blitDepth()),D&&st!==-1&&this.currentLayer===st+1&&!this.transform.isOrthographic&&this.blitDepth(),this.terrain||this._renderTileClippingMasks(Be,We,We?W[We.id]:void 0),this.renderLayer(this,We,Be,Ge(Be,We)),!this.terrain&&_e&&Ne>0&&Be.hasShadowPass()&&--Ne==0&&(_e.drawGroundShadows(),this.firstLightBeamLayer<=this.currentLayer)){const Re=this.currentLayer;for(this.renderPass="light-beam",this.currentLayer=this.firstLightBeamLayer;this.currentLayer<=Re;this.currentLayer++){const ht=L[this.currentLayer];if(!ht.hasLightBeamPass())continue;const Xe=i.getLayerSourceCache(ht);this.renderLayer(this,Xe,ht,Xe?K[Xe.id]:void 0)}this.currentLayer=Re,this.renderPass="translucent"}if(this.currentLayer>=this._lastOcclusionLayer&&this.layersWithOcclusionOpacity.length>0){const Re=this.currentLayer;this.depthOcclusion=!0;for(const ht of this.layersWithOcclusionOpacity){this.currentLayer=ht;const Xe=L[this.currentLayer],gt=i.getLayerSourceCache(Xe),ct=gt?K[gt.id]:void 0;this.terrain||this._renderTileClippingMasks(Xe,gt,gt?W[gt.id]:void 0),this.renderLayer(this,gt,Xe,ct)}this.depthOcclusion=!1,this.currentLayer=Re,this.renderPass="translucent",this.layersWithOcclusionOpacity=[]}++this.currentLayer}}if(this.terrain&&this.terrain.postRender(),this._snow&&this._snow.draw(this),this._rain&&this._rain.draw(this),this.options.showTileBoundaries||this.options.showQueryGeometry||this.options.showTileAABBs){let Be=null;
3241L.forEach(We=>{const Re=i.getLayerSourceCache(We);Re&&!We.isHidden(this.transform.zoom)&&Re.getVisibleCoordinates().length&&(!Be||Be.getSource().maxzoom<Re.getSource().maxzoom)&&(Be=Re)}),Be&&this.options.showTileBoundaries&&Rn.debug(this,Be,Be.getVisibleCoordinates(),s.am.red,!1,this.options.showParseStatus)}this.terrain&&this._debugParams.showTerrainProxyTiles&&Rn.debug(this,this.terrain.proxySourceCache,this.terrain.proxyCoords,new s.am(1,.8,.1,1),!0,this.options.showParseStatus),this.options.showPadding&&function(Be){const We=Be.transform.padding;Ku(Be,Be.transform.height-(We.top||0),3,ll),Ku(Be,We.bottom||0,3,nu),Ju(Be,We.left||0,3,cd),Ju(Be,Be.transform.width-(We.right||0),3,Ao);const Re=Be.transform.centerPoint;(function(ht,Xe,gt,ct){Sc(ht,Xe-1,gt-10,2,20,ct),Sc(ht,Xe-10,gt-1,20,2,ct)})(Be,Re.x,Be.transform.height-Re.y,Na)}(this),this.context.setDefault(),this.frameCounter=(this.frameCounter+1)%Number.MAX_SAFE_INTEGER,this.tileLoaded&&this.options.speedIndexTiming&&(this.loadTimeStamps.push(performance.now()),this.saveC
3241anvasCopy()),$||(this.conflationActive=!1)}prepareLayer(i){this.gpuTimingStart(i);const{unsupportedLayers:l}=this.transform.projection,p=!l||!l.includes(i.type);if(Ng[i.type]&&(p||this.terrain&&i.type==="custom")){const y=this.style.getLayerSourceCache(i);Ng[i.type](i,y,this)}this.gpuTimingEnd()}renderLayer(i,l,p,y){p.isHidden(this.transform.zoom)||(p.type==="background"||p.type==="sky"||p.type==="custom"||p.type==="model"||p.type==="raster"||p.type==="raster-particle"||y&&y.length)&&(this.id=p.id,this.gpuTimingStart(p),i.transform.projection.unsupportedLayers&&i.transform.projection.unsupportedLayers.includes(p.type)&&(!i.terrain||p.type!=="custom")||p.type==="clip"||Rn[p.type](i,l,p,y,this.style.placement.variableOffsets,this.options.isInitialLoad),this.gpuTimingEnd())}gpuTimingStart(i){if(!this.options.gpuTiming)return;const l=this.context.extTimerQuery,p=this.context.gl;let y=this.gpuTimers[i.id];y||(y=this.gpuTimers[i.id]={calls:0,cpuTime:0,query:p.createQuery()}),y.calls++,p.beginQuery(l.TIME_ELAPSED_EXT,y.query)}gpuTimingDeferredRenderStart(){if(this.options.gpuTimingDeferredRender){const i=this.context.extTimerQuery,l=this.context.gl,p=l.createQuery();this.deferredRenderGpuTimeQueries.push(p),l.beginQuery(i.TIME_ELAPSED_EXT,p)}}gpuTimingDeferredRenderEnd(){this.options.gpuTimingDeferredRender&&this.context.gl.endQuery(this.context.extTimerQuery.TIME_ELAPSED_EXT)}gpuTimingEnd(){this.options.gpuTiming&&this.context.gl.endQuery(this.context.extTimerQuery.TIME_ELAPSED_EXT)}collectGpuTimers(){const i=this.gpuTimers;return this.gpuTimers={},i}collectDeferredRenderGpuQueries(){const i=this.deferredRenderGpuTimeQueries;return this.deferredRenderGpuTimeQueries=[],i}queryGpuTimers(i){const l={};for(const p in i){const y=i[p],v=this.context.extTimerQuery,w=v.getQueryParameter(y.query,this.context.gl.QUERY_RESULT)/1e6;v.deleteQueryEXT(y.query),l[p]=w}return l}queryGpuTimeDeferredRender(i){if(!this.options.gpuTimingDeferredRender)return 0;const l=this.context.gl;let p=0;for(const y of i)p+=l.getQueryParameter(y,l.QUERY_RESULT)/1e6,l.deleteQuery(y);return p}translatePosMatrix(i,l,p,y,v){if(!p[0]&&!p[1])return i;const w=v?y==="map"?this.transform.angle:0:y==="viewport"?-this.transform.angle:0;if(w){const D=Math.sin(w),L=Math.cos(w);p=[p[0]*L-p[1]*D,p[0]*D+p[1]*L]}const S=[v?p[0]:s.aw(l,p[0],this.transform.zoom),v?p[1]:s.aw(l,p[1],this.transform.zoom),0],C=new Float32Array(16);return s.bo(C,i,S),C}saveTileTexture(i){const l=i.size[0],p=this._tileTextures[l];p?p.push(i):this._tileTextures[l]=[i]}getTileTexture(i){const l=this._tileTextures[i];return l&&l.length>0?l.pop():null}terrainRenderModeElevated(){return this.style&&!!this.style.getTerrain()&&!!this.terrain&&!this.terrain.renderingToTexture||this.forceTerrainMode}linearFloatFilteringSupported(){return this.context.extTextureFloatLinear!=null}currentGlobalDefines(i,l,p){const y=p===void 0?this.terrain&&this.terrain.renderingToTexture:p,v=[];return this.style&&this.style.enable3dLights()&&(i==="globeRaster"||i==="terrainRaster"?(v.push("LIGHTING_3D_MODE"),v.push("LIGHTING_3D_ALPHA_EMISSIVENESS")):y||v.push("LIGHTING_3D_MODE")),this.renderPass==="shadow"&&(this._shadowMapDebug||v.push("DEPTH_TEXTURE")),this.terrainRenderModeElevated()&&(v.push("TERRAIN"),this.linearFloatFilteringSupported()&&v.push("TERRAIN_DEM_FLOAT_FORMAT")),this.transform.projection.name==="globe"&&v.push("GLOBE"),!this._fogVisible||y||l!==void 0&&!l||v.push("FOG","FOG_DITHERING"),y&&v.push("RENDER_TO_TEXTURE"),this._showOverdrawInspector&&v.push("OVERDRAW_INSPECTOR"),v}getOrCreateProgram(i,l){this.cache=this.cache||{};const p=l&&l.defines||[],y=l&&l.config,v=this.currentGlobalDefines(i,l&&l.overrideFog,l&&l.overrideRtt).concat(p),w=od.cacheKey(vc[i],i,v,y);return this.cache[w]||(this.cache[w]=new od(this.context,i,vc[i],y,Ws[i],v)),this.cache[w]}setCustomLayerDefaults(){this.context.unbindVAO(),this.context.cullFace.setDefault(),this.context.frontFace.setDefault(),this.context.cullFaceSide.setDefault(),this.context.activeTexture.setDefault(),this.context.pixelStoreUnpack.setDefault(),this.context.pixelStoreUnpackPremultiplyAlpha.setDefault(),this.context.pixelStoreUnpackFlipY.setDefault()}setBaseState(){const i=this.context.gl;this.context.cullFace.set(!1),this.context.viewport.set([0,0,this.width,this.height]),this.context.blendEquation.set(i.FUNC_ADD)}initDebugOverlayCanvas(){this.debugOverlayCanvas==null&&(this.debugOverlayCanvas=document.createElement("canvas"),this.debugOverlayCanvas.width=512,this.debugOverlayCanvas.height=512,this.debugOverlayTexture=new s.T(this.context,this.debugOverlayCanvas,this.context.gl.RGBA8))}destroy(){this._terrain&&this._terrain.destroy(),this._atmosphere&&(this._atmosphere.de
vendor: 57,032 bytes, line 3241
3241stroy(),this._atmosphere=void 0),this.globeSharedBuffers&&this.globeSharedBuffers.destroy(),this.emptyTexture.destroy(),this.debugOverlayTexture&&this.debugOverlayTexture.destroy(),this._wireframeDebugCache.destroy(),this.depthFBO&&(this.depthFBO.destroy(),this.depthFBO=void 0,this.depthTexture=void 0),this.emptyDepthTexture&&this.emptyDepthTexture.destroy()}prepareDrawTile(){this.terrain&&this.terrain.prepareDrawTile()}uploadCommonLightUniforms(i,l){if(this.style.enable3dLights()){const p=this.style.directionalLight,y=this.style.ambientLight;if(p&&y){const v=((w,S,C)=>{const D=w.properties.get("direction"),L=w.properties.get("color-use-theme")==="none",F=w.properties.get("color").toRenderColor(L?null:C.getLut(w.scope)).toArray01(),O=w.properties.get("intensity"),$=S.properties.get("color-use-theme")==="none",q=S.properties.get("color").toRenderColor($?null:C.getLut(S.scope)).toArray01(),W=S.properties.get("intensity"),K=[D.x,D.y,D.z],Z=s.dw(q,W),se=s.dw(F,O);return{u_lighting_ambient_color:Z,u_lighting_directional_dir:K,u_lighting_directional_color:se,u_ground_radiance:Af(K,se,Z)}})(p,y,this.style);l.setLightsUniformValues(i,v)}}}uploadCommonUniforms(i,l,p,y,v){if(this.uploadCommonLightUniforms(i,l),this.terrain&&this.terrain.renderingToTexture)return;const w=this.style.fog;if(w){const S=w.getOpacity(this.transform.pitch),C=((D,L,F,O,$,q,W,K,Z,se,ue,fe)=>{const xe=D.transform,_e=L.properties.get("color-use-theme")==="none",ye=L.properties.get("color").toRenderColor(_e?null:D.style.getLut(L.scope)).toArray01();ye[3]=O;const pe=D.frameCounter/1e3%1,[Se,Ae]=L.properties.get("vertical-range");return{u_fog_matrix:F?xe.calculateFogTileMatrix(F):fe||D.identityMat,u_fog_range:L.getFovAdjustedRange(xe._fov),u_fog_color:ye,u_fog_horizon_blend:L.properties.get("horizon-blend"),u_fog_vertical_limit:[Math.min(Se,Ae),Ae],u_fog_temporal_offset:pe,u_frustum_tl:$,u_frustum_tr:q,u_frustum_br:W,u_frustum_bl:K,u_globe_pos:Z,u_globe_radius:se,u_viewport:ue,u_globe_transition:s.ah(xe.zoom),u_is_globe:+(xe.projection.name==="globe")}})(this,w,p,S,this.transform.frustumCorners.TL,this.transform.frustumCorners.TR,this.transform.frustumCorners.BR,this.transform.frustumCorners.BL,this.transform.globeCenterInViewSpace,this.transform.globeRadius,[this.transform.width*s.q.devicePixelRatio,this.transform.height*s.q.devicePixelRatio],y);l.setFogUniformValues(i,C)}v&&l.setCutoffUniformValues(i,v.uniformValues)}setTileLoadedFlag(i){this.tileLoaded=i}saveCanvasCopy(){const i=this.canvasCopy();i&&(this.frameCopies.push(i),this.tileLoaded=!1)}canvasCopy(){const i=this.context.gl,l=i.createTexture();return i.bindTexture(i.TEXTURE_2D,l),i.copyTexImage2D(i.TEXTURE_2D,0,i.RGBA,0,0,i.drawingBufferWidth,i.drawingBufferHeight,0),l}getCanvasCopiesAndTimestamps(){return{canvasCopies:this.frameCopies,timeStamps:this.loadTimeStamps}}averageElevationNeedsEasing(){if(!this.transform._elevation)return!1;const i=this.style&&this.style.fog;return!!i&&i.getOpacity(this.transform.pitch)!==0}getBackgroundTiles(){const i=this._backgroundTiles,l=this._backgroundTiles={},p=this.transform.coveringTiles({tileSize:512});for(const y of p)l[y.key]=i[y.key]||new eo(y,512,this.transform.tileZoom,this);return l}clearBackgroundTiles(){this._backgroundTiles={}}isSourceForClippingOrConflation(i,l){return!(!i.is3D(!(!this.terrain||!this.terrain.enabled))||i.type!=="clip"&&(i.minzoom&&i.minzoom>this.transform.zoom||(this.style._clipLayerPresent||i.sourceLayer!=="building")&&(!l||l.type!=="batched-model")))}isTileAffectedByFog(i){if(!this.style||!this.style.fog)return!1;if(this.transform.projection.name==="globe")return!0;let l=this._cachedTileFogOpacities[i.key];return l||(this._cachedTileFogOpacities[i.key]=l=this.style.fog.getOpacityForTile(i)),l[0]>=Ht||l[1]>=Ht}setupDepthForOcclusion(i,l,p){const y=this.context,v=y.gl,w=!!p;var S;p||(p={u_dem:2,u_dem_prev:4,u_dem_tl:[0,0],u_dem_tl_prev:[0,0],u_dem_scale:0,u_dem_scale_prev:0,u_dem_size:0,u_dem_lerp:1,u_depth:3,u_depth_size_inv:[0,0],u_depth_range_unpack:[0,1],u_occluder_half_size:16,u_occlusion_depth_offset:-1e-4,u_exaggeration:0}),y.activeTexture.set(v.TEXTURE3),i&&this.depthFBO&&this.depthTexture?(this.depthTexture.bind(v.NEAREST,v.CLAMP_TO_EDGE),p.u_depth_size_inv=[1/this.depthFBO.width,1/this.depthFBO.height],p.u_depth_range_unpack=[2/((S=this.depthRangeFor3D)[1]-S[0]),-1-2*S[0]/(S[1]-S[0])],p.u_occluder_half_size=.5*this.occlusionParams.occluderSize,p.u_occlusion_depth_offset=this.occlusionParams.depthOffset):this.emptyDepthTexture.bind(v.NEAREST,v.CLAMP_TO_EDGE),y.activeTexture.set(v.TEXTURE0),w||l.setTerrainUniformValues(y,p)}}function ih(f,i){let l=!1,p=null;const y=()=>{p=null,l&&(f(),p=setTimeout(y,i),l=!1)};return()=>(l=!0,p||y(),p)}class dd{constructor(i){this._hashName=i&&encodeURIComponent(i),s.aV(["_getCurrentHash","_onHashChange","_updateHash"],this),this._updateHash=ih(this._updateHashUnthrottled.bind(this),300)}addTo(i){return this._map=i,window.addEventListener("hashchange",this._onHashChange,!1),i.on("moveend",this._updateHash),this}remove(){return this._map?(this._map.off("moveend",this._updateHash),window.removeEventListener("hashchange",this._onHashChange,!1),clearTimeout(this._updateHash()),this._map=void 0,this):this}getHashString(){const i=this._map;if(!i)return"";const l=dm(i);if(this._hashName){const p=this._hashName;let y=!1;const v=location.hash.slice(1).split("&").map(w=>{const S=w.split("=")[0];return S===p?(y=!0,`${S}=${l}`):w}).filter(w=>w);return y||v.push(`${p}=${l}`),`#${v.join("&")}`}return`#${l}`}_getCurrentHash(){const i=location.hash.replace("#","");if(this._hashName){let l;return i.split("&").map(p=>p.split("=")).forEach(p=>{p[0]===this._hashName&&(l=p)}),(l&&l[1]||"").split("/")}return i.split("/")}_onHashChange(){const i=this._map;if(!i)return!1;const l=this._getCurrentHash();if(l.length>=3&&!l.some(p=>isNaN(Number(p)))){const p=i.dragRotate.isEnabled()&&i.touchZoomRotate.isEnabled()?+(l[3]||0):i.getBearing();return i.jumpTo({center:[+l[2],+l[1]],zoom:+l[0],bearing:p,pitch:+(l[4]||0)}),!0}return!1}_updateHashUnthrottled(){history.replaceState(history.state,"",location.href.replace(/(#.+)?$/,this.getHashString()))}}function dm(f,i){const l=f.getCenter(),p=Math.round(100*f.getZoom())/100,y=Math.ceil((p*Math.LN2+Math.log(512/360/.5))/Math.LN10),v=Math.pow(10,y),w=Math.round(l.lng*v)/v,S=Math.round(l.lat*v)/v,C=f.getBearing(),D=f.getPitch();let L=i?`/${w}/${S}/${p}`:`${p}/${S}/${w}`;return(C||D)&&(L+="/"+Math.round(10*C)/10),D&&(L+=`/${Math.round(D)}`),L}const fd={linearity:.3,easing:s.ew(0,0,.3,1)},Vg=s.l({deceleration:2500,maxSpeed:1400},fd),$g=s.l({deceleration:20,maxSpeed:1400},fd),Hl=s.l({deceleration:1e3,maxSpeed:360},fd),Ac=s.l({deceleration:1e3,maxSpeed:90},fd);class fm{constructor(i){this._map=i,this.clear()}clear(){this._inertiaBuffer=[]}record(i){this._drainInertiaBuffer(),this._inertiaBuffer.push({time:s.q.now(),settings:i})}_drainInertiaBuffer(){const i=this._inertiaBuffer,l=s.q.now();for(;i.length>0&&l-i[0].time>160;)i.shift()}_onMoveEnd(i){if(this._map._prefersReducedMotion()||(this._drainInertiaBuffer(),this._inertiaBuffer.length<2))return;const l={zoom:0,bearing:0,pitch:0,pan:new s.P(0,0),pinchAround:void 0,around:void 0};for(const{settings:v}of this._inertiaBuffer)l.zoom+=v.zoomDelta||0,l.bearing+=v.bearingDelta||0,l.pitch+=v.pitchDelta||0,v.panDelta&&l.pan._add(v.panDelta),v.around&&(l.around=v.around),v.pinchAround&&(l.pinchAround=v.pinchAround);const p=this._inertiaBuffer[this._inertiaBuffer.length-1].time-this._inertiaBuffer[0].time,y={};if(l.pan.mag()){const v=pd(l.pan.mag(),p,s.l({},Vg,i||{}));y.offset=l.pan.mult(v.amount/l.pan.mag()),y.center=this._map.transform.center,nh(y,v)}if(l.zoom){const v=pd(l.zoom,p,$g);y.zoom=this._map.transform.zoom+v.amount,nh(y,v)}if(l.bearing){const v=pd(l.bearing,p,Hl);y.bearing=this._map.transform.bearing+s.aD(v.amount,-179,179),nh(y,v)}if(l.pitch){const v=pd(l.pitch,p,Ac);y.pitch=this._map.transform.pitch+v.amount,nh(y,v)}if(y.zoom||y.bearing){const v=l.pinchAround===void 0?l.around:l.pinchAround;y.around=v?this._map.unproject(v):this._map.getCenter()}return this.clear(),y.noMoveStart=!0,y}}function nh(f,i){(!f.duration||f.duration<i.duration)&&(f.duration=i.duration,f.easing=i.easing)}function pd(f,i,l){const{maxSpeed:p,linearity:y,deceleration:v}=l,w=s.aD(f*y/(i/1e3),-p,p),S=Math.abs(w)/(v*y);return{easing:l.easing,duration:1e3*S,amount:w*(S/2)}}class qo extends s.A{preventDefault(){this._defaultPrevented=!0}get defaultPrevented(){return this._defaultPrevented}constructor(i,l,p,y={}){const v=Mt(l.getCanvasContainer(),p),w=l.unproject(v);super(i,s.l({point:v,lngLat:w,originalEvent:p},y)),this._defaultPrevented=!1,this.target=l}}class Gl extends s.A{preventDefault(){this._defaultPrevented=!0}get defaultPrevented(){return this._defaultPrevented}constructor(i,l,p){const y=i==="touchend"?p.changedTouches:p.touches,v=At(l.getCanvasContainer(),y),w=v.map(C=>l.unproject(C)),S=v.reduce((C,D,L,F)=>C.add(D.div(F.length)),new s.P(0,0));super(i,{points:v,point:S,lngLats:w,lngLat:l.unproject(S),originalEvent:p}),this._defaultPrevented=!1}}class jg extends s.A{preventDefault(){this._defaultPrevented=!0}get defaultPrevented(){return this._defaultPrevented}constructor(i,l){super("wheel",{originalEvent:l}),this._defaultPrevented=!1}}class au{constructor(i,l){this._map=i,this._clickTolerance=l.clickTolerance}reset(){this._mousedownPos=void 0}wheel(i){return this._firePreventable(new jg(this._map,i))}mousedown(i,l){return this._mousedownPos=l,this._firePreventable(new qo(i.type,this._map,i))}mouseup(i){this._map.fire(new qo(i.type,this._map,i))}preclick(i){const l=s.l({},i);l.type="preclick",this._map.fire(new qo(l.type,this._map,l))}click(i,l){this._mousedownPos&&this._mousedownPos.dist(l)>=this._clickTolerance||(this.preclick(i),this._map.fire(new qo(i.type,this._map,i)))}dblclick(i){return this._firePreventable(new qo(i.type,this._map,i))}mouseover(i){this._map.fire(new qo(i.type,this._map,i))}mouseout(i){this._map.fire(new qo(i.type,this._map,i))}touchstart(i){return this._firePreventable(new Gl(i.type,this._map,i))}touchmove(i){this._map.fire(new Gl(i.type,this._map,i))}touchend(i){this._map.fire(new Gl(i.type,this._map,i))}touchcancel(i){this._map.fire(new Gl(i.type,this._map,i))}_firePreventable(i){if(this._map.fire(i),i.defaultPrevented)return{}}isEnabled(){return!0}isActive(){return!1}enable(){}disable(){}}class Ug{constructor(i){this._map=i}reset(){this._delayContextMenu=!1,this._contextMenuEvent=void 0}mousemove(i){this._map.fire(new qo(i.type,this._map,i))}mousedown(){this._delayContextMenu=!0}mouseup(){this._delayContextMenu=!1,this._contextMenuEvent&&(this._map.fire(new qo("contextmenu",this._map,this._contextMenuEvent)),delete this._contextMenuEvent)}contextmenu(i){this._delayContextMenu?this._contextMenuEvent=i:this._map.fire(new qo(i.type,this._map,i)),this._map.listens("contextmenu")&&i.preventDefault()}isEnabled(){return!0}isActive(){return!1}enable(){}disable(){}}class pm{constructor(i,l){this._map=i,this._el=i.getCanvasContainer(),this._container=i.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(i,l){this.isEnabled()&&i.shiftKey&&i.button===0&&(Ve(),this._startPos=this._lastPos=l,this._active=!0)}mousemoveWindow(i,l){if(!this._active)return;const p=l,y=this._startPos,v=this._lastPos;if(!y||!v||v.equals(p)||!this._box&&p.dist(y)<this._clickTolerance)return;this._lastPos=p,this._box||(this._box=re("div","mapboxgl-boxzoom",this._container),this._container.classList.add("mapboxgl-crosshair"),this._fireEvent("boxzoomstart",i));const w=Math.min(y.x,p.x),S=Math.max(y.x,p.x),C=Math.min(y.y,p.y),D=Math.max(y.y,p.y);this._map._requestDomTask(()=>{this._box&&(this._box.style.transform=`translate(${w}px,${C}px)`,this._box.style.width=S-w+"px",this._box.style.height=D-C+"px")})}mouseupWindow(i,l){if(!this._active)return;const p=this._startPos,y=l;if(p&&i.button===0){if(this.reset(),_t(),p.x!==y.x||p.y!==y.y)return this._map.fire(new s.A("boxzoomend",{originalEvent:i})),{cameraAnimation:v=>v.fitScreenCoordinates(p,y,this._map.getBearing(),{linear:!1})};this._fireEvent("boxzoomcancel",i)}}keydown(i){this._active&&i.keyCode===27&&(this.reset(),this._fireEvent("boxzoomcancel",i))}blur(){this.reset()}reset(){this._active=!1,this._container.classList.remove("mapboxgl-crosshair"),this._box&&(this._box.remove(),this._box=null),Je(),delete this._startPos,delete this._lastPos}_fireEvent(i,l){return this._map.fire(new s.A(i,{originalEvent:l}))}}function Of(f,i){const l={};for(let p=0;p<f.length;p++)l[f[p].identifier]=i[p];return l}class Hg{constructor(i){this.reset(),this.numTouches=i.numTouches}reset(){this.centroid=void 0,this.startTime=0,this.touches={},this.aborted=!1}touchstart(i,l,p){(this.centroid||p.length>this.numTouches)&&(this.aborted=!0),this.aborted||(this.startTime===0&&(this.startTime=i.timeStamp),p.length===this.numTouches&&(this.centroid=function(y){const v=new s.P(0,0);for(const w of y)v._add(w);return v.div(y.length)}(l),this.touches=Of(p,l)))}touchmove(i,l,p){if(this.aborted||!this.centroid)return;const y=Of(p,l);for(const v in this.touches){const w=y[v];(!w||w.dist(this.touches[v])>30)&&(this.aborted=!0)}}touchend(i,l,p){if((!this.centroid||i.timeStamp-this.startTime>500)&&(this.aborted=!0),p.length===0){const y=!this.aborted&&this.centroid;if(this.reset(),y)return y}}}class Vr{constructor(i){this.singleTap=new Hg(i),this.numTaps=i.numTaps,this.reset()}reset(){this.lastTime=1/0,this.lastTap=void 0,this.count=0,this.singleTap.reset()}touchstart(i,l,p){this.singleTap.touchstart(i,l,p)}touchmove(i,l,p){this.singleTap.touchmove(i,l,p)}touchend(i,l,p){const y=this.singleTap.touchend(i,l,p);if(y){const v=i.timeStamp-this.lastTime<500,w=!this.lastTap||this.lastTap.dist(y)<30;if(v&&w||this.reset(),this.count++,this.lastTime=i.timeStamp,this.lastTap=y,this.count===this.numTaps)return this.reset(),y}}}class Gg{constructor(){this._zoomIn=new Vr({numTouches:1,numTaps:2}),this._zoomOut=new Vr({numTouches:2,numTaps:1}),this.reset()}reset(){this._active=!1,this._zoomIn.reset(),this._zoomOut.reset()}touchstart(i,l,p){this._zoomIn.touchstart(i,l,p),this._zoomOut.touchstart(i,l,p)}touchmove(i,l,p){this._zoomIn.touchmove(i,l,p),this._zoomOut.touchmove(i,l,p)}touchend(i,l,p){const y=this._zoomIn.touchend(i,l,p),v=this._zoomOut.touchend(i,l,p);return y?(this._active=!0,i.preventDefault(),setTimeout(()=>this.reset(),0),{cameraAnimation:w=>w.easeTo({duration:300,zoom:w.getZoom()+1,around:w.unproject(y)},{originalEvent:i})}):v?(this._active=!0,i.preventDefault(),setTimeout(()=>this.reset(),0),{cameraAnimation:w=>w.easeTo({duration:300,zoom:w.getZoom()-1,around:w.unproject(v)},{originalEvent:i})}):void 0}touchcancel(){this.reset()}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}const Wg={0:1,2:2},lu={Control:"ctrlKey",Alt:"altKey",Shift:"shiftKey",Meta:"metaKey"};class zf{constructor(i){this.reset(),this._clickTolerance=i.clickTolerance||1}blur(){this.reset()}reset(){this._active=!1,this._moved=!1,this._lastPoint=void 0,this._eventButton=void 0}_correctButton(i,l){return!1}_move(i,l){return{}}mousedown(i,l){if(this._lastPoint)return;const p=ei(i);this._correctButton(i,p)&&(this._lastPoint=l,this._eventButton=p)}mousemoveWindow(i,l){const p=this._lastPoint;if(p){if(i.preventDefault(),this._eventButton!=null&&function(y,v){const w=Wg[v];return y.buttons===void 0||(y.buttons&w)!==w}(i,this._eventButton))this.reset();else if(this._moved||!(l.dist(p)<this._clickTolerance))return this._moved=!0,this._lastPoint=l,this._move(p,l)}}mouseupWindow(i){this._lastPoint&&ei(i)===this._eventButton&&(this._moved&&_t(),this.reset())}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class qg extends zf{mousedown(i,l){super.mousedown(i,l),this._lastPoint&&(this._active=!0)}_correctButton(i,l){return l===0&&!i.ctrlKey}_move(i,l){return{around:l,panDelta:l.sub(i)}}}class mm extends zf{constructor(i){super(i),this._pitchRotateKey=i.pitchRotateKey?lu[i.pitchRotateKey]:void 0}_correctButton(i,l){return this._pitchRotateKey?l===0&&i[this._pitchRotateKey]:l===0&&i.ctrlKey||l===2}_move(i,l){const p=.8*(l.x-i.x);if(p)return this._active=!0,{bearingDelta:p}}contextmenu(i){this._pitchRotateKey||i.preventDefault()}}class sh extends zf{constructor(i){super(i),this._pitchRotateKey=i.pitchRotateKey?lu[i.pitchRotateKey]:void 0}_correctButton(i,l){return this._pitchRotateKey?l===0&&i[this._pitchRotateKey]:l===0&&i.ctrlKey||l===2}_move(i,l){const p=-.5*(l.y-i.y);if(p)return this._active=!0,{pitchDelta:p}}contextmenu(i){this._pitchRotateKey||i.preventDefault()}}class Zg{constructor(i,l){this._map=i,this._el=i.getCanvasContainer(),this._minTouches=1,this._clickTolerance=l.clickTolerance||1,this.reset(),s.aV(["_addTouchPanBlocker","_showTouchPanBlockerAlert"],this)}reset(){this._active=!1,this._touches={},this._sum=new s.P(0,0)}touchstart(i,l,p){return this._calculateTransform(i,l,p)}touchmove(i,l,p){if(this._active&&!(p.length<this._minTouches)){if(this._map._cooperativeGestures&&!this._map.isMoving()){if(p.length===1&&!s.ex())return void this._showTouchPanBlockerAlert();this._alertContainer.style.visibility!=="hidden"&&(this._alertContainer.style.visibility="hidden",clearTimeout(this._alertTimer))}return i.cancelable&&i.preventDefault(),this._calculateTransform(i,l,p)}}touchend(i,l,p){this._calculateTransform(i,l,p),this._active&&p.length<this._minTouches&&this.reset()}touchcancel(){this.reset()}_calculateTransform(i,l,p){p.length>0&&(this._active=!0);const y=Of(p,l),v=new s.P(0,0),w=new s.P(0,0);let S=0;for(const D in y){const L=y[D],F=this._touches[D];F&&(v._add(L),w._add(L.sub(F)),S++,y[D]=L)}if(this._touches=y,S<this._minTouches||!w.mag())return;const C=w.div(S);return this._sum._add(C),this._sum.mag()<this._clickTolerance?void 0:{around:v.div(S),panDelta:C}}enable(){this._enabled=!0,this._map._cooperativeGestures&&(this._addTouchPanBlocker(),this._el.classList.add("mapboxgl-touch-pan-blocker-override","mapboxgl-scrollable-page"))}disable(){this._enabled=!1,this._map._cooperativeGestures&&(clearTimeout(this._alertTimer),this._alertContainer.remove(),this._el.classList.remove("mapboxgl-touch-pan-blocker-override","mapboxgl-scrollable-page")),this.reset()}isEnabled(){return!!this._enabled}isActive(){return!!this._active}_addTouchPanBlocker(){this._map&&!this._alertContainer&&(this._alertContainer=re("div","mapboxgl-touch-pan-blocker",this._map._container),this._alertContainer.textContent=this._map._getUIString("TouchPanBlocker.Message"),this._alertContainer.style.fontSize=`${Math.max(10,Math.min(24,Math.floor(.05*this._el.clientWidth)))}px`)}_showTouchPanBlockerAlert(){this._alertContainer.style.visibility="visible",this._alertContainer.classList.add("mapboxgl-touch-pan-blocker-show"),this._alertContainer.setAttribute("role","alert"),clearTimeout(this._alertTimer),this._alertTimer=window.setTimeout(()=>{this._alertContainer.classList.remove("mapboxgl-touch-pan-blocker-show"),this._alertContainer.removeAttribute("role")},500)}}class Ff{constructor(){this.reset()}reset(){this._active=!1,this._firstTwoTouches=void 0}_start(i){}_move(i,l,p){return{}}touchstart(i,l,p){this._firstTwoTouches||p.length<2||(this._firstTwoTouches=[p[0].identifier,p[1].identifier],this._start([l[0],l[1]]))}touchmove(i,l,p){const y=this._firstTwoTouches;if(!y)return;i.preventDefault();const[v,w]=y,S=md(p,l,v),C=md(p,l,w);if(!S||!C)return;const D=this._aroundCenter?null:S.add(C).div(2);return this._move([S,C],D,i)}touchend(i,l,p){if(!this._firstTwoTouches)return;const[y,v]=this._firstTwoTouches,w=md(p,l,y),S=md(p,l,v);w&&S||(this._active&&_t(),this.reset())}touchcancel(){this.reset()}enable(i){this._enabled=!0,this._aroundCenter=!!i&&i.around==="center"}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}function md(f,i,l){for(let p=0;p<f.length;p++)if(f[p].identifier===l)return i[p]}function Bf(f,i){return Math.log(f/i)/Math.LN2}class Xg extends Ff{reset(){super.reset(),this._distance=0,this._startDistance=0}_start(i){this._startDistance=this._distance=i[0].dist(i[1])}_move(i,l){const p=this._distance;if(this._distance=i[0].dist(i[1]),this._active||!(Math.abs(Bf(this._distance,this._startDistance))<.1))return this._active=!0,{zoomDelta:Bf(this._distance,p),pinchAround:l}}}function gm(f,i){return 180*f.angleWith(i)/Math.PI}class a0 extends Ff{reset(){super.reset(),this._minDiameter=0,this._startVector=void 0,this._vector=void 0}_start(i){this._startVector=this._vector=i[0].sub(i[1]),this._minDiameter=i[0].dist(i[1])}_move(i,l){const p=this._vector;if(this._vector=i[0].sub(i[1]),p&&(this._active||!this._isBelowThreshold(this._vector)))return this._active=!0,{bearingDelta:gm(this._vector,p),pinchAround:l}}_isBelowThreshold(i){this._minDiameter=Math.min(this._minDiameter,i.mag());const l=25/(Math.PI*this._minDiameter)*360,p=this._startVector;if(!p)return!1;const y=gm(i,p);return Math.abs(y)<l}}function _m(f){return Math.abs(f.y)>Math.abs(f.x)}class l0 extends Ff{constructor(i){super(),this._map=i}reset(){super.reset(),this._valid=void 0,this._firstMove=void 0,this._lastPoints=void 0}_start(i){this._lastPoints=i,_m(i[0].sub(i[1]))&&(this._valid=!1)}_move(i,l,p){const y=this._lastPoints;if(!y)return;const v=i[0].sub(y[0]),w=i[1].sub(y[1]);return this._map._cooperativeGestures&&!s.ex()&&p.touches.length<3||(this._valid=this.gestureBeginsVertically(v,w,p.timeStamp),!this._valid)?void 0:(this._lastPoints=i,this._active=!0,{pitchDelta:(v.y+w.y)/2*-.5})}gestureBeginsVertically(i,l,p){if(this._valid!==void 0)return this._valid;const y=i.mag()>=2,v=l.mag()>=2;if(!y&&!v)return;if(!y||!v)return this._firstMove==null&&(this._firstMove=p),p-this._firstMove<100&&void 0;const w=i.y>0==l.y>0;return _m(i)&&_m(l)&&w}}const c0={panStep:100,bearingStep:15,pitchStep:10};class u0{constructor(){const i=c0;this._panStep=i.panStep,this._bearingStep=i.bearingStep,this._pitchStep=i.pitchStep,this._rotationDisabled=!1}blur(){this.reset()}reset(){this._active=!1}keydown(i){if(i.altKey||i.ctrlKey||i.metaKey)return;let l=0,p=0,y=0,v=0,w=0;switch(i.keyCode){case 61:case 107:case 171:case 187:l=1;break;case 189:case 109:case 173:l=-1;break;case 37:i.shiftKey?p=-1:(i.preventDefault(),v=-1);break;case 39:i.shiftKey?p=1:(i.preventDefault(),v=1);break;case 38:i.shiftKey?y=1:(i.preventDefault(),w=-1);break;case 40:i.shiftKey?y=-1:(i.preventDefault(),w=1);break;default:return}return this._rotationDisabled&&(p=0,y=0),{cameraAnimation:S=>{const C=S.getZoom();S.easeTo({duration:300,easeId:"keyboardHandler",easing:h0,zoom:l?Math.round(C)+l*(i.shiftKey?2:1):C,bearing:S.getBearing()+p*this._bearingStep,pitch:S.getPitch()+y*this._pitchStep,offset:[-v*this._panStep,-w*this._panStep],center:S.getCenter()},{originalEvent:i})}}}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}disableRotation(){this._rotationDisabled=!0}enableRotation(){this._rotationDisabled=!1}}function h0(f){return f*(2-f)}const Yg=4.000244140625,d0=1/450;class f0{constructor(i,l){this._map=i,this._el=i.getCanvasContainer(),this._handler=l,this._delta=0,this._lastDelta=0,this._defaultZoomRate=.01,this._wheelZoomRate=d0,s.aV(["_onTimeout","_addScrollZoomBlocker","_showBlockerAlert"],this)}setZoomRate(i){this._defaultZoomRate=i}setWheelZoomRate(i){this._wheelZoomRate=i}isEnabled(){return!!this._enabled}isActive(){return this._active||this._finishTimeout!==void 0}isZooming(){return!!this._zooming}enable(i){this.isEnabled()||(this._enabled=!0,this._aroundCenter=!!i&&i.around==="center",this._map._cooperativeGestures&&this._addScrollZoomBlocker())}disable(){this.isEnabled()&&(this._enabled=!1,this._map._cooperativeGestures&&(clearTimeout(this._alertTimer),this._alertContainer.remove()))}wheel(i){if(!this.isEnabled())return;if(this._map._cooperativeGestures){if(!(i.ctrlKey||i.metaKey||this.isZooming()||s.ex()))return void this._showBlockerAlert();this._alertContainer.style.visibility!=="hidden"&&(this._alertContainer.style.visibility="hidden",clearTimeout(this._alertTimer))}let l=i.deltaMode===WheelEvent.DOM_DELTA_LINE?40*i.deltaY:i.deltaY;const p=s.q.now(),y=p-(this._lastWheelEventTime||0);this._lastWheelEventTime=p,l!==0&&l%Yg==0?this._type="wheel":l!==0&&Math.abs(l)<4?this._type="trackpad":y>400?(this._type=null,this._lastValue=l,this._timeout=window.setTimeout(this._onTimeout,40,i)):this._type||(this._type=Math.abs(y*l)<200?"trackpad":"wheel",this._timeout&&(clearTimeout(this._timeout),this._timeout=null,l+=this._lastValue)),i.shiftKey&&l&&(l/=4),this._type&&(this._lastWheelEvent=i,this._delta-=l,this._active||this._start(i)),i.preventDefault()}_onTimeout(i){this._type="wheel",this._delta-=this._lastValue,this._active||this._start(i)}_start(i){if(!this._delta)return;this._frameId&&(this._frameId=null),this._active=!0,this.isZooming()||(this._zooming=!0),this._finishTimeout&&(clearTimeout(this._finishTimeout),delete this._finishTimeout);const l=Mt(this._el,i);this._aroundPoint=this._aroundCenter?this._map.transform.centerPoint:l,this._aroundCoord=this._map.transform.pointCoordinate3D(this._aroundPoint),this._targetZoom=void 0,this._frameId||(this._frameId=!0,this._handler._triggerRenderFrame())}renderFrame(){if(!this._frameId||(this._frameId=null,!this.isActive()))return;const i=this._map.transform;this._type==="wheel"&&i.projection.wrap&&(i._center.lng>=180||i._center.lng<=-180)&&(this._prevEase=null,this._easing=null,this._lastWheelEvent=null,this._lastWheelEventTime=0);const l=()=>i._terrainEnabled()&&this._aroundCoord?i.computeZoomRelativeTo(this._aroundCoord):i.zoom;if(this._delta!==0){const D=this._type==="wheel"&&Math.abs(this._delta)>Yg?this._wheelZoomRate:this._defaultZoomRate;let L=2/(1+Math.exp(-Math.abs(this._delta*D)));this._delta<0&&L!==0&&(L=1/L);const F=l(),O=Math.pow(2,F),$=typeof this._targetZoom=="number"?i.zoomScale(this._targetZoom):O;this._targetZoom=Math.min(i.maxZoom,Math.max(i.minZoom,i.scaleZoom($*L))),this._type==="wheel"&&(this._startZoom=F,this._easing=this._smoothOutEasing(200)),this._lastDelta=this._delta,this._delta=0}const p=typeof this._targetZoom=="number"?this._targetZoom:l(),y=this._startZoom,v=this._easing;let w,S=!1;if(this._type==="wheel"&&y&&v){const D=Math.min((s.q.now()-this._lastWheelEventTime)/200,1),L=v(D);w=s.ai(y,p,L),D<1?this._frameId||(this._frameId=!0):S=!0}else w=p,S=!0;this._active=!0,S&&(this._active=!1,this._finishTimeout=window.setTimeout(()=>{this._zooming=!1,this._handler._triggerRenderFrame(),delete this._targetZoom,delete this._finishTimeout},200));let C=w-l();return C*this._lastDelta<0&&(C=0),{noInertia:!0,needsRenderFrame:!S,zoomDelta:C,around:this._aroundPoint,aroundCoord:this._aroundCoord,originalEvent:this._lastWheelEvent}}_smoothOutEasing(i){let l=s.ey;if(this._prevEase){const p=this._prevEase,y=(s.q.now()-p.start)/p.duration,v=p.easing(y+.01)-p.easing(y),w=.27/Math.sqrt(v*v+1e-4)*.01,S=Math.sqrt(.0729-w*w);l=s.ew(w,S,.25,1)}return this._prevEase={start:s.q.now(),duration:i,easing:l},l}blur(){this.reset()}reset(){this._active=!1}_addScrollZoomBlocker(){this._map&&!this._alertContainer&&(this._alertContainer=re("div","mapboxgl-scroll-zoom-blocker",this._map._container),this._alertContainer.textContent=/(Mac|iPad)/i.test(navigator.userAgent)?this._map._getUIString("ScrollZoomBlocker.CmdMessage"):this._map._getUIString("ScrollZoomBlocker.CtrlMessage"),this._alertContainer.style.fontSize=`${Math.max(10,Math.min(24,Math.floor(.05*this._el.clientWidth)))}px`)}_showBlockerAlert(){this._alertContainer.style.visibility="visible",this._alertContainer.classList.add("mapboxgl-scroll-zoom-blocker-show"),this._alertContainer.setAttribute("role","alert"),clearTimeout(this._alertTimer),this._alertTimer=window.setTimeout(()=>{this._alertContainer.classList.remove("mapboxgl-scroll-zoom-blocker-show"),this._alertContainer.removeAttribute("role")},200)}}class p0{constructor(i,l){this._clickZoom=i,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 m0{constructor(){this.reset()}reset(){this._active=!1}blur(){this.reset()}dblclick(i,l){return i.preventDefault(),{cameraAnimation:p=>{p.easeTo({duration:300,zoom:p.getZoom()+(i.shiftKey?-1:1),around:p.unproject(l)},{originalEvent:i})}}}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class g0{constructor(){this._tap=new Vr({numTouches:1,numTaps:1}),this.reset()}reset(){this._active=!1,this._swipePoint=void 0,this._swipeTouch=0,this._tapTime=0,this._tap.reset()}touchstart(i,l,p){this._swipePoint||(this._tapTime&&i.timeStamp-this._tapTime>500&&this.reset(),this._tapTime?p.length>0&&(this._swipePoint=l[0],this._swipeTouch=p[0].identifier):this._tap.touchstart(i,l,p))}touchmove(i,l,p){if(this._tapTime){if(this._swipePoint){if(p[0].identifier!==this._swipeTouch)return;const y=l[0],v=y.y-this._swipePoint.y;return this._swipePoint=y,i.preventDefault(),this._active=!0,{zoomDelta:v/128}}}else this._tap.touchmove(i,l,p)}touchend(i,l,p){this._tapTime?this._swipePoint&&p.length===0&&this.reset():this._tap.touchend(i,l,p)&&(this._tapTime=i.timeStamp)}touchcancel(){this.reset()}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class _0{constructor(i,l,p){this._el=i,this._mousePan=l,this._touchPan=p}enable(i){this._inertiaOptions=i||{},this._mousePan.enable(),this._touchPan.enable(),this._el.classList.add("mapboxgl-touch-drag-pan")}disable(){this._mousePan.disable(),this._touchPan.disable(),this._el.classList.remove("mapboxgl-touch-drag-pan")}isEnabled(){return this._mousePan.isEnabled()&&this._touchPan.isEnabled()}isActive(){return this._mousePan.isActive()||this._touchPan.isActive()}}class P1{constructor(i,l,p){this._pitchWithRotate=i.pitchWithRotate,this._mouseRotate=l,this._mousePitch=p}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 D1{constructor(i,l,p,y){this._el=i,this._touchZoom=l,this._touchRotate=p,this._tapDragZoom=y,this._rotationDisabled=!1,this._enabled=!0}enable(i){this._touchZoom.enable(i),this._rotationDisabled||this._touchRotate.enable(i),this._tapDragZoom.enable(),this._el.classList.add("mapboxgl-touch-zoom-rotate")}disable(){this._touchZoom.disable(),this._touchRotate.disable(),this._tapDragZoom.disable(),this._el.classList.remove("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()}}const Vs=f=>f.zoom||f.drag||f.pitch||f.rotate;class y0 extends s.A{}class k1{constructor(){this.constants=[1,1,.01],this.radius=0}setup(i,l){const p=s.at([],l,i);this.radius=s.ae(p[2]<0?s.eA([],p,this.constants):[p[0],p[1],0])}projectRay(i){s.eA(i,i,this.constants),s.au(i,i),s.eB(i,i,this.constants);const l=s.b$([],i,this.radius);if(l[2]>0){const p=s.b$([],[0,0,1],s.bE(l,[0,0,1])),y=s.b$([],s.au([],[l[0],l[1],0]),this.radius),v=s.cU([],l,s.b$([],s.at([],s.cU([],y,p),l),2));l[0]=v[0],l[1]=v[1]}return l}}function gd(f){return f.panDelta&&f.panDelta.mag()||f.zoomDelta||f.bearingDelta||f.pitchDelta}class L1{constructor(i,l){this._map=i,this._el=this._map.getCanvasContainer(),this._handlers=[],this._handlersById={},this._changes=[],this._inertia=new fm(i),this._bearingSnap=l.bearingSnap,this._previousActiveHandlers={},this._trackingEllipsoid=new k1,this._dragOrigin=null,this._eventsInProgress={},this._addDefaultHandlers(l),s.aV(["handleEvent","handleWindowEvent"],this);const p=this._el;this._listeners=[[p,"touchstart",{passive:!0}],[p,"touchmove",{passive:!1}],[p,"touchend",void 0],[p,"touchcancel",void 0],[p,"mousedown",void 0],[p,"mousemove",void 0],[p,"mouseup",void 0],[document,"mousemove",{capture:!0}],[document,"mouseup",void 0],[p,"mouseover",void 0],[p,"mouseout",void 0],[p,"dblclick",void 0],[p,"click",void 0],[p,"keydown",{capture:!1}],[p,"keyup",void 0],[p,"wheel",{passive:!1}],[p,"contextmenu",void 0],[window,"blur",void 0]];for(const[y,v,w]of this._listeners){const S=y===document?this.handleWindowEvent:this.handleEvent;y.addEventListener(v,S,w)}}destroy(){for(const[i,l,p]of this._listeners){const y=i===document?this.handleWindowEvent:this.handleEvent;i.removeEventListener(l,y,p)}}_addDefaultHandlers(i){const l=this._map,p=l.getCanvasContainer();this._add("mapEvent",new au(l,i));const y=l.boxZoom=new pm(l,i);this._add("boxZoom",y);const v=new Gg,w=new m0;l.doubleClickZoom=new p0(w,v),this._add("tapZoom",v),this._add("clickZoom",w);const S=new g0;this._add("tapDragZoom",S);const C=l.touchPitch=new l0(l);this._add("touchPitch",C);const D=new mm(i),L=new sh(i);l.dragRotate=new P1(i,D,L),this._add("mouseRotate",D,["mousePitch"]),this._add("mousePitch",L,["mouseRotate"]);const F=new qg(i),O=new Zg(l,i);l.dragPan=new _0(p,F,O),this._add("mousePan",F),this._add("touchPan",O,["touchZoom","touchRotate"]);const $=new a0,q=new Xg;l.touchZoomRotate=new D1(p,q,$,S),this._add("touchRotate",$,["touchPan","touchZoom"]),this._add("touchZoom",q,["touchPan","touchRotate"]),this._add("blockableMapEvent",new Ug(l));const W=l.scrollZoom=new f0(l,this);this._add("scrollZoom",W,["mousePan"]);const K=l.keyboard=new u0;this._add("keyboard",K);for(const Z of["boxZoom","doubleClickZoom","tapDragZoom","touchPitch","dragRotate","dragPan","touchZoomRotate","scrollZoom","keyboard"])i.interactive&&i[Z]&&l[Z].enable(i[Z])}_add(i,l,p){this._handlers.push({handlerName:i,handler:l,allowed:p}),this._handlersById[i]=l}stop(i){if(!this._updatingCamera){for(const{handler:l}of this._handlers)l.reset();this._inertia.clear(),this._fireEvents({},{},i),this._changes=[],this._originalZoom=void 0}}isActive(){for(const{handler:i}of this._handlers)if(i.isActive())return!0;return!1}isZooming(){return!!this._eventsInProgress.zoom||this._map.scrollZoom.isZooming()}isRotating(){return!!this._eventsInProgress.rotate}isMoving(){return!!Vs(this._eventsInProgress)||this.isZooming()}_isDragging(){return!!this._eventsInProgress.drag}_blockedByActive(i,l,p){for(const y in i)if(y!==p&&(!l||l.indexOf(y)<0))return!0;return!1}handleWindowEvent(i){this.handleEvent(i,`${i.type}Window`)}_getMapTouches(i){const l=[];for(const p of i)this._el.contains(p.target)&&l.push(p);return l}handleEvent(i,l){this._updatingCamera=!0;const p=i.type==="renderFrame",y=p?void 0:i,v={needsRenderFrame:!1},w={},S={},C=i.touches?this._getMapTouches(i.touches):void 0,D=C?At(this._el,C):p?void 0:Mt(this._el,i);for(const{handlerName:O,handler:$,allowed:q}of this._handlers){if(!$.isEnabled())continue;let W;this._blockedByActive(S,q,O)?$.reset():$[l||i.type]&&(W=$[l||i.type](i,D,C),this.mergeHandlerResult(v,w,W,O,y),W&&W.needsRenderFrame&&this._triggerRenderFrame()),(W||$.isActive())&&(S[O]=$)}const L={};for(const O in this._previousActiveHandlers)S[O]||(L[O]=y);this._previousActiveHandlers=S,(Object.keys(L).length||gd(v))&&(this._changes.push([v,w,L]),this._triggerRenderFrame()),(Object.keys(S).length||gd(v))&&this._map._stop(!0),this._updatingCamera=!1;const{cameraAnimation:F}=v;F&&(this._inertia.clear(),this._fireEvents({},{},!0),this._changes=[],F(this._map))}mergeHandlerResult(i,l,p,y,v){if(!p)return;s.l(i,p);const w={handlerName:y,originalEvent:p.originalEvent||v};p.zoomDelta!==void 0&&(l.zoom=w),p.panDelta!==void 0&&(l.drag=w),p.pitchDelta!==void 0&&(l.pitch=w),p.bearingDelta!==void 0&&(l.rotate=w)}_applyChanges(){const i={},l={},p={};for(const[y,v,w]of this._changes)y.panDelta&&(i.panDelta=(i.panDelta||new s.P(0,0))._add(y.panDelta)),y.zoomDelta&&(i.zoomDelta=(i.zoomDelta||0)+y.zoomDelta),y.bearingDelta&&(i.bearingDelta=(i.bearingDelta||0)+y.bearingDelta),y.pitchDelta&&(i.pitchDelta=(i.pitchDelta||0)+y.pitchDelta),y.around!==void 0&&(i.around=y.around),y.aroundCoord!==void 0&&(i.aroundCoord=y.aroundCoord),y.pinchAround!==void 0&&(i.pinchAround=y.pinchAround),y.noInertia&&(i.noInertia=y.noInertia),s.l(l,v),s.l(p,w);this._updateMapTransform(i,l,p),this._changes=[]}_updateMapTransform(i,l,p){const y=this._map,v=y.transform,w=se=>[se.x,se.y,se.z];if((se=>{const ue=this._eventsInProgress.drag;return ue&&!this._handlersById[ue.handlerName].isActive()})()&&!gd(i)){const se=v.zoom;v.cameraElevationReference="sea",this._originalZoom!=null&&v._orthographicProjectionAtLowPitch&&v.projection.name!=="globe"&&v.pitch===0?(v.cameraElevationReference="ground",v.zoom=this._originalZoom):(v.recenterOnTerrain(),v.cameraElevationReference="ground"),se!==v.zoom&&this._map._update(!0)}if(v._isCameraConstrained&&y._stop(!0),!gd(i))return void this._fireEvents(l,p,!0);let{panDelta:S,zoomDelta:C,bearingDelta:D,pitchDelta:L,around:F,aroundCoord:O,pinchAround:$}=i;v._isCameraConstrained&&(C>0&&(C=0),v._isCameraConstrained=!1),$!==void 0&&(F=$),(C||(se=>l[se]&&!this._eventsInProgress[se])("drag"))&&F&&(this._dragOrigin=w(v.pointCoordinate3D(F)),this._originalZoom=v.zoom,this._trackingEllipsoid.setup(v._camera.position,this._dragOrigin)),v.cameraElevationReference="sea",y._stop(!0),F=F||y.transform.centerPoint,D&&(v.bearing+=D),L&&(v.pitch+=L),v._updateCameraState();const q=[0,0,0];if(S)if(v.projection.name==="mercator"){const se=this._trackingEllipsoid.projectRay(v.screenPointToMercatorRay(F).dir),ue=this._trackingEllipsoid.projectRay(v.screenPointToMercatorRay(F.sub(S)).dir);q[0]=ue[0]-se[0],q[1]=ue[1]-se[1]}else{const se=v.pointCoordinate(F);if(v.projection.name==="globe"){S=S.rotate(-v.angle);const ue=v._pixelsPerMercatorPixel/v.worldSize;q[0]=-S.x*s.ez(s.aY(se.y))*ue,q[1]=-S.y*s.ez(v.center.lat)*ue}else{const ue=v.pointCoordinate(F.sub(S));se&&ue&&(q[0]=ue.x-se.x,q[1]=ue.y-se.y)}}const W=v.zoom,K=[0,0,0];if(C){const se=w(O||v.pointCoordinate3D(F)),ue={dir:s.au([],s.at([],se,v._camera.position))};if(ue.dir[2]<0){const fe=v.zoomDeltaToMovement(se,C);s.b$(K,ue.dir,fe)}}const Z=s.cU(q,q,K);v._translateCameraConstrained(Z),C&&Math.abs(v.zoom-W)>1e-4&&v.recenterOnTerrain(),v.cameraElevationReference="ground",this._map._update(),i.noInertia||this._inertia.record(i),this._fireEvents(l,p,!0)}_fireEvents(i,l,p){const y=Vs(this._eventsInProgress),v=Vs(i),w={};for(const L in i){const{originalEvent:F}=i[L];this._eventsInProgress[L]||(w[`${L}start`]=F),this._eventsInProgress[L]=i[L]}!y&&v&&this._fireEvent("movestart",v.originalEvent);for(const L in w)this._fireEvent(L,w[L]);v&&this._fireEvent("move",v.originalEvent);for(const L in i){const{originalEvent:F}=i[L];this._fireEvent(L,F)}const S={};let C;for(const L in this._eventsInProgress){const{handlerName:F,originalEvent:O}=this._eventsInProgress[L];this._handlersById[F].isActive()||(delete this._eventsInProgress[L],C=l[F]||O,S[`${L}end`]=C)}for(const L in S)this._fireEvent(L,S[L]);const D=Vs(this._eventsInProgress);if(p&&(y||v)&&!D){this._updatingCamera=!0;const L=this._inertia._onMoveEnd(this._map.dragPan._inertiaOptions),F=O=>O!==0&&-this._bearingSnap<O&&O<this._bearingSnap;L?(F(L.bearing||this._map.getBearing())&&(L.bearing=0),this._map.easeTo(L,{originalEvent:C})):(this._map.fire(new s.A("moveend",{originalEvent:C})),F(this._map.getBearing())&&this._map.resetNorth()),this._updatingCamera=!1}}_fireEvent(i,l){this._map.fire(new s.A(i,l?{originalEvent:l}:{}))}_requestFrame(){return this._map.triggerRepaint(),this._map._renderTaskQueue.add(i=>{this._frameId=void 0,this.handleEvent(new y0("renderFrame",{timeStamp:i})),this._applyChanges()})}_triggerRenderFrame(){this._frameId===void 0&&(this._frameId=this._requestFrame())}}const _d="map.setFreeCameraOptions(...) and map.getFreeCameraOptions() are not yet supported for non-mercator projections.";class v0 extends s.E{constructor(i,l){super(),this._moving=!1,this._zooming=!1,this.transform=i,this._bearingSnap=l.bearingSnap,this._respectPrefersReducedMotion=l.respectPrefersReducedMotion!==!1,s.aV(["_renderFrameCallback"],this)}getCenter(){return new s.cd(this.transform.center.lng,this.transform.center.lat)}setCenter(i,l){return this.jumpTo({center:i},l)}panBy(i,l,p){return i=s.P.convert(i).mult(-1),this.panTo(this.transform.center,s.l({offset:i},l),p)}panTo(i,l,p){return this.easeTo(s.l({center:i},l),p)}getZoom(){return this.transform.zoom}setZoom(i,l){return this.jumpTo({zoom:i},l),this}zoomTo(i,l,p){return this.easeTo(s.l({zoom:i},l),p)}zoomIn(i,l){return this.zoomTo(this.getZoom()+1,i,l),this}zoomOut(i,l){return this.zoomTo(this.getZoom()-1,i,l),this}getBearing(){return this.transform.bearing}setBearing(i,l){return this.jumpTo({bearing:i},l),this}getPadding(){return this.transform.padding}setPadding(i,l){return this.jumpTo({padding:i},l),this}rotateTo(i,l,p){return this.easeTo(s.l({bearing:i},l),p)}resetNorth(i,l){return this.rotateTo(0,s.l({duration:1e3},i),l),this}resetNorthPitch(i,l){return this.easeTo(s.l({bearing:0,pitch:0,duration:1e3},i),l),this}snapToNorth(i,l){return Math.abs(this.getBearing())<this._bearingSnap?this.resetNorth(i,l):this}getPitch(){return this.transform.pitch}setPitch(i,l){return this.jumpTo({pitch:i},l),this}cameraForBounds(i,l){i=s.aG.convert(i);const p=l&&l.bearing||0,y=l&&l.pitch||0,v=i.getNorthWest(),w=i.getSouthEast();return this._cameraForBounds(this.transform,v,w,p,y,l)}_extendPadding(i){const l={top:0,right:0,bottom:0,left:0};return i==null?s.l({},l,this.transform.padding):typeof i=="number"?{top:i,bottom:i,right:i,left:i}:s.l({},l,i)}_extendCameraOptions(i){return(i=s.l({offset:[0,0],maxZoom:this.transform.maxZoom},i)).padding=this._extendPadding(i.padding),i}_minimumAABBFrustumDistance(i,l){const p=l.max[0]-l.min[0],y=l.max[1]-l.min[1];return p/y>i.aspect?p/(2*Math.tan(.5*i.fovX)*i.aspect):y/(2*Math.tan(.5*i.fovY)*i.aspect)}_cameraForBoundsOnGlobe(i,l,p,y,v,w){const S=i.clone(),C=this._extendCameraOptions(w);S.bearing=y,S.pitch=v;const D=s.cd.convert(l),L=s.cd.convert(p),F=.5*(D.lat+L.lat),O=.5*(D.lng+L.lng),$=s.eC(F,O),q=s.au([],$),W=s.au([],s.bG([],q,[0,1,0])),K=s.bG([],W,q),Z=[W[0],W[1],W[2],0,K[0],K[1],K[2],0,q[0],q[1],q[2],0,0,0,0,1],se=[$,s.eC(D.lat,D.lng),s.eC(L.lat,D.lng),s.eC(L.lat,L.lng),s.eC(D.lat,L.lng),s.eC(F,D.lng),s.eC(F,L.lng),s.eC(D.lat,O),s.eC(L.lat,O)];let ue=s.cV.fromPoints(se.map(Xe=>[s.bE(W,Xe),s.bE(K,Xe),s.bE(q,Xe)]));const fe=s.ad([],ue.center,Z);s.eD(fe)===0&&s.eE(fe,0,0,1),s.au(fe,fe),s.b$(fe,fe,s.aE),S.center=s.eF(fe);const xe=S.getWorldToCameraMatrix(),_e=s.bi(new Float64Array(16),xe);ue=s.cV.applyTransform(ue,s.az([],xe,Z));const ye=this._extendAABB(ue,S,C,y);if(!ye)return void s.w("Map cannot fit within canvas with the given bounds, padding, and/or offset.");ue=ye,s.ad(fe,fe,xe);const pe=.5*(ue.max[2]-ue.min[2]),Se=this._minimumAABBFrustumDistance(S,ue),Ae=s.b$([],[0,0,1],pe),Ge=s.cU(Ae,fe,Ae),Ne=Se+(S.pitch===0?0:s.bD(fe,Ge)),lt=S.globeCenterInViewSpace,st=s.at([],fe,[lt[0],lt[1],lt[2]]);s.au(st,st),s.b$(st,st,Ne);const Et=s.cU([],fe,st);s.ad(Et,Et,_e);const Be=s.eq/s.aE,We=s.ae(Et),Re=s.c6(Math.max(We*Be-s.eq,Number.EPSILON),0),ht=Math.min(S.zoomFromMercatorZAdjusted(Re),C.maxZoom);return ht>.5*(s.cL+s.cx)?(S.setProjection({name:"mercator"}),S.zoom=ht,this._cameraForBounds(S,l,p,y,v,w)):{center:S.center,zoom:ht,bearing:y,pitch:v}}_extendAABB(i,l,p,y){const v=.5*((p.padding.left||0)+(p.padding.right||0)),w=.5*((p.padding.top||0)+(p.padding.bottom||0)),S=w,C=v,D=v,L=w,F=l.width-(C+D),O=l.height-(S+L),$=s.at([],i.max,i.min),q=Math.min(F/$[0],O/$[1]),W=Math.min(l.scaleZoom(l.scale*q),p.maxZoom);if(isNaN(W))return null;const K=l.scale/l.zoomScale(W),Z=new s.cV([i.min[0]-C*K,i.min[1]-L*K,i.min[2]],[i.max[0]+D*K,i.max[1]+S*K,i.max[2]]),se=(typeof p.offset.x=="number"&&typeof p.offset.y=="number"?new s.P(p.offset.x,p.offset.y):s.P.convert(p.offset)).rotate(-s.al(y));return Z.center[0]-=se.x*K,Z.center[1]+=se.y*K,Z}queryTerrainElevation(i,l){const p=this.transform.elevation;return p?(l=s.l({},{exaggerated:!0},l),p.getAtPoint(s.ac.fromLngLat(i),null,l.exaggerated)):null}_cameraForBounds(i,l,p,y,v,w){if(i.projection.name==="globe")return this._cameraForBoundsOnGlobe(i,l,p,y,v,w);const S=i.clone(),C=this._extendCameraOptions(w);S.bearing=y,S.pitch=v;const D=s.cd.convert(l),L=s.cd.convert(p),F=new s.cd(D.lng,L.lat),O=new s.cd(L.lng,D.lat),$=S.project(D),q=S.project(L),W=this.queryTerrainElevation(D),K=this.queryTerrainElevation(L),Z=this.queryTerrainElevation(F),se=this.queryTerrainElevation(O),ue=[[$.x,$.y,Math.min(W||0,K||0,Z||0,se||0)],[q.x,q.y,Math.max(W||0,K||0,Z||0,se||0)]];let fe=s.cV.fromPoints(ue);const xe=S.getWorldToCameraMatrix(),_e=s.bi(new Float64Array(16),xe);fe=s.cV.applyTransform(fe,xe);const ye=this._extendAABB(fe,S,C,y);if(!ye)return void s.w("Map cannot fit within canvas with the given bounds, padding, and/or offset.");fe=ye;const pe=.5*s.at([],fe.max,fe.min)[2],Se=this._minimumAABBFrustumDistance(S,fe),Ae=[0,0,1,0];s.aA(Ae,Ae,xe),s.eG(Ae,Ae);const Ge=s.b$([],Ae,Se+pe),Ne=s.cU([],fe.center,Ge);s.ad(fe.center,fe.center,_e),s.ad(Ne,Ne,_e);const lt=S.unproject(new s.P(fe.center[0],fe.center[1])),st=s.eH(S.projection,lt),Et=Math.pow(2,st),Be=Math.min(S._zoomFromMercatorZ(Ne[2]*S.pixelsPerMeter*Et/S.worldSize),C.maxZoom);return S.mercatorFromTransition&&Be<.5*(s.cL+s.cx)?(S.setProjection({name:"globe"}),S.zoom=Be,this._cameraForBounds(S,l,p,y,v,w)):{center:lt,zoom:Be,bearing:y,pitch:v}}fitBounds(i,l,p){const y=this.cameraForBounds(i,l);return this._fitInternal(y,l,p)}fitScreenCoordinates(i,l,p,y,v){const w=s.P.convert(i),S=s.P.convert(l),C=new s.P(Math.min(w.x,S.x),Math.min(w.y,S.y)),D=new s.P(Math.max(w.x,S.x),Math.max(w.y,S.y));if(this.transform.projection.name==="mercator"&&this.transform.anyCornerOffEdge(w,S))return this;const L=this.transform.pointLocation3D(C),F=this.transform.pointLocation3D(D),O=this.transform.pointLocation3D(new s.P(C.x,D.y)),$=this.transform.pointLocation3D(new s.P(D.x,C.y)),q=[Math.min(L.lng,F.lng,O.lng,$.lng),Math.min(L.lat,F.lat,O.lat,$.lat)],W=[Math.max(L.lng,F.lng,O.lng,$.lng),Math.max(L.lat,F.lat,O.lat,$.lat)],K=y&&y.pitch?y.pitch:this.getPitch(),Z=this._cameraForBounds(this.transform,q,W,p,K,y);return this._fitInternal(Z,y,v)}_fitInternal(i,l,p){return i?(l=s.l(i,l)).linear?this.easeTo(l,p):this.flyTo(l,p):this}jumpTo(i,l){this.stop();const p=i.preloadOnly?this.transform.clone():this.transform;let y=!1,v=!1,w=!1;"zoom"in i&&p.zoom!==+i.zoom&&(y=!0,p.zoom=+i.zoom),i.center!==void 0&&(p.center=s.cd.convert(i.center)),"bearing"in i&&p.bearing!==+i.bearing&&(v=!0,p.bearing=+i.bearing),"pitch"in i&&p.pitch!==+i.pitch&&(w=!0,p.pitch=+i.pitch);const S=typeof i.padding=="number"?this._extendPadding(i.padding):i.padding;if(i.padding!=null&&!p.isPaddingEqual(S))if(i.retainPadding===!1){const C=p.clone();C.padding=S,p.setLocationAtPoint(p.center,C.centerPoint)}else p.padding=S;return i.preloadOnly?(this._preloadTiles(p),this):(this.fire(new s.A("movestart",l)).fire(new s.A("move",l)),y&&this.fire(new s.A("zoomstart",l)).fire(new s.A("zoom",l)).fire(new s.A("zoomend",l)),v&&this.fire(new s.A("rotatestart",l)).fire(new s.A("rotate",l)).fire(new s.A("rotateend",l)),w&&this.fire(new s.A("pitchstart",l)).fire(new s.A("pitch",l)).fire(new s.A("pitchend",l)),this.fire(new s.A("moveend",l)))}getFreeCameraOptions(){return this.transform.projection.supportsFreeCamera||s.w(_d),this.transform.getFreeCameraOptions()}setFreeCameraOptions(i,l){const p=this.transform;if(!p.projection.supportsFreeCamera)return s.w(_d),this;this.stop();const y=p.zoom,v=p.pitch,w=p.bearing;p.setFreeCameraOptions(i);const S=y!==p.zoom,C=v!==p.pitch,D=w!==p.bearing;return this.fire(new s.A("movestart",l)).fire(new s.A("move",l)),S&&this.fire(new s.A("zoomstart",l)).fire(new s.A("zoom",l)).fire(new s.A("zoomend",l)),D&&this.fire(new s.A("rotatestart",l)).fire(new s.A("rotate",l)).fire(new s.A("rotateend",l)),C&&this.fire(new s.A("pitchstart",l)).fire(new s.A("pitch",l)).fire(new s.A("pitchend",l)),this.fire(new s.A("moveend",l)),this}easeTo(i,l){this._stop(!1,i.easeId),((i=s.l({offset:[0,0],duration:500,easing:s.ey},i)).animate===!1||this._prefersReducedMotion(i))&&(i.duration=0);const p=this.transform,y=this.getZoom(),v=this.getBearing(),w=this.getPitch(),S=this.getPadding(),C="zoom"in i?+i.zoom:y,D="bearing"in i?this._normalizeBearing(i.bearing,v):v,L="pitch"in i?+i.pitch:w,F=this._extendPadding(i.padding),O=s.P.convert(i.offset);let $,q,W;if(p.projection.name==="globe"){const Ae=s.ac.fromLngLat(p.center),Ge=O.rotate(-p.angle);Ae.x+=Ge.x/p.worldSize,Ae.y+=Ge.y/p.worldSize;const Ne=Ae.toLngLat(),lt=s.cd.convert(i.center||Ne);this._normalizeCenter(lt),$=p.centerPoint.add(Ge),q=new s.P(Ae.x,Ae.y).mult(p.worldSize),W=new s.P(s.ay(lt.lng),s.aH(lt.lat)).mult(p.worldSize).sub(q)}else{$=p.centerPoint.add(O);const Ae=p.pointLocation($),Ge=s.cd.convert(i.center||Ae);this._normalizeCenter(Ge),q=p.project(Ae),W=p.project(Ge).sub(q)}const K=p.zoomScale(C-y);let Z,se;i.around&&(Z=s.cd.convert(i.around),se=p.locationPoint(Z));const ue=this._zooming||C!==y,fe=this._rotating||v!==D,xe=this._pitching||L!==w,_e=!p.isPaddingEqual(F),ye=i.retainPadding===!1?p.clone():p,pe=Ae=>Ge=>{if(ue&&(Ae.zoom=s.ai(y,C,Ge)),fe&&(Ae.bearing=s.ai(v,D,Ge)),xe&&(Ae.pitch=s.ai(w,L,Ge)),_e&&(ye.interpolatePadding(S,F,Ge),$=ye.centerPoint.add(O)),Z)Ae.setLocationAtPoint(Z,se);else{const Ne=Ae.zoomScale(Ae.zoom-y),lt=C>y?Math.min(2,K):Math.max(.5,K),st=Math.pow(lt,1-Ge),Et=Ae.unproject(q.add(W.mult(Ge*st)).mult(Ne));Ae.setLocationAtPoint(Ae.renderWorldCopies?Et.wrap():Et,$)}return i.preloadOnly||this._fireMoveEvents(l),Ae};if(i.preloadOnly){const Ae=this._emulate(pe,i.duration,p);return this._preloadTiles(Ae),this}const Se={moving:this._moving,zooming:this._zooming,rotating:this._rotating,pitching:this._pitching};return this._zooming=ue,this._rotating=fe,this._pitching=xe,this._padding=_e,this._easeId=i.easeId,this._prepareEase(l,i.noMoveStart,Se),this._ease(pe(p),Ae=>{p.cameraElevationReference==="sea"&&p.recenterOnTerrain(),this._afterEase(l,Ae)},i),this}_prepareEase(i,l,p={}){this._moving=!0,this.transform.cameraElevationReference="sea",this.transform._orthographicProjectionAtLowPitch&&this.transform.pitch===0&&this.transform.projection.name!=="globe"&&(this.transform.cameraElevationReference="ground"),l||p.moving||this.fire(new s.A("movestart",i)),this._zooming&&!p.zooming&&this.fire(new s.A("zoomstart",i)),this._rotating&&!p.rotating&&this.fire(new s.A("rotatestart",i)),this._pitching&&!p.pitching&&this.fire(new s.A("pitchstart",i))}_fireMoveEvents(i){this.fire(new s.A("move",i)),this._zooming&&this.fire(new s.A("zoom",i)),this._rotating&&this.fire(new s.A("rotate",i)),this._pitching&&this.fire(new s.A("pitch",i))}_afterEase(i,l){if(this._easeId&&l&&this._easeId===l)return;this._easeId=void 0,this.transform.cameraElevationReference="ground";const p=this._zooming,y=this._rotating,v=this._pitching;this._moving=!1,this._zooming=!1,this._rotating=!1,this._pitching=!1,this._padding=!1,p&&this.fire(new s.A("zoomend",i)),y&&this.fire(new s.A("rotateend",i)),v&&this.fire(new s.A("pitchend",i)),this.fire(new s.A("moveend",i))}flyTo(i,l){if(this._prefersReducedMotion(i)){const Xe=s.aF(i,["center","zoom","bearing","pitch","around","padding","retainPadding"]);return this.jumpTo(Xe,l)}this.stop(),i=s.l({offset:[0,0],speed:1.2,curve:1.42,easing:s.ey},i);const p=this.transform,y=this.getZoom(),v=this.getBearing(),w=this.getPitch(),S=this.getPadding(),C="zoom"in i?s.aD(+i.zoom,p.minZoom,p.maxZoom):y,D="bearing"in i?this._normalizeBearing(i.bearing,v):v,L="pitch"in i?+i.pitch:w,F=this._extendPadding(i.padding),O=p.zoomScale(C-y),$=s.P.convert(i.offset);let q=p.centerPoint.add($);const W=p.pointLocation(q),K=s.cd.convert(i.center||W);this._normalizeCenter(K);const Z=p.project(W),se=p.project(K).sub(Z);let ue=i.curve;const fe=Math.max(p.width,p.height),xe=fe/O,_e=se.mag();if("minZoom"in i){const Xe=s.aD(Math.min(i.minZoom,y,C),p.minZoom,p.maxZoom),gt=fe/p.zoomScale(Xe-y);ue=Math.sqrt(gt/_e*2)}const ye=ue*ue;function pe(Xe){const gt=(xe*xe-fe*fe+(Xe?-1:1)*ye*ye*_e*_e)/(2*(Xe?xe:fe)*ye*_e);return Math.log(Math.sqrt(gt*gt+1)-gt)}function Se(Xe){return(Math.exp(Xe)-Math.exp(-Xe))/2}function Ae(Xe){return(Math.exp(Xe)+Math.exp(-Xe))/2}const Ge=pe(0);let Ne=function(Xe){return Ae(Ge)/Ae(Ge+ue*Xe)},lt=function(Xe){return fe*((Ae(Ge)*(Se(gt=Ge+ue*Xe)/Ae(gt))-Se(Ge))/ye)/_e;var gt},st=(pe(1)-Ge)/ue;if(Math.abs(_e)<1e-6||!isFinite(st)){if(Math.abs(fe-xe)<1e-6)return this.easeTo(i,l);const Xe=xe<fe?-1:1;st=Math.abs(Math.log(xe/fe))/ue,lt=function(){return 0},Ne=function(gt){return Math.exp(Xe*ue*gt)}}i.duration="duration"in i?+i.duration:1e3*st/("screenSpeed"in i?+i.screenSpeed/ue:+i.speed),i.maxDuration&&i.duration>i.maxDuration&&(i.duration=0);const Et=v!==D,Be=L!==w,We=!p.isPaddingEqual(F),Re=i.retainPadding===!1?p.clone():p,ht=Xe=>gt=>{const ct=gt*st,yt=1/Ne(ct);Xe.zoom=gt===1?C:y+Xe.scaleZoom(yt),Et&&(Xe.bearing=s.ai(v,D,gt)),Be&&(Xe.pitch=s.ai(w,L,gt)),We&&(Re.interpolatePadding(S,F,gt),q=Re.centerPoint.add($));const xt=gt===1?K:Xe.unproject(Z.add(se.mult(lt(ct))).mult(yt));return Xe.setLocationAtPoint(Xe.renderWorldCopies?xt.wrap():xt,q),Xe._updateCameraOnTerrain(),i.preloadOnly||this._fireMoveEvents(l),Xe};if(i.preloadOnly){const Xe=this._emulate(ht,i.duration,p);return this._preloadTiles(Xe),this}return this._zooming=!0,this._rotating=Et,this._pitching=Be,this._padding=We,this._prepareEase(l,!1),this._ease(ht(p),()=>this._afterEase(l),i),this}isEasing(){return!!this._easeFrameId}stop(){return this._stop()}_requestRenderFrame(i){}_cancelRenderFrame(i){}_stop(i,l){if(this._easeFrameId&&(this._cancelRenderFrame(this._easeFrameId),this._easeFrameId=void 0,this._onEaseFrame=void 0),this._onEaseEnd){const p=this._onEaseEnd;this._onEaseEnd=void 0,p.call(this,l)}if(!i){const p=this.handlers;p&&p.stop(!1)}return this}_ease(i,l,p){p.animate===!1||p.duration===0?(i(1),l()):(this._easeStart=s.q.now(),this._easeOptions=p,this._onEaseFrame=i,this._onEaseEnd=l,this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback))}_renderFrameCallback(){const i=Math.min((s.q.now()-this._easeStart)/this._easeOptions.duration,1),l=this._onEaseFrame;l&&l(this._easeOptions.easing(i)),i<1?this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback):this.stop()}_normalizeBearing(i,l){i=s.bX(i,-180,180);const p=Math.abs(i-l);return Math.abs(i-360-l)<p&&(i-=360),Math.abs(i+360-l)<p&&(i+=360),i}_normalizeCenter(i){const l=this.transform;if(l.maxBounds||l.projection.name!=="globe"&&!l.renderWorldCopies)return;const p=i.lng-l.center.lng;i.lng+=p>180?-360:p<-180?360:0}_prefersReducedMotion(i){return this._respectPrefersReducedMotion&&s.q.prefersReducedMotion&&!(i&&i.essential)}_emulate(i,l,p){const y=Math.ceil(15*l/1e3),v=[],w=i(p.clone());for(let S=0;S<=y;S++){const C=w(S/y);v.push(C.clone())}return v}_preloadTiles(i,l){}}class ym{constructor(i={}){this.options=i,s.aV(["_toggleAttribution","_updateEditLink","_updateData","_updateCompact"],this)}getDefaultPosition(){return"bottom-right"}onAdd(i){const l=this.options&&this.options.compact,p=i._getUIString("AttributionControl.ToggleAttribution");this._map=i,this._container=re("div","mapboxgl-ctrl mapboxgl-ctrl-attrib"),this._compactButton=re("button","mapboxgl-ctrl-attrib-button",this._container),this._compactButton.type="button",this._compactButton.addEventListener("click",this._toggleAttribution),this._compactButton.setAttribute("aria-label",p);const y=re("span","mapboxgl-ctrl-icon",this._compactButton);return y.setAttribute("aria-hidden","true"),y.setAttribute("title",p),this._innerContainer=re("div","mapboxgl-ctrl-attrib-inner",this._container),l&&this._container.classList.add("mapboxgl-compact"),this._updateAttributions(),this._updateEditLink(),this._map.on("styledata",this._updateData),this._map.on("sourcedata",this._updateData),this._map.on("moveend",this._updateEditLink),l===void 0&&(this._map.on("resize",this._updateCompact),this._updateCompact()),this._container}onRemove(){this._container.remove(),this._map.off("styledata",this._updateData),this._map.off("sourcedata",this._updateData),this._map.off("moveend",this._updateEditLink),this._map.off("resize",this._updateCompact),this._map=void 0,this._attribHTML=void 0}_toggleAttribution(){this._container.classList.contains("mapboxgl-compact-show")?(this._container.classList.remove("mapboxgl-compact-show"),this._compactButton.setAttribute("aria-expanded","fal
3241se")):(this._container.classList.add("mapboxgl-compact-show"),this._compactButton.setAttribute("aria-expanded","true"))}_updateEditLink(){let i=this._editLink;i||(i=this._editLink=this._container.querySelector(".mapbox-improve-map"));const l=[{key:"owner",value:this.styleOwner},{key:"id",value:this.styleId},{key:"access_token",value:this._map._requestManager._customAccessToken||s.e.ACCESS_TOKEN}];if(i){const p=l.reduce((y,v,w)=>(v.value&&(y+=`${v.key}=${v.value}${w<l.length-1?"&":""}`),y),"?");i.href=`${s.e.FEEDBACK_URL}/${p}#${dm(this._map,!0)}`,i.rel="noopener nofollow"}}_updateData(i){!i||i.sourceDataType!=="metadata"&&i.sourceDataType!=="visibility"&&i.dataType!=="style"||(this._updateAttributions(),this._updateEditLink())}_updateAttributions(){if(!this._map.style)return;let i=[];if(this._map.style.stylesheet){const y=this._map.style.stylesheet;this.styleOwner=y.owner,this.styleId=y.id}const l=this._map.style._mergedSourceCaches;for(const y in l){const v=l[y];if(v.used){const w=v.getSource();w.attribution&&i.indexOf(w.attribution)<0&&i.push(w.attribution)}}i.sort((y,v)=>y.length-v.length),i=i.filter((y,v)=>{for(let w=v+1;w<i.length;w++)if(i[w].indexOf(y)>=0)return!1;return!0}),this.options.customAttribution&&(Array.isArray(this.options.customAttribution)?i=[...this.options.customAttribution,...i]:i.unshift(this.options.customAttribution));const p=i.join(" | ");p!==this._attribHTML&&(this._attribHTML=p,i.length?(this._innerContainer.innerHTML=p,this._container.classList.remove("mapboxgl-attrib-empty")):this._container.classList.add("mapboxgl-attrib-empty"),this._editLink=null)}_updateCompact(){this._map.getCanvasContainer().offsetWidth<=640?this._container.classList.add("mapboxgl-compact"):this._container.classList.remove("mapboxgl-compact","mapboxgl-compact-show")}}class Nf{constructor(){s.aV(["_updateLogo","_updateCompact"],this)}onAdd(i){this._map=i,this._container=re("div","mapboxgl-ctrl");const l=re("a","mapboxgl-ctrl-logo");return l.target="_blank",l.rel="noopener nofollow",l.href="https://www.mapbox.com/",l.setAttribute("aria-label",this._map._getUIString("LogoControl.Title")),l.setAttribute("rel","noopener nofollow"),this._container.appendChild(l),this._container.style.display="none",this._map.on("sourcedata",this._updateLogo),this._updateLogo(),this._map.on("resize",this._updateCompact),this._updateCompact(),this._container}onRemove(){this._container.remove(),this._map.off("sourcedata",this._updateLogo),this._map.off("resize",this._updateCompact)}getDefaultPosition(){return"bottom-left"}_updateLogo(i){i&&i.sourceDataType!=="metadata"||(this._container.style.display=this._logoRequired()?"block":"none")}_logoRequired(){if(!this._map.style)return!0;const i=this._map.style._sourceCaches;if(Object.entries(i).length===0)return!0;for(const l in i){const p=i[l].getSource();if(p.hasOwnProperty("mapbox_logo")&&!p.mapbox_logo)return!1}return!0}_updateCompact(){const i=this._container.children;if(i.length){const l=i[0];this._map.getCanvasContainer().offsetWidth<250?l.classList.add("mapboxgl-compact"):l.classList.remove("mapboxgl-compact")}}}class Wl{constructor(){this._queue=[],this._id=0,this._cleared=!1,this._currentlyRunning=!1}add(i){const l=++this._id;return this._queue.push({callback:i,id:l,cancelled:!1}),l}remove(i){const l=this._currentlyRunning,p=l?this._queue.concat(l):this._queue;for(const y of p)if(y.id===i)return void(y.cancelled=!0)}run(i=0){const l=this._currentlyRunning=this._queue;this._queue=[];for(const p of l)if(!p.cancelled&&(p.callback(i),this._cleared))break;this._cleared=!1,this._currentlyRunning=!1}clear(){this._currentlyRunning&&(this._cleared=!0),this._queue=[]}}class vm{constructor(i){this.jumpTo(i)}getValue(i){if(i<=this._startTime)return this._start;if(i>=this._endTime)return this._end;const l=s.dk((i-this._startTime)/(this._endTime-this._startTime));return this._start*(1-l)+this._end*l}isEasing(i){return i>=this._startTime&&i<=this._endTime}jumpTo(i){this._startTime=-1/0,this._endTime=-1/0,this._start=i,this._end=i}easeTo(i,l,p){this._start=this.getValue(l),this._end=i,this._startTime=l,this._endTime=l+p}}const cr={"AttributionControl.ToggleAttribution":"Toggle attribution","FullscreenControl.Enter":"Enter fullscreen","FullscreenControl.Exit":"Exit fullscreen","GeolocateControl.FindMyLocation":"Find my location","GeolocateControl.LocationNotAvailable":"Location not available","LogoControl.Title":"Mapbox homepage","Map.Title":"Map","NavigationControl.ResetBearing":"Reset bearing to north","NavigationControl.ZoomIn":"Zoom in","NavigationControl.ZoomOut":"Zoom out","ScrollZoomBlocker.CtrlMessage":"Use ctrl + scroll to zoom the map","ScrollZoomBlocker.CmdMessage":"Use â + scroll to zoom the map","TouchPanBlocker.Message":"Use two fingers to move the map"};class ul extends s.A{constructor(i,l,p,y){const{point:v,lngLat:w,originalEvent:S,target:C}=i;super(i.type,{point:v,lngLat:w,originalEvent:S,target:C}),this.preventDefault=()=>{i.preventDefault()},this.id=l,this.interaction=p,this.feature=y}}class Vf{constructor(i){this.map=i,this.interactionsByType=new Map,this.delegatedInteractions=new Map,this.typeById=new Map,this.filters=new Map,this.handleType=this.handleType.bind(this),this.handleMove=this.handleMove.bind(this),this.handleOut=this.handleOut.bind(this),this.hoveredFeatures=new Map,this.prevHoveredFeatures=new Map}
vendor: 6,466 bytes, line 3241
3241add(i,l){if(this.typeById.has(i))throw new Error(`Interaction id "${i}" already exists.`);const p=l.filter;let y=l.type;p&&this.filters.set(i,s.b3(p)),y==="mouseover"&&(y="mouseenter"),y==="mouseout"&&(y="mouseleave");const v=this.interactionsByType.get(y)||new Map;y==="mouseenter"||y==="mouseleave"?(this.delegatedInteractions.size===0&&(this.map.on("mousemove",this.handleMove),this.map.on("mouseout",this.handleOut)),this.delegatedInteractions.set(i,l)):v.size===0&&this.map.on(y,this.handleType),v.size===0&&this.interactionsByType.set(y,v),v.set(i,l),this.typeById.set(i,y)}get(i){const l=this.typeById.get(i);if(!l)return;const p=this.interactionsByType.get(l);return p?p.get(i):void 0}remove(i){const l=this.typeById.get(i);if(!l)return;this.typeById.delete(i),this.filters.delete(i);const p=this.interactionsByType.get(l);p&&(p.delete(i),l==="mouseenter"||l==="mouseleave"?(this.delegatedInteractions.delete(i),this.delegatedInteractions.size===0&&(this.map.off("mousemove",this.handleMove),this.map.off("mouseout",this.handleOut))):p.size===0&&this.map.off(l,this.handleType))}queryTargets(i,l){const p=[];for(const[y,v]of l)v.target&&p.push({targetId:y,target:v.target,filter:this.filters.get(y)});return this.map.style.queryRenderedTargets(i,p,this.map.transform)}handleMove(i){this.prevHoveredFeatures=this.hoveredFeatures,this.hoveredFeatures=new Map;const l=this.queryTargets(i.point,Array.from(this.delegatedInteractions).reverse());l.length&&(i.type="mouseenter",this.handleType(i,l));const p=new Map;for(const[y,{feature:v}]of this.prevHoveredFeatures)this.hoveredFeatures.has(y)||p.set(v.id,v);p.size&&(i.type="mouseleave",this.handleType(i,Array.from(p.values())))}handleOut(i){const l=Array.from(this.hoveredFeatures.values()).map(({feature:p})=>p);l.length&&(i.type="mouseleave",this.handleType(i,l)),this.hoveredFeatures.clear()}handleType(i,l){const p=Array.from(this.interactionsByType.get(i.type)).reverse(),y=!!l;l=l||this.queryTargets(i.point,p);const v=i.type==="mouseenter";let w=!1;const S=new Set;for(const C of l){for(const[D,L]of p){if(!L.target)continue;const F=C.variants?C.variants[D]:null;if(F){for(const O of F){if(Jr(O,C,S,D))continue;const $=new s.df(C,O),q=Vo(O,C,D);y&&($.state=this.map.getFeatureState($));const W=v?this.prevHoveredFeatures.get(q):null,K=new ul(i,D,L,$),Z=W?W.stop:L.handler(K);if(v&&this.hoveredFeatures.set(q,{feature:C,stop:Z}),Z!==!1){w=!0;break}}if(w)break}}if(w)break}if(!w)for(const[C,D]of p){const{handler:L,target:F}=D;if(!F&&L(new ul(i,C,D,null))!==!1)break}}}function xm(f,i){if(Array.isArray(f)&&Array.isArray(i)){const l=new Set(f),p=new Set(i);return l.size===p.size&&f.every(y=>p.has(y))}return s.bv(f,i)}const x0={center:[0,0],zoom:0,bearing:0,pitch:0,minZoom:-2,maxZoom:22,minPitch:0,maxPitch:85,interactive:!0,scrollZoom:!0,boxZoom:!0,dragRotate:!0,dragPan:!0,keyboard:!0,doubleClickZoom:!0,touchZoomRotate:!0,touchPitch:!0,cooperativeGestures:!1,performanceMetricsCollection:!0,bearingSnap:7,clickTolerance:3,pitchWithRotate:!0,hash:!1,attributionControl:!0,antialias:!1,failIfMajorPerformanceCaveat:!1,preserveDrawingBuffer:!1,trackResize:!0,renderWorldCopies:!0,refreshExpiredTiles:!0,minTileCacheSize:null,maxTileCacheSize:null,localIdeographFontFamily:"sans-serif",localFontFamily:null,transformRequest:null,accessToken:null,fadeDuration:300,respectPrefersReducedMotion:!0,crossSourceCollisions:!0,collectResourceTiming:!1,testMode:!1,precompilePrograms:!0,scaleFactor:1,spriteFormat:"auto"},R1={showCompass:!0,showZoom:!0,visualizePitch:!1};class $f{constructor(i,l,p=!1){this._clickTolerance=10,this.element=l,this.mouseRotate=new mm({clickTolerance:i.dragRotate._mouseRotate._clickTolerance}),this.map=i,p&&(this.mousePitch=new sh({clickTolerance:i.dragRotate._mousePitch._clickTolerance})),s.aV(["mousedown","mousemove","mouseup","touchstart","touchmove","touchend","reset"],this),l.addEventListener("mousedown",this.mousedown),l.addEventListener("touchstart",this.touchstart,{passive:!1}),l.addEventListener("touchmove",this.touchmove),l.addEventListener("touchend",this.touchend),l.addEventListener("touchcancel",this.reset)}down(i,l){this.mouseRotate.mousedown(i,l),this.mousePitch&&this.mousePitch.mousedown(i,l),Ve()}move(i,l){const p=this.map,y=this.mouseRotate.mousemoveWindow(i,l),v=y&&y.bearingDelta;if(v&&p.setBearing(p.getBearing()+v),this.mousePitch){const w=this.mousePitch.mousemoveWindow(i,l),S=w&&w.pitchDelta;S&&p.setPitch(p.getPitch()+S)}}off(){const i=this.element;i.removeEventListener("mousedown",this.mousedown),i.removeEventListener("touchstart",this.touchstart),i.removeEventListener("touchmove",this.touchmove),i.removeEventListener("touchend",this.touchend),i.removeEventListener("touchcancel",this.reset),this.offTemp()}offTemp(){Je(),window.removeEventListener("mousemove",this.mousemove),window.removeEventListener("mouseup",this.mouseup)}mousedown(i){this.down(s.l({},i,{ctrlKey:!0,preventDefault:()=>i.preventDefault()}),Mt(this.element,i)),window.addEventListener("mousemove",this.mousemove),window.addEventListener("mouseup",this.mouseup)}mousemove(i){this.move(i,Mt(this.element,i))}mouseup(i){this.mouseRotate.mouseupWindow(i),this.mousePitch&&this.mousePitch.mouseupWindow(i),this.offTemp()}touchstart(i){i.targetTouches.length!==1?this.reset():(this._startPos=this._lastPos=At(this.element,i.targetTouches)[0],this.down({type:"mousedown",button:0,ctrlKey:!0,preventDefault:()=>i.preventDefault()},this._startPos))}touchmove(i){i.targetTouches.length!==1?this.reset():(this._lastPos=At(this.element,i.targetTouches)[0],this.move({preventDefault:()=>i.preventDefault()},this._lastPos))}touchend(i){i.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 b0(f,i,l){if(f=new s.cd(f.lng,f.lat),i){const p=new s.cd(f.lng-360,f.lat),y=new s.cd(f.lng+360,f.lat),v=360*Math.ceil(Math.abs(f.lng-l.center.lng)/360),w=l.locationPoint3D(f).distSqr(i),S=i.x<0||i.y<0||i.x>l.width||i.y>l.height;l.locationPoint3D(p).distSqr(i)<w&&(S||Math.abs(p.lng-l.center.lng)<v)?f=p:l.locationPoint3D(y).distSqr(i)<w&&(S||Math.abs(y.lng-l.center.lng)<v)&&(f=y)}for(;Math.abs(f.lng-l.center.lng)>180;){const p=l.locationPoint3D(f);if(p.x>=0&&p.y>=0&&p.x<=l.width&&p.y<=l.height)break;f.lng>l.center.lng?f.lng-=360:f.lng+=360}return f}
3241const Kg={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%)"},Va={rotation:0,rotationAlignment:"auto",pitchAlignment:"auto",occludedOpacity:.2,altitude:0};class jf extends s.E{constructor(i,l){super(),(i instanceof HTMLElement||l)&&(i=s.l({element:i},l)),s.aV(["_update","_onMove","_onUp","_addDragHandler","_onMapClick","_onKeyPress","_clearFadeTimer"],this);const{anchor:p="center",color:y="#3FB1CE",scale:v=1,draggable:w=!1,clickTolerance:S=0,rotation:C=Va.rotation,rotationAlignment:D=Va.rotationAlignment,pitchAlignment:L=Va.pitchAlignment,occludedOpacity:F=Va.occludedOpacity,altitude:O=Va.altitude}=i||{};this._anchor=p,this._color=y,this._scale=v,this._draggable=w,this._clickTolerance=S,this._rotation=C,this._rotationAlignment=D,this._pitchAlignment=L,this._occludedOpacity=F,this._altitude=O,this._state="inactive",this._isDragging=!1,this._updateMoving=()=>this._update(!0),i&&i.element?(this._element=i.element,this._offset=s.P.convert(i&&i.offset||[0,0])):(this._defaultMarker=!0,this._element=this._createDefaultMarker(),this._offset=s.P.convert(i&&i.offset||[0,-14])),this._element.hasAttribute("aria-label")||this._element.setAttribute("aria-label","Map marker"),this._element.hasAttribute("role")||this._element.setAttribute("role","img"),this._element.classList.add("mapboxgl-marker"),this._element.addEventListener("dragstart",W=>{W.preventDefault()}),this._element.addEventListener("mousedown",W=>{W.preventDefault()});const $=this._element.classList;for(const W in Kg)$.remove(`mapboxgl-marker-anchor-${W}`);$.add(`mapboxgl-marker-anchor-${this._anchor}`);const q=i&&i.className?i.className.trim().split(/\s+/):[];$.add(...q),this._popup=null}_createDefaultMarker(){const i=re("div"),l=be("svg",{display:"block",height:41*this._scale+"px",width:27*this._scale+"px",viewBox:"0 0 27 41"},i);if(this._altitude===0){const p=be("radialGradient",{id:"shadowGradient"},be("defs",{},l));be("stop",{offset:"10%","stop-opacity":.4},p),be("stop",{offset:"100%","stop-opacity":.05},p),be("ellipse",{cx:13.5,cy:34.8,rx:10.5,ry:5.25,fill:"url(#shadowGradient)"},l)}return be("path",{fill:this._color,d:"M27,13.5C27,19.07 20.25,27 14.75,34.5C14.02,35.5 12.98,35.5 12.25,34.5C6.75,27 0,19.22 0,13.5C0,6.04 6.04,0 13.5,0C20.96,0 27,6.04 27,13.5Z"},l),be("path",{opacity:.25,d:"M13.5,0C6.04,0 0,6.04 0,13.5C0,19.22 6.75,27 12.25,34.5C13,35.52 14.02,35.5 14.75,34.5C20.25,27 27,19.07 27,13.5C27,6.04 20.96,0 13.5,0ZM13.5,1C20.42,1 26,6.58 26,13.5C26,15.9 24.5,19.18 22.22,22.74C19.95,26.3 16.71,30.14 13.94,33.91C13.74,34.18 13.61,34.32 13.5,34.44C13.39,34.32 13.26,34.18 13.06,33.91C10.28,30.13 7.41,26.31 5.02,22.77C2.62,19.23 1,15.95 1,13.5C1,6.58 6.58,1 13.5,1Z"},l),be("circle",{fill:"white",cx:13.5,cy:13.5,r:5.5},l),i}addTo(i){return i===this._map||(this.remove(),this._map=i,i.getCanvasContainer().appendChild(this._element),i.on("move",this._updateMoving),i.on("moveend",this._update),i.on("remove",this._clearFadeTimer),i._addMarker(this),this.setDraggable(this._draggable),this._update(),i.on("click",this._onMapClick)),this}remove(){const i=this._map;return i&&(i.off("click",this._onMapClick),i.off("move",this._updateMoving),i.off("moveend",this._update),i.off("mousedown",this._addDragHandler),i.off("touchstart",this._addDragHandler),i.off("mouseup",this._onUp),i.off("touchend",this._onUp),i.off("mousemove",this._onMove),i.off("touchmove",this._onMove),i.off("remove",this._clearFadeTimer),i._removeMarker(this),this._map=void 0),this._clearFadeTimer(),this._element.remove(),this._popup&&this._popup.remove(),this}getLngLat(){return this._lngLat}setLngLat(i){return this._lngLat=s.cd.convert(i),this._pos=null,this._popup&&this._popup.setLngLat(this._lngLat),this._update(!0),this}setAltitude(i){return i===this._altitude||(this._defaultMarker&&(this._altitude===0&&i!==0||this._altitude!==0&&i===0)&&(this._element=this._createDefaultMarker()),this._altitude=i||Va.altitude,this._update()),this}getAltitude(){return this._altitude}getElement(){return this._element}setPopup(i){if(this._popup&&(this._popup.remove(),this._popup=null,this._element.removeAttribute("role"),this._element.removeEventListener("keypress",this._onKeyPress),this._originalTabIndex||this._element.removeAttribute("tabindex")),i){if(!("offset"in i.options)){const y=Math.sqrt(Math.pow(13.5,2)/2);i.options.offset=this._defaultMarker?{top:[0,0],"top-left":[0,0],"top-right":[0,0],bottom:[
vendor: 8,266 bytes, lines 3241-3246
32410,-38.1],"bottom-left":[y,-1*(38.1-13.5+y)],"bottom-right":[-y,-1*(38.1-13.5+y)],left:[13.5,-1*(38.1-13.5)],right:[-13.5,-1*(38.1-13.5)]}:this._offset}this._popup=i,i._marker=this,i._altitude=this._altitude,this._lngLat&&this._popup.setLngLat(this._lngLat),this._element.setAttribute("role","button"),this._originalTabIndex=this._element.getAttribute("tabindex"),this._originalTabIndex||this._element.setAttribute("tabindex","0"),this._element.addEventListener("keypress",this._onKeyPress),this._element.setAttribute("aria-expanded","false")}return this}_onKeyPress(i){const l=i.code,p=i.charCode||i.keyCode;l!=="Space"&&l!=="Enter"&&p!==32&&p!==13||this.togglePopup()}_onMapClick(i){const l=i.originalEvent.target,p=this._element;this._popup&&(l===p||p.contains(l))&&this.togglePopup()}getPopup(){return this._popup}togglePopup(){const i=this._popup;return i?(i.isOpen()?(i.remove(),this._element.setAttribute("aria-expanded","false")):this._map&&(i.addTo(this._map),this._element.setAttribute("aria-expanded","true")),this):this}_behindTerrain(){const i=this._map,l=this._pos;if(!i||!l)return!1;const p=i.unproject(l,this._altitude),y=i.getFreeCameraOptions();if(!y.position)return!1;const v=y.position.toLngLat();return v.distanceTo(p)<.9*v.distanceTo(this._lngLat)}_evaluateOpacity(){const i=this._map;if(!i)return;const l=this._pos;if(!l||l.x<0||l.x>i.transform.width||l.y<0||l.y>i.transform.height)return void this._clearFadeTimer();const p=i.unproject(l,this._altitude);let y;i._showingGlobe()&&s.eK(i.transform,this._lngLat)?y=0:(y=1-i._queryFogOpacity(p),i.transform._terrainEnabled()&&i.getTerrain()&&this._behindTerrain()&&(y*=this._occludedOpacity)),this._element.style.opacity=`${y}`,this._element.style.pointerEvents=y>0?"auto":"none",this._popup&&this._popup._setOpacity(y),this._fadeTimer=null}_clearFadeTimer(){this._fadeTimer&&(clearTimeout(this._fadeTimer),this._fadeTimer=null)}_updateDOM(){const i=this._pos;if(!i||!this._map)return;const l=this._offset.mult(this._scale);this._element.style.transform=` 3242 translate(${i.x}px,${i.y}px) 3243 ${Kg[this._anchor]} 3244 ${this._calculateXYTransform()} ${this._calculateZTransform()} 3245 translate(${l.x}px,${l.y}px) 3246 `}_calculateXYTransform(){const i=this._pos,l=this._map,p=this.getPitchAlignment();if(!l||!i||p!=="map")return"";if(!l._showingGlobe()){const C=l.getPitch();return C?`rotateX(${C}deg)`:""}const y=s.cJ(s.eL(l.transform,this._lngLat)),v=i.sub(s.eM(l.transform)),w=Math.abs(v.x)+Math.abs(v.y);if(w===0)return"";const S=y/w;return`rotateX(${-v.y*S}deg) rotateY(${v.x*S}deg)`}_calculateZTransform(){const i=this._pos,l=this._map;if(!l||!i)return"";let p=0;const y=this.getRotationAlignment();if(y==="map")if(l._showingGlobe()){const v=l.project(new s.cd(this._lngLat.lng,this._lngLat.lat+.001),this._altitude),w=l.project(new s.cd(this._lngLat.lng,this._lngLat.lat-.001),this._altitude).sub(v);p=s.cJ(Math.atan2(w.y,w.x))-90}else p=-l.getBearing();else if(y==="horizon"){const v=s.af(4,6,l.getZoom()),w=s.eM(l.transform);w.y+=v*l.transform.height;const S=i.sub(w),C=s.cJ(Math.atan2(S.y,S.x));p=(C>90?C-270:C+90)*(1-v)}return p+=this._rotation,p?`rotateZ(${p}deg)`:""}_update(i){cancelAnimationFrame(this._updateFrameId);const l=this._map;l&&(l.transform.renderWorldCopies&&(this._lngLat=b0(this._lngLat,this._pos,l.transform)),this._pos=l.project(this._lngLat,this._altitude),i===!0?this._updateFrameId=requestAnimationFrame(()=>{this._element&&this._pos&&this._anchor&&(this._pos=this._pos.round(),this._updateDOM())}):this._pos=this._pos.round(),l._requestDomTask(()=>{this._map&&(this._element&&this._pos&&this._anchor&&this._updateDOM(),(l._showingGlobe()||l.getTerrain()||l.getFog())&&!this._fadeTimer&&(this._fadeTimer=window.setTimeout(this._evaluateOpacity.bind(this),60)))}))}getOffset(){return this._offset}setOffset(i){return this._offset=s.P.convert(i),this._update(),this}addClassName(i){return this._element.classList.add(i),this}removeClassName(i){return this._element.classList.remove(i),this}toggleClassName(i){return this._element.classList.toggle(i)}_onMove(i){const l=this._map;if(!l)return;const p=this._pointerdownPos,y=this._positionDelta;if(p&&y){if(!this._isDragging){const v=this._clickTolerance||l._clickTolerance;if(i.point.dist(p)<v)return;this._isDragging=!0}this._pos=i.point.sub(y),this._lngLat=l.unproject(this._pos,this._altitude),this.setLngLat(this._lngLat),this._element.style.pointerEvents="none",this._state==="pending"&&(this._state="active",this.fire(new s.A("dragstart"))),this.fire(new s.A("drag"))}}_onUp(){this._element.style.pointerEvents="auto",this._positionDelta=null,this._pointerdownPos=null,this._isDragging=!1;const i=this._map;i&&(i.off("mousemove",this._onMove),i.off("touchmove",this._onMove)),this._state==="active"&&this.fire(new s.A("dragend")),this._state="inactive"}_addDragHandler(i){const l=this._map,p=this._pos;l&&p&&this._element.contains(i.originalEvent.target)&&(i.preventDefault(),this._positionDelta=i.point.sub(p),this._pointerdownPos=i.point,this._state="pending",l.on("mousemove",this._onMove),l.on("touchmove",this._onMove),l.once("mouseup",this._onUp),l.once("touchend",this._onUp))}setDraggable(i){this._draggable=!!i;const l=this._map;return l&&(i?(l.on("mousedown",this._addDragHandler),l.on("touchstart",this._addDragHandler)):(l.off("mousedown",this._addDragHandler),l.off("touchstart",this._addDragHandler))),this}isDraggable(){return this._draggable}setRotation(i){return this._rotation=i||Va.rotation,this._update(),this}getRotation(){return this._rotation}setRotationAlignment(i){return this._rotationAlignment=i||Va.rotationAlignment,this._update(),this}getRotationAlignment(){return this._rotationAlignment==="auto"||this._rotationAlignment==="horizon"&&this._map&&!this._map._showingGlobe()?"viewport":this._rotationAlignment}setPitchAlignment(i){return this._pitchAlignment=i||Va.pitchAlignment,this._update(),this}getPitchAlignment(){return this._pitchAlignment==="auto"?this.getRotationAlignment():this._pitchAlignment}setOccludedOpacity(i){return this._occludedOpacity=i||Va.occludedOpacity,this._update(),this}getOccludedOpacity(){return this._occludedOpacity}}const Uf={positionOptions:{enableHighAccuracy:!1,maximumAge:0,timeout:6e3},fitBoundsOptions:{maxZoom:15},trackUserLocation:!1,showAccuracyCircle:!0,showUserLocation:!0,showUserHeading:!1},yd={maxWidth:100,unit:"metric"},Cc={kilometer:"km",meter:"m",mile:"mi",foot:"ft","nautical-mile":"nm"},hl={closeButton:!0,closeOnClick:!0,focusAfterOpen:!0,className:"",maxWidth:"240px",altitude:0},dl=["a[href]","[tabindex]:not([tabindex='-1'])","[contenteditable]:not([contenteditable='false'])","button:not([disabled])","input:not([disabled])","select:not([disabled])","textarea:not([disabled])"].join(", ");function cu(f=new s.P(0,0),i="bottom"){if(typeof f=="number"){const l=Math.round(Math.sqrt(.5*Math.pow(f,2)));switch(i){case"top":return new s.P(0,f);case"top-left":return new s.P(l,l);case"top-right":return new s.P(-l,l);case"bottom":return new s.P(0,-f);case"bottom-left":return new s.P(l,-l);case"bottom-right":return new s.P(-l,-l);case"left":return new s.P(f,0);case"right":return new s.P(-f,0)}return new s.P(0,0)}return f instanceof s.P||Array.isArray(f)?s.P.convert(f):s.P.convert(f[i]||[0,0])}return{version:A,supported:me.supported,setRTLTextPlugin:s.eN,getRTLTextPluginStatus:s.eO,Map:class extends v0{constructor(f){R.mark(P.create);const i=f;if((f=s.l({},x0,f)).minZoom!=null&&f.maxZoom!=null&&f.minZoom>f.maxZoom)throw new Error("maxZoom must be greater than or equal to minZoom");if(f.minPitch!=null&&f.maxPitch!=null&&f.minPitch>f.maxPitch)throw new Error("maxPitch must be greater than or equal to minPitch");if(f.minPitch!=null&&f.minPitch<0)throw new Error("minPitch must be greater than or equal to 0");if(f.maxPitch!=null&&f.maxPitch>85)throw new Error("maxPitch must be less than or equal to 85");if(f.antialias&&s.eI(window)&&(f.antialias=!1,s.w("Antialiasing is disabled for this WebGL context to avoid browser bug: https://github.com/mapbox/mapbox-gl-js/issues/11609")),super(new Bl(f.minZoom,f.maxZoom,f.minPitch,f.maxPitch,f.renderWorldCopies,null,null),f),this._repaint=!!f.repaint,this._interactive=f.interactive,this._minTileCacheSize=f.minTileCacheSize,this._maxTileC
3246acheSize=f.maxTileCacheSize,this._failIfMajorPerformanceCaveat=f.failIfMajorPerformanceCaveat,this._preserveDrawingBuffer=f.preserveDrawingBuffer,this._antialias=f.antialias,this._trackResize=f.trackResize,this._bearingSnap=f.bearingSnap,this._refreshExpiredTiles=f.refreshExpiredTiles,this._fadeDuration=f.fadeDuration,this._isInitialLoad=!0,this._crossSourceCollisions=f.crossSourceCollisions,this._collectResourceTiming=f.collectResourceTiming,this._language=this._parseLanguage(f.language),this._worldview=f.worldview,this._renderTaskQueue=new Wl,this._domRenderTaskQueue=new Wl,this._controls=[],this._markers=[],this._popups=[],this._mapId=s.a$(),this._locale=s.l({},cr,f.locale),this._clickTolerance=f.clickTolerance,this._cooperativeGestures=f.cooperativeGestures,this._performanceMetricsCollection=f.performanceMetricsCollection,this._tessellationStep=f.tessellationStep,this._containerWidth=0,this._containerHeight=0,this._showParseStatus=!0,this._precompilePrograms=f.precompilePrograms,this._scaleFactorChanged=!1,this._averageElevationLastSampledAt=-1/0,this._averageElevationExaggeration=0,this._averageElevation=new vm(0),this._interactionRange=[1/0,-1/0],this._visibilityHidden=0,this._useExplicitProjection=!1,this._frameId=0,this._scaleFactor=f.scaleFactor,this._requestManager=new Fi(f.transformRequest,f.accessToken,f.testMode),this._silenceAuthErrors=!!f.testMode,this._contextCreateOptions=f.contextCreateOptions?Object.assign({},f.contextCreateOptions):{},typeof f.container=="string"){const l=document.getElementById(f.container);if(!l)throw new Error(`Container '${f.container.toString()}' not found.`);this._container=l}else{if(!(f.container instanceof HTMLElement))throw new Error("Invalid type: 'container' must be a String or HTMLElement.");this._container=f.container}if(this._container.childNodes.length>0&&s.w("The map container element should be empty, otherwise the map's interactivity will be negatively impacted. If you want to display a message when WebGL is not supported, use the Mapbox GL Supported plugin instead."),f.maxBounds&&this.setMaxBounds(f.maxBounds),this._spriteFormat=f.spriteFormat,s.aV(["_onWindowOnline","_onWindowResize","_onVisibilityChange","_onMapScroll","_contextLost","_contextRestored"],this),this._setupContainer(),this._tp||(this._tp=new zg),this._tp.registerParameter(this,["Debug"],"showOverdrawInspector"),this._tp.registerParameter(this,["Debug"],"showTileBoundaries"),this._tp.registerParameter(this,["Debug"],"showParseStatus"),this._tp.registerParameter(this,["Debug"],"repaint"),this._tp.registerParameter(this,["Debug"],"showTileAABBs"),this._tp.registerParameter(this,["Debug"],"showPadding"),this._tp.registerParameter(this,["Debug"],"showCollisionBoxes",{noSave:!0}),this._tp.registerParameter(this.transform,["Debug"],"freezeTileCoverage",{noSave:!0},()=>{this._update()}),this._tp.registerParameter(this,["Debug","Wireframe"],"showTerrainWireframe"),this._tp.registerParameter(this,["Debug","Wireframe"],"showLayers2DWireframe"),this._tp.registerParameter(this,["Debug","Wireframe"],"showLayers3DWireframe"),this._tp.registerParameter(this,["Scaling"],"_scaleFactor",{min:.1,max:10,step:.1},()=>{this.setScaleFactor(this._scaleFactor)}),this._setupPainter(),this.painter===void 0)throw new Error("Failed to initialize WebGL.");if(this.on("move",()=>this._update(!1)),this.on("moveend",()=>this._update(!1)),this.on("zoom",()=>this._update(!0)),this._fullscreenchangeEvent="onfullscreenchange"in document?"fullscreenchange":"webkitfullscreenchange",window.addEventListener("online",this._onWindowOnline,!1),window.addEventListener("resize",this._onWindowResize,!1),window.addEventListener("orientationchange",this._onWindowResize,!1),window.addEventListener(this._fullscreenchangeEvent,this._onWindowResize,!1),window.addEventListener("visibilitychange",this._onVisibilityChange,!1),this.handlers=new L1(this,f),this._localFontFamily=f.localFontFamily,this._localIdeographFontFamily=f.localIdeographFontFamily,(f.style||!f.testMode)&&this.setStyle(f.style||s.e.DEFAULT_STYLE,{config:f.config,localFontFamily:this._localFontFamily,localIdeographFontFamily:this._localIdeographFontFamily}),f.projection&&this.setProjection(f.projection),this.indoor=new Hp(this),f.hash&&(this._hash=new dd(typeof f.hash=="string"&&f.hash||void 0).addTo(this)),!this._hash||!this._hash._onHashChange()){i.center==null&&i.zoom==null||(this.transform._unmodified=!1),this.jumpTo({center:f.center,zoom:f.zoom,bearing:f.bearing,pitch:f.pitch});
vendor: 9,221 bytes, line 3246
3246const l=f.bounds;l&&(this.resize(),this.fitBounds(l,s.l({},f.fitBoundsOptions,{duration:0})))}this.resize(),f.attributionControl&&this.addControl(new ym({customAttribution:f.customAttribution})),this._logoControl=new Nf,this.addControl(this._logoControl,f.logoPosition),this.on("style.load",()=>{this.transform.unmodified&&this.jumpTo(this.style.stylesheet),this._postStyleLoadEvent()}),this.on("data",l=>{this._update(l.dataType==="style"),this.fire(new s.A(`${l.dataType}data`,l))}),this.on("dataloading",l=>{this.fire(new s.A(`${l.dataType}dataloading`,l))}),this._interactions=new Vf(this)}_getMapId(){return this._mapId}addControl(f,i){if(i===void 0&&(i=f.getDefaultPosition?f.getDefaultPosition():"top-right"),!f||!f.onAdd)return this.fire(new s.z(new Error("Invalid argument to map.addControl(). Argument must be a control with onAdd and onRemove methods.")));const l=f.onAdd(this);this._controls.push(f);const p=this._controlPositions[i];return i.indexOf("bottom")!==-1?p.insertBefore(l,p.firstChild):p.appendChild(l),this}removeControl(f){if(!f||!f.onRemove)return this.fire(new s.z(new Error("Invalid argument to map.removeControl(). Argument must be a control with onAdd and onRemove methods.")));const i=this._controls.indexOf(f);return i>-1&&this._controls.splice(i,1),f.onRemove(this),this}hasControl(f){return this._controls.indexOf(f)>-1}getContainer(){return this._container}getCanvasContainer(){return this._canvasContainer}getCanvas(){return this._canvas}resize(f){if(this._updateContainerDimensions(),this._containerWidth===this.transform.width&&this._containerHeight===this.transform.height)return this;this._resizeCanvas(this._containerWidth,this._containerHeight),this.transform.resize(this._containerWidth,this._containerHeight),this.painter.resize(Math.ceil(this._containerWidth),Math.ceil(this._containerHeight));const i=!this._moving;return i&&this.fire(new s.A("movestart",f)).fire(new s.A("move",f)),this.fire(new s.A("resize",f)),i&&this.fire(new s.A("moveend",f)),this}getBounds(){return this.transform.getBounds()}getMaxBounds(){return this.transform.getMaxBounds()||null}setMaxBounds(f){return this.transform.setMaxBounds(s.aG.convert(f)),this._update()}setMinZoom(f){if((f=f??-2)>=-2&&f<=this.transform.maxZoom)return this.transform.minZoom=f,this._update(),this.getZoom()<f?this.setZoom(f):this.fire(new s.A("zoomstart")).fire(new s.A("zoom")).fire(new s.A("zoomend")),this;throw new Error("minZoom must be between -2 and the current maxZoom, inclusive")}getMinZoom(){return this.transform.minZoom}setMaxZoom(f){if((f=f??22)>=this.transform.minZoom)return this.transform.maxZoom=f,this._update(),this.getZoom()>f?this.setZoom(f):this.fire(new s.A("zoomstart")).fire(new s.A("zoom")).fire(new s.A("zoomend")),this;throw new Error("maxZoom must be greater than the current minZoom")}getMaxZoom(){return this.transform.maxZoom}setMinPitch(f){if((f=f??0)<0)throw new Error("minPitch must be greater than or equal to 0");if(f>=0&&f<=this.transform.maxPitch)return this.transform.minPitch=f,this._update(),this.getPitch()<f?this.setPitch(f):this.fire(new s.A("pitchstart")).fire(new s.A("pitch")).fire(new s.A("pitchend")),this;throw new Error("minPitch must be between 0 and the current maxPitch, inclusive")}getMinPitch(){return this.transform.minPitch}setMaxPitch(f){if((f=f??85)>85)throw new Error("maxPitch must be less than or equal to 85");if(f>=this.transform.minPitch)return this.transform.maxPitch=f,this._update(),this.getPitch()>f?this.setPitch(f):this.fire(new s.A("pitchstart")).fire(new s.A("pitch")).fire(new s.A("pitchend")),this;throw new Error("maxPitch must be greater than or equal to minPitch")}getMaxPitch(){return this.transform.maxPitch}getScaleFactor(){return this._scaleFactor}setScaleFactor(f){return this._scaleFactor=f,this.painter.scaleFactor=f,this._tp.refreshUI(),this._scaleFactorChanged=!0,this.style._updateFilteredLayers(i=>i.type==="symbol"),this._update(!0),this}getRenderWorldCopies(){return this.transform.renderWorldCopies}setRenderWorldCopies(f){return this.transform.renderWorldCopies=f,this.transform.renderWorldCopies||this._forceMarkerAndPopupUpdate(!0),this._update()}getLanguage(){return this._language}_parseLanguage(f){return f==="auto"?navigator.language:Array.isArray(f)?f.length===0?void 0:f.map(i=>i==="auto"?navigator.language:i):f}setLanguage(f){const i=this._parseLanguage(f);if(!this.style||i===this._language)return this;this._language=i,this.style.reloadSources();for(const l of this._controls)l._setLanguage&&l._setLanguage(this._language);return this}getWorldview(){return this._worldview}setWorldview(f){return this.style&&f!==this._worldview?(this._worldview=f,this.style.reloadSources(),this):this}getProjection(){return this.transform.mercatorFromTransition?{name:"globe",center:[0,0]}:this.transform.getProjection()}_showingGlobe(){return this.transform.projection.name==="globe"}setProjection(f){return this._lazyInitEmptyStyle(),f?typeof f=="string"&&(f={name:f}):f=null,this._useExplicitProjection=!!f,this._prioritizeAndUpdateProjection(f,this.style.projection)}_updateProjectionTransition(){if(this.getProjection().name!=="globe")return;const f=this.transform,i=f.projection.name;let l;i==="globe"&&f.zoom>=s.cx?(f.setMercatorFromTransition(),l=!0):i==="mercator"&&f.zoom<s.cx&&(f.setProjection({name:"globe"}),l=!0),l&&(this.style.applyProjectionUpdate(),this.style._forceSymbolLayerUpdate())}_prioritizeAndUpdateProjection(f,i){return this._updateProjection(f||i||{name:"mercator"})}_updateProjection(f){let i;return i=f.name==="globe"&&this.transform.zoom>=s.cx?this.transform.setMercatorFromTransition():this.transform.setProjection(f),this.style.applyProjectionUpdate(),i&&(this.painter.clearBackgroundTiles(),this.style.clearSources(),this._update(!0),this._forceMarkerAndPopupUpdate(!0)),this}project(f,i){return this.transform.locationPoint3D(s.cd.convert(f),i)}unproject(f,i){return this.transform.pointLocation3D(s.P.convert(f),i)}isMoving(){return this._moving||this.handlers&&this.handlers.isMoving()||!1}isZooming(){return this._zooming||this.handlers&&this.handlers.isZooming()||!1}isRotating(){return this._rotating||this.handlers&&this.handlers.isRotating()||!1}_isDragging(){return this.handlers&&this.handlers._isDragging()||!1}_createDelegatedListener(f,i,l){const p=y=>{let v=[];if(Array.isArray(i)){const w=i.filter(S=>this.getLayer(S));v=w.length?this.queryRenderedFeatures(y,{layers:w}):[]}else v=this.queryRenderedFeatures(y,{target:i});return v};if(f==="mouseenter"||f==="mouseover"){let y=!1;return{listener:l,targets:i,delegates:{mousemove:w=>{const S=p(w.point);S.length?y||(y=!0,l.call(this,new qo(f,this,w.originalEvent,{features:S}))):y=!1},mouseout:()=>{y=!1}}}}if(f==="mouseleave"||f==="mouseout"){let y=!1;return{listener:l,targets:i,delegates:{mousemove:S=>{p(S.point).length?y=!0:y&&(y=!1,l.call(this,new qo(f,this,S.originalEvent)))},mouseout:S=>{y&&(y=!1,l.call(this,new qo(f,this,S.originalEvent)))}}}}{const y=v=>{const w=p(v.point);w.length&&(v.features=w,l.call(this,v),delete v.features)};return{listener:l,targets:i,delegates:{[f]:y}}}}on(f,i,l){if(typeof i=="function"||l===void 0)return super.on(f,i);if(typeof i=="string"&&(i=[i]),!this._areTargetsValid(i))return this;const p=this._createDelegatedListener(f,i,l);this._delegatedListeners=this._delegatedListeners||{},this._delegatedListeners[f]=this._delegatedListeners[f]||[],this._delegatedListeners[f].push(p);for(const y in p.delegates)this.on(y,p.delegates[y]);return this}once(f,i,l){if(typeof i=="function"||l===void 0)return super.once(f,i);if(typeof i=="string"&&(i=[i]),!this._areTargetsValid(i))return this;const p=this._createDelegatedListener(f,i,l);for(const y in p.delegates)this.once(y,p.delegates[y]);return this}off(f,i,l){if(typeof i=="function"||l===void 0)return super.off(f,i);if(typeof i=="string"&&(i=[i]),!this._areTargetsValid(i))return this;const p=this._delegatedListeners?this._delegatedListeners[f]:void 0;return p&&(y=>{for(let v=0;v<y.length;v++){const w=y[v];if(w.listener===l&&xm(w.targets,i)){for(const S in w.delegates)this.off(S,w.delegates[S]);return y.splice(v,1),this}}})(p),this}queryRenderedFeatures(f,i){if(!this.style)return[];if(f===void 0||f instanceof s.P||Array.isArray(f)||i!==void 0||(i=f,f=void 0),f=f||[[0,0],[this.transform.width,this.transform.height]],!i){const v=this.style.queryRenderedFeatures(f,void 0,this.transform),w=this.style.queryRenderedFeatureset(f,void 0,this.transform);return v.concat(w)}let l=!0;if(i.target&&(l=this._isTargetValid(i.target),l&&!i.layers))return this.style.queryRenderedFeatureset(f,i,this.transform);let p=!0;if(i.layers&&Array.isArray(i.layers)){for(const v of i.layers)if(!this._isValidId(v)){p=!1;break}if(p&&!i.target)return this.style.queryRenderedFeatures(f,i,this.transform)}let y=[];return p&&(y=y.concat(this.style.queryRenderedFeatures(f,i,this.transform))),l&&(y=y.concat(this.style.queryRenderedFeatureset(f,i,this.transform))),y}querySourceFeatures(f,i){return!f||typeof f=="string"&&!this._isValidId(f)?[]:this.style.querySourceFeatures(f,i)}isPointOnSurface(f){const{name:i}=this.transform.projection;return i!=="globe"&&i!=="mercator"&&s.w(`${i} projection does not support isPointOnSurface, this API may behave unex
3246pectedly.`),this.transform.isPointOnSurface(s.P.convert(f))}addInteraction(f,i){return this._interactions.add(f,i),this}removeInteraction(f){return this._interactions.remove(f),this}getCooperativeGestures(){return this._cooperativeGestures}setCooperativeGestures(f){return this._cooperativeGestures=f,this}setStyle(f,i){return i=s.l({},{localIdeographFontFamily:this._localIdeographFontFamily,localFontFamily:this._localFontFamily},i),this.style&&f&&i.diff!==!1&&i.localFontFamily===this._localFontFamily&&i.localIdeographFontFamily===this._localIdeographFontFamily&&!i.config?(this.style._diffStyle(f,(l,p)=>{if(l){const y=typeof l=="string"?l:l instanceof Error?l.message:l.error;s.w(`Unable to perform style diff: ${y}. Rebuilding the style from scratch.`),this._updateStyle(f,i)}else p&&this._update(!0)},()=>this._postStyleLoadEvent()),this):(this._localIdeographFontFamily=i.localIdeographFontFamily,this._localFontFamily=i.localFontFamily,this._updateStyle(f,i))}_getUIString(f){const i=this._locale[f];if(i==null)throw new Error(`Missing UI string '${f}'`);return i}_updateStyle(f,i){if(this.style&&(this.style.setEventedParent(null),this.style._remove(),this.style=void 0),f){const l=s.l({},i);i&&i.config&&(l.initialConfig=i.config,delete l.config),this.style=new ea(this,l).load(f),this.style.setEventedParent(this,{style:this.style})}return this._updateTerrain(),this}_lazyInitEmptyStyle(){this.style||(this.style=new ea(this,{}),this.style.setEventedParent(this,{style:this.style}),this.style.loadEmpty())}getStyle(){if(this.style)return this.style.serialize()}isStyleLoaded(){return this.style?this.style.loaded():(s.w("There is no style added to the map."),!1)}_isValidId(f){return f==null?(this.fire(new s.z(new Error("IDs can't be empty."))),!1):!s.d9(f)||(this.fire(new s.z(new Error(`IDs can't contain special symbols: "${f}".`))),!1)}_isTargetValid(f){return"featuresetId"in f?this._isValidId("importId"in f?f.importId:f.featuresetId):"layerId"in f&&this._isValidId(f.layerId)}_areTargetsValid(f){if(Array.isArray(f)){for(const i of f)if(!this._isValidId(i))return!1;return!0}return this._isTargetValid(f)}addSource(f,i){return this._isValidId(f)?(this._lazyInitEmptyStyle(),this.style.addSource(f,i),this._update(!0)):this}isSourceLoaded(f){return!!this._isValidId(f)&&!!this.style&&this.style._isSourceCacheLoaded(f)}areTilesLoaded(){return this.style.areTilesLoaded()}addSourceType(f,i,l){this._lazyInitEmptyStyle(),this.style.addSourceType(f,i,l)}removeSource(f){return this._isValidId(f)?(this.style.removeSource(f),this._updateTerrain(),this._update(!0)):this}getSource(f){return this._isValidId(f)?this.style.getOwnSource(f):null}addImage(f,i,{pixelRatio:l=1,sdf:p=!1,stretchX:y,stretchY:v,content:w}={}){this._lazyInitEmptyStyle();const S=s.I.from(f);if(i instanceof HTMLImageElement||ImageBitmap&&i instanceof ImageBitmap){const{width:C,height:D,data:L}=s.q.getImageData(i);this.style.addImage(S,{data:new s.r({width:C,height:D},L),pixelRatio:l,stretchX:y,stretchY:v,content:w,sdf:p,version:0,usvg:!1})}else if(i.width===void 0||i.height===void 0)this.fire(new s.z(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`")));else{const{width:C,height:D}=i,L=i;this.style.addImage(S,{data:new s.r({width:C,height:D},new Uint8Array(L.data)),pixelRatio:l,stretchX:y,stretchY:v,content:w,sdf:p,usvg:!1,version:0,userImage:L}),L.onAdd&&L.onAdd(this,f)}}updateImage(f,i){this._lazyInitEmptyStyle();const l=s.I.from(f),p=this.style.getImage(l);if(!p)return void this.fire(new s.z(new Error("The map has no image with that id. If you are adding a new image use `map.addImage(...)` instead.")));const y=i instanceof HTMLImageElement||ImageBitmap&&i instanceof ImageBitmap?s.q.getImageData(i):i,{width:v,height:w,data:S}=y;if(v===void 0||w===void 0)return void this.fire(new s.z(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(v!==(p.usvg?p.icon.usvg_tree.width:p.data.width)||w!==(p.usvg?p.icon.usvg_tree.height:p.data.height))return void this.fire(new s.z(new Error(`The width and height of the updated image (${v}, ${w}) 3247 must be that same as the previous version of the image 3248 (${p.data.width}, ${p.data.height})`)));const C=!(i instanceof HTMLImageElement||ImageBitmap&&i instanceof ImageBitmap);let D=!1;p.usvg?(p.data=new s.r({width:v,height:w},new Uint8Array(S)),p.usvg=!1,p.icon=void 0,D=!0):p.data.replace(S,C),this.style.updateImage(l,p,D)}hasImage(f){return f?!!this.style&&!!this.style.getImage(s.I.from(f)):(this.fire(new s.z(new Error("Missing required image id"))),!1)}removeImage(f){this.style.removeImage(s.I.from(f))}loadImage(f,i){s.o(this._requestManager.transformRequest(f,s.R.Image),(l,p)=>{i(l,p instanceof HTMLImageElement?s.q.getImageData(p):p)})}listImages(){return this.style.listImages().map(f=>f.name)}addModel(f,i){this._lazyInitEmptyStyle(),this.style.addModel(f,i)}hasModel(f){return f?this.style.hasModel(f):(this.fire(new s.z(new Error("Missing required model id"))),!1)}removeModel(f){this.style.removeModel(f)}listModels(){return this.style.listModels()}addLayer(f,i){return this._isValidId(f.id)?(this._lazyInitEmptyStyle(),this.style.addLayer(f,i),this._update(!0)):this}getSlot(f){const i=this.getLayer(f);return i&&i.slot||null}setSlot(f,i){return this.style.setSlot(f,i),this.style.mergeLayers(),this._update(!0)}
vendor: 5,201 bytes, line 3248
3248addImport(f,i){return this.style.addImport(f,i).catch(l=>this.fire(new s.z(new Error("Failed to add import",l)))),this}updateImport(f,i){return typeof i!="string"&&i.id!==f?(this.removeImport(f),this.addImport(i)):(this.style.updateImport(f,i),this._update(!0))}removeImport(f){return this.style.removeImport(f),this}moveImport(f,i){return this.style.moveImport(f,i),this._update(!0)}moveLayer(f,i){return this._isValidId(f)?(this.style.moveLayer(f,i),this._update(!0)):this}removeLayer(f){return this._isValidId(f)?(this.style.removeLayer(f),this._update(!0)):this}getLayer(f){if(!this._isValidId(f))return null;const i=this.style.getOwnLayer(f);return i?i.type==="custom"?i.implementation:i.serialize():void 0}getSlots(){return this.style.getSlots()}setLayerZoomRange(f,i,l){return this._isValidId(f)?(this.style.setLayerZoomRange(f,i,l),this._update(!0)):this}setFilter(f,i,l={}){return this._isValidId(f)?(this.style.setFilter(f,i,l),this._update(!0)):this}getFilter(f){return this._isValidId(f)?this.style.getFilter(f):null}setPaintProperty(f,i,l,p={}){return this._isValidId(f)?(this.style.setPaintProperty(f,i,l,p),this._update(!0)):this}getPaintProperty(f,i){return this._isValidId(f)?this.style.getPaintProperty(f,i):null}setLayoutProperty(f,i,l,p={}){return this._isValidId(f)?(this.style.setLayoutProperty(f,i,l,p),this._update(!0)):this}getLayoutProperty(f,i){return this._isValidId(f)?this.style.getLayoutProperty(f,i):null}getGlyphsUrl(){return this.style.getGlyphsUrl()}setGlyphsUrl(f){return this.style.setGlyphsUrl(f),this._update(!0)}getSchema(f){return this.style.getSchema(f)}setSchema(f,i){return this.style.setSchema(f,i),this._update(!0)}getConfig(f){return this.style.getConfig(f)}setConfig(f,i){return this.style.setConfig(f,i),this._update(!0)}getConfigProperty(f,i){return this.style.getConfigProperty(f,i)}setConfigProperty(f,i,l){return this.style.setConfigProperty(f,i,l),this._update(!0)}getFeaturesetDescriptors(f){return this.style.getFeaturesetDescriptors(f)}setLights(f){if(this._lazyInitEmptyStyle(),f&&f.length===1&&f[0].type==="flat"){const i=f[0];i.properties?this.style.setFlatLight(i.properties,i.id,{}):this.style.setFlatLight({},"flat")}else this.style.setLights(f),this.painter.terrain&&(this.painter.terrain.invalidateRenderCache=!0);return this._update(!0)}getLights(){const f=this.style.getLights()||[];return f.length===0&&f.push({id:this.style.light.id,type:"flat",properties:this.style.getFlatLight()}),f}setLight(f,i={}){return console.log("The `map.setLight` function is deprecated, prefer using `map.setLights` with `flat` light type instead."),this.setLights([{id:"flat",type:"flat",properties:f}])}getLight(){return console.log("The `map.getLight` function is deprecated, prefer using `map.getLights` instead."),this.style.getFlatLight()}setTerrain(f){return this._lazyInitEmptyStyle(),!f&&this.transform.projection.requiresDraping?this.style.setTerrainForDraping():this.style.setTerrain(f),this._averageElevationLastSampledAt=-1/0,this._update(!0)}getTerrain(){return this.style?this.style.getTerrain():null}setFog(f){return this._lazyInitEmptyStyle(),this.style.setFog(f),this._update(!0)}getFog(){return this.style?this.style.getFog():null}setSnow(f){return this._lazyInitEmptyStyle(),this.style.setSnow(f),this._update(!0)}getSnow(){return this.style?this.style.getSnow():null}setRain(f){return this._lazyInitEmptyStyle(),this.style.setRain(f),this._update(!0)}getRain(){return this.style?this.style.getRain():null}setColorTheme(f){return this._lazyInitEmptyStyle(),this.style.setColorTheme(f),this._update(!0)}setImportColorTheme(f,i){return this._lazyInitEmptyStyle(),this.style.setImportColorTheme(f,i),this._update(!0)}setCamera(f){return this.style.setCamera(f),this._triggerCameraUpdate(f)}_triggerCameraUpdate(f){return this._update(this.transform.setOrthographicProjectionAtLowPitch(f["camera-projection"]==="orthographic"))}getCamera(){return this.style.camera}_queryFogOpacity(f){return this.style&&this.style.fog?this.style.fog.getOpacityAtLatLng(s.cd.convert(f),this.transform):0}setFeatureState(f,i){return f.source&&!this._isValidId(f.source)?this:(this.style.setFeatureState(f,i),this._update())}removeFeatureState(f,i){return f.source&&!this._isValidId(f.source)?this:(this.style.removeFeatureState(f,i),this._update())}getFeatureState(f){return f.source&&!this._isValidId(f.source)?null:this.style.getFeatureState(f)}_updateContainerDimensions(){if(!this._container)return;const f=this._container.getBoundingClientRect().width||400,i=this._container.getBoundingClientRect().height||300;let l,p,y,v=this._container;for(;v&&(!p||!y);){const w=window.getComputedStyle(v).transform;w&&w!=="none"&&(l=w.match(/matrix.*\((.+)\)/)[1].split(", "),l[0]&&l[0]!=="0"&&l[0]!=="1"&&(p=l[0]),l[3]&&l[3]!=="0"&&l[3]!=="1"&&(y=l[3])),v=v.parentElement}this._containerWidth=p?Math.abs(f/p):f,this._containerHeight=y?Math.abs(i/y):i}_detectMissingCSS(){window.getComputedStyle(this._missingCSSCanary).getPropertyValue("background-color")!=="rgb(250, 128, 114)"&&s.w("This page appears to be missing CSS declarations for Mapbox GL JS, which may cause the map to display incorrectly. Please ensure your page includes mapbox-gl.css, as described
3248in https://www.mapbox.com/mapbox-gl-js/api/.")}_setupContainer(){const f=this._container;f.classList.add("mapboxgl-map"),(this._missingCSSCanary=re("div","mapboxgl-canary",f)).style.visibility="hidden",this._detectMissingCSS();const i=this._canvasContainer=re("div","mapboxgl-canvas-container",f);this._canvas=re("canvas","mapboxgl-canvas",i),this._interactive&&(i.classList.add("mapboxgl-interactive"),this._canvas.setAttribute("tabindex","0")),this._canvas.addEventListener("webglcontextlost",this._contextLost,!1),this._canvas.addEventListener("webglcontextrestored",this._contextRestored,!1),this._canvas.setAttribute("aria-label",this._getUIString("Map.Title")),this._canvas.setAttribute("role","region"),this._updateContainerDimensions(),this._resizeCanvas(this._containerWidth,this._containerHeight);const l=this._controlContainer=re("div","mapboxgl-control-container",f),p=this._controlPositions={};["top-left","top","top-right","right","bottom-right","bottom","bottom-left","left"].forEach(y=>{p[y]=re("div",`mapboxgl-ctrl-${y}`,l)}),this._container.addEventListener("scroll",this._onMapScroll,!1)}_resizeCanvas(f,i){const l=s.q.devicePixelRatio||1;this._canvas.width=l*Math.ceil(f),this._canvas.height=l*Math.ceil(i),this._canvas.style.width=`${f}px`,this._canvas.style.height=`${i}px`}_addMarker(f){this._markers.push(f)}_removeMarker(f){const i=this._markers.indexOf(f);i!==-1&&this._markers.splice(i,1)}_addPopup(f){this._popups.push(f)}_removePopup(f){const i=this._popups.indexOf(f);i!==-1&&this._popups.splice(i,1)}_setupPainter(){const f=s.l({},me.supported.webGLContextAttributes,{failIfMajorPerformanceCaveat:this._failIfMajorPerformanceCaveat,preserveDrawingBuffer:this._preserveDrawingBuffer,antialias:this._antialias||!1}),i=this._canvas.getContext("webgl2",f);i?(Fe(i,!0),this.painter=new hm(i,this._contextCreateOptions,this.transform,this._scaleFactor,this._tp),this.on("data",l=>{l.dataType==="source"&&this.painter.setTileLoadedFlag(!0)}),s.m.testSupport(i)):this.fire(new s.z(new Error("Failed to initialize WebGL")))}_contextLost(f){f.preventDefault(),this._frame&&(this._frame.cancel(),this._frame=null),this.fire(new s.A("webglcontextlost",{originalEvent:f}))}_contextRestored(f){this._setupPainter(),this.painter.resize(Math.ceil(this._containerWidth),Math.ceil(this._containerHeight)),this._updateTerrain(),this.style&&(this.style.reloadModels(),this.style.clearSources()),this._update(),this.fire(new s.A("webglcontextrestored",{originalEvent:f}))}_onMapScroll(f){if(f.target===this._container)return this._container.scrollTop=0,this._container.scrollLeft=0,!1}idle(){return!this.isMoving()&&this.loaded()}loaded(){return!this._styleDirty&&!this._sourcesDirty&&!!this.style&&this.style.loaded()}frameReady(){return this.loaded()&&!this._placementDirty}_update(f){return this.style?(this._styleDirty=this._styleDirty||f,this._sourcesDirty=!0,this.triggerRepaint(),this):this}_requestRenderFrame(f){return this._update(),this._renderTaskQueue.add(f)}_cancelRenderFrame(f){this._renderTaskQueue.remove(f)}_requestDomTask(f){!this.loaded()||this.loaded()&&!this.isMoving()?f():this._domRenderTaskQueue.add(f)}_render(f){let i;this.fire(new s.A("renderstart")),++this._frameId;const l=this.painter.context.extTimerQuery,p=s.q.now(),y=this.painter.context.gl;if(this.listens("gpu-timing-frame")&&(i=y.createQuery(),y.beginQuery(l.TIME_ELAPSED_EXT,i)),this.painter.context.setDirty(),this.painter.setBaseState(),(this.isMoving()||this.isRotating()||this.isZooming())&&(this._interactionRange[0]=Math.min(this._interactionRange[0],performance.now()),this._interactionRange[1]=Math.max(this._interactionRange[1],performance.now())),this._renderTaskQueue.run(f),this._domRenderTaskQueue.run(f),this._removed)return;this._updateProjectionTransition();const v=this._isInitialLoad?0:this._fadeDuration;if(this.style&&this._styleDirty){this._styleDirty=!1;const D=this.transform.zoom,L=this.transform.pitch,F=s.q.now(),O=new s.aa(D,{now:F,fadeDuration:v,pitch:L,transition:this.style.transition});this.style.update(O)}this.style&&this.style.hasFogTransition()&&(this.style._markersNeedU
vendor: 11,821 bytes, line 3248
3248pdate=!0,this._sourcesDirty=!0);let w=!1;this.style&&this._sourcesDirty?(this._sourcesDirty=!1,this.painter._updateFog(this.style),this._updateTerrain(),w=this._updateAverageElevation(p),this.style.updateSources(this.transform),this.style.updateImageProviders(),this.isMoving()||this._forceMarkerAndPopupUpdate()):w=this._updateAverageElevation(p);const S=this.style&&this.style._updatePlacement(this.painter,this.painter.transform,this.showCollisionBoxes,v,this._crossSourceCollisions,this.painter.replacementSource,this._scaleFactorChanged);if(this._scaleFactorChanged&&(this._scaleFactorChanged=!1),S&&(this._placementDirty=S.needsRerender),this.style&&this.painter.render(this.style,{showTileBoundaries:this.showTileBoundaries,showParseStatus:this.showParseStatus,wireframe:{terrain:this.showTerrainWireframe,layers2D:this.showLayers2DWireframe,layers3D:this.showLayers3DWireframe},showOverdrawInspector:this._showOverdrawInspector,showQueryGeometry:!!this._showQueryGeometry,showTileAABBs:this.showTileAABBs,rotating:this.isRotating(),zooming:this.isZooming(),moving:this.isMoving(),fadeDuration:v,isInitialLoad:this._isInitialLoad,showPadding:this.showPadding,gpuTiming:!!this.listens("gpu-timing-layer"),gpuTimingDeferredRender:!!this.listens("gpu-timing-deferred-render"),speedIndexTiming:this.speedIndexTiming}),this.fire(new s.A("render")),this.loaded()&&!this._loaded&&(this._loaded=!0,R.mark(P.load),this.fire(new s.A("load"))),this.style&&this.style.hasTransitions()&&(this._styleDirty=!0),this.style&&(this.style.snow||this.style.rain)&&(this._styleDirty=!0),this.style&&this.style.imageManager.hasPatternsInFlight()&&(this._styleDirty=!0),this.style&&!this.style.modelManager.isLoaded()&&(this._styleDirty=!0),this.style&&!this._placementDirty&&this.style._releaseSymbolFadeTiles(),i){const D=s.q.now()-p;y.endQuery(l.TIME_ELAPSED_EXT),setTimeout(()=>{const L=y.getQueryParameter(i,y.QUERY_RESULT)/1e6;y.deleteQuery(i),this.fire(new s.A("gpu-timing-frame",{cpuTime:D,gpuTime:L}))},50)}if(this.listens("gpu-timing-layer")){const D=this.painter.collectGpuTimers();setTimeout(()=>{const L=this.painter.queryGpuTimers(D);this.fire(new s.A("gpu-timing-layer",{layerTimes:L}))},50)}if(this.listens("gpu-timing-deferred-render")){const D=this.painter.collectDeferredRenderGpuQueries();setTimeout(()=>{const L=this.painter.queryGpuTimeDeferredRender(D);this.fire(new s.A("gpu-timing-deferred-render",{gpuTime:L}))},50)}const C=this._sourcesDirty||this._styleDirty||this._placementDirty||w;if(C||this._repaint)this.triggerRepaint();else{const D=this.idle();if(D&&(w=this._updateAverageElevation(p,!0)),w)this.triggerRepaint();else if(this._triggerFrame(!1),D&&(this.fire(new s.A("idle")),this._isInitialLoad=!1,this.speedIndexTiming)){const L=this._calculateSpeedIndex();this.fire(new s.A("speedindexcompleted",{speedIndex:L})),this.speedIndexTiming=!1}}!this._loaded||this._fullyLoaded||C||(this._fullyLoaded=!0,R.mark(P.fullLoad),this._performanceMetricsCollection&&zt(this._requestManager._customAccessToken,{width:this.painter.width,height:this.painter.height,interactionRange:this._interactionRange,visibilityHidden:this._visibilityHidden,terrainEnabled:!!this.painter.style.getTerrain(),fogEnabled:!!this.painter.style.getFog(),projection:this.getProjection().name,zoom:this.transform.zoom,renderer:this.painter.context.renderer,vendor:this.painter.context.vendor}),this._authenticate())}_forceMarkerAndPopupUpdate(f){for(const i of this._markers)f&&!this.getRenderWorldCopies()&&(i._lngLat=i._lngLat.wrap()),i._update();for(const i of this._popups)!f||this.getRenderWorldCopies()||i._trackPointer||(i._lngLat=i._lngLat.wrap()),i._update()}_updateAverageElevation(f,i=!1){const l=y=>(this.transform.averageElevation=y,this._update(!1),!0);if(!this.painter.averageElevationNeedsEasing())return this.transform.averageElevation!==0&&l(0);const p=this.transform.elevation&&this.transform.elevation.exaggeration()!==this._averageElevationExaggeration;if(p||(i||f-this._averageElevationLastSampledAt>500)&&!this._averageElevation.isEasing(f)){const y=this.transform.averageElevation;let v=this.transform.sampleAverageElevation();this.transform.elevation!=null&&(this._averageElevationExaggeration=this.transform.elevation.exaggeration()),isNaN(v)?v=0:this._averageElevationLastSampledAt=f;const w=Math.abs(y-v);if(w>1){if(this._isInitialLoad||p)return this._averageElevation.jumpTo(v),l(v);this._averageElevation.easeTo(v,f,300)}else if(w>1e-4)return this._averageElevation.jumpTo(v),l(v)}return!!this._averageElevation.isEasing(f)&&l(this._averageElevation.getValue(f))}_authenticate(){qi(this._getMapId(),this._requestManager._skuToken,this._requestManager._customAccessToken,f=>{if(f&&(f.message===yi||f.status===401)){const i=this.painter.context.gl;Fe(i,!1),this._logoControl instanceof Nf&&this._logoControl._updateLogo(),i&&i.clear(i.DEPTH_BUFFER_BIT|i.COLOR_BUFFER_BIT|i.STENCIL_BUFFER_BIT),this._silenceAuthErrors||this.fire(new s.z(new Error("A valid Mapbox access token is required to use Mapbox GL JS. To create an account or a new access token, visit https://account.mapbox.com/")))}}),On(this._getMapId(),this._requestManager._skuToken,this._requestManager._customAccessToken,()=>{})}_postStyleLoadEvent(){this.style.globalId&&Hi(this._requestManager._customAccessToken,{map:this,style:this.style.globalId,importedStyles:this.style.getImportGlobalIds()})}_updateTerrain(){const f=this._isDragging();this.painter.updateTerrain(this.style,f)}_calculateSpeedIndex(){const f=this.painter.canvasCopy(),i=this.painter.getCanvasCopiesAndTimestamps();i.timeStamps.push(performance.now());const l=this.painter.context.gl,p=l.createFramebuffer();function y(v){l.framebufferTexture2D(l.FRAMEBUFFER,l.COLOR_ATTACHMENT0,l.TEXTURE_2D,v,0);const w=new Uint8Array(l.drawingBufferWidth*l.drawingBufferHeight*4);return l.readPixels(0,0,l.drawingBufferWidth,l.drawingBufferHeight,l.RGBA,l.UNSIGNED_BYTE,w),w}return l.bindFramebuffer(l.FRAMEBUFFER,p),this._canvasPixelComparison(y(f),i.canvasCopies.map(y),i.timeStamps)}_canvasPixelComparison(f,i,l){let p=l[1]-l[0];const y=f.length/4;for(let v=0;v<i.length;v++){const w=i[v];let S=0;for(let C=0;C<w.length;C+=4)w[C]===f[C]&&w[C+1]===f[C+1]&&w[C+2]===f[C+2]&&w[C+3]===f[C+3]&&(S+=1);p+=(l[v+2]-l[v+1])*(1-S/y)}return p}remove(){this._hash&&this._hash.remove();for(const i of this._controls)i.onRemove(this);this._controls=[],this._frame&&(this._frame.cancel(),this._frame=null),this._renderTaskQueue.clear(),this._domRenderTaskQueue.clear(),this.style&&this.style.destroy(),this.indoor.destroy(),this.painter.destroy(),this.handlers&&this.handlers.destroy(),this.handlers=void 0,this.setStyle(null),window.removeEventListener("resize",this._onWindowResize,!1),window.removeEventListener("orientationchange",this._onWindowResize,!1),window.removeEventListener(this._fullscreenchangeEvent,this._onWindowResize,!1),window.removeEventListener("online",this._onWindowOnline,!1),window.removeEventListener("visibilitychange",this._onVisibilityChange,!1);const f=this.painter.context.gl.getExtension("WEBGL_lose_context");f&&f.loseContext(),this._canvas.removeEventListener("webglcontextlost",this._contextLost,!1),this._canvas.removeEventListener("webglcontextrestored",this._contextRestored,!1),this._canvasContainer.remove(),this._controlContainer.remove(),this._missingCSSCanary.remove(),this._canvas=void 0,this._canvasContainer=void 0,this._controlContainer=void 0,this._missingCSSCanary=void 0,this._container.classList.remove("mapboxgl-map"),this._container.removeEventListener("scroll",this._onMapScroll,!1),ts.delete(this.painter.context.gl),ti.remove(),ps.remove(),this._removed=!0,this.fire(new s.A("remove"))}triggerRepaint(){this._triggerFrame(!0)}_triggerFrame(f){this._renderNextFrame=this._renderNextFrame||f,this.style&&!this._frame&&(this._frame=s.q.frame(i=>{const l=!!this._renderNextFrame;this._frame=null,this._renderNextFrame=null,l&&this._render(i)}))}_preloadTiles(f){const i=this.style?this.style.getSourceCaches():[];return s.bt(i,(l,p)=>l._preloadTiles(f,p),()=>{this.triggerRepaint()}),this}_onWindowOnline(){this._update()}_onWindowResize(f){this._trackResize&&this.resize({originalEvent:f})._update()}_onVisibilityChange(){document.visibilityState==="hidden"&&this._visibilityHidden++}get showTileBoundaries(){return!!this._showTileBoundaries}set showTileBoundaries(f){this._showTileBoundaries!==f&&(this._showTileBoundaries=f,this._tp.refreshUI(),this._update())}get showParseStatus(){return!!this._showParseStatus}set showParseStatus(f){this._showParseStatus!==f&&(this._showParseStatus=f,this._tp.refreshUI(),this._update())}get showTerrainWireframe(){return!!this._showTerrainWireframe}set showTerrainWireframe(f){this._showTerrainWireframe!==f&&(this._showTerrainWireframe=f,this._tp.refreshUI(),this._update())}get showLayers2DWireframe(){return!!this._showLayers2DWireframe}set showLayers2DWireframe(f){this._showLayers2DWireframe!==f&&(this._showLayers2DWireframe=f,this._tp.refreshUI(),this._update())}get showLayers3DWireframe(){return!!this._showLayers3DWireframe}set showLayers3DWireframe(f){this._showLayers3DWireframe!==f&&(this._showLayers3DWireframe=f,this._tp.refreshUI(),this._update())}get speedIndexTiming(){return!!this._speedIndexTiming}set speedIndexTiming(f){this._speedIndexTiming!==f&&(this._speedIndexTiming=f,this._update())}get showPadding(){return!!this._showPadding}set showPadding(f){this._showPadding!==f&&(this._showPadding=f,this._tp.refreshUI(),this._update())}get showCollisionBoxes(){return!!this._showCollisionBoxes}set showCollisionBoxes(f){this._showCollisionBoxes!==f&&(this._showCollisionBoxes=f,this._tp.refreshUI(),f?this.style._generateCollisionBoxes():this._update())}get showOverdrawInspector(){return!!this._showOverdrawInspector}set showOverdrawInspector(f){this._showOverdrawInspector!==f&&(this._showOverdrawInspector=f,this._tp.refreshUI(),this._update())}get repaint(){return!!this._repaint}set repaint(f){this._repaint!==f&&(this._repaint=f,this._tp.refreshUI(),this.triggerRepaint())}get vertices(){return!!this._vertices}set vertices(f){this._vertices=f,this._update()}get showTileAABBs(){return!!this._showTileAABBs}set showTileAABBs(f){this._showTileAABBs!==f&&(this._showTileAABBs=f,this._tp.refreshUI(),f&&this._update())}_setCacheLimits(f,i){s.eJ(f,i)}get version(){return A}},NavigationControl:class{constructor(f={}){this.options=s.l({},R1,f),this._container=re("div","mapboxgl-ctrl mapboxgl-ctrl-group"),this._container.addEventListener("contextmenu",i=>i.preventDefault()),this.options.showZoom&&(s.aV(["_setButtonTitle","_updateZoomButtons"],this),this._zoomInButton=this._createButton("mapboxgl-ctrl-zoom-in",i=>{this._map&&this._map.zoomIn({},{originalEvent:i})}),re("span","mapboxgl-ctrl-icon",this._zoomInButton).setAttribute("aria-hidden","true"),this._zoomOutButton=this._createButton("mapboxgl-ctrl-zoom-out",i=>{this._map&&this._map.zoomOut({},{originalEvent:i})}),re("span","mapboxgl-ctrl-icon",this._zoomOutButton).setAttribute("aria-hidden","true")),this.options.showCompass&&(s.aV(["_rotateCompassArrow"],this),this._compass=this._createButton("mapboxgl-ctrl-compass",i=>{const l=this._map;l&&(this.options.visualizePitch?l.resetNorthPitch({},{originalEvent:i}):l.resetNorth({},{originalEvent:i}))}),this._compassIcon=re("span","mapboxgl-ctrl-icon",this._compass),this._compassIcon.setAttribute("aria-hidden","true"))}_updateZoomButtons(){const f=this._map;if(!f)return;const i=f.getZoom(),l=i===f.getMaxZoom(),p=i===f.getMinZoom();this._zoomInButton.disabled=l,this._zoomOutButton.disabled=p,this._zoomInButton.setAttribute("aria-disabled",l.toString()),this._zoomOutButton.setAttribute("aria-disabled",p.toString())}_rotateCompassArrow(){const f=this._map;if(!f)return;const i=this.options.visualizePitch?`scale(${1/Math.pow(Math.cos(f.transform.pitch*(Math.PI/180)
3248),.5)}) rotateX(${f.transform.pitch}deg) rotateZ(${f.transform.angle*(180/Math.PI)}deg)`:`rotate(${f.transform.angle*(180/Math.PI)}deg)`;f._requestDomTask(()=>{this._compassIcon&&(this._compassIcon.style.transform=i)})}onAdd(f){return this._map=f,this.options.showZoom&&(this._setButtonTitle(this._zoomInButton,"ZoomIn"),this._setButtonTitle(this._zoomOutButton,"ZoomOut"),f.on("zoom",this._updateZoomButtons),this._updateZoomButtons()),this.options.showCompass&&(this._setButtonTitle(this._compass,"ResetBearing"),this.options.visualizePitch&&f.on("pitch",this._rotateCompassArrow),f.on("rotate",this._rotateCompassArrow),this._rotateCompassArrow(),this._handler=new $f(f,this._compass,this.options.visualizePitch)),this._container}onRemove(){const f=this._map;f&&(this._container.remove(),this.options.showZoom&&f.off("zoom",this._updateZoomButtons),this.options.showCompass&&(this.options.visualizePitch&&f.off("pitch",this._rotateCompassArrow),f.off("rotate",this._rotateCompassArrow),this._handler&&this._handler.off(),this._handler=void 0),this._map=void 0)}_createButton(f,i){const l=re("button",f,this._container);return l.type="button",l.addEventListener("click",i),l}_setButtonTitle(f,i){if(!this._map)return;const l=this._map._getUIString(`NavigationControl.${i}`);f.setAttribute("aria-label",l),f.firstElementChild&&f.firstElementChild.setAttribute("title",l)}},GeolocateControl:class extends s.E{constructor(f={}){super();const i=navigator.geolocation;this.options=s.l({geolocation:i},Uf,f),s.aV(["_onSuccess","_onError","_onZoom","_finish","_setupUI","_updateCamera","_updateMarker","_updateMarkerRotation","_onDeviceOrientation"],this),this._updateMarkerRotationThrottled=ih(this._updateMarkerRotation,20),this._numberOfWatches=0}onAdd(f){return this._map=f,this._container=re("div","mapboxgl-ctrl mapboxgl-ctrl-group"),this._checkGeolocationSupport(this._setupUI),this._container}onRemove(){this._geolocationWatchID!==void 0&&(this.options.geolocation.clearWatch(this._geolocationWatchID),this._geolocationWatchID=void 0),this.options.showUserLocation&&this._userLocationDotMarker&&this._userLocationDotMarker.remove(),this.options.showAccuracyCircle&&this._accuracyCircleMarker&&this._accuracyCircleMarker.remove(),this._container.remove(),this._map.off("zoom",this._onZoom),this._map=void 0,this._numberOfWatches=0,this._noTimeout=!1}_checkGeolocationSupport(f){const i=(l=!!this.options.geolocation)=>{this._supportsGeolocation=l,f(l)};this._supportsGeolocation!==void 0?f(this._supportsGeolocation):navigator.permissions!==void 0?navigator.permissions.query({name:"geolocation"}).then(l=>i(l.state!=="denied")).catch(()=>i()):i()}_isOutOfMapMaxBounds(f){const i=this._map.getMaxBounds(),l=f.coords;return!!i&&(l.longitude<i.getWest()||l.longitude>i.getEast()||l.latitude<i.getSouth()||l.latitude>i.getNorth())}_setErrorState(){switch(this._watchState){case"WAITING_ACTIVE":this._watchState="ACTIVE_ERROR",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active-error");break;case"ACTIVE_LOCK":this._watchState="ACTIVE_ERROR",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting");break;case"BACKGROUND":this._watchState="BACKGROUND_ERROR",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background-error"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting")}}_onSuccess(f){if(this._map){if(this._isOutOfMapMaxBounds(f))return this._setErrorState(),this.fire(new s.A("outofmaxbounds",f)),this._updateMarker(),void this._finish();if(this.options.trackUserLocation)switch(this._lastKnownPosition=f,this._watchState){case"WAITING_ACTIVE":case"ACTIVE_LOCK":case"ACTIVE_ERROR":this._watchState="ACTIVE_LOCK",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active");break;case"BACKGROUND":case"BACKGROUND_ERROR":this._watchState="BACKGROUND",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background-error"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background")}this.options.showUserLocation&&this._watchState!=="OFF"&&this._updateMarker(f),this.options.trackUserLocation&&this._watchState!=="ACTIVE_LOCK"||this._updateCamera(f),this.options.showUserLocation&&this._userLocationDotMarker.removeClassName("mapboxgl-user-location-dot-stale"),this.fire(new s.A("geolocate",f)),this._finish()}}_updateCamera(f){const i=new s.cd(f.coords.longitude,f.coords.latitude),l=f.coords.accuracy,p=this._map.getBearing(),y=s.l({bearing:p},this.options.fitBoundsOptions);this._map.fitBounds(i.toBounds(l),y,{geolocateSource:!0})}_updateMarker(f){if(f){const i=new s.cd(f.coords.longitude,f.coords.latitude);this._accuracyCircleMarker.setLngLat(i).addTo(this._map),this._userLocationDotMarker.setLngLat(i).addTo(this._map),this._accuracy=f.coords.accuracy,this.options.showUserLocation&&this.options.showAccuracyCircle&&this._updateCircleRadius()}else this._userLocationDotMarker.remove(),this._accuracyCircleMarker.remove()}_updateCircleRadius(){const f=this._map.transform,i=s.c6(1,f._center.lat)*f.worldSize,l=Math.ceil(2*this._accuracy*i);this._circleElement.style.width=`${l}px`,this._circleElement.style.height=`${l}px`}_onZoom(){this.options.showUserLocation&&this.options.showAccuracyCircle&&this._updateCircleRadius()}_updateMarkerRotation(){this._userLocationDotMarker&&typeof this._heading=="number"?(this._userLocationDotMarker.setRotation(this._heading),this._userLocationDotMarker.addClassName("mapboxgl-user-location-show-heading")):(this._userLocationDotMarker.removeClassName("mapboxgl-user-location-show-heading"),this._userLocationDotMarker.setRotation(0))}_onError(f){if(this._map){if(this.options.trackUserLocation)if(f.code===1){this._watchState="OFF",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background-error"),this._geolocateButton.disabled=!0;const i=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.setAttribute("aria-label",i),this._geolocateButton.firstElementChild&&this._geolocateButton.firstElementChild.setAttribute("title",i),this._geolocationWatchID!==void 0&&this._clearWatch()}else{if(f.code===3&&this._noTimeout)return;this._setErrorState()}this._watchState!=="OFF"&&this.options.showUserLocation&&this._userLocationDotMarker.addClassName("mapboxgl-user-location-dot-stale"),this.fire(new s.A("error",f)),this._finish()}}_finish(){this._timeoutId&&clearTimeout(this._timeoutId),this._timeoutId=void 0}_setupUI(f){if(this._map!==void 0){if(this._container.addEventListener("contextmenu",i=>i.preventDefault()),this._geolocateButton=re("button","mapboxgl-ctrl-geolocate",this._container),re("span","mapboxgl-ctrl-icon",this._geolocateButton).setAttribute("aria-hidden","true"),this._geolocateButton.type="button",f===!1){s.w("Geolocation support is not available so the GeolocateControl will be disabled.");const i=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.disabled=!0,this._geolocateButton.setAttribute("aria-label",i),this._geolocateButton.firstElementChild&&this._geolocateButton.firstElementChild.setAttribute("title",i)}else{const i=this._map._getUIString("GeolocateControl.FindMyLocation");this._geolocateButton.setAttribute("aria-label",i),this._geolocateButton.firstElementChild&&this._geolocateButton.firstElementChild.setAttribute("title",i)}this.options.trackUserLocation&&(this._geolocateButton.setAttribute("aria-pressed","fal
3248se"),this._watchState="OFF"),this.options.showUserLocation&&(this._dotElement=re("div","mapboxgl-user-location"),this._dotElement.appendChild(re("div","mapboxgl-user-location-dot")),this._dotElement.appendChild(re("div","mapboxgl-user-location-heading")),this._userLocationDotMarker=new jf({element:this._dotElement,rotationAlignment:"map",pitchAlignment:"map"}),this._circleElement=re("div","mapboxgl-user-location-accuracy-circle"),this._accuracyCircleMarker=new jf({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",i=>{i.geolocateSource||this._watchState!=="ACTIVE_LOCK"||i.originalEvent&&i.originalEvent.type==="resize"||(this._watchState="BACKGROUND",this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this.fire(new s.A("trackuserlocationend")))})}}_onDeviceOrientation(f){this._userLocationDotMarker&&(f.webkitCompassHeading?this._heading=f.webkitCompassHeading:f.absolute===!0&&(this._heading=-1*f.alpha),this._updateMarkerRotationThrottled())}trigger(){if(!this._setup)return s.w("Geolocate control triggered before added to a map"),!1;if(this.options.trackUserLocation){switch(this._watchState){case"OFF":this._watchState="WAITING_ACTIVE",this.fire(new s.A("trackuserlocationstart"));break;case"WAITING_ACTIVE":case"ACTIVE_LOCK":case"ACTIVE_ERROR":case"BACKGROUND_ERROR":this._numberOfWatches--,this._noTimeout=!1,this._watchState="OFF",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background-error"),this.fire(new s.A("trackuserlocationend"));break;case"BACKGROUND":this._watchState="ACTIVE_LOCK",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background"),this._lastKnownPosition&&this._updateCamera(this._lastKnownPosition),this.fire(new s.A("trackuserlocationstart"))}switch(this._watchState){case"WAITING_ACTIVE":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active");break;case"ACTIVE_LOCK":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active");break;case"ACTIVE_ERROR":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active-error");break;case"BACKGROUND":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background");break;case"BACKGROUND_ERROR":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background-error")}if(this._watchState==="OFF"&&this._geolocationWatchID!==void 0)this._clearWatch();else if(this._geolocationWatchID===void 0){let f;this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.setAttribute("aria-pressed","true"),this._numberOfWatches++,this._numberOfWatches>1?(f={maximumAge:6e5,timeout:0},this._noTimeout=!0):(f=this.options.positionOptions,this._noTimeout=!1),this._geolocationWatchID=this.options.geolocation.watchPosition(this._onSuccess,this._onError,f),this.options.showUserHeading&&this._addDeviceOrientationListener()}}else this.options.geolocation.getCurrentPosition(this._onSuccess,this._onError,this.options.positionOptions),this._timeoutId=window.setTimeout(this._finish,1e4);return!0}_addDeviceOrientationListener(){const f=()=>{"ondeviceorientationabsolute"in window?window.addEventListener("deviceorientationabsolute",this._onDeviceOrientation):window.addEventListener("deviceorientation",this._onDeviceOrientation)};typeof DeviceMotionEvent<"u"&&typeof DeviceMotionEvent.requestPermission=="function"?DeviceOrientationEvent.requestPermission().then(i=>{i==="granted"&&f()}).catch(console.error):f()}_clearWatch(){this.options.geolocation.clearWatch(this._geolocationWatchID),window.removeEventListener("deviceorientation",this._onDeviceOrientation),window.removeEventListener("deviceorientationabsolute",this._onDeviceOrientation),this._geolocationWatchID=void 0,this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.setAttribute("aria-pressed","fal
3248se"),this.options.showUserLocation&&this._updateMarker(null)}},AttributionControl:ym,ScaleControl:class{constructor(f={}){this.options=s.l({},yd,f),this._isNumberFormatSupported=function(){try{return new Intl.NumberFormat("en",{style:"unit",unitDisplay:"short",unit:"meter"}),!0}catch{return!1}}(),s.aV(["_update","_setScale","setUnit"],this)}getDefaultPosition(){return"bottom-left"}_update(){const f=this.options.maxWidth||100,i=this._map,l=i._containerHeight/2,p=i._containerWidth/2-f/2,y=i.unproject([p,l]),v=i.unproject([p+f,l]),w=y.distanceTo(v);if(this.options.unit==="imperial"){const S=3.2808*w;S>5280?this._setScale(f,S/5280,"mile"):this._setScale(f,S,"foot")}else this.options.unit==="nautical"?this._setScale(f,w/1852,"nautical-mile"):w>=1e3?this._setScale(f,w/1e3,"kilometer"):this._setScale(f,w,"meter")}_setScale(f,i,l){this._map._requestDomTask(()=>{const p=function(v){const w=Math.pow(10,`${Math.floor(v)}`.length-1);let S=v/w;return S=S>=10?10:S>=5?5:S>=3?3:S>=2?2:S>=1?1:function(C){const D=Math.pow(10,Math.ceil(-Math.log(C)/Math.LN10));return Math.round(C*D)/D}(S),w*S}(i),y=p/i;this._container.innerHTML=this._isNumberFormatSupported&&l!=="nautical-mile"?new Intl.NumberFormat(this._language,{style:"unit",unitDisplay:"short",unit:l}).format(p):`${p} ${Cc[l]}`,this._container.style.width=f*y+"px"})}onAdd(f){return this._map=f,this._language=f.getLanguage(),this._container=re("div","mapboxgl-ctrl mapboxgl-ctrl-scale",f.getContainer()),this._container.dir="auto",this._map.on("move",this._update),this._update(),this._container}onRemove(){this._container.remove(),this._map.off("move",this._update),this._map=void 0}_setLanguage(f){this._language=f,this._update()}setUnit(f){this.options.unit=f,this._update()}},FullscreenControl:class{constructor(f={}){this._fullscreen=!1,f&&f.container&&(f.container instanceof HTMLElement?this._container=f.container:s.w("Full screen control 'container' must be a DOM element.")),s.aV(["_onClickFullscreen","_changeIcon"],this),"onfullscreenchange"in document?this._fullscreenchange="fullscreenchange":"onwebkitfullscreenchange"in document&&(this._fullscreenchange="webkitfullscreenchange")}onAdd(f){return this._map=f,this._container||(this._container=this._map.getContainer()),this._controlContainer=re("div","mapboxgl-ctrl mapboxgl-ctrl-group"),this._checkFullscreenSupport()?this._setupUI():(this._controlContainer.style.display="none",s.w("This device does not support fullscreen mode.")),this._controlContainer}onRemove(){this._controlContainer.remove(),this._map=null,document.removeEventListener(this._fullscreenchange,this._changeIcon)}_checkFullscreenSupport(){return!(!document.fullscreenEnabled&&!document.webkitFullscreenEnabled)}_setupUI(){const f=this._fullscreenButton=re("button","mapboxgl-ctrl-fullscreen",this._controlContainer);re("span","mapboxgl-ctrl-icon",f).setAttribute("aria-hidden","true"),f.type="button",this._updateTitle(),this._fullscreenButton.addEventListener("click",this._onClickFullscreen),document.addEventListener(this._fullscreenchange,this._changeIcon)}_updateTitle(){const f=this._getTitle();this._fullscreenButton.setAttribute("aria-label",f),this._fullscreenButton.firstElementChild&&this._fullscreenButton.firstElementChild.setAttribute("title",f)}_getTitle(){return this._map._getUIString(this._isFullscreen()?"FullscreenControl.Exit":"FullscreenControl.Enter")}_isFullscreen(){return this._fullscreen}_changeIcon(){(document.fullscreenElement||document.webkitFullscreenElement)===this._container!==this._fullscreen&&(this._fullscreen=!this._fullscreen,this._fullscreenButton.classList.toggle("mapboxgl-ctrl-shrink"),this._fullscreenButton.classList.toggle("mapboxgl-ctrl-fullscreen"),this._updateTitle())}_onClickFullscreen(){this._isFullscreen()?document.exitFullscreen?document.exitFullscreen():document.webkitCancelFullScreen&&document.webkitCancelFullScreen():this._container.requestFullscreen?this._container.requestFullscreen():this._container.webkitRequestFullscreen&&this._container.webkitRequestFullscreen()}},Popup:class extends s.E{constructor(f){super(),this.options=s.l(Object.create(hl),f),this._altitude=this.options.altitude,s.aV(["_update","_onClose","remove","_onMouseEvent"],this),this._classList=new Set(f&&f.className?f.className.trim().split(/\s+/):[])}addTo(f){return this._map&&this.remove(),this._map=f,this.options.closeOnClick&&f.on("preclick",this._onClose),this.options.closeOnMove&&f.on("move",this._onClose),f.on("remove",this.remove),this._update(),f._addPopup(this),this._focusFirstElement(),this._trackPointer?(f.on("mousemove",this._onMouseEvent),f.on("mouseup",this._onMouseEvent),f._canvasContainer.classList.add("mapboxgl-track-pointer")):f.on("move",this._update),this.fire(new s.A("open")),this}isOpen(){return!!this._map}remove(){this._content&&this._content.remove(),this._container&&(this._container.remove(),this._container=void 0);const f=this._map;return f&&(f.off("move",this._update),f.off("move",this._onClose),f.off("preclick",this._onClose),f.off("click",this._onClose),f.off("remove",this.remove),f.off("mousemove",this._onMouseEvent),f.off("mouseup",this._onMouseEvent),f.off("drag",this._onMouseEvent),f._canvasContainer&&f._canvasContainer.classList.remove("mapboxgl-track-pointer"),f._removePopup(this),this._map=void 0),this.fire(new s.A("close")),this}getLngLat(){return this._lngLat}setLngLat(f){this._lngLat=s.cd.convert(f),this._pos=null,this._trackPointer=!1,this._update();const i=this._map;return i&&(i.on("move",this._update),i.off("mousemove",this._onMouseEvent),i._canvasContainer.classList.remove("mapboxgl-track-pointer")),this}getAltitude(){return this._altitude}setAltitude(f){return this._altitude=f,this._update(),this}trackPointer(){this._trackPointer=!0,this._pos=null,this._update();const f=this._map;return f&&(f.off("move",this._update),f.on("mousemove",this._onMouseEvent),f.on("drag",this._onMouseEvent),f._canvasContainer.classList.add("mapboxgl-track-pointer")),this}getElement(){return this._container}setText(f){return this.setDOMContent(document.createTextNode(f))}setHTML(f){const i=document.createDocumentFragment(),l=document.createElement("body");let p;for(l.innerHTML=f;p=l.firstChild,p;)i.appendChild(p);return this.setDOMContent(i)}getMaxWidth(){return this._container&&this._container.style.maxWidth}setMaxWidth(f){return this.options.maxWidth=f,this._update(),this}setDOMContent(f){let i=this._content;if(i)for(;i.hasChildNodes();)i.firstChild&&i.removeChild(i.firstChild);else i=this._content=re("div","mapboxgl-popup-content",this._container||void 0);if(i.appendChild(f),this.options.closeButton){const l=this._closeButton=re("button","mapboxgl-popup-close-button",i);l.type="button",l.setAttribute("aria-label","Close popup"),l.innerHTML='<span aria-hidden="true">×</span>',l.addEventListener("click",this._onClose)}return this._update(),this._focusFirstElement(),this}addClassName(f){return this._classList.add(f),this._updateClassList(),this}removeClassName(f){return this._classList.delete(f),this._updateClassList(),this}setOffset(f){return this.options.offset=f,this._update(),this}toggleClassName(f){let i;return this._classList.delete(f)?i=!1:(this._classList.add(f),i=!0),this._updateClassList(),i}_onMouseEvent(f){this._update(f.point)}_getAnchor(f){if(this.options.anchor)return this.options.anchor;const i=this._map,l=this._container,p=this._pos;if(!i||!l||!p)return"bottom";const y=l.offsetWidth,v=l.offsetHeight,w=p.x<y/2,S=p.x>i.transform.width-y/2;if(p.y+f<v)return w?"top-left":S?"top-right":"top";if(p.y>i.transform.height-v){if(w)return"bottom-left";if(S)return"bottom-right"}return w?"left":S?"right":"bottom"}_updateClassList(){const f=this._container;if(!f)return;const i=[...this._classList];i.push("mapboxgl-popup"),this._anchor&&i.push(`mapboxgl-popup-anchor-${this._anchor}`),this._trackPointer&&i.push("mapboxgl-popup-track-pointer"),f.className=i.join(" ")}_update(f){const i=this._map,l=this._content;if(!i||!this._lngLat&&!this._trackPointer||!l)return;let p=this._container;if(p||(p=this._container=re("div","mapboxgl-popup",i.getContainer()),this._tip=re("div","mapboxgl-popup-tip",p),p.appendChild(l)),this.options.maxWidth&&p.style.maxWidth!==this.options.maxWidth&&(p.style.maxWidth=this.options.maxWidth),i.transform.renderWorldCopies&&!this._trackPointer&&(this._lngLat=b0(this._lngLat,this._pos,i.transform)),!this._trackPointer||f){const y=this._pos=this._trackPointer&&f instanceof s.P?f:i.project(this._lngLat,this._altitude),v=cu(this.options.offset),w=this._anchor=this._getAnchor(v.y),S=cu(this.options.offset,w),C=y.add(S).round();i._requestDomTask(()=>{this._container&&w&&(this._container.style.transform=`${Kg[w]} translate(${C.x}px,${C.y}px)`)})}if(!this._marker&&i._showingGlobe()){const y=s.eK(i.transform,this._lngLat)?0:1;this._setOpacity(y)}this._updateClassList()}_focusFirstElement(){if(!this.options.focusAfterOpen||!this._container)return;const f=this._container.querySelector(dl);
3248f&&f.focus()}_onClose(){this.remove()}_setOpacity(f){this._container&&(this._container.style.opacity=`${f}`),this._content&&(this._content.style.pointerEvents=f?"auto":"none")}},Marker:jf,Style:ea,LngLat:s.cd,LngLatBounds:s.aG,Point:s.P,MercatorCoordinate:s.ac,FreeCameraOptions:jh,Evented:s.E,config:s.e,prewarm:s.eP,clearPrewarmedResources:s.eQ,get accessToken(){return s.e.ACCESS_TOKEN},set accessToken(f){s.e.ACCESS_TOKEN=f},get baseApiUrl(){return s.e.API_URL},set baseApiUrl(f){s.e.API_URL=f},get workerCount(){return s.eR.workerCount},set workerCount(f){s.eR.workerCount=f},get maxParallelImageRequests(){return s.e.MAX_PARALLEL_IMAGE_REQUESTS},set maxParallelImageRequests(f){s.e.MAX_PARALLEL_IMAGE_REQUESTS=f},clearStorage(f){s.eS(f)},get workerUrl(){return s.eT.workerUrl},set workerUrl(f){s.eT.workerUrl=f},get workerClass(){return s.eT.workerClass},set workerClass(f){s.eT.workerClass=f},get workerParams(){return s.eT.workerParams},set workerParams(f){s.eT.workerParams=f},get dracoUrl(){return s.eU()},set dracoUrl(f){s.eV(f)},get meshoptUrl(){return s.eW()},set meshoptUrl(f){s.eX(f)},setNow:s.q.setNow,restoreNow:s.q.restoreNow}});var x=d;return x})}(rx)),rx.exports}var xq=vq();const Dv=_q(xq),bq={class:"modal-content"},wq={__name:"MapModal",props:{modelValue:Boolean},emits:["update:modelValue"],setup(n,{emit:t}){const o=n,u=t,d=Mi(!1),_=Mi(!1),x=[{name:"CIBC Downtown Toronto",coords:[-79.3832,43.6532]},{name:"CIBC Yonge & Eglinton",coords:[-79.3985,43.7076]},{name:"CIBC Mississauga Central",coords:[-79.6441,43.589]}];let s=null;xp(()=>o.modelValue,async P=>{if(d.value=P,!P){s&&(s.remove(),s=null),_.value=!1;return}await qx(),Dv.accessToken="pk.eyJ1IjoiYXRoZWZhayIsImEiOiJjbWF5bm1rOHkwN2JvMnJwc3Bqcm5vN3NvIn0.qoqCTiBY8t9PcrjE52pD7A",s=new Dv.Map({container:"modal-map",style:"mapbox://styles/mapbox/streets-v12",center:x[0].coords,zoom:10}),s.on("load",()=>{_.value=!0}),x.forEach(R=>{new Dv.Marker().setLngLat(R.coords).setPopup(new Dv.Popup().setText(R.name)).addTo(s)})},{immediate:!0});function A(){u("update:modelValue",!1)}return(P,R)=>d.value?(Ke(),it("div",{key:0,class:"modal-overlay",onClick:Eh(A,["self"])},[Dt(ET,{name:"modal-scale-fade"},{default:vl(()=>[H("div",bq,[H("button",{class:"modal-close",onClick:A},"Ã"),H("div",{id:"modal-map",class:lo(["mapbox-container",{"map-loaded":_.value}])},null,2)])]),_:1})])):ha("",!0)}},CL=ji(wq,[["__scopeId","data-v-cdeca496"]]),Tq={class:"container"},Sq={class:"row my-5"},Eq={class:"col-lg-8"},Aq={class:"col-lg-4"},Cq={__name:"HomePage",setup(n){const t=Mi(null),o=Mi(!1),u=()=>{t.value&&t.value.show()};return kh(()=>{const d=new IntersectionObserver(_=>{_.forEach(x=>{x.isIntersecting&&x.target.classList.add("animate__animated","animate__fadeInUp")})},{threshold:.1});document.querySelectorAll(".animate-on-scroll").forEach(_=>{d.observe(_)})}),(d,_)=>(Ke(),it("div",null,[Dt(yg),H("main",null,[Dt(q8,{onOpenApplicationModal:u,onOpenMapModal:_[0]||(_[0]=x=>o.value=!0)}),H("div",Tq,[H("div",Sq,[H("div",Eq,[Dt(J8)]),H("div",Aq,[Dt(lN)])]),Dt(_N),Dt($N,{class:"my-5"}),Dt(AU),Dt(iq),Dt(hq),Dt(XN),H("div",{class:"text-center my-5"},[_[2]||(_[2]=H("h2",{class:"mb-4"},"Ready to Apply?",-1)),H("button",{onClick:u,class:"btn btn-apply-now btn-lg"}," Apply Now ")])]),Dt(EL)]),Dt(vg),Dt(TU,{ref_key:"applicationModal",ref:t},null,512),Dt(CL,{modelValue:o.value,"onUpdate:modelValue":_[1]||(_[1]=x=>o.value=x)},null,8,["modelValue"])]))}},Iq=ji(Cq,[["__scopeId","data-v-33892ddb"]]),Mq={class:"about-hero"},Pq={__name:"AboutHero",setup(n){return(t,o)=>(Ke(),it("section",Mq,o[0]||(o[0]=[Xo('<div class="animated-background" data-v-faab611d><div class="circle circle-1" data-v-faab611d></div><div class="circle circle-2" data-v-faab611d></div><div class="circle circle-3" data-v-faab611d></div><img src="https://logos-world.net/wp-content/uploads/2021/05/CIBC-Emblem.png" alt="CIBC Logo" class="floating-logo" data-v-faab611d></div><div class="hero-content" data-v-faab611d><h1 class="animate__animated animate__fadeInDown" data-v-faab611d>Empowering Your Financial Journey</h1><p class="animate__animated animate__fadeInUp animate__delay-1s" data-v-faab611d> For over 150 years, CIBC has been a trusted partner in your financial success. </p></div><div class="hero-image animate__animated animate__zoomIn animate__delay-2s" data-v-faab611d><img src="https://www.cibc.com/content/dam/cibc-public-assets/business/images/cibc-advisor-helping-two-clients-banner-desktop.png/_jcr_content/renditions/cq5dam.web.2000.2000.png" alt="CIBC Headquarters" data-v-faab611d></div>',3)])))}},Dq=ji(Pq,[["__scopeId","data-v-faab611d"]]);/*! @license is-dom-node v1.0.4 3249 3250 Copyright 2018 Fisssion LLC. 3251 3252 Permission is hereby granted, free of charge, to any person obtaining a copy 3253 of this software and associated documentation files (the "Software"), to deal 3254 in the Software without restriction, including without limitation the rights 3255 to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 3256 copies of the Software, and to permit persons to whom the Software is 3257 furnished to do so, subject to the following conditions: 3258 3259 The above copyright notice and this permission notice shall be included in all 3260 copies or substantial portions of the Software. 3261 3262 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 3263 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 3264 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 3265 AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 3266 LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 3267 OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 3268 SOFTWARE. 3269 3270*/function j2(n){return typeof window.Node=="object"?n instanceof window.Node:n!==null&&typeof n=="object"&&typeof n.nodeType=="number"&&typeof n.nodeName=="string"}
3270/*! @license is-dom-node-list v1.2.1 3271 3272 Copyright 2018 Fisssion LLC. 3273 3274 Permission is hereby granted, free of charge, to any person obtaining a copy 3275 of this software and associated documentation files (the "Software"), to deal 3276 in the Software without restriction, including without limitation the rights 3277 to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 3278 copies of the Software, and to permit persons to whom the Software is 3279 furnished to do so, subject to the following conditions: 3280 3281 The above copyright notice and this permission notice shall be included in all 3282 copies or substantial portions of the Software. 3283 3284 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 3285 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 3286 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 3287 AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 3288 LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 3289 OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 3290 SOFTWARE. 3291 3292*/function kq(n){var t=Object.prototype.toString.call(n),o=/^\[object (HTMLCollection|NodeList|Object)\]$/;return typeof window.NodeList=="object"?n instanceof window.NodeList:n!==null&&typeof n=="object"&&typeof n.length=="number"&&o.test(t)&&(n.length===0||j2(n[0]))}/*! @license Tealight v0.3.6 3293 3294 Copyright 2018 Fisssion LLC. 3295 3296 Permission is hereby granted, free of charge, to any person obtaining a copy 3297 of this software and associated documentation files (the "Software"), to deal 3298 in the Software without restriction, including without limitation the rights 3299 to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 3300 copies of the Software, and to permit persons to whom the Software is 3301 furnished to do so, subject to the following conditions: 3302 3303 The above copyright notice and this permission notice shall be included in all 3304 copies or substantial portions of the Software. 3305 3306 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 3307 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 3308 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 3309 AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 3310 LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 3311 OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 3312 SOFTWARE. 3313 3314*/function Py(n,t){if(t===void 0&&(t=document),n instanceof Array)return n.filter(j2);if(j2(n))return[n];if(kq(n))return Array.prototype.slice.call(n);if(typeof n=="string")try{var o=t.querySelectorAll(n);return Array.prototype.slice.call(o)}catch{return[]}return[]}/*! @license Rematrix v0.3.0 3315 3316 Copyright 2018 Julian Lloyd. 3317 3318 Permission is hereby granted, free of charge, to any person obtaining a copy 3319 of this software and associated documentation files (the "Software"), to deal 3320 in the Software without restriction, including without limitation the rights 3321 to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 3322 copies of the Software, and to permit persons to whom the Software is 3323 furnished to do so, subject to the following conditions: 3324 3325 The above copyright notice and this permission notice shall be included in 3326 all copies or substantial portions of the Software. 3327 3328 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 3329 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 3330 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 3331 AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 3332 LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 3333 OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 3334 THE SOFTWARE. 3335*/function U2(n){if(n.constructor!==Array)throw new TypeError("Expected array.");if(n.length===16)return n;if(n.length===6){var t=cf();return t[0]=n[0],t[1]=n[1],t[4]=n[2],t[5]=n[3],t[12]=n[4],t[13]=n[5],t}throw new RangeError("Expected array with either 6 or 16 values.")}function cf(){for(var n=[],t=0;t<16;t++)t%5==0?n.push(1):n.push(0);return n}function Lq(n,t){for(var o=U2(n),u=U2(t),d=[],_=0;_<4;_++)for(var x=[o[_],o[_+4],o[_+8],o[_+12]],s=0;s<4;s++){var A=s*4,P=[u[A],u[A+1],u[A+2],u[A+3]],R=x[0]*P[0]+x[1]*P[1]+x[2]*P[2]+x[3]*P[3];d[_+A]=R}return d}function Rq(n){if(typeof n=="string"){var t=n.match(/matrix(3d)?\(([^)]+)\)/);if(t){var o=t[2].split(", ").map(parseFloat);return U2(o)}}return cf()}function Oq(n){var t=Math.PI/180*n,o=cf();return o[5]=o[10]=Math.cos(t),o[6]=o[9]=Math.sin(t),o[9]*=-1,o}function zq(n){var t=Math.PI/180*n,o=cf();return o[0]=o[10]=Math.cos(t),o[2]=o[8]=Math.sin(t),o[2]*=-1,o}
3335function Fq(n){var t=Math.PI/180*n,o=cf();return o[0]=o[5]=Math.cos(t),o[1]=o[4]=Math.sin(t),o[4]*=-1,o}function LM(n,t){var o=cf();return o[0]=n,o[5]=n,o}function Bq(n){var t=cf();return t[12]=n,t}function Nq(n){var t=cf();return t[13]=n,t}/*! @license miniraf v1.0.0 3336 3337 Copyright 2018 Fisssion LLC. 3338 3339 Permission is hereby granted, free of charge, to any person obtaining a copy 3340 of this software and associated documentation files (the "Software"), to deal 3341 in the Software without restriction, including without limitation the rights 3342 to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 3343 copies of the Software, and to permit persons to whom the Software is 3344 furnished to do so, subject to the following conditions: 3345 3346 The above copyright notice and this permission notice shall be included in all 3347 copies or substantial portions of the Software. 3348 3349 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 3350 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 3351 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 3352 AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 3353 LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 3354 OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 3355 SOFTWARE. 3356 3357*/var IL=function(){var n=Date.now();return function(t){var o=Date.now();o-n>16?(n=o,t(o)):setTimeout(function(){return IL(t)},0)}}(),Vq=window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||IL;/*! @license ScrollReveal v4.0.9 3358 3359 Copyright 2021 Fisssion LLC. 3360 3361 Licensed under the GNU General Public License 3.0 for 3362 compatible open source projects and non-commercial use. 3363 3364 For commercial sites, themes, projects, and applications, 3365 keep your source code private/proprietary by purchasing 3366 a commercial license from https://scrollrevealjs.org/ 3367*/var ML={delay:0,distance:"0",duration:600,easing:"cubic-bezier(0.5, 0, 0, 1)",interval:0,opacity:0,origin:"bottom",rotate:{x:0,y:0,z:0},scale:1,cleanup:!1,container:document.documentElement,desktop:!0,mobile:!0,reset:!1,useDelay:"always",viewFactor:0,viewOffset:{top:0,right:0,bottom:0,left:0},afterReset:function(){},afterReveal:function(){},beforeReset:function(){},beforeReveal:function(){}};function $q(){return document.documentElement.classList.remove("sr"),{clean:function(){},destroy:function(){},reveal:function(){},sync:function(){},get noop(){return!0}}}function jq(){document.documentElement.classList.add("sr"),document.body?document.body.style.height="100%":document.addEventListener("DOMContentLoaded",function(){document.body.style.height="100%"})}var N_={success:jq,failure:$q};function ox(n){return n!==null&&n instanceof Object&&(n.constructor===Object||Object.prototype.toString.call(n)==="[object Object]")}function Ar(n,t){if(ox(n)){var o=Object.keys(n);return o.forEach(function(u){return t(n[u],u,n)})}if(n instanceof Array)return n.forEach(function(u,d){return t(u,d,n)});throw new TypeError("Expected either an array or object literal.")}function _p(n){for(var t=[],o=arguments.length-1;o-- >0;)t[o]=arguments[o+1];if(this.constructor.debug&&console){var u="%cScrollReveal: "+n;t.forEach(function(d){return u+=` 3368 â `+d}),console.log(u,"color: #ea654b;")}}function PL(){var n=this,t=function(){return{active:[],stale:[]}},o=t(),u=t(),d=t();try{Ar(Py("[data-sr-id]"),function(_){var x=parseInt(_.getAttribute("data-sr-id"));o.active.push(x)})}catch(_){throw _}Ar(this.store.elements,function(_){o.active.indexOf(_.id)===-1&&o.stale.push(_.id)}),Ar(o.stale,function(_){return delete n.store.elements[_]}),Ar(this.store.elements,function(_){d.active.indexOf(_.containerId)===-1&&d.active.push(_.containerId),_.hasOwnProperty("sequence")&&u.active.indexOf(_.sequence.id)===-1&&u.active.push(_.sequence.id)}),Ar(this.store.containers,function(_){d.active.indexOf(_.id)===-1&&d.stale.push(_.id)}),Ar(d.stale,function(_){var x=n.store.containers[_].node;x.removeEventListener("scroll",n.delegate),x.removeEventListener("resize",n.delegate),delete n.store.containers[_]}),Ar(this.store.sequences,function(_){u.active.indexOf(_.id)===-1&&u.stale.push(_.id)}),Ar(u.stale,function(_){return delete n.store.sequences[_]})}var RM=function(){var n={},t=document.documentElement.style;function o(u,d){if(d===void 0&&(d=t),u&&typeof u=="string"){if(n[u])return n[u];if(typeof d[u]=="string")return n[u]=u;
3368if(typeof d["-webkit-"+u]=="string")return n[u]="-webkit-"+u;throw new RangeError('Unable to find "'+u+'" style property.')}throw new TypeError("Expected a string.")}return o.clearCache=function(){return n={}},o}();function Uq(n){var t=window.getComputedStyle(n.node),o=t.position,u=n.config,d={},_=n.node.getAttribute("style")||"",x=_.match(/[\w-]+\s*:\s*[^;]+\s*/gi)||[];d.computed=x.map(function(Mt){return Mt.trim()}).join("; ")+";",d.generated=x.some(function(Mt){return Mt.match(/visibility\s?:\s?visible/i)})?d.computed:x.concat(["visibility: visible"]).map(function(Mt){return Mt.trim()}).join("; ")+";";var s=parseFloat(t.opacity),A=isNaN(parseFloat(u.opacity))?parseFloat(t.opacity):parseFloat(u.opacity),P={computed:s!==A?"opacity: "+s+";":"",generated:s!==A?"opacity: "+A+";":""},R=[];if(parseFloat(u.distance)){var V=u.origin==="top"||u.origin==="bottom"?"Y":"X",j=u.distance;(u.origin==="top"||u.origin==="left")&&(j=/^-/.test(j)?j.substr(1):"-"+j);var Q=j.match(/(^-?\d+\.?\d?)|(em$|px$|%$)/g),me=Q[0],re=Q[1];switch(re){case"em":j=parseInt(t.fontSize)*me;break;case"px":j=me;break;case"%":j=V==="Y"?n.node.getBoundingClientRect().height*me/100:n.node.getBoundingClientRect().width*me/100;break;default:throw new RangeError("Unrecognized or missing distance unit.")}V==="Y"?R.push(Nq(j)):R.push(Bq(j))}u.rotate.x&&R.push(Oq(u.rotate.x)),u.rotate.y&&R.push(zq(u.rotate.y)),u.rotate.z&&R.push(Fq(u.rotate.z)),u.scale!==1&&(u.scale===0?R.push(LM(2e-4)):R.push(LM(u.scale)));var be={};if(R.length){be.property=RM("transform"),be.computed={raw:t[be.property],matrix:Rq(t[be.property])},R.unshift(be.computed.matrix);var ve=R.reduce(Lq);be.generated={initial:be.property+": matrix3d("+ve.join(", ")+");",final:be.property+": matrix3d("+be.computed.matrix.join(", ")+");"}}else be.generated={initial:"",final:""};var Ee={};if(P.generated||be.generated.initial){Ee.property=RM("transition"),Ee.computed=t[Ee.property],Ee.fragments=[];var je=u.delay,Ve=u.duration,Je=u.easing;P.generated&&Ee.fragments.push({delayed:"opacity "+Ve/1e3+"s "+Je+" "+je/1e3+"s",instant:"opacity "+Ve/1e3+"s "+Je+" 0s"}),be.generated.initial&&Ee.fragments.push({delayed:be.property+" "+Ve/1e3+"s "+Je+" "+je/1e3+"s",instant:be.property+" "+Ve/1e3+"s "+Je+" 0s"});var vt=Ee.computed&&!Ee.computed.match(/all 0s|none 0s/);vt&&Ee.fragments.unshift({delayed:Ee.computed,instant:Ee.computed});var _t=Ee.fragments.reduce(function(Mt,At,ei){return Mt.delayed+=ei===0?At.delayed:", "+At.delayed,Mt.instant+=ei===0?At.instant:", "+At.instant,Mt},{delayed:"",instant:""});Ee.generated={delayed:Ee.property+": "+_t.delayed+";",instant:Ee.property+": "+_t.instant+";"}}else Ee.generated={delayed:"",instant:""};return{inline:d,opacity:P,position:o,transform:be,transition:Ee}}function Sg(n,t){t.split(";").forEach(function(o){var u=o.split(":"),d=u[0],_=u.slice(1);d&&_&&(n.style[d.trim()]=_.join(":"))})}function aS(n){var t=this,o;try{Ar(Py(n),function(u){var d=u.getAttribute("data-sr-id");if(d!==null){o=!0;var _=t.store.elements[d];_.callbackTimer&&window.clearTimeout(_.callbackTimer.clock),Sg(_.node,_.styles.inline.generated),u.removeAttribute("data-sr-id"),delete t.store.elements[d]}})}catch(u){return _p.call(this,"Clean failed.",u.message)}if(o)try{PL.call(this)}catch(u){return _p.call(this,"Clean failed.",u.message)}}function Hq(){var n=this;Ar(this.store.elements,function(t){Sg(t.node,t.styles.inline.generated),t.node.removeAttribute("data-sr-id")}),Ar(this.store.containers,function(t){var o=t.node===document.documentElement?window:t.node;o.removeEventListener("scroll",n.delegate),o.removeEventListener("resize",n.delegate)}),this.store={containers:{},elements:{},history:[],sequences:{}}}function Dy(n){for(var t=[],o=arguments.length-1;o-- >0;)t[o]=arguments[o+1];if(ox(n))return Ar(t,function(u){Ar(u,function(d,_){ox(d)?((!n[_]||!ox(n[_]))&&(n[_]={}),Dy(n[_],d)):n[_]=d})}),n;throw new TypeError("Target must be an object literal.")}function Dx(n){return n===void 0&&(n=navigator.userAgent),/Android|iPhone|iPad|iPod/i.test(n)}var H2=function(){var n=0;return function(){return n++}}();function DL(){var n=this;PL.call(this),Ar(this.store.elements,function(t){var o=[t.styles.inline.generated];
3368t.visible?(o.push(t.styles.opacity.computed),o.push(t.styles.transform.generated.final),t.revealed=!0):(o.push(t.styles.opacity.generated),o.push(t.styles.transform.generated.initial),t.revealed=!1),Sg(t.node,o.filter(function(u){return u!==""}).join(" "))}),Ar(this.store.containers,function(t){var o=t.node===document.documentElement?window:t.node;o.addEventListener("scroll",n.delegate),o.addEventListener("resize",n.delegate)}),this.delegate(),this.initTimeout=null}function q_(n,t){t===void 0&&(t={});var o=t.pristine||this.pristine,u=n.config.useDelay==="always"||n.config.useDelay==="onload"&&o||n.config.useDelay==="once"&&!n.seen,d=n.visible&&!n.revealed,_=!n.visible&&n.revealed&&n.config.reset;if(t.reveal||d)return Gq.call(this,n,u);if(t.reset||_)return Wq.call(this,n)}function Gq(n,t){var o=[n.styles.inline.generated,n.styles.opacity.computed,n.styles.transform.generated.final];t?o.push(n.styles.transition.generated.delayed):o.push(n.styles.transition.generated.instant),n.revealed=n.seen=!0,Sg(n.node,o.filter(function(u){return u!==""}).join(" ")),kL.call(this,n,t)}function Wq(n){var t=[n.styles.inline.generated,n.styles.opacity.generated,n.styles.transform.generated.initial,n.styles.transition.generated.instant];n.revealed=!1,Sg(n.node,t.filter(function(o){return o!==""}).join(" ")),kL.call(this,n)}function kL(n,t){var o=this,u=t?n.config.duration+n.config.delay:n.config.duration,d=n.revealed?n.config.beforeReveal:n.config.beforeReset,_=n.revealed?n.config.afterReveal:n.config.afterReset,x=0;n.callbackTimer&&(x=Date.now()-n.callbackTimer.start,window.clearTimeout(n.callbackTimer.clock)),d(n.node),n.callbackTimer={start:Date.now(),clock:window.setTimeout(function(){_(n.node),n.callbackTimer=null,n.revealed&&!n.config.reset&&n.config.cleanup&&aS.call(o,n.node)},u-x)}}function LL(n,t){if(t===void 0&&(t=this.pristine),!n.visible&&n.revealed&&n.config.reset)return q_.call(this,n,{reset:!0});var o=this.store.sequences[n.sequence.id],u=n.sequence.index;if(o){var d=new OM(o,"visible",this.store),_=new OM(o,"revealed",this.store);if(o.models={visible:d,revealed:_},!_.body.length){var x=o.members[d.body[0]],s=this.store.elements[x];if(s)return kv.call(this,o,d.body[0],-1,t),kv.call(this,o,d.body[0],1,t),q_.call(this,s,{reveal:!0,pristine:t})}if(!o.blocked.head&&u===[].concat(_.head).pop()&&u>=[].concat(d.body).shift())return kv.call(this,o,u,-1,t),q_.call(this,n,{reveal:!0,pristine:t});if(!o.blocked.foot&&u===[].concat(_.foot).shift()&&u<=[].concat(d.body).pop())return kv.call(this,o,u,1,t),q_.call(this,n,{reveal:!0,pristine:t})}}function qq(n){var t=Math.abs(n);if(!isNaN(t))this.id=H2(),this.interval=Math.max(t,16),this.members=[],this.models={},this.blocked={head:!1,foot:!1};else throw new RangeError("Invalid sequence interval.")}function OM(n,t,o){var u=this;this.head=[],this.body=[],this.foot=[],Ar(n.members,function(d,_){var x=o.elements[d];x&&x[t]&&u.body.push(_)}),this.body.length&&Ar(n.members,function(d,_){var x=o.elements[d];x&&!x[t]&&(_<u.body[0]?u.head.push(_):u.foot.push(_))})}function kv(n,t,o,u){var d=this,_=["head",null,"foot"][1+o],x=n.members[t+o],s=this.store.elements[x];n.blocked[_]=!0,setTimeout(function(){n.blocked[_]=!1,s&&LL.call(d,s,u)},n.interval)}function RL(n,t,o){var u=this;t===void 0&&(t={}),o===void 0&&(o=!1);var d=[],_,x=t.interval||ML.interval;try{x&&(_=new qq(x));var s=Py(n);if(!s.length)throw new Error("Invalid reveal target.");var A=s.reduce(function(P,R){var V={},j=R.getAttribute("data-sr-id");j?(Dy(V,u.store.elements[j]),Sg(V.node,V.styles.inline.computed)):(V.id=H2(),V.node=R,V.seen=!1,V.revealed=!1,V.visible=!1);var Q=Dy({},V.config||u.defaults,t);if(!Q.mobile&&Dx()||!Q.desktop&&!Dx())return j&&aS.call(u,V),P;var me=Py(Q.container)[0];if(!me)throw new Error("Invalid container.");if(!me.contains(R))return P;var re;return re=Zq(me,d,u.store.containers),re===null&&(re=H2(),d.push({id:re,node:me})),V.config=Q,V.containerId=re,V.styles=Uq(V),_&&(V.sequence={id:_.id,index:_.members.length},_.members.push(V.id)),P.push(V),P},[]);Ar(A,function(P){u.store.elements[P.id]=P,P.node.setAttribute("data-sr-id",P.id)})}catch(P){return _p.call(this,"Reveal failed.",P.message)}Ar(d,function(P){u.store.containers[P.id]={id:P.id,node:P.node}}),_&&(this.store.sequences[_.id]=_),o!==!0&&(this.store.history.push({target:n,options:t}),this.initTimeout&&window.clearTimeout(this.initTimeout),this.initTimeout=window.setTimeout(DL.bind(this),0))}function Zq(n){for(var t=[],o=arguments.length-1;o-- >0;)t[o]=arguments[o+1];var u=null;return Ar(t,function(d){Ar(d,function(_){u===null&&_.node===n&&(u=_.id)})}),u}function Xq(){var n=this;Ar(this.store.history,function(t){RL.call(n,t.target,t.options,!0)}),DL.call(this)}var Yq=function(n){return(n>0)-(n<0)||+n},zM=Math.sign||Yq;function FM(n,t){var o=t?n.node.clientHeight:n.node.offsetHeight,u=t?n.node.clientWidth:n.node.offsetWidth,d=0,_=0,x=n.node;do isNaN(x.offsetTop)||(d+=x.offsetTop),isNaN(x.offsetLeft)||(_+=x.offsetLeft),x=x.offsetParent;while(x);return{bounds:{top:d,right:_+u,bottom:d+o,left:_},height:o,width:u}}function Kq(n){var t,o;return n.node===document.documentElement?(t=window.pageYOffset,o=window.pageXOffset):(t=n.node.scrollTop,o=n.node.scrollLeft),{top:t,left:o}}function Jq(n){n===void 0&&(n={});
3368var t=this.store.containers[n.containerId];if(t){var o=Math.max(0,Math.min(1,n.config.viewFactor)),u=n.config.viewOffset,d={top:n.geometry.bounds.top+n.geometry.height*o,right:n.geometry.bounds.right-n.geometry.width*o,bottom:n.geometry.bounds.bottom-n.geometry.height*o,left:n.geometry.bounds.left+n.geometry.width*o},_={top:t.geometry.bounds.top+t.scroll.top+u.top,right:t.geometry.bounds.right+t.scroll.left-u.right,bottom:t.geometry.bounds.bottom+t.scroll.top-u.bottom,left:t.geometry.bounds.left+t.scroll.left+u.left};return d.top<_.bottom&&d.right>_.left&&d.bottom>_.top&&d.left<_.right||n.styles.position==="fixed"}}function Qq(n,t){var o=this;n===void 0&&(n={type:"init"}),t===void 0&&(t=this.store.elements),Vq(function(){var u=n.type==="init"||n.type==="resize";Ar(o.store.containers,function(d){u&&(d.geometry=FM.call(o,d,!0));var _=Kq.call(o,d);d.scroll&&(d.direction={x:zM(_.left-d.scroll.left),y:zM(_.top-d.scroll.top)}),d.scroll=_}),Ar(t,function(d){(u||d.geometry===void 0)&&(d.geometry=FM.call(o,d)),d.visible=Jq.call(o,d)}),Ar(t,function(d){d.sequence?LL.call(o,d):q_.call(o,d)}),o.pristine=!1})}function eZ(){var n=document.documentElement.style;return"transform"in n||"WebkitTransform"in n}function tZ(){var n=document.documentElement.style;return"transition"in n||"WebkitTransition"in n}var iZ="4.0.9",zw,Fw,Bw,Nw,Vw,Rd,$w,jw;function tc(n){n===void 0&&(n={});var t=typeof this>"u"||Object.getPrototypeOf(this)!==tc.prototype;if(t)return new tc(n);if(!tc.isSupported())return _p.call(this,"Instantiation failed.","This browser is not supported."),N_.failure();var o;try{o=Rd?Dy({},Rd,n):Dy({},ML,n)}catch(d){return _p.call(this,"Invalid configuration.",d.message),N_.failure()}try{var u=Py(o.container)[0];if(!u)throw new Error("Invalid container.")}catch(d){return _p.call(this,d.message),N_.failure()}return Rd=o,!Rd.mobile&&Dx()||!Rd.desktop&&!Dx()?(_p.call(this,"This device is disabled.","desktop: "+Rd.desktop,"mobile: "+Rd.mobile),N_.failure()):(N_.success(),this.store={containers:{},elements:{},history:[],sequences:{}},this.pristine=!0,zw=zw||Qq.bind(this),Fw=Fw||Hq.bind(this),Bw=Bw||RL.bind(this),Nw=Nw||aS.bind(this),Vw=Vw||Xq.bind(this),Object.defineProperty(this,"delegate",{get:function(){return zw}}),Object.defineProperty(this,"destroy",{get:function(){return Fw}}),Object.defineProperty(this,"reveal",{get:function(){return Bw}}),Object.defineProperty(this,"clean",{get:function(){return Nw}}),Object.defineProperty(this,"sync",{get:function(){return Vw}}),Object.defineProperty(this,"defaults",{get:function(){return Rd}}),Object.defineProperty(this,"version",{get:function(){return iZ}}),Object.defineProperty(this,"noop",{get:function(){return!1}}),jw||(jw=this))}tc.isSupported=function(){return eZ()&&tZ()};Object.defineProperty(tc,"debug",{get:function(){return $w||!1},set:function(n){return $w=typeof n=="boolean"?n:$w}});tc();const nZ={class:"our-history"},sZ={class:"timeline"},rZ={class:"timeline-content"},oZ={class:"year"},aZ={__name:"OurHistory",setup(n){const t=Mi([{year:1867,title:"The Beginning",description:"CIBC was founded as the Canadian Bank of Commerce, coinciding with Canada's Confederation."},{year:1961,title:"A New Identity",description:"The Canadian Bank of Commerce and the Imperial Bank of Canada merged to form the Canadian Imperial Bank of Commerce (CIBC)."},{year:1992,title:"Digital Innovation",description:"CIBC launched its first online banking services, pioneering digital banking in Canada."},{year:2019,title:"CIBC Square",description:"Construction began on CIBC Square, our new global headquarters in Toronto, symbolizing our commitment to innovation and sustainability."}]),o={mounted:(u,d)=>{tc().reveal(u,d.value)}};return(u,d)=>(Ke(),it("section",nZ,[d[0]||(d[0]=H("h2",{class:"section-title"},"Our Rich History",-1)),H("div",sZ,[(Ke(!0),it(fn,null,Hn(t.value,(_,x)=>(Ke(),it("div",{key:x,class:lo(["timeline-item",{right:x%2!==0}])},[An((Ke(),it("div",rZ,[H("div",oZ,Ut(_.year),1),H("h3",null,Ut(_.title),1),H("p",null,Ut(_.description),1)])),[[o,{delay:200}]])],2))),128))])]))}},lZ=ji(aZ,[["__scopeId","data-v-63b026ec"]]),cZ={class:"our-values"},uZ={class:"values-container"},hZ={class:"icon-container"},dZ={__name:"OurValues",setup(n){const t=Mi([{icon:"handshake",title:"Trust",description:"We build and maintain trust with our clients, employees, and communities through integrity and transparency."}
3368,{icon:"users",title:"Teamwork",description:"We collaborate across our organization to deliver the best solutions and experiences for our clients."},{icon:"lightbulb",title:"Innovation",description:"We embrace change and continuously seek new ways to enhance our services and operations."},{icon:"heart",title:"Client-Focused",description:"We put our clients at the center of everything we do, striving to exceed their expectations."}]),o={mounted:(u,d)=>{tc().reveal(u,d.value)}};return(u,d)=>(Ke(),it("section",cZ,[d[0]||(d[0]=H("h2",{class:"section-title"},"Our Core Values",-1)),H("div",uZ,[(Ke(!0),it(fn,null,Hn(t.value,(_,x)=>An((Ke(),it("div",{key:x,class:"value-card"},[H("div",hZ,[Dt(cs(Fs),{icon:["fas",_.icon]},null,8,["icon"])]),H("h3",null,Ut(_.title),1),H("p",null,Ut(_.description),1)])),[[o,{delay:200*x}]])),128))])]))}},fZ=ji(dZ,[["__scopeId","data-v-af832c34"]]),pZ={class:"leadership"},mZ={class:"leadership-container"},gZ={class:"leader-image"},_Z=["src","alt"],yZ={class:"leader-title"},vZ={class:"leader-bio"},xZ={__name:"Leadership",setup(n){const t=Mi([{name:"Victor G. Dodig",title:"President and CEO",image:"https://media.licdn.com/dms/image/v2/C5603AQH1bSh0N-Li5Q/profile-displayphoto-shrink_400_400/profile-displayphoto-shrink_400_400/0/1574456477144?e=2147483647&v=beta&t=84c1UpumcFtL4T2b4gzEUAKcweahzcaOaXWSeSgGbQk",bio:"Victor has been leading CIBC's transformation into a relationship-oriented bank for a modern world since 2014."},{name:"Hratch Panossian",title:"Senior Executive Vice-President and CFO",image:"https://www.sickkids.ca/siteassets/images/staff-headshots/board-of-trustee-headshots/hratch-panossian-headshot-300.png",bio:"Hratch oversees financial governance and reporting, as well as CIBC's corporate strategy and financial planning."},{name:"Christina Kramer",title:"Senior Executive Vice-President and Group Head, Technology, Infrastructure and Innovation",image:"https://ffnews.com/wp-content/uploads/2021/07/Christina-Kramer-.jpg",bio:"Christina leads CIBC's technology and operations teams, driving innovation and digital transformation across the bank."}]),o={mounted:(u,d)=>{tc().reveal(u,d.value)}};return(u,d)=>(Ke(),it("section",pZ,[d[0]||(d[0]=H("h2",{class:"section-title"},"Our Leadership",-1)),H("div",mZ,[(Ke(!0),it(fn,null,Hn(t.value,(_,x)=>An((Ke(),it("div",{key:x,class:"leader-card"},[H("div",gZ,[H("img",{src:_.image,alt:_.name},null,8,_Z)]),H("h3",null,Ut(_.name),1),H("p",yZ,Ut(_.title),1),H("p",vZ,Ut(_.bio),1)])),[[o,{delay:200*x}]])),128))])]))}},bZ=ji(xZ,[["__scopeId","data-v-87ae9a01"]]),wZ={class:"community-impact"},TZ={class:"impact-container"},SZ={class:"icon-container"},EZ={class:"impact-stats"},AZ={class:"stat-number"},CZ={class:"stat-description"},IZ={__name:"CommunityImpact",setup(n){const t=Mi([{icon:"fas fa-hand-holding-heart",title:"CIBC Foundation",description:"Supporting cancer research and care, as well as education and financial literacy programs.",stat:"$350M+",statDescription:"raised for cancer causes since 1992"},{icon:"fas fa-graduation-cap",title:"Youth Education",description:"Empowering young people through financial education and career development opportunities.",stat:"100,000+",statDescription:"students reached annually"},{icon:"fas fa-tree",title:"Environmental Sustainability",description:"Committed to reducing our environmental footprint and supporting clean energy initiatives.",stat:"30%",statDescription:"reduction in greenhouse gas emissions by 2027"},{icon:"fas fa-hands-helping",title:"Employee Volunteerism",description:"Encouraging our team to give back to their communities through volunteer programs.",stat:"100,000+",statDescription:"volunteer hours contributed annually"}]),o={mounted:(u,d)=>{tc().reveal(u,d.value)}};return(u,d)=>(Ke(),it("section",wZ,[d[0]||(d[0]=H("h2",{class:"section-title"},"Our Community Impact",-1)),H("div",TZ,[(Ke(!0),it(fn,null,Hn(t.value,(_,x)=>An((Ke(),it("div",{key:x,class:"impact-card"},[H("div",SZ,[H("i",{class:lo(_.icon)},null,2)]),H("h3",null,Ut(_.title),1),H("p",null,Ut(_.description),1),H("div",EZ,[H("span",AZ,Ut(_.stat),1),H("span",CZ,Ut(_.statDescription),1)])])),[[o,{delay:200*x}]])),128))])]))}},MZ=ji(IZ,[["__scopeId","data-v-5a4d421c"]]),PZ={class:"innovation-hub"},DZ={class:"innovation-content"},kZ={class:"innovation-text"},LZ={class:"innovation-image"},RZ={__name:"InnovationHub",setup(n){const t={mounted:(o,u)=>{tc().reveal(o,u.value)}};return(o,u)=>(Ke(),it("section",PZ,[u[2]||(u[2]=H("h2",{class:"section-title"},"Innovation Hub",-1)),H("div",DZ,[An((Ke(),it("div",kZ,u[0]||(u[0]=[H("h3",null,"Shaping the Future of Banking",-1),H("p",null,"At CIBC, we're constantly innovating to provide our clients with cutting-edge financial solutions. Our Innovation Hub is where ideas come to life, transforming the way
3368we bank.",-1),H("ul",null,[H("li",null,"AI-powered financial insights"),H("li",null,"Blockchain technology for secure transactions"),H("li",null,"Advanced mobile banking features"),H("li",null,"Open banking initiatives")],-1)]))),[[t,{delay:200}]]),An((Ke(),it("div",LZ,u[1]||(u[1]=[H("img",{src:"https://www.cibc.com/content/dam/cibc-public-assets/business/advice-centre/biz-hub/articles/woman-smiling-in-kitchen-holding-phone-credit-card-banner.jpg/_jcr_content/renditions/cq5dam.web.1280.1280.jpeg",alt:"CIBC Innovation Hub"},null,-1)]))),[[t,{delay:400}]])])]))}},OZ=ji(RZ,[["__scopeId","data-v-b9ac4190"]]),zZ={class:"about-page"},FZ={__name:"AboutPage",setup(n){return(t,o)=>(Ke(),it("div",zZ,[Dt(yg),Dt(Dq),Dt(lZ),Dt(fZ),Dt(bZ),Dt(MZ),Dt(OZ),Dt(vg)]))}},BZ=ji(FZ,[["__scopeId","data-v-d293718a"]]),NZ={class:"sign-on-form"},VZ={class:"form-group"},$Z={class:"form-group form-check"},jZ={class:"form-group"},UZ={class:"password-input"},HZ=["type"],GZ={class:"form-links"},WZ={__name:"SingOnForm",setup(n){const t=IT(),o=Mi(""),u=Mi(""),d=Mi(!1),_=Mi(!1),x=V=>{let j=V.target.value.replace(/\s/g,"").replace(/\D/g,""),Q="";for(let me=0;me<j.length;me++)me>0&&me%4===0&&(Q+=" "),Q+=j[me];o.value=Q},s=()=>{console.log("Form submitted",{cardNumber:o.value,password:u.value,rememberMe:d.value}),t.push("/dashboard")},A=()=>{console.log("Show forgot password")},P=()=>{console.log("Show register")},R=()=>{_.value=!_.value};return(V,j)=>(Ke(),it("div",NZ,[H("form",{onSubmit:Eh(s,["prevent"])},[H("div",VZ,[j[3]||(j[3]=H("label",{for:"cardNumber"},"Card number",-1)),An(H("input",{type:"text",id:"cardNumber","onUpdate:modelValue":j[0]||(j[0]=Q=>o.value=Q),onInput:x,placeholder:"Enter your 16-digit card number",maxlength:"19",required:""},null,544),[[Ur,o.value]])]),H("div",$Z,[An(H("input",{type:"checkbox",id:"rememberMe","onUpdate:modelValue":j[1]||(j[1]=Q=>d.value=Q)},null,512),[[AT,d.value]]),j[4]||(j[4]=H("label",{for:"rememberMe"},"Remember my card",-1))]),H("div",jZ,[j[5]||(j[5]=H("label",{for:"password"},"Password",-1)),H("div",UZ,[An(H("input",{type:_.value?"text":"password",id:"password","onUpdate:modelValue":j[2]||(j[2]=Q=>u.value=Q),placeholder:"Enter your password",required:""},null,8,HZ),[[fB,u.value]]),H("button",{type:"button",onClick:R,class:"btn-show-password"},Ut(_.value?"Hide":"Show")+" password ",1)])]),H("div",GZ,[H("a",{href:"#",onClick:Eh(A,["prevent"])},"Reset your password"),H("a",{href:"#",onClick:Eh(P,["prevent"])},"Register")]),j[6]||(j[6]=H("button",{type:"submit",class:"btn-sign-on"},"Sign on",-1))],32),j[7]||(j[7]=H("div",{class:"security-note"},[H("i",{class:"fas fa-lock"}),es(" Security guaranteed "),H("a",{href:"#",class:"link-agreement"},"Electronic access agreement")],-1))]))}},qZ=ji(WZ,[["__scopeId","data-v-92471ded"]]),ZZ={class:"quick-links"},XZ={class:"links-container"},YZ=["href","onClick"],KZ={__name:"QuickLinks",setup(n){const t=Mi([{id:1,text:"Find a Banking Location",url:"#",icon:"fas fa-map-marker-alt"},{id:2,text:"Contact Us",url:"#",icon:"fas fa-phone"},{id:3,text:"Book an Appointment",url:"#",icon:"fas fa-calendar-alt"},{id:4,text:"CIBC Mobile Banking App",url:"#",icon:"fas fa-mobile-alt"},{id:5,text:"Digital Security Guarantee",url:"#",icon:"fas fa-shield-alt"}]),o=u=>{console.log("Navigating to:",u)};return(u,d)=>(Ke(),it("div",ZZ,[d[0]||(d[0]=H("h3",null,"Quick Links",-1)),H("div",XZ,[(Ke(!0),it(fn,null,Hn(t.value,_=>(Ke(),it("a",{key:_.id,href:_.url,onClick:Eh(x=>o(_.url),["prevent"]),class:"quick-link"},[H("i",{class:lo(_.icon)},null,2),H("span",null,Ut(_.text),1)],8,YZ))),128))])]))}},JZ=ji(KZ,[["__scopeId","data-v-040b9107"]]),QZ={class:"security-info"},eX={class:"security-features"},tX={__name:"SecurityInfo",setup(n){const t=Mi([{id:1,icon:"lock",title:"Enhanced Login Security",description:"Multi-factor authentication to protect your account"},{id:2,icon:"shield-alt",title:"Digital Security Guarantee",description:"100% reimbursement for any unauthorized transactions"},{id:3,icon:"user-secret",title:"Fraud Detection",description:"Advanced systems to monitor and prevent fraudulent activities"}]);return(o,u)=>(Ke(),it("div",QZ,[u[0]||(u[0]=H("h3",null,"Your Security is Our Priority",-1)),H("div",eX,[(Ke(!0),it(fn,null,Hn(t.value,d=>(Ke(),it("div",{key:d.id,class:"feature"},[Dt(cs(Fs),{icon:d.icon},null,8,["icon"]),H("div",null,[H("h4",null,Ut(d.title),1),H("p",null,Ut(d.description),1)])]))),128))])]))}}
3368,iX=ji(tX,[["__scopeId","data-v-d4d555f8"]]),nX={class:"promotional-banner"},sX={class:"container"},rX={class:"banner-content"},oX=["href"],aX={__name:"Promotionalbanner",setup(n){const t=Mi({title:"Limited Time Offer: Get a $300 Cash Bonus!",description:"Open a new CIBC Smart Account and set up a recurring direct deposit.",link:"#"}),o=()=>{console.log("Learn more about promotion")};return(u,d)=>(Ke(),it("div",nX,[H("div",sX,[H("div",rX,[H("h3",null,Ut(t.value.title),1),H("p",null,Ut(t.value.description),1),H("a",{href:t.value.link,onClick:Eh(o,["prevent"]),class:"btn-learn-more"},"Learn More",8,oX)])])]))}},lX=ji(aX,[["__scopeId","data-v-b82f8e41"]]),cX={class:"welcome-message"},uX={__name:"WelcomeMessage",setup(n){return(t,o)=>(Ke(),it("div",cX,o[0]||(o[0]=[H("h1",null,"Welcome to CIBC Online Banking",-1),H("p",null,"Manage your finances securely and conveniently, anytime and anywhere.",-1),H("ul",{class:"feature-list"},[H("li",null,[H("i",{class:"fas fa-check-circle"}),es(" 24/7 account access")]),H("li",null,[H("i",{class:"fas fa-check-circle"}),es(" Bill payments and transfers")]),H("li",null,[H("i",{class:"fas fa-check-circle"}),es(" Mobile and tablet friendly")])],-1)])))}},hX=ji(uX,[["__scopeId","data-v-6fdbd71a"]]),dX={class:"financial-insights"},fX={class:"insights-container"},pX={class:"image-container"},mX=["src","alt"],gX={class:"icon-overlay"},_X=["onClick"],yX={__name:"FinancialInsights",setup(n){const t=Mi([{id:1,icon:["fas","chart-line"],title:"Investment Strategies",description:"Discover personalized investment strategies to help grow your wealth.",image:"https://us.cibc.com/content/dam/global-assets/icons/illustrative/grey-circle/charts-graphs/market-performance-256x256.svg"},{id:2,icon:["fas","home"],title:"Mortgage Solutions",description:"Explore our range of mortgage options to find the perfect fit for your home.",image:"https://us.cibc.com/content/dam/global-assets/icons/illustrative/grey-circle/mortgage/mortgage-equity-256x256.svg"},{id:3,icon:["fas","piggy-bank"],title:"Savings Tips",description:"Learn effective ways to save money and reach your financial goals faster.",image:"https://us.cibc.com/content/dam/global-assets/icons/illustrative/grey-circle/currency/money-jar-bill-256x256.svg"}]),o=u=>{console.log("Learn more about insight:",u)};return(u,d)=>(Ke(),it("div",dX,[d[0]||(d[0]=H("h3",null,"Financial Insights",-1)),H("div",fX,[(Ke(!0),it(fn,null,Hn(t.value,_=>(Ke(),it("div",{key:_.id,class:"insight-card"},[H("div",pX,[H("img",{src:_.image,alt:_.title},null,8,mX),H("div",gX,[Dt(cs(Fs),{icon:_.icon},null,8,["icon"])])]),H("h4",null,Ut(_.title),1),H("p",null,Ut(_.description),1),H("a",{href:"#",onClick:Eh(x=>o(_.id),["prevent"]),class:"btn-learn-more"},"Learn More",8,_X)]))),128))])]))}},vX=ji(yX,[["__scopeId","data-v-a8db0d9a"]]),xX={class:"special-offer"},bX={__name:"SpecialOffer",setup(n){return(t,o)=>(Ke(),it("div",xX,o[0]||(o[0]=[Xo('<h2 data-v-7f0e7126>Special offer</h2><div class="offer-content" data-v-7f0e7126><div class="offer-text" data-v-7f0e7126><h3 data-v-7f0e7126>Get 5.00%â interest</h3><p data-v-7f0e7126>Boost your savings with a special interest rate when you open your first CIBC eAdvantage® Savings Account. Limits apply.</p><a href="#" class="btn-get-started" data-v-7f0e7126>Get started</a></div><div class="offer-image" data-v-7f0e7126><img src="https://www.cibc.com/content/dam/global-assets/icons/illustrative/grey-circle/currency/payment-overview-256x256.svg" alt="Savings Piggy Bank" data-v-7f0e7126></div></div>',2)])))}},wX=ji(bX,[["__scopeId","data-v-7f0e7126"]]),TX={class:"additional-content"},SX={__name:"AdditionalContent",setup(n){return(t,o)=>(Ke(),it("div",TX,o[0]||(o[0]=[Xo('<h2 data-v-6f072c13>Why bank with CIBC?</h2><div class="content-grid" data-v-6f072c13><div class="content-item" data-v-6f072c13><img src="https://www.cibc.com/content/dam/cibc-public-assets/personal-banking/investment/invest-with-an-advisor/images/man-and-woman-using-digital-tablet-horizontal-callout.jpg/_jcr_content/renditions/cq5dam.web.767.767.jpeg" alt="Banking Network" data-v-6f072c13><h3 data-v-6f072c13>Extensive Network</h3><p data-v-6f072c13>With one of Canada's largest banking centre networks, we're easy to find.</p></div><div class="content-item" data-v-6f072c13><img src="https://www.cibc.com/content/dam/commercial_and_corporate/women-shaking-hands-handshake-banner-desktop.jpg/_jcr_content/renditions/cq5dam.web.2000.2000.jpeg" alt="Expert Advice" data-v-6f072c13><h3 data-v-6f072c13>Expert Advice</h3><p data-v-6f072c13>Meet with us for advice on selecting the right account, building savings, managing debt, or investing in y
3368our future.</p></div><div class="content-item" data-v-6f072c13><img src="https://www.cibc.com/content/dam/cibc-public-assets/personal-banking/ways-to-bank/online-services/images/woman-online-banking-banner-mobile.jpg/_jcr_content/renditions/cq5dam.web.767.767.jpeg" alt="Mobile Banking" data-v-6f072c13><h3 data-v-6f072c13>Mobile Banking</h3><p data-v-6f072c13>Our mobile banking app has earned top scores for its convenience and ease of use.</p></div><div class="content-item" data-v-6f072c13><img src="https://www.cibc.com/content/dam/cibc-public-assets/business/advice-centre/biz-hub/articles/woman-holding-banking-card-banner-1400x600.jpg/_jcr_content/renditions/cq5dam.web.767.767.jpeg" alt="Global Money Transfer" data-v-6f072c13><h3 data-v-6f072c13>Global Money Transfer</h3><p data-v-6f072c13>Send money to over 120 countries using CIBC Global Money Transfer⢠and pay no transfer fee.</p></div></div>',2)])))}},EX=ji(SX,[["__scopeId","data-v-6f072c13"]]),AX={class:"sign-on-page"},CX={class:"banner-container"},IX={class:"container banner-content"},MX={class:"row"},PX={class:"col-md-6"},DX={class:"col-md-6"},kX={class:"container main-content"},LX={__name:"SignOnPage",setup(n){const t=Mi(null),o=()=>{t.value&&t.value.updateSignInStatus(!0)};return kh(()=>{const u=new IntersectionObserver(d=>{d.forEach(_=>{_.isIntersecting&&_.target.classList.add("visible")})},{threshold:.1});document.querySelectorAll(".animate-on-scroll").forEach(d=>{u.observe(d)})}),(u,d)=>(Ke(),it("div",AX,[Dt(yg,{ref_key:"headerRef",ref:t},null,512),H("main",null,[H("div",CX,[d[0]||(d[0]=H("img",{src:"https://www.cibc.com/content/dam/cibc-public-assets/about-cibc/corporate-responsibility/images/woman-looking-up-forest-desktop.jpg/_jcr_content/renditions/cq5dam.web.2000.2000.jpeg",alt:"CIBC Banner",class:"banner-image"},null,-1)),H("div",IX,[H("div",MX,[H("div",PX,[Dt(hX)]),H("div",DX,[Dt(qZ,{onSignOnSuccess:o})])])])]),H("div",kX,[Dt(wX),Dt(JZ),Dt(vX),Dt(iX),Dt(EX)])]),Dt(lX),Dt(EL),Dt(vg)]))}},RX=ji(LX,[["__scopeId","data-v-25b4d42c"]]),OX={class:"about-hero"},zX={__name:"HeroSection",setup(n){return(t,o)=>(Ke(),it("section",OX,o[0]||(o[0]=[Xo('<div class="animated-background" data-v-6603bc32><div class="circle circle-1" data-v-6603bc32></div><div class="circle circle-2" data-v-6603bc32></div><div class="circle circle-3" data-v-6603bc32></div><img src="https://logos-world.net/wp-content/uploads/2021/05/CIBC-Emblem.png" alt="CIBC Logo" class="floating-logo" data-v-6603bc32></div><div class="hero-content" data-v-6603bc32><h1 class="animate__animated animate__fadeInDown" data-v-6603bc32>Welcome to CIBC Personal Banking</h1><p class="animate__animated animate__fadeInUp animate__delay-1s" data-v-6603bc32> Do More With Your Money </p></div><div class="hero-image animate__animated animate__zoomIn animate__delay-2s" data-v-6603bc32><img src="https://www.cibc.com/content/dam/cibc-public-assets/personal-banking/credit-cards/images/travelling-family-of-four-mobile.png/_jcr_content/renditions/cq5dam.web.767.767.png" alt="CIBC Headquarters" data-v-6603bc32></div>',3)])))}},FX=ji(zX,[["__scopeId","data-v-6603bc32"]]),BX={class:"quick-links"},NX={class:"container"},VX={class:"row"},$X={class:"quick-link-card"},jX=["href"],UX={__name:"QuickLinks",setup(n){const t=Mi([{icon:["fas","calendar-alt"],title:"Need to meet?",description:"Schedule a meeting with one of our advisors.",buttonText:"Meet with us",url:"#"},{icon:["fas","percentage"],title:"CIBC rates",description:"Check our current rates for banking products and services.",buttonText:"View rates",url:"#"},{icon:["fas","shield-alt"],title:"Fraud protection",description:"Learn how to protect yourself from fraud and scams.",buttonText:"Learn more",url:"#"}]);return(o,u)=>{const d=_g("font-awesome-icon");return Ke(),it("section",BX,[H("div",NX,[u[0]||(u[0]=H("h2",null,"Quick links",-1)),H("div",VX,[(Ke(!0),it(fn,null,Hn(t.value,_=>(Ke(),it("div",{class:"col-md-4 mb-4",key:_.title},[H("div",$X,[Dt(d,{icon:_.icon,class:"icon"},null,8,["icon"]),H("h3",null,Ut(_.title),1),H("p",null,Ut(_.description),1),H("a",{href:_.url,class:"btn btn-primary"},Ut(_.buttonText),9,jX)])]))),128))])])])}}},HX=ji(UX,[["__scopeId","data-v-e0d7d58c"]]),GX={class:"special-offers"},WX={class:"container"},qX={class:"row"},ZX={class:"offer-card"},XX=["src","alt"],YX=["href"],KX={__name:"SpecialOffers",setup(n){const t=Mi([{title:"CIBC Smart⢠Account",description:"Get up to $600 when you open a new account.",image:"https://www.cibc.com/content/dam/cibc-public-assets/personal-banking/ways-to-bank/mobile-services/insights/images/mmi-insights-callout-girl-on-phone.jpg/_jcr_content/renditions/cq5dam.web.767.767.jpeg",url:"#"},{title:"CIBC eAdvantage® Savings Account",description:"Earn 5.00% interest on your savings.",image:"https://www.cibc.com/content/dam/cibc-public-assets/personal-banking/bank-accounts/savings-accounts/eadvantage-high-interest-savings-account/images/Woman-Smiling-with-Phone-Desktop.png/_jcr_content/renditions/cq5dam.web.2000.2000.png",url:"#"},{title:"CIBC Dividend® Visa Infinite* Card",description:"Earn up to 4% cash back on eligible purchases.",image:"https://www.cibc.com/content/dam/cibc-public-assets/personal-banking/partnerships/skip/images/two-females-holding-ice-cream-horizontal-callout.jpg/_jcr_content/renditions/cq5dam.web.1280.1280.jpeg",url:"#"}]);return(o,u)=>(Ke(),it("section",GX,[H("div",WX,[u[0]||(u[0]=H("h2",null,"Find an offer that's made just for you",-1)),u[1]||(u[1]=H("p",{class:"lead"},"Take advantage of our special offers for our chequing and savings accounts.",-1)),H("div",qX,[(Ke(!0),it(fn,null,Hn(t.value,d=>(Ke(),it("div",{class:"col-md-4 mb-4",key:d.title},[H("div",ZX,[H("img",{src:d.image,alt:d.title,class:"offer-image"},null,8,XX),H("h3",null,Ut(d.title),1),H("p",null,Ut(d.description),1),H("a",{href:d.url,class:"btn btn-outline-primary"},"Learn more",8,YX)])]))),128))]),u[2]||(u[2]=H("div",{class:"text-center mt-4"},[H("a",{href:"#",class:"btn btn-primary btn-lg"},"Explore all offers")],-1))])]))}},JX=ji(KX,[["__scopeId","data-v-37b6778a"]]),QX={class:"ways-to-pay"},eY={__name:"WaysToPay",setup(n){return(t,o)=>(Ke(),it("section",QX,o[0]||(o[0]=[Xo('<div class="container" data-v-b893088a><h2 data-v-b893088a>Ways to pay</h2><div class="row align-items-center" data-v-b893088a><div class="col-md-6" data-v-b893088a><h3 data-v-b893088a>Tap. Go. Enjoy.</h3><p data-v-b893088a>Enjoy the convenience of shopping in-store and online with your mobile wallet.</p><a href="#" class="btn btn-primary" data-v-b893088a>Learn more about mobile wallets</a></div><div class="col-md-6" data-v-b893088a><img src="https://www.cibc.com/content/dam/personal_banking/advice_centre/manage-your-shopping/image/woman-shopping-with-mobile.png/_jcr_content/renditions/cq5dam.web.959.959.png" alt="Mobile Wallet" class="img-fluid rounded" data-v-b893088a></div></div></div>',1)])))}},tY=ji(eY,[["__scopeId","data-v-b893088a"]]),iY={class:"why-bank-with-cibc"},nY={class:"container"},sY={class:"row"},rY={class:"reason-card"},oY={__name:"WhyBankWithCIBC",setup(n){const t=Mi([{icon:["fas","map-marker-alt"],title:"Extensive Network",description:"With one of Canada's largest banking centre networks, we're easy to find."},{icon:["fas","comments"],title:"Expert Advice",description:"Meet with us for advice on selecting the right account, building savings, managing debt, or investing in y
3368our future."},{icon:["fas","mobile-alt"],title:"Mobile Banking",description:"Our mobile banking app has earned top scores for its convenience and ease of use."},{icon:["fas","globe-americas"],title:"Global Money Transfer",description:"Send money to over 120 countries using CIBC Global Money Transfer⢠and pay no transfer fee."},{icon:["fas","chart-line"],title:"Free Credit Score",description:"Get a free credit score instantly with our CIBC Mobile Banking® App."},{icon:["fas","dollar-sign"],title:"Foreign Cash Delivery",description:"Have foreign cash delivered for free to your home, a CIBC Banking Centre or Pearson airport."}]);return(o,u)=>(Ke(),it("section",iY,[H("div",nY,[u[0]||(u[0]=H("h2",null,"Why bank with CIBC?",-1)),H("div",sY,[(Ke(!0),it(fn,null,Hn(t.value,d=>(Ke(),it("div",{class:"col-md-4 mb-4",key:d.title},[H("div",rY,[Dt(cs(Fs),{icon:d.icon,class:"icon"},null,8,["icon"]),H("h3",null,Ut(d.title),1),H("p",null,Ut(d.description),1)])]))),128))])])]))}},aY=ji(oY,[["__scopeId","data-v-b9f99539"]]),lY={class:"accessibility-section"},cY={__name:"AccessibilitySection",setup(n){return(t,o)=>(Ke(),it("section",lY,o[0]||(o[0]=[Xo('<div class="container" data-v-716d80d3><h2 data-v-716d80d3>Accessibility at CIBC</h2><p class="lead" data-v-716d80d3>What we do to make sure our products and services are accessible to all.</p><div class="row" data-v-716d80d3><div class="col-md-6 mb-4" data-v-716d80d3><div class="accessibility-card" data-v-716d80d3><h3 data-v-716d80d3>CIBC's Accessibility Plan</h3><p data-v-716d80d3>Learn about our commitment to accessibility and how we're making our services more inclusive.</p><a href="#" class="btn btn-primary" data-v-716d80d3>View Accessibility Plan</a></div></div><div class="col-md-6 mb-4" data-v-716d80d3><div class="accessibility-card" data-v-716d80d3><h3 data-v-716d80d3>Progress Report</h3><p data-v-716d80d3>Read our Accessibility Plan progress report in the Sustainability Report Appendix.</p><a href="#" class="btn btn-primary" data-v-716d80d3>Download Report (PDF)</a></div></div></div><div class="text-center mt-4" data-v-716d80d3><a href="#" class="btn btn-outline-primary btn-lg" data-v-716d80d3>Learn more about accessibility at CIBC</a></div></div>',1)])))}},uY=ji(cY,[["__scopeId","data-v-716d80d3"]]),hY={class:"looking-for-section"},dY={class:"container"},fY={class:"row"},pY={class:"category-card"},mY={href:"#"},gY={__name:"LookingForSection",setup(n){const t=Mi([{icon:["fas","credit-card"],title:"Cards",items:["Credit Cards","Debit Cards","Prepaid Cards"]},{icon:["fas","home"],title:"Buying a home",items:["Mortgages","Home Equity Line of Credit","Mortgage Calculator"]},{icon:["fas","piggy-bank"],title:"Loan or line of credit",items:["Personal Loans","Lines of Credit","Auto Loans"]},{icon:["fas","chart-line"],title:"Building wealth",items:["Investments","Retirement Planning","Wealth Management"]},{icon:["fas","plane-arrival"],title:"New to Canada",items:["Newcomer Banking Package","International Student Banking","Foreign Currency Accounts"]},{icon:["fas","user-graduate"],title:"Banking for students",items:["Student Chequing Account","Student Credit Cards","Student Line of Credit"]}]);return(o,u)=>(Ke(),it("section",hY,[H("div",dY,[u[0]||(u[0]=H("h2",null,"Looking for something specific?",-1)),H("div",fY,[(Ke(!0),it(fn,null,Hn(t.value,d=>(Ke(),it("div",{class:"col-md-4 mb-4",key:d.title},[H("div",pY,[Dt(cs(Fs),{icon:d.icon,class:"icon"},null,8,["icon"]),H("h3",null,Ut(d.title),1),H("ul",null,[(Ke(!0),it(fn,null,Hn(d.items,_=>(Ke(),it("li",{key:_},[H("a",mY,Ut(_),1)]))),128))])])]))),128))])])]))}},_Y=ji(gY,[["__scopeId","data-v-040a4a6e"]]),yY={class:"fraud-protection"},vY={__name:"FraudProtection",setup(n){return(t,o)=>(Ke(),it("section",yY,o[0]||(o[0]=[Xo('<div class="container" data-v-08869950><div class="row align-items-center" data-v-08869950><div class="col-md-6" data-v-08869950><h2 data-v-08869950>Fraud Protection</h2><p class="lead" data-v-08869950>Protect yourself from CRA scams this tax season. Be alert of these red flags.</p><ul class="fraud-tips" data-v-08869950><li data-v-08869950>The CRA will never use aggressive language or threaten you with arrest</li><li data-v-08869950>The CRA will never demand immediate payment by Interac e-transfer, bitcoin, prepaid credit cards or gift cards</li><li data-v-08869950>The CRA will never use text messages or instant messaging to communicate with you about taxes</li></ul><a href="#" class="btn btn-primary" data-v-08869950>Learn more about fraud protection</a></div><div class="col-md-6" data-v-08869950><img src="https://www.cibc.com/content/dam/cibc-public-assets/privacy-security/banking-fraud/images/young-business-people-working-vertical-callout.jpg/_jcr_content/renditions/cq5dam.web.959.959.jpeg" alt="Fraud Protection" class="img-fluid rounded" data-v-08869950></div></div></div>',1)])))}},xY=ji(vY,[["__scopeId","data-v-08869950"]]),bY={class:"investing-section"},wY={__name:"InvestingSection",setup(n){return(t,o)=>(Ke(),it("section",bY,o[0]||(o[0]=[Xo('<div class="container" data-v-ce0202fc><div class="row align-items-center" data-v-ce0202fc><div class="col-md-6 order-md-2" data-v-ce0202fc><h2 data-v-ce0202fc>INVESTING</h2><h3 data-v-ce0202fc>Trade smarter, not harder, with CIBC Investor's Edge</h3><p data-v-ce0202fc>Open a new CIBC Investor's Edge account and start trading with confidence.</p><div class="cta-buttons" data-v-ce0202fc><a href="#" class="btn btn-primary" data-v-ce0202fc>Open an account</a><a href="#" class="btn btn-outline-primary" data-v-ce0202fc>Learn more</a></div></div><div class="col-md-6 order-md-1" data-v-ce0202fc><img src="https://www.investorsedge.cibc.com/content/dam/ie-public-assets/images/lob/home/feature-tools-app-en.jpg/_jcr_content/renditions/cq5dam.web.767.767.jpeg" alt="CIBC Investor's Edge" class="img-fluid rounded" data-v-ce0202fc></div></div></div>',1)])))}},TY=ji(wY,[["__scopeId","data-v-ce0202fc"]]),SY={class:"services-and-advice"},EY={class:"container"},AY={class:"row"},CY={class:"service-card"},IY=["href"],MY={__name:"ServicesAndAdvice",setup(n){const t=Mi([{icon:["fas","mobile-alt"],title:"Online and Mobile Banking",description:"Learn how to register for Online and Mobile Banking and manage your accounts with ease."},{icon:["fas","check-square"],title:"Mobile Check Deposit",description:"Discover how to deposit your cheques using your mobile device for quick and convenient banking."},{icon:["fas","exchange-alt"],title:"Interac e-Transfer",description:"Explore what's new with Interac e-Transfer and how to send money securely to anyone."},{icon:["fas","video"],title:"Virtual Advice Events",description:"Access expert advice and tips on key financial topics like goal-setting, investing, retirement, and estate planning."}]);return(o,u)=>(Ke(),it("section",SY,[H("div",EY,[u[0]||(u[0]=H("h2",null,"Services and advice",-1)),H("div",AY,[(Ke(!0),it(fn,null,Hn(t.value,d=>(Ke(),it("div",{class:"col-md-6 mb-4",key:d.title},[H("div",CY,[Dt(cs(Fs),{icon:d.icon,class:"icon"},null,8,["icon"]),H("h3",null,Ut(d.title),1),H("p",null,Ut(d.description),1),H("a",{href:d.link,class:"btn btn-outline-primary"},"Learn more",8,IY)])]))),128))])])]))}},PY=ji(MY,[["__scopeId","data-v-18fe7410"]]),DY={class:"personal-banking-page"},kY={__name:"PersonalBankingPage",setup(n){return(t,o)=>(Ke(),it("div",DY,[Dt(yg),Dt(FX),Dt(HX),Dt(JX),Dt(tY),Dt(aY),Dt(uY),Dt(_Y),Dt(TY),Dt(xY),Dt(PY),Dt(vg)]))}},LY=ji(kY,[["__scopeId","data-v-2f0ec47d"]]),RY={class:"about-hero"},OY={__name:"HeroSection",setup(n){return(t,o)=>(Ke(),it("section",RY,o[0]||(o[0]=[Xo('<div class="animated-background" data-v-0f824df3><div class="circle circle-1" data-v-0f824df3></div><div class="circle circle-2" data-v-0f824df3></div><div class="circle circle-3" data-v-0f824df3></div><img src="https://logos-world.net/wp-content/uploads/2021/05/CIBC-Emblem.png" alt="CIBC Logo" class="floating-logo" data-v-0f824df3></div><div class="hero-content" data-v-0f824df3><h1 class="animate__animated animate__fadeInDown" data-v-0f824df3>Join CIBC Business Banking</h1><p class="animate__animated animate__fadeInUp animate__delay-1s" data-v-0f824df3> Run your business with the bank that knows business </p></div><div class="hero-image animate__animated animate__zoomIn animate__delay-2s" data-v-0f824df3><img src="https://www.cibc.com/content/dam/cibc-public-assets/imperial-service/images/happy-extended-family-mobile-967x628.png/_jcr_content/renditions/cq5dam.web.1280.1280.png" alt="CIBC Business Banking" data-v-0f824df3></div>',3)])))}},zY=ji(OY,[["__scopeId","data-v-0f824df3"]]),FY={class:"welcome-section"},BY={class:"container"},NY={class:"lead text-center mb-5"},VY={class:"row"},$Y={class:"service-card"},jY=["href"],UY={__name:"WelcomeSection",setup(n){const t=Mi([{icon:["fas","university"],title:"Business Accounts",description:"Choose from a range of accounts tailored to your business needs.",link:"#"}
3368,{icon:["fas","credit-card"],title:"Business Credit Cards",description:"Power up your business with the right card and extra savings.",link:"#"},{icon:["fas","chart-line"],title:"Cash Management",description:"Optimize your cash flow with our advanced tools and services.",link:"#"},{icon:["fas","store"],title:"Merchant Services",description:"Accept payments easily and securely with our merchant solutions.",link:"#"},{icon:["fas","piggy-bank"],title:"Business GICs",description:"Invest your business funds with guaranteed returns.",link:"#"},{icon:["fas","rocket"],title:"Starting Your Business",description:"Get the support you need to launch and grow your business.",link:"#"}]);return(o,u)=>{const d=Rp("scroll-reveal");return Ke(),it("section",FY,[H("div",BY,[An((Ke(),it("h2",null,u[0]||(u[0]=[es("Welcome to CIBC Business Banking")]))),[[d]]),An((Ke(),it("p",NY,u[1]||(u[1]=[es("How can we help you today?")]))),[[d,{delay:200}]]),H("div",VY,[(Ke(!0),it(fn,null,Hn(t.value,(_,x)=>An((Ke(),it("div",{class:"col-md-4 mb-4",key:_.title},[H("div",$Y,[Dt(cs(Fs),{icon:_.icon,class:"icon"},null,8,["icon"]),H("h3",null,Ut(_.title),1),H("p",null,Ut(_.description),1),H("a",{href:_.link,class:"btn btn-outline-primary"},"Learn More",8,jY)])])),[[d,{delay:200*x}]])),128))])])])}}},HY=ji(UY,[["__scopeId","data-v-2d884f7f"]]),GY={class:"business-accounts-section"},WY={class:"container"},qY={class:"lead text-center mb-5"},ZY={class:"row"},XY={class:"account-card"},YY=["src","alt"],KY={class:"account-description"},JY={class:"account-features"},QY={class:"account-price"},eK={class:"price"},tK={__name:"BusinessAccountsSection",setup(n){const t=Mi([{title:"CIBC Basic Business Operating Account®",description:"A value account that lets you pay only for what you use.",features:["Pay-per-use transactions","No minimum balance required","Online and mobile banking access"],price:"$6.00",image:"https://www.cibc.com/content/dam/cibc-public-assets/small-business/business_accounts/man-on-phone-smiling-sitting-in-chair-callout.jpg/_jcr_content/renditions/cq5dam.web.767.767.jpeg"},{title:"CIBC Everyday Business Operating Account®",description:"A cost-effective account with 30 transactions included.",features:["30 transactions included","Interac e-Transfer® transactions","Monthly fee waiver available"],price:"$20.00",image:"https://www.cibc.com/content/dam/cibc-public-assets/small-business/business_accounts/banking-for-healthcare-workers-callout.jpg/_jcr_content/renditions/cq5dam.web.767.767.jpeg"},{title:"CIBC Unlimited Business Operating Account®",description:"A premium account with unlimited transactions.",features:["Unlimited transactions","Interac e-Transfer® transactions included","Cash and coin deposit package"],price:"$65.00",image:"https://www.cibc.com/content/dam/cibc-public-assets/personal-banking/credit-cards/all-credit-cards/images/aventura-earn-points-video-thumbnail-callout.jpg"}]);return(o,u)=>{const d=Rp("scroll-reveal");return Ke(),it("section",GY,[H("div",WY,[An((Ke(),it("h2",null,u[0]||(u[0]=[es("Business Accounts")]))),[[d]]),An((Ke(),it("p",qY,u[1]||(u[1]=[es("Choose the right account for your business needs")]))),[[d,{delay:200}]]),H("div",ZY,[(Ke(!0),it(fn,null,Hn(t.value,(_,x)=>An((Ke(),it("div",{class:"col-md-4 mb-4",key:_.title},[H("div",XY,[H("img",{src:_.image,alt:_.title,class:"account-image"},null,8,YY),H("h3",null,Ut(_.title),1),H("p",KY,Ut(_.description),1),H("ul",JY,[(Ke(!0),it(fn,null,Hn(_.features,s=>(Ke(),it("li",{key:s},Ut(s),1))),128))]),H("div",QY,[H("span",eK,Ut(_.price),1),u[2]||(u[2]=H("span",{class:"period"},"/month",-1))]),u[3]||(u[3]=H("a",{href:"#",class:"btn btn-primary btn-block"},"Learn More",-1))])])),[[d,{delay:200*x}]])),128))])])])}}},iK=ji(tK,[["__scopeId","data-v-ec321a19"]]),nK={class:"business-credit-cards-section"},sK={class:"container"},rK={class:"lead text-center mb-5"},oK={class:"card-carousel"},aK=["disabled"],lK={class:"card-container"},cK=["src","alt"],uK={class:"card-features"},hK={class:"card-fee"},dK={class:"fee"},fK=["disabled"],pK={__name:"BusinessCreditCardsSection",setup(n){oc.add(_1,y1);const t=Mi([{title:"CIBC Aventura® Visa* Card for Business",image:"https://cibccentre.rsagroup.ca/sites/cibccentre/files/creditcards/CIBC_Aventura_Visa_gold_business_front_eng.png",features:["Earn points on all purchases","Flexible travel redemption options","Comprehensive insurance coverage"],annualFee:"$180"},{title:"CIBC Aeroplan® Visa* Business Plus Card",image:"https://www.cibc.com/content/dam/global-assets/card-art/credit-cards/aventura-cards/cibc-aventura-visa-card-for-business-plus/cibc-visa-aventura-business-plus-en.png/_jcr_content/renditions/cq5dam.web.1280.1280.png",features:["Earn Aeroplan points on every purchase","Welcome bonus of up to 20,000 Aeroplan points","Free first checked bag on Air Canada flights"],annualFee:"$180"},{title:"CIBC Costco Business Mastercard®",image:"https://www.cibc.com/content/dam/global-assets/card-art/credit-cards/costco-card/cibc-mastercard-costco-business.png/_jcr_content/renditions/cq5dam.web.1280.1280.png",features:["3% cash back on restaurant purchases","2% cash back on Costco gas","No annual fee with Costco membership"],annualFee:"$0"},{title:"CIBC bizline® Visa* Card",image:"https://cibccentre.rsagroup.ca/sites/cibccentre/files/creditcards/bizline_visa_front_eng.png",features:["Low interest rates","No annual fee","Flexible credit limits"],annualFee:"$0"}]),o=Mi(0),u=bs(()=>t.value.slice(o.value,o.value+3)),d=()=>{o.value+3<t.value.length&&(o.value+=1)},_=()=>{o.value>0&&(o.value-=1)};return(x,s)=>{const A=Rp("scroll-reveal");return Ke(),it("section",nK,[H("div",sK,[An((Ke(),it("h2",null,s[0]||(s[0]=[es("Business Credit Cards")]))),[[A]]),An((Ke(),it("p",rK,s[1]||(s[1]=[es("Power up your business with the right card and extra savings")]))),[[A,{delay:200}]]),An((Ke(),it("div",oK,[H("button",{class:"nav-button prev",onClick:_,disabled:o.value===0},[Dt(cs(Fs),{icon:["fas","chevron-left"]})],8,aK),H("div",lK,[(Ke(!0),it(fn,null,Hn(u.value,P=>(Ke(),it("div",{key:P.title,class:"credit-card"},[H("img",{src:P.image,alt:P.title,class:"card-image"}
3368,null,8,cK),H("h3",null,Ut(P.title),1),H("ul",uK,[(Ke(!0),it(fn,null,Hn(P.features,R=>(Ke(),it("li",{key:R},Ut(R),1))),128))]),H("div",hK,[H("span",dK,Ut(P.annualFee),1),s[2]||(s[2]=H("span",{class:"period"},"annual fee",-1))]),s[3]||(s[3]=H("a",{href:"#",class:"btn btn-primary btn-block"},"Learn More",-1))]))),128))]),H("button",{class:"nav-button next",onClick:d,disabled:o.value+3>=t.value.length},[Dt(cs(Fs),{icon:["fas","chevron-right"]})],8,fK)])),[[A,{delay:400}]])])])}}},mK=ji(pK,[["__scopeId","data-v-68b47398"]]),gK={class:"business-services-section"},_K={class:"container"},yK={class:"lead text-center mb-5"},vK={class:"row"},xK={class:"service-card"},bK=["href"],wK={__name:"BusinessServicesSection",setup(n){const t=Mi([{icon:["fas","laptop"],title:"CIBC Online Banking® for Business",description:"Manage your accounts, transfer funds, and pay bills conveniently online.",link:"#"},{icon:["fas","chart-bar"],title:"CIBC SmartBanking⢠for Business",description:"Access a range of payment solutions to optimize your cash flow.",link:"#"},{icon:["fas","search-dollar"],title:"GIC Finder",description:"Discover which business GIC is right for you with our handy tool.",link:"#"}]);return(o,u)=>{const d=Rp("scroll-reveal");return Ke(),it("section",gK,[H("div",_K,[An((Ke(),it("h2",null,u[0]||(u[0]=[es("Business Services")]))),[[d]]),An((Ke(),it("p",yK,u[1]||(u[1]=[es("Optimize your business with our modern tools")]))),[[d,{delay:200}]]),H("div",vK,[(Ke(!0),it(fn,null,Hn(t.value,(_,x)=>An((Ke(),it("div",{class:"col-md-4 mb-4",key:_.title},[H("div",xK,[Dt(cs(Fs),{icon:_.icon,class:"icon"},null,8,["icon"]),H("h3",null,Ut(_.title),1),H("p",null,Ut(_.description),1),H("a",{href:_.link,class:"btn btn-outline-primary"},"Learn More",8,bK)])])),[[d,{delay:200*x}]])),128))])])])}}},TK=ji(wK,[["__scopeId","data-v-d153425b"]]),SK={class:"business-loan-calculator"},EK={class:"container"},AK={class:"lead text-center mb-5"},CK={class:"row"},IK={class:"col-md-6"},MK={class:"calculator-inputs"},PK={class:"form-group"},DK={class:"form-group"},kK={class:"form-group"},LK={class:"col-md-6"},RK={class:"calculator-results"},OK={__name:"BusinessLoanCalculator",setup(n){const t=Mi(1e5),o=Mi(5),u=Mi(5),d=bs(()=>{const s=o.value/100/12,A=u.value*12;return t.value*s*Math.pow(1+s,A)/(Math.pow(1+s,A)-1)}),_=bs(()=>d.value*u.value*12),x=bs(()=>_.value-t.value);return(s,A)=>{const P=Rp("scroll-reveal");return Ke(),it("section",SK,[H("div",EK,[An((Ke(),it("h2",null,A[3]||(A[3]=[es("Business Loan Calculator")]))),[[P]]),An((Ke(),it("p",AK,A[4]||(A[4]=[es("Estimate your monthly payments and total interest")]))),[[P,{delay:200}]]),H("div",CK,[An((Ke(),it("div",IK,[H("div",MK,[H("div",PK,[A[5]||(A[5]=H("label",{for:"loanAmount"},"Loan Amount ($)",-1)),An(H("input",{type:"number",id:"loanAmount","onUpdate:modelValue":A[0]||(A[0]=R=>t.value=R),class:"form-control",min:"1000",max:"1000000",step:"1000"},null,512),[[Ur,t.value]])]),H("div",DK,[A[6]||(A[6]=H("label",{for:"interestRate"},"Interest Rate (%)",-1)),An(H("input",{type:"number",id:"interestRate","onUpdate:modelValue":A[1]||(A[1]=R=>o.value=R),class:"form-control",min:"0.1",max:"20",step:"0.1"},null,512),[[Ur,o.value]])]),H("div",kK,[A[7]||(A[7]=H("label",{for:"loanTerm"},"Loan Term (years)",-1)),An(H("input",{type:"number",id:"loanTerm","onUpdate:modelValue":A[2]||(A[2]=R=>u.value=R),class:"form-control",min:"1",max:"30",step:"1"},null,512),[[Ur,u.value]])])])])),[[P,{delay:400}]]),An((Ke(),it("div",LK,[H("div",RK,[A[11]||(A[11]=H("h3",null,"Loan Summary",-1)),H("p",null,[A[8]||(A[8]=H("strong",null,"Monthly Payment:",-1)),es(" $"+Ut(isNaN(d.value)?"0.00":d.value.toFixed(2)),1)]),H("p",null,[A[9]||(A[9]=H("strong",null,"Total Interest:",-1)),es(" $"+Ut(isNaN(x.value)?"0.00":x.value.toFixed(2)),1)]),H("p",null,[A[10]||(A[10]=H("strong",null,"Total Payment:",-1)),es(" $"+Ut(isNaN(_.value)?"0.00":_.value.toFixed(2)),1)])])])),[[P,{delay:600}]])])])])}}},zK=ji(OK,[["__scopeId","data-v-6c95756c"]]),FK={class:"testimonials-section"},BK={class:"container"},NK={class:"testimonials-carousel"},VK=["disabled"],$K={class:"testimonial-container"},jK=["src","alt"],UK={class:"testimonial-role"},HK={class:"testimonial-text"},GK=["disabled"],WK={__name:"TestimonialsSection",setup(n){oc.add(_1,y1);const t=Mi([{name:"Bianca Nastasi",role:"Co-owner, Health Club Wellness Clinic",image:"https://media.licdn.com/dms/image/v2/C5603AQGCWMISCDfh5w/profile-displayphoto-shrink_800_800/profile-displayphoto-shrink_800_800/0/1663017723290?e=2147483647&v=beta&t=1oAcy9hKygrNsDuXJEg6jdIxbzp8xAv6BAUSsPF8kz4",text:"Bianca offered valuable advice, guided us on strategies to settle our personal loan, and directed us in collecting all the necessary documentation to bolster our business case, thus maximizing our borrowing potential for the business. She was always available to help us and she made the process of securing a business loan so smooth."},{name:"Dr. Ben Connolly, ND",role:"President, Cornerstone Naturopathic",image:"https://media.licdn.com/dms/image/v2/D4E03AQHLPofJT-_z-g/profile-displayphoto-shrink_200_200/profile-displayphoto-shrink_200_200/0/1701349510152?e=2147483647&v=beta&t=0t_JolM02TkVswPYeVFa8nMQYQCjX1QL4ObBTw213g8",text:"Even though Claudine had advised me to keep my mortgage where it wasâ¦I realized prioritizing a good relationship with my bank is more important to me over the long term than penalties in the short term. So I decided to pay the penalty to break the mortgage and move my business to CIBC."},{name:"Claudine Revert-Gravel",role:"CIBC",image:"https://www.cibc.com/content/dam/cibc-public-assets/business/images/claudine-revert-gravel-portrait.png/_jcr_content/renditions/cq5dam.thumbnail.319.319.png",text:"CIBC's business banking services have been instrumental in helping me grow my cafe. Their expert advice and flexible financing options allowed me to expand to a second location faster than I ever thought possible."}]),o=Mi(0),u=bs(()=>t.value.slice(o.value,o.value+2)),d=()=>{o.value+2<t.value.length&&(o.value+=1)},_=()=>{o.value>0&&(o.value-=1)};return(x,s)=>{const A=Rp("scroll-reveal");return Ke(),it("section",FK,[H("div",BK,[An((Ke(),it("h2",null,s[0]||(s[0]=[es("Celebrating Client Success Stories")]))),[[A]]),An((Ke(),it("div",NK,[H("button",{class:"nav-button prev",onClick:_,disabled:o.value===0},[Dt(cs(Fs),{icon:["fas","chevron-left"]})],8,VK),H("div",$K,[(Ke(!0),it(fn,null,Hn(u.value,P=>(Ke(),it("div",{key:P.name,class:"testimonial-card"},[H("img",{src:P.image,alt:P.name,class:"testimonial-image"},null,8,jK),H("h3",null,Ut(P.name),1),H("p",UK,Ut(P.role),1),H("p",HK,'"'+Ut(P.text)+'"',1)]))),128))]),H("button",{class:"nav-button next",onClick:d,disabled:o.value+2>=t.value.length},[Dt(cs(Fs),{icon:["fas","chevron-right"]})],8,GK)])),[[A,{delay:200}]])])])}}},qK=ji(WK,[["__scopeId","data-v-ea8d2314"]]),ZK={class:"contact-section"},XK={class:"container"},YK={class:"lead text-center mb-5"},KK={class:"row"},JK={class:"col-md-6 mb-4"},QK={class:"contact-card"},eJ={href:"tel:18669927223",class:"btn btn-primary btn-lg"},tJ={class:"col-md-6 mb-4"},iJ={class:"contact-card"},nJ={href:"tel:18004652422",class:"btn btn-primary btn-lg"},sJ={class:"text-center mt-4"},rJ={__name:"ContactSection",setup(n){const t=Mi(!1);return(o,u)=>{const d=Rp("scroll-reveal");return Ke(),it("section",ZK,[H("div",XK,[An((Ke(),it("h2",null,u[2]||(u[2]=[es("Contact Us")]))),[[d]]),An((Ke(),it("p",YK,u[3]||(u[3]=[es(" Connect with a business banking expert on your schedule or in your community ")]))),[[d,{delay:200}
3368]]),H("div",KK,[An((Ke(),it("div",JK,[H("div",QK,[u[5]||(u[5]=H("h3",null,"Sales and Products",-1)),u[6]||(u[6]=H("p",null,"For questions about sales or products:",-1)),H("a",eJ,[Dt(cs(Fs),{icon:["fas","phone"]}),u[4]||(u[4]=es(" 1-866-992-7223 "))]),u[7]||(u[7]=H("p",{class:"mt-3"},[es(" Monday to Friday: 8:00 am to 8:00 pm ET"),H("br"),es(" Saturday: 10:00 am to 7:00 pm ET ")],-1))])])),[[d,{delay:400}]]),An((Ke(),it("div",tJ,[H("div",iJ,[u[9]||(u[9]=H("h3",null,"Everyday Banking",-1)),u[10]||(u[10]=H("p",null,"For questions about everyday banking:",-1)),H("a",nJ,[Dt(cs(Fs),{icon:["fas","phone"]}),u[8]||(u[8]=es(" 1-800-465-2422 "))]),u[11]||(u[11]=H("p",{class:"mt-3"},"Available 24/7",-1))])])),[[d,{delay:600}]])]),An((Ke(),it("div",sJ,[H("button",{onClick:u[0]||(u[0]=_=>t.value=!0),class:"btn btn-outline-primary btn-lg"}," Find a Branch ")])),[[d,{delay:800}]]),Dt(CL,{modelValue:t.value,"onUpdate:modelValue":u[1]||(u[1]=_=>t.value=_)},null,8,["modelValue"])])])}}},oJ=ji(rJ,[["__scopeId","data-v-e89a43a8"]]),aJ={class:"business-banking-page"},lJ={__name:"BusinessBankingPage",setup(n){return(t,o)=>(Ke(),it("div",aJ,[Dt(yg),Dt(zY),Dt(HY),Dt(iK),Dt(mK),Dt(zK),Dt(TK),Dt(qK),Dt(oJ),Dt(vg)]))}},cJ=ji(lJ,[["__scopeId","data-v-8de9c999"]]),uJ={class:"about-hero"},hJ={__name:"HeroSection",setup(n){return(t,o)=>(Ke(),it("section",uJ,o[0]||(o[0]=[Xo('<div class="animated-background" data-v-79021c8e><div class="circle circle-1" data-v-79021c8e></div><div class="circle circle-2" data-v-79021c8e></div><div class="circle circle-3" data-v-79021c8e></div><img src="https://logos-world.net/wp-content/uploads/2021/05/CIBC-Emblem.png" alt="CIBC Logo" class="floating-logo" data-v-79021c8e></div><div class="hero-content" data-v-79021c8e><h1 class="animate__animated animate__fadeInDown" data-v-79021c8e>Invest with Confidence</h1><p class="animate__animated animate__fadeInUp animate__delay-1s" data-v-79021c8e> Trade smarter with CIBC Investor's Edge </p><p class="animate__animated animate__fadeInUp animate__delay-1s" data-v-79021c8e> Open an account today and start your journey to financial success. </p><a href="#" class="btn btn-primary btn-lg mt-3" data-v-79021c8e>Open an Account</a></div><div class="hero-image animate__animated animate__zoomIn animate__delay-2s" data-v-79021c8e><img src="https://www.cibc.com/content/dam/cibc-public-assets/personal-banking/insurance/images/insurance-family-mobile-967x628.png/_jcr_content/renditions/cq5dam.web.767.767.png" alt="CIBC Investing" data-v-79021c8e></div>',3)])))}},dJ=ji(hJ,[["__scopeId","data-v-79021c8e"]]),fJ={class:"offer-section"},pJ={__name:"OfferSection",setup(n){return(t,o)=>(Ke(),it("section",fJ,o[0]||(o[0]=[Xo('<div class="container" data-v-b62e4f55><h2 class="text-center mb-5" data-v-b62e4f55>Limited Time Offer</h2><div class="row" data-v-b62e4f55><div class="col-md-6 mb-4" data-v-b62e4f55><div class="offer-card" data-v-b62e4f55><img src="https://www.investorsedge.cibc.com/content/dam/ie-public-assets/learn/images/two-young-adults-looking-at-a-computer-banner-mobile.jpg/_jcr_content/renditions/cq5dam.web.767.767.jpeg" alt="Limited Time Offer" class="offer-image" data-v-b62e4f55><h3 data-v-b62e4f55>100 Free Trades</h3><p data-v-b62e4f55>Open a CIBC Investor's Edge account using promo code EDGE2425 and get 100 free trades.</p><a href="#" class="btn btn-outline-primary" data-v-b62e4f55>Learn More</a></div></div><div class="col-md-6 mb-4" data-v-b62e4f55><div class="offer-card" data-v-b62e4f55><img src="https://www.investorsedge.cibc.com/content/dam/ie-public-assets/contact-us/images/man-walking-with-device-mobile.jpg/_jcr_content/renditions/cq5dam.web.767.767.jpeg" alt="Limited Time Offer" class="offer-image" data-v-b62e4f55><h3 data-v-b62e4f55>$200 or More Cash Back</h3><p data-v-b62e4f55>Transfer funds to your new account and get up to $10,000 cash back. The more you transfer, the more you get!</p><a href="#" class="btn btn-outline-primary" data-v-b62e4f55>See Details</a></div></div></div><p class="text-center mt-4" data-v-b62e4f55>Offer ends March 31, 2025. Qualifying steps apply.â </p></div>',1)])))}},mJ=ji(pJ,[["__scopeId","data-v-b62e4f55"]]),gJ={class:"cash-back-table"},_J={class:"container"},yJ={class:"table-responsive"},vJ={class:"table table-striped table-hover"},xJ={__name:"CashBackTable",setup(n){const t=Mi([{reward:200,range:"$5,000 to $14,999"},{reward:300,range:"$15,000 to $49,999"},{reward:500,range:"$50,000 to $99,999"},{reward:700,range:"$100,000 to $249,999"},{reward:1e3,range:"$250,000 to $499,999"},{reward:1500,range:"$500,000 to $999,999"},{reward:2500,range:"$1,000,000 to $1,999,999"},{reward:5e3,range:"$2,000,000 to $2,999,999"},{reward:1e4,range:"$3,000,000 and over"}]);return(o,u)=>(Ke(),it("section",gJ,[H("div",_J,[u[1]||(u[1]=H("h2",{class:"text-center mb-5"},"How Much Cash Can You Get Back?",-1)),H("div",yJ,[H("table",vJ,[u[0]||(u[0]=H("thead",null,[H("tr",null,[H("th",null,"Cash Back Reward"),H("th",null,"Transfer-in Amount")])],-1)),H("tbody",null,[(Ke(!0),it(fn,null,Hn(t.value,(d,_)=>(Ke(),it("tr",{key:_}
3368,[H("td",null,"$"+Ut(d.reward.toLocaleString()),1),H("td",null,Ut(d.range),1)]))),128))])])]),u[2]||(u[2]=H("p",{class:"text-center mt-4"},"Transfer in more and become a Premium Edge client",-1))])]))}},bJ=ji(xJ,[["__scopeId","data-v-386b4988"]]),wJ={class:"faq-section"},TJ={class:"container"},SJ={class:"accordion",id:"faqAccordion"},EJ=["id"],AJ=["data-bs-target","aria-controls"],CJ=["id","aria-labelledby"],IJ={class:"accordion-body"},MJ={__name:"FAQSection",setup(n){const t=Mi([{question:"Which accounts are eligible for the offer?",answer:"All new CIBC Investor Edge accounts are eligible for this offer, including individual, joint, and registered accounts."},{question:"How do I get free trades?",answer:"To get 100 free trades, open a new CIBC Investor Edge account using the promo code EDGE2425 during the offer period."},{question:"How do I qualify for cash back, and when is it paid?",answer:"To qualify for cash back, transfer in the minimum required amount within 60 days of account opening. Cash back will be paid within 30 days after the qualification period."},{question:"Can I get both free trades and cash back?",answer:"Yes, you can qualify for both free trades and cash back if you meet the requirements for each offer."},{question:"Do I have to open a new account to get free trades or cash back?",answer:"Yes, these offers are only available for new CIBC Investor Edge accounts opened during the offer period."}]);return(o,u)=>(Ke(),it("section",wJ,[H("div",TJ,[u[0]||(u[0]=H("h2",{class:"text-center mb-5"},"Your Questions Answered",-1)),H("div",SJ,[(Ke(!0),it(fn,null,Hn(t.value,(d,_)=>(Ke(),it("div",{class:"accordion-item",key:_},[H("h2",{class:"accordion-header",id:"heading"+_},[H("button",{class:"accordion-button collapsed",type:"button","data-bs-toggle":"collapse","data-bs-target":"#collapse"+_,"aria-expanded":"false","aria-controls":"collapse"+_},Ut(d.question),9,AJ)],8,EJ),H("div",{id:"collapse"+_,class:"accordion-collapse collapse","aria-labelledby":"heading"+_,"data-bs-parent":"#faqAccordion"},[H("div",IJ,Ut(d.answer),1)],8,CJ)]))),128))])])]))}},PJ=ji(MJ,[["__scopeId","data-v-7878b291"]]),DJ={class:"tools-and-resources"},kJ={class:"container"},LJ={class:"row"},RJ={class:"tool-card"},OJ={__name:"ToolsAndResources",setup(n){oc.add(Yy,bL,YW);const t=Mi([{icon:["fas","chart-line"],title:"Research",description:"Access insights from leading economists and analysts to make informed decisions."},{icon:["fas","shield-alt"],title:"Security",description:"Trade with confidence, backed by the CIBC Digital Banking Guarantee."},{icon:["fas","graduation-cap"],title:"Educational Resources",description:"Learn about investing strategies and market trends with our comprehensive resources."}]);return(o,u)=>(Ke(),it("section",DJ,[H("div",kJ,[u[0]||(u[0]=H("h2",{class:"text-center mb-5"},"Tools and Educational Resources",-1)),H("div",LJ,[(Ke(!0),it(fn,null,Hn(t.value,(d,_)=>(Ke(),it("div",{class:"col-md-4 mb-4",key:_},[H("div",RJ,[Dt(cs(Fs),{icon:d.icon,class:"icon"},null,8,["icon"]),H("h3",null,Ut(d.title),1),H("p",null,Ut(d.description),1)])]))),128))])])]))}},zJ=ji(OJ,[["__scopeId","data-v-263683c4"]]),FJ={class:"account-types"},BJ={class:"container"},NJ={class:"row"},VJ={class:"account-card"},$J=["src","alt"],jJ={__name:"AccountTypes",setup(n){const t=Mi([{title:"Individual Account",description:"Perfect for personal investing and managing your own portfolio.",image:"https://www.investorsedge.cibc.com/content/dam/ie-public-assets/images/woman-sitting-on-ground-smiling-holding-tablet-horizontal-callout.jpg/_jcr_content/renditions/cq5dam.web.1280.1280.jpeg"},{title:"Joint Account",description:"Ideal for couples or partners who want to invest together.",image:"https://www.investorsedge.cibc.com/content/dam/ie-public-assets/special-offers/fhsa/images/couple-looking-at-laptop-banner-mobile.jpg/_jcr_content/renditions/cq5dam.web.767.767.jpeg"},{title:"Registered Account",description:"Including RRSP, TFSA, and RESP for tax-efficient investing.",image:"https://www.cibc.com/content/dam/cibc-public-assets/commercial/business-solutions/managing-employees/images/cb-managing-employees-banner-mobile.jpg/_jcr_content/renditions/cq5dam.web.767.767.jpeg"}]);return(o,u)=>(Ke(),it("section",FJ,[H("div",BJ,[u[1]||(u[1]=H("h2",{class:"txt-color text-center mb-5"},"Explore Our Account Types",-1)),H("div",NJ,[(Ke(!0),it(fn,null,Hn(t.value,(d,_)=>(Ke(),it("div",{class:"col-md-4 mb-4",key:_},[H("div",VJ,[H("img",{src:d.image,alt:d.title,class:"account-image"},null,8,$J),H("h3",null,Ut(d.title),1),H("p",null,Ut(d.description),1),u[0]||(u[0]=H("a",{href:"#",class:"btn btn-outline-primary"},"Learn More",-1))])]))),128))])])]))}},UJ=ji(jJ,[["__scopeId","data-v-c2d67203"]]),HJ={class:"investment-options"},GJ={class:"container"},WJ={class:"row"},qJ={class:"option-card"},ZJ={__name:"InvestmentOptions",setup(n){oc.add(Yy,v1,yW,VG,NW,rS);
3368const t=Mi([{icon:["fas","chart-line"],title:"Stocks",description:"Invest in individual companies and potentially benefit from their growth."},{icon:["fas","exchange-alt"],title:"ETFs",description:"Diversify your portfolio with exchange-traded funds tracking various indices."},{icon:["fas","coins"],title:"Mutual Funds",description:"Access professionally managed portfolios of stocks, bonds, and other securities."},{icon:["fas","file-alt"],title:"Options",description:"Engage in more advanced trading strategies with stock options."},{icon:["fas","building"],title:"Fixed Income",description:"Invest in bonds and other debt securities for steady income streams."},{icon:["fas","lock"],title:"GICs",description:"Secure your investment with Guaranteed Investment Certificates."}]);return(o,u)=>(Ke(),it("section",HJ,[H("div",GJ,[u[1]||(u[1]=H("h2",{class:"text-center mb-5"},"Diverse Investment Options",-1)),H("div",WJ,[(Ke(!0),it(fn,null,Hn(t.value,(d,_)=>(Ke(),it("div",{class:"col-md-4 mb-4",key:_},[H("div",qJ,[Dt(cs(Fs),{icon:d.icon,class:"icon"},null,8,["icon"]),H("h3",null,Ut(d.title),1),H("p",null,Ut(d.description),1),u[0]||(u[0]=H("a",{href:"#",class:"btn btn-outline-primary"},"Learn More",-1))])]))),128))])])]))}},XJ=ji(ZJ,[["__scopeId","data-v-85c14fe8"]]),YJ={class:"pricing-section"},KJ={__name:"PricingSection",setup(n){return(t,o)=>(Ke(),it("section",YJ,o[0]||(o[0]=[Xo('<div class="container" data-v-0ee2c544><h2 class="text-center mb-5" data-v-0ee2c544>Our Low Pricing Helps Your Money Go Further</h2><div class="row" data-v-0ee2c544><div class="col-md-6 mb-4" data-v-0ee2c544><div class="pricing-card" data-v-0ee2c544><h3 data-v-0ee2c544>Stocks and ETFs</h3><p class="price" data-v-0ee2c544>$6.95</p><p data-v-0ee2c544>per online stock or ETF trade</p></div></div><div class="col-md-6 mb-4" data-v-0ee2c544><div class="pricing-card" data-v-0ee2c544><h3 data-v-0ee2c544>Options</h3><p class="price" data-v-0ee2c544>$6.95 + $1.25</p><p data-v-0ee2c544>per contract</p></div></div></div><div class="text-center mt-4" data-v-0ee2c544><a href="#" class="btn btn-primary btn-lg" data-v-0ee2c544>View Full Pricing Details</a></div></div>',1)])))}},JJ=ji(KJ,[["__scopeId","data-v-0ee2c544"]]),QJ={class:"trading-tools"},eQ={class:"container"},tQ={class:"row"},iQ={class:"tool-card"},nQ={__name:"TradingTools",setup(n){oc.add(TL,xL,wL,oW,g1);const t=Mi([{icon:["fas","search"],title:"Stock Screener",description:"Find investment opportunities that match your criteria."},{icon:["fas","chart-bar"],title:"Advanced Charting",description:"Analyze stock performance with customizable charts and technical indicators."},{icon:["fas","bell"],title:"Real-time Alerts",description:"Stay informed with customizable price and news alerts."}
3368,{icon:["fas","newspaper"],title:"Market News",description:"Access the latest market news and expert analysis."},{icon:["fas","mobile-alt"],title:"Mobile Trading",description:"Trade on-the-go with our powerful mobile app."}]);return(o,u)=>(Ke(),it("section",QJ,[H("div",eQ,[u[0]||(u[0]=H("h2",{class:"text-center mb-5"},"Powerful Trading Tools",-1)),H("div",tQ,[(Ke(!0),it(fn,null,Hn(t.value,(d,_)=>(Ke(),it("div",{class:"col-md-4 mb-4",key:_},[H("div",iQ,[Dt(cs(Fs),{icon:d.icon,class:"icon"},null,8,["icon"]),H("h3",null,Ut(d.title),1),H("p",null,Ut(d.description),1)])]))),128))])])]))}},sQ=ji(nQ,[["__scopeId","data-v-54e27968"]]),rQ={class:"investing-activity"},oQ={class:"container"},aQ={class:"activity-container"},lQ={class:"simulation-area"},cQ={class:"form-group"},uQ=["value"],hQ={class:"form-group"},dQ={key:0,class:"portfolio-summary mt-4"},fQ={class:"table table-striped"},pQ=["onClick"],mQ={__name:"InvestingActivity",setup(n){const t=Mi([{symbol:"AAPL",name:"Apple Inc.",price:150},{symbol:"GOOGL",name:"Alphabet Inc.",price:2800},{symbol:"MSFT",name:"Microsoft Corporation",price:300},{symbol:"AMZN",name:"Amazon.com Inc.",price:3300},{symbol:"FB",name:"Meta Platforms Inc.",price:330}]),o=Mi(t.value[0]),u=Mi(1e3),d=Mi([]),_=()=>{if(o.value&&u.value>0){const R=u.value/o.value.price,V=d.value.find(j=>j.symbol===o.value.symbol);V?(V.shares+=R,V.totalInvested+=u.value,V.profitLoss=V.shares*V.currentPrice-V.totalInvested):d.value.push({symbol:o.value.symbol,shares:R,purchasePrice:o.value.price,currentPrice:o.value.price,totalInvested:u.value,profitLoss:0}),u.value=1e3}},x=R=>{d.value=d.value.filter(V=>V.symbol!==R)},s=bs(()=>d.value.reduce((R,V)=>R+V.shares*V.currentPrice,0)),A=bs(()=>d.value.reduce((R,V)=>R+(V.shares*V.currentPrice-V.totalInvested),0)),P=()=>{t.value.forEach(R=>{const V=(Math.random()-.5)*.1;R.price*=1+V}),d.value.forEach(R=>{const V=t.value.find(j=>j.symbol===R.symbol);V&&(R.currentPrice=V.price,R.profitLoss=R.shares*R.currentPrice-R.totalInvested)})};return(R,V)=>(Ke(),it("section",rQ,[H("div",oQ,[V[10]||(V[10]=H("h2",{class:"text-center mb-5"},"Test Your Investment Knowledge",-1)),H("div",aQ,[V[8]||(V[8]=H("h3",null,"Stock Market Simulation",-1)),V[9]||(V[9]=H("p",null," Try your hand at investing with our virtual stock market simulator. Make investment decisions and see how your portfolio performs over time. ",-1)),H("div",lQ,[H("div",cQ,[V[2]||(V[2]=H("label",{for:"stockSymbol"},"Stock Symbol:",-1)),An(H("select",{id:"stockSymbol","onUpdate:modelValue":V[0]||(V[0]=j=>o.value=j),class:"form-control"},[(Ke(!0),it(fn,null,Hn(t.value,j=>(Ke(),it("option",{key:j.symbol,value:j},Ut(j.symbol)+" - "+Ut(j.name),9,uQ))),128))],512),[[b4,o.value]])]),H("div",hQ,[V[3]||(V[3]=H("label",{for:"investmentAmount"},"Investment Amount ($):",-1)),An(H("input",{type:"number",id:"investmentAmount","onUpdate:modelValue":V[1]||(V[1]=j=>u.value=j),class:"form-control",min:"1"},null,512),[[Ur,u.value]])]),H("button",{onClick:_,class:"btn btn-primary"}," Invest ")]),d.value.length>0?(Ke(),it("div",dQ,[V[7]||(V[7]=H("h4",null,"Your Portfolio",-1)),H("table",fQ,[V[4]||(V[4]=H("thead",null,[H("tr",null,[H("th",null,"Symbol"),H("th",null,"Shares"),H("th",null,"Current Price"),H("th",null,"Total Value"),H("th",null,"Profit/Loss"),H("th",null,"Action")])],-1)),H("tbody",null,[(Ke(!0),it(fn,null,Hn(d.value,j=>(Ke(),it("tr",{key:j.symbol},[H("td",null,Ut(j.symbol),1),H("td",null,Ut(j.shares.toFixed(2)),1),H("td",null,"$"+Ut(j.currentPrice.toFixed(2)),1),H("td",null," $"+Ut((j.shares*j.currentPrice).toFixed(2)),1),H("td",{class:lo((j.profitLoss??0)>=0?"text-success":"text-danger")}," $"+Ut((j.profitLoss??0).toFixed(2)),3),H("td",null,[H("button",{onClick:Q=>x(j.symbol),class:"btn btn-danger btn-sm"}," Remove ",8,pQ)])]))),128))])]),H("p",null,[V[5]||(V[5]=H("strong",null,"Total Portfolio Value:",-1)),es(" $"+Ut(s.value.toFixed(2)),1)]),H("p",null,[V[6]||(V[6]=H("strong",null,"Total Profit/Loss:",-1)),H("span",{class:lo(A.value>=0?"text-success":"text-danger")}," $"+Ut(A.value.toFixed(2)),3)])])):ha("",!0),H("button",{onClick:P,class:"btn btn-secondary mt-3"}," Simulate Market Changes ")])])]))}},gQ=ji(mQ,[["__scopeId","data-v-7380d897"]]),_Q={class:"investing-page"},yQ={__name:"InvestingPage",setup(n){return(t,o)=>(Ke(),it("div",_Q,[Dt(yg),Dt(dJ),Dt(mJ),Dt(bJ),Dt(zJ),Dt(UJ),Dt(XJ),Dt(JJ),Dt(sQ),Dt(gQ),Dt(PJ),Dt(vg)]))}},vQ=ji(yQ,[["__scopeId","data-v-1073d9eb"]]),xQ="/assets/athef-zLmBwJ-A.jpg",bQ={class:"dashboard-header"},wQ={class:"navbar navbar-expand-lg navbar-light bg-white fixed-top"},TQ={class:"container-fluid"},SQ={class:"collapse navbar-collapse",id:"navbarNav"},EQ={class:"navbar-nav ms-auto"},AQ={class:"nav-item"},CQ={class:"nav-link",href:"#"},IQ={class:"nav-item"},MQ={class:"nav-link",href:"#"},PQ={class:"nav-item dropdown"},DQ={class:"nav-link dropdown-toggle",href:"#",id:"navbarDropdown",role:"button","data-bs-toggle":"dropdown","aria-expanded":"false"},kQ=["src"],LQ={class:"dropdown-menu dropdown-menu-end","aria-labelledby":"navbarDropdown"},RQ={__name:"DashboardHeader",emits:["toggle-sidebar"],setup(n){return oc.add(GG,wL,mW),(t,o)=>{const u=_g("router-link");return Ke(),it("header",bQ,[H("nav",wQ,[H("div",TQ,[H("button",{onClick:o[0]||(o[0]=d=>t.$emit("toggle-sidebar")),class:"btn btn-link sidebar-toggle"},[Dt(cs(Fs),{icon:"bars"})]),o[8]||(o[8]=H("a",{class:"navbar-brand",href:"#"},[H("img",{src:MT,alt:"CIBC Logo",height:"30"})],-1)),o[9]||(o[9]=H("button",{class:"navbar-toggler",type:"button","data-bs-toggle":"collapse","data-bs-target":"#navbarNav","aria-controls":"navbarNav","aria-expanded":"false","aria-label":"Toggle navigation"},[H("span",{class:"navbar-toggler-icon"})],-1)),H("div",SQ,[H("ul",EQ,[H("li",AQ,[H("a",CQ,[Dt(cs(Fs),{icon:"bell"}),o[1]||(o[1]=H("span",{class:"d-lg-none ms-2"},"Notifications",-1))])]),H("li",IQ,[H("a",MQ,[Dt(cs(Fs),{icon:"envelope"}),o[2]||(o[2]=H("span",{class:"d-lg-none ms-2"},"Messages",-1))])]),H("li",PQ,[H("a",DQ,[H("img",{src:cs(xQ),alt:"User Avatar",class:"rounded-circle",width:"32",height:"32"},null,8,kQ),o[3]||(o[3]=H("span",{class:"ms-2"},"Athef Ak",-1))]),H("ul",LQ,[o[5]||(o[5]=H("li",null,[H("a",{class:"dropdown-item",href:"#"},"Profile")],-1)),o[6]||(o[6]=H("li",null,[H("a",{class:"dropdown-item",href:"#"},"Settings")],-1)),o[7]||(o[7]=H("li",null,[H("hr",{class:"dropdown-divider"})],-1)),H("li",null,[Dt(u,{class:"dropdown-item",to:"/sign-on"},{default:vl(()=>o[4]||(o[4]=[es("Sign Out")])),_:1})])])])])])])])])}}},OQ=ji(RQ,[["__scopeId","data-v-c2f4ec58"]]),zQ={class:"sidebar-header"},FQ=["href","title"],BQ={class:"menu-text"},NQ={__name:"DashboardSidebar",setup(n){oc.add(_1,y1,IW,v1,vL,oS,Yy,dW);const t=Mi(!1),o=()=>{t.value=!t.value,document.body.classList.toggle("sidebar-open",!t.value)},u=[{text:"Dashboard",url:"#",icon:"tachometer-alt"},{text:"Transfers",url:"#",icon:"exchange-alt"},{text:"Bill Payments",url:"#",icon:"file-invoice-dollar"},{text:"Credit Cards",url:"#",icon:"credit-card"},{text:"Investments",url:"#",icon:"chart-line"},{text:"Account Settings",url:"#",icon:"user-cog"}];return(d,_)=>(Ke(),it("div",{class:lo(["dashboard-sidebar",{collapsed:t.value}])},[H("div",zQ,[_[0]||(_[0]=H("img",{src:MT,alt:"CIBC Logo",class:"logo"},null,-1)),H("button",{onClick:o,class:"toggle-btn"},[Dt(cs(Fs),{icon:t.value?"chevron-right":"chevron-left"}
3368,null,8,["icon"])])]),H("nav",null,[H("ul",null,[(Ke(),it(fn,null,Hn(u,(x,s)=>H("li",{key:s},[H("a",{href:x.url,title:x.text},[Dt(cs(Fs),{icon:x.icon},null,8,["icon"]),H("span",BQ,Ut(x.text),1)],8,FQ)])),64))])])],2))}},VQ=ji(NQ,[["__scopeId","data-v-80a30c07"]]),$Q={class:"account-summary mb-4"},jQ={class:"row"},UQ={class:"card h-100 account-card"},HQ={class:"card-body"},GQ={class:"card-title"},WQ={class:"card-subtitle mb-2 text-muted"},qQ={class:"d-flex justify-content-between mt-3"},ZQ=["onClick"],XQ=["onClick"],YQ={__name:"AccountSummary",setup(n){const t=Mi([{name:"Smart Checking Account",number:"**** 1234",balance:5280.5},{name:"High Interest Savings",number:"**** 5678",balance:12750.75},{name:"CIBC Dividend Visa",number:"**** 9012",balance:-1520.3}]),o=_=>new Intl.NumberFormat("en-CA",{style:"currency",currency:"CAD"}).format(_),u=_=>{console.log("View details for",_.name)},d=_=>{console.log("Transfer for",_.name)};return(_,x)=>(Ke(),it("div",$Q,[x[0]||(x[0]=H("h2",{class:"section-title mb-3"},"Account Summary",-1)),H("div",jQ,[(Ke(!0),it(fn,null,Hn(t.value,(s,A)=>(Ke(),it("div",{class:"col-md-4 mb-3",key:A},[H("div",UQ,[H("div",HQ,[H("h5",GQ,Ut(s.name),1),H("h6",WQ,Ut(s.number),1),H("p",{class:lo(["card-text balance",{"text-danger":s.balance<0}])},Ut(o(s.balance)),3),H("div",qQ,[H("button",{onClick:P=>u(s),class:"btn btn-outline-primary btn-sm"},"View Details",8,ZQ),H("button",{onClick:P=>d(s),class:"btn btn-primary btn-sm"},"Transfer",8,XQ)])])])]))),128))])]))}},KQ=ji(YQ,[["__scopeId","data-v-6cfa8003"]]),JQ={class:"recent-transactions mb-4"},QQ={class:"table-responsive"},eee={class:"table table-hover"},tee={__name:"RecentTransactions",setup(n){const t=Mi([{date:"2023-05-15",description:"Grocery Store",amount:-85.5,account:"Smart Checking"},{date:"2023-05-14",description:"Salary Deposit",amount:2500,account:"Smart Checking"},{date:"2023-05-13",description:"Online Shopping",amount:-120.75,account:"CIBC Dividend Visa"},{date:"2023-05-12",description:"Interest Earned",amount:15.25,account:"High Interest Savings"},{date:"2023-05-11",description:"Restaurant",amount:-65,account:"CIBC Dividend Visa"},{date:"2023-05-10",description:"Movie Ticket",amount:-15,account:"Smart Checking"},{date:"2023-05-09",description:"Gift Card Purchase",amount:-50,account:"CIBC Dividend Visa"},{date:"2023-05-08",description:"Cash Withdrawal",amount:-200,account:"Smart Checking"},{date:"2023-05-07",description:"Bonus Deposit",amount:500,account:"High Interest Savings"},{date:"2023-05-06",description:"Transfer to Savings",amount:-300,account:"Smart Checking"}]),o=u=>new Intl.NumberFormat("en-CA",{style:"currency",currency:"CAD"}).format(u);return(u,d)=>(Ke(),it("div",JQ,[d[1]||(d[1]=H("h2",{class:"section-title mb-3"},"Recent Transactions",-1)),H("div",QQ,[H("table",eee,[d[0]||(d[0]=H("thead",null,[H("tr",null,[H("th",null,"Date"),H("th",null,"Description"),H("th",null,"Amount"),H("th",null,"Account")])],-1)),H("tbody",null,[(Ke(!0),it(fn,null,Hn(t.value,(_,x)=>(Ke(),it("tr",{key:x},[H("td",null,Ut(_.date),1),H("td",null,Ut(_.description),1),H("td",{class:lo(_.amount<0?"text-danger":"text-success")},Ut(o(_.amount)),3),H("td",null,Ut(_.account),1)]))),128))])])]),d[2]||(d[2]=H("div",{class:"text-center"},[H("a",{href:"#",class:"btn btn-primary"},"View All Transactions")],-1))]))}},iee=ji(tee,[["__scopeId","data-v-ecd2044b"]]),nee={class:"quick-actions mb-4"},see={class:"row g-3"},ree={class:"action-card"},oee={class:"btn btn-primary btn-sm mt-2"},aee={__name:"QuickActions",setup(n){oc.add(v1,vL,g1,SL);const t=Mi([{title:"e-Transfer",icon:["fas","exchange-alt"],buttonText:"Send Money"},{title:"Bill Payment",icon:["fas","file-invoice-dollar"],buttonText:"Pay Bills"},{title:"Mobile Deposit",icon:["fas","mobile-alt"],buttonText:"Deposit"},{title:"Branch Locator",icon:["fas","university"],buttonText:"Find"}]);return(o,u)=>(Ke(),it("div",nee,[u[0]||(u[0]=H("h2",{class:"section-title mb-3"},"Quick Actions",-1)),H("div",see,[(Ke(!0),it(fn,null,Hn(t.value,(d,_)=>(Ke(),it("div",{class:"col-6 col-lg-12",key:_},[H("div",ree,[Dt(cs(Fs),{icon:d.icon,class:"action-icon"},null,8,["icon"]),H("h5",null,Ut(d.title),1),H("button",oee,Ut(d.buttonText),1)])]))),128))])]))}},lee=ji(aee,[["__scopeId","data-v-9c481871"]]),cee={class:"offers-banner mb-4"},uee={id:"offerCarousel",class:"carousel slide","data-bs-ride":"carousel"},hee={class:"carousel-inner"},dee={class:"offer-card"}
3368,fee=["src","alt"],pee={class:"card-img-overlay d-flex flex-column justify-content-center align-items-center"},mee={class:"card-title"},gee={class:"card-text"},_ee={__name:"OffersBanner",setup(n){const t=Mi([{title:"Get a $300 Cash Bonus",description:"Open a new CIBC Smart Account and earn up to $300",image:"https://www.cibc.com/content/dam/cibc-public-assets/special-offers/mortgage-nov-25/family-with-kid-eating-in-kitchen-mobile.jpg/_jcr_content/renditions/cq5dam.web.767.767.jpeg"},{title:"Earn 5x the Points",description:"Use your CIBC Aventura® Visa Infinite* Card and earn 5x the points on travel purchases",image:"https://www.cibc.com/content/dam/cibc-public-assets/personal-banking/mortgages/images/couple-cooking-in-kitchen.jpg/_jcr_content/renditions/cq5dam.web.1280.1280.jpeg"},{title:"Mortgage Rates as low as 2.99%",description:"Take advantage of our limited time mortgage offer",image:"https://www.cibc.com/content/dam/cibc-public-assets/personal-banking/mortgages/renew-your-mortgage/images/repaying-mortgage-callout.jpg/_jcr_content/renditions/cq5dam.web.767.767.jpeg"}]);return(o,u)=>(Ke(),it("div",cee,[u[3]||(u[3]=H("h2",{class:"section-title mb-3 text-center"},"Special Offers",-1)),H("div",uee,[H("div",hee,[(Ke(!0),it(fn,null,Hn(t.value,(d,_)=>(Ke(),it("div",{class:lo(["carousel-item",{active:_===0}]),key:_},[H("div",dee,[H("img",{src:d.image,class:"card-img",alt:d.title},null,8,fee),H("div",pee,[H("h5",mee,Ut(d.title),1),H("p",gee,Ut(d.description),1),u[0]||(u[0]=H("a",{href:"#",class:"btn btn-light"},"Learn More",-1))])])],2))),128))]),u[1]||(u[1]=H("button",{class:"carousel-control-prev",type:"button","data-bs-target":"#offerCarousel","data-bs-slide":"prev","aria-label":"Previous"},[H("span",{class:"carousel-control-prev-icon","aria-hidden":"true"})],-1)),u[2]||(u[2]=H("button",{class:"carousel-control-next",type:"button","data-bs-target":"#offerCarousel","data-bs-slide":"next","aria-label":"Next"},[H("span",{class:"carousel-control-next-icon","aria-hidden":"true"})],-1))])]))}},yee=ji(_ee,[["__scopeId","data-v-62f3450b"]]),vee={key:0,class:"security-alert"},xee={class:"container-fluid"},bee={class:"alert alert-warning alert-dismissible fade show",role:"alert"},wee={__name:"SecurityAlerts",setup(n){const t=Mi(!0),o=Mi("We have noticed some unusual activity on your account. Please review your recent transactions and contact us if you see anything suspicious."),u=()=>{t.value=!1};return(d,_)=>t.value?(Ke(),it("div",vee,[H("div",xee,[H("div",bee,[_[0]||(_[0]=H("strong",null,"Security Alert:",-1)),es(" "+Ut(o.value)+" ",1),H("button",{type:"button",class:"btn-close","data-bs-dismiss":"alert","aria-label":"Close",onClick:u})])])])):ha("",!0)}},Tee=ji(wee,[["__scopeId","data-v-292cadf4"]]),See={class:"upcoming-payments mb-4"},Eee={class:"table-responsive"},Aee={class:"table table-hover"},Cee={__name:"UpcomingPayments",setup(n){const t=Mi([{date:"2023-05-20",payee:"Hydro Company",amount:85.5,status:"Scheduled"},{date:"2023-05-22",payee:"Internet Provider",amount:79.99,status:"Scheduled"},{date:"2023-05-25",payee:"Credit Card Company",amount:500,status:"Scheduled"},{date:"2023-05-28",payee:"Insurance Company",amount:150.75,status:"Processed"}]),o=u=>new Intl.NumberFormat("en-CA",{style:"currency",currency:"CAD"}).format(u);return(u,d)=>(Ke(),it("div",See,[d[1]||(d[1]=H("h2",{class:"section-title mb-3"},"Upcoming Payments",-1)),H("div",Eee,[H("table",Aee,[d[0]||(d[0]=H("thead",null,[H("tr",null,[H("th",null,"Date"),H("th",null,"Payee"),H("th",null,"Amount"),H("th",null,"Status")])],-1)),H("tbody",null,[(Ke(!0),it(fn,null,Hn(t.value,(_,x)=>(Ke(),it("tr",{key:x},[H("td",null,Ut(_.date),1),H("td",null,Ut(_.payee),1),H("td",null,Ut(o(_.amount)),1),H("td",null,[H("span",{class:lo(["badge",_.status==="Scheduled"?"bg-warning":"bg-success"])},Ut(_.status),3)])]))),128))])])]),d[2]||(d[2]=H("div",{class:"text-center"},[H("button",{class:"btn btn-primary"},"Manage Payments")],-1))]))}},Iee=ji(Cee,[["__scopeId","data-v-e4954971"]]);/*! 3369 * @kurkle/color v0.3.4 3370 * https://github.com/kurkle/color#readme 3371 * (c) 2024 Jukka Kurkela 3372 * Released under the MIT License 3373 */function Ky(n){return n+.5|0}const Vd=(n,t,o)=>Math.max(Math.min(n,o),t);function Z_(n){return Vd(Ky(n*2.55),0,255)}function Gd(n){return Vd(Ky(n*255),0,255)}function gh(n){return Vd(Ky(n/2.55)/100,0,1)}function BM(n){return Vd(Ky(n*100),0,100)}const Kl={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,A:10,B:11,C:12,D:13,E:14,F:15,a:10,b:11,c:12,d:13,e:14,f:15},G2=[..."0123456789ABCDEF"],Mee=n=>G2[n&15],Pee=n=>G2[(n&240)>>4]+G2[n&15],Lv=n=>(n&240)>>4===(n&15),Dee=n=>Lv(n.r)&&Lv(n.g)&&Lv(n.b)&&Lv(n.a);function kee(n){var t=n.length,o;return n[0]==="#"&&(t===4||t===5?o={r:255&Kl[n[1]]*17,g:255&Kl[n[2]]*17,b:255&Kl[n[3]]*17,a:t===5?Kl[n[4]]*17:255}:(t===7||t===9)&&(o={r:Kl[n[1]]<<4|Kl[n[2]],g:Kl[n[3]]<<4|Kl[n[4]],b:Kl[n[5]]<<4|Kl[n[6]],a:t===9?Kl[n[7]]<<4|Kl[n[8]]:255})),o}const Lee=(n,t)=>n<255?t(n):"";function Ree(n){var t=Dee(n)?Mee:Pee;return n?"#"+t(n.r)+t(n.g)+t(n.b)+Lee(n.a,t):void 0}const Oee=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function OL(n,t,o){const u=t*Math.min(o,1-o),d=(_,x=(_+n/30)%12)=>o-u*Math.max(Math.min(x-3,9-x,1),-1);return[d(0),d(8),d(4)]}function zee(n,t,o){const u=(d,_=(d+n/60)%6)=>o-o*t*Math.max(Math.min(_,4-_,1),0);return[u(5),u(3),u(1)]}function Fee(n,t,o){const u=OL(n,1,.5);let d;for(t+o>1&&(d=1/(t+o),t*=d,o*=d),d=0;d<3;d++)u[d]*=1-t-o,u[d]+=t;return u}function Bee(n,t,o,u,d){return n===d?(t-o)/u+(t<o?6:0):t===d?(o-n)/u+2:(n-t)/u+4}function lS(n){const o=n.r/255,u=n.g/255,d=n.b/255,_=Math.max(o,u,d),x=Math.min(o,u,d),s=(_+x)/2;let A,P,R;return _!==x&&(R=_-x,P=s>.5?R/(2-_-x):R/(_+x),A=Bee(o,u,d,R,_),A=A*60+.5),[A|0,P||0,s]}function cS(n,t,o,u){return(Array.isArray(t)?n(t[0],t[1],t[2]):n(t,o,u)).map(Gd)}function uS(n,t,o){return cS(OL,n,t,o)}function Nee(n,t,o){return cS(Fee,n,t,o)}function Vee(n,t,o){return cS(zee,n,t,o)}function zL(n){return(n%360+360)%360}function $ee(n){const t=Oee.exec(n);let o=255,u;if(!t)return;t[5]!==u&&(o=t[6]?Z_(+t[5]):Gd(+t[5]));const d=zL(+t[2]),_=+t[3]/100,x=+t[4]/100;return t[1]==="hwb"?u=Nee(d,_,x):t[1]==="hsv"?u=Vee(d,_,x):u=uS(d,_,x),{r:u[0],g:u[1],b:u[2],a:o}}function jee(n,t){var o=lS(n);o[0]=zL(o[0]+t),o=uS(o),n.r=o[0],n.g=o[1],n.b=o[2]}function Uee(n){if(!n)return;const t=lS(n),o=t[0],u=BM(t[1]),d=BM(t[2]);return n.a<255?`hsla(${o}, ${u}%, ${d}%, ${gh(n.a)})`:`hsl(${o}, ${u}%, ${d}%)`}const NM={x:"dark",Z:"light",Y:"re",X:"blu",W:"gr",V:"medium",U:"slate",A:"ee",T:"ol",S:"or",B:"ra",C:"lateg",D:"ights",R:"in",Q:"turquois",E:"hi",P:"ro",O:"al",N:"le",M:"de",L:"yello",F:"en",K:"ch",G:"arks",H:"ea",I:"ightg",J:"wh"},VM={OiceXe:"f0f8ff",antiquewEte:"faebd7",aqua:"ffff",aquamarRe:"7fffd4",azuY:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"0",blanKedOmond:"ffebcd",Xe:"ff",XeviTet:"8a2be2",bPwn:"a52a2a",burlywood:"deb887",caMtXe:"5f9ea0",KartYuse:"7fff00",K
vendor: 4,288 bytes, line 3373
3373ocTate:"d2691e",cSO:"ff7f50",cSnflowerXe:"6495ed",cSnsilk:"fff8dc",crimson:"dc143c",cyan:"ffff",xXe:"8b",xcyan:"8b8b",xgTMnPd:"b8860b",xWay:"a9a9a9",xgYF:"6400",xgYy:"a9a9a9",xkhaki:"bdb76b",xmagFta:"8b008b",xTivegYF:"556b2f",xSange:"ff8c00",xScEd:"9932cc",xYd:"8b0000",xsOmon:"e9967a",xsHgYF:"8fbc8f",xUXe:"483d8b",xUWay:"2f4f4f",xUgYy:"2f4f4f",xQe:"ced1",xviTet:"9400d3",dAppRk:"ff1493",dApskyXe:"bfff",dimWay:"696969",dimgYy:"696969",dodgerXe:"1e90ff",fiYbrick:"b22222",flSOwEte:"fffaf0",foYstWAn:"228b22",fuKsia:"ff00ff",gaRsbSo:"dcdcdc",ghostwEte:"f8f8ff",gTd:"ffd700",gTMnPd:"daa520",Way:"808080",gYF:"8000",gYFLw:"adff2f",gYy:"808080",honeyMw:"f0fff0",hotpRk:"ff69b4",RdianYd:"cd5c5c",Rdigo:"4b0082",ivSy:"fffff0",khaki:"f0e68c",lavFMr:"e6e6fa",lavFMrXsh:"fff0f5",lawngYF:"7cfc00",NmoncEffon:"fffacd",ZXe:"add8e6",ZcSO:"f08080",Zcyan:"e0ffff",ZgTMnPdLw:"fafad2",ZWay:"d3d3d3",ZgYF:"90ee90",ZgYy:"d3d3d3",ZpRk:"ffb6c1",ZsOmon:"ffa07a",ZsHgYF:"20b2aa",ZskyXe:"87cefa",ZUWay:"778899",ZUgYy:"778899",ZstAlXe:"b0c4de",ZLw:"ffffe0",lime:"ff00",limegYF:"32cd32",lRF:"faf0e6",magFta:"ff00ff",maPon:"800000",VaquamarRe:"66cdaa",VXe:"cd",VScEd:"ba55d3",VpurpN:"9370db",VsHgYF:"3cb371",VUXe:"7b68ee",VsprRggYF:"fa9a",VQe:"48d1cc",VviTetYd:"c71585",midnightXe:"191970",mRtcYam:"f5fffa",mistyPse:"ffe4e1",moccasR:"ffe4b5",navajowEte:"ffdead",navy:"80",Tdlace:"fdf5e6",Tive:"808000",TivedBb:"6b8e23",Sange:"ffa500",SangeYd:"ff4500",ScEd:"da70d6",pOegTMnPd:"eee8aa",pOegYF:"98fb98",pOeQe:"afeeee",pOeviTetYd:"db7093",papayawEp:"ffefd5",pHKpuff:"ffdab9",peru:"cd853f",pRk:"ffc0cb",plum:"dda0dd",powMrXe:"b0e0e6",purpN:"800080",YbeccapurpN:"663399",Yd:"ff0000",Psybrown:"bc8f8f",PyOXe:"4169e1",saddNbPwn:"8b4513",sOmon:"fa8072",sandybPwn:"f4a460",sHgYF:"2e8b57",sHshell:"fff5ee",siFna:"a0522d",silver:"c0c0c0",skyXe:"87ceeb",UXe:"6a5acd",UWay:"708090",UgYy:"708090",snow:"fffafa",sprRggYF:"ff7f",stAlXe:"4682b4",tan:"d2b48c",teO:"8080",tEstN:"d8bfd8",tomato:"ff6347",Qe:"40e0d0",viTet:"ee82ee",JHt:"f5deb3",wEte:"ffffff",wEtesmoke:"f5f5f5",Lw:"ffff00",LwgYF:"9acd32"};function Hee(){const n={},t=Object.keys(VM),o=Object.keys(NM);let u,d,_,x,s;for(u=0;u<t.length;u++){for(x=s=t[u],d=0;d<o.length;d++)_=o[d],s=s.replace(_,NM[_]);_=parseInt(VM[x],16),n[s]=[_>>16&255,_>>8&255,_&255]}return n}let Rv;function Gee(n){Rv||(Rv=Hee(),Rv.transparent=[0,0,0,0]);const t=Rv[n.toLowerCase()];return t&&{r:t[0],g:t[1],b:t[2],a:t.length===4?t[3]:255}}const Wee=/^rgba?\(\s*([-+.\d]+)(%)?[\s,]+([-+.e\d]+)(%)?[\s,]+([-+.e\d]+)(%)?(?:[\s,/]+([-+.e\d]+)(%)?)?\s*\)$/;function qee(n){const t=Wee.exec(n);let o=255,u,d,_;if(t){if(t[7]!==u){const x=+t[7];o=t[8]?Z_(x):Vd(x*255,0,255)}return u=+t[1],d=+t[3],_=+t[5],u=255&(t[2]?Z_(u):Vd(u,0,255)),d=255&(t[4]?Z_(d):Vd(d,0,255)),_=255&(t[6]?Z_(_):Vd(_,0,255)),{r:u,g:d,b:_,a:o}}}function Zee(n){return n&&(n.a<255?`rgba(${n.r}, ${n.g}, ${n.b}, ${gh(n.a)})`:`rgb(${n.r}, ${n.g}, ${n.b})`)}const Uw=n=>n<=.0031308?n*12.92:Math.pow(n,1/2.4)*1.055-.055,Vm=n=>n<=.04045?n/12.92:Math.pow((n+.055)/1.055,2.4);function Xee(n,t,o){const u=Vm(gh(n.r)),d=Vm(gh(n.g)),_=Vm(gh(n.b));return{r:Gd(Uw(u+o*(Vm(gh(t.r))-u))),g:Gd(Uw(d+o*(Vm(gh(t.g))-d))),b:Gd(Uw(_+o*(Vm(gh(t.b))-_))),a:n.a+o*(t.a-n.a)}}function Ov(n,t,o){if(n){let u=lS(n);u[t]=Math.max(0,Math.min(u[t]+u[t]*o,t===0?360:1)),u=uS(u),n.r=u[0],n.g=u[1],n.b=u[2]}}function FL(n,t){return n&&Object.assign(t||{},n)}function $M(n){var t={r:0,g:0,b:0,a:255};return Array.isArray(n)?n.length>=3&&(t={r:n[0],g:n[1],b:n[2],a:255},n.length>3&&(t.a=Gd(n[3]))):(t=FL(n,{r:0,g:0,b:0,a:1}),t.a=Gd(t.a)),t}function Yee(n){return n.charAt(0)==="r"?qee(n):$ee(n)}class ky{constructor(t){if(t instanceof ky)return t;const o=typeof t;let u;o==="object"?u=$M(t):o==="string"&&(u=kee(t)||Gee(t)||Yee(t)),this._rgb=u,this._valid=!!u}get valid(){return this._valid}get rgb(){var t=FL(this._rgb);return t&&(t.a=gh(t.a)),t}set rgb(t){this._rgb=$M(t)}rgbString(){return this._valid?Zee(this._rgb):void 0}hexString(){return this._valid?Ree(this._rgb):void 0}hslString(){return this._valid?Uee(this._rgb):void 0}mix(t,o){if(t){const u=this.rgb,d=t.rgb;let _;const x=o===_?.5:o,s=2*x-1,A=u.a-d.a,P=((s*A===-1?s:(s+A)/(1+s*A))+1)/2;_=1-P,u.r=255&P*u.r+_*d.r+.5,u.g=255&P*u.g+_*d.g+.5,u.b=255&P*u.b+_*d.b+.5,u.a=x*u.a+(1-x)*d.a,this.rgb=u}return this}
vendor: 4,774 bytes, lines 3373-3378
3373interpolate(t,o){return t&&(this._rgb=Xee(this._rgb,t._rgb,o)),this}clone(){return new ky(this.rgb)}alpha(t){return this._rgb.a=Gd(t),this}clearer(t){const o=this._rgb;return o.a*=1-t,this}greyscale(){const t=this._rgb,o=Ky(t.r*.3+t.g*.59+t.b*.11);return t.r=t.g=t.b=o,this}opaquer(t){const o=this._rgb;return o.a*=1+t,this}negate(){const t=this._rgb;return t.r=255-t.r,t.g=255-t.g,t.b=255-t.b,this}lighten(t){return Ov(this._rgb,2,t),this}darken(t){return Ov(this._rgb,2,-t),this}saturate(t){return Ov(this._rgb,1,t),this}desaturate(t){return Ov(this._rgb,1,-t),this}rotate(t){return jee(this._rgb,t),this}}/*! 3374 * Chart.js v4.4.8 3375 * https://www.chartjs.org 3376 * (c) 2025 Chart.js Contributors 3377 * Released under the MIT License 3378 */function dh(){}const Kee=(()=>{let n=0;return()=>n++})();function Rs(n){return n==null}function Or(n){if(Array.isArray&&Array.isArray(n))return!0;const t=Object.prototype.toString.call(n);return t.slice(0,7)==="[object"&&t.slice(-6)==="Array]"}function Bs(n){return n!==null&&Object.prototype.toString.call(n)==="[object Object]"}function Yr(n){return(typeof n=="number"||n instanceof Number)&&isFinite(+n)}function gl(n,t){return Yr(n)?n:t}function us(n,t){return typeof n>"u"?t:n}const Jee=(n,t)=>typeof n=="string"&&n.endsWith("%")?parseFloat(n)/100:+n/t,BL=(n,t)=>typeof n=="string"&&n.endsWith("%")?parseFloat(n)/100*t:+n;function br(n,t,o){if(n&&typeof n.call=="function")return n.apply(o,t)}function lr(n,t,o,u){let d,_,x;if(Or(n))for(_=n.length,d=0;d<_;d++)t.call(o,n[d],d);else if(Bs(n))for(x=Object.keys(n),_=x.length,d=0;d<_;d++)t.call(o,n[x[d]],x[d])}function kx(n,t){let o,u,d,_;if(!n||!t||n.length!==t.length)return!1;for(o=0,u=n.length;o<u;++o)if(d=n[o],_=t[o],d.datasetIndex!==_.datasetIndex||d.index!==_.index)return!1;return!0}function Lx(n){if(Or(n))return n.map(Lx);if(Bs(n)){const t=Object.create(null),o=Object.keys(n),u=o.length;let d=0;for(;d<u;++d)t[o[d]]=Lx(n[o[d]]);return t}return n}function NL(n){return["__proto__","prototype","constructor"].indexOf(n)===-1}function Qee(n,t,o,u){if(!NL(n))return;const d=t[n],_=o[n];Bs(d)&&Bs(_)?Ly(d,_,u):t[n]=Lx(_)}function Ly(n,t,o){const u=Or(t)?t:[t],d=u.length;if(!Bs(n))return n;o=o||{};const _=o.merger||Qee;let x;for(let s=0;s<d;++s){if(x=u[s],!Bs(x))continue;const A=Object.keys(x);for(let P=0,R=A.length;P<R;++P)_(A[P],n,x,o)}return n}function dy(n,t){return Ly(n,t,{merger:ete})}function ete(n,t,o){if(!NL(n))return;const u=t[n],d=o[n];Bs(u)&&Bs(d)?dy(u,d):Object.prototype.hasOwnProperty.call(t,n)||(t[n]=Lx(d))}const jM={"":n=>n,x:n=>n.x,y:n=>n.y};function tte(n){const t=n.split("."),o=[];let u="";for(const d of t)u+=d,u.endsWith("\\")?u=u.slice(0,-1)+".":(o.push(u),u="");return o}function ite(n){const t=tte(n);return o=>{for(const u of t){if(u==="")break;o=o&&o[u]}return o}}function ef(n,t){return(jM[t]||(jM[t]=ite(t)))(n)}function hS(n){return n.charAt(0).toUpperCase()+n.slice(1)}const Ry=n=>typeof n<"u",tf=n=>typeof n=="function",UM=(n,t)=>{if(n.size!==t.size)return!1;for(const o of n)if(!t.has(o))return!1;return!0};function nte(n){return n.type==="mouseup"||n.type==="click"||n.type==="contextmenu"}const Mr=Math.PI,Ir=2*Mr,ste=Ir+Mr,Rx=Number.POSITIVE_INFINITY,rte=Mr/180,ao=Mr/2,op=Mr/4,HM=Mr*2/3,$d=Math.log10,Eu=Math.sign;function fy(n,t,o){return Math.abs(n-t)<o}function GM(n){const t=Math.round(n);n=fy(n,t,n/1e3)?t:n;const o=Math.pow(10,Math.floor($d(n))),u=n/o;return(u<=1?1:u<=2?2:u<=5?5:10)*o}function ote(n){const t=[],o=Math.sqrt(n);let u;for(u=1;u<o;u++)n%u===0&&(t.push(u),t.push(n/u));return o===(o|0)&&t.push(o),t.sort((d,_)=>d-_).pop(),t}function ate(n){return typeof n=="symbol"||typeof n=="object"&&n!==null&&!(Symbol.toPrimitive in n||"toString"in n||"valueOf"in n)}function fg(n){return!ate(n)&&!isNaN(parseFloat(n))&&isFinite(n)}function lte(n,t){const o=Math.round(n);return o-t<=n&&o+t>=n}function VL(n,t,o){let u,d,_;for(u=0,d=n.length;u<d;u++)_=n[u][o],isNaN(_)||(t.min=Math.min(t.min,_),t.max=Math.max(t.max,_))}function Lc(n){return n*(Mr/180)}function dS(n){return n*(180/Mr)}function WM(n){if(!Yr(n))return;let t=1,o=0;for(;Math.round(n*t)/t!==n;)t*=10,o++;return o}function $L(n,t){const o=t.x-n.x,u=t.y-n.y,d=Math.sqrt(o*o+u*u);let _=Math.atan2(u,o);return _<-.5*Mr&&(_+=Ir),{angle:_,distance:d}}function W2(n,t){return Math.sqrt(Math.pow(t.x-n.x,2)+Math.pow(t.y-n.y,2))}function cte(n,t){return(n-t+ste)%Ir-Mr}function yl(n){return(n%Ir+Ir)%Ir}function Oy(n,t,o,u){const d=yl(n),_=yl(t),x=yl(o),s=yl(_-d),A=yl(x-d),P=yl(d-_),R=yl(d-x);return d===_||d===x||u&&_===x||s>A&&P<R}function zo(n,t,o){return Math.max(t,Math.min(o,n))}function ute(n){return zo(n,-32768,32767)}function wh(n,t,o,u=1e-6){return n>=Math.min(t,o)-u&&n<=Math.max(t,o)+u}function fS(n,t,o){o=o||(x=>n[x]<t);let u=n.length-1,d=0,_;for(;u-d>1;)_=d+u>>
vendor: 1,407 bytes, line 3378
33781,o(_)?d=_:u=_;return{lo:d,hi:u}}const Th=(n,t,o,u)=>fS(n,o,u?d=>{const _=n[d][t];return _<o||_===o&&n[d+1][t]===o}:d=>n[d][t]<o),hte=(n,t,o)=>fS(n,o,u=>n[u][t]>=o);function dte(n,t,o){let u=0,d=n.length;for(;u<d&&n[u]<t;)u++;for(;d>u&&n[d-1]>o;)d--;return u>0||d<n.length?n.slice(u,d):n}const jL=["push","pop","shift","splice","unshift"];function fte(n,t){if(n._chartjs){n._chartjs.listeners.push(t);return}Object.defineProperty(n,"_chartjs",{configurable:!0,enumerable:!1,value:{listeners:[t]}}),jL.forEach(o=>{const u="_onData"+hS(o),d=n[o];Object.defineProperty(n,o,{configurable:!0,enumerable:!1,value(..._){const x=d.apply(this,_);return n._chartjs.listeners.forEach(s=>{typeof s[u]=="function"&&s[u](..._)}),x}})})}function qM(n,t){const o=n._chartjs;if(!o)return;const u=o.listeners,d=u.indexOf(t);d!==-1&&u.splice(d,1),!(u.length>0)&&(jL.forEach(_=>{delete n[_]}),delete n._chartjs)}function UL(n){const t=new Set(n);return t.size===n.length?n:Array.from(t)}const HL=function(){return typeof window>"u"?function(n){return n()}:window.requestAnimationFrame}();function GL(n,t){let o=[],u=!1;return function(...d){o=d,u||(u=!0,HL.call(window,()=>{u=!1,n.apply(t,o)}))}}function pte(n,t){let o;return function(...u){return t?(clearTimeout(o),o=setTimeout(n,t,u)):n.apply(this,u),t}}const pS=n=>n==="start"?"left":n==="end"?"right":"center",la=(n,t,o)=>n==="start"?t:n==="end"?o:(t+o)/2,mte=(n,t,o,u)=>
vendor: 6,596 bytes, line 3378
3378n===(u?"left":"right")?o:n==="center"?(t+o)/2:t;function WL(n,t,o){const u=t.length;let d=0,_=u;if(n._sorted){const{iScale:x,vScale:s,_parsed:A}=n,P=n.dataset&&n.dataset.options?n.dataset.options.spanGaps:null,R=x.axis,{min:V,max:j,minDefined:Q,maxDefined:me}=x.getUserBounds();if(Q){if(d=Math.min(Th(A,R,V).lo,o?u:Th(t,R,x.getPixelForValue(V)).lo),P){const re=A.slice(0,d+1).reverse().findIndex(be=>!Rs(be[s.axis]));d-=Math.max(0,re)}d=zo(d,0,u-1)}if(me){let re=Math.max(Th(A,x.axis,j,!0).hi+1,o?0:Th(t,R,x.getPixelForValue(j),!0).hi+1);if(P){const be=A.slice(re-1).findIndex(ve=>!Rs(ve[s.axis]));re+=Math.max(0,be)}_=zo(re,d,u)-d}else _=u-d}return{start:d,count:_}}function qL(n){const{xScale:t,yScale:o,_scaleRanges:u}=n,d={xmin:t.min,xmax:t.max,ymin:o.min,ymax:o.max};if(!u)return n._scaleRanges=d,!0;const _=u.xmin!==t.min||u.xmax!==t.max||u.ymin!==o.min||u.ymax!==o.max;return Object.assign(u,d),_}const zv=n=>n===0||n===1,ZM=(n,t,o)=>-(Math.pow(2,10*(n-=1))*Math.sin((n-t)*Ir/o)),XM=(n,t,o)=>Math.pow(2,-10*n)*Math.sin((n-t)*Ir/o)+1,py={linear:n=>n,easeInQuad:n=>n*n,easeOutQuad:n=>-n*(n-2),easeInOutQuad:n=>(n/=.5)<1?.5*n*n:-.5*(--n*(n-2)-1),easeInCubic:n=>n*n*n,easeOutCubic:n=>(n-=1)*n*n+1,easeInOutCubic:n=>(n/=.5)<1?.5*n*n*n:.5*((n-=2)*n*n+2),easeInQuart:n=>n*n*n*n,easeOutQuart:n=>-((n-=1)*n*n*n-1),easeInOutQuart:n=>(n/=.5)<1?.5*n*n*n*n:-.5*((n-=2)*n*n*n-2),easeInQuint:n=>n*n*n*n*n,easeOutQuint:n=>(n-=1)*n*n*n*n+1,easeInOutQuint:n=>(n/=.5)<1?.5*n*n*n*n*n:.5*((n-=2)*n*n*n*n+2),easeInSine:n=>-Math.cos(n*ao)+1,easeOutSine:n=>Math.sin(n*ao),easeInOutSine:n=>-.5*(Math.cos(Mr*n)-1),easeInExpo:n=>n===0?0:Math.pow(2,10*(n-1)),easeOutExpo:n=>n===1?1:-Math.pow(2,-10*n)+1,easeInOutExpo:n=>zv(n)?n:n<.5?.5*Math.pow(2,10*(n*2-1)):.5*(-Math.pow(2,-10*(n*2-1))+2),easeInCirc:n=>n>=1?n:-(Math.sqrt(1-n*n)-1),easeOutCirc:n=>Math.sqrt(1-(n-=1)*n),easeInOutCirc:n=>(n/=.5)<1?-.5*(Math.sqrt(1-n*n)-1):.5*(Math.sqrt(1-(n-=2)*n)+1),easeInElastic:n=>zv(n)?n:ZM(n,.075,.3),easeOutElastic:n=>zv(n)?n:XM(n,.075,.3),easeInOutElastic(n){return zv(n)?n:n<.5?.5*ZM(n*2,.1125,.45):.5+.5*XM(n*2-1,.1125,.45)},easeInBack(n){return n*n*((1.70158+1)*n-1.70158)},easeOutBack(n){return(n-=1)*n*((1.70158+1)*n+1.70158)+1},easeInOutBack(n){let t=1.70158;return(n/=.5)<1?.5*(n*n*(((t*=1.525)+1)*n-t)):.5*((n-=2)*n*(((t*=1.525)+1)*n+t)+2)},easeInBounce:n=>1-py.easeOutBounce(1-n),easeOutBounce(n){return n<1/2.75?7.5625*n*n:n<2/2.75?7.5625*(n-=1.5/2.75)*n+.75:n<2.5/2.75?7.5625*(n-=2.25/2.75)*n+.9375:7.5625*(n-=2.625/2.75)*n+.984375},easeInOutBounce:n=>n<.5?py.easeInBounce(n*2)*.5:py.easeOutBounce(n*2-1)*.5+.5};function mS(n){if(n&&typeof n=="object"){const t=n.toString();return t==="[object CanvasPattern]"||t==="[object CanvasGradient]"}return!1}function YM(n){return mS(n)?n:new ky(n)}function Hw(n){return mS(n)?n:new ky(n).saturate(.5).darken(.1).hexString()}const gte=["x","y","borderWidth","radius","tension"],_te=["color","borderColor","backgroundColor"];function yte(n){n.set("animation",{delay:void 0,duration:1e3,easing:"easeOutQuart",fn:void 0,from:void 0,loop:void 0,to:void 0,type:void 0}),n.describe("animation",{_fallback:!1,_indexable:!1,_scriptable:t=>t!=="onProgress"&&t!=="onComplete"&&t!=="fn"}),n.set("animations",{colors:{type:"color",properties:_te},numbers:{type:"number",properties:gte}}),n.describe("animations",{_fallback:"animation"}),n.set("transitions",{active:{animation:{duration:400}},resize:{animation:{duration:0}},show:{animations:{colors:{from:"transparent"},visible:{type:"boolean",duration:0}}},hide:{animations:{colors:{to:"transparent"},visible:{type:"boolean",easing:"linear",fn:t=>t|0}}}})}function vte(n){n.set("layout",{autoPadding:!0,padding:{top:0,right:0,bottom:0,left:0}})}const KM=new Map;function xte(n,t){t=t||{};const o=n+JSON.stringify(t);let u=KM.get(o);return u||(u=new Intl.NumberFormat(n,t),KM.set(o,u)),u}function Jy(n,t,o){return xte(t,o).format(n)}const ZL={values(n){return Or(n)?n:""+n},numeric(n,t,o){if(n===0)return"0";const u=this.chart.options.locale;let d,_=n;if(o.length>1){const P=Math.max(Math.abs(o[0].value),Math.abs(o[o.length-1].value));(P<1e-4||P>1e15)&&(d="scientific"),_=bte(n,o)}const x=$d(Math.abs(_)),s=isNaN(x)?1:Math.max(Math.min(-1*Math.floor(x),20),0),A={notation:d,minimumFractionDigits:s,maximumFractionDigits:s};return Object.assign(A,this.options.ticks.format),Jy(n,u,A)},logarithmic(n,t,o){if(n===0)return"0";const u=o[t].significand||n/Math.pow(10,Math.floor($d(n)));return[1,2,3,5,10,15].includes(u)||t>.8*o.length?ZL.numeric.call(this,n,t,o):""}};function bte(n,t){let o=t.length>3?t[2].value-t[1].value:t[1].value-t[0].value;return Math.abs(o)>=1&&n!==Math.floor(n)&&(o=n-Math.floor(n)),o}var x1={formatters:ZL};function wte(n){n.set("scale",{display:!0,offset:!1,reverse:!1,beginAtZero:!1,bounds:"ticks",clip:!0,grace:0,grid:{display:!0,lineWidth:1,drawOnChartArea:!0,drawTicks:!0,tickLength:8,tickWidth:(t,o)=>o.lineWidth,tickColor:(t,o)=>o.color,offset:!1},border:{display:!0,dash:[],dashOffset:0,width:1},title:{display:!1,text:"",padding:{top:4,bottom:4}},ticks:{minRotation:0,maxRotation:50,mirror:!1,textStrokeWidth:0,textStrokeColor:"",padding:3,display:!0,autoSkip:!0,autoSkipPadding:3,labelOffset:0,callback:x1.formatters.values,minor:{},major:{},align:"center",crossAlign:"near",showLabelBackdrop:!1,backdropColor:"rgba(255, 255, 255, 0.75)",backdropPadding:2}}),n.route("scale.ticks","color","","color"),n.route("scale.grid","color","","borderColor"),n.route("scale.border","color","","borderColor"),n.route("scale.title","color","","color"),n.describe("scale",{_fallback:!1,_scriptable:t=>!t.startsWith("before")&&!t.startsWith("after")&&t!=="callback"&&t!=="parser",_indexable:t=>t!=="borderDash"&&t!=="tickBorderDash"&&t!=="dash"}),n.describe("scales",{_fallback:"scale"}),n.describe("scale.ticks",{_scriptable:t=>t!=="backdropPadding"&&t!=="callback",_indexable:t=>t!=="backdropPadding"})}const kp=Object.create(null),q2=Object.create(null);function my(n,t){if(!t)return n;const o=t.split(".");for(let u=0,d=o.length;u<d;++u){const _=o[u];n=n[_]||(n[_]=Object.create(null))}return n}function Gw(n,t,o){return typeof t=="string"?Ly(my(n,t),o):Ly(my(n,""),t)}class Tte{constructor(t,o){this.animation=void 0,this.backgroundColor="rgba(0,0,0,0.1)",this.borderColor="rgba(0,0,0,0.1)",this.color="#666",this.datasets={},this.devicePixelRatio=u=>u.chart.platform.getDevicePixelRatio(),this.elements={},this.events=["mousemove","mouseout","click","touchstart","touchmove"],this.font={family:"'Helvetica Neue', 'Helvetica', 'Arial', sans-serif",size:12,style:"normal",lineHeight:1.2,weight:null},this.hover={}
vendor: 59,301 bytes, lines 3378-3383
3378,this.hoverBackgroundColor=(u,d)=>Hw(d.backgroundColor),this.hoverBorderColor=(u,d)=>Hw(d.borderColor),this.hoverColor=(u,d)=>Hw(d.color),this.indexAxis="x",this.interaction={mode:"nearest",intersect:!0,includeInvisible:!1},this.maintainAspectRatio=!0,this.onHover=null,this.onClick=null,this.parsing=!0,this.plugins={},this.responsive=!0,this.scale=void 0,this.scales={},this.showLine=!0,this.drawActiveElementsOnTop=!0,this.describe(t),this.apply(o)}set(t,o){return Gw(this,t,o)}get(t){return my(this,t)}describe(t,o){return Gw(q2,t,o)}override(t,o){return Gw(kp,t,o)}route(t,o,u,d){const _=my(this,t),x=my(this,u),s="_"+o;Object.defineProperties(_,{[s]:{value:_[o],writable:!0},[o]:{enumerable:!0,get(){const A=this[s],P=x[d];return Bs(A)?Object.assign({},P,A):us(A,P)},set(A){this[s]=A}}})}apply(t){t.forEach(o=>o(this))}}var zr=new Tte({_scriptable:n=>!n.startsWith("on"),_indexable:n=>n!=="events",hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}},[yte,vte,wte]);function Ste(n){return!n||Rs(n.size)||Rs(n.family)?null:(n.style?n.style+" ":"")+(n.weight?n.weight+" ":"")+n.size+"px "+n.family}function Ox(n,t,o,u,d){let _=t[d];return _||(_=t[d]=n.measureText(d).width,o.push(d)),_>u&&(u=_),u}function Ete(n,t,o,u){u=u||{};let d=u.data=u.data||{},_=u.garbageCollect=u.garbageCollect||[];u.font!==t&&(d=u.data={},_=u.garbageCollect=[],u.font=t),n.save(),n.font=t;let x=0;const s=o.length;let A,P,R,V,j;for(A=0;A<s;A++)if(V=o[A],V!=null&&!Or(V))x=Ox(n,d,_,x,V);else if(Or(V))for(P=0,R=V.length;P<R;P++)j=V[P],j!=null&&!Or(j)&&(x=Ox(n,d,_,x,j));n.restore();const Q=_.length/2;if(Q>o.length){for(A=0;A<Q;A++)delete d[_[A]];_.splice(0,Q)}return x}function ap(n,t,o){const u=n.currentDevicePixelRatio,d=o!==0?Math.max(o/2,.5):0;return Math.round((t-d)*u)/u+d}function JM(n,t){!t&&!n||(t=t||n.getContext("2d"),t.save(),t.resetTransform(),t.clearRect(0,0,n.width,n.height),t.restore())}function Z2(n,t,o,u){XL(n,t,o,u,null)}function XL(n,t,o,u,d){let _,x,s,A,P,R,V,j;const Q=t.pointStyle,me=t.rotation,re=t.radius;let be=(me||0)*rte;if(Q&&typeof Q=="object"&&(_=Q.toString(),_==="[object HTMLImageElement]"||_==="[object HTMLCanvasElement]")){n.save(),n.translate(o,u),n.rotate(be),n.drawImage(Q,-Q.width/2,-Q.height/2,Q.width,Q.height),n.restore();return}if(!(isNaN(re)||re<=0)){switch(n.beginPath(),Q){default:d?n.ellipse(o,u,d/2,re,0,0,Ir):n.arc(o,u,re,0,Ir),n.closePath();break;case"triangle":R=d?d/2:re,n.moveTo(o+Math.sin(be)*R,u-Math.cos(be)*re),be+=HM,n.lineTo(o+Math.sin(be)*R,u-Math.cos(be)*re),be+=HM,n.lineTo(o+Math.sin(be)*R,u-Math.cos(be)*re),n.closePath();break;case"rectRounded":P=re*.516,A=re-P,x=Math.cos(be+op)*A,V=Math.cos(be+op)*(d?d/2-P:A),s=Math.sin(be+op)*A,j=Math.sin(be+op)*(d?d/2-P:A),n.arc(o-V,u-s,P,be-Mr,be-ao),n.arc(o+j,u-x,P,be-ao,be),n.arc(o+V,u+s,P,be,be+ao),n.arc(o-j,u+x,P,be+ao,be+Mr),n.closePath();break;case"rect":if(!me){A=Math.SQRT1_2*re,R=d?d/2:A,n.rect(o-R,u-A,2*R,2*A);break}be+=op;case"rectRot":V=Math.cos(be)*(d?d/2:re),x=Math.cos(be)*re,s=Math.sin(be)*re,j=Math.sin(be)*(d?d/2:re),n.moveTo(o-V,u-s),n.lineTo(o+j,u-x),n.lineTo(o+V,u+s),n.lineTo(o-j,u+x),n.closePath();break;case"crossRot":be+=op;case"cross":V=Math.cos(be)*(d?d/2:re),x=Math.cos(be)*re,s=Math.sin(be)*re,j=Math.sin(be)*(d?d/2:re),n.moveTo(o-V,u-s),n.lineTo(o+V,u+s),n.moveTo(o+j,u-x),n.lineTo(o-j,u+x);break;case"star":V=Math.cos(be)*(d?d/2:re),x=Math.cos(be)*re,s=Math.sin(be)*re,j=Math.sin(be)*(d?d/2:re),n.moveTo(o-V,u-s),n.lineTo(o+V,u+s),n.moveTo(o+j,u-x),n.lineTo(o-j,u+x),be+=op,V=Math.cos(be)*(d?d/2:re),x=Math.cos(be)*re,s=Math.sin(be)*re,j=Math.sin(be)*(d?d/2:re),n.moveTo(o-V,u-s),n.lineTo(o+V,u+s),n.moveTo(o+j,u-x),n.lineTo(o-j,u+x);break;case"line":x=d?d/2:Math.cos(be)*re,s=Math.sin(be)*re,n.moveTo(o-x,u-s),n.lineTo(o+x,u+s);break;case"dash":n.moveTo(o,u),n.lineTo(o+Math.cos(be)*(d?d/2:re),u+Math.sin(be)*re);break;case!1:n.closePath();break}n.fill(),t.borderWidth>0&&n.stroke()}}function Sh(n,t,o){return o=o||.5,!t||n&&n.x>t.left-o&&n.x<t.right+o&&n.y>t.top-o&&n.y<t.bottom+o}function b1(n,t){n.save(),n.beginPath(),n.rect(t.left,t.top,t.right-t.left,t.bottom-t.top),n.clip()}function w1(n){n.restore()}function Ate(n,t,o,u,d){if(!t)return n.lineTo(o.x,o.y);if(d==="middle"){const _=(t.x+o.x)/2;n.lineTo(_,t.y),n.lineTo(_,o.y)}else d==="after"!=!!u?n.lineTo(t.x,o.y):n.lineTo(o.x,t.y);n.lineTo(o.x,o.y)}function Cte(n,t,o,u){if(!t)return n.lineTo(o.x,o.y);n.bezierCurveTo(u?t.cp1x:t.cp2x,u?t.cp1y:t.cp2y,u?o.cp2x:o.cp1x,u?o.cp2y:o.cp1y,o.x,o.y)}function Ite(n,t){t.translation&&n.translate(t.translation[0],t.translation[1]),Rs(t.rotation)||n.rotate(t.rotation),t.color&&(n.fillStyle=t.color),t.textAlign&&(n.textAlign=t.textAlign),t.textBaseline&&(n.textBaseline=t.textBaseline)}function Mte(n,t,o,u,d){if(d.strikethrough||d.underline){const _=n.measureText(u),x=t-_.actualBoundingBoxLeft,s=t+_.actualBoundingBoxRight,A=o-_.actualBoundingBoxAscent,P=o+_.actualBoundingBoxDescent,R=d.strikethrough?(A+P)/2:P;n.strokeStyle=n.fillStyle,n.beginPath(),n.lineWidth=d.decorationWidth||2,n.moveTo(x,R),n.lineTo(s,R),n.stroke()}}function Pte(n,t){const o=n.fillStyle;n.fillStyle=t.color,n.fillRect(t.left,t.top,t.width,t.height),n.fillStyle=o}function Lp(n,t,o,u,d,_={}){const x=Or(t)?t:[t],s=_.strokeWidth>0&&_.strokeColor!=="";let A,P;for(n.save(),n.font=d.string,Ite(n,_),A=0;A<x.length;++A)P=x[A],_.backdrop&&Pte(n,_.backdrop),s&&(_.strokeColor&&(n.strokeStyle=_.strokeColor),Rs(_.strokeWidth)||(n.lineWidth=_.strokeWidth),n.strokeText(P,o,u,_.maxWidth)),n.fillText(P,o,u,_.maxWidth),Mte(n,o,u,P,_),u+=Number(d.lineHeight);n.restore()}function zy(n,t){const{x:o,y:u,w:d,h:_,radius:x}=t;n.arc(o+x.topLeft,u+x.topLeft,x.topLeft,1.5*Mr,Mr,!0),n.lineTo(o,u+_-x.bottomLeft),n.arc(o+x.bottomLeft,u+_-x.bottomLeft,x.bottomLeft,Mr,ao,!0),n.lineTo(o+d-x.bottomRight,u+_),n.arc(o+d-x.bottomRight,u+_-x.bottomRight,x.bottomRight,ao,0,!0),n.lineTo(o+d,u+x.topRight),n.arc(o+d-x.topRight,u+x.topRight,x.topRight,0,-ao,!0),n.lineTo(o+x.topLeft,u)}const Dte=/^(normal|(\d+(?:\.\d+)?)(px|em|%)?)$/,kte=/^(normal|italic|initial|inherit|unset|(oblique( -?[0-9]?[0-9]deg)?))$/;function Lte(n,t){const o=(""+n).match(Dte);if(!o||o[1]==="normal")return t*1.2;switch(n=+o[2],o[3]){case"px":return n;case"%":n/=100;break}return t*n}const Rte=n=>+n||0;function gS(n,t){const o={},u=Bs(t),d=u?Object.keys(t):t,_=Bs(n)?u?x=>us(n[x],n[t[x]]):x=>n[x]:()=>n;for(const x of d)o[x]=Rte(_(x));return o}function YL(n){return gS(n,{top:"y",right:"x",bottom:"y",left:"x"})}function wp(n){return gS(n,["topLeft","topRight","bottomLeft","bottomRight"])}function ma(n){const t=YL(n);return t.width=t.left+t.right,t.height=t.top+t.bottom,t}function Io(n,t){n=n||{},t=t||zr.font;let o=us(n.size,t.size);typeof o=="string"&&(o=parseInt(o,10));let u=us(n.style,t.style);u&&!(""+u).match(kte)&&(console.warn('Invalid font style specified: "'+u+'"'),u=void 0);const d={family:us(n.family,t.family),lineHeight:Lte(us(n.lineHeight,t.lineHeight),o),size:o,style:u,weight:us(n.weight,t.weight),string:""};return d.string=Ste(d),d}function X_(n,t,o,u){let d,_,x;for(d=0,_=n.length;d<_;++d)if(x=n[d],x!==void 0&&x!==void 0)return x}function Ote(n,t,o){const{min:u,max:d}=n,_=BL(t,(d-u)/2),x=(s,A)=>o&&s===0?0:s+A;return{min:x(u,-Math.abs(_)),max:x(d,_)}}function uf(n,t){return Object.assign(Object.create(n),t)}function _S(n,t=[""],o,u,d=()=>n[0]){const _=o||n;typeof u>"u"&&(u=eR("_fallback",n));const x={[Symbol.toStringTag]:"Object",_cacheable:!0,_scopes:n,_rootScopes:_,_fallback:u,_getTarget:d,override:s=>_S([s,...n],t,_,u)};return new Proxy(x,{deleteProperty(s,A){return delete s[A],delete s._keys,delete n[0][A],!0},get(s,A){return JL(s,A,()=>Ute(A,t,n,s))},getOwnPropertyDescriptor(s,A){return Reflect.getOwnPropertyDescriptor(s._scopes[0],A)},getPrototypeOf(){return Reflect.getPrototypeOf(n[0])},has(s,A){return eP(s).includes(A)},ownKeys(s){return eP(s)},set(s,A,P){const R=s._storage||(s._storage=d());return s[A]=R[A]=P,delete s._keys,!0}})}function pg(n,t,o,u){const d={_cacheable:!1,_proxy:n,_context:t,_subProxy:o,_stack:new Set,_descriptors:KL(n,u),setContext:_=>pg(n,_,o,u),override:_=>pg(n.override(_),t,o,u)};return new Proxy(d,{deleteProperty(_,x){return delete _[x],delete n[x],!0},get(_,x,s){return JL(_,x,()=>Fte(_,x,s))},getOwnPropertyDescriptor(_,x){return _._descriptors.allKeys?Reflect.has(n,x)?{enumerable:!0,configurable:!0}:void 0:Reflect.getOwnPropertyDescriptor(n,x)},getPrototypeOf(){return Reflect.getPrototypeOf(n)},has(_,x){return Reflect.has(n,x)},ownKeys(){return Reflect.ownKeys(n)},set(_,x,s){return n[x]=s,delete _[x],!0}})}function KL(n,t={scriptable:!0,indexable:!0}){const{_scriptable:o=t.scriptable,_indexable:u=t.indexable,_allKeys:d=t.allKeys}=n;return{allKeys:d,scriptable:o,indexable:u,isScriptable:tf(o)?o:()=>o,isIndexable:tf(u)?u:()=>u}}const zte=(n,t)=>n?n+hS(t):t,yS=(n,t)=>Bs(t)&&n!=="adapters"&&(Object.getPrototypeOf(t)===null||t.constructor===Object);function JL(n,t,o){if(Object.prototype.hasOwnProperty.call(n,t)||t==="constructor")return n[t];const u=o();return n[t]=u,u}function Fte(n,t,o){const{_proxy:u,_context:d,_subProxy:_,_descriptors:x}=n;let s=u[t];return tf(s)&&x.isScriptable(t)&&(s=Bte(t,s,n,o)),Or(s)&&s.length&&(s=Nte(t,s,n,x.isIndexable)),yS(t,s)&&(s=pg(s,d,_&&_[t],x)),s}function Bte(n,t,o,u){const{_proxy:d,_context:_,_subProxy:x,_stack:s}=o;if(s.has(n))throw new Error("Recursion detected: "+Array.from(s).join("->")+"->"+n);s.add(n);let A=t(_,x||u);return s.delete(n),yS(n,A)&&(A=vS(d._scopes,d,n,A)),A}function Nte(n,t,o,u){const{_proxy:d,_context:_,_subProxy:x,_descriptors:s}=o;if(typeof _.index<"u"&&u(n))return t[_.index%t.length];if(Bs(t[0])){const A=t,P=d._scopes.filter(R=>R!==A);t=[];for(const R of A){const V=vS(P,d,n,R);t.push(pg(V,_,x&&x[n],s))}}return t}function QL(n,t,o){return tf(n)?n(t,o):n}const Vte=(n,t)=>n===!0?t:typeof n=="string"?ef(t,n):void 0;function $te(n,t,o,u,d){for(const _ of t){const x=Vte(o,_);if(x){n.add(x);const s=QL(x._fallback,o,d);if(typeof s<"u"&&s!==o&&s!==u)return s}else if(x===!1&&typeof u<"u"&&o!==u)return null}return!1}function vS(n,t,o,u){const d=t._rootScopes,_=QL(t._fallback,o,u),x=[...n,...d],s=new Set;s.add(u);let A=QM(s,x,o,_||o,u);return A===null||typeof _<"u"&&_!==o&&(A=QM(s,x,_,A,u),A===null)?!1:_S(Array.from(s),[""],d,_,()=>jte(t,o,u))}function QM(n,t,o,u,d){for(;o;)o=$te(n,t,o,u,d);return o}function jte(n,t,o){const u=n._getTarget();t in u||(u[t]={});const d=u[t];return Or(d)&&Bs(o)?o:d||{}}function Ute(n,t,o,u){let d;for(const _ of t)if(d=eR(zte(_,n),o),typeof d<"u")return yS(n,d)?vS(o,u,n,d):d}function eR(n,t){for(const o of t){if(!o)continue;const u=o[n];if(typeof u<"u")return u}}function eP(n){let t=n._keys;return t||(t=n._keys=Hte(n._scopes)),t}function Hte(n){const t=new Set;for(const o of n)for(const u of Object.keys(o).filter(d=>!d.startsWith("_")))t.add(u);return Array.from(t)}function tR(n,t,o,u){const{iScale:d}=n,{key:_="r"}=this._parsing,x=new Array(u);let s,A,P,R;for(s=0,A=u;s<A;++s)P=s+o,R=t[P],x[s]={r:d.parse(ef(R,_),P)};return x}const Gte=Number.EPSILON||1e-14,mg=(n,t)=>t<n.length&&!n[t].skip&&n[t],iR=n=>n==="x"?"y":"x";function Wte(n,t,o,u){const d=n.skip?t:n,_=t,x=o.skip?t:o,s=W2(_,d),A=W2(x,_);let P=s/(s+A),R=A/(s+A);P=isNaN(P)?0:P,R=isNaN(R)?0:R;const V=u*P,j=u*R;return{previous:{x:_.x-V*(x.x-d.x),y:_.y-V*(x.y-d.y)},next:{x:_.x+j*(x.x-d.x),y:_.y+j*(x.y-d.y)}}}function qte(n,t,o){const u=n.length;let d,_,x,s,A,P=mg(n,0);for(let R=0;R<u-1;++R)if(A=P,P=mg(n,R+1),!(!A||!P)){if(fy(t[R],0,Gte)){o[R]=o[R+1]=0;continue}d=o[R]/t[R],_=o[R+1]/t[R],s=Math.pow(d,2)+Math.pow(_,2),!(s<=9)&&(x=3/Math.sqrt(s),o[R]=d*x*t[R],o[R+1]=_*x*t[R])}}function Zte(n,t,o="x"){const u=iR(o),d=n.length;let _,x,s,A=mg(n,0);for(let P=0;P<d;++P){if(x=s,s=A,A=mg(n,P+1),!s)continue;const R=s[o],V=s[u];x&&(_=(R-x[o])/3,s[`cp1${o}`]=R-_,s[`cp1${u}`]=V-_*t[P]),A&&(_=(A[o]-R)/3,s[`cp2${o}`]=R+_,s[`cp2${u}`]=V+_*t[P])}}function Xte(n,t="x"){const o=iR(t),u=n.length,d=Array(u).fill(0),_=Array(u);let x,s,A,P=mg(n,0);for(x=0;x<u;++x)if(s=A,A=P,P=mg(n,x+1),!!A){if(P){const R=P[t]-A[t];d[x]=R!==0?(P[o]-A[o])/R:0}_[x]=s?P?Eu(d[x-1])!==Eu(d[x])?0:(d[x-1]+d[x])/2:d[x-1]:d[x]}qte(n,d,_),Zte(n,_,t)}function Fv(n,t,o){return Math.max(Math.min(n,o),t)}function Yte(n,t){let o,u,d,_,x,s=Sh(n[0],t);for(o=0,u=n.length;o<u;++o)x=_,_=s,s=o<u-1&&Sh(n[o+1],t),_&&(d=n[o],x&&(d.cp1x=Fv(d.cp1x,t.left,t.right),d.cp1y=Fv(d.cp1y,t.top,t.bottom)),s&&(d.cp2x=Fv(d.cp2x,t.left,t.right),d.cp2y=Fv(d.cp2y,t.top,t.bottom)))}function Kte(n,t,o,u,d){let _,x,s,A;if(t.spanGaps&&(n=n.filter(P=>!P.skip)),t.cubicInterpolationMode==="monotone")Xte(n,d);else{let P=u?n[n.length-1]:n[0];for(_=0,x=n.length;_<x;++_)s=n[_],A=Wte(P,s,n[Math.min(_+1,x-(u?0:1))%x],t.tension),s.cp1x=A.previous.x,s.cp1y=A.previous.y,s.cp2x=A.next.x,s.cp2y=A.next.y,P=s}t.capBezierPoints&&Yte(n,o)}function xS(){return typeof window<"u"&&typeof document<"u"}function bS(n){let t=n.parentNode;return t&&t.toString()==="[object ShadowRoot]"&&(t=t.host),t}function zx(n,t,o){let u;return typeof n=="string"?(u=parseInt(n,10),n.indexOf("%")!==-1&&(u=u/100*t.parentNode[o])):u=n,u}const T1=n=>n.ownerDocument.defaultView.getComputedStyle(n,null);function Jte(n,t){return T1(n).getPropertyValue(t)}const Qte=["top","right","bottom","left"];function Tp(n,t,o){const u={};o=o?"-"+o:"";for(let d=0;d<4;d++){const _=Qte[d];u[_]=parseFloat(n[t+"-"+_+o])||0}return u.width=u.left+u.right,u.height=u.top+u.bottom,u}const eie=(n,t,o)=>(n>0||t>0)&&(!o||!o.shadowRoot);function tie(n,t){const o=n.touches,u=o&&o.length?o[0]:n,{offsetX:d,offsetY:_}=u;let x=!1,s,A;if(eie(d,_,n.target))s=d,A=_;else{const P=t.getBoundingClientRect();s=u.clientX-P.left,A=u.clientY-P.top,x=!0}return{x:s,y:A,box:x}}function hp(n,t){if("native"in n)return n;const{canvas:o,currentDevicePixelRatio:u}=t,d=T1(o),_=d.boxSizing==="border-box",x=Tp(d,"padding"),s=Tp(d,"border","width"),{x:A,y:P,box:R}=tie(n,o),V=x.left+(R&&s.left),j=x.top+(R&&s.top);let{width:Q,height:me}=t;return _&&(Q-=x.width+s.width,me-=x.height+s.height),{x:Math.round((A-V)/Q*o.width/u),y:Math.round((P-j)/me*o.height/u)}}function iie(n,t,o){let u,d;if(t===void 0||o===void 0){const _=n&&bS(n);if(!_)t=n.clientWidth,o=n.clientHeight;else{const x=_.getBoundingClientRect(),s=T1(_),A=Tp(s,"border","width"),P=Tp(s,"padding");t=x.width-P.width-A.width,o=x.height-P.height-A.height,u=zx(s.maxWidth,_,"clientWidth"),d=zx(s.maxHeight,_,"clientHeight")}}return{width:t,height:o,maxWidth:u||Rx,maxHeight:d||Rx}}const Bv=n=>Math.round(n*10)/10;function nie(n,t,o,u){const d=T1(n),_=Tp(d,"margin"),x=zx(d.maxWidth,n,"clientWidth")||Rx,s=zx(d.maxHeight,n,"clientHeight")||Rx,A=iie(n,t,o);let{width:P,height:R}=A;if(d.boxSizing==="content-box"){const j=Tp(d,"border","width"),Q=Tp(d,"padding");P-=Q.width+j.width,R-=Q.height+j.height}return P=Math.max(0,P-_.width),R=Math.max(0,u?P/u:R-_.height),P=Bv(Math.min(P,x,A.maxWidth)),R=Bv(Math.min(R,s,A.maxHeight)),P&&!R&&(R=Bv(P/2)),(t!==void 0||o!==void 0)&&u&&A.height&&R>A.height&&(R=A.height,P=Bv(Math.floor(R*u))),{width:P,height:R}}function tP(n,t,o){const u=t||1,d=Math.floor(n.height*u),_=Math.floor(n.width*u);n.height=Math.floor(n.height),n.width=Math.floor(n.width);const x=n.canvas;return x.style&&(o||!x.style.height&&!x.style.width)&&(x.style.height=`${n.height}px`,x.style.width=`${n.width}px`),n.currentDevicePixelRatio!==u||x.height!==d||x.width!==_?(n.currentDevicePixelRatio=u,x.height=d,x.width=_,n.ctx.setTransform(u,0,0,u,0,0),!0):!1}const sie=function(){let n=!1;try{const t={get passive(){return n=!0,!1}};xS()&&(window.addEventListener("test",null,t),window.removeEventListener("test",null,t))}catch{}return n}();function iP(n,t){const o=Jte(n,t),u=o&&o.match(/^(\d+)(\.\d+)?px$/);return u?+u[1]:void 0}function dp(n,t,o,u){return{x:n.x+o*(t.x-n.x),y:n.y+o*(t.y-n.y)}}function rie(n,t,o,u){return{x:n.x+o*(t.x-n.x),y:u==="middle"?o<.5?n.y:t.y:u==="after"?o<1?n.y:t.y:o>0?t.y:n.y}}function oie(n,t,o,u){const d={x:n.cp2x,y:n.cp2y},_={x:t.cp1x,y:t.cp1y},x=dp(n,d,o),s=dp(d,_,o),A=dp(_,t,o),P=dp(x,s,o),R=dp(s,A,o);return dp(P,R,o)}const aie=function(n,t){return{x(o){return n+n+t-o},setWidth(o){t=o},textAlign(o){return o==="center"?o:o==="right"?"left":"right"},xPlus(o,u){return o-u},leftForLtr(o,u){return o-u}}},lie=function(){return{x(n){return n},setWidth(n){},textAlign(n){return n},xPlus(n,t){return n+t},leftForLtr(n,t){return n}}};function ig(n,t,o){return n?aie(t,o):lie()}function nR(n,t){let o,u;(t==="ltr"||t==="rtl")&&(o=n.canvas.style,u=[o.getPropertyValue("direction"),o.getPropertyPriority("direction")],o.setProperty("direction",t,"important"),n.prevTextDirection=u)}function sR(n,t){t!==void 0&&(delete n.prevTextDirection,n.canvas.style.setProperty("direction",t[0],t[1]))}function rR(n){return n==="angle"?{between:Oy,compare:cte,normalize:yl}:{between:wh,compare:(t,o)=>t-o,normalize:t=>t}}function nP({start:n,end:t,count:o,loop:u,style:d}){return{start:n%o,end:t%o,loop:u&&(t-n+1)%o===0,style:d}}function cie(n,t,o){const{property:u,start:d,end:_}=o,{between:x,normalize:s}=rR(u),A=t.length;let{start:P,end:R,loop:V}=n,j,Q;if(V){for(P+=A,R+=A,j=0,Q=A;j<Q&&x(s(t[P%A][u]),d,_);++j)P--,R--;P%=A,R%=A}return R<P&&(R+=A),{start:P,end:R,loop:V,style:n.style}}function oR(n,t,o){if(!o)return[n];const{property:u,start:d,end:_}=o,x=t.length,{compare:s,between:A,normalize:P}=rR(u),{start:R,end:V,loop:j,style:Q}=cie(n,t,o),me=[];let re=!1,be=null,ve,Ee,je;const Ve=()=>A(d,je,ve)&&s(d,je)!==0,Je=()=>s(_,ve)===0||A(_,je,ve),vt=()=>re||Ve(),_t=()=>!re||Je();for(let Mt=R,At=R;Mt<=V;++Mt)Ee=t[Mt%x],!Ee.skip&&(ve=P(Ee[u]),ve!==je&&(re=A(ve,d,_),be===null&&vt()&&(be=s(ve,d)===0?Mt:At),be!==null&&_t()&&(me.push(nP({start:be,end:Mt,loop:j,count:x,style:Q})),be=null),At=Mt,je=ve));return be!==null&&me.push(nP({start:be,end:V,loop:j,count:x,style:Q})),me}function aR(n,t){const o=[],u=n.segments;for(let d=0;d<u.length;d++){const _=oR(u[d],n.points,t);_.length&&o.push(..._)}return o}function uie(n,t,o,u){let d=0,_=t-1;if(o&&!u)for(;d<t&&!n[d].skip;)d++;for(;d<t&&n[d].skip;)d++;for(d%=t,o&&(_+=d);_>d&&n[_%t].skip;)_--;return _%=t,{start:d,end:_}}function hie(n,t,o,u){const d=n.length,_=[];let x=t,s=n[t],A;for(A=t+1;A<=o;++A){const P=n[A%d];P.skip||P.stop?s.skip||(u=!1,_.push({start:t%d,end:(A-1)%d,loop:u}),t=x=P.stop?A:null):(x=A,s.skip&&(t=A)),s=P}return x!==null&&_.push({start:t%d,end:x%d,loop:u}),_}function die(n,t){const o=n.points,u=n.options.spanGaps,d=o.length;if(!d)return[];const _=!!n._loop,{start:x,end:s}=uie(o,d,_,u);if(u===!0)return sP(n,[{start:x,end:s,loop:_}],o,t);const A=s<x?s+d:s,P=!!n._fullLoop&&x===0&&s===d-1;return sP(n,hie(o,x,A,P),o,t)}function sP(n,t,o,u){return!u||!u.setContext||!o?t:fie(n,t,o,u)}function fie(n,t,o,u){const d=n._chart.getContext(),_=rP(n.options),{_datasetIndex:x,options:{spanGaps:s}}=n,A=o.length,P=[];let R=_,V=t[0].start,j=V;function Q(me,re,be,ve){const Ee=s?-1:1;if(me!==re){for(me+=A;o[me%A].skip;)me-=Ee;for(;o[re%A].skip;)re+=Ee;me%A!==re%A&&(P.push({start:me%A,end:re%A,loop:be,style:ve}),R=ve,V=re%A)}}for(const me of t){V=s?V:me.start;let re=o[V%A],be;for(j=V+1;j<=me.end;j++){const ve=o[j%A];be=rP(u.setContext(uf(d,{type:"segment",p0:re,p1:ve,p0DataIndex:(j-1)%A,p1DataIndex:j%A,datasetIndex:x}))),pie(be,R)&&Q(V,j-1,me.loop,R),re=ve,R=be}V<j-1&&Q(V,j-1,me.loop,R)}return P}function rP(n){return{backgroundColor:n.backgroundColor,borderCapStyle:n.borderCapStyle,borderDash:n.borderDash,borderDashOffset:n.borderDashOffset,borderJoinStyle:n.borderJoinStyle,borderWidth:n.borderWidth,borderColor:n.borderColor}}function pie(n,t){if(!t)return!1;const o=[],u=function(d,_){return mS(_)?(o.includes(_)||o.push(_),o.indexOf(_)):_};return JSON.stringify(n,u)!==JSON.stringify(t,u)}/*! 3379 * Chart.js v4.4.8 3380 * https://www.chartjs.org 3381 * (c) 2025 Chart.js Contributors 3382 * Released under the MIT License 3383 */class mie{constructor(){this._request=null,this._charts=new Map,this._running=!1,this._lastDate=void 0}_notify(t,o,u,d){const _=o.listeners[d],x=o.duration;_.forEach(s=>s({chart:t,initial:o.initial,numSteps:x,currentStep:Math.min(u-o.start,x)}))}_refresh(){this._request||(this._running=!0,this._request=HL.call(window,()=>{this._update(),this._request=null,this._running&&this._refresh()}))}_update(t=Date.now()){let o=0;this._charts.forEach((u,d)=>{if(!u.running||!u.items.length)return;const _=u.items;let x=_.length-1,s=!1,A;for(;x>=0;--x)A=_[x],A._active?(A._total>u.duration&&(u.duration=A._total),A.tick(t),s=!0):(_[x]=_[_.length-1],_.pop());s&&(d.draw(),this._notify(d,u,t,"progress")),_.length||(u.running=!1,this._notify(d,u,t,"complete"),u.initial=!1),o+=_.length}),this._lastDate=t,o===0&&(this._running=!1)}_getAnims(t){const o=this._charts;let u=o.get(t);return u||(u={running:!1,initial:!0,items:[],listeners:{complete:[],progress:[]}},o.set(t,u)),u}listen(t,o,u){this._getAnims(t).listeners[o].push(u)}add(t,o){!o||!o.length||this._getAnims(t).items.push(...o)}has(t){return this._getAnims(t).items.length>0}start(t){const o=this._charts.get(t);o&&(o.running=!0,o.start=Date.now(),o.duration=o.items.reduce((u,d)=>Math.max(u,d._duration),0),this._refresh())}running(t){if(!this._running)return!1;const o=this._charts.get(t);return!(!o||!o.running||!o.items.length)}stop(t){const o=this._charts.get(t);if(!o||!o.items.length)return;const u=o.items;let d=u.length-1;for(;d>=0;--d)u[d].cancel();o.items=[],this._notify(t,o,Date.now(),"complete")}remove(t){return this._charts.delete(t)}}var fh=new mie;const oP="transparent",gie={boolean(n,t,o){return o>.5?t:n},color(n,t,o){const u=YM(n||oP),d=u.valid&&YM(t||oP);return d&&d.valid?d.mix(u,o).hexString():t},number(n,t,o){return n+(t-n)*o}};class _ie{constructor(t,o,u,d){const _=o[u];d=X_([t.to,d,_,t.from]);const x=X_([t.from,_,d]);this._active=!0,this._fn=t.fn||gie[t.type||typeof x],this._easing=py[t.easing]||py.linear,this._start=Math.floor(Date.now()+(t.delay||0)),this._duration=this._total=Math.floor(t.duration),this._loop=!!t.loop,this._target=o,this._prop=u,this._from=x,this._to=d,this._promises=void 0}active(){return this._active}update(t,o,u){if(this._active){this._notify(!1);const d=this._target[this._prop],_=u-this._start,x=this._duration-_;this._start=u,this._duration=Math.floor(Math.max(x,t.duration)),this._total+=_,this._loop=!!t.loop,this._to=X_([t.to,o,d,t.from]),this._from=X_([t.from,d,o])}}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}tick(t){const o=t-this._start,u=this._duration,d=this._prop,_=this._from,x=this._loop,s=this._to;let A;if(this._active=_!==s&&(x||o<u),!this._active){this._target[d]=s,this._notify(!0);return}if(o<0){this._target[d]=_;return}A=o/u%2,A=x&&A>1?2-A:A,A=this._easing(Math.min(1,Math.max(0,A))),this._target[d]=this._fn(_,s,A)}wait(){const t=this._promises||(this._promises=[]);return new Promise((o,u)=>{t.push({res:o,rej:u})})}_notify(t){const o=t?"res":"rej",u=this._promises||[];for(let d=0;d<u.length;d++)u[d][o]()}}class lR{constructor(t,o){this._chart=t,this._properties=new Map,this.configure(o)}configure(t){if(!Bs(t))return;const o=Object.keys(zr.animation),u=this._properties;Object.getOwnPropertyNames(t).forEach(d=>{const _=t[d];if(!Bs(_))return;const x={};for(const s of o)x[s]=_[s];(Or(_.properties)&&_.properties||[d]).forEach(s=>{(s===d||!u.has(s))&&u.set(s,x)})})}_animateOptions(t,o){const u=o.options,d=vie(t,u);if(!d)return[];const _=this._createAnimations(d,u);return u.$shared&&yie(t.options.$animations,u).then(()=>{t.options=u},()=>{}),_}_createAnimations(t,o){const u=this._properties,d=[],_=t.$animations||(t.$animations={}),x=Object.keys(o),s=Date.now();let A;for(A=x.length-1;A>=0;--A){const P=x[A];if(P.charAt(0)==="$")continue;if(P==="options"){d.push(...this._animateOptions(t,o));continue}const R=o[P];let V=_[P];const j=u.get(P);if(V)if(j&&V.active()){V.update(j,R,s);continue}else V.cancel();if(!j||!j.duration){t[P]=R;continue}_[P]=V=new _ie(j,t,P,R),d.push(V)}return d}update(t,o){if(this._properties.size===0){Object.assign(t,o);return}const u=this._createAnimations(t,o);if(u.length)return fh.add(this._chart,u),!0}}function yie(n,t){const o=[],u=Object.keys(t);for(let d=0;d<u.length;d++){const _=n[u[d]];_&&_.active()&&o.push(_.wait())}return Promise.all(o)}function vie(n,t){if(!t)return;let o=n.options;if(!o){n.options=t;return}return o.$shared&&(n.options=o=Object.assign({},o,{$shared:!1,$animations:{}})),o}function aP(n,t){const o=n&&n.options||{},u=o.reverse,d=o.min===void 0?t:0,_=o.max===void 0?t:0;return{start:u?_:d,end:u?d:_}}function xie(n,t,o){if(o===!1)return!1;const u=aP(n,o),d=aP(t,o);return{top:d.end,right:u.end,bottom:d.start,left:u.start}}function bie(n){let t,o,u,d;return Bs(n)?(t=n.top,o=n.right,u=n.bottom,d=n.left):t=o=u=d=n,{top:t,right:o,bottom:u,left:d,disabled:n===!1}}function cR(n,t){const o=[],u=n._getSortedDatasetMetas(t);let d,_;for(d=0,_=u.length;d<_;++d)o.push(u[d].index);return o}function lP(n,t,o,u={}){const d=n.keys,_=u.mode==="single";let x,s,A,P;if(t===null)return;let R=!1;for(x=0,s=d.length;x<s;++x){if(A=+d[x],A===o){if(R=!0,u.all)continue;break}P=n.values[A],Yr(P)&&(_||t===0||Eu(t)===Eu(P))&&(t+=P)}return!R&&!u.all?0:t}function wie(n,t){const{iScale:o,vScale:u}=t,d=o.axis==="x"?"x":"y",_=u.axis==="x"?"x":"y",x=Object.keys(n),s=new Array(x.length);let A,P,R;for(A=0,P=x.length;A<P;++A)R=x[A],s[A]={[d]:R,[_]:n[R]};return s}function Ww(n,t){const o=n&&n.options.stacked;return o||o===void 0&&t.stack!==void 0}function Tie(n,t,o){return`${n.id}.${t.id}.${o.stack||o.type}`}function Sie(n){const{min:t,max:o,minDefined:u,maxDefined:d}=n.getUserBounds();return{min:u?t:Number.NEGATIVE_INFINITY,max:d?o:Number.POSITIVE_INFINITY}}function Eie(n,t,o){const u=n[t]||(n[t]={});return u[o]||(u[o]={})}function cP(n,t,o,u){for(const d of t.getMatchingVisibleMetas(u).reverse()){const _=n[d.index];if(o&&_>0||!o&&_<0)return d.index}return null}function uP(n,t){const{chart:o,_cachedMeta:u}=n,d=o._stacks||(o._stacks={}),{iScale:_,vScale:x,index:s}=u,A=_.axis,P=x.axis,R=Tie(_,x,u),V=t.length;let j;for(let Q=0;Q<V;++Q){const me=t[Q],{[A]:re,[P]:be}=me,ve=me._stacks||(me._stacks={});j=ve[P]=Eie(d,R,re),j[s]=be,j._top=cP(j,x,!0,u.type),j._bottom=cP(j,x,!1,u.type);const Ee=j._visualValues||(j._visualValues={});Ee[s]=be}}function qw(n,t){const o=n.scales;return Object.keys(o).filter(u=>o[u].axis===t).shift()}function Aie(n,t){return uf(n,{active:!1,dataset:void 0,datasetIndex:t,index:t,mode:"default",type:"dataset"})}function Cie(n,t,o){return uf(n,{active:!1,dataIndex:t,parsed:void 0,raw:void 0,element:o,index:t,mode:"default",type:"data"})}function V_(n,t){const o=n.controller.index,u=n.vScale&&n.vScale.axis;if(u){t=t||n._parsed;for(const d of t){const _=d._stacks;if(!_||_[u]===void 0||_[u][o]===void 0)return;delete _[u][o],_[u]._visualValues!==void 0&&_[u]._visualValues[o]!==void 0&&delete _[u]._visualValues[o]}}}const Zw=n=>n==="reset"||n==="none",hP=(n,t)=>t?n:Object.assign({},n),Iie=(n,t,o)=>n&&!t.hidden&&t._stacked&&{keys:cR(o,!0),values:null};class Oc{constructor(t,o){this.chart=t,this._ctx=t.ctx,this.index=o,this._cachedDataOpts={},this._cachedMeta=this.getMeta(),this._type=this._cachedMeta.type,this.options=void 0,this._parsing=!1,this._data=void 0,this._objectData=void 0,this._sharedOptions=void 0,this._drawStart=void 0,this._drawCount=void 0,this.enableOptionSharing=!1,this.supportsDecimation=!1,this.$context=void 0,this._syncList=[],this.datasetElementType=new.target.datasetElementType,this.dataElementType=new.target.dataElementType,this.initialize()}initialize(){const t=this._cachedMeta;this.configure(),this.linkScales(),t._stacked=Ww(t.vScale,t),this.addElements(),this.options.fill&&!this.chart.isPluginEnabled("filler")&&console.warn("Tried to use the 'fill' option without the 'Filler' plugin enabled. Please import and register the 'Filler' plugin and make sure it is not disabled in the options")}updateIndex(t){this.index!==t&&V_(this._cachedMeta),this.index=t}linkScales(){const t=this.chart,o=this._cachedMeta,u=this.getDataset(),d=(V,j,Q,me)=>V==="x"?j:V==="r"?me:Q,_=o.xAxisID=us(u.xAxisID,qw(t,"x")),x=o.yAxisID=us(u.yAxisID,qw(t,"y")),s=o.rAxisID=us(u.rAxisID,qw(t,"r")),A=o.indexAxis,P=o.iAxisID=d(A,_,x,s),R=o.vAxisID=d(A,x,_,s);o.xScale=this.getScaleForId(_),o.yScale=this.getScaleForId(x),o.rScale=this.getScaleForId(s),o.iScale=this.getScaleForId(P),o.vScale=this.getScaleForId(R)}getDataset(){return this.chart.data.datasets[this.index]}getMeta(){return this.chart.getDatasetMeta(this.index)}getScaleForId(t){return this.chart.scales[t]}_getOtherScale(t){const o=this._cachedMeta;return t===o.iScale?o.vScale:o.iScale}reset(){this._update("reset")}_destroy(){const t=this._cachedMeta;this._data&&qM(this._data,this),t._stacked&&V_(t)}_dataCheck(){const t=this.getDataset(),o=t.data||(t.data=[]),u=this._data;if(Bs(o)){const d=this._cachedMeta;this._data=wie(o,d)}else if(u!==o){if(u){qM(u,this);const d=this._cachedMeta;V_(d),d._parsed=[]}o&&Object.isExtensible(o)&&fte(o,this),this._syncList=[],this._data=o}}addElements(){const t=this._cachedMeta;this._dataCheck(),this.datasetElementType&&(t.dataset=new this.datasetElementType)}buildOrUpdateElements(t){const o=this._cachedMeta,u=this.getDataset();let d=!1;this._dataCheck();const _=o._stacked;o._stacked=Ww(o.vScale,o),o.stack!==u.stack&&(d=!0,V_(o),o.stack=u.stack),this._resyncElements(t),(d||_!==o._stacked)&&(uP(this,o._parsed),o._stacked=Ww(o.vScale,o))}configure(){const t=this.chart.config,o=t.datasetScopeKeys(this._type),u=t.getOptionScopes(this.getDataset(),o,!0);this.options=t.createResolver(u,this.getContext()),this._parsing=this.options.parsing,this._cachedDataOpts={}}parse(t,o){const{_cachedMeta:u,_data:d}=this,{iScale:_,_stacked:x}=u,s=_.axis;let A=t===0&&o===d.length?!0:u._sorted,P=t>0&&u._parsed[t-1],R,V,j;if(this._parsing===!1)u._parsed=d,u._sorted=!0,j=d;else{Or(d[t])?j=this.parseArrayData(u,d,t,o):Bs(d[t])?j=this.parseObjectData(u,d,t,o):j=this.parsePrimitiveData(u,d,t,o);const Q=()=>V[s]===null||P&&V[s]<P[s];for(R=0;R<o;++R)u._parsed[R+t]=V=j[R],A&&(Q()&&(A=!1),P=V);u._sorted=A}x&&uP(this,j)}parsePrimitiveData(t,o,u,d){const{iScale:_,vScale:x}=t,s=_.axis,A=x.axis,P=_.getLabels(),R=_===x,V=new Array(d);let j,Q,me;for(j=0,Q=d;j<Q;++j)me=j+u,V[j]={[s]:R||_.parse(P[me],me),[A]:x.parse(o[me],me)};return V}parseArrayData(t,o,u,d){const{xScale:_,yScale:x}=t,s=new Array(d);let A,P,R,V;for(A=0,P=d;A<P;++A)R=A+u,V=o[R],s[A]={x:_.parse(V[0],R),y:x.parse(V[1],R)};return s}parseObjectData(t,o,u,d){const{xScale:_,yScale:x}=t,{xAxisKey:s="x",yAxisKey:A="y"}=this._parsing,P=new Array(d);let R,V,j,Q;for(R=0,V=d;R<V;++R)j=R+u,Q=o[j],P[R]={x:_.parse(ef(Q,s),j),y:x.parse(ef(Q,A),j)};return P}getParsed(t){return this._cachedMeta._parsed[t]}getDataElement(t){return this._cachedMeta.data[t]}applyStack(t,o,u){const d=this.chart,_=this._cachedMeta,x=o[t.axis],s={keys:cR(d,!0),values:o._stacks[t.axis]._visualValues};return lP(s,x,_.index,{mode:u})}updateRangeFromParsed(t,o,u,d){const _=u[o.axis];let x=_===null?NaN:_;const s=d&&u._stacks[o.axis];d&&s&&(d.values=s,x=lP(d,_,this._cachedMeta.index)),t.min=Math.min(t.min,x),t.max=Math.max(t.max,x)}getMinMax(t,o){const u=this._cachedMeta,d=u._parsed,_=u._sorted&&t===u.iScale,x=d.length,s=this._getOtherScale(t),A=Iie(o,u,this.chart),P={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY},{min:R,max:V}=Sie(s);let j,Q;function me(){Q=d[j];const re=Q[s.axis];return!Yr(Q[t.axis])||R>re||V<re}for(j=0;j<x&&!(!me()&&(this.updateRangeFromParsed(P,t,Q,A),_));++j);if(_){for(j=x-1;j>=0;--j)if(!me()){this.updateRangeFromParsed(P,t,Q,A);break}}return P}getAllParsedValues(t){const o=this._cachedMeta._parsed,u=[];let d,_,x;for(d=0,_=o.length;d<_;++d)x=o[d][t.axis],Yr(x)&&u.push(x);return u}getMaxOverflow(){return!1}getLabelAndValue(t){const o=this._cachedMeta,u=o.iScale,d=o.vScale,_=this.getParsed(t);return{label:u?""+u.getLabelForValue(_[u.axis]):"",value:d?""+d.getLabelForValue(_[d.axis]):""}}_update(t){const o=this._cachedMeta;this.update(t||"default"),o._clip=bie(us(this.options.clip,xie(o.xScale,o.yScale,this.getMaxOverflow())))}update(t){}draw(){const t=this._ctx,o=this.chart,u=this._cachedMeta,d=u.data||[],_=o.chartArea,x=[],s=this._drawStart||0,A=this._drawCount||d.length-s,P=this.options.drawActiveElementsOnTop;let R;for(u.dataset&&u.dataset.draw(t,_,s,A),R=s;R<s+A;++R){const V=d[R];V.hidden||(V.active&&P?x.push(V):V.draw(t,_))}for(R=0;R<x.length;++R)x[R].draw(t,_)}getStyle(t,o){const u=o?"active":"default";return t===void 0&&this._cachedMeta.dataset?this.resolveDatasetElementOptions(u):this.resolveDataElementOptions(t||0,u)}getContext(t,o,u){const d=this.getDataset();let _;if(t>=0&&t<this._cachedMeta.data.length){const x=this._cachedMeta.data[t];_=x.$context||(x.$context=Cie(this.getContext(),t,x)),_.parsed=this.getParsed(t),_.raw=d.data[t],_.index=_.dataIndex=t}else _=this.$context||(this.$context=Aie(this.chart.getContext(),this.index)),_.dataset=d,_.index=_.datasetIndex=this.index;return _.active=!!o,_.mode=u,_}resolveDatasetElementOptions(t){return this._resolveElementOptions(this.datasetElementType.id,t)}resolveDataElementOptions(t,o){return this._resolveElementOptions(this.dataElementType.id,o,t)}_resolveElementOptions(t,o="default",u){const d=o==="active",_=this._cachedDataOpts,x=t+"-"+o,s=_[x],A=this.enableOptionSharing&&Ry(u);if(s)return hP(s,A);const P=this.chart.config,R=P.datasetElementScopeKeys(this._type,t),V=d?[`${t}Hover`,"hover",t,""]:[t,""],j=P.getOptionScopes(this.getDataset(),R),Q=Object.keys(zr.elements[t]),me=()=>this.getContext(u,d,o),re=P.resolveNamedOptions(j,Q,me,V);return re.$shared&&(re.$shared=A,_[x]=Object.freeze(hP(re,A))),re}_resolveAnimations(t,o,u){const d=this.chart,_=this._cachedDataOpts,x=`animation-${o}`,s=_[x];if(s)return s;let A;if(d.options.animation!==!1){const R=this.chart.config,V=R.datasetAnimationScopeKeys(this._type,o),j=R.getOptionScopes(this.getDataset(),V);A=R.createResolver(j,this.getContext(t,u,o))}const P=new lR(d,A&&A.animations);return A&&A._cacheable&&(_[x]=Object.freeze(P)),P}getSharedOptions(t){if(t.$shared)return this._sharedOptions||(this._sharedOptions=Object.assign({},t))}includeOptions(t,o){return!o||Zw(t)||this.chart._animationsDisabled}_getSharedOptions(t,o){const u=this.resolveDataElementOptions(t,o),d=this._sharedOptions,_=this.getSharedOptions(u),x=this.includeOptions(o,_)||_!==d;return this.updateSharedOptions(_,o,u),{sharedOptions:_,includeOptions:x}}updateElement(t,o,u,d){Zw(d)?Object.assign(t,u):this._resolveAnimations(o,d).update(t,u)}updateSharedOptions(t,o,u){t&&!Zw(o)&&this._resolveAnimations(void 0,o).update(t,u)}_setStyle(t,o,u,d){t.active=d;const _=this.getStyle(o,d);this._resolveAnimations(o,u,d).update(t,{options:!d&&this.getSharedOptions(_)||_})}removeHoverStyle(t,o,u){this._setStyle(t,u,"active",!1)}setHoverStyle(t,o,u){this._setStyle(t,u,"active",!0)}_removeDatasetHoverStyle(){const t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!1)}_setDatasetHoverStyle(){const t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!0)}_resyncElements(t){const o=this._data,u=this._cachedMeta.data;for(const[s,A,P]of this._syncList)this[s](A,P);this._syncList=[];const d=u.length,_=o.length,x=Math.min(_,d);x&&this.parse(0,x),_>d?this._insertElements(d,_-d,t):_<d&&this._removeElements(_,d-_)}_insertElements(t,o,u=!0){const d=this._cachedMeta,_=d.data,x=t+o;let s;const A=P=>{for(P.length+=o,s=P.length-1;s>=x;s--)P[s]=P[s-o]};for(A(_),s=t;s<x;++s)_[s]=new this.dataElementType;this._parsing&&A(d._parsed),this.parse(t,o),u&&this.updateElements(_,t,o,"reset")}updateElements(t,o,u,d){}_removeElements(t,o){const u=this._cachedMeta;if(this._parsing){const d=u._parsed.splice(t,o);u._stacked&&V_(u,d)}u.data.splice(t,o)}_sync(t){if(this._parsing)this._syncList.push(t);else{const[o,u,d]=t;this[o](u,d)}this.chart._dataChanges.push([this.index,...t])}_onDataPush(){const t=arguments.length;this._sync(["_insertElements",this.getDataset().data.length-t,t])}_onDataPop(){this._sync(["_removeElements",this._cachedMeta.data.length-1,1])}_onDataShift(){this._sync(["_removeElements",0,1])}_onDataSplice(t,o){o&&this._sync(["_removeElements",t,o]);const u=arguments.length-2;u&&this._sync(["_insertElements",t,u])}_onDataUnshift(){this._sync(["_insertElements",0,arguments.length])}}zi(Oc,"defaults",{}),zi(Oc,"datasetElementType",null),zi(Oc,"dataElementType",null);function Mie(n,t){if(!n._cache.$bar){const o=n.getMatchingVisibleMetas(t);let u=[];for(let d=0,_=o.length;d<_;d++)u=u.concat(o[d].controller.getAllParsedValues(n));n._cache.$bar=UL(u.sort((d,_)=>d-_))}return n._cache.$bar}function Pie(n){const t=n.iScale,o=Mie(t,n.type);let u=t._length,d,_,x,s;const A=()=>{x===32767||x===-32768||(Ry(s)&&(u=Math.min(u,Math.abs(x-s)||u)),s=x)};for(d=0,_=o.length;d<_;++d)x=t.getPixelForValue(o[d]),A();for(s=void 0,d=0,_=t.ticks.length;d<_;++d)x=t.getPixelForTick(d),A();return u}function Die(n,t,o,u){const d=o.barThickness;let _,x;return Rs(d)?(_=t.min*o.categoryPercentage,x=o.barPercentage):(_=d*u,x=1),{chunk:_/u,ratio:x,start:t.pixels[n]-_/2}}function kie(n,t,o,u){const d=t.pixels,_=d[n];let x=n>0?d[n-1]:null,s=n<d.length-1?d[n+1]:null;const A=o.categoryPercentage;x===null&&(x=_-(s===null?t.end-t.start:s-_)),s===null&&(s=_+_-x);const P=_-(_-Math.min(x,s))/2*A;return{chunk:Math.abs(s-x)/2*A/u,ratio:o.barPercentage,start:P}}function Lie(n,t,o,u){const d=o.parse(n[0],u),_=o.parse(n[1],u),x=Math.min(d,_),s=Math.max(d,_);let A=x,P=s;Math.abs(x)>Math.abs(s)&&(A=s,P=x),t[o.axis]=P,t._custom={barStart:A,barEnd:P,start:d,end:_,min:x,max:s}}function uR(n,t,o,u){return Or(n)?Lie(n,t,o,u):t[o.axis]=o.parse(n,u),t}function dP(n,t,o,u){const d=n.iScale,_=n.vScale,x=d.getLabels(),s=d===_,A=[];let P,R,V,j;for(P=o,R=o+u;P<R;++P)j=t[P],V={},V[d.axis]=s||d.parse(x[P],P),A.push(uR(j,V,_,P));return A}function Xw(n){return n&&n.barStart!==void 0&&n.barEnd!==void 0}function Rie(n,t,o){return n!==0?Eu(n):(t.isHorizontal()?1:-1)*(t.min>=o?1:-1)}function Oie(n){let t,o,u,d,_;return n.horizontal?(t=n.base>n.x,o="left",u="right"):(t=n.base<n.y,o="bottom",u="top"),t?(d="end",_="start"):(d="start",_="end"),{start:o,end:u,reverse:t,top:d,bottom:_}}function zie(n,t,o,u){let d=t.borderSkipped;const _={};if(!d){n.borderSkipped=_;return}if(d===!0){n.borderSkipped={top:!0,right:!0,bottom:!0,left:!0};return}const{start:x,end:s,reverse:A,top:P,bottom:R}=Oie(n);d==="middle"&&o&&(n.enableBorderRadius=!0,(o._top||0)===u?d=P:(o._bottom||0)===u?d=R:(_[fP(R,x,s,A)]=!0,d=P)),_[fP(d,x,s,A)]=!0,n.borderSkipped=_}function fP(n,t,o,u){return u?(n=Fie(n,t,o),n=pP(n,o,t)):n=pP(n,t,o),n}function Fie(n,t,o){return n===t?o:n===o?t:n}function pP(n,t,o){return n==="start"?t:n==="end"?o:n}function Bie(n,{inflateAmount:t},o){n.inflateAmount=t==="auto"?o===1?.33:0:t}class ax extends Oc{parsePrimitiveData(t,o,u,d){return dP(t,o,u,d)}parseArrayData(t,o,u,d){return dP(t,o,u,d)}parseObjectData(t,o,u,d){const{iScale:_,vScale:x}=t,{xAxisKey:s="x",yAxisKey:A="y"}=this._parsing,P=_.axis==="x"?s:A,R=x.axis==="x"?s:A,V=[];let j,Q,me,re;for(j=u,Q=u+d;j<Q;++j)re=o[j],me={},me[_.axis]=_.parse(ef(re,P),j),V.push(uR(ef(re,R),me,x,j));return V}updateRangeFromParsed(t,o,u,d){super.updateRangeFromParsed(t,o,u,d);const _=u._custom;_&&o===this._cachedMeta.vScale&&(t.min=Math.min(t.min,_.min),t.max=Math.max(t.max,_.max))}getMaxOverflow(){return 0}getLabelAndValue(t){const o=this._cachedMeta,{iScale:u,vScale:d}=o,_=this.getParsed(t),x=_._custom,s=Xw(x)?"["+x.start+", "+x.end+"]":""+d.getLabelForValue(_[d.axis]);return{label:""+u.getLabelForValue(_[u.axis]),value:s}}initialize(){this.enableOptionSharing=!0,super.initialize();const t=this._cachedMeta;t.stack=this.getDataset().stack}update(t){const o=this._cachedMeta;this.updateElements(o.data,0,o.data.length,t)}updateElements(t,o,u,d){const _=d==="reset",{index:x,_cachedMeta:{vScale:s}}=this,A=s.getBasePixel(),P=s.isHorizontal(),R=this._getRuler(),{sharedOptions:V,includeOptions:j}=this._getSharedOptions(o,d);for(let Q=o;Q<o+u;Q++){const me=this.getParsed(Q),re=_||Rs(me[s.axis])?{base:A,head:A}:this._calculateBarValuePixels(Q),be=this._calculateBarIndexPixels(Q,R),ve=(me._stacks||{})[s.axis],Ee={horizontal:P,base:re.base,enableBorderRadius:!ve||Xw(me._custom)||x===ve._top||x===ve._bottom,x:P?re.head:be.center,y:P?be.center:re.head,height:P?be.size:Math.abs(re.size),width:P?Math.abs(re.size):be.size};j&&(Ee.options=V||this.resolveDataElementOptions(Q,t[Q].active?"active":d));const je=Ee.options||t[Q].options;zie(Ee,je,ve,x),Bie(Ee,je,R.ratio),this.updateElement(t[Q],Q,Ee,d)}}_getStacks(t,o){const{iScale:u}=this._cachedMeta,d=u.getMatchingVisibleMetas(this._type).filter(R=>R.controller.options.grouped),_=u.options.stacked,x=[],s=this._cachedMeta.controller.getParsed(o),A=s&&s[u.axis],P=R=>{const V=R._parsed.find(Q=>Q[u.axis]===A),j=V&&V[R.vScale.axis];if(Rs(j)||isNaN(j))return!0};for(const R of d)if(!(o!==void 0&&P(R))&&((_===!1||x.indexOf(R.stack)===-1||_===void 0&&R.stack===void 0)&&x.push(R.stack),R.index===t))break;return x.length||x.push(void 0),x}_getStackCount(t){return this._getStacks(void 0,t).length}_getStackIndex(t,o,u){const d=this._getStacks(t,u),_=o!==void 0?d.indexOf(o):-1;return _===-1?d.length-1:_}_getRuler(){const t=this.options,o=this._cachedMeta,u=o.iScale,d=[];let _,x;for(_=0,x=o.data.length;_<x;++_)d.push(u.getPixelForValue(this.getParsed(_)[u.axis],_));const s=t.barThickness;return{min:s||Pie(o),pixels:d,start:u._startPixel,end:u._endPixel,stackCount:this._getStackCount(),scale:u,grouped:t.grouped,ratio:s?1:t.categoryPercentage*t.barPercentage}}_calculateBarValuePixels(t){const{_cachedMeta:{vScale:o,_stacked:u,index:d},options:{base:_,minBarLength:x}}=this,s=_||0,A=this.getParsed(t),P=A._custom,R=Xw(P);let V=A[o.axis],j=0,Q=u?this.applyStack(o,A,u):V,me,re;Q!==V&&(j=Q-V,Q=V),R&&(V=P.barStart,Q=P.barEnd-P.barStart,V!==0&&Eu(V)!==Eu(P.barEnd)&&(j=0),j+=V);const be=!Rs(_)&&!R?_:j;let ve=o.getPixelForValue(be);if(this.chart.getDataVisibility(t)?me=o.getPixelForValue(j+Q):me=ve,re=me-ve,Math.abs(re)<x){re=Rie(re,o,s)*x,V===s&&(ve-=re/2);const Ee=o.getPixelForDecimal(0),je=o.getPixelForDecimal(1),Ve=Math.min(Ee,je),Je=Math.max(Ee,je);ve=Math.max(Math.min(ve,Je),Ve),me=ve+re,u&&!R&&(A._stacks[o.axis]._visualValues[d]=o.getValueForPixel(me)-o.getValueForPixel(ve))}if(ve===o.getPixelForValue(s)){const Ee=Eu(re)*o.getLineWidthForValue(s)/2;ve+=Ee,re-=Ee}return{size:re,base:ve,head:me,center:me+re/2}}_calculateBarIndexPixels(t,o){const u=o.scale,d=this.options,_=d.skipNull,x=us(d.maxBarThickness,1/0);let s,A;if(o.grouped){const P=_?this._getStackCount(t):o.stackCount,R=d.barThickness==="flex"?kie(t,o,d,P):Die(t,o,d,P),V=this._getStackIndex(this.index,this._cachedMeta.stack,_?t:void 0);s=R.start+R.chunk*V+R.chunk/2,A=Math.min(x,R.chunk*R.ratio)}else s=u.getPixelForValue(this.getParsed(t)[u.axis],t),A=Math.min(x,o.min*o.ratio);return{base:s-A/2,head:s+A/2,center:s,size:A}}draw(){const t=this._cachedMeta,o=t.vScale,u=t.data,d=u.length;let _=0;for(;_<d;++_)this.getParsed(_)[o.axis]!==null&&!u[_].hidden&&u[_].draw(this._ctx)}}zi(ax,"id","bar"),zi(ax,"defaults",{datasetElementType:!1,dataElementType:"bar",categoryPercentage:.8,barPercentage:.9,grouped:!0,animations:{numbers:{type:"number",properties:["x","y","base","width","height"]}}}),zi(ax,"overrides",{scales:{_index_:{type:"category",offset:!0,grid:{offset:!0}},_value_:{type:"linear",beginAtZero:!0}}});class lx extends Oc{initialize(){this.enableOptionSharing=!0,super.initialize()}parsePrimitiveData(t,o,u,d){const _=super.parsePrimitiveData(t,o,u,d);for(let x=0;x<_.length;x++)_[x]._custom=this.resolveDataElementOptions(x+u).radius;return _}parseArrayData(t,o,u,d){const _=super.parseArrayData(t,o,u,d);for(let x=0;x<_.length;x++){const s=o[u+x];_[x]._custom=us(s[2],this.resolveDataElementOptions(x+u).radius)}return _}parseObjectData(t,o,u,d){const _=super.parseObjectData(t,o,u,d);for(let x=0;x<_.length;x++){const s=o[u+x];_[x]._custom=us(s&&s.r&&+s.r,this.resolveDataElementOptions(x+u).radius)}return _}getMaxOverflow(){const t=this._cachedMeta.data;let o=0;for(let u=t.length-1;u>=0;--u)o=Math.max(o,t[u].size(this.resolveDataElementOptions(u))/2);return o>0&&o}getLabelAndValue(t){const o=this._cachedMeta,u=this.chart.data.labels||[],{xScale:d,yScale:_}=o,x=this.getParsed(t),s=d.getLabelForValue(x.x),A=_.getLabelForValue(x.y),P=x._custom;return{label:u[t]||"",value:"("+s+", "+A+(P?", "+P:"")+")"}}update(t){const o=this._cachedMeta.data;this.updateElements(o,0,o.length,t)}updateElements(t,o,u,d){const _=d==="reset",{iScale:x,vScale:s}=this._cachedMeta,{sharedOptions:A,includeOptions:P}=this._getSharedOptions(o,d),R=x.axis,V=s.axis;for(let j=o;j<o+u;j++){const Q=t[j],me=!_&&this.getParsed(j),re={},be=re[R]=_?x.getPixelForDecimal(.5):x.getPixelForValue(me[R]),ve=re[V]=_?s.getBasePixel():s.getPixelForValue(me[V]);re.skip=isNaN(be)||isNaN(ve),P&&(re.options=A||this.resolveDataElementOptions(j,Q.active?"active":d),_&&(re.options.radius=0)),this.updateElement(Q,j,re,d)}}resolveDataElementOptions(t,o){const u=this.getParsed(t);let d=super.resolveDataElementOptions(t,o);d.$shared&&(d=Object.assign({},d,{$shared:!1}));const _=d.radius;return o!=="active"&&(d.radius=0),d.radius+=us(u&&u._custom,_),d}}zi(lx,"id","bubble"),zi(lx,"defaults",{datasetElementType:!1,dataElementType:"point",animations:{numbers:{type:"number",properties:["x","y","borderWidth","radius"]}}}),zi(lx,"overrides",{scales:{x:{type:"linear"},y:{type:"linear"}}});function Nie(n,t,o){let u=1,d=1,_=0,x=0;if(t<Ir){const s=n,A=s+t,P=Math.cos(s),R=Math.sin(s),V=Math.cos(A),j=Math.sin(A),Q=(je,Ve,Je)=>Oy(je,s,A,!0)?1:Math.max(Ve,Ve*o,Je,Je*o),me=(je,Ve,Je)=>Oy(je,s,A,!0)?-1:Math.min(Ve,Ve*o,Je,Je*o),re=Q(0,P,V),be=Q(ao,R,j),ve=me(Mr,P,V),Ee=me(Mr+ao,R,j);u=(re-ve)/2,d=(be-Ee)/2,_=-(re+ve)/2,x=-(be+Ee)/2}return{ratioX:u,ratioY:d,offsetX:_,offsetY:x}}class yp extends Oc{constructor(t,o){super(t,o),this.enableOptionSharing=!0,this.innerRadius=void 0,this.outerRadius=void 0,this.offsetX=void 0,this.offsetY=void 0}linkScales(){}parse(t,o){const u=this.getDataset().data,d=this._cachedMeta;if(this._parsing===!1)d._parsed=u;else{let _=A=>+u[A];if(Bs(u[t])){const{key:A="value"}=this._parsing;_=P=>+ef(u[P],A)}let x,s;for(x=t,s=t+o;x<s;++x)d._parsed[x]=_(x)}}_getRotation(){return Lc(this.options.rotation-90)}_getCircumference(){return Lc(this.options.circumference)}_getRotationExtents(){let t=Ir,o=-Ir;for(let u=0;u<this.chart.data.datasets.length;++u)if(this.chart.isDatasetVisible(u)&&this.chart.getDatasetMeta(u).type===this._type){const d=this.chart.getDatasetMeta(u).controller,_=d._getRotation(),x=d._getCircumference();t=Math.min(t,_),o=Math.max(o,_+x)}return{rotation:t,circumference:o-t}}update(t){const o=this.chart,{chartArea:u}=o,d=this._cachedMeta,_=d.data,x=this.getMaxBorderWidth()+this.getMaxOffset(_)+this.options.spacing,s=Math.max((Math.min(u.width,u.height)-x)/2,0),A=Math.min(Jee(this.options.cutout,s),1),P=this._getRingWeight(this.index),{circumference:R,rotation:V}=this._getRotationExtents(),{ratioX:j,ratioY:Q,offsetX:me,offsetY:re}=Nie(V,R,A),be=(u.width-x)/j,ve=(u.height-x)/Q,Ee=Math.max(Math.min(be,ve)/2,0),je=BL(this.options.radius,Ee),Ve=Math.max(je*A,0),Je=(je-Ve)/this._getVisibleDatasetWeightTotal();this.offsetX=me*je,this.offsetY=re*je,d.total=this.calculateTotal(),this.outerRadius=je-Je*this._getRingWeightOffset(this.index),this.innerRadius=Math.max(this.outerRadius-Je*P,0),this.updateElements(_,0,_.length,t)}_circumference(t,o){const u=this.options,d=this._cachedMeta,_=this._getCircumference();return o&&u.animation.animateRotate||!this.chart.getDataVisibility(t)||d._parsed[t]===null||d.data[t].hidden?0:this.calculateCircumference(d._parsed[t]*_/Ir)}updateElements(t,o,u,d){const _=d==="reset",x=this.chart,s=x.chartArea,P=x.options.animation,R=(s.left+s.right)/2,V=(s.top+s.bottom)/2,j=_&&P.animateScale,Q=j?0:this.innerRadius,me=j?0:this.outerRadius,{sharedOptions:re,includeOptions:be}=this._getSharedOptions(o,d);let ve=this._getRotation(),Ee;for(Ee=0;Ee<o;++Ee)ve+=this._circumference(Ee,_);for(Ee=o;Ee<o+u;++Ee){const je=this._circumference(Ee,_),Ve=t[Ee],Je={x:R+this.offsetX,y:V+this.offsetY,startAngle:ve,endAngle:ve+je,circumference:je,outerRadius:me,innerRadius:Q};be&&(Je.options=re||this.resolveDataElementOptions(Ee,Ve.active?"active":d)),ve+=je,this.updateElement(Ve,Ee,Je,d)}}calculateTotal(){const t=this._cachedMeta,o=t.data;let u=0,d;for(d=0;d<o.length;d++){const _=t._parsed[d];_!==null&&!isNaN(_)&&this.chart.getDataVisibility(d)&&!o[d].hidden&&(u+=Math.abs(_))}return u}calculateCircumference(t){const o=this._cachedMeta.total;return o>0&&!isNaN(t)?Ir*(Math.abs(t)/o):0}getLabelAndValue(t){const o=this._cachedMeta,u=this.chart,d=u.data.labels||[],_=Jy(o._parsed[t],u.options.locale);return{label:d[t]||"",value:_}}getMaxBorderWidth(t){let o=0;const u=this.chart;let d,_,x,s,A;if(!t){for(d=0,_=u.data.datasets.length;d<_;++d)if(u.isDatasetVisible(d)){x=u.getDatasetMeta(d),t=x.data,s=x.controller;break}}if(!t)return 0;for(d=0,_=t.length;d<_;++d)A=s.resolveDataElementOptions(d),A.borderAlign!=="inner"&&(o=Math.max(o,A.borderWidth||0,A.hoverBorderWidth||0));return o}getMaxOffset(t){let o=0;for(let u=0,d=t.length;u<d;++u){const _=this.resolveDataElementOptions(u);o=Math.max(o,_.offset||0,_.hoverOffset||0)}return o}_getRingWeightOffset(t){let o=0;for(let u=0;u<t;++u)this.chart.isDatasetVisible(u)&&(o+=this._getRingWeight(u));return o}_getRingWeight(t){return Math.max(us(this.chart.data.datasets[t].weight,1),0)}_getVisibleDatasetWeightTotal(){return this._getRingWeightOffset(this.chart.data.datasets.length)||1}}zi(yp,"id","doughnut"),zi(yp,"defaults",{datasetElementType:!1,dataElementType:"arc",animation:{animateRotate:!0,animateScale:!1},animations:{numbers:{type:"number",properties:["circumference","endAngle","innerRadius","outerRadius","startAngle","x","y","offset","borderWidth","spacing"]}},cutout:"50%",rotation:0,circumference:360,radius:"100%",spacing:0,indexAxis:"r"}),zi(yp,"descriptors",{_scriptable:t=>t!=="spacing",_indexable:t=>t!=="spacing"&&!t.startsWith("borderDash")&&!t.startsWith("hoverBorderDash")}),zi(yp,"overrides",{aspectRatio:1,plugins:{legend:{labels:{generateLabels(t){const o=t.data;if(o.labels.length&&o.datasets.length){const{labels:{pointStyle:u,color:d}}=t.legend.options;return o.labels.map((_,x)=>{const A=t.getDatasetMeta(0).controller.getStyle(x);return{text:_,fillStyle:A.backgroundColor,strokeStyle:A.borderColor,fontColor:d,lineWidth:A.borderWidth,pointStyle:u,hidden:!t.getDataVisibility(x),index:x}})}return[]}},onClick(t,o,u){u.chart.toggleDataVisibility(o.index),u.chart.update()}}}});class cx extends Oc{initialize(){this.enableOptionSharing=!0,this.supportsDecimation=!0,super.initialize()}update(t){const o=this._cachedMeta,{dataset:u,data:d=[],_dataset:_}=o,x=this.chart._animationsDisabled;let{start:s,count:A}=WL(o,d,x);this._drawStart=s,this._drawCount=A,qL(o)&&(s=0,A=d.length),u._chart=this.chart,u._datasetIndex=this.index,u._decimated=!!_._decimated,u.points=d;const P=this.resolveDatasetElementOptions(t);this.options.showLine||(P.borderWidth=0),P.segment=this.options.segment,this.updateElement(u,void 0,{animated:!x,options:P},t),this.updateElements(d,s,A,t)}updateElements(t,o,u,d){const _=d==="reset",{iScale:x,vScale:s,_stacked:A,_dataset:P}=this._cachedMeta,{sharedOptions:R,includeOptions:V}=this._getSharedOptions(o,d),j=x.axis,Q=s.axis,{spanGaps:me,segment:re}=this.options,be=fg(me)?me:Number.POSITIVE_INFINITY,ve=this.chart._animationsDisabled||_||d==="none",Ee=o+u,je=t.length;let Ve=o>0&&this.getParsed(o-1);for(let Je=0;Je<je;++Je){const vt=t[Je],_t=ve?vt:{};if(Je<o||Je>=Ee){_t.skip=!0;continue}const Mt=this.getParsed(Je),At=Rs(Mt[Q]),ei=_t[j]=x.getPixelForValue(Mt[j],Je),Yt=_t[Q]=_||At?s.getBasePixel():s.getPixelForValue(A?this.applyStack(s,Mt,A):Mt[Q],Je);_t.skip=isNaN(ei)||isNaN(Yt)||At,_t.stop=Je>0&&Math.abs(Mt[j]-Ve[j])>be,re&&(_t.parsed=Mt,_t.raw=P.data[Je]),V&&(_t.options=R||this.resolveDataElementOptions(Je,vt.active?"active":d)),ve||this.updateElement(vt,Je,_t,d),Ve=Mt}}getMaxOverflow(){const t=this._cachedMeta,o=t.dataset,u=o.options&&o.options.borderWidth||0,d=t.data||[];if(!d.length)return u;const _=d[0].size(this.resolveDataElementOptions(0)),x=d[d.length-1].size(this.resolveDataElementOptions(d.length-1));return Math.max(u,_,x)/2}draw(){const t=this._cachedMeta;t.dataset.updateControlPoints(this.chart.chartArea,t.iScale.axis),super.draw()}}zi(cx,"id","line"),zi(cx,"defaults",{datasetElementType:"line",dataElementType:"point",showLine:!0,spanGaps:!1}),zi(cx,"overrides",{scales:{_index_:{type:"category"},_value_:{type:"linear"}}});class gy extends Oc{constructor(t,o){super(t,o),this.innerRadius=void 0,this.outerRadius=void 0}getLabelAndValue(t){const o=this._cachedMeta,u=this.chart,d=u.data.labels||[],_=Jy(o._parsed[t].r,u.options.locale);return{label:d[t]||"",value:_}}parseObjectData(t,o,u,d){return tR.bind(this)(t,o,u,d)}update(t){const o=this._cachedMeta.data;this._updateRadius(),this.updateElements(o,0,o.length,t)}getMinMax(){const t=this._cachedMeta,o={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY};return t.data.forEach((u,d)=>{const _=this.getParsed(d).r;!isNaN(_)&&this.chart.getDataVisibility(d)&&(_<o.min&&(o.min=_),_>o.max&&(o.max=_))}),o}_updateRadius(){const t=this.chart,o=t.chartArea,u=t.options,d=Math.min(o.right-o.left,o.bottom-o.top),_=Math.max(d/2,0),x=Math.max(u.cutoutPercentage?_/100*u.cutoutPercentage:1,0),s=(_-x)/t.getVisibleDatasetCount();this.outerRadius=_-s*this.index,this.innerRadius=this.outerRadius-s}updateElements(t,o,u,d){const _=d==="reset",x=this.chart,A=x.options.animation,P=this._cachedMeta.rScale,R=P.xCenter,V=P.yCenter,j=P.getIndexAngle(0)-.5*Mr;let Q=j,me;const re=360/this.countVisibleElements();for(me=0;me<o;++me)Q+=this._computeAngle(me,d,re);for(me=o;me<o+u;me++){const be=t[me];let ve=Q,Ee=Q+this._computeAngle(me,d,re),je=x.getDataVisibility(me)?P.getDistanceFromCenterForValue(this.getParsed(me).r):0;Q=Ee,_&&(A.animateScale&&(je=0),A.animateRotate&&(ve=Ee=j));const Ve={x:R,y:V,innerRadius:0,outerRadius:je,startAngle:ve,endAngle:Ee,options:this.resolveDataElementOptions(me,be.active?"active":d)};this.updateElement(be,me,Ve,d)}}countVisibleElements(){const t=this._cachedMeta;let o=0;return t.data.forEach((u,d)=>{!isNaN(this.getParsed(d).r)&&this.chart.getDataVisibility(d)&&o++}),o}_computeAngle(t,o,u){return this.chart.getDataVisibility(t)?Lc(this.resolveDataElementOptions(t,o).angle||u):0}}zi(gy,"id","polarArea"),zi(gy,"defaults",{dataElementType:"arc",animation:{animateRotate:!0,animateScale:!0},animations:{numbers:{type:"number",properties:["x","y","startAngle","endAngle","innerRadius","outerRadius"]}},indexAxis:"r",startAngle:0}),zi(gy,"overrides",{aspectRatio:1,plugins:{legend:{labels:{generateLabels(t){const o=t.data;if(o.labels.length&&o.datasets.length){const{labels:{pointStyle:u,color:d}}=t.legend.options;return o.labels.map((_,x)=>{const A=t.getDatasetMeta(0).controller.getStyle(x);return{text:_,fillStyle:A.backgroundColor,strokeStyle:A.borderColor,fontColor:d,lineWidth:A.borderWidth,pointStyle:u,hidden:!t.getDataVisibility(x),index:x}})}return[]}},onClick(t,o,u){u.chart.toggleDataVisibility(o.index),u.chart.update()}}},scales:{r:{type:"radialLinear",angleLines:{display:!1},beginAtZero:!0,grid:{circular:!0},pointLabels:{display:!1},startAngle:0}}});class X2 extends yp{}zi(X2,"id","pie"),zi(X2,"defaults",{cutout:0,rotation:0,circumference:360,radius:"100%"});class ux extends Oc{getLabelAndValue(t){const o=this._cachedMeta.vScale,u=this.getParsed(t);return{label:o.getLabels()[t],value:""+o.getLabelForValue(u[o.axis])}}parseObjectData(t,o,u,d){return tR.bind(this)(t,o,u,d)}update(t){const o=this._cachedMeta,u=o.dataset,d=o.data||[],_=o.iScale.getLabels();if(u.points=d,t!=="resize"){const x=this.resolveDatasetElementOptions(t);this.options.showLine||(x.borderWidth=0);const s={_loop:!0,_fullLoop:_.length===d.length,options:x};this.updateElement(u,void 0,s,t)}this.updateElements(d,0,d.length,t)}updateElements(t,o,u,d){const _=this._cachedMeta.rScale,x=d==="reset";for(let s=o;s<o+u;s++){const A=t[s],P=this.resolveDataElementOptions(s,A.active?"active":d),R=_.getPointPositionForValue(s,this.getParsed(s).r),V=x?_.xCenter:R.x,j=x?_.yCenter:R.y,Q={x:V,y:j,angle:R.angle,skip:isNaN(V)||isNaN(j),options:P};this.updateElement(A,s,Q,d)}}}zi(ux,"id","radar"),zi(ux,"defaults",{datasetElementType:"line",dataElementType:"point",indexAxis:"r",showLine:!0,elements:{line:{fill:"start"}}}),zi(ux,"overrides",{aspectRatio:1,scales:{r:{type:"radialLinear"}}});class hx extends Oc{getLabelAndValue(t){const o=this._cachedMeta,u=this.chart.data.labels||[],{xScale:d,yScale:_}=o,x=this.getParsed(t),s=d.getLabelForValue(x.x),A=_.getLabelForValue(x.y);return{label:u[t]||"",value:"("+s+", "+A+")"}}update(t){const o=this._cachedMeta,{data:u=[]}=o,d=this.chart._animationsDisabled;let{start:_,count:x}=WL(o,u,d);if(this._drawStart=_,this._drawCount=x,qL(o)&&(_=0,x=u.length),this.options.showLine){this.datasetElementType||this.addElements();const{dataset:s,_dataset:A}=o;s._chart=this.chart,s._datasetIndex=this.index,s._decimated=!!A._decimated,s.points=u;const P=this.resolveDatasetElementOptions(t);P.segment=this.options.segment,this.updateElement(s,void 0,{animated:!d,options:P},t)}else this.datasetElementType&&(delete o.dataset,this.datasetElementType=!1);this.updateElements(u,_,x,t)}addElements(){const{showLine:t}=this.options;!this.datasetElementType&&t&&(this.datasetElementType=this.chart.registry.getElement("line")),super.addElements()}updateElements(t,o,u,d){const _=d==="reset",{iScale:x,vScale:s,_stacked:A,_dataset:P}=this._cachedMeta,R=this.resolveDataElementOptions(o,d),V=this.getSharedOptions(R),j=this.includeOptions(d,V),Q=x.axis,me=s.axis,{spanGaps:re,segment:be}=this.options,ve=fg(re)?re:Number.POSITIVE_INFINITY,Ee=this.chart._animationsDisabled||_||d==="none";let je=o>0&&this.getParsed(o-1);for(let Ve=o;Ve<o+u;++Ve){const Je=t[Ve],vt=this.getParsed(Ve),_t=Ee?Je:{},Mt=Rs(vt[me]),At=_t[Q]=x.getPixelForValue(vt[Q],Ve),ei=_t[me]=_||Mt?s.getBasePixel():s.getPixelForValue(A?this.applyStack(s,vt,A):vt[me],Ve);_t.skip=isNaN(At)||isNaN(ei)||Mt,_t.stop=Ve>0&&Math.abs(vt[Q]-je[Q])>ve,be&&(_t.parsed=vt,_t.raw=P.data[Ve]),j&&(_t.options=V||this.resolveDataElementOptions(Ve,Je.active?"active":d)),Ee||this.updateElement(Je,Ve,_t,d),je=vt}this.updateSharedOptions(V,d,R)}getMaxOverflow(){const t=this._cachedMeta,o=t.data||[];if(!this.options.showLine){let s=0;for(let A=o.length-1;A>=0;--A)s=Math.max(s,o[A].size(this.resolveDataElementOptions(A))/2);return s>0&&s}const u=t.dataset,d=u.options&&u.options.borderWidth||0;if(!o.length)return d;const _=o[0].size(this.resolveDataElementOptions(0)),x=o[o.length-1].size(this.resolveDataElementOptions(o.length-1));return Math.max(d,_,x)/2}}zi(hx,"id","scatter"),zi(hx,"defaults",{datasetElementType:!1,dataElementType:"point",showLine:!1,fill:!1}),zi(hx,"overrides",{interaction:{mode:"point"},scales:{x:{type:"linear"},y:{type:"linear"}}});var Vie=Object.freeze({__proto__:null,BarController:ax,BubbleController:lx,DoughnutController:yp,LineController:cx,PieController:X2,PolarAreaController:gy,RadarController:ux,ScatterController:hx});function lp(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}class wS{constructor(t){zi(this,"options");this.options=t||{}}static override(t){Object.assign(wS.prototype,t)}init(){}formats(){return lp()}parse(){return lp()}format(){return lp()}
vendor: 4,409 bytes, line 3383
3383add(){return lp()}diff(){return lp()}startOf(){return lp()}endOf(){return lp()}}var $ie={_date:wS};function jie(n,t,o,u){const{controller:d,data:_,_sorted:x}=n,s=d._cachedMeta.iScale,A=n.dataset&&n.dataset.options?n.dataset.options.spanGaps:null;if(s&&t===s.axis&&t!=="r"&&x&&_.length){const P=s._reversePixels?hte:Th;if(u){if(d._sharedOptions){const R=_[0],V=typeof R.getRange=="function"&&R.getRange(t);if(V){const j=P(_,t,o-V),Q=P(_,t,o+V);return{lo:j.lo,hi:Q.hi}}}}else{const R=P(_,t,o);if(A){const{vScale:V}=d._cachedMeta,{_parsed:j}=n,Q=j.slice(0,R.lo+1).reverse().findIndex(re=>!Rs(re[V.axis]));R.lo-=Math.max(0,Q);const me=j.slice(R.hi).findIndex(re=>!Rs(re[V.axis]));R.hi+=Math.max(0,me)}return R}}return{lo:0,hi:_.length-1}}function Qy(n,t,o,u,d){const _=n.getSortedVisibleDatasetMetas(),x=o[t];for(let s=0,A=_.length;s<A;++s){const{index:P,data:R}=_[s],{lo:V,hi:j}=jie(_[s],t,x,d);for(let Q=V;Q<=j;++Q){const me=R[Q];me.skip||u(me,P,Q)}}}function Uie(n){const t=n.indexOf("x")!==-1,o=n.indexOf("y")!==-1;return function(u,d){const _=t?Math.abs(u.x-d.x):0,x=o?Math.abs(u.y-d.y):0;return Math.sqrt(Math.pow(_,2)+Math.pow(x,2))}}function Yw(n,t,o,u,d){const _=[];return!d&&!n.isPointInArea(t)||Qy(n,o,t,function(s,A,P){!d&&!Sh(s,n.chartArea,0)||s.inRange(t.x,t.y,u)&&_.push({element:s,datasetIndex:A,index:P})},!0),_}function Hie(n,t,o,u){let d=[];function _(x,s,A){const{startAngle:P,endAngle:R}=x.getProps(["startAngle","endAngle"],u),{angle:V}=$L(x,{x:t.x,y:t.y});Oy(V,P,R)&&d.push({element:x,datasetIndex:s,index:A})}return Qy(n,o,t,_),d}function Gie(n,t,o,u,d,_){let x=[];const s=Uie(o);let A=Number.POSITIVE_INFINITY;function P(R,V,j){const Q=R.inRange(t.x,t.y,d);if(u&&!Q)return;const me=R.getCenterPoint(d);if(!(!!_||n.isPointInArea(me))&&!Q)return;const be=s(t,me);be<A?(x=[{element:R,datasetIndex:V,index:j}],A=be):be===A&&x.push({element:R,datasetIndex:V,index:j})}return Qy(n,o,t,P),x}function Kw(n,t,o,u,d,_){return!_&&!n.isPointInArea(t)?[]:o==="r"&&!u?Hie(n,t,o,d):Gie(n,t,o,u,d,_)}function mP(n,t,o,u,d){const _=[],x=o==="x"?"inXRange":"inYRange";let s=!1;return Qy(n,o,t,(A,P,R)=>{A[x]&&A[x](t[o],d)&&(_.push({element:A,datasetIndex:P,index:R}),s=s||A.inRange(t.x,t.y,d))}),u&&!s?[]:_}var Wie={evaluateInteractionItems:Qy,modes:{index(n,t,o,u){const d=hp(t,n),_=o.axis||"x",x=o.includeInvisible||!1,s=o.intersect?Yw(n,d,_,u,x):Kw(n,d,_,!1,u,x),A=[];return s.length?(n.getSortedVisibleDatasetMetas().forEach(P=>{const R=s[0].index,V=P.data[R];V&&!V.skip&&A.push({element:V,datasetIndex:P.index,index:R})}),A):[]},dataset(n,t,o,u){const d=hp(t,n),_=o.axis||"xy",x=o.includeInvisible||!1;let s=o.intersect?Yw(n,d,_,u,x):Kw(n,d,_,!1,u,x);if(s.length>0){const A=s[0].datasetIndex,P=n.getDatasetMeta(A).data;s=[];for(let R=0;R<P.length;++R)s.push({element:P[R],datasetIndex:A,index:R})}return s},point(n,t,o,u){const d=hp(t,n),_=o.axis||"xy",x=o.includeInvisible||!1;return Yw(n,d,_,u,x)},nearest(n,t,o,u){const d=hp(t,n),_=o.axis||"xy",x=o.includeInvisible||!1;return Kw(n,d,_,o.intersect,u,x)},x(n,t,o,u){const d=hp(t,n);return mP(n,d,"x",o.intersect,u)},y(n,t,o,u){const d=hp(t,n);return mP(n,d,"y",o.intersect,u)}}};const hR=["left","top","right","bottom"];function $_(n,t){return n.filter(o=>o.pos===t)}function gP(n,t){return n.filter(o=>hR.indexOf(o.pos)===-1&&o.box.axis===t)}function j_(n,t){return n.sort((o,u)=>{const d=t?u:o,_=t?o:u;return d.weight===_.weight?d.index-_.index:d.weight-_.weight})}function qie(n){const t=[];let o,u,d,_,x,s;for(o=0,u=(n||[]).length;o<u;++o)d=n[o],{position:_,options:{stack:x,stackWeight:s=1}}=d,t.push({index:o,box:d,pos:_,horizontal:d.isHorizontal(),weight:d.weight,stack:x&&_+x,stackWeight:s});return t}function Zie(n){const t={};for(const o of n){const{stack:u,pos:d,stackWeight:_}=o;if(!u||!hR.includes(d))continue;const x=t[u]||(t[u]={count:0,placed:0,weight:0,size:0});x.count++,x.weight+=_}return t}function Xie(n,t){const o=Zie(n),{vBoxMaxWidth:u,hBoxMaxHeight:d}=t;let _,x,s;for(_=0,x=n.length;_<x;++_){s=n[_];const{fullSize:A}=s.box,P=o[s.stack],R=P&&s.stackWeight/P.weight;s.horizontal?(s.width=R?R*u:A&&t.availableWidth,s.height=d):(s.width=u,s.height=R?R*d:A&&t.availableHeight)}return o}function Yie(n){const t=qie(n),o=j_(t.filter(P=>P.box.fullSize),!0),u=j_($_(t,"left"),!0),d=j_($_(t,"right")),_=j_($_(t,"top"),!0),x=j_($_(t,"bottom")),s=gP(t,"x"),A=gP(t,"y");return{fullSize:o,leftAndTop:u.concat(_),rightAndBottom:d.concat(A).
vendor: 4,796 bytes, line 3383
3383concat(x).concat(s),chartArea:$_(t,"chartArea"),vertical:u.concat(d).concat(A),horizontal:_.concat(x).concat(s)}}function _P(n,t,o,u){return Math.max(n[o],t[o])+Math.max(n[u],t[u])}function dR(n,t){n.top=Math.max(n.top,t.top),n.left=Math.max(n.left,t.left),n.bottom=Math.max(n.bottom,t.bottom),n.right=Math.max(n.right,t.right)}function Kie(n,t,o,u){const{pos:d,box:_}=o,x=n.maxPadding;if(!Bs(d)){o.size&&(n[d]-=o.size);const V=u[o.stack]||{size:0,count:1};V.size=Math.max(V.size,o.horizontal?_.height:_.width),o.size=V.size/V.count,n[d]+=o.size}_.getPadding&&dR(x,_.getPadding());const s=Math.max(0,t.outerWidth-_P(x,n,"left","right")),A=Math.max(0,t.outerHeight-_P(x,n,"top","bottom")),P=s!==n.w,R=A!==n.h;return n.w=s,n.h=A,o.horizontal?{same:P,other:R}:{same:R,other:P}}function Jie(n){const t=n.maxPadding;function o(u){const d=Math.max(t[u]-n[u],0);return n[u]+=d,d}n.y+=o("top"),n.x+=o("left"),o("right"),o("bottom")}function Qie(n,t){const o=t.maxPadding;function u(d){const _={left:0,top:0,right:0,bottom:0};return d.forEach(x=>{_[x]=Math.max(t[x],o[x])}),_}return u(n?["left","right"]:["top","bottom"])}function Y_(n,t,o,u){const d=[];let _,x,s,A,P,R;for(_=0,x=n.length,P=0;_<x;++_){s=n[_],A=s.box,A.update(s.width||t.w,s.height||t.h,Qie(s.horizontal,t));const{same:V,other:j}=Kie(t,o,s,u);P|=V&&d.length,R=R||j,A.fullSize||d.push(s)}return P&&Y_(d,t,o,u)||R}function Nv(n,t,o,u,d){n.top=o,n.left=t,n.right=t+u,n.bottom=o+d,n.width=u,n.height=d}function yP(n,t,o,u){const d=o.padding;let{x:_,y:x}=t;for(const s of n){const A=s.box,P=u[s.stack]||{count:1,placed:0,weight:1},R=s.stackWeight/P.weight||1;if(s.horizontal){const V=t.w*R,j=P.size||A.height;Ry(P.start)&&(x=P.start),A.fullSize?Nv(A,d.left,x,o.outerWidth-d.right-d.left,j):Nv(A,t.left+P.placed,x,V,j),P.start=x,P.placed+=V,x=A.bottom}else{const V=t.h*R,j=P.size||A.width;Ry(P.start)&&(_=P.start),A.fullSize?Nv(A,_,d.top,j,o.outerHeight-d.bottom-d.top):Nv(A,_,t.top+P.placed,j,V),P.start=_,P.placed+=V,_=A.right}}t.x=_,t.y=x}var da={addBox(n,t){n.boxes||(n.boxes=[]),t.fullSize=t.fullSize||!1,t.position=t.position||"top",t.weight=t.weight||0,t._layers=t._layers||function(){return[{z:0,draw(o){t.draw(o)}}]},n.boxes.push(t)},removeBox(n,t){const o=n.boxes?n.boxes.indexOf(t):-1;o!==-1&&n.boxes.splice(o,1)},configure(n,t,o){t.fullSize=o.fullSize,t.position=o.position,t.weight=o.weight},update(n,t,o,u){if(!n)return;const d=ma(n.options.layout.padding),_=Math.max(t-d.width,0),x=Math.max(o-d.height,0),s=Yie(n.boxes),A=s.vertical,P=s.horizontal;lr(n.boxes,re=>{typeof re.beforeLayout=="function"&&re.beforeLayout()});const R=A.reduce((re,be)=>be.box.options&&be.box.options.display===!1?re:re+1,0)||1,V=Object.freeze({outerWidth:t,outerHeight:o,padding:d,availableWidth:_,availableHeight:x,vBoxMaxWidth:_/2/R,hBoxMaxHeight:x/2}),j=Object.assign({},d);dR(j,ma(u));const Q=Object.assign({maxPadding:j,w:_,h:x,x:d.left,y:d.top},d),me=Xie(A.concat(P),V);Y_(s.fullSize,Q,V,me),Y_(A,Q,V,me),Y_(P,Q,V,me)&&Y_(A,Q,V,me),Jie(Q),yP(s.leftAndTop,Q,V,me),Q.x+=Q.w,Q.y+=Q.h,yP(s.rightAndBottom,Q,V,me),n.chartArea={left:Q.left,top:Q.top,right:Q.left+Q.w,bottom:Q.top+Q.h,height:Q.h,width:Q.w},lr(s.chartArea,re=>{const be=re.box;Object.assign(be,n.chartArea),be.update(Q.w,Q.h,{left:0,top:0,right:0,bottom:0})})}};class fR{acquireContext(t,o){}releaseContext(t){return!1}addEventListener(t,o,u){}removeEventListener(t,o,u){}getDevicePixelRatio(){return 1}getMaximumSize(t,o,u,d){return o=Math.max(0,o||t.width),u=u||t.height,{width:o,height:Math.max(0,d?Math.floor(o/d):u)}}isAttached(t){return!0}updateConfig(t){}}class ene extends fR{acquireContext(t){return t&&t.getContext&&t.getContext("2d")||null}updateConfig(t){t.options.animation=!1}}const dx="$chartjs",tne={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},vP=n=>n===null||n==="";function ine(n,t){const o=n.style,u=n.getAttribute("height"),d=n.getAttribute("width");if(n[dx]={initial:{height:u,width:d,style:{display:o.display,height:o.height,width:o.width}}},o.display=o.display||"block",o.boxSizing=o.boxSizing||"border-box",vP(d)){const _=iP(n,"width");_!==void 0&&(n.width=_)}if(vP(u))if(n.style.height==="")n.height=n.width/(t||2);else{const _=iP(n,"height");_!==void 0&&(n.height=_)}return n}const pR=sie?{passive:!0}:!1;function nne(n,t,o){n&&n.addEventListener(t,o,pR)}function sne(n,t,o){n&&n.canvas&&n.canvas.removeEventListener(t,o,pR)}function rne(n,t){const o=tne[n.type]||n.type,{x:u,y:d}=hp(n,t);return{type:o,chart:t,native:n,x:u!==void 0?u:null,y:d!==void 0?d:null}}function Fx(n,t){for(const o of n)if(o===t||o.contains(t))return!0}function one(n,t,o){const u=n.canvas,d=new MutationObserver(_=>{let x=!1;
vendor: 7,277 bytes, line 3383
3383for(const s of _)x=x||Fx(s.addedNodes,u),x=x&&!Fx(s.removedNodes,u);x&&o()});return d.observe(document,{childList:!0,subtree:!0}),d}function ane(n,t,o){const u=n.canvas,d=new MutationObserver(_=>{let x=!1;for(const s of _)x=x||Fx(s.removedNodes,u),x=x&&!Fx(s.addedNodes,u);x&&o()});return d.observe(document,{childList:!0,subtree:!0}),d}const Fy=new Map;let xP=0;function mR(){const n=window.devicePixelRatio;n!==xP&&(xP=n,Fy.forEach((t,o)=>{o.currentDevicePixelRatio!==n&&t()}))}function lne(n,t){Fy.size||window.addEventListener("resize",mR),Fy.set(n,t)}function cne(n){Fy.delete(n),Fy.size||window.removeEventListener("resize",mR)}function une(n,t,o){const u=n.canvas,d=u&&bS(u);if(!d)return;const _=GL((s,A)=>{const P=d.clientWidth;o(s,A),P<d.clientWidth&&o()},window),x=new ResizeObserver(s=>{const A=s[0],P=A.contentRect.width,R=A.contentRect.height;P===0&&R===0||_(P,R)});return x.observe(d),lne(n,_),x}function Jw(n,t,o){o&&o.disconnect(),t==="resize"&&cne(n)}function hne(n,t,o){const u=n.canvas,d=GL(_=>{n.ctx!==null&&o(rne(_,n))},n);return nne(u,t,d),d}class dne extends fR{acquireContext(t,o){const u=t&&t.getContext&&t.getContext("2d");return u&&u.canvas===t?(ine(t,o),u):null}releaseContext(t){const o=t.canvas;if(!o[dx])return!1;const u=o[dx].initial;["height","width"].forEach(_=>{const x=u[_];Rs(x)?o.removeAttribute(_):o.setAttribute(_,x)});const d=u.style||{};return Object.keys(d).forEach(_=>{o.style[_]=d[_]}),o.width=o.width,delete o[dx],!0}addEventListener(t,o,u){this.removeEventListener(t,o);const d=t.$proxies||(t.$proxies={}),x={attach:one,detach:ane,resize:une}[o]||hne;d[o]=x(t,o,u)}removeEventListener(t,o){const u=t.$proxies||(t.$proxies={}),d=u[o];if(!d)return;({attach:Jw,detach:Jw,resize:Jw}[o]||sne)(t,o,d),u[o]=void 0}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(t,o,u,d){return nie(t,o,u,d)}isAttached(t){const o=t&&bS(t);return!!(o&&o.isConnected)}}function fne(n){return!xS()||typeof OffscreenCanvas<"u"&&n instanceof OffscreenCanvas?ene:dne}var qv;let Oh=(qv=class{constructor(){zi(this,"x");zi(this,"y");zi(this,"active",!1);zi(this,"options");zi(this,"$animations")}tooltipPosition(t){const{x:o,y:u}=this.getProps(["x","y"],t);return{x:o,y:u}}hasValue(){return fg(this.x)&&fg(this.y)}getProps(t,o){const u=this.$animations;if(!o||!u)return this;const d={};return t.forEach(_=>{d[_]=u[_]&&u[_].active()?u[_]._to:this[_]}),d}},zi(qv,"defaults",{}),zi(qv,"defaultRoutes"),qv);function pne(n,t){const o=n.options.ticks,u=mne(n),d=Math.min(o.maxTicksLimit||u,u),_=o.major.enabled?_ne(t):[],x=_.length,s=_[0],A=_[x-1],P=[];if(x>d)return yne(t,P,_,x/d),P;const R=gne(_,t,d);if(x>0){let V,j;const Q=x>1?Math.round((A-s)/(x-1)):null;for(Vv(t,P,R,Rs(Q)?0:s-Q,s),V=0,j=x-1;V<j;V++)Vv(t,P,R,_[V],_[V+1]);return Vv(t,P,R,A,Rs(Q)?t.length:A+Q),P}return Vv(t,P,R),P}function mne(n){const t=n.options.offset,o=n._tickSize(),u=n._length/o+(t?0:1),d=n._maxLength/o;return Math.floor(Math.min(u,d))}function gne(n,t,o){const u=vne(n),d=t.length/o;if(!u)return Math.max(d,1);const _=ote(u);for(let x=0,s=_.length-1;x<s;x++){const A=_[x];if(A>d)return A}return Math.max(d,1)}function _ne(n){const t=[];let o,u;for(o=0,u=n.length;o<u;o++)n[o].major&&t.push(o);return t}function yne(n,t,o,u){let d=0,_=o[0],x;for(u=Math.ceil(u),x=0;x<n.length;x++)x===_&&(t.push(n[x]),d++,_=o[d*u])}function Vv(n,t,o,u,d){const _=us(u,0),x=Math.min(us(d,n.length),n.length);let s=0,A,P,R;for(o=Math.ceil(o),d&&(A=d-u,o=A/Math.floor(A/o)),R=_;R<0;)s++,R=Math.round(_+s*o);for(P=Math.max(_,0);P<x;P++)P===R&&(t.push(n[P]),s++,R=Math.round(_+s*o))}function vne(n){const t=n.length;let o,u;if(t<2)return!1;for(u=n[0],o=1;o<t;++o)if(n[o]-n[o-1]!==u)return!1;return u}const xne=n=>n==="left"?"right":n==="right"?"left":n,bP=(n,t,o)=>t==="top"||t==="left"?n[t]+o:n[t]-o,wP=(n,t)=>Math.min(t||n,n);function TP(n,t){const o=[],u=n.length/t,d=n.length;let _=0;for(;_<d;_+=u)o.push(n[Math.floor(_)]);return o}function bne(n,t,o){const u=n.ticks.length,d=Math.min(t,u-1),_=n._startPixel,x=n._endPixel,s=1e-6;let A=n.getPixelForTick(d),P;if(!(o&&(u===1?P=Math.max(A-_,x-A):t===0?P=(n.getPixelForTick(1)-A)/2:P=(A-n.getPixelForTick(d-1))/2,A+=d<t?P:-P,A<_-s||A>x+s)))return A}function wne(n,t){lr(n,o=>{const u=o.gc,d=u.length/2;let _;if(d>t){for(_=0;_<d;++_)delete o.data[u[_]];u.splice(0,d)}})}function U_(n){return n.drawTicks?n.tickLength:0}function SP(n,t){if(!n.display)return 0;const o=Io(n.font,t),u=ma(n.padding);return(Or(n.text)?n.text.length:1)*o.lineHeight+u.height}function Tne(n,t){return uf(n,{scale:t,type:"scale"})}function Sne(n,t,o){return uf(n,{tick:o,index:t,type:"tick"})}function Ene(n,t,o){let u=pS(n);return(o&&t!=="right"||!o&&t==="right")&&(u=xne(u)),u}function Ane(n,t,o,u){const{top:d,left:_,bottom:x,right:s,chart:A}=n,{chartArea:P,scales:R}=A;let V=0,j,Q,me;const re=x-d,be=s-_;if(n.isHorizontal()){if(Q=la(u,_,s),Bs(o)){const ve=Object.keys(o)[0],Ee=o[ve];me=R[ve].getPixelForValue(Ee)+re-t}else o==="center"?me=(P.bottom+P.top)/2+re-t:me=bP(n,o,t);j=s-_}else{if(Bs(o)){const ve=Object.keys(o)[0],Ee=o[ve];Q=R[ve].getPixelForValue(Ee)-be+t}else o==="center"?Q=(P.left+P.right)/2-be+t:Q=bP(n,o,t);me=la(u,x,d),V=o==="left"?-ao:ao}return{titleX:Q,titleY:me,maxWidth:j,rotation:V}}class Fp extends Oh{constructor(t){super(),this.id=t.id,this.type=t.type,this.options=void 0,this.ctx=t.ctx,this.chart=t.chart,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.width=void 0,this.height=void 0,this._margins={left:0,right:0,top:0,bottom:0},this.maxWidth=void 0,this.maxHeight=void 0,this.paddingTop=void 0,this.paddingBottom=void 0,this.paddingLeft=void 0,this.paddingRight=void 0,this.axis=void 0,this.labelRotation=void 0,this.min=void 0,this.max=void 0,this._range=void 0,this.ticks=[],this._gridLineItems=null,this._labelItems=null,this._labelSizes=null,this._length=0,this._maxLength=0,this._longestTextCache={},this._startPixel=void 0,this._endPixel=void 0,this._reversePixels=!1,this._userMax=void 0,this._userMin=void 0,this._suggestedMax=void 0,this._suggestedMin=void 0,this._ticksLength=0,this._borderValue=0,this._cache={},this._dataLimitsCached=!1,this.$context=void 0}init(t){this.options=t.setContext(this.getContext()),this.axis=t.axis,this._userMin=this.parse(t.min),this._userMax=this.parse(t.max),this._suggestedMin=this.parse(t.suggestedMin),this._suggestedMax=this.parse(t.suggestedMax)}parse(t,o){return t}getUserBounds(){let{_userMin:t,_userMax:o,_suggestedMin:u,_suggestedMax:d}=this;return t=gl(t,Number.POSITIVE_INFINITY),o=gl(o,Number.NEGATIVE_INFINITY),u=gl(u,Number.POSITIVE_INFINITY),d=gl(d,Number.NEGATIVE_INFINITY),{min:gl(t,u),max:gl(o,d),minDefined:Yr(t),maxDefined:Yr(o)}}getMinMax(t){let{min:o,max:u,minDefined:d,maxDefined:_}=this.getUserBounds(),x;if(d&&_)return{min:o,max:u};const s=this.getMatchingVisibleMetas();for(let A=0,P=s.length;A<P;++A)x=s[A].controller.getMinMax(this,t),d||(o=Math.min(o,x.min)),_||(u=Math.max(u,x.max));return o=_&&o>u?u:o,u=d&&o>u?o:u,{min:gl(o,gl(u,o)),max:gl(u,gl(o,u))}}getPadding(){return{left:this.paddingLeft||0,top:this.paddingTop||0,right:this.paddingRight||0,bottom:this.paddingBottom||0}}getTicks(){return this.ticks}getLabels(){const t=this.chart.data;return this.options.labels||(this.isHorizontal()?t.xLabels:t.yLabels)||t.labels||[]}
vendor: 108,738 bytes, lines 3383-3385
3383getLabelItems(t=this.chart.chartArea){return this._labelItems||(this._labelItems=this._computeLabelItems(t))}beforeLayout(){this._cache={},this._dataLimitsCached=!1}beforeUpdate(){br(this.options.beforeUpdate,[this])}update(t,o,u){const{beginAtZero:d,grace:_,ticks:x}=this.options,s=x.sampleSize;this.beforeUpdate(),this.maxWidth=t,this.maxHeight=o,this._margins=u=Object.assign({left:0,right:0,top:0,bottom:0},u),this.ticks=null,this._labelSizes=null,this._gridLineItems=null,this._labelItems=null,this.beforeSetDimensions(),this.setDimensions(),this.afterSetDimensions(),this._maxLength=this.isHorizontal()?this.width+u.left+u.right:this.height+u.top+u.bottom,this._dataLimitsCached||(this.beforeDataLimits(),this.determineDataLimits(),this.afterDataLimits(),this._range=Ote(this,_,d),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();const A=s<this.ticks.length;this._convertTicksToLabels(A?TP(this.ticks,s):this.ticks),this.configure(),this.beforeCalculateLabelRotation(),this.calculateLabelRotation(),this.afterCalculateLabelRotation(),x.display&&(x.autoSkip||x.source==="auto")&&(this.ticks=pne(this,this.ticks),this._labelSizes=null,this.afterAutoSkip()),A&&this._convertTicksToLabels(this.ticks),this.beforeFit(),this.fit(),this.afterFit(),this.afterUpdate()}configure(){let t=this.options.reverse,o,u;this.isHorizontal()?(o=this.left,u=this.right):(o=this.top,u=this.bottom,t=!t),this._startPixel=o,this._endPixel=u,this._reversePixels=t,this._length=u-o,this._alignToPixels=this.options.alignToPixels}afterUpdate(){br(this.options.afterUpdate,[this])}beforeSetDimensions(){br(this.options.beforeSetDimensions,[this])}setDimensions(){this.isHorizontal()?(this.width=this.maxWidth,this.left=0,this.right=this.width):(this.height=this.maxHeight,this.top=0,this.bottom=this.height),this.paddingLeft=0,this.paddingTop=0,this.paddingRight=0,this.paddingBottom=0}afterSetDimensions(){br(this.options.afterSetDimensions,[this])}_callHooks(t){this.chart.notifyPlugins(t,this.getContext()),br(this.options[t],[this])}beforeDataLimits(){this._callHooks("beforeDataLimits")}determineDataLimits(){}afterDataLimits(){this._callHooks("afterDataLimits")}beforeBuildTicks(){this._callHooks("beforeBuildTicks")}buildTicks(){return[]}afterBuildTicks(){this._callHooks("afterBuildTicks")}beforeTickToLabelConversion(){br(this.options.beforeTickToLabelConversion,[this])}generateTickLabels(t){const o=this.options.ticks;let u,d,_;for(u=0,d=t.length;u<d;u++)_=t[u],_.label=br(o.callback,[_.value,u,t],this)}afterTickToLabelConversion(){br(this.options.afterTickToLabelConversion,[this])}beforeCalculateLabelRotation(){br(this.options.beforeCalculateLabelRotation,[this])}calculateLabelRotation(){const t=this.options,o=t.ticks,u=wP(this.ticks.length,t.ticks.maxTicksLimit),d=o.minRotation||0,_=o.maxRotation;let x=d,s,A,P;if(!this._isVisible()||!o.display||d>=_||u<=1||!this.isHorizontal()){this.labelRotation=d;return}const R=this._getLabelSizes(),V=R.widest.width,j=R.highest.height,Q=zo(this.chart.width-V,0,this.maxWidth);s=t.offset?this.maxWidth/u:Q/(u-1),V+6>s&&(s=Q/(u-(t.offset?.5:1)),A=this.maxHeight-U_(t.grid)-o.padding-SP(t.title,this.chart.options.font),P=Math.sqrt(V*V+j*j),x=dS(Math.min(Math.asin(zo((R.highest.height+6)/s,-1,1)),Math.asin(zo(A/P,-1,1))-Math.asin(zo(j/P,-1,1)))),x=Math.max(d,Math.min(_,x))),this.labelRotation=x}afterCalculateLabelRotation(){br(this.options.afterCalculateLabelRotation,[this])}afterAutoSkip(){}beforeFit(){br(this.options.beforeFit,[this])}fit(){const t={width:0,height:0},{chart:o,options:{ticks:u,title:d,grid:_}}=this,x=this._isVisible(),s=this.isHorizontal();if(x){const A=SP(d,o.options.font);if(s?(t.width=this.maxWidth,t.height=U_(_)+A):(t.height=this.maxHeight,t.width=U_(_)+A),u.display&&this.ticks.length){const{first:P,last:R,widest:V,highest:j}=this._getLabelSizes(),Q=u.padding*2,me=Lc(this.labelRotation),re=Math.cos(me),be=Math.sin(me);if(s){const ve=u.mirror?0:be*V.width+re*j.height;t.height=Math.min(this.maxHeight,t.height+ve+Q)}else{const ve=u.mirror?0:re*V.width+be*j.height;t.width=Math.min(this.maxWidth,t.width+ve+Q)}this._calculatePadding(P,R,be,re)}}this._handleMargins(),s?(this.width=this._length=o.width-this._margins.left-this._margins.right,this.height=t.height):(this.width=t.width,this.height=this._length=o.height-this._margins.top-this._margins.bottom)}_calculatePadding(t,o,u,d){const{ticks:{align:_,padding:x},position:s}=this.options,A=this.labelRotation!==0,P=s!=="top"&&this.axis==="x";if(this.isHorizontal()){const R=this.getPixelForTick(0)-this.left,V=this.right-this.getPixelForTick(this.ticks.length-1);let j=0,Q=0;A?P?(j=d*t.width,Q=u*o.height):(j=u*t.height,Q=d*o.width):_==="start"?Q=o.width:_==="end"?j=t.width:_!=="inner"&&(j=t.width/2,Q=o.width/2),this.paddingLeft=Math.max((j-R+x)*this.width/(this.width-R),0),this.paddingRight=Math.max((Q-V+x)*this.width/(this.width-V),0)}else{let R=o.height/2,V=t.height/2;_==="start"?(R=0,V=t.height):_==="end"&&(R=o.height,V=0),this.paddingTop=R+x,this.paddingBottom=V+x}}_handleMargins(){this._margins&&(this._margins.left=Math.max(this.paddingLeft,this._margins.left),this._margins.top=Math.max(this.paddingTop,this._margins.top),this._margins.right=Math.max(this.paddingRight,this._margins.right),this._margins.bottom=Math.max(this.paddingBottom,this._margins.bottom))}afterFit(){br(this.options.afterFit,[this])}isHorizontal(){const{axis:t,position:o}=this.options;return o==="top"||o==="bottom"||t==="x"}isFullSize(){return this.options.fullSize}_convertTicksToLabels(t){this.beforeTickToLabelConversion(),this.generateTickLabels(t);let o,u;for(o=0,u=t.length;o<u;o++)Rs(t[o].label)&&(t.splice(o,1),u--,o--);this.afterTickToLabelConversion()}_getLabelSizes(){let t=this._labelSizes;if(!t){const o=this.options.ticks.sampleSize;let u=this.ticks;o<u.length&&(u=TP(u,o)),this._labelSizes=t=this._computeLabelSizes(u,u.length,this.options.ticks.maxTicksLimit)}return t}_computeLabelSizes(t,o,u){const{ctx:d,_longestTextCache:_}=this,x=[],s=[],A=Math.floor(o/wP(o,u));let P=0,R=0,V,j,Q,me,re,be,ve,Ee,je,Ve,Je;for(V=0;V<o;V+=A){if(me=t[V].label,re=this._resolveTickFontOptions(V),d.font=be=re.string,ve=_[be]=_[be]||{data:{},gc:[]},Ee=re.lineHeight,je=Ve=0,!Rs(me)&&!Or(me))je=Ox(d,ve.data,ve.gc,je,me),Ve=Ee;else if(Or(me))for(j=0,Q=me.length;j<Q;++j)Je=me[j],!Rs(Je)&&!Or(Je)&&(je=Ox(d,ve.data,ve.gc,je,Je),Ve+=Ee);x.push(je),s.push(Ve),P=Math.max(je,P),R=Math.max(Ve,R)}wne(_,o);const vt=x.indexOf(P),_t=s.indexOf(R),Mt=At=>({width:x[At]||0,height:s[At]||0});return{first:Mt(0),last:Mt(o-1),widest:Mt(vt),highest:Mt(_t),widths:x,heights:s}}getLabelForValue(t){return t}getPixelForValue(t,o){return NaN}getValueForPixel(t){}getPixelForTick(t){const o=this.ticks;return t<0||t>o.length-1?null:this.getPixelForValue(o[t].value)}getPixelForDecimal(t){this._reversePixels&&(t=1-t);const o=this._startPixel+t*this._length;return ute(this._alignToPixels?ap(this.chart,o,0):o)}getDecimalForPixel(t){const o=(t-this._startPixel)/this._length;return this._reversePixels?1-o:o}getBasePixel(){return this.getPixelForValue(this.getBaseValue())}getBaseValue(){const{min:t,max:o}=this;return t<0&&o<0?o:t>0&&o>0?t:0}getContext(t){const o=this.ticks||[];if(t>=0&&t<o.length){const u=o[t];return u.$context||(u.$context=Sne(this.getContext(),t,u))}return this.$context||(this.$context=Tne(this.chart.getContext(),this))}_tickSize(){const t=this.options.ticks,o=Lc(this.labelRotation),u=Math.abs(Math.cos(o)),d=Math.abs(Math.sin(o)),_=this._getLabelSizes(),x=t.autoSkipPadding||0,s=_?_.widest.width+x:0,A=_?_.highest.height+x:0;return this.isHorizontal()?A*u>s*d?s/u:A/d:A*d<s*u?A/u:s/d}_isVisible(){const t=this.options.display;return t!=="auto"?!!t:this.getMatchingVisibleMetas().length>0}_computeGridLineItems(t){const o=this.axis,u=this.chart,d=this.options,{grid:_,position:x,border:s}=d,A=_.offset,P=this.isHorizontal(),V=this.ticks.length+(A?1:0),j=U_(_),Q=[],me=s.setContext(this.getContext()),re=me.display?me.width:0,be=re/2,ve=function(wi){return ap(u,wi,re)};let Ee,je,Ve,Je,vt,_t,Mt,At,ei,Yt,Zt,yi;if(x==="top")Ee=ve(this.bottom),_t=this.bottom-j,At=Ee-be,Yt=ve(t.top)+be,yi=t.bottom;else if(x==="bottom")Ee=ve(this.top),Yt=t.top,yi=ve(t.bottom)-be,_t=Ee+be,At=this.top+j;else if(x==="left")Ee=ve(this.right),vt=this.right-j,Mt=Ee-be,ei=ve(t.left)+be,Zt=t.right;else if(x==="right")Ee=ve(this.left),ei=t.left,Zt=ve(t.right)-be,vt=Ee+be,Mt=this.left+j;else if(o==="x"){if(x==="center")Ee=ve((t.top+t.bottom)/2+.5);else if(Bs(x)){const wi=Object.keys(x)[0],Li=x[wi];Ee=ve(this.chart.scales[wi].getPixelForValue(Li))}Yt=t.top,yi=t.bottom,_t=Ee+be,At=_t+j}else if(o==="y"){if(x==="center")Ee=ve((t.left+t.right)/2);else if(Bs(x)){const wi=Object.keys(x)[0],Li=x[wi];Ee=ve(this.chart.scales[wi].getPixelForValue(Li))}vt=Ee-be,Mt=vt-j,ei=t.left,Zt=t.right}const Fi=us(d.ticks.maxTicksLimit,V),ki=Math.max(1,Math.ceil(V/Fi));for(je=0;je<V;je+=ki){const wi=this.getContext(je),Li=_.setContext(wi),cn=s.setContext(wi),vi=Li.lineWidth,Ue=Li.color,Yn=cn.dash||[],Ki=cn.dashOffset,ps=Li.tickWidth,On=Li.tickColor,hn=Li.tickBorderDash||[],Hi=Li.tickBorderDashOffset;Ve=bne(this,je,A),Ve!==void 0&&(Je=ap(u,Ve,vi),P?vt=Mt=ei=Zt=Je:_t=At=Yt=yi=Je,Q.push({tx1:vt,ty1:_t,tx2:Mt,ty2:At,x1:ei,y1:Yt,x2:Zt,y2:yi,width:vi,color:Ue,borderDash:Yn,borderDashOffset:Ki,tickWidth:ps,tickColor:On,tickBorderDash:hn,tickBorderDashOffset:Hi}))}return this._ticksLength=V,this._borderValue=Ee,Q}_computeLabelItems(t){const o=this.axis,u=this.options,{position:d,ticks:_}=u,x=this.isHorizontal(),s=this.ticks,{align:A,crossAlign:P,padding:R,mirror:V}=_,j=U_(u.grid),Q=j+R,me=V?-R:Q,re=-Lc(this.labelRotation),be=[];let ve,Ee,je,Ve,Je,vt,_t,Mt,At,ei,Yt,Zt,yi="middle";if(d==="top")vt=this.bottom-me,_t=this._getXAxisLabelAlignment();else if(d==="bottom")vt=this.top+me,_t=this._getXAxisLabelAlignment();else if(d==="left"){const ki=this._getYAxisLabelAlignment(j);_t=ki.textAlign,Je=ki.x}else if(d==="right"){const ki=this._getYAxisLabelAlignment(j);_t=ki.textAlign,Je=ki.x}else if(o==="x"){if(d==="center")vt=(t.top+t.bottom)/2+Q;else if(Bs(d)){const ki=Object.keys(d)[0],wi=d[ki];vt=this.chart.scales[ki].getPixelForValue(wi)+Q}_t=this._getXAxisLabelAlignment()}else if(o==="y"){if(d==="center")Je=(t.left+t.right)/2-Q;else if(Bs(d)){const ki=Object.keys(d)[0],wi=d[ki];Je=this.chart.scales[ki].getPixelForValue(wi)}_t=this._getYAxisLabelAlignment(j).textAlign}o==="y"&&(A==="start"?yi="top":A==="end"&&(yi="bottom"));const Fi=this._getLabelSizes();for(ve=0,Ee=s.length;ve<Ee;++ve){je=s[ve],Ve=je.label;const ki=_.setContext(this.getContext(ve));Mt=this.getPixelForTick(ve)+_.labelOffset,At=this._resolveTickFontOptions(ve),ei=At.lineHeight,Yt=Or(Ve)?Ve.length:1;const wi=Yt/2,Li=ki.color,cn=ki.textStrokeColor,vi=ki.textStrokeWidth;let Ue=_t;x?(Je=Mt,_t==="inner"&&(ve===Ee-1?Ue=this.options.reverse?"left":"right":ve===0?Ue=this.options.reverse?"right":"left":Ue="center"),d==="top"?P==="near"||re!==0?Zt=-Yt*ei+ei/2:P==="center"?Zt=-Fi.highest.height/2-wi*ei+ei:Zt=-Fi.highest.height+ei/2:P==="near"||re!==0?Zt=ei/2:P==="center"?Zt=Fi.highest.height/2-wi*ei:Zt=Fi.highest.height-Yt*ei,V&&(Zt*=-1),re!==0&&!ki.showLabelBackdrop&&(Je+=ei/2*Math.sin(re))):(vt=Mt,Zt=(1-Yt)*ei/2);let Yn;if(ki.showLabelBackdrop){const Ki=ma(ki.backdropPadding),ps=Fi.heights[ve],On=Fi.widths[ve];let hn=Zt-Ki.top,Hi=0-Ki.left;switch(yi){case"middle":hn-=ps/2;break;case"bottom":hn-=ps;break}switch(_t){case"center":Hi-=On/2;break;case"right":Hi-=On;break;case"inner":ve===Ee-1?Hi-=On:ve>0&&(Hi-=On/2);break}Yn={left:Hi,top:hn,width:On+Ki.width,height:ps+Ki.height,color:ki.backdropColor}}be.push({label:Ve,font:At,textOffset:Zt,options:{rotation:re,color:Li,strokeColor:cn,strokeWidth:vi,textAlign:Ue,textBaseline:yi,translation:[Je,vt],backdrop:Yn}})}return be}_getXAxisLabelAlignment(){const{position:t,ticks:o}=this.options;if(-Lc(this.labelRotation))return t==="top"?"left":"right";let d="center";return o.align==="start"?d="left":o.align==="end"?d="right":o.align==="inner"&&(d="inner"),d}_getYAxisLabelAlignment(t){const{position:o,ticks:{crossAlign:u,mirror:d,padding:_}}=this.options,x=this._getLabelSizes(),s=t+_,A=x.widest.width;let P,R;return o==="left"?d?(R=this.right+_,u==="near"?P="left":u==="center"?(P="center",R+=A/2):(P="right",R+=A)):(R=this.right-s,u==="near"?P="right":u==="center"?(P="center",R-=A/2):(P="left",R=this.left)):o==="right"?d?(R=this.left+_,u==="near"?P="right":u==="center"?(P="center",R-=A/2):(P="left",R-=A)):(R=this.left+s,u==="near"?P="left":u==="center"?(P="center",R+=A/2):(P="right",R=this.right)):P="right",{textAlign:P,x:R}}_computeLabelArea(){if(this.options.ticks.mirror)return;const t=this.chart,o=this.options.position;if(o==="left"||o==="right")return{top:0,left:this.left,bottom:t.height,right:this.right};if(o==="top"||o==="bottom")return{top:this.top,left:0,bottom:this.bottom,right:t.width}}drawBackground(){const{ctx:t,options:{backgroundColor:o},left:u,top:d,width:_,height:x}=this;o&&(t.save(),t.fillStyle=o,t.fillRect(u,d,_,x),t.restore())}getLineWidthForValue(t){const o=this.options.grid;if(!this._isVisible()||!o.display)return 0;const d=this.ticks.findIndex(_=>_.value===t);return d>=0?o.setContext(this.getContext(d)).lineWidth:0}drawGrid(t){const o=this.options.grid,u=this.ctx,d=this._gridLineItems||(this._gridLineItems=this._computeGridLineItems(t));let _,x;const s=(A,P,R)=>{!R.width||!R.color||(u.save(),u.lineWidth=R.width,u.strokeStyle=R.color,u.setLineDash(R.borderDash||[]),u.lineDashOffset=R.borderDashOffset,u.beginPath(),u.moveTo(A.x,A.y),u.lineTo(P.x,P.y),u.stroke(),u.restore())};if(o.display)for(_=0,x=d.length;_<x;++_){const A=d[_];o.drawOnChartArea&&s({x:A.x1,y:A.y1},{x:A.x2,y:A.y2},A),o.drawTicks&&s({x:A.tx1,y:A.ty1},{x:A.tx2,y:A.ty2},{color:A.tickColor,width:A.tickWidth,borderDash:A.tickBorderDash,borderDashOffset:A.tickBorderDashOffset})}}drawBorder(){const{chart:t,ctx:o,options:{border:u,grid:d}}=this,_=u.setContext(this.getContext()),x=u.display?_.width:0;if(!x)return;const s=d.setContext(this.getContext(0)).lineWidth,A=this._borderValue;let P,R,V,j;this.isHorizontal()?(P=ap(t,this.left,x)-x/2,R=ap(t,this.right,s)+s/2,V=j=A):(V=ap(t,this.top,x)-x/2,j=ap(t,this.bottom,s)+s/2,P=R=A),o.save(),o.lineWidth=_.width,o.strokeStyle=_.color,o.beginPath(),o.moveTo(P,V),o.lineTo(R,j),o.stroke(),o.restore()}drawLabels(t){if(!this.options.ticks.display)return;const u=this.ctx,d=this._computeLabelArea();d&&b1(u,d);const _=this.getLabelItems(t);for(const x of _){const s=x.options,A=x.font,P=x.label,R=x.textOffset;Lp(u,P,0,R,A,s)}d&&w1(u)}drawTitle(){const{ctx:t,options:{position:o,title:u,reverse:d}}=this;if(!u.display)return;const _=Io(u.font),x=ma(u.padding),s=u.align;let A=_.lineHeight/2;o==="bottom"||o==="center"||Bs(o)?(A+=x.bottom,Or(u.text)&&(A+=_.lineHeight*(u.text.length-1))):A+=x.top;const{titleX:P,titleY:R,maxWidth:V,rotation:j}=Ane(this,A,o,s);Lp(t,u.text,0,0,_,{color:u.color,maxWidth:V,rotation:j,textAlign:Ene(s,o,d),textBaseline:"middle",translation:[P,R]})}draw(t){this._isVisible()&&(this.drawBackground(),this.drawGrid(t),this.drawBorder(),this.drawTitle(),this.drawLabels(t))}_layers(){const t=this.options,o=t.ticks&&t.ticks.z||0,u=us(t.grid&&t.grid.z,-1),d=us(t.border&&t.border.z,0);return!this._isVisible()||this.draw!==Fp.prototype.draw?[{z:o,draw:_=>{this.draw(_)}}]:[{z:u,draw:_=>{this.drawBackground(),this.drawGrid(_),this.drawTitle()}},{z:d,draw:()=>{this.drawBorder()}},{z:o,draw:_=>{this.drawLabels(_)}}]}getMatchingVisibleMetas(t){const o=this.chart.getSortedVisibleDatasetMetas(),u=this.axis+"AxisID",d=[];let _,x;for(_=0,x=o.length;_<x;++_){const s=o[_];s[u]===this.id&&(!t||s.type===t)&&d.push(s)}return d}_resolveTickFontOptions(t){const o=this.options.ticks.setContext(this.getContext(t));return Io(o.font)}_maxDigits(){const t=this._resolveTickFontOptions(0).lineHeight;return(this.isHorizontal()?this.width:this.height)/t}}class $v{constructor(t,o,u){this.type=t,this.scope=o,this.override=u,this.items=Object.create(null)}isForType(t){return Object.prototype.isPrototypeOf.call(this.type.prototype,t.prototype)}register(t){const o=Object.getPrototypeOf(t);let u;Mne(o)&&(u=this.register(o));const d=this.items,_=t.id,x=this.scope+"."+_;if(!_)throw new Error("class does not have id: "+t);return _ in d||(d[_]=t,Cne(t,x,u),this.override&&zr.override(t.id,t.overrides)),x}get(t){return this.items[t]}unregister(t){const o=this.items,u=t.id,d=this.scope;u in o&&delete o[u],d&&u in zr[d]&&(delete zr[d][u],this.override&&delete kp[u])}}function Cne(n,t,o){const u=Ly(Object.create(null),[o?zr.get(o):{},zr.get(t),n.defaults]);zr.set(t,u),n.defaultRoutes&&Ine(t,n.defaultRoutes),n.descriptors&&zr.describe(t,n.descriptors)}function Ine(n,t){Object.keys(t).forEach(o=>{const u=o.split("."),d=u.pop(),_=[n].concat(u).join("."),x=t[o].split("."),s=x.pop(),A=x.join(".");zr.route(_,d,A,s)})}function Mne(n){return"id"in n&&"defaults"in n}class Pne{constructor(){this.controllers=new $v(Oc,"datasets",!0),this.elements=new $v(Oh,"elements"),this.plugins=new $v(Object,"plugins"),this.scales=new $v(Fp,"scales"),this._typedRegistries=[this.controllers,this.scales,this.elements]}add(...t){this._each("register",t)}remove(...t){this._each("unregister",t)}addControllers(...t){this._each("register",t,this.controllers)}addElements(...t){this._each("register",t,this.elements)}addPlugins(...t){this._each("register",t,this.plugins)}addScales(...t){this._each("register",t,this.scales)}getController(t){return this._get(t,this.controllers,"controller")}getElement(t){return this._get(t,this.elements,"element")}getPlugin(t){return this._get(t,this.plugins,"plugin")}getScale(t){return this._get(t,this.scales,"scale")}removeControllers(...t){this._each("unregister",t,this.controllers)}removeElements(...t){this._each("unregister",t,this.elements)}removePlugins(...t){this._each("unregister",t,this.plugins)}removeScales(...t){this._each("unregister",t,this.scales)}_each(t,o,u){[...o].forEach(d=>{const _=u||this._getRegistryForType(d);u||_.isForType(d)||_===this.plugins&&d.id?this._exec(t,_,d):lr(d,x=>{const s=u||this._getRegistryForType(x);this._exec(t,s,x)})})}_exec(t,o,u){const d=hS(t);br(u["before"+d],[],u),o[t](u),br(u["after"+d],[],u)}_getRegistryForType(t){for(let o=0;o<this._typedRegistries.length;o++){const u=this._typedRegistries[o];if(u.isForType(t))return u}return this.plugins}_get(t,o,u){const d=o.get(t);if(d===void 0)throw new Error('"'+t+'" is not a registered '+u+".");return d}}var _u=new Pne;class Dne{constructor(){this._init=[]}notify(t,o,u,d){o==="beforeInit"&&(this._init=this._createDescriptors(t,!0),this._notify(this._init,t,"install"));const _=d?this._descriptors(t).filter(d):this._descriptors(t),x=this._notify(_,t,o,u);return o==="afterDestroy"&&(this._notify(_,t,"stop"),this._notify(this._init,t,"uninstall")),x}_notify(t,o,u,d){d=d||{};for(const _ of t){const x=_.plugin,s=x[u],A=[o,d,_.options];if(br(s,A,x)===!1&&d.cancelable)return!1}return!0}invalidate(){Rs(this._cache)||(this._oldCache=this._cache,this._cache=void 0)}_descriptors(t){if(this._cache)return this._cache;const o=this._cache=this._createDescriptors(t);return this._notifyStateChanges(t),o}_createDescriptors(t,o){const u=t&&t.config,d=us(u.options&&u.options.plugins,{}),_=kne(u);return d===!1&&!o?[]:Rne(t,_,d,o)}_notifyStateChanges(t){const o=this._oldCache||[],u=this._cache,d=(_,x)=>_.filter(s=>!x.some(A=>s.plugin.id===A.plugin.id));this._notify(d(o,u),t,"stop"),this._notify(d(u,o),t,"start")}}function kne(n){const t={},o=[],u=Object.keys(_u.plugins.items);for(let _=0;_<u.length;_++)o.push(_u.getPlugin(u[_]));const d=n.plugins||[];for(let _=0;_<d.length;_++){const x=d[_];o.indexOf(x)===-1&&(o.push(x),t[x.id]=!0)}return{plugins:o,localIds:t}}function Lne(n,t){return!t&&n===!1?null:n===!0?{}:n}function Rne(n,{plugins:t,localIds:o},u,d){const _=[],x=n.getContext();for(const s of t){const A=s.id,P=Lne(u[A],d);P!==null&&_.push({plugin:s,options:One(n.config,{plugin:s,local:o[A]},P,x)})}return _}function One(n,{plugin:t,local:o},u,d){const _=n.pluginScopeKeys(t),x=n.getOptionScopes(u,_);return o&&t.defaults&&x.push(t.defaults),n.createResolver(x,d,[""],{scriptable:!1,indexable:!1,allKeys:!0})}function Y2(n,t){const o=zr.datasets[n]||{};return((t.datasets||{})[n]||{}).indexAxis||t.indexAxis||o.indexAxis||"x"}function zne(n,t){let o=n;return n==="_index_"?o=t:n==="_value_"&&(o=t==="x"?"y":"x"),o}function Fne(n,t){return n===t?"_index_":"_value_"}function EP(n){if(n==="x"||n==="y"||n==="r")return n}function Bne(n){if(n==="top"||n==="bottom")return"x";if(n==="left"||n==="right")return"y"}function K2(n,...t){if(EP(n))return n;for(const o of t){const u=o.axis||Bne(o.position)||n.length>1&&EP(n[0].toLowerCase());if(u)return u}throw new Error(`Cannot determine type of '${n}' axis. Please provide 'axis' or 'position' option.`)}function AP(n,t,o){if(o[t+"AxisID"]===n)return{axis:t}}function Nne(n,t){if(t.data&&t.data.datasets){const o=t.data.datasets.filter(u=>u.xAxisID===n||u.yAxisID===n);if(o.length)return AP(n,"x",o[0])||AP(n,"y",o[0])}return{}}function Vne(n,t){const o=kp[n.type]||{scales:{}},u=t.scales||{},d=Y2(n.type,t),_=Object.create(null);return Object.keys(u).forEach(x=>{const s=u[x];if(!Bs(s))return console.error(`Invalid scale configuration for scale: ${x}`);if(s._proxy)return console.warn(`Ignoring resolver passed as options for scale: ${x}`);const A=K2(x,s,Nne(x,n),zr.scales[s.type]),P=Fne(A,d),R=o.scales||{};_[x]=dy(Object.create(null),[{axis:A},s,R[A],R[P]])}),n.data.datasets.forEach(x=>{const s=x.type||n.type,A=x.indexAxis||Y2(s,t),R=(kp[s]||{}).scales||{};Object.keys(R).forEach(V=>{const j=zne(V,A),Q=x[j+"AxisID"]||j;_[Q]=_[Q]||Object.create(null),dy(_[Q],[{axis:j},u[Q],R[V]])})}),Object.keys(_).forEach(x=>{const s=_[x];dy(s,[zr.scales[s.type],zr.scale])}),_}function gR(n){const t=n.options||(n.options={});t.plugins=us(t.plugins,{}),t.scales=Vne(n,t)}function _R(n){return n=n||{},n.datasets=n.datasets||[],n.labels=n.labels||[],n}function $ne(n){return n=n||{},n.data=_R(n.data),gR(n),n}const CP=new Map,yR=new Set;function jv(n,t){let o=CP.get(n);return o||(o=t(),CP.set(n,o),yR.add(o)),o}const H_=(n,t,o)=>{const u=ef(t,o);u!==void 0&&n.add(u)};class jne{constructor(t){this._config=$ne(t),this._scopeCache=new Map,this._resolverCache=new Map}get platform(){return this._config.platform}get type(){return this._config.type}set type(t){this._config.type=t}get data(){return this._config.data}set data(t){this._config.data=_R(t)}get options(){return this._config.options}set options(t){this._config.options=t}get plugins(){return this._config.plugins}update(){const t=this._config;this.clearCache(),gR(t)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(t){return jv(t,()=>[[`datasets.${t}`,""]])}datasetAnimationScopeKeys(t,o){return jv(`${t}.transition.${o}`,()=>[[`datasets.${t}.transitions.${o}`,`transitions.${o}`],[`datasets.${t}`,""]])}datasetElementScopeKeys(t,o){return jv(`${t}-${o}`,()=>[[`datasets.${t}.elements.${o}`,`datasets.${t}`,`elements.${o}`,""]])}pluginScopeKeys(t){const o=t.id,u=this.type;return jv(`${u}-plugin-${o}`,()=>[[`plugins.${o}`,...t.additionalOptionScopes||[]]])}_cachedScopes(t,o){const u=this._scopeCache;let d=u.get(t);return(!d||o)&&(d=new Map,u.set(t,d)),d}getOptionScopes(t,o,u){const{options:d,type:_}=this,x=this._cachedScopes(t,u),s=x.get(o);if(s)return s;const A=new Set;o.forEach(R=>{t&&(A.add(t),R.forEach(V=>H_(A,t,V))),R.forEach(V=>H_(A,d,V)),R.forEach(V=>H_(A,kp[_]||{},V)),R.forEach(V=>H_(A,zr,V)),R.forEach(V=>H_(A,q2,V))});const P=Array.from(A);return P.length===0&&P.push(Object.create(null)),yR.has(o)&&x.set(o,P),P}chartOptionScopes(){const{options:t,type:o}=this;return[t,kp[o]||{},zr.datasets[o]||{},{type:o},zr,q2]}resolveNamedOptions(t,o,u,d=[""]){const _={$shared:!0},{resolver:x,subPrefixes:s}=IP(this._resolverCache,t,d);let A=x;if(Hne(x,o)){_.$shared=!1,u=tf(u)?u():u;const P=this.createResolver(t,u,s);A=pg(x,u,P)}for(const P of o)_[P]=A[P];return _}createResolver(t,o,u=[""],d){const{resolver:_}=IP(this._resolverCache,t,u);return Bs(o)?pg(_,o,void 0,d):_}}function IP(n,t,o){let u=n.get(t);u||(u=new Map,n.set(t,u));const d=o.join();let _=u.get(d);return _||(_={resolver:_S(t,o),subPrefixes:o.filter(s=>!s.toLowerCase().includes("hover"))},u.set(d,_)),_}const Une=n=>Bs(n)&&Object.getOwnPropertyNames(n).some(t=>tf(n[t]));function Hne(n,t){const{isScriptable:o,isIndexable:u}=KL(n);for(const d of t){const _=o(d),x=u(d),s=(x||_)&&n[d];if(_&&(tf(s)||Une(s))||x&&Or(s))return!0}return!1}var Gne="4.4.8";const Wne=["top","bottom","left","right","chartArea"];function MP(n,t){return n==="top"||n==="bottom"||Wne.indexOf(n)===-1&&t==="x"}function PP(n,t){return function(o,u){return o[n]===u[n]?o[t]-u[t]:o[n]-u[n]}}function DP(n){const t=n.chart,o=t.options.animation;t.notifyPlugins("afterRender"),br(o&&o.onComplete,[n],t)}function qne(n){const t=n.chart,o=t.options.animation;br(o&&o.onProgress,[n],t)}function vR(n){return xS()&&typeof n=="string"?n=document.getElementById(n):n&&n.length&&(n=n[0]),n&&n.canvas&&(n=n.canvas),n}const fx={},kP=n=>{const t=vR(n);return Object.values(fx).filter(o=>o.canvas===t).pop()};function Zne(n,t,o){const u=Object.keys(n);for(const d of u){const _=+d;if(_>=t){const x=n[d];delete n[d],(o>0||_>t)&&(n[_+o]=x)}}}function Xne(n,t,o,u){return!o||n.type==="mouseout"?null:u?t:n}function Uv(n,t,o){return n.options.clip?n[o]:t[o]}function Yne(n,t){const{xScale:o,yScale:u}=n;return o&&u?{left:Uv(o,t,"left"),right:Uv(o,t,"right"),top:Uv(u,t,"top"),bottom:Uv(u,t,"bottom")}:t}class _h{static register(...t){_u.add(...t),LP()}static unregister(...t){_u.remove(...t),LP()}constructor(t,o){const u=this.config=new jne(o),d=vR(t),_=kP(d);if(_)throw new Error("Canvas is already in use. Chart with ID '"+_.id+"' must be destroyed before the canvas with ID '"+_.canvas.id+"' can be reused.");const x=u.createResolver(u.chartOptionScopes(),this.getContext());this.platform=new(u.platform||fne(d)),this.platform.updateConfig(u);const s=this.platform.acquireContext(d,x.aspectRatio),A=s&&s.canvas,P=A&&A.height,R=A&&A.width;if(this.id=Kee(),this.ctx=s,this.canvas=A,this.width=R,this.height=P,this._options=x,this._aspectRatio=this.aspectRatio,this._layers=[],this._metasets=[],this._stacks=void 0,this.boxes=[],this.currentDevicePixelRatio=void 0,this.chartArea=void 0,this._active=[],this._lastEvent=void 0,this._listeners={},this._responsiveListeners=void 0,this._sortedMetasets=[],this.scales={},this._plugins=new Dne,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=pte(V=>this.update(V),x.resizeDelay||0),this._dataChanges=[],fx[this.id]=this,!s||!A){console.error("Failed to create chart: can't acquire context from the given item");return}fh.listen(this,"complete",DP),fh.listen(this,"progress",qne),this._initialize(),this.attached&&this.update()}get aspectRatio(){const{options:{aspectRatio:t,maintainAspectRatio:o},width:u,height:d,_aspectRatio:_}=this;return Rs(t)?o&&_?_:d?u/d:null:t}get data(){return this.config.data}set data(t){this.config.data=t}get options(){return this._options}set options(t){this.config.options=t}get registry(){return _u}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():tP(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return JM(this.canvas,this.ctx),this}stop(){return fh.stop(this),this}resize(t,o){fh.running(this)?this._resizeBeforeDraw={width:t,height:o}:this._resize(t,o)}_resize(t,o){const u=this.options,d=this.canvas,_=u.maintainAspectRatio&&this.aspectRatio,x=this.platform.getMaximumSize(d,t,o,_),s=u.devicePixelRatio||this.platform.getDevicePixelRatio(),A=this.width?"resize":"attach";this.width=x.width,this.height=x.height,this._aspectRatio=this.aspectRatio,tP(this,s,!0)&&(this.notifyPlugins("resize",{size:x}),br(u.onResize,[this,x],this),this.attached&&this._doResize(A)&&this.render())}ensureScalesHaveIDs(){const o=this.options.scales||{};lr(o,(u,d)=>{u.id=d})}buildOrUpdateScales(){const t=this.options,o=t.scales,u=this.scales,d=Object.keys(u).reduce((x,s)=>(x[s]=!1,x),{});let _=[];o&&(_=_.concat(Object.keys(o).map(x=>{const s=o[x],A=K2(x,s),P=A==="r",R=A==="x";return{options:s,dposition:P?"chartArea":R?"bottom":"left",dtype:P?"radialLinear":R?"category":"linear"}}))),lr(_,x=>{const s=x.options,A=s.id,P=K2(A,s),R=us(s.type,x.dtype);(s.position===void 0||MP(s.position,P)!==MP(x.dposition))&&(s.position=x.dposition),d[A]=!0;let V=null;if(A in u&&u[A].type===R)V=u[A];else{const j=_u.getScale(R);V=new j({id:A,type:R,ctx:this.ctx,chart:this}),u[V.id]=V}V.init(s,t)}),lr(d,(x,s)=>{x||delete u[s]}),lr(u,x=>{da.configure(this,x,x.options),da.addBox(this,x)})}_updateMetasets(){const t=this._metasets,o=this.data.datasets.length,u=t.length;if(t.sort((d,_)=>d.index-_.index),u>o){for(let d=o;d<u;++d)this._destroyDatasetMeta(d);t.splice(o,u-o)}this._sortedMetasets=t.slice(0).sort(PP("order","index"))}_removeUnreferencedMetasets(){const{_metasets:t,data:{datasets:o}}=this;t.length>o.length&&delete this._stacks,t.forEach((u,d)=>{o.filter(_=>_===u._dataset).length===0&&this._destroyDatasetMeta(d)})}buildOrUpdateControllers(){const t=[],o=this.data.datasets;let u,d;for(this._removeUnreferencedMetasets(),u=0,d=o.length;u<d;u++){const _=o[u];let x=this.getDatasetMeta(u);const s=_.type||this.config.type;if(x.type&&x.type!==s&&(this._destroyDatasetMeta(u),x=this.getDatasetMeta(u)),x.type=s,x.indexAxis=_.indexAxis||Y2(s,this.options),x.order=_.order||0,x.index=u,x.label=""+_.label,x.visible=this.isDatasetVisible(u),x.controller)x.controller.updateIndex(u),x.controller.linkScales();else{const A=_u.getController(s),{datasetElementType:P,dataElementType:R}=zr.datasets[s];Object.assign(A,{dataElementType:_u.getElement(R),datasetElementType:P&&_u.getElement(P)}),x.controller=new A(this,u),t.push(x.controller)}}return this._updateMetasets(),t}_resetElements(){lr(this.data.datasets,(t,o)=>{this.getDatasetMeta(o).controller.reset()},this)}reset(){this._resetElements(),this.notifyPlugins("reset")}update(t){const o=this.config;o.update();const u=this._options=o.createResolver(o.chartOptionScopes(),this.getContext()),d=this._animationsDisabled=!u.animation;if(this._updateScales(),this._checkEventBindings(),this._updateHiddenIndices(),this._plugins.invalidate(),this.notifyPlugins("beforeUpdate",{mode:t,cancelable:!0})===!1)return;const _=this.buildOrUpdateControllers();this.notifyPlugins("beforeElementsUpdate");let x=0;for(let P=0,R=this.data.datasets.length;P<R;P++){const{controller:V}=this.getDatasetMeta(P),j=!d&&_.indexOf(V)===-1;V.buildOrUpdateElements(j),x=Math.max(+V.getMaxOverflow(),x)}x=this._minPadding=u.layout.autoPadding?x:0,this._updateLayout(x),d||lr(_,P=>{P.reset()}),this._updateDatasets(t),this.notifyPlugins("afterUpdate",{mode:t}),this._layers.sort(PP("z","_idx"));const{_active:s,_lastEvent:A}=this;A?this._eventHandler(A,!0):s.length&&this._updateHoverStyles(s,s,!0),this.render()}_updateScales(){lr(this.scales,t=>{da.removeBox(this,t)}),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){const t=this.options,o=new Set(Object.keys(this._listeners)),u=new Set(t.events);(!UM(o,u)||!!this._responsiveListeners!==t.responsive)&&(this.unbindEvents(),this.bindEvents())}_updateHiddenIndices(){const{_hiddenIndices:t}=this,o=this._getUniformDataChanges()||[];for(const{method:u,start:d,count:_}of o){const x=u==="_removeElements"?-_:_;Zne(t,d,x)}}_getUniformDataChanges(){const t=this._dataChanges;if(!t||!t.length)return;this._dataChanges=[];const o=this.data.datasets.length,u=_=>new Set(t.filter(x=>x[0]===_).map((x,s)=>s+","+x.splice(1).join(","))),d=u(0);for(let _=1;_<o;_++)if(!UM(d,u(_)))return;return Array.from(d).map(_=>_.split(",")).map(_=>({method:_[1],start:+_[2],count:+_[3]}))}_updateLayout(t){if(this.notifyPlugins("beforeLayout",{cancelable:!0})===!1)return;da.update(this,this.width,this.height,t);const o=this.chartArea,u=o.width<=0||o.height<=0;this._layers=[],lr(this.boxes,d=>{u&&d.position==="chartArea"||(d.configure&&d.configure(),this._layers.push(...d._layers()))},this),this._layers.forEach((d,_)=>{d._idx=_}),this.notifyPlugins("afterLayout")}_updateDatasets(t){if(this.notifyPlugins("beforeDatasetsUpdate",{mode:t,cancelable:!0})!==!1){for(let o=0,u=this.data.datasets.length;o<u;++o)this.getDatasetMeta(o).controller.configure();for(let o=0,u=this.data.datasets.length;o<u;++o)this._updateDataset(o,tf(t)?t({datasetIndex:o}):t);this.notifyPlugins("afterDatasetsUpdate",{mode:t})}}_updateDataset(t,o){const u=this.getDatasetMeta(t),d={meta:u,index:t,mode:o,cancelable:!0};this.notifyPlugins("beforeDatasetUpdate",d)!==!1&&(u.controller._update(o),d.cancelable=!1,this.notifyPlugins("afterDatasetUpdate",d))}render(){this.notifyPlugins("beforeRender",{cancelable:!0})!==!1&&(fh.has(this)?this.attached&&!fh.running(this)&&fh.start(this):(this.draw(),DP({chart:this})))}draw(){let t;if(this._resizeBeforeDraw){const{width:u,height:d}=this._resizeBeforeDraw;this._resizeBeforeDraw=null,this._resize(u,d)}if(this.clear(),this.width<=0||this.height<=0||this.notifyPlugins("beforeDraw",{cancelable:!0})===!1)return;const o=this._layers;for(t=0;t<o.length&&o[t].z<=0;++t)o[t].draw(this.chartArea);for(this._drawDatasets();t<o.length;++t)o[t].draw(this.chartArea);this.notifyPlugins("afterDraw")}_getSortedDatasetMetas(t){const o=this._sortedMetasets,u=[];let d,_;for(d=0,_=o.length;d<_;++d){const x=o[d];(!t||x.visible)&&u.push(x)}return u}getSortedVisibleDatasetMetas(){return this._getSortedDatasetMetas(!0)}_drawDatasets(){if(this.notifyPlugins("beforeDatasetsDraw",{cancelable:!0})===!1)return;const t=this.getSortedVisibleDatasetMetas();for(let o=t.length-1;o>=0;--o)this._drawDataset(t[o]);this.notifyPlugins("afterDatasetsDraw")}_drawDataset(t){const o=this.ctx,u=t._clip,d=!u.disabled,_=Yne(t,this.chartArea),x={meta:t,index:t.index,cancelable:!0};this.notifyPlugins("beforeDatasetDraw",x)!==!1&&(d&&b1(o,{left:u.left===!1?0:_.left-u.left,right:u.right===!1?this.width:_.right+u.right,top:u.top===!1?0:_.top-u.top,bottom:u.bottom===!1?this.height:_.bottom+u.bottom}),t.controller.draw(),d&&w1(o),x.cancelable=!1,this.notifyPlugins("afterDatasetDraw",x))}isPointInArea(t){return Sh(t,this.chartArea,this._minPadding)}getElementsAtEventForMode(t,o,u,d){const _=Wie.modes[o];return typeof _=="function"?_(this,t,u,d):[]}getDatasetMeta(t){const o=this.data.datasets[t],u=this._metasets;let d=u.filter(_=>_&&_._dataset===o).pop();return d||(d={type:null,data:[],dataset:null,controller:null,hidden:null,xAxisID:null,yAxisID:null,order:o&&o.order||0,index:t,_dataset:o,_parsed:[],_sorted:!1},u.push(d)),d}getContext(){return this.$context||(this.$context=uf(null,{chart:this,type:"chart"}))}getVisibleDatasetCount(){return this.getSortedVisibleDatasetMetas().length}isDatasetVisible(t){const o=this.data.datasets[t];if(!o)return!1;const u=this.getDatasetMeta(t);return typeof u.hidden=="boolean"?!u.hidden:!o.hidden}setDatasetVisibility(t,o){const u=this.getDatasetMeta(t);u.hidden=!o}toggleDataVisibility(t){this._hiddenIndices[t]=!this._hiddenIndices[t]}getDataVisibility(t){return!this._hiddenIndices[t]}_updateVisibility(t,o,u){const d=u?"show":"hide",_=this.getDatasetMeta(t),x=_.controller._resolveAnimations(void 0,d);Ry(o)?(_.data[o].hidden=!u,this.update()):(this.setDatasetVisibility(t,u),x.update(_,{visible:u}),this.update(s=>s.datasetIndex===t?d:void 0))}hide(t,o){this._updateVisibility(t,o,!1)}show(t,o){this._updateVisibility(t,o,!0)}_destroyDatasetMeta(t){const o=this._metasets[t];o&&o.controller&&o.controller._destroy(),delete this._metasets[t]}_stop(){let t,o;for(this.stop(),fh.remove(this),t=0,o=this.data.datasets.length;t<o;++t)this._destroyDatasetMeta(t)}destroy(){this.notifyPlugins("beforeDestroy");const{canvas:t,ctx:o}=this;this._stop(),this.config.clearCache(),t&&(this.unbindEvents(),JM(t,o),this.platform.releaseContext(o),this.canvas=null,this.ctx=null),delete fx[this.id],this.notifyPlugins("afterDestroy")}toBase64Image(...t){return this.canvas.toDataURL(...t)}bindEvents(){this.bindUserEvents(),this.options.responsive?this.bindResponsiveEvents():this.attached=!0}bindUserEvents(){const t=this._listeners,o=this.platform,u=(_,x)=>{o.addEventListener(this,_,x),t[_]=x},d=(_,x,s)=>{_.offsetX=x,_.offsetY=s,this._eventHandler(_)};lr(this.options.events,_=>u(_,d))}bindResponsiveEvents(){this._responsiveListeners||(this._responsiveListeners={});const t=this._responsiveListeners,o=this.platform,u=(A,P)=>{o.addEventListener(this,A,P),t[A]=P},d=(A,P)=>{t[A]&&(o.removeEventListener(this,A,P),delete t[A])},_=(A,P)=>{this.canvas&&this.resize(A,P)};let x;const s=()=>{d("attach",s),this.attached=!0,this.resize(),u("resize",_),u("detach",x)};x=()=>{this.attached=!1,d("resize",_),this._stop(),this._resize(0,0),u("attach",s)},o.isAttached(this.canvas)?s():x()}unbindEvents(){lr(this._listeners,(t,o)=>{this.platform.removeEventListener(this,o,t)}),this._listeners={},lr(this._responsiveListeners,(t,o)=>{this.platform.removeEventListener(this,o,t)}),this._responsiveListeners=void 0}updateHoverStyle(t,o,u){const d=u?"set":"remove";let _,x,s,A;for(o==="dataset"&&(_=this.getDatasetMeta(t[0].datasetIndex),_.controller["_"+d+"DatasetHoverStyle"]()),s=0,A=t.length;s<A;++s){x=t[s];const P=x&&this.getDatasetMeta(x.datasetIndex).controller;P&&P[d+"HoverStyle"](x.element,x.datasetIndex,x.index)}}getActiveElements(){return this._active||[]}setActiveElements(t){const o=this._active||[],u=t.map(({datasetIndex:_,index:x})=>{const s=this.getDatasetMeta(_);if(!s)throw new Error("No dataset found at index "+_);return{datasetIndex:_,element:s.data[x],index:x}});!kx(u,o)&&(this._active=u,this._lastEvent=null,this._updateHoverStyles(u,o))}notifyPlugins(t,o,u){return this._plugins.notify(this,t,o,u)}isPluginEnabled(t){return this._plugins._cache.filter(o=>o.plugin.id===t).length===1}_updateHoverStyles(t,o,u){const d=this.options.hover,_=(A,P)=>A.filter(R=>!P.some(V=>R.datasetIndex===V.datasetIndex&&R.index===V.index)),x=_(o,t),s=u?t:_(t,o);x.length&&this.updateHoverStyle(x,d.mode,!1),s.length&&d.mode&&this.updateHoverStyle(s,d.mode,!0)}_eventHandler(t,o){const u={event:t,replay:o,cancelable:!0,inChartArea:this.isPointInArea(t)},d=x=>(x.options.events||this.options.events).includes(t.native.type);if(this.notifyPlugins("beforeEvent",u,d)===!1)return;const _=this._handleEvent(t,o,u.inChartArea);return u.cancelable=!1,this.notifyPlugins("afterEvent",u,d),(_||u.changed)&&this.render(),this}_handleEvent(t,o,u){const{_active:d=[],options:_}=this,x=o,s=this._getActiveElements(t,d,u,x),A=nte(t),P=Xne(t,this._lastEvent,u,A);u&&(this._lastEvent=null,br(_.onHover,[t,s,this],this),A&&br(_.onClick,[t,s,this],this));const R=!kx(s,d);return(R||o)&&(this._active=s,this._updateHoverStyles(s,d,o)),this._lastEvent=P,R}_getActiveElements(t,o,u,d){if(t.type==="mouseout")return[];if(!u)return o;const _=this.options.hover;return this.getElementsAtEventForMode(t,_.mode,_,d)}}zi(_h,"defaults",zr),zi(_h,"instances",fx),zi(_h,"overrides",kp),zi(_h,"registry",_u),zi(_h,"version",Gne),zi(_h,"getChart",kP);function LP(){return lr(_h.instances,n=>n._plugins.invalidate())}function Kne(n,t,o){const{startAngle:u,pixelMargin:d,x:_,y:x,outerRadius:s,innerRadius:A}=t;let P=d/s;n.beginPath(),n.arc(_,x,s,u-P,o+P),A>d?(P=d/A,n.arc(_,x,A,o+P,u-P,!0)):n.arc(_,x,d,o+ao,u-ao),n.closePath(),n.clip()}function Jne(n){return gS(n,["outerStart","outerEnd","innerStart","innerEnd"])}function Qne(n,t,o,u){const d=Jne(n.options.borderRadius),_=(o-t)/2,x=Math.min(_,u*t/2),s=A=>{const P=(o-Math.min(_,A))*u/2;return zo(A,0,Math.min(_,P))};return{outerStart:s(d.outerStart),outerEnd:s(d.outerEnd),innerStart:zo(d.innerStart,0,x),innerEnd:zo(d.innerEnd,0,x)}}function $m(n,t,o,u){return{x:o+n*Math.cos(t),y:u+n*Math.sin(t)}}function Bx(n,t,o,u,d,_){const{x,y:s,startAngle:A,pixelMargin:P,innerRadius:R}=t,V=Math.max(t.outerRadius+u+o-P,0),j=R>0?R+u+o+P:0;let Q=0;const me=d-A;if(u){const ki=R>0?R-u:0,wi=V>0?V-u:0,Li=(ki+wi)/2,cn=Li!==0?me*Li/(Li+u):me;Q=(me-cn)/2}const re=Math.max(.001,me*V-o/Mr)/V,be=(me-re)/2,ve=A+be+Q,Ee=d-be-Q,{outerStart:je,outerEnd:Ve,innerStart:Je,innerEnd:vt}=Qne(t,j,V,Ee-ve),_t=V-je,Mt=V-Ve,At=ve+je/_t,ei=Ee-Ve/Mt,Yt=j+Je,Zt=j+vt,yi=ve+Je/Yt,Fi=Ee-vt/Zt;if(n.beginPath(),_){const ki=(At+ei)/2;if(n.arc(x,s,V,At,ki),n.arc(x,s,V,ki,ei),Ve>0){const vi=$m(Mt,ei,x,s);n.arc(vi.x,vi.y,Ve,ei,Ee+ao)}const wi=$m(Zt,Ee,x,s);if(n.lineTo(wi.x,wi.y),vt>0){const vi=$m(Zt,Fi,x,s);n.arc(vi.x,vi.y,vt,Ee+ao,Fi+Math.PI)}const Li=(Ee-vt/j+(ve+Je/j))/2;if(n.arc(x,s,j,Ee-vt/j,Li,!0),n.arc(x,s,j,Li,ve+Je/j,!0),Je>0){const vi=$m(Yt,yi,x,s);n.arc(vi.x,vi.y,Je,yi+Math.PI,ve-ao)}const cn=$m(_t,ve,x,s);if(n.lineTo(cn.x,cn.y),je>0){const vi=$m(_t,At,x,s);n.arc(vi.x,vi.y,je,ve-ao,At)}}else{n.moveTo(x,s);const ki=Math.cos(At)*V+x,wi=Math.sin(At)*V+s;n.lineTo(ki,wi);const Li=Math.cos(ei)*V+x,cn=Math.sin(ei)*V+s;n.lineTo(Li,cn)}n.closePath()}function ese(n,t,o,u,d){const{fullCircles:_,startAngle:x,circumference:s}=t;let A=t.endAngle;if(_){Bx(n,t,o,u,A,d);for(let P=0;P<_;++P)n.fill();isNaN(s)||(A=x+(s%Ir||Ir))}return Bx(n,t,o,u,A,d),n.fill(),A}function tse(n,t,o,u,d){const{fullCircles:_,startAngle:x,circumference:s,options:A}=t,{borderWidth:P,borderJoinStyle:R,borderDash:V,borderDashOffset:j}=A,Q=A.borderAlign==="inner";if(!P)return;n.setLineDash(V||[]),n.lineDashOffset=j,Q?(n.lineWidth=P*2,n.lineJoin=R||"round"):(n.lineWidth=P,n.lineJoin=R||"bevel");let me=t.endAngle;if(_){Bx(n,t,o,u,me,d);for(let re=0;re<_;++re)n.stroke();isNaN(s)||(me=x+(s%Ir||Ir))}Q&&Kne(n,t,me),_||(Bx(n,t,o,u,me,d),n.stroke())}class K_ extends Oh{constructor(o){super();zi(this,"circumference");zi(this,"endAngle");zi(this,"fullCircles");zi(this,"innerRadius");zi(this,"outerRadius");zi(this,"pixelMargin");zi(this,"startAngle");this.options=void 0,this.circumference=void 0,this.startAngle=void 0,this.endAngle=void 0,this.innerRadius=void 0,this.outerRadius=void 0,this.pixelMargin=0,this.fullCircles=0,o&&Object.assign(this,o)}inRange(o,u,d){const _=this.getProps(["x","y"],d),{angle:x,distance:s}=$L(_,{x:o,y:u}),{startAngle:A,endAngle:P,innerRadius:R,outerRadius:V,circumference:j}=this.getProps(["startAngle","endAngle","innerRadius","outerRadius","circumference"],d),Q=(this.options.spacing+this.options.borderWidth)/2,me=us(j,P-A),re=Oy(x,A,P)&&A!==P,be=me>=Ir||re,ve=wh(s,R+Q,V+Q);return be&&ve}getCenterPoint(o){const{x:u,y:d,startAngle:_,endAngle:x,innerRadius:s,outerRadius:A}=this.getProps(["x","y","startAngle","endAngle","innerRadius","outerRadius"],o),{offset:P,spacing:R}=this.options,V=(_+x)/2,j=(s+A+R+P)/2;return{x:u+Math.cos(V)*j,y:d+Math.sin(V)*j}}tooltipPosition(o){return this.getCenterPoint(o)}draw(o){const{options:u,circumference:d}=this,_=(u.offset||0)/4,x=(u.spacing||0)/2,s=u.circular;if(this.pixelMargin=u.borderAlign==="inner"?.33:0,this.fullCircles=d>Ir?Math.floor(d/Ir):0,d===0||this.innerRadius<0||this.outerRadius<0)return;o.save();const A=(this.startAngle+this.endAngle)/2;o.translate(Math.cos(A)*_,Math.sin(A)*_);const P=1-Math.sin(Math.min(Mr,d||0)),R=_*P;o.fillStyle=u.backgroundColor,o.strokeStyle=u.borderColor,ese(o,this,R,x,s),tse(o,this,R,x,s),o.restore()}}zi(K_,"id","arc"),zi(K_,"defaults",{borderAlign:"center",borderColor:"#fff",borderDash:[],borderDashOffset:0,borderJoinStyle:void 0,borderRadius:0,borderWidth:2,offset:0,spacing:0,angle:void 0,circular:!0}),zi(K_,"defaultRoutes",{backgroundColor:"backgroundColor"}),zi(K_,"descriptors",{_scriptable:!0,_indexable:o=>o!=="borderDash"});function xR(n,t,o=t){n.lineCap=us(o.borderCapStyle,t.borderCapStyle),n.setLineDash(us(o.borderDash,t.borderDash)),n.lineDashOffset=us(o.borderDashOffset,t.borderDashOffset),n.lineJoin=us(o.borderJoinStyle,t.borderJoinStyle),n.lineWidth=us(o.borderWidth,t.borderWidth),n.strokeStyle=us(o.borderColor,t.borderColor)}function ise(n,t,o){n.lineTo(o.x,o.y)}function nse(n){return n.stepped?Ate:n.tension||n.cubicInterpolationMode==="monotone"?Cte:ise}function bR(n,t,o={}){const u=n.length,{start:d=0,end:_=u-1}=o,{start:x,end:s}=t,A=Math.max(d,x),P=Math.min(_,s),R=d<x&&_<x||d>s&&_>s;return{count:u,start:A,loop:t.loop,ilen:P<A&&!R?u+P-A:P-A}}function sse(n,t,o,u){const{points:d,options:_}=t,{count:x,start:s,loop:A,ilen:P}=bR(d,o,u),R=nse(_);let{move:V=!0,reverse:j}=u||{},Q,me,re;for(Q=0;Q<=P;++Q)me=d[(s+(j?P-Q:Q))%x],!me.skip&&(V?(n.moveTo(me.x,me.y),V=!1):R(n,re,me,j,_.stepped),re=me);return A&&(me=d[(s+(j?P:0))%x],R(n,re,me,j,_.stepped)),!!A}function rse(n,t,o,u){const d=t.points,{count:_,start:x,ilen:s}=bR(d,o,u),{move:A=!0,reverse:P}=u||{};let R=0,V=0,j,Q,me,re,be,ve;const Ee=Ve=>(x+(P?s-Ve:Ve))%_,je=()=>{re!==be&&(n.lineTo(R,be),n.lineTo(R,re),n.lineTo(R,ve))};for(A&&(Q=d[Ee(0)],n.moveTo(Q.x,Q.y)),j=0;j<=s;++j){if(Q=d[Ee(j)],Q.skip)continue;const Ve=Q.x,Je=Q.y,vt=Ve|0;vt===me?(Je<re?re=Je:Je>be&&(be=Je),R=(V*R+Ve)/++V):(je(),n.lineTo(Ve,Je),me=vt,V=0,re=be=Je),ve=Je}je()}function J2(n){const t=n.options,o=t.borderDash&&t.borderDash.length;return!n._decimated&&!n._loop&&!t.tension&&t.cubicInterpolationMode!=="monotone"&&!t.stepped&&!o?rse:sse}function ose(n){return n.stepped?rie:n.tension||n.cubicInterpolationMode==="monotone"?oie:dp}function ase(n,t,o,u){let d=t._path;d||(d=t._path=new Path2D,t.path(d,o,u)&&d.closePath()),xR(n,t.options),n.stroke(d)}function lse(n,t,o,u){const{segments:d,options:_}=t,x=J2(t);for(const s of d)xR(n,_,s.style),n.beginPath(),x(n,t,s,{start:o,end:o+u-1})&&n.closePath(),n.stroke()}const cse=typeof Path2D=="function";function use(n,t,o,u){cse&&!t.options.segment?ase(n,t,o,u):lse(n,t,o,u)}class jd extends Oh{constructor(t){super(),this.animated=!0,this.options=void 0,this._chart=void 0,this._loop=void 0,this._fullLoop=void 0,this._path=void 0,this._points=void 0,this._segments=void 0,this._decimated=!1,this._pointsUpdated=!1,this._datasetIndex=void 0,t&&Object.assign(this,t)}updateControlPoints(t,o){const u=this.options;if((u.tension||u.cubicInterpolationMode==="monotone")&&!u.stepped&&!this._pointsUpdated){const d=u.spanGaps?this._loop:this._fullLoop;Kte(this._points,u,t,d,o),this._pointsUpdated=!0}}set points(t){this._points=t,delete this._segments,delete this._path,this._pointsUpdated=!1}get points(){return this._points}get segments(){return this._segments||(this._segments=die(this,this.options.segment))}first(){const t=this.segments,o=this.points;return t.length&&o[t[0].start]}last(){const t=this.segments,o=this.points,u=t.length;return u&&o[t[u-1].end]}interpolate(t,o){const u=this.options,d=t[o],_=this.points,x=aR(this,{property:o,start:d,end:d});if(!x.length)return;const s=[],A=ose(u);let P,R;for(P=0,R=x.length;P<R;++P){const{start:V,end:j}=x[P],Q=_[V],me=_[j];if(Q===me){s.push(Q);continue}const re=Math.abs((d-Q[o])/(me[o]-Q[o])),be=A(Q,me,re,u.stepped);be[o]=t[o],s.push(be)}return s.length===1?s[0]:s}pathSegment(t,o,u){return J2(this)(t,this,o,u)}path(t,o,u){const d=this.segments,_=J2(this);let x=this._loop;o=o||0,u=u||this.points.length-o;for(const s of d)x&=_(t,this,s,{start:o,end:o+u-1});return!!x}draw(t,o,u,d){const _=this.options||{};(this.points||[]).length&&_.borderWidth&&(t.save(),use(t,this,u,d),t.restore()),this.animated&&(this._pointsUpdated=!1,this._path=void 0)}}zi(jd,"id","line"),zi(jd,"defaults",{borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderWidth:3,capBezierPoints:!0,cubicInterpolationMode:"default",fill:!1,spanGaps:!1,stepped:!1,tension:0}),zi(jd,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"}),zi(jd,"descriptors",{_scriptable:!0,_indexable:t=>t!=="borderDash"&&t!=="fill"});function RP(n,t,o,u){const d=n.options,{[o]:_}=n.getProps([o],u);return Math.abs(t-_)<d.radius+d.hitRadius}class px extends Oh{constructor(o){super();zi(this,"parsed");zi(this,"skip");zi(this,"stop");this.options=void 0,this.parsed=void 0,this.skip=void 0,this.stop=void 0,o&&Object.assign(this,o)}inRange(o,u,d){const _=this.options,{x,y:s}=this.getProps(["x","y"],d);return Math.pow(o-x,2)+Math.pow(u-s,2)<Math.pow(_.hitRadius+_.radius,2)}inXRange(o,u){return RP(this,o,"x",u)}inYRange(o,u){return RP(this,o,"y",u)}getCenterPoint(o){const{x:u,y:d}=this.getProps(["x","y"],o);return{x:u,y:d}}size(o){o=o||this.options||{};let u=o.radius||0;u=Math.max(u,u&&o.hoverRadius||0);const d=u&&o.borderWidth||0;return(u+d)*2}draw(o,u){const d=this.options;this.skip||d.radius<.1||!Sh(this,u,this.size(d)/2)||(o.strokeStyle=d.borderColor,o.lineWidth=d.borderWidth,o.fillStyle=d.backgroundColor,Z2(o,d,this.x,this.y))}getRange(){const o=this.options||{};return o.radius+o.hitRadius}}zi(px,"id","point"),zi(px,"defaults",{borderWidth:1,hitRadius:1,hoverBorderWidth:1,hoverRadius:4,pointStyle:"circle",radius:3,rotation:0}),zi(px,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"});function wR(n,t){const{x:o,y:u,base:d,width:_,height:x}=n.getProps(["x","y","base","width","height"],t);let s,A,P,R,V;return n.horizontal?(V=x/2,s=Math.min(o,d),A=Math.max(o,d),P=u-V,R=u+V):(V=_/2,s=o-V,A=o+V,P=Math.min(u,d),R=Math.max(u,d)),{left:s,top:P,right:A,bottom:R}}function Ud(n,t,o,u){return n?0:zo(t,o,u)}function hse(n,t,o){const u=n.options.borderWidth,d=n.borderSkipped,_=YL(u);return{t:Ud(d.top,_.top,0,o),r:Ud(d.right,_.right,0,t),b:Ud(d.bottom,_.bottom,0,o),l:Ud(d.left,_.left,0,t)}}function dse(n,t,o){const{enableBorderRadius:u}=n.getProps(["enableBorderRadius"]),d=n.options.borderRadius,_=wp(d),x=Math.min(t,o),s=n.borderSkipped,A=u||Bs(d);return{topLeft:Ud(!A||s.top||s.left,_.topLeft,0,x),topRight:Ud(!A||s.top||s.right,_.topRight,0,x),bottomLeft:Ud(!A||s.bottom||s.left,_.bottomLeft,0,x),bottomRight:Ud(!A||s.bottom||s.right,_.bottomRight,0,x)}}function fse(n){const t=wR(n),o=t.right-t.left,u=t.bottom-t.top,d=hse(n,o/2,u/2),_=dse(n,o/2,u/2);return{outer:{x:t.left,y:t.top,w:o,h:u,radius:_},inner:{x:t.left+d.l,y:t.top+d.t,w:o-d.l-d.r,h:u-d.t-d.b,radius:{topLeft:Math.max(0,_.topLeft-Math.max(d.t,d.l)),topRight:Math.max(0,_.topRight-Math.max(d.t,d.r)),bottomLeft:Math.max(0,_.bottomLeft-Math.max(d.b,d.l)),bottomRight:Math.max(0,_.bottomRight-Math.max(d.b,d.r))}}}}function Qw(n,t,o,u){const d=t===null,_=o===null,s=n&&!(d&&_)&&wR(n,u);return s&&(d||wh(t,s.left,s.right))&&(_||wh(o,s.top,s.bottom))}function pse(n){return n.topLeft||n.topRight||n.bottomLeft||n.bottomRight}function mse(n,t){n.rect(t.x,t.y,t.w,t.h)}function e2(n,t,o={}){const u=n.x!==o.x?-t:0,d=n.y!==o.y?-t:0,_=(n.x+n.w!==o.x+o.w?t:0)-u,x=(n.y+n.h!==o.y+o.h?t:0)-d;return{x:n.x+u,y:n.y+d,w:n.w+_,h:n.h+x,radius:n.radius}}class mx extends Oh{constructor(t){super(),this.options=void 0,this.horizontal=void 0,this.base=void 0,this.width=void 0,this.height=void 0,this.inflateAmount=void 0,t&&Object.assign(this,t)}draw(t){const{inflateAmount:o,options:{borderColor:u,backgroundColor:d}}=this,{inner:_,outer:x}=fse(this),s=pse(x.radius)?zy:mse;t.save(),(x.w!==_.w||x.h!==_.h)&&(t.beginPath(),s(t,e2(x,o,_)),t.clip(),s(t,e2(_,-o,x)),t.fillStyle=u,t.fill("evenodd")),t.beginPath(),s(t,e2(_,o)),t.fillStyle=d,t.fill(),t.restore()}inRange(t,o,u){return Qw(this,t,o,u)}inXRange(t,o){return Qw(this,t,null,o)}inYRange(t,o){return Qw(this,null,t,o)}getCenterPoint(t){const{x:o,y:u,base:d,horizontal:_}=this.getProps(["x","y","base","horizontal"],t);return{x:_?(o+d)/2:o,y:_?u:(u+d)/2}}getRange(t){return t==="x"?this.width/2:this.height/2}}zi(mx,"id","bar"),zi(mx,"defaults",{borderSkipped:"start",borderWidth:0,borderRadius:0,inflateAmount:"auto",pointStyle:void 0}),zi(mx,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"});var gse=Object.freeze({__proto__:null,ArcElement:K_,BarElement:mx,LineElement:jd,PointElement:px});const Q2=["rgb(54, 162, 235)","rgb(255, 99, 132)","rgb(255, 159, 64)","rgb(255, 205, 86)","rgb(75, 192, 192)","rgb(153, 102, 255)","rgb(201, 203, 207)"],OP=Q2.map(n=>n.replace("rgb(","rgba(").replace(")",", 0.5)"));function TR(n){return Q2[n%Q2.length]}function SR(n){return OP[n%OP.length]}function _se(n,t){return n.borderColor=TR(t),n.backgroundColor=SR(t),++t}function yse(n,t){return n.backgroundColor=n.data.map(()=>TR(t++)),t}function vse(n,t){return n.backgroundColor=n.data.map(()=>SR(t++)),t}function xse(n){let t=0;return(o,u)=>{const d=n.getDatasetMeta(u).controller;d instanceof yp?t=yse(o,t):d instanceof gy?t=vse(o,t):d&&(t=_se(o,t))}}function zP(n){let t;for(t in n)if(n[t].borderColor||n[t].backgroundColor)return!0;return!1}function bse(n){return n&&(n.borderColor||n.backgroundColor)}function wse(){return zr.borderColor!=="rgba(0,0,0,0.1)"||zr.backgroundColor!=="rgba(0,0,0,0.1)"}var Tse={id:"colors",defaults:{enabled:!0,forceOverride:!1},beforeLayout(n,t,o){if(!o.enabled)return;const{data:{datasets:u},options:d}=n.config,{elements:_}=d,x=zP(u)||bse(d)||_&&zP(_)||wse();if(!o.forceOverride&&x)return;const s=xse(n);u.forEach(s)}};function Sse(n,t,o,u,d){const _=d.samples||u;if(_>=o)return n.slice(t,t+o);const x=[],s=(o-2)/(_-2);let A=0;const P=t+o-1;let R=t,V,j,Q,me,re;for(x[A++]=n[R],V=0;V<_-2;V++){let be=0,ve=0,Ee;const je=Math.floor((V+1)*s)+1+t,Ve=Math.min(Math.floor((V+2)*s)+1,o)+t,Je=Ve-je;for(Ee=je;Ee<Ve;Ee++)be+=n[Ee].x,ve+=n[Ee].y;be/=Je,ve/=Je;const vt=Math.floor(V*s)+1+t,_t=Math.min(Math.floor((V+1)*s)+1,o)+t,{x:Mt,y:At}=n[R];for(Q=me=-1,Ee=vt;Ee<_t;Ee++)me=.5*Math.abs((Mt-be)*(n[Ee].y-At)-(Mt-n[Ee].x)*(ve-At)),me>Q&&(Q=me,j=n[Ee],re=Ee);x[A++]=j,R=re}return x[A++]=n[P],x}function Ese(n,t,o,u){let d=0,_=0,x,s,A,P,R,V,j,Q,me,re;const be=[],ve=t+o-1,Ee=n[t].x,Ve=n[ve].x-Ee;for(x=t;x<t+o;++x){s=n[x],A=(s.x-Ee)/Ve*u,P=s.y;const Je=A|0;if(Je===R)P<me?(me=P,V=x):P>re&&(re=P,j=x),d=(_*d+s.x)/++_;else{const vt=x-1;if(!Rs(V)&&!Rs(j)){const _t=Math.min(V,j),Mt=Math.max(V,j);_t!==Q&&_t!==vt&&be.push({...n[_t],x:d}),Mt!==Q&&Mt!==vt&&be.push({...n[Mt],x:d})}x>0&&vt!==Q&&be.push(n[vt]),be.push(s),R=Je,_=0,me=re=P,V=j=Q=x}}return be}function ER(n){if(n._decimated){const t=n._data;delete n._decimated,delete n._data,Object.defineProperty(n,"data",{configurable:!0,enumerable:!0,writable:!0,value:t})}}function FP(n){n.data.datasets.forEach(t=>{ER(t)})}function Ase(n,t){const o=t.length;let u=0,d;const{iScale:_}=n,{min:x,max:s,minDefined:A,maxDefined:P}=_.getUserBounds();return A&&(u=zo(Th(t,_.axis,x).lo,0,o-1)),P?d=zo(Th(t,_.axis,s).hi+1,u,o)-u:d=o-u,{start:u,count:d}}var Cse={id:"decimation",defaults:{algorithm:"min-max",enabled:!1},beforeElementsUpdate:(n,t,o)=>{if(!o.enabled){FP(n);return}const u=n.width;n.data.datasets.forEach((d,_)=>{const{_data:x,indexAxis:s}=d,A=n.getDatasetMeta(_),P=x||d.data;if(X_([s,n.options.indexAxis])==="y"||!A.controller.supportsDecimation)return;const R=n.scales[A.xAxisID];if(R.type!=="linear"&&R.type!=="time"||n.options.parsing)return;let{start:V,count:j}=Ase(A,P);const Q=o.threshold||4*u;if(j<=Q){ER(d);return}Rs(x)&&(d._data=P,delete d.data,Object.defineProperty(d,"data",{configurable:!0,enumerable:!0,get:function(){return this._decimated},set:function(re){this._data=re}}));let me;switch(o.algorithm){case"lttb":me=Sse(P,V,j,u,o);break;case"min-max":me=Ese(P,V,j,u);break;default:throw new Error(`Unsupported decimation algorithm '${o.algorithm}'`)}d._decimated=me})},destroy(n){FP(n)}};function Ise(n,t,o){const u=n.segments,d=n.points,_=t.points,x=[];for(const s of u){let{start:A,end:P}=s;P=TS(A,P,d);const R=eT(o,d[A],d[P],s.loop);if(!t.segments){x.push({source:s,target:R,start:d[A],end:d[P]});continue}const V=aR(t,R);for(const j of V){const Q=eT(o,_[j.start],_[j.end],j.loop),me=oR(s,d,Q);for(const re of me)x.push({source:re,target:j,start:{[o]:BP(R,Q,"start",Math.max)},end:{[o]:BP(R,Q,"end",Math.min)}})}}return x}function eT(n,t,o,u){if(u)return;let d=t[n],_=o[n];return n==="angle"&&(d=yl(d),_=yl(_)),{property:n,start:d,end:_}}function Mse(n,t){const{x:o=null,y:u=null}=n||{},d=t.points,_=[];return t.segments.forEach(({start:x,end:s})=>{s=TS(x,s,d);const A=d[x],P=d[s];u!==null?(_.push({x:A.x,y:u}),_.push({x:P.x,y:u})):o!==null&&(_.push({x:o,y:A.y}),_.push({x:o,y:P.y}))}),_}function TS(n,t,o){for(;t>n;t--){const u=o[t];if(!isNaN(u.x)&&!isNaN(u.y))break}return t}function BP(n,t,o,u){return n&&t?u(n[o],t[o]):n?n[o]:t?t[o]:0}function AR(n,t){let o=[],u=!1;return Or(n)?(u=!0,o=n):o=Mse(n,t),o.length?new jd({points:o,options:{tension:0},_loop:u,_fullLoop:u}):null}function NP(n){return n&&n.fill!==!1}function Pse(n,t,o){let d=n[t].fill;const _=[t];let x;if(!o)return d;for(;d!==!1&&_.indexOf(d)===-1;){if(!Yr(d))return d;if(x=n[d],!x)return!1;if(x.visible)return d;_.push(d),d=x.fill}return!1}function Dse(n,t,o){const u=Ose(n);if(Bs(u))return isNaN(u.value)?!1:u;let d=parseFloat(u);return Yr(d)&&Math.floor(d)===d?kse(u[0],t,d,o):["origin","start","end","stack","shape"].indexOf(u)>=0&&u}function kse(n,t,o,u){return(n==="-"||n==="+")&&(o=t+o),o===t||o<0||o>=u?!1:o}function Lse(n,t){let o=null;return n==="start"?o=t.bottom:n==="end"?o=t.top:Bs(n)?o=t.getPixelForValue(n.value):t.getBasePixel&&(o=t.getBasePixel()),o}function Rse(n,t,o){let u;return n==="start"?u=o:n==="end"?u=t.options.reverse?t.min:t.max:Bs(n)?u=n.value:u=t.getBaseValue(),u}function Ose(n){const t=n.options,o=t.fill;let u=us(o&&o.target,o);return u===void 0&&(u=!!t.backgroundColor),u===!1||u===null?!1:u===!0?"origin":u}function zse(n){const{scale:t,index:o,line:u}=n,d=[],_=u.segments,x=u.points,s=Fse(t,o);s.push(AR({x:null,y:t.bottom},u));for(let A=0;A<_.length;A++){const P=_[A];for(let R=P.start;R<=P.end;R++)Bse(d,x[R],s)}return new jd({points:d,options:{}})}function Fse(n,t){const o=[],u=n.getMatchingVisibleMetas("line");for(let d=0;d<u.length;d++){const _=u[d];if(_.index===t)break;_.hidden||o.unshift(_.dataset)}return o}function Bse(n,t,o){const u=[];for(let d=0;d<o.length;d++){const _=o[d],{first:x,last:s,point:A}=Nse(_,t,"x");if(!(!A||x&&s)){if(x)u.unshift(A);else if(n.push(A),!s)break}}n.push(...u)}function Nse(n,t,o){const u=n.interpolate(t,o);if(!u)return{};const d=u[o],_=n.segments,x=n.points;let s=!1,A=!1;for(let P=0;P<_.length;P++){const R=_[P],V=x[R.start][o],j=x[R.end][o];if(wh(d,V,j)){s=d===V,A=d===j;break}}return{first:s,last:A,point:u}}class CR{constructor(t){this.x=t.x,this.y=t.y,this.radius=t.radius}pathSegment(t,o,u){const{x:d,y:_,radius:x}=this;return o=o||{start:0,end:Ir},t.arc(d,_,x,o.end,o.start,!0),!u.bounds}interpolate(t){const{x:o,y:u,radius:d}=this,_=t.angle;return{x:o+Math.cos(_)*d,y:u+Math.sin(_)*d,angle:_}}}function Vse(n){const{chart:t,fill:o,line:u}=n;if(Yr(o))return $se(t,o);if(o==="stack")return zse(n);if(o==="shape")return!0;const d=jse(n);return d instanceof CR?d:AR(d,u)}function $se(n,t){const o=n.getDatasetMeta(t);return o&&n.isDatasetVisible(t)?o.dataset:null}function jse(n){return(n.scale||{}).getPointPositionForValue?Hse(n):Use(n)}function Use(n){const{scale:t={},fill:o}=n,u=Lse(o,t);if(Yr(u)){const d=t.isHorizontal();return{x:d?u:null,y:d?null:u}}return null}function Hse(n){const{scale:t,fill:o}=n,u=t.options,d=t.getLabels().length,_=u.reverse?t.max:t.min,x=Rse(o,t,_),s=[];if(u.grid.circular){const A=t.getPointPositionForValue(0,_);return new CR({x:A.x,y:A.y,radius:t.getDistanceFromCenterForValue(x)})}for(let A=0;A<d;++A)s.push(t.getPointPositionForValue(A,x));return s}function t2(n,t,o){const u=Vse(t),{line:d,scale:_,axis:x}=t,s=d.options,A=s.fill,P=s.backgroundColor,{above:R=P,below:V=P}=A||{};u&&d.points.length&&(b1(n,o),Gse(n,{line:d,target:u,above:R,below:V,area:o,scale:_,axis:x}),w1(n))}function Gse(n,t){const{line:o,target:u,above:d,below:_,area:x,scale:s}=t,A=o._loop?"angle":t.axis;n.save(),A==="x"&&_!==d&&(VP(n,u,x.top),$P(n,{line:o,target:u,color:d,scale:s,property:A}),n.restore(),n.save(),VP(n,u,x.bottom)),$P(n,{line:o,target:u,color:_,scale:s,property:A}),n.restore()}function VP(n,t,o){const{segments:u,points:d}=t;let _=!0,x=!1;n.beginPath();for(const s of u){const{start:A,end:P}=s,R=d[A],V=d[TS(A,P,d)];_?(n.moveTo(R.x,R.y),_=!1):(n.lineTo(R.x,o),n.lineTo(R.x,R.y)),x=!!t.pathSegment(n,s,{move:x}),x?n.closePath():n.lineTo(V.x,o)}n.lineTo(t.first().x,o),n.closePath(),n.clip()}function $P(n,t){const{line:o,target:u,property:d,color:_,scale:x}=t,s=Ise(o,u,d);for(const{source:A,target:P,start:R,end:V}of s){const{style:{backgroundColor:j=_}={}}=A,Q=u!==!0;n.save(),n.fillStyle=j,Wse(n,x,Q&&eT(d,R,V)),n.beginPath();const me=!!o.pathSegment(n,A);let re;if(Q){me?n.closePath():jP(n,u,V,d);const be=!!u.pathSegment(n,P,{move:me,reverse:!0});re=me&&be,re||jP(n,u,R,d)}n.closePath(),n.fill(re?"evenodd":"nonzero"),n.restore()}}function Wse(n,t,o){const{top:u,bottom:d}=t.chart.chartArea,{property:_,start:x,end:s}=o||{};_==="x"&&(n.beginPath(),n.rect(x,u,s-x,d-u),n.clip())}function jP(n,t,o,u){const d=t.interpolate(o,u);d&&n.lineTo(d.x,d.y)}var qse={id:"filler",afterDatasetsUpdate(n,t,o){const u=(n.data.datasets||[]).length,d=[];let _,x,s,A;for(x=0;x<u;++x)_=n.getDatasetMeta(x),s=_.dataset,A=null,s&&s.options&&s instanceof jd&&(A={visible:n.isDatasetVisible(x),index:x,fill:Dse(s,x,u),chart:n,axis:_.controller.options.indexAxis,scale:_.vScale,line:s}),_.$filler=A,d.push(A);for(x=0;x<u;++x)A=d[x],!(!A||A.fill===!1)&&(A.fill=Pse(d,x,o.propagate))},beforeDraw(n,t,o){const u=o.drawTime==="beforeDraw",d=n.getSortedVisibleDatasetMetas(),_=n.chartArea;for(let x=d.length-1;x>=0;--x){const s=d[x].$filler;s&&(s.line.updateControlPoints(_,s.axis),u&&s.fill&&t2(n.ctx,s,_))}},beforeDatasetsDraw(n,t,o){if(o.drawTime!=="beforeDatasetsDraw")return;const u=n.getSortedVisibleDatasetMetas();for(let d=u.length-1;d>=0;--d){const _=u[d].$filler;NP(_)&&t2(n.ctx,_,n.chartArea)}},beforeDatasetDraw(n,t,o){const u=t.meta.$filler;!NP(u)||o.drawTime!=="beforeDatasetDraw"||t2(n.ctx,u,n.chartArea)},defaults:{propagate:!0,drawTime:"beforeDatasetDraw"}};const UP=(n,t)=>{let{boxHeight:o=t,boxWidth:u=t}=n;return n.usePointStyle&&(o=Math.min(o,t),u=n.pointStyleWidth||Math.min(u,t)),{boxWidth:u,boxHeight:o,itemHeight:Math.max(t,o)}},Zse=(n,t)=>n!==null&&t!==null&&n.datasetIndex===t.datasetIndex&&n.index===t.index;class HP extends Oh{constructor(t){super(),this._added=!1,this.legendHitBoxes=[],this._hoveredItem=null,this.doughnutMode=!1,this.chart=t.chart,this.options=t.options,this.ctx=t.ctx,this.legendItems=void 0,this.columnSizes=void 0,this.lineWidths=void 0,this.maxHeight=void 0,this.maxWidth=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.height=void 0,this.width=void 0,this._margins=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0}update(t,o,u){this.maxWidth=t,this.maxHeight=o,this._margins=u,this.setDimensions(),this.buildLabels(),this.fit()}setDimensions(){this.isHorizontal()?(this.width=this.maxWidth,this.left=this._margins.left,this.right=this.width):(this.height=this.maxHeight,this.top=this._margins.top,this.bottom=this.height)}buildLabels(){const t=this.options.labels||{};let o=br(t.generateLabels,[this.chart],this)||[];t.filter&&(o=o.filter(u=>t.filter(u,this.chart.data))),t.sort&&(o=o.sort((u,d)=>t.sort(u,d,this.chart.data))),this.options.reverse&&o.reverse(),this.legendItems=o}fit(){const{options:t,ctx:o}=this;if(!t.display){this.width=this.height=0;return}const u=t.labels,d=Io(u.font),_=d.size,x=this._computeTitleHeight(),{boxWidth:s,itemHeight:A}=UP(u,_);let P,R;o.font=d.string,this.isHorizontal()?(P=this.maxWidth,R=this._fitRows(x,_,s,A)+10):(R=this.maxHeight,P=this._fitCols(x,d,s,A)+10),this.width=Math.min(P,t.maxWidth||this.maxWidth),this.height=Math.min(R,t.maxHeight||this.maxHeight)}_fitRows(t,o,u,d){const{ctx:_,maxWidth:x,options:{labels:{padding:s}}}=this,A=this.legendHitBoxes=[],P=this.lineWidths=[0],R=d+s;let V=t;_.textAlign="left",_.textBaseline="middle";let j=-1,Q=-R;return this.legendItems.forEach((me,re)=>{const be=u+o/2+_.measureText(me.text).width;(re===0||P[P.length-1]+be+2*s>x)&&(V+=R,P[P.length-(re>0?0:1)]=0,Q+=R,j++),A[re]={left:0,top:Q,row:j,width:be,height:d},P[P.length-1]+=be+s}),V}_fitCols(t,o,u,d){const{ctx:_,maxHeight:x,options:{labels:{padding:s}}}=this,A=this.legendHitBoxes=[],P=this.columnSizes=[],R=x-t;let V=s,j=0,Q=0,me=0,re=0;return this.legendItems.forEach((be,ve)=>{const{itemWidth:Ee,itemHeight:je}=Xse(u,o,_,be,d);ve>0&&Q+je+2*s>R&&(V+=j+s,P.push({width:j,height:Q}),me+=j+s,re++,j=Q=0),A[ve]={left:me,top:Q,col:re,width:Ee,height:je},j=Math.max(j,Ee),Q+=je+s}),V+=j,P.push({width:j,height:Q}),V}adjustHitBoxes(){if(!this.options.display)return;const t=this._computeTitleHeight(),{legendHitBoxes:o,options:{align:u,labels:{padding:d},rtl:_}}=this,x=ig(_,this.left,this.width);if(this.isHorizontal()){let s=0,A=la(u,this.left+d,this.right-this.lineWidths[s]);for(const P of o)s!==P.row&&(s=P.row,A=la(u,this.left+d,this.right-this.lineWidths[s])),P.top+=this.top+t+d,P.left=x.leftForLtr(x.x(A),P.width),A+=P.width+d}else{let s=0,A=la(u,this.top+t+d,this.bottom-this.columnSizes[s].height);for(const P of o)P.col!==s&&(s=P.col,A=la(u,this.top+t+d,this.bottom-this.columnSizes[s].height)),P.top=A,P.left+=this.left+d,P.left=x.leftForLtr(x.x(P.left),P.width),A+=P.height+d}}isHorizontal(){return this.options.position==="top"||this.options.position==="bottom"}draw(){if(this.options.display){const t=this.ctx;b1(t,this),this._draw(),w1(t)}}_draw(){const{options:t,columnSizes:o,lineWidths:u,ctx:d}=this,{align:_,labels:x}=t,s=zr.color,A=ig(t.rtl,this.left,this.width),P=Io(x.font),{padding:R}=x,V=P.size,j=V/2;let Q;this.drawTitle(),d.textAlign=A.textAlign("left"),d.textBaseline="middle",d.lineWidth=.5,d.font=P.string;const{boxWidth:me,boxHeight:re,itemHeight:be}=UP(x,V),ve=function(vt,_t,Mt){if(isNaN(me)||me<=0||isNaN(re)||re<0)return;d.save();const At=us(Mt.lineWidth,1);if(d.fillStyle=us(Mt.fillStyle,s),d.lineCap=us(Mt.lineCap,"butt"),d.lineDashOffset=us(Mt.lineDashOffset,0),d.lineJoin=us(Mt.lineJoin,"miter"),d.lineWidth=At,d.strokeStyle=us(Mt.strokeStyle,s),d.setLineDash(us(Mt.lineDash,[])),x.usePointStyle){const ei={radius:re*Math.SQRT2/2,pointStyle:Mt.pointStyle,rotation:Mt.rotation,borderWidth:At},Yt=A.xPlus(vt,me/2),Zt=_t+j;XL(d,ei,Yt,Zt,x.pointStyleWidth&&me)}else{const ei=_t+Math.max((V-re)/2,0),Yt=A.leftForLtr(vt,me),Zt=wp(Mt.borderRadius);d.beginPath(),Object.values(Zt).some(yi=>yi!==0)?zy(d,{x:Yt,y:ei,w:me,h:re,radius:Zt}):d.rect(Yt,ei,me,re),d.fill(),At!==0&&d.stroke()}d.restore()},Ee=function(vt,_t,Mt){Lp(d,Mt.text,vt,_t+be/2,P,{strikethrough:Mt.hidden,textAlign:A.textAlign(Mt.textAlign)})},je=this.isHorizontal(),Ve=this._computeTitleHeight();je?Q={x:la(_,this.left+R,this.right-u[0]),y:this.top+R+Ve,line:0}:Q={x:this.left+R,y:la(_,this.top+Ve+R,this.bottom-o[0].height),line:0},nR(this.ctx,t.textDirection);const Je=be+R;this.legendItems.forEach((vt,_t)=>{d.strokeStyle=vt.fontColor,d.fillStyle=vt.fontColor;const Mt=d.measureText(vt.text).width,At=A.textAlign(vt.textAlign||(vt.textAlign=x.textAlign)),ei=me+j+Mt;let Yt=Q.x,Zt=Q.y;A.setWidth(this.width),je?_t>0&&Yt+ei+R>this.right&&(Zt=Q.y+=Je,Q.line++,Yt=Q.x=la(_,this.left+R,this.right-u[Q.line])):_t>0&&Zt+Je>this.bottom&&(Yt=Q.x=Yt+o[Q.line].width+R,Q.line++,Zt=Q.y=la(_,this.top+Ve+R,this.bottom-o[Q.line].height));const yi=A.x(Yt);if(ve(yi,Zt,vt),Yt=mte(At,Yt+me+j,je?Yt+ei:this.right,t.rtl),Ee(A.x(Yt),Zt,vt),je)Q.x+=ei+R;else if(typeof vt.text!="string"){const Fi=P.lineHeight;Q.y+=IR(vt,Fi)+R}else Q.y+=Je}),sR(this.ctx,t.textDirection)}drawTitle(){const t=this.options,o=t.title,u=Io(o.font),d=ma(o.padding);if(!o.display)return;const _=ig(t.rtl,this.left,this.width),x=this.ctx,s=o.position,A=u.size/2,P=d.top+A;let R,V=this.left,j=this.width;if(this.isHorizontal())j=Math.max(...this.lineWidths),R=this.top+P,V=la(t.align,V,this.right-j);else{const me=this.columnSizes.reduce((re,be)=>Math.max(re,be.height),0);R=P+la(t.align,this.top,this.bottom-me-t.labels.padding-this._computeTitleHeight())}const Q=la(s,V,V+j);x.textAlign=_.textAlign(pS(s)),x.textBaseline="middle",x.strokeStyle=o.color,x.fillStyle=o.color,x.font=u.string,Lp(x,o.text,Q,R,u)}_computeTitleHeight(){const t=this.options.title,o=Io(t.font),u=ma(t.padding);return t.display?o.lineHeight+u.height:0}_getLegendItemAt(t,o){let u,d,_;if(wh(t,this.left,this.right)&&wh(o,this.top,this.bottom)){for(_=this.legendHitBoxes,u=0;u<_.length;++u)if(d=_[u],wh(t,d.left,d.left+d.width)&&wh(o,d.top,d.top+d.height))return this.legendItems[u]}return null}handleEvent(t){const o=this.options;if(!Jse(t.type,o))return;const u=this._getLegendItemAt(t.x,t.y);if(t.type==="mousemove"||t.type==="mouseout"){const d=this._hoveredItem,_=Zse(d,u);d&&!_&&br(o.onLeave,[t,d,this],this),this._hoveredItem=u,u&&!_&&br(o.onHover,[t,u,this],this)}else u&&br(o.onClick,[t,u,this],this)}}function Xse(n,t,o,u,d){const _=Yse(u,n,t,o),x=Kse(d,u,t.lineHeight);return{itemWidth:_,itemHeight:x}}function Yse(n,t,o,u){let d=n.text;return d&&typeof d!="string"&&(d=d.reduce((_,x)=>_.length>x.length?_:x)),t+o.size/2+u.measureText(d).width}function Kse(n,t,o){let u=n;return typeof t.text!="string"&&(u=IR(t,o)),u}function IR(n,t){const o=n.text?n.text.length:0;return t*o}function Jse(n,t){return!!((n==="mousemove"||n==="mouseout")&&(t.onHover||t.onLeave)||t.onClick&&(n==="click"||n==="mouseup"))}var Qse={id:"legend",_element:HP,start(n,t,o){const u=n.legend=new HP({ctx:n.ctx,options:o,chart:n});da.configure(n,u,o),da.addBox(n,u)},stop(n){da.removeBox(n,n.legend),delete n.legend},beforeUpdate(n,t,o){const u=n.legend;da.configure(n,u,o),u.options=o},afterUpdate(n){const t=n.legend;t.buildLabels(),t.adjustHitBoxes()},afterEvent(n,t){t.replay||n.legend.handleEvent(t.event)},defaults:{display:!0,position:"top",align:"center",fullSize:!0,reverse:!1,weight:1e3,onClick(n,t,o){const u=t.datasetIndex,d=o.chart;d.isDatasetVisible(u)?(d.hide(u),t.hidden=!0):(d.show(u),t.hidden=!1)},onHover:null,onLeave:null,labels:{color:n=>n.chart.options.color,boxWidth:40,padding:10,generateLabels(n){const t=n.data.datasets,{labels:{usePointStyle:o,pointStyle:u,textAlign:d,color:_,useBorderRadius:x,borderRadius:s}}=n.legend.options;return n._getSortedDatasetMetas().map(A=>{const P=A.controller.getStyle(o?0:void 0),R=ma(P.borderWidth);return{text:t[A.index].label,fillStyle:P.backgroundColor,fontColor:_,hidden:!A.visible,lineCap:P.borderCapStyle,lineDash:P.borderDash,lineDashOffset:P.borderDashOffset,lineJoin:P.borderJoinStyle,lineWidth:(R.width+R.height)/4,strokeStyle:P.borderColor,pointStyle:u||P.pointStyle,rotation:P.rotation,textAlign:d||P.textAlign,borderRadius:x&&(s||P.borderRadius),datasetIndex:A.index}},this)}},title:{color:n=>n.chart.options.color,display:!1,position:"center",text:""}},descriptors:{_scriptable:n=>!n.startsWith("on"),labels:{_scriptable:n=>!["generateLabels","filter","sort"].includes(n)}}};class SS extends Oh{constructor(t){super(),this.chart=t.chart,this.options=t.options,this.ctx=t.ctx,this._padding=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.width=void 0,this.height=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0}update(t,o){const u=this.options;if(this.left=0,this.top=0,!u.display){this.width=this.height=this.right=this.bottom=0;return}this.width=this.right=t,this.height=this.bottom=o;const d=Or(u.text)?u.text.length:1;this._padding=ma(u.padding);const _=d*Io(u.font).lineHeight+this._padding.height;this.isHorizontal()?this.height=_:this.width=_}isHorizontal(){const t=this.options.position;return t==="top"||t==="bottom"}_drawArgs(t){const{top:o,left:u,bottom:d,right:_,options:x}=this,s=x.align;let A=0,P,R,V;return this.isHorizontal()?(R=la(s,u,_),V=o+t,P=_-u):(x.position==="left"?(R=u+t,V=la(s,d,o),A=Mr*-.5):(R=_-t,V=la(s,o,d),A=Mr*.5),P=d-o),{titleX:R,titleY:V,maxWidth:P,rotation:A}}draw(){const t=this.ctx,o=this.options;if(!o.display)return;const u=Io(o.font),_=u.lineHeight/2+this._padding.top,{titleX:x,titleY:s,maxWidth:A,rotation:P}=this._drawArgs(_);Lp(t,o.text,0,0,u,{color:o.color,maxWidth:A,rotation:P,textAlign:pS(o.align),textBaseline:"middle",translation:[x,s]})}}function ere(n,t){const o=new SS({ctx:n.ctx,options:t,chart:n});da.configure(n,o,t),da.addBox(n,o),n.titleBlock=o}var tre={id:"title",_element:SS,start(n,t,o){ere(n,o)},stop(n){const t=n.titleBlock;da.removeBox(n,t),delete n.titleBlock},beforeUpdate(n,t,o){const u=n.titleBlock;da.configure(n,u,o),u.options=o},defaults:{align:"center",display:!1,font:{weight:"bold"},fullSize:!0,padding:10,position:"top",text:"",weight:2e3},defaultRoutes:{color:"color"},descriptors:{_scriptable:!0,_indexable:!1}};const Hv=new WeakMap;var ire={id:"subtitle",start(n,t,o){const u=new SS({ctx:n.ctx,options:o,chart:n});da.configure(n,u,o),da.addBox(n,u),Hv.set(n,u)},stop(n){da.removeBox(n,Hv.get(n)),Hv.delete(n)},beforeUpdate(n,t,o){const u=Hv.get(n);da.configure(n,u,o),u.options=o},defaults:{align:"center",display:!1,font:{weight:"normal"},fullSize:!0,padding:0,position:"top",text:"",weight:1500},defaultRoutes:{color:"color"},descriptors:{_scriptable:!0,_indexable:!1}};const J_={average(n){if(!n.length)return!1;let t,o,u=new Set,d=0,_=0;for(t=0,o=n.length;t<o;++t){const s=n[t].element;if(s&&s.hasValue()){const A=s.tooltipPosition();u.add(A.x),d+=A.y,++_}}return _===0||u.size===0?!1:{x:[...u].reduce((s,A)=>s+A)/u.size,y:d/_}},nearest(n,t){if(!n.length)return!1;let o=t.x,u=t.y,d=Number.POSITIVE_INFINITY,_,x,s;for(_=0,x=n.length;_<x;++_){const A=n[_].element;if(A&&A.hasValue()){const P=A.getCenterPoint(),R=W2(t,P);R<d&&(d=R,s=A)}}if(s){const A=s.tooltipPosition();o=A.x,u=A.y}return{x:o,y:u}}};function mu(n,t){return t&&(Or(t)?Array.prototype.push.apply(n,t):n.push(t)),n}function ph(n){return(typeof n=="string"||n instanceof String)&&n.indexOf(` 3384`)>-1?n.split(` 3385`):n}function nre(n,t){const{element:o,datasetIndex:u,index:d}=t,_=n.getDatasetMeta(u).controller,{label:x,value:s}=_.getLabelAndValue(d);return{chart:n,label:x,parsed:_.getParsed(d),raw:n.data.datasets[u].data[d],formattedValue:s,dataset:_.getDataset(),dataIndex:d,datasetIndex:u,element:o}}function GP(n,t){const o=n.chart.ctx,{body:u,footer:d,title:_}=n,{boxWidth:x,boxHeight:s}=t,A=Io(t.bodyFont),P=Io(t.titleFont),R=Io(t.footerFont),V=_.length,j=d.length,Q=u.length,me=ma(t.padding);let re=me.height,be=0,ve=u.reduce((Ve,Je)=>Ve+Je.before.length+Je.lines.length+Je.after.length,0);if(ve+=n.beforeBody.length+n.afterBody.length,V&&(re+=V*P.lineHeight+(V-1)*t.titleSpacing+t.titleMarginBottom),ve){const Ve=t.displayColors?Math.max(s,A.lineHeight):A.lineHeight;re+=Q*Ve+(ve-Q)*A.lineHeight+(ve-1)*t.bodySpacing}j&&(re+=t.footerMarginTop+j*R.lineHeight+(j-1)*t.footerSpacing);let Ee=0;const je=function(Ve){be=Math.max(be,o.measureText(Ve).width+Ee)};return o.save(),o.font=P.string,lr(n.title,je),o.font=A.string,lr(n.beforeBody.concat(n.afterBody),je),Ee=t.displayColors?x+2+t.boxPadding:0,lr(u,Ve=>{lr(Ve.before,je),lr(Ve.lines,je),lr(Ve.after,je)}),Ee=0,o.font=R.string,lr(n.footer,je),o.restore(),be+=me.width,{width:be,height:re}}function sre(n,t){const{y:o,height:u}=t;return o<u/2?"top":o>n.height-u/2?"bottom":"center"}function rre(n,t,o,u){const{x:d,width:_}=u,x=o.caretSize+o.caretPadding;if(n==="left"&&d+_+x>t.width||n==="right"&&d-_-x<0)return!0}function ore(n,t,o,u){const{x:d,width:_}=o,{width:x,chartArea:{left:s,right:A}}=n;let P="center";return u==="center"?P=d<=(s+A)/2?"left":"right":d<=_/2?P="left":d>=x-_/2&&(P="right"),rre(P,n,t,o)&&(P="center"),P}function WP(n,t,o){const u=o.yAlign||t.yAlign||sre(n,o);return{xAlign:o.xAlign||t.xAlign||ore(n,t,o,u),yAlign:u}}function are(n,t){let{x:o,width:u}=n;return t==="right"?o-=u:t==="center"&&(o-=u/2),o}function lre(n,t,o){let{y:u,height:d}=n;return t==="top"?u+=o:t==="bottom"?u-=d+o:u-=d/2,u}function qP(n,t,o,u){const{caretSize:d,caretPadding:_,cornerRadius:x}=n,{xAlign:s,yAlign:A}=o,P=d+_,{topLeft:R,topRight:V,bottomLeft:j,bottomRight:Q}=wp(x);let me=are(t,s);const re=lre(t,A,P);return A==="center"?s==="left"?me+=P:s==="right"&&(me-=P):s==="left"?me-=Math.max(R,j)+d:s==="right"&&(me+=Math.max(V,Q)+d),{x:zo(me,0,u.width-t.width),y:zo(re,0,u.height-t.height)}}function Gv(n,t,o){const u=ma(o.padding);return t==="center"?n.x+n.width/2:t==="right"?n.x+n.width-u.right:n.x+u.left}function ZP(n){return mu([],ph(n))}function cre(n,t,o){return uf(n,{tooltip:t,tooltipItems:o,type:"tooltip"})}function XP(n,t){const o=t&&t.dataset&&t.dataset.tooltip&&t.dataset.tooltip.callbacks;return o?n.override(o):n}const MR={beforeTitle:dh,title(n){if(n.length>0){const t=n[0],o=t.chart.data.labels,u=o?o.length:0;if(this&&this.options&&this.options.mode==="dataset")return t.dataset.label||"";if(t.label)return t.label;if(u>0&&t.dataIndex<u)return o[t.dataIndex]}return""},afterTitle:dh,beforeBody:dh,beforeLabel:dh,label(n){if(this&&this.options&&this.options.mode==="dataset")return n.label+": "+n.formattedValue||n.formattedValue;let t=n.dataset.label||"";t&&(t+=": ");const o=n.formattedValue;return Rs(o)||(t+=o),t},labelColor(n){const o=n.chart.getDatasetMeta(n.datasetIndex).controller.getStyle(n.dataIndex);return{borderColor:o.borderColor,backgroundColor:o.backgroundColor,borderWidth:o.borderWidth,borderDash:o.borderDash,borderDashOffset:o.borderDashOffset,borderRadius:0}},labelTextColor(){return this.options.bodyColor},labelPointStyle(n){const o=n.chart.getDatasetMeta(n.datasetIndex).controller.getStyle(n.dataIndex);return{pointStyle:o.pointStyle,rotation:o.rotation}},afterLabel:dh,afterBody:dh,beforeFooter:dh,footer:dh,afterFooter:dh};function Ua(n,t,o,u){const d=n[t].call(o,u);return typeof d>"u"?MR[t].call(o,u):d}class tT extends Oh{constructor(t){super(),this.opacity=0,this._active=[],this._eventPosition=void 0,this._size=void 0,this._cachedAnimations=void 0,this._tooltipItems=[],this.$animations=void 0,this.$context=void 0,this.chart=t.chart,this.options=t.options,this.dataPoints=void 0,this.title=void 0,this.beforeBody=void 0,this.body=void 0,this.afterBody=void 0,this.footer=void 0,this.xAlign=void 0,this.yAlign=void 0,this.x=void 0,this.y=void 0,this.height=void 0,this.width=void 0,this.caretX=void 0,this.caretY=void 0,this.labelColors=void 0,this.labelPointStyles=void 0,this.labelTextColors=void 0}initialize(t){this.options=t,this._cachedAnimations=void 0,this.$context=void 0}_resolveAnimations(){const t=this._cachedAnimations;if(t)return t;const o=this.chart,u=this.options.setContext(this.getContext()),d=u.enabled&&o.options.animation&&u.animations,_=new lR(this.chart,d);return d._cacheable&&(this._cachedAnimations=Object.freeze(_)),_}getContext(){return this.$context||(this.$context=cre(this.chart.getContext(),this,this._tooltipItems))}getTitle(t,o){const{callbacks:u}=o,d=Ua(u,"beforeTitle",this,t),_=Ua(u,"title",this,t),x=Ua(u,"afterTitle",this,t);let s=[];return s=mu(s,ph(d)),s=mu(s,ph(_)),s=mu(s,ph(x)),s}getBeforeBody(t,o){return ZP(Ua(o.callbacks,"beforeBody",this,t))}getBody(t,o){const{callbacks:u}=o,d=[];return lr(t,_=>{const x={before:[],lines:[],after:[]},s=XP(u,_);mu(x.before,ph(Ua(s,"beforeLabel",this,_))),mu(x.lines,Ua(s,"label",this,_)),mu(x.after,ph(Ua(s,"afterLabel",this,_))),d.push(x)}),d}getAfterBody(t,o){return ZP(Ua(o.callbacks,"afterBody",this,t))}getFooter(t,o){const{callbacks:u}=o,d=Ua(u,"beforeFooter",this,t),_=Ua(u,"footer",this,t),x=Ua(u,"afterFooter",this,t);let s=[];return s=mu(s,ph(d)),s=mu(s,ph(_)),s=mu(s,ph(x)),s}_createItems(t){const o=this._active,u=this.chart.data,d=[],_=[],x=[];let s=[],A,P;for(A=0,P=o.length;A<P;++A)s.push(nre(this.chart,o[A]));return t.filter&&(s=s.filter((R,V,j)=>t.filter(R,V,j,u))),t.itemSort&&(s=s.sort((R,V)=>t.itemSort(R,V,u))),lr(s,R=>{const V=XP(t.callbacks,R);d.push(Ua(V,"labelColor",this,R)),_.push(Ua(V,"labelPointStyle",this,R)),x.push(Ua(V,"labelTextColor",this,R))}),this.labelColors=d,this.labelPointStyles=_,this.labelTextColors=x,this.dataPoints=s,s}update(t,o){const u=this.options.setContext(this.getContext()),d=this._active;let _,x=[];if(!d.length)this.opacity!==0&&(_={opacity:0});else{const s=J_[u.position].call(this,d,this._eventPosition);x=this._createItems(u),this.title=this.getTitle(x,u),this.beforeBody=this.getBeforeBody(x,u),this.body=this.getBody(x,u),this.afterBody=this.getAfterBody(x,u),this.footer=this.getFooter(x,u);const A=this._size=GP(this,u),P=Object.assign({},s,A),R=WP(this.chart,u,P),V=qP(u,P,R,this.chart);this.xAlign=R.xAlign,this.yAlign=R.yAlign,_={opacity:1,x:V.x,y:V.y,width:A.width,height:A.height,caretX:s.x,caretY:s.y}}this._tooltipItems=x,this.$context=void 0,_&&this._resolveAnimations().update(this,_),t&&u.external&&u.external.call(this,{chart:this.chart,tooltip:this,replay:o})}drawCaret(t,o,u,d){const _=this.getCaretPosition(t,u,d);o.lineTo(_.x1,_.y1),o.lineTo(_.x2,_.y2),o.lineTo(_.x3,_.y3)}getCaretPosition(t,o,u){const{xAlign:d,yAlign:_}=this,{caretSize:x,cornerRadius:s}=u,{topLeft:A,topRight:P,bottomLeft:R,bottomRight:V}=wp(s),{x:j,y:Q}=t,{width:me,height:re}=o;let be,ve,Ee,je,Ve,Je;return _==="center"?(Ve=Q+re/2,d==="left"?(be=j,ve=be-x,je=Ve+x,Je=Ve-x):(be=j+me,ve=be+x,je=Ve-x,Je=Ve+x),Ee=be):(d==="left"?ve=j+Math.max(A,R)+x:d==="right"?ve=j+me-Math.max(P,V)-x:ve=this.caretX,_==="top"?(je=Q,Ve=je-x,be=ve-x,Ee=ve+x):(je=Q+re,Ve=je+x,be=ve+x,Ee=ve-x),Je=je),{x1:be,x2:ve,x3:Ee,y1:je,y2:Ve,y3:Je}}drawTitle(t,o,u){const d=this.title,_=d.length;let x,s,A;if(_){const P=ig(u.rtl,this.x,this.width);for(t.x=Gv(this,u.titleAlign,u),o.textAlign=P.textAlign(u.titleAlign),o.textBaseline="middle",x=Io(u.titleFont),s=u.titleSpacing,o.fillStyle=u.titleColor,o.font=x.string,A=0;A<_;++A)o.fillText(d[A],P.x(t.x),t.y+x.lineHeight/2),t.y+=x.lineHeight+s,A+1===_&&(t.y+=u.titleMarginBottom-s)}}_drawColorBox(t,o,u,d,_){const x=this.labelColors[u],s=this.labelPointStyles[u],{boxHeight:A,boxWidth:P}=_,R=Io(_.bodyFont),V=Gv(this,"left",_),j=d.x(V),Q=A<R.lineHeight?(R.lineHeight-A)/2:0,me=o.y+Q;if(_.usePointStyle){const re={radius:Math.min(P,A)/2,pointStyle:s.pointStyle,rotation:s.rotation,borderWidth:1},be=d.leftForLtr(j,P)+P/2,ve=me+A/2;t.strokeStyle=_.multiKeyBackground,t.fillStyle=_.multiKeyBackground,Z2(t,re,be,ve),t.strokeStyle=x.borderColor,t.fillStyle=x.backgroundColor,Z2(t,re,be,ve)}else{t.lineWidth=Bs(x.borderWidth)?Math.max(...Object.values(x.borderWidth)):x.borderWidth||1,t.strokeStyle=x.borderColor,t.setLineDash(x.borderDash||[]),t.lineDashOffset=x.borderDashOffset||0;const re=d.leftForLtr(j,P),be=d.leftForLtr(d.xPlus(j,1),P-2),ve=wp(x.borderRadius);Object.values(ve).some(Ee=>Ee!==0)?(t.beginPath(),t.fillStyle=_.multiKeyBackground,zy(t,{x:re,y:me,w:P,h:A,radius:ve}),t.fill(),t.stroke(),t.fillStyle=x.backgroundColor,t.beginPath(),zy(t,{x:be,y:me+1,w:P-2,h:A-2,radius:ve}),t.fill()):(t.fillStyle=_.multiKeyBackground,t.fillRect(re,me,P,A),t.strokeRect(re,me,P,A),t.fillStyle=x.backgroundColor,t.fillRect(be,me+1,P-2,A-2))}t.fillStyle=this.labelTextColors[u]}drawBody(t,o,u){const{body:d}=this,{bodySpacing:_,bodyAlign:x,displayColors:s,boxHeight:A,boxWidth:P,boxPadding:R}=u,V=Io(u.bodyFont);let j=V.lineHeight,Q=0;const me=ig(u.rtl,this.x,this.width),re=function(Mt){o.fillText(Mt,me.x(t.x+Q),t.y+j/2),t.y+=j+_},be=me.textAlign(x);let ve,Ee,je,Ve,Je,vt,_t;for(o.textAlign=x,o.textBaseline="middle",o.font=V.string,t.x=Gv(this,be,u),o.fillStyle=u.bodyColor,lr(this.beforeBody,re),Q=s&&be!=="right"?x==="center"?P/2+R:P+2+R:0,Ve=0,vt=d.length;Ve<vt;++Ve){for(ve=d[Ve],Ee=this.labelTextColors[Ve],o.fillStyle=Ee,lr(ve.before,re),je=ve.lines,s&&je.length&&(this._drawColorBox(o,t,Ve,me,u),j=Math.max(V.lineHeight,A)),Je=0,_t=je.length;Je<_t;++Je)re(je[Je]),j=V.lineHeight;lr(ve.after,re)}Q=0,j=V.lineHeight,lr(this.afterBody,re),t.y-=_}drawFooter(t,o,u){const d=this.footer,_=d.length;let x,s;if(_){const A=ig(u.rtl,this.x,this.width);for(t.x=Gv(this,u.footerAlign,u),t.y+=u.footerMarginTop,o.textAlign=A.textAlign(u.footerAlign),o.textBaseline="middle",x=Io(u.footerFont),o.fillStyle=u.footerColor,o.font=x.string,s=0;s<_;++s)o.fillText(d[s],A.x(t.x),t.y+x.lineHeight/2),t.y+=x.lineHeight+u.footerSpacing}}drawBackground(t,o,u,d){const{xAlign:_,yAlign:x}=this,{x:s,y:A}=t,{width:P,height:R}=u,{topLeft:V,topRight:j,bottomLeft:Q,bottomRight:me}=wp(d.cornerRadius);o.fillStyle=d.backgroundColor,o.strokeStyle=d.borderColor,o.lineWidth=d.borderWidth,o.beginPath(),o.moveTo(s+V,A),x==="top"&&this.drawCaret(t,o,u,d),o.lineTo(s+P-j,A),o.quadraticCurveTo(s+P,A,s+P,A+j),x==="center"&&_==="right"&&this.drawCaret(t,o,u,d),o.lineTo(s+P,A+R-me),o.quadraticCurveTo(s+P,A+R,s+P-me,A+R),x==="bottom"&&this.drawCaret(t,o,u,d),o.lineTo(s+Q,A+R),o.quadraticCurveTo(s,A+R,s,A+R-Q),x==="center"&&_==="left"&&this.drawCaret(t,o,u,d),o.lineTo(s,A+V),o.quadraticCurveTo(s,A,s+V,A),o.closePath(),o.fill(),d.borderWidth>0&&o.stroke()}_updateAnimationTarget(t){const o=this.chart,u=this.$animations,d=u&&u.x,_=u&&u.y;if(d||_){const x=J_[t.position].call(this,this._active,this._eventPosition);if(!x)return;const s=this._size=GP(this,t),A=Object.assign({},x,this._size),P=WP(o,t,A),R=qP(t,A,P,o);(d._to!==R.x||_._to!==R.y)&&(this.xAlign=P.xAlign,this.yAlign=P.yAlign,this.width=s.width,this.height=s.height,this.caretX=x.x,this.caretY=x.y,this._resolveAnimations().update(this,R))}}_willRender(){return!!this.opacity}draw(t){const o=this.options.setContext(this.getContext());let u=this.opacity;if(!u)return;this._updateAnimationTarget(o);const d={width:this.width,height:this.height},_={x:this.x,y:this.y};u=Math.abs(u)<.001?0:u;const x=ma(o.padding),s=this.title.length||this.beforeBody.length||this.body.length||this.afterBody.length||this.footer.length;o.enabled&&s&&(t.save(),t.globalAlpha=u,this.drawBackground(_,t,d,o),nR(t,o.textDirection),_.y+=x.top,this.drawTitle(_,t,o),this.drawBody(_,t,o),this.drawFooter(_,t,o),sR(t,o.textDirection),t.restore())}getActiveElements(){return this._active||[]}setActiveElements(t,o){const u=this._active,d=t.map(({datasetIndex:s,index:A})=>{const P=this.chart.getDatasetMeta(s);if(!P)throw new Error("Cannot find a dataset at index "+s);return{datasetIndex:s,element:P.data[A],index:A}}),_=!kx(u,d),x=this._positionChanged(d,o);(_||x)&&(this._active=d,this._eventPosition=o,this._ignoreReplayEvents=!0,this.update(!0))}handleEvent(t,o,u=!0){if(o&&this._ignoreReplayEvents)return!1;this._ignoreReplayEvents=!1;const d=this.options,_=this._active||[],x=this._getActiveElements(t,_,o,u),s=this._positionChanged(x,t),A=o||!kx(x,_)||s;return A&&(this._active=x,(d.enabled||d.external)&&(this._eventPosition={x:t.x,y:t.y},this.update(!0,o))),A}_getActiveElements(t,o,u,d){const _=this.options;if(t.type==="mouseout")return[];if(!d)return o.filter(s=>this.chart.data.datasets[s.datasetIndex]&&this.chart.getDatasetMeta(s.datasetIndex).controller.getParsed(s.index)!==void 0);const x=this.chart.getElementsAtEventForMode(t,_.mode,_,u);return _.reverse&&x.reverse(),x}_positionChanged(t,o){const{caretX:u,caretY:d,options:_}=this,x=J_[_.position].call(this,t,o);return x!==!1&&(u!==x.x||d!==x.y)}}zi(tT,"positioners",J_);var ure={id:"tooltip",_element:tT,positioners:J_,afterInit(n,t,o){o&&(n.tooltip=new tT({chart:n,options:o}))},beforeUpdate(n,t,o){n.tooltip&&n.tooltip.initialize(o)},reset(n,t,o){n.tooltip&&n.tooltip.initialize(o)},afterDraw(n){const t=n.tooltip;if(t&&t._willRender()){const o={tooltip:t};if(n.notifyPlugins("beforeTooltipDraw",{...o,cancelable:!0})===!1)return;t.draw(n.ctx),n.notifyPlugins("afterTooltipDraw",o)}},afterEvent(n,t){if(n.tooltip){const o=t.replay;n.tooltip.handleEvent(t.event,o,t.inChartArea)&&(t.changed=!0)}},defaults:{enabled:!0,external:null,position:"average",backgroundColor:"rgba(0,0,0,0.8)",titleColor:"#fff",titleFont:{weight:"bold"},titleSpacing:2,titleMarginBottom:6,titleAlign:"left",bodyColor:"#fff",bodySpacing:2,bodyFont:{},bodyAlign:"left",footerColor:"#fff",footerSpacing:2,footerMarginTop:6,footerFont:{weight:"bold"},footerAlign:"left",padding:6,caretPadding:2,caretSize:5,cornerRadius:6,boxHeight:(n,t)=>t.bodyFont.size,boxWidth:(n,t)=>t.bodyFont.size,multiKeyBackground:"#fff",displayColors:!0,boxPadding:0,borderColor:"rgba(0,0,0,0)",borderWidth:0,animation:{duration:400,easing:"easeOutQuart"},animations:{numbers:{type:"number",properties:["x","y","width","height","caretX","caretY"]},opacity:{easing:"linear",duration:200}},callbacks:MR},defaultRoutes:{bodyFont:"font",footerFont:"font",titleFont:"font"},descriptors:{_scriptable:n=>n!=="filter"&&n!=="itemSort"&&n!=="external",_indexable:!1,callbacks:{_scriptable:!1,_indexable:!1},animation:{_fallback:!1},animations:{_fallback:"animation"}},additionalOptionScopes:["interaction"]},hre=Object.freeze({__proto__:null,Colors:Tse,Decimation:Cse,Filler:qse,Legend:Qse,SubTitle:ire,Title:tre,Tooltip:ure});const dre=(n,t,o,u)=>(typeof t=="string"?(o=n.push(t)-1,u.unshift({index:o,label:t})):isNaN(t)&&(o=null),o);function fre(n,t,o,u){const d=n.indexOf(t);if(d===-1)return dre(n,t,o,u);const _=n.lastIndexOf(t);return d!==_?o:d}const pre=(n,t)=>n===null?null:zo(Math.round(n),0,t);function YP(n){const t=this.getLabels();return n>=0&&n<t.length?t[n]:n}class iT extends Fp{constructor(t){super(t),this._startValue=void 0,this._valueRange=0,this._addedLabels=[]}init(t){const o=this._addedLabels;if(o.length){const u=this.getLabels();for(const{index:d,label:_}of o)u[d]===_&&u.splice(d,1);this._addedLabels=[]}super.init(t)}parse(t,o){if(Rs(t))return null;const u=this.getLabels();return o=isFinite(o)&&u[o]===t?o:fre(u,t,us(o,t),this._addedLabels),pre(o,u.length-1)}determineDataLimits(){const{minDefined:t,maxDefined:o}=this.getUserBounds();let{min:u,max:d}=this.getMinMax(!0);this.options.bounds==="ticks"&&(t||(u=0),o||(d=this.getLabels().length-1)),this.min=u,this.max=d}buildTicks(){const t=this.min,o=this.max,u=this.options.offset,d=[];let _=this.getLabels();_=t===0&&o===_.length-1?_:_.slice(t,o+1),this._valueRange=Math.max(_.length-(u?0:1),1),this._startValue=this.min-(u?.5:0);for(let x=t;x<=o;x++)d.push({value:x});return d}getLabelForValue(t){return YP.call(this,t)}configure(){super.configure(),this.isHorizontal()||(this._reversePixels=!this._reversePixels)}getPixelForValue(t){return typeof t!="number"&&(t=this.parse(t)),t===null?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getPixelForTick(t){const o=this.ticks;return t<0||t>o.length-1?null:this.getPixelForValue(o[t].value)}getValueForPixel(t){return Math.round(this._startValue+this.getDecimalForPixel(t)*this._valueRange)}getBasePixel(){return this.bottom}}zi(iT,"id","category"),zi(iT,"defaults",{ticks:{callback:YP}});function mre(n,t){const o=[],{bounds:d,step:_,min:x,max:s,precision:A,count:P,maxTicks:R,maxDigits:V,includeBounds:j}=n,Q=_||1,me=R-1,{min:re,max:be}=t,ve=!Rs(x),Ee=!Rs(s),je=!Rs(P),Ve=(be-re)/(V+1);let Je=GM((be-re)/me/Q)*Q,vt,_t,Mt,At;if(Je<1e-14&&!ve&&!Ee)return[{value:re},{value:be}];At=Math.ceil(be/Je)-Math.floor(re/Je),At>me&&(Je=GM(At*Je/me/Q)*Q),Rs(A)||(vt=Math.pow(10,A),Je=Math.ceil(Je*vt)/vt),d==="ticks"?(_t=Math.floor(re/Je)*Je,Mt=Math.ceil(be/Je)*Je):(_t=re,Mt=be),ve&&Ee&&_&<e((s-x)/_,Je/1e3)?(At=Math.round(Math.min((s-x)/Je,R)),Je=(s-x)/At,_t=x,Mt=s):je?(_t=ve?x:_t,Mt=Ee?s:Mt,At=P-1,Je=(Mt-_t)/At):(At=(Mt-_t)/Je,fy(At,Math.round(At),Je/1e3)?At=Math.round(At):At=Math.ceil(At));const ei=Math.max(WM(Je),WM(_t));vt=Math.pow(10,Rs(A)?ei:A),_t=Math.round(_t*vt)/vt,Mt=Math.round(Mt*vt)/vt;let Yt=0;for(ve&&(j&&_t!==x?(o.push({value:x}),_t<x&&Yt++,fy(Math.round((_t+Yt*Je)*vt)/vt,x,KP(x,Ve,n))&&Yt++):_t<x&&Yt++);Yt<At;++Yt){const Zt=Math.round((_t+Yt*Je)*vt)/vt;if(Ee&&Zt>s)break;o.push({value:Zt})}return Ee&&j&&Mt!==s?o.length&&fy(o[o.length-1].value,s,KP(s,Ve,n))?o[o.length-1].value=s:o.push({value:s}):(!Ee||Mt===s)&&o.push({value:Mt}),o}function KP(n,t,{horizontal:o,minRotation:u}){const d=Lc(u),_=(o?Math.sin(d):Math.cos(d))||.001,x=.75*t*(""+n).length;return Math.min(t/_,x)}class Nx extends Fp{constructor(t){super(t),this.start=void 0,this.end=void 0,this._startValue=void 0,this._endValue=void 0,this._valueRange=0}parse(t,o){return Rs(t)||(typeof t=="number"||t instanceof Number)&&!isFinite(+t)?null:+t}handleTickRangeOptions(){const{beginAtZero:t}=this.options,{minDefined:o,maxDefined:u}=this.getUserBounds();let{min:d,max:_}=this;const x=A=>d=o?d:A,s=A=>_=u?_:A;if(t){const A=Eu(d),P=Eu(_);A<0&&P<0?s(0):A>0&&P>0&&x(0)}if(d===_){let A=_===0?1:Math.abs(_*.05);s(_+A),t||x(d-A)}this.min=d,this.max=_}getTickLimit(){const t=this.options.ticks;let{maxTicksLimit:o,stepSize:u}=t,d;return u?(d=Math.ceil(this.max/u)-Math.floor(this.min/u)+1,d>1e3&&(console.warn(`scales.${this.id}.ticks.stepSize: ${u} would result generating up to ${d} ticks. Limiting to 1000.`),d=1e3)):(d=this.computeTickLimit(),o=o||11),o&&(d=Math.min(o,d)),d}computeTickLimit(){return Number.POSITIVE_INFINITY}buildTicks(){const t=this.options,o=t.ticks;let u=this.getTickLimit();u=Math.max(2,u);const d={maxTicks:u,bounds:t.bounds,min:t.min,max:t.max,precision:o.precision,step:o.stepSize,count:o.count,maxDigits:this._maxDigits(),horizontal:this.isHorizontal(),minRotation:o.minRotation||0,includeBounds:o.includeBounds!==!1},_=this._range||this,x=mre(d,_);return t.bounds==="ticks"&&VL(x,this,"value"),t.reverse?(x.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),x}configure(){const t=this.ticks;let o=this.min,u=this.max;if(super.configure(),this.options.offset&&t.length){const d=(u-o)/Math.max(t.length-1,1)/2;o-=d,u+=d}this._startValue=o,this._endValue=u,this._valueRange=u-o}getLabelForValue(t){return Jy(t,this.chart.options.locale,this.options.ticks.format)}}class nT extends Nx{determineDataLimits(){const{min:t,max:o}=this.getMinMax(!0);this.min=Yr(t)?t:0,this.max=Yr(o)?o:1,this.handleTickRangeOptions()}computeTickLimit(){const t=this.isHorizontal(),o=t?this.width:this.height,u=Lc(this.options.ticks.minRotation),d=(t?Math.sin(u):Math.cos(u))||.001,_=this._resolveTickFontOptions(0);return Math.ceil(o/Math.min(40,_.lineHeight/d))}getPixelForValue(t){return t===null?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getValueForPixel(t){return this._startValue+this.getDecimalForPixel(t)*this._valueRange}}zi(nT,"id","linear"),zi(nT,"defaults",{ticks:{callback:x1.formatters.numeric}});const By=n=>Math.floor($d(n)),cp=(n,t)=>Math.pow(10,By(n)+t);function JP(n){return n/Math.pow(10,By(n))===1}function QP(n,t,o){const u=Math.pow(10,o),d=Math.floor(n/u);return Math.ceil(t/u)-d}function gre(n,t){const o=t-n;let u=By(o);for(;QP(n,t,u)>10;)u++;for(;QP(n,t,u)<10;)u--;return Math.min(u,By(n))}function _re(n,{min:t,max:o}){t=gl(n.min,t);const u=[],d=By(t);let _=gre(t,o),x=_<0?Math.pow(10,Math.abs(_)):1;const s=Math.pow(10,_),A=d>_?Math.pow(10,d):0,P=Math.round((t-A)*x)/x,R=Math.floor((t-A)/s/10)*s*10;let V=Math.floor((P-R)/Math.pow(10,_)),j=gl(n.min,Math.round((A+R+V*Math.pow(10,_))*x)/x);for(;j<o;)u.push({value:j,major:JP(j),significand:V}),V>=10?V=V<15?15:20:V++,V>=20&&(_++,V=2,x=_>=0?1:x),j=Math.round((A+R+V*Math.pow(10,_))*x)/x;const Q=gl(n.max,j);return u.push({value:Q,major:JP(Q),significand:V}),u}class sT extends Fp{constructor(t){super(t),this.start=void 0,this.end=void 0,this._startValue=void 0,this._valueRange=0}parse(t,o){const u=Nx.prototype.parse.apply(this,[t,o]);if(u===0){this._zero=!0;return}return Yr(u)&&u>0?u:null}determineDataLimits(){const{min:t,max:o}=this.getMinMax(!0);this.min=Yr(t)?Math.max(0,t):null,this.max=Yr(o)?Math.max(0,o):null,this.options.beginAtZero&&(this._zero=!0),this._zero&&this.min!==this._suggestedMin&&!Yr(this._userMin)&&(this.min=t===cp(this.min,0)?cp(this.min,-1):cp(this.min,0)),this.handleTickRangeOptions()}handleTickRangeOptions(){const{minDefined:t,maxDefined:o}=this.getUserBounds();let u=this.min,d=this.max;const _=s=>u=t?u:s,x=s=>d=o?d:s;u===d&&(u<=0?(_(1),x(10)):(_(cp(u,-1)),x(cp(d,1)))),u<=0&&_(cp(d,-1)),d<=0&&x(cp(u,1)),this.min=u,this.max=d}buildTicks(){const t=this.options,o={min:this._userMin,max:this._userMax},u=_re(o,this);return t.bounds==="ticks"&&VL(u,this,"value"),t.reverse?(u.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),u}getLabelForValue(t){return t===void 0?"0":Jy(t,this.chart.options.locale,this.options.ticks.format)}configure(){const t=this.min;super.configure(),this._startValue=$d(t),this._valueRange=$d(this.max)-$d(t)}getPixelForValue(t){return(t===void 0||t===0)&&(t=this.min),t===null||isNaN(t)?NaN:this.getPixelForDecimal(t===this.min?0:($d(t)-this._startValue)/this._valueRange)}getValueForPixel(t){const o=this.getDecimalForPixel(t);return Math.pow(10,this._startValue+o*this._valueRange)}}zi(sT,"id","logarithmic"),zi(sT,"defaults",{ticks:{callback:x1.formatters.logarithmic,major:{enabled:!0}}});function rT(n){const t=n.ticks;if(t.display&&n.display){const o=ma(t.backdropPadding);return us(t.font&&t.font.size,zr.font.size)+o.height}return 0}function yre(n,t,o){return o=Or(o)?o:[o],{w:Ete(n,t.string,o),h:o.length*t.lineHeight}}function eD(n,t,o,u,d){return n===u||n===d?{start:t-o/2,end:t+o/2}:n<u||n>d?{start:t-o,end:t}:{start:t,end:t+o}}function vre(n){const t={l:n.left+n._padding.left,r:n.right-n._padding.right,t:n.top+n._padding.top,b:n.bottom-n._padding.bottom},o=Object.assign({},t),u=[],d=[],_=n._pointLabels.length,x=n.options.pointLabels,s=x.centerPointLabels?Mr/_:0;for(let A=0;A<_;A++){const P=x.setContext(n.getPointLabelContext(A));d[A]=P.padding;const R=n.getPointPosition(A,n.drawingArea+d[A],s),V=Io(P.font),j=yre(n.ctx,V,n._pointLabels[A]);u[A]=j;const Q=yl(n.getIndexAngle(A)+s),me=Math.round(dS(Q)),re=eD(me,R.x,j.w,0,180),be=eD(me,R.y,j.h,90,270);xre(o,t,Q,re,be)}n.setCenterPoint(t.l-o.l,o.r-t.r,t.t-o.t,o.b-t.b),n._pointLabelItems=Tre(n,u,d)}function xre(n,t,o,u,d){const _=Math.abs(Math.sin(o)),x=Math.abs(Math.cos(o));let s=0,A=0;u.start<t.l?(s=(t.l-u.start)/_,n.l=Math.min(n.l,t.l-s)):u.end>t.r&&(s=(u.end-t.r)/_,n.r=Math.max(n.r,t.r+s)),d.start<t.t?(A=(t.t-d.start)/x,n.t=Math.min(n.t,t.t-A)):d.end>t.b&&(A=(d.end-t.b)/x,n.b=Math.max(n.b,t.b+A))}function bre(n,t,o){const u=n.drawingArea,{extra:d,additionalAngle:_,padding:x,size:s}=o,A=n.getPointPosition(t,u+d+x,_),P=Math.round(dS(yl(A.angle+ao))),R=Are(A.y,s.h,P),V=Sre(P),j=Ere(A.x,s.w,V);return{visible:!0,x:A.x,y:R,textAlign:V,left:j,top:R,right:j+s.w,bottom:R+s.h}}function wre(n,t){if(!t)return!0;const{left:o,top:u,right:d,bottom:_}=n;return!(Sh({x:o,y:u},t)||Sh({x:o,y:_},t)||Sh({x:d,y:u},t)||Sh({x:d,y:_},t))}function Tre(n,t,o){const u=[],d=n._pointLabels.length,_=n.options,{centerPointLabels:x,display:s}=_.pointLabels,A={extra:rT(_)/2,additionalAngle:x?Mr/d:0};let P;for(let R=0;R<d;R++){A.padding=o[R],A.size=t[R];const V=bre(n,R,A);u.push(V),s==="auto"&&(V.visible=wre(V,P),V.visible&&(P=V))}return u}function Sre(n){return n===0||n===180?"center":n<180?"left":"right"}function Ere(n,t,o){return o==="right"?n-=t:o==="center"&&(n-=t/2),n}function Are(n,t,o){return o===90||o===270?n-=t/2:(o>270||o<90)&&(n-=t),n}function Cre(n,t,o){const{left:u,top:d,right:_,bottom:x}=o,{backdropColor:s}=t;if(!Rs(s)){const A=wp(t.borderRadius),P=ma(t.backdropPadding);n.fillStyle=s;const R=u-P.left,V=d-P.top,j=_-u+P.width,Q=x-d+P.height;Object.values(A).some(me=>me!==0)?(n.beginPath(),zy(n,{x:R,y:V,w:j,h:Q,radius:A}),n.fill()):n.fillRect(R,V,j,Q)}}function Ire(n,t){const{ctx:o,options:{pointLabels:u}}=n;for(let d=t-1;d>=0;d--){const _=n._pointLabelItems[d];if(!_.visible)continue;const x=u.setContext(n.getPointLabelContext(d));Cre(o,x,_);const s=Io(x.font),{x:A,y:P,textAlign:R}=_;Lp(o,n._pointLabels[d],A,P+s.lineHeight/2,s,{color:x.color,textAlign:R,textBaseline:"middle"})}}function PR(n,t,o,u){const{ctx:d}=n;if(o)d.arc(n.xCenter,n.yCenter,t,0,Ir);else{let _=n.getPointPosition(0,t);d.moveTo(_.x,_.y);for(let x=1;x<u;x++)_=n.getPointPosition(x,t),d.lineTo(_.x,_.y)}}function Mre(n,t,o,u,d){const _=n.ctx,x=t.circular,{color:s,lineWidth:A}=t;!x&&!u||!s||!A||o<0||(_.save(),_.strokeStyle=s,_.lineWidth=A,_.setLineDash(d.dash||[]),_.lineDashOffset=d.dashOffset,_.beginPath(),PR(n,o,x,u),_.closePath(),_.stroke(),_.restore())}function Pre(n,t,o){return uf(n,{label:o,index:t,type:"pointLabel"})}class Q_ extends Nx{constructor(t){super(t),this.xCenter=void 0,this.yCenter=void 0,this.drawingArea=void 0,this._pointLabels=[],this._pointLabelItems=[]}setDimensions(){const t=this._padding=ma(rT(this.options)/2),o=this.width=this.maxWidth-t.width,u=this.height=this.maxHeight-t.height;this.xCenter=Math.floor(this.left+o/2+t.left),this.yCenter=Math.floor(this.top+u/2+t.top),this.drawingArea=Math.floor(Math.min(o,u)/2)}determineDataLimits(){const{min:t,max:o}=this.getMinMax(!1);this.min=Yr(t)&&!isNaN(t)?t:0,this.max=Yr(o)&&!isNaN(o)?o:0,this.handleTickRangeOptions()}computeTickLimit(){return Math.ceil(this.drawingArea/rT(this.options))}generateTickLabels(t){Nx.prototype.generateTickLabels.call(this,t),this._pointLabels=this.getLabels().map((o,u)=>{const d=br(this.options.pointLabels.callback,[o,u],this);return d||d===0?d:""}).filter((o,u)=>this.chart.getDataVisibility(u))}fit(){const t=this.options;t.display&&t.pointLabels.display?vre(this):this.setCenterPoint(0,0,0,0)}setCenterPoint(t,o,u,d){this.xCenter+=Math.floor((t-o)/2),this.yCenter+=Math.floor((u-d)/2),this.drawingArea-=Math.min(this.drawingArea/2,Math.max(t,o,u,d))}getIndexAngle(t){const o=Ir/(this._pointLabels.length||1),u=this.options.startAngle||0;return yl(t*o+Lc(u))}getDistanceFromCenterForValue(t){if(Rs(t))return NaN;const o=this.drawingArea/(this.max-this.min);return this.options.reverse?(this.max-t)*o:(t-this.min)*o}getValueForDistanceFromCenter(t){if(Rs(t))return NaN;const o=t/(this.drawingArea/(this.max-this.min));return this.options.reverse?this.max-o:this.min+o}getPointLabelContext(t){const o=this._pointLabels||[];if(t>=0&&t<o.length){const u=o[t];return Pre(this.getContext(),t,u)}}getPointPosition(t,o,u=0){const d=this.getIndexAngle(t)-ao+u;return{x:Math.cos(d)*o+this.xCenter,y:Math.sin(d)*o+this.yCenter,angle:d}}getPointPositionForValue(t,o){return this.getPointPosition(t,this.getDistanceFromCenterForValue(o))}getBasePosition(t){return this.getPointPositionForValue(t||0,this.getBaseValue())}getPointLabelPosition(t){const{left:o,top:u,right:d,bottom:_}=this._pointLabelItems[t];return{left:o,top:u,right:d,bottom:_}}drawBackground(){const{backgroundColor:t,grid:{circular:o}}=this.options;if(t){const u=this.ctx;u.save(),u.beginPath(),PR(this,this.getDistanceFromCenterForValue(this._endValue),o,this._pointLabels.length),u.closePath(),u.fillStyle=t,u.fill(),u.restore()}}drawGrid(){const t=this.ctx,o=this.options,{angleLines:u,grid:d,border:_}=o,x=this._pointLabels.length;let s,A,P;if(o.pointLabels.display&&Ire(this,x),d.display&&this.ticks.forEach((R,V)=>{if(V!==0||V===0&&this.min<0){A=this.getDistanceFromCenterForValue(R.value);const j=this.getContext(V),Q=d.setContext(j),me=_.setContext(j);Mre(this,Q,A,x,me)}}),u.display){for(t.save(),s=x-1;s>=0;s--){const R=u.setContext(this.getPointLabelContext(s)),{color:V,lineWidth:j}=R;!j||!V||(t.lineWidth=j,t.strokeStyle=V,t.setLineDash(R.borderDash),t.lineDashOffset=R.borderDashOffset,A=this.getDistanceFromCenterForValue(o.reverse?this.min:this.max),P=this.getPointPosition(s,A),t.beginPath(),t.moveTo(this.xCenter,this.yCenter),t.lineTo(P.x,P.y),t.stroke())}t.restore()}}drawBorder(){}drawLabels(){const t=this.ctx,o=this.options,u=o.ticks;if(!u.display)return;const d=this.getIndexAngle(0);let _,x;t.save(),t.translate(this.xCenter,this.yCenter),t.rotate(d),t.textAlign="center",t.textBaseline="middle",this.ticks.forEach((s,A)=>{if(A===0&&this.min>=0&&!o.reverse)return;const P=u.setContext(this.getContext(A)),R=Io(P.font);if(_=this.getDistanceFromCenterForValue(this.ticks[A].value),P.showLabelBackdrop){t.font=R.string,x=t.measureText(s.label).width,t.fillStyle=P.backdropColor;const V=ma(P.backdropPadding);t.fillRect(-x/2-V.left,-_-R.size/2-V.top,x+V.width,R.size+V.height)}Lp(t,s.label,0,-_,R,{color:P.color,strokeColor:P.textStrokeColor,strokeWidth:P.textStrokeWidth})}),t.restore()}drawTitle(){}}zi(Q_,"id","radialLinear"),zi(Q_,"defaults",{display:!0,animate:!0,position:"chartArea",angleLines:{display:!0,lineWidth:1,borderDash:[],borderDashOffset:0},grid:{circular:!1},startAngle:0,ticks:{showLabelBackdrop:!0,callback:x1.formatters.numeric},pointLabels:{backdropColor:void 0,backdropPadding:2,display:!0,font:{size:10},callback(t){return t},padding:5,centerPointLabels:!1}}),zi(Q_,"defaultRoutes",{"angleLines.color":"borderColor","pointLabels.color":"color","ticks.color":"color"}),zi(Q_,"descriptors",{angleLines:{_fallback:"grid"}});const S1={millisecond:{common:!0,size:1,steps:1e3},second:{common:!0,size:1e3,steps:60},minute:{common:!0,size:6e4,steps:60},hour:{common:!0,size:36e5,steps:24},day:{common:!0,size:864e5,steps:30},week:{common:!1,size:6048e5,steps:4},month:{common:!0,size:2628e6,steps:12},quarter:{common:!1,size:7884e6,steps:4},year:{common:!0,size:3154e7}},Wa=Object.keys(S1);function tD(n,t){return n-t}function iD(n,t){if(Rs(t))return null;const o=n._adapter,{parser:u,round:d,isoWeekday:_}=n._parseOpts;let x=t;return typeof u=="function"&&(x=u(x)),Yr(x)||(x=typeof u=="string"?o.parse(x,u):o.parse(x)),x===null?null:(d&&(x=d==="week"&&(fg(_)||_===!0)?o.startOf(x,"isoWeek",_):o.startOf(x,d)),+x)}function nD(n,t,o,u){const d=Wa.length;for(let _=Wa.indexOf(n);_<d-1;++_){const x=S1[Wa[_]],s=x.steps?x.steps:Number.MAX_SAFE_INTEGER;if(x.common&&Math.ceil((o-t)/(s*x.size))<=u)return Wa[_]}return Wa[d-1]}function Dre(n,t,o,u,d){for(let _=Wa.length-1;_>=Wa.indexOf(o);_--){const x=Wa[_];if(S1[x].common&&n._adapter.diff(d,u,x)>=t-1)return x}return Wa[o?Wa.indexOf(o):0]}function kre(n){for(let t=Wa.indexOf(n)+1,o=Wa.length;t<o;++t)if(S1[Wa[t]].common)return Wa[t]}function sD(n,t,o){if(!o)n[t]=!0;else if(o.length){const{lo:u,hi:d}=fS(o,t),_=o[u]>=t?o[u]:o[d];n[_]=!0}}function Lre(n,t,o,u){const d=n._adapter,_=+d.startOf(t[0].value,u),x=t[t.length-1].value;let s,A;for(s=_;s<=x;s=+d.add(s,1,u))A=o[s],A>=0&&(t[A].major=!0);return t}function rD(n,t,o){const u=[],d={},_=t.length;let x,s;for(x=0;x<_;++x)s=t[x],d[s]=x,u.push({value:s,major:!1});return _===0||!o?u:Lre(n,u,d,o)}class Ny extends Fp{constructor(t){super(t),this._cache={data:[],labels:[],all:[]},this._unit="day",this._majorUnit=void 0,this._offsets={},this._normalized=!1,this._parseOpts=void 0}init(t,o={}){const u=t.time||(t.time={}),d=this._adapter=new $ie._date(t.adapters.date);d.init(o),dy(u.displayFormats,d.formats()),this._parseOpts={parser:u.parser,round:u.round,isoWeekday:u.isoWeekday},super.init(t),this._normalized=o.normalized}parse(t,o){return t===void 0?null:iD(this,t)}beforeLayout(){super.beforeLayout(),this._cache={data:[],labels:[],all:[]}}determineDataLimits(){const t=this.options,o=this._adapter,u=t.time.unit||"day";let{min:d,max:_,minDefined:x,maxDefined:s}=this.getUserBounds();function A(P){!x&&!isNaN(P.min)&&(d=Math.min(d,P.min)),!s&&!isNaN(P.max)&&(_=Math.max(_,P.max))}(!x||!s)&&(A(this._getLabelBounds()),(t.bounds!=="ticks"||t.ticks.source!=="labels")&&A(this.getMinMax(!1))),d=Yr(d)&&!isNaN(d)?d:+o.startOf(Date.now(),u),_=Yr(_)&&!isNaN(_)?_:+o.endOf(Date.now(),u)+1,this.min=Math.min(d,_-1),this.max=Math.max(d+1,_)}_getLabelBounds(){const t=this.getLabelTimestamps();let o=Number.POSITIVE_INFINITY,u=Number.NEGATIVE_INFINITY;return t.length&&(o=t[0],u=t[t.length-1]),{min:o,max:u}}buildTicks(){const t=this.options,o=t.time,u=t.ticks,d=u.source==="labels"?this.getLabelTimestamps():this._generate();t.bounds==="ticks"&&d.length&&(this.min=this._userMin||d[0],this.max=this._userMax||d[d.length-1]);const _=this.min,x=this.max,s=dte(d,_,x);return this._unit=o.unit||(u.autoSkip?nD(o.minUnit,this.min,this.max,this._getLabelCapacity(_)):Dre(this,s.length,o.minUnit,this.min,this.max)),this._majorUnit=!u.major.enabled||this._unit==="year"?void 0:kre(this._unit),this.initOffsets(d),t.reverse&&s.reverse(),rD(this,s,this._majorUnit)}afterAutoSkip(){this.options.offsetAfterAutoskip&&this.initOffsets(this.ticks.map(t=>+t.value))}initOffsets(t=[]){let o=0,u=0,d,_;this.options.offset&&t.length&&(d=this.getDecimalForValue(t[0]),t.length===1?o=1-d:o=(this.getDecimalForValue(t[1])-d)/2,_=this.getDecimalForValue(t[t.length-1]),t.length===1?u=_:u=(_-this.getDecimalForValue(t[t.length-2]))/2);const x=t.length<3?.5:.25;o=zo(o,0,x),u=zo(u,0,x),this._offsets={start:o,end:u,factor:1/(o+1+u)}}_generate(){const t=this._adapter,o=this.min,u=this.max,d=this.options,_=d.time,x=_.unit||nD(_.minUnit,o,u,this._getLabelCapacity(o)),s=us(d.ticks.stepSize,1),A=x==="week"?_.isoWeekday:!1,P=fg(A)||A===!0,R={};let V=o,j,Q;if(P&&(V=+t.startOf(V,"isoWeek",A)),V=+t.startOf(V,P?"day":x),t.diff(u,o,x)>1e5*s)throw new Error(o+" and "+u+" are too far apart with stepSize of "+s+" "+x);const me=d.ticks.source==="data"&&this.getDataTimestamps();for(j=V,Q=0;j<u;j=+t.add(j,s,x),Q++)sD(R,j,me);return(j===u||d.bounds==="ticks"||Q===1)&&sD(R,j,me),Object.keys(R).sort(tD).map(re=>+re)}getLabelForValue(t){const o=this._adapter,u=this.options.time;return u.tooltipFormat?o.format(t,u.tooltipFormat):o.format(t,u.displayFormats.datetime)}format(t,o){const d=this.options.time.displayFormats,_=this._unit,x=o||d[_];return this._adapter.format(t,x)}_tickFormatFunction(t,o,u,d){const _=this.options,x=_.ticks.callback;if(x)return br(x,[t,o,u],this);const s=_.time.displayFormats,A=this._unit,P=this._majorUnit,R=A&&s[A],V=P&&s[P],j=u[o],Q=P&&V&&j&&j.major;return this._adapter.format(t,d||(Q?V:R))}generateTickLabels(t){let o,u,d;for(o=0,u=t.length;o<u;++o)d=t[o],d.label=this._tick
3385FormatFunction(d.value,o,t)}getDecimalForValue(t){return t===null?NaN:(t-this.min)/(this.max-this.min)}getPixelForValue(t){const o=this._offsets,u=this.getDecimalForValue(t);return this.getPixelForDecimal((o.start+u)*o.factor)}getValueForPixel(t){const o=this._offsets,u=this.getDecimalForPixel(t)/o.factor-o.end;return this.min+u*(this.max-this.min)}_getLabelSize(t){const o=this.options.ticks,u=this.ctx.measureText(t).width,d=Lc(this.isHorizontal()?o.maxRotation:o.minRotation),_=Math.cos(d),x=Math.sin(d),s=this._resolveTickFontOptions(0).size;return{w:u*_+s*x,h:u*x+s*_}}_getLabelCapacity(t){const o=this.options.time,u=o.displayFormats,d=u[o.unit]||u.millisecond,_=this._tickFormatFunction(t,0,rD(this,[t],this._majorUnit),d),x=this._getLabelSize(_),s=Math.floor(this.isHorizontal()?this.width/x.w:this.height/x.h)-1;return s>0?s:1}getDataTimestamps(){let t=this._cache.data||[],o,u;if(t.length)return t;const d=this.getMatchingVisibleMetas();if(this._normalized&&d.length)return this._cache.data=d[0].controller.getAllParsedValues(this);for(o=0,u=d.length;o<u;++o)t=t.concat(d[o].controller.getAllParsedValues(this));return this._cache.data=this.normalize(t)}getLabelTimestamps(){const t=this._cache.labels||[];let o,u;if(t.length)return t;const d=this.getLabels();for(o=0,u=d.length;o<u;++o)t.push(iD(this,d[o]));return this._cache.labels=this._normalized?t:this.normalize(t)}normalize(t){return UL(t.sort(tD))}}zi(Ny,"id","time"),zi(Ny,"defaults",{bounds:"data",adapters:{},time:{parser:!1,unit:!1,round:!1,isoWeekday:!1,minUnit:"millisecond",displayFormats:{}},ticks:{source:"auto",callback:!1,major:{enabled:!1}}});function Wv(n,t,o){let u=0,d=n.length-1,_,x,s,A;o?(t>=n[u].pos&&t<=n[d].pos&&({lo:u,hi:d}=Th(n,"pos",t)),{pos:_,time:s}=n[u],{pos:x,time:A}=n[d]):(t>=n[u].time&&t<=n[d].time&&({lo:u,hi:d}=Th(n,"time",t)),{time:_,pos:s}=n[u],{time:x,pos:A}=n[d]);const P=x-_;return P?s+(A-s)*(t-_)/P:s}class oT extends Ny{constructor(t){super(t),this._table=[],this._minPos=void 0,this._tableRange=void 0}initOffsets(){const t=this._getTimestampsForTable(),o=this._table=this.buildLookupTable(t);this._minPos=Wv(o,this.min),this._tableRange=Wv(o,this.max)-this._minPos,super.initOffsets(t)}buildLookupTable(t){const{min:o,max:u}=this,d=[],_=[];let x,s,A,P,R;for(x=0,s=t.length;x<s;++x)P=t[x],P>=o&&P<=u&&d.push(P);if(d.length<2)return[{time:o,pos:0},{time:u,pos:1}];for(x=0,s=d.length;x<s;++x)R=d[x+1],A=d[x-1],P=d[x],Math.round((R+A)/2)!==P&&_.push({time:P,pos:x/(s-1)});return _}_generate(){const t=this.min,o=this.max;let u=super.getDataTimestamps();return(!u.includes(t)||!u.length)&&u.splice(0,0,t),(!u.includes(o)||u.length===1)&&u.push(o),u.sort((d,_)=>d-_)}_getTimestampsForTable(){let t=this._cache.all||[];if(t.length)return t;const o=this.getDataTimestamps(),u=this.getLabelTimestamps();return o.length&&u.length?t=this.normalize(o.concat(u)):t=o.length?o:u,t=this._cache.all=t,t}getDecimalForValue(t){return(Wv(this._table,t)-this._minPos)/this._tableRange}getValueForPixel(t){const o=this._offsets,u=this.getDecimalForPixel(t)/o.factor-o.end;return Wv(this._table,u*this._tableRange+this._minPos,!0)}}zi(oT,"id","timeseries"),zi(oT,"defaults",Ny.defaults);var Rre=Object.freeze({__proto__:null,CategoryScale:iT,LinearScale:nT,LogarithmicScale:sT,RadialLinearScale:Q_,TimeScale:Ny,TimeSeriesScale:oT});const Ore=[Vie,gse,hre,Rre];_h.register(...Ore);const zre={class:"investment-summary mb-4"},Fre={class:"row"},Bre={class:"col-md-6 mb-3"},Nre={class:"card h-100"},Vre={class:"card-body"},$re={class:"card-text portfolio-value"},jre={class:"col-md-6 mb-3"},Ure={class:"card h-100"},Hre={class:"card-body"},Gre={class:"chart-container"},Wre={__name:"InvestmentSummary",setup(n){const t=Mi(125e3),o=Mi(3750),u=bs(()=>{const P=o.value/t.value*100;return`${P>0?"+":""}${P.toFixed(2)}%`}),d=bs(()=>o.value>=0?"text-success":"text-danger"),_=Mi(null),x=P=>new Intl.NumberFormat("en-CA",{style:"currency",currency:"CAD"}).format(P),s=()=>{console.log("View portfolio")},A=()=>{console.log("Trade")};return kh(()=>{const P=_.value.getContext("2d");new _h(P,{type:"doughnut",data:{labels:["Stocks","Bonds","Real Estate","Cash"],datasets:[{data:[50,30,15,5],backgroundColor:["#c41f3e","#0077be","#ffa500","#4caf50"],borderWidth:0}]},options:{responsive:!0,maintainAspectRatio:!1,plugins:{legend:{position:"right"}},cutout:"70%"}})}),(P,R)=>(Ke(),it("div",zre,[R[2]||(R[2]=H("h2",{class:"section-title mb-3"},"Investment Summary",-1)),H("div",Fre,[H("div",Bre,[H("div",Nre,[H("div",Vre,[R[0]||(R[0]=H("h5",{class:"card-title"},"Portfolio Value",-1)),H("h3",$re,Ut(x(t.value)),1),H("p",{class:lo(["mt-2","profit-loss",d.value])},Ut(u.value)+" ("+Ut(x(o.value))+") ",3),H("div",{class:"d-flex justify-content-between mt-3"},[H("button",{onClick:s,class:"btn btn-outline-primary btn-sm"},"View Portfolio"),H("button",{onClick:A,class:"btn btn-primary btn-sm"},"Trade")])])])]),H("div",jre,[H("div",Ure,[H("div",Hre,[R[1]||(R[1]=H("h5",{class:"card-title"},"Asset Allocation",-1)),H("div",Gre,[H("canvas",{ref_key:"chartCanvas",ref:_},null,512)])])])])])]))}},qre=ji(Wre,[["__scopeId","data-v-9fe7fc31"]]),Zre={class:"credit-score-widget mb-4"},Xre={class:"card"},Yre={class:"card-body text-center"},Kre={class:"credit-score-chart mb-3"},Jre={width:"200",height:"200",viewBox:"0 0 200 200"},Qre=["stroke","stroke-dasharray"],eoe={x:"100",y:"100","text-anchor":"middle","dominant-baseline":"central","font-size":"36","font-weight":"bold",fill:"#333"},toe={class:"mb-2"},ioe={class:"text-muted"},noe={__name:"CreditScore",setup(n){oc.add(PW,SW);const t=Mi(750),o=Mi(15),u=bs(()=>t.value>=800?"Excellent":t.value>=740?"Very Good":t.value>=670?"Good":t.value>=580?"Fair":"Poor"),d=bs(()=>t.value>=800?"exceptional":t.value>=740?"very good":t.value>=670?"good":t.value>=580?"fair":"poor"),_=bs(()=>t.value/900*565),x=bs(()=>t.value>=800?"#4caf50":t.value>=740?"#8bc34a":t.value>=670?"#ffc107":t.value>=580?"#ff9800":"#f44336"),s=bs(()=>o.value>=0?"text-success":"text-danger"),A=bs(()=>o.value>=0?["fas","arrow-up"]:["fas","arrow-down"]),P=()=>{console.log("View credit report")};return(R,V)=>(Ke(),it("div",Zre,[V[1]||(V[1]=H("h2",{class:"section-title mb-3 text-center"},"Credit Score",-1)),H("div",Xre,[H("div",Yre,[H("div",Kre,[(Ke(),it
3385("svg",Jre,[V[0]||(V[0]=H("circle",{cx:"100",cy:"100",r:"90",fill:"none",stroke:"#e0e0e0","stroke-width":"20"},null,-1)),H("circle",{cx:"100",cy:"100",r:"90",fill:"none",stroke:x.value,"stroke-width":"20","stroke-dasharray":`${_.value} 565`,"stroke-dashoffset":"0",transform:"rotate(-90 100 100)"},null,8,Qre),H("text",eoe,Ut(t.value),1)]))]),H("h3",toe,Ut(u.value),1),H("p",ioe,"Your credit score is "+Ut(d.value),1),H("p",{class:lo(["mt-3",s.value])},[Dt(cs(Fs),{icon:A.value},null,8,["icon"]),es(" "+Ut(Math.abs(o.value))+" points since last month ",1)],2)])]),H("div",{class:"text-center mt-3"},[H("button",{onClick:P,class:"btn btn-primary"},"View Credit Report")])]))}},soe=ji(noe,[["__scopeId","data-v-56b490fe"]]),roe={class:"budget-tracker mb-4"},ooe={class:"card"},aoe={class:"card-body"},loe={class:"row"},coe={class:"col-md-6 mb-4"},uoe={class:"mb-3"},hoe={class:"input-group"},doe={class:"mb-3"},foe={class:"input-group"},poe={class:"mb-3"},moe={class:"input-group"},goe={class:"progress mt-3",style:{height:"25px"}},_oe=["aria-valuenow"],yoe={class:"budget-summary mt-3"},voe={class:"d-flex justify-content-between align-items-center"},xoe={class:"mt-2 text-center"},boe={class:"col-md-6"},woe={class:"d-flex justify-content-between align-items-center mb-3"},Toe={class:"categories-container mb-4",ref:"categoriesContainer"},Soe={key:0,class:"category-edit-form"},Eoe={class:"row g-2"},Aoe={class:"col-6"},Coe={class:"col-3"},Ioe={class:"col-3"},Moe={class:"d-flex justify-content-end mt-2"},Poe=["onClick"],Doe={key:1},koe={class:"category-info"},Loe={class:"category-name"},Roe={class:"category-amount-container"},Ooe={class:"category-amount"},zoe={key:0,class:"category-budget"},Foe={class:"category-progress"},Boe={class:"progress",style:{height:"8px"}},Noe={class:"text-muted"},Voe={class:"category-actions"},$oe=["onClick"],joe=["onClick"],Uoe={key:0,class:"empty-state"},Hoe={class:"add-category-section"},Goe={class:"row g-2"},Woe={class:"col-6"},qoe={class:"col-3"},Zoe={class:"col-3"},Xoe={class:"row g-2 mt-2"},Yoe={class:"col-8"},Koe={class:"col-4"},Joe={key:0,class:"delete-modal"},Qoe={class:"delete-modal-content"},eae={class:"text-center mt-3"},tae={__name:"BudgetTracker",setup(n){oc.add(YG,fW,kW,sW,$W,eW,HW,iW,aW,RW,vW);const t=Mi(6e3),o=Mi(5e3),u=Mi(3750),d=Mi("desc"),_=Mi([{name:"Groceries",amount:800,budget:600},{name:"Utilities",amount:500,budget:450},{name:"Entertainment",amount:300,budget:400},{name:"Transportation",amount:450,budget:500},{name:"Dining Out",amount:275,budget:200}]),x=Mi({name:"",amount:0,budget:0}),s=Mi(-1),A=Mi({name:"",amount:0,budget:0}),P=Mi(!1),R=Mi(-1),V=Mi(null),j=bs(()=>o.value===0?0:Math.round(u.value/o.value*100)),Q=bs(()=>o.value-u.value),me=bs(()=>Q.value<0?`Overspent by ${je(Math.abs(Q.value))}`:`${je(Q.value)} remaining`),re=bs(()=>Q.value<0?"exclamation-triangle":Q.value<o.value*.1?"times-circle":"check-circle"),be=bs(()=>j.value>=100?"#dc3545":j.value>=90?"#fd7e14":j.value>=75?"#ffc107":"#c41f3e"),ve=bs(()=>Q.value<0?"bg-danger":Q.value<o.value*.1?"bg-warning":"bg-success"),Ee=bs(()=>[..._.value].sort((vi,Ue)=>d.value==="desc"?Ue.amount-vi.amount:vi.amount-Ue.amount)),je=vi=>new Intl.NumberFormat("en-CA",{style:"currency",currency:"CAD"}).format(vi),Ve=vi=>u.value===0?0:Math.round(vi/u.value*100),Je=vi=>vi.budget&&vi.amount>vi.budget?"#dc3545":vi.budget&&vi.amount>vi.budget*.9?"#ffc107":"#c41f3e",vt=vi=>vi.budget&&vi.amount>vi.budget,_t=()=>{const vi=_.value.reduce((Ue,Yn)=>Ue+Yn.amount,0);vi>0&&(u.value=vi)},Mt=()=>{d.value=d.value==="desc"?"asc":"desc"},At=()=>{if(x.value.name.trim()&&x.value.amount>0){const vi={name:x.value.name.trim(),amount:Number(x.value.amount)};x.value.budget>0&&(vi.budget=Number(x.value.budget)),_.value.push(vi),ei(),_t()}else alert("Please provide a valid category name and amount.")},ei=()=>{x.value.name="",x.value.amount=0,x.value.budget=0},Yt=vi=>{_.value.indexOf(Ee.value[vi]),A.value={...Ee.value[vi]},s.value=vi},Zt=vi=>{if(A.value.name.trim()&&A.value.amount>0){const Ue=_.value.indexOf(Ee.value[vi]);_.value.splice(Ue,1,{...A.value}),yi(),_t()}else alert("Please provide a valid category name and amount.")},yi=()=>{s.value=-1},Fi=vi=>{V.value=Ee.value[vi],R.value=vi,P.value=!0},ki=()=>{const vi=_.value.indexOf(V.value);vi!==-1&&_.value.splice(vi,1),wi(),_t()},wi=()=>{P.value=!1,R.value=-1,V.value=null},Li=()=>{const vi={income:t.value,budget:o.value,spent:u.value,categories:_.value,date:new Date().toISOString()},Ue=JSON.stringify(vi,null,2),Yn=new Blob([Ue],{type:"application/json"}),Ki=URL.createObjectURL(Yn),ps=document.createElement("a");ps.href=Ki,ps.download=`budget-${new Date().toISOString().split("T")[0]}.json`,ps.click(),URL.revokeObjectURL(Ki)},cn=()=>{t.value=6e3,o.value=5e3,u.value=0,_.value=[]};return _t(),(vi,Ue)=>{var Yn;return Ke(),it("div",roe,[Ue[25]||(Ue[25]=H("h2",{class:"section-title mb-3 text-center"},"Budget Tracker",-1)),H("div",ooe,[H("div",aoe,[H("div",loe,[H("div",coe,[Ue[17]||(Ue[17]=H("h5",null,"Budget Overview",-1)),H("div",uoe,[Ue[10]||(Ue[10]=H("label",{for:"incomeInput",class:"form-label"},"Monthly Income",-1)),H("div",hoe,[Ue[9]||(Ue[9]=H("span",{class:"input-group-text"},"$",-1)),An(H("input",{id:"incomeInput",type:"number","onUpdate:modelValue":Ue[0]||(Ue[0]=Ki=>t.value=Ki),class:"form-control",placeholder:"Enter your monthly income",min:"0"},null,512),[[Ur,t.value]])])]),H("div",doe,[Ue[12]||(Ue[12]=H("label",{for:"budgetInput",class:"form-label"},"Monthly Budget",-1)),H("div",foe,[Ue[11]||(Ue[11]=H("span",{class:"input-group-text"},"$",-1)),An(H("input",{id:"budgetInput",type:"number","onUpdate:modelValue":Ue[1]||(Ue[1]=Ki=>o.value=Ki),class:"form-control",placeholder:"Enter your budget",onInput:_t,min:"0"},null,544),[[Ur,o.value]])])]),H("div",poe,[Ue[14]||(Ue[14]=H("label",{for:"spentInput",class:"form-label"},"Amount Spent",-1)),H("div",moe,[Ue[13]||(Ue[13]=H("span",{class:"input-group-text"},"$",-1)),An(H("input",{id:"spentInput",type:"number","onUpdate:modelValue":Ue[2]||(Ue[2]=Ki=>u.value=Ki),class:"form-control",placeholder:"Enter amount spent",onInput:_t,min:"0"},null,544),[[Ur,u.value]])])]),H("div",goe,[H("div",{class:"progress-bar",role:"progressbar",style:Nd({width:`${Math.min(j.value,100)}%`,backgroundColor:be.value}
3385),"aria-valuenow":j.value,"aria-valuemin":"0","aria-valuemax":"100"},Ut(j.value)+"% ",13,_oe),j.value>100?(Ke(),it("div",{key:0,class:"progress-bar progress-bar-overspent",style:Nd({width:`${Math.min(j.value-100,100)}%`})}," +"+Ut(j.value-100)+"% ",5)):ha("",!0)]),H("div",yoe,[H("div",voe,[H("span",null,[H("strong",null,Ut(je(u.value)),1),Ue[15]||(Ue[15]=es(" spent"))]),H("span",null,[H("strong",null,Ut(je(o.value)),1),Ue[16]||(Ue[16]=es(" budget"))])]),H("div",xoe,[H("span",{class:lo(["badge",ve.value])},[Dt(cs(Fs),{icon:re.value,class:"me-1"},null,8,["icon"]),es(" "+Ut(me.value),1)],2)])])]),H("div",boe,[H("div",woe,[Ue[19]||(Ue[19]=H("h5",null,"Spending Categories",-1)),H("button",{class:"btn btn-outline-primary btn-sm",onClick:Mt},[Dt(cs(Fs),{icon:"sort-amount-down",class:"me-1"}),Ue[18]||(Ue[18]=es(" Sort "))])]),H("div",Toe,[(Ke(!0),it(fn,null,Hn(Ee.value,(Ki,ps)=>(Ke(),it("div",{key:ps,class:lo(["category-item",{"category-overspent":vt(Ki)}])},[s.value===ps?(Ke(),it("div",Soe,[H("div",Eoe,[H("div",Aoe,[An(H("input",{"onUpdate:modelValue":Ue[3]||(Ue[3]=On=>A.value.name=On),type:"text",class:"form-control form-control-sm",placeholder:"Category name"},null,512),[[Ur,A.value.name]])]),H("div",Coe,[An(H("input",{"onUpdate:modelValue":Ue[4]||(Ue[4]=On=>A.value.amount=On),type:"number",class:"form-control form-control-sm",placeholder:"Amount",min:"0"},null,512),[[Ur,A.value.amount]])]),H("div",Ioe,[An(H("input",{"onUpdate:modelValue":Ue[5]||(Ue[5]=On=>A.value.budget=On),type:"number",class:"form-control form-control-sm",placeholder:"Budget",min:"0"},null,512),[[Ur,A.value.budget]])])]),H("div",Moe,[H("button",{class:"btn btn-primary btn-sm me-2",onClick:On=>Zt(ps)}," Save ",8,Poe),H("button",{class:"btn btn-outline-secondary btn-sm",onClick:yi}," Cancel ")])])):(Ke(),it("div",Doe,[H("div",koe,[H("span",Loe,Ut(Ki.name),1),H("div",Roe,[H("span",Ooe,Ut(je(Ki.amount)),1),Ki.budget?(Ke(),it("span",zoe," / "+Ut(je(Ki.budget)),1)):ha("",!0)])]),H("div",Foe,[H("div",Boe,[H("div",{class:"progress-bar category-progress-bar",style:Nd({width:`${Math.min(Ve(Ki.amount),100)}%`,backgroundColor:Je(Ki)})},null,4),Ki.budget&&Ki.amount>Ki.budget?(Ke(),it("div",{key:0,class:"progress-bar category-progress-overspent",style:Nd({width:`${Math.min((Ki.amount-Ki.budget)/Ki.budget*100,100)}%`})},null,4)):ha("",!0)]),H("small",Noe,Ut(Ve(Ki.amount))+"% of total spending",1)]),H("div",Voe,[H("button",{class:"btn btn-outline-primary btn-sm",onClick:On=>Yt(ps),title:"Edit category"},[Dt(cs(Fs),{icon:"edit"})],8,$oe),H("button",{class:"btn btn-outline-danger btn-sm",onClick:On=>Fi(ps),title:"Remove category"},[Dt(cs(Fs),{icon:"trash"}
3385)],8,joe)])]))],2))),128)),_.value.length===0?(Ke(),it("div",Uoe,[Dt(cs(Fs),{icon:"chart-pie",class:"empty-icon"}),Ue[20]||(Ue[20]=H("p",null," No spending categories yet. Add your first category below! ",-1))])):ha("",!0)],512),H("div",Hoe,[Ue[22]||(Ue[22]=H("h6",null,"Add New Category",-1)),H("div",Goe,[H("div",Woe,[An(H("input",{"onUpdate:modelValue":Ue[6]||(Ue[6]=Ki=>x.value.name=Ki),type:"text",class:"form-control form-control-sm",placeholder:"Category name",onKeyup:hw(At,["enter"])},null,544),[[Ur,x.value.name]])]),H("div",qoe,[An(H("input",{"onUpdate:modelValue":Ue[7]||(Ue[7]=Ki=>x.value.amount=Ki),type:"number",class:"form-control form-control-sm",placeholder:"Amount",min:"0",onKeyup:hw(At,["enter"])},null,544),[[Ur,x.value.amount]])]),H("div",Zoe,[An(H("input",{"onUpdate:modelValue":Ue[8]||(Ue[8]=Ki=>x.value.budget=Ki),type:"number",class:"form-control form-control-sm",placeholder:"Budget",min:"0",onKeyup:hw(At,["enter"])},null,544),[[Ur,x.value.budget]])])]),H("div",Xoe,[H("div",Yoe,[H("button",{class:"btn btn-primary btn-sm w-100",onClick:At},[Dt(cs(Fs),{icon:"plus",class:"me-1"}),Ue[21]||(Ue[21]=es(" Add Category "))])]),H("div",Koe,[H("button",{class:"btn btn-outline-secondary btn-sm w-100",onClick:ei},[Dt(cs(Fs),{icon:"times"})])])])])])])])]),P.value?(Ke(),it("div",Joe,[H("div",Qoe,[H("p",null,'Are you sure you want to remove "'+Ut((Yn=V.value)==null?void 0:Yn.name)+'"?',1),H("div",{class:"d-flex justify-content-end"},[H("button",{class:"btn btn-danger btn-sm me-2",onClick:ki}," Delete "),H("button",{class:"btn btn-outline-secondary btn-sm",onClick:wi}," Cancel ")])])])):ha("",!0),H("div",eae,[H("button",{class:"btn btn-outline-primary me-2",onClick:Li},[Dt(cs(Fs),{icon:"download",class:"me-1"}),Ue[23]||(Ue[23]=es(" Export Budget "))]),H("button",{class:"btn btn-outline-secondary",onClick:cn},[Dt(cs(Fs),{icon:"refresh",class:"me-1"}),Ue[24]||(Ue[24]=es(" Reset "))])])])}}},iae=ji(tae,[["__scopeId","data-v-63f7618d"]]),nae={class:"main-content"},sae={class:"container-fluid"},rae={class:"row"},oae={class:"col-lg-8"},aae={class:"col-lg-4"},lae={__name:"Dashboard",setup(n){const t=Mi(null),o=Mi(!1),u=()=>{t.value&&(t.value.toggleSidebar(),o.value=!o.value)};return(d,_)=>(Ke(),it("div",{class:lo(["dashboard",{"sidebar-collapsed":o.value}])},[Dt(OQ,{onToggleSidebar:u}),Dt(VQ,{ref_key:"sidebar",ref:t},null,512),H("main",nae,[H("div",sae,[H("div",rae,[H("div",oae,[Dt(KQ),Dt(qre),Dt(iee)]),H("div",aae,[Dt(soe),Dt(lee),Dt(Iee)])]),Dt(iae),Dt(yee)])]),Dt(Tee)],2))}}
3385,cae=ji(lae,[["__scopeId","data-v-fe537bc3"]]),uae=[{path:"/",name:"Intro",component:O8},{path:"/personal-banking",name:"PersonalBanking",component:LY},{path:"/business-banking",name:"BusinessBanking",component:cJ},{path:"/investing",name:"Investing",component:vQ},{path:"/home",name:"Home",component:Iq},{path:"/about",name:"About",component:BZ},{path:"/sign-on",name:"SignOn",component:RX},{path:"/dashboard",name:"Dashboard",component:cae}],hae=M8({history:s8(),routes:uae});var gx={exports:{}};/*! 3386 * Bootstrap v5.3.3 (https://getbootstrap.com/) 3387 * Copyright 2011-2024 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors) 3388 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) 3389 */var dae=gx.exports,oD;function fae(){return oD||(oD=1,function(n,t){(function(o,u){n.exports=u()})(dae,function(){const o=new Map,u={set(ce,z,ee){o.has(ce)||o.set(ce,new Map);const we=o.get(ce);we.has(z)||we.size===0?we.set(z,ee):console.error(`Bootstrap doesn't allow more than one instance per element. Bound instance: ${Array.from(we.keys())[0]}.`)},get:(ce,z)=>o.has(ce)&&o.get(ce).get(z)||null,remove(ce,z){if(!o.has(ce))return;const ee=o.get(ce);ee.delete(z),ee.size===0&&o.delete(ce)}},d="transitionend",_=ce=>(ce&&window.CSS&&window.CSS.escape&&(ce=ce.replace(/#([^\s"#']+)/g,(z,ee)=>`#${CSS.escape(ee)}`)),ce),x=ce=>{ce.dispatchEvent(new Event(d))},s=ce=>!(!ce||typeof ce!="object")&&(ce.jquery!==void 0&&(ce=ce[0]),ce.nodeType!==void 0),A=ce=>s(ce)?ce.jquery?ce[0]:ce:typeof ce=="string"&&ce.length>0?document.querySelector(_(ce)):null,P=ce=>{if(!s(ce)||ce.getClientRects().length===0)return!1;const z=getComputedStyle(ce).getPropertyValue("visibility")==="visible",ee=ce.closest("details:not([open])");if(!ee)return z;if(ee!==ce){const we=ce.closest("summary");if(we&&we.parentNode!==ee||we===null)return!1}return z},R=ce=>!ce||ce.nodeType!==Node.ELEMENT_NODE||!!ce.classList.contains("disabled")||(ce.disabled!==void 0?ce.disabled:ce.hasAttribute("disabled")&&ce.getAttribute("disabled")!=="false"),V=ce=>{if(!document.documentElement.attachShadow)return null;if(typeof ce.getRootNode=="function"){const z=ce.getRootNode();return z instanceof ShadowRoot?z:null}return ce instanceof ShadowRoot?ce:ce.parentNode?V(ce.parentNode):null},j=()=>{},Q=ce=>{ce.offsetHeight},me=()=>window.jQuery&&!document.body.hasAttribute("data-bs-no-jquery")?window.jQuery:null,re=[],be=()=>document.documentElement.dir==="rtl",ve=ce=>{var z;z=()=>{const ee=me();if(ee){const we=ce.NAME,ot=ee.fn[we];ee.fn[we]=ce.jQueryInterface,ee.fn[we].Constructor=ce,ee.fn[we].noConflict=()=>(ee.fn[we]=ot,ce.jQueryInterface)}},document.readyState==="loading"?(re.length||document.addEventListener("DOMContentLoaded",()=>{for(const ee of re)ee()}),re.push(z)):z()},Ee=(ce,z=[],ee=ce)=>typeof ce=="function"?ce(...z):ee,je=(ce,z,ee=!0)=>{if(!ee)return void Ee(ce);const we=(Ot=>{if(!Ot)return 0;let{transitionDuration:ii,transitionDelay:Si}=window.getComputedStyle(Ot);const Wi=Number.parseFloat(ii),Ui=Number.parseFloat(Si);return Wi||Ui?(ii=ii.split(",")[0],Si=Si.split(",")[0],1e3*(Number.parseFloat(ii)+Number.parseFloat(Si))):0})(z)+5;let ot=!1;const at=({target:Ot})=>{Ot===z&&(ot=!0,z.removeEventListener(d,at),Ee(ce))};z.addEventListener(d,at),setTimeout(()=>{ot||x(z)},we)},Ve=(ce,z,ee,we)=>{const ot=ce.length;let at=ce.indexOf(z);return at===-1?!ee&&we?ce[ot-1]:ce[0]:(at+=ee?1:-1,we&&(at=(at+ot)%ot),ce[Math.max(0,Math.min(at,ot-1))])},Je=/[^.]*(?=\..*)\.|.*/,vt=/\..*/,_t=/::\d+$/,Mt={};let At=1;
3389const ei={mouseenter:"mouseover",mouseleave:"mouseout"},Yt=new Set(["click","dblclick","mouseup","mousedown","contextmenu","mousewheel","DOMMouseScroll","mouseover","mouseout","mousemove","selectstart","selectend","keydown","keypress","keyup","orientationchange","touchstart","touchmove","touchend","touchcancel","pointerdown","pointermove","pointerup","pointerleave","pointercancel","gesturestart","gesturechange","gestureend","focus","blur","change","reset","select","submit","focusin","focusout","load","unload","beforeunload","resize","move","DOMContentLoaded","readystatechange","error","abort","scroll"]);function Zt(ce,z){return z&&`${z}::${At++}`||ce.uidEvent||At++}function yi(ce){const z=Zt(ce);return ce.uidEvent=z,Mt[z]=Mt[z]||{},Mt[z]}function Fi(ce,z,ee=null){return Object.values(ce).find(we=>we.callable===z&&we.delegationSelector===ee)}function ki(ce,z,ee){const we=typeof z=="string",ot=we?ee:z||ee;let at=vi(ce);return Yt.has(at)||(at=ce),[we,ot,at]}function wi(ce,z,ee,we,ot){if(typeof z!="string"||!ce)return;let[at,Ot,ii]=ki(z,ee,we);z in ei&&(Ot=(kn=>function(Ln){if(!Ln.relatedTarget||Ln.relatedTarget!==Ln.delegateTarget&&!Ln.delegateTarget.contains(Ln.relatedTarget))return kn.call(this,Ln)})(Ot));const Si=yi(ce),Wi=Si[ii]||(Si[ii]={}),Ui=Fi(Wi,Ot,at?ee:null);if(Ui)return void(Ui.oneOff=Ui.oneOff&&ot);const $i=Zt(Ot,z.replace(Je,"")),xn=at?function(wn,kn,Ln){return function Fn(Ns){const Gs=wn.querySelectorAll(kn);for(let{target:os}=Ns;os&&os!==this;os=os.parentNode)for(const As of Gs)if(As===os)return Yn(Ns,{delegateTarget:os}),Fn.oneOff&&Ue.off(wn,Ns.type,kn,Ln),Ln.apply(os,[Ns])}}(ce,ee,Ot):function(wn,kn){return function Ln(Fn){return Yn(Fn,{delegateTarget:wn}),Ln.oneOff&&Ue.off(wn,Fn.type,kn),kn.apply(wn,[Fn])}}(ce,Ot);xn.delegationSelector=at?ee:null,xn.callable=Ot,xn.oneOff=ot,xn.uidEvent=$i,Wi[$i]=xn,ce.addEventListener(ii,xn,at)}function Li(ce,z,ee,we,ot){const at=Fi(z[ee],we,ot);at&&(ce.removeEventListener(ee,at,!!ot),delete z[ee][at.uidEvent])}function cn(ce,z,ee,we){const ot=z[ee]||{};for(const[at,Ot]of Object.entries(ot))at.includes(we)&&Li(ce,z,ee,Ot.callable,Ot.delegationSelector)}function vi(ce){return ce=ce.replace(vt,""),ei[ce]||ce}const Ue={on(ce,z,ee,we){wi(ce,z,ee,we,!1)},one(ce,z,ee,we){wi(ce,z,ee,we,!0)},off(ce,z,ee,we){if(typeof z!="string"||!ce)return;const[ot,at,Ot]=ki(z,ee,we),ii=Ot!==z,Si=yi(ce),Wi=Si[Ot]||{},Ui=z.startsWith(".");if(at===void 0){if(Ui)for(const $i of Object.keys(Si))cn(ce,Si,$i,z.slice(1));for(const[$i,xn]of Object.entries(Wi)){const wn=$i.replace(_t,"");ii&&!z.includes(wn)||Li(ce,Si,Ot,xn.callable,xn.delegationSelector)}}else{if(!Object.keys(Wi).length)return;Li(ce,Si,Ot,at,ot?ee:null)}},trigger(ce,z,ee){if(typeof z!="string"||!ce)return null;const we=me();let ot=null,at=!0,Ot=!0,ii=!1;z!==vi(z)&&we&&(ot=we.Event(z,ee),we(ce).trigger(ot),at=!ot.isPropagationStopped(),Ot=!ot.isImmediatePropagationStopped(),ii=ot.isDefaultPrevented());const Si=Yn(new Event(z,{bubbles:at,cancelable:!0}),ee);return ii&&Si.preventDefault(),Ot&&ce.dispatchEvent(Si),Si.defaultPrevented&&ot&&ot.preventDefault(),Si}};function Yn(ce,z={}){for(const[ee,we]of Object.entries(z))try{ce[ee]=we}catch{Object.defineProperty(ce,ee,{configurable:!0,get:()=>we})}return ce}function Ki(ce){if(ce==="true")return!0;if(ce==="false")return!1;if(ce===Number(ce).toString())return Number(ce);if(ce===""||ce==="null")return null;if(typeof ce!="string")return ce;try{return JSON.parse(decodeURIComponent(ce))}catch{return ce}}function ps(ce){return ce.replace(/[A-Z]/g,z=>`-${z.toLowerCase()}`)}const On={setDataAttribute(ce,z,ee){ce.setAttribute(`data-bs-${ps(z)}`,ee)},removeDataAttribute(ce,z){ce.removeAttribute(`data-bs-${ps(z)}`)},getDataAttributes(ce){if(!ce)return{};const z={},ee=Object.keys(ce.dataset).filter(we=>we.startsWith("bs")&&!we.startsWith("bsConfig"));for(const we of ee){let ot=we.replace(/^bs/,"");ot=ot.charAt(0).toLowerCase()+ot.slice(1,ot.length),z[ot]=Ki(ce.dataset[we])}return z},getDataAttribute:(ce,z)=>Ki(ce.getAttribute(`data-bs-${ps(z)}`))};class hn{static get Default(){return{}}static get DefaultType(){return{}}static get NAME(){throw new Error('You have to implement the static method "NAME", for each component!')}_getConfig(z){return z=this._mergeConfigObj(z),z=this._configAfterMerge(z),this._typeCheckConfig(z),z}_configAfterMerge(z){return z}_mergeConfigObj(z,ee){const we=s(ee)?On.getDataAttribute(ee,"config"):{};return{...this.constructor.Default,...typeof we=="object"?we:{},...s(ee)?On.getDataAttributes(ee):{},...typeof z=="object"?z:{}}}_typeCheckConfig(z,ee=this.constructor.DefaultType){for(const[ot,at]of Object.entries(ee)){const Ot=z[ot],ii=s(Ot)?"element":(we=Ot)==null?`${we}`:Object.prototype.toString.call(we).match(/\s([a-z]+)/i)[1].toLowerCase();if(!new RegExp(at).test(ii))throw new TypeError(`${this.constructor.NAME.toUpperCase()}: Option "${ot}" provided type "${ii}" but expected type "${at}".`)}var we}}class Hi extends hn{constructor(z,ee){super(),(z=A(z))&&(this._element=z,this._config=this._getConfig(ee),u.set(this._element,this.constructor.DATA_KEY,this))}dispose(){u.remove(this._element,this.constructor.DATA_KEY),Ue.off(this._element,this.constructor.EVENT_KEY);for(const z of Object.getOwnPropertyNames(this))this[z]=null}_queueCallback(z,ee,we=!0){je(z,ee,we)}_getConfig(z){return z=this._mergeConfigObj(z,this._element),z=this._configAfterMerge(z),this._typeCheckConfig(z),z}static getInstance(z){return u.get(A(z),this.DATA_KEY)}static getOrCreateInstance(z,ee={}){return this.getInstance(z)||new this(z,typeof ee=="object"?ee:null)}static get VERSION(){return"5.3.3"}static get DATA_KEY(){return`bs.${this.NAME}`}static get EVENT_KEY(){return`.${this.DATA_KEY}`}static eventName(z){return`${z}${this.EVENT_KEY}`}}const Ct=ce=>{let z=ce.getAttribute("data-bs-target");if(!z||z==="#"){let ee=ce.getAttribute("href");if(!ee||!ee.includes("#")&&!ee.startsWith("."))return null;ee.includes("#")&&!ee.startsWith("#")&&(ee=`#${ee.split("#")[1]}`),z=ee&&ee!=="#"?ee.trim():null}return z?z.split(",").map(ee=>_(ee)).join(","):null}
vendor: 4,288 bytes, line 3389
3389,zt={find:(ce,z=document.documentElement)=>[].concat(...Element.prototype.querySelectorAll.call(z,ce)),findOne:(ce,z=document.documentElement)=>Element.prototype.querySelector.call(z,ce),children:(ce,z)=>[].concat(...ce.children).filter(ee=>ee.matches(z)),parents(ce,z){const ee=[];let we=ce.parentNode.closest(z);for(;we;)ee.push(we),we=we.parentNode.closest(z);return ee},prev(ce,z){let ee=ce.previousElementSibling;for(;ee;){if(ee.matches(z))return[ee];ee=ee.previousElementSibling}return[]},next(ce,z){let ee=ce.nextElementSibling;for(;ee;){if(ee.matches(z))return[ee];ee=ee.nextElementSibling}return[]},focusableChildren(ce){const z=["a","button","input","textarea","select","details","[tabindex]",'[contenteditable="true"]'].map(ee=>`${ee}:not([tabindex^="-"])`).join(",");return this.find(z,ce).filter(ee=>!R(ee)&&P(ee))},getSelectorFromElement(ce){const z=Ct(ce);return z&&zt.findOne(z)?z:null},getElementFromSelector(ce){const z=Ct(ce);return z?zt.findOne(z):null},getMultipleElementsFromSelector(ce){const z=Ct(ce);return z?zt.find(z):[]}},ti=(ce,z="hide")=>{const ee=`click.dismiss${ce.EVENT_KEY}`,we=ce.NAME;Ue.on(document,ee,`[data-bs-dismiss="${we}"]`,function(ot){if(["A","AREA"].includes(this.tagName)&&ot.preventDefault(),R(this))return;const at=zt.getElementFromSelector(this)||this.closest(`.${we}`);ce.getOrCreateInstance(at)[z]()})},qi=".bs.alert",ts=`close${qi}`,Fe=`closed${qi}`;class Oe extends Hi{static get NAME(){return"alert"}close(){if(Ue.trigger(this._element,ts).defaultPrevented)return;this._element.classList.remove("show");const z=this._element.classList.contains("fade");this._queueCallback(()=>this._destroyElement(),this._element,z)}_destroyElement(){this._element.remove(),Ue.trigger(this._element,Fe),this.dispose()}static jQueryInterface(z){return this.each(function(){const ee=Oe.getOrCreateInstance(this);if(typeof z=="string"){if(ee[z]===void 0||z.startsWith("_")||z==="constructor")throw new TypeError(`No method named "${z}"`);ee[z](this)}})}}ti(Oe,"close"),ve(Oe);const dt='[data-bs-toggle="button"]';class $t extends Hi{static get NAME(){return"button"}toggle(){this._element.setAttribute("aria-pressed",this._element.classList.toggle("active"))}static jQueryInterface(z){return this.each(function(){const ee=$t.getOrCreateInstance(this);z==="toggle"&&ee[z]()})}}Ue.on(document,"click.bs.button.data-api",dt,ce=>{ce.preventDefault();const z=ce.target.closest(dt);$t.getOrCreateInstance(z).toggle()}),ve($t);const Ft=".bs.swipe",Wt=`touchstart${Ft}`,Ti=`touchmove${Ft}`,pi=`touchend${Ft}`,di=`pointerdown${Ft}`,ai=`pointerup${Ft}`,on={endCallback:null,leftCallback:null,rightCallback:null},Ci={endCallback:"(function|null)",leftCallback:"(function|null)",rightCallback:"(function|null)"};class Bi extends hn{constructor(z,ee){super(),this._element=z,z&&Bi.isSupported()&&(this._config=this._getConfig(ee),this._deltaX=0,this._supportPointerEvents=!!window.PointerEvent,this._initEvents())}static get Default(){return on}static get DefaultType(){return Ci}static get NAME(){return"swipe"}dispose(){Ue.off(this._element,Ft)}_start(z){this._supportPointerEvents?this._eventIsPointerPenTouch(z)&&(this._deltaX=z.clientX):this._deltaX=z.touches[0].clientX}_end(z){this._eventIsPointerPenTouch(z)&&(this._deltaX=z.clientX-this._deltaX),this._handleSwipe(),Ee(this._config.endCallback)}_move(z){this._deltaX=z.touches&&z.touches.length>1?0:z.touches[0].clientX-this._deltaX}_handleSwipe(){const z=Math.abs(this._deltaX);if(z<=40)return;const ee=z/this._deltaX;this._deltaX=0,ee&&Ee(ee>0?this._config.rightCallback:this._config.leftCallback)}_initEvents(){this._supportPointerEvents?(Ue.on(this._element,di,z=>this._start(z)),Ue.on(this._element,ai,z=>this._end(z)),this._element.classList.add("pointer-event")):(Ue.on(this._element,Wt,z=>this._start(z)),Ue.on(this._element,Ti,z=>this._move(z)),Ue.on(this._element,pi,z=>this._end(z)))}_eventIsPointerPenTouch(z){return this._supportPointerEvents&&(z.pointerType==="pen"||z.pointerType==="touch")}static isSupported(){return"ontouchstart"in document.documentElement||navigator.maxTouchPoints>0}}const Gi=".bs.carousel",Vn=".data-api",Kn="next",$n="prev",Us="left",Qs="right",tr=`slide${Gi}`,Pr=`slid${Gi}`,Mo=`keydown${Gi}`,Bo=`mouseenter${Gi}`,wr=`mouseleave${Gi}`,Hr=`dragstart${Gi}`,El=`load${Gi}
3389${Vn}`,Ss=`click${Gi}${Vn}`,ga="carousel",qa="active",No=".active",Vc=".carousel-item",zh=No+Vc,Cu={ArrowLeft:Qs,ArrowRight:Us},kt={interval:5e3,keyboard:!0,pause:"hover",ride:!1,touch:!0,wrap:!0},Za={interval:"(number|boolean)",keyboard:"boolean",pause:"(string|boolean)",ride:"(boolean|string)",touch:"boolean",wrap:"boolean"};class Xa extends Hi{constructor(z,ee){super(z,ee),this._interval=null,this._activeElement=null,this._isSliding=!1,this.touchTimeout=null,this._swipeHelper=null,this._indicatorsElement=zt.findOne(".carousel-indicators",this._element),this._addEventListeners(),this._config.ride===ga&&this.cycle()}static get Default(){return kt}static get DefaultType(){return Za}static get NAME(){return"carousel"}next(){this._slide(Kn)}nextWhenVisible(){!document.hidden&&P(this._element)&&this.next()}prev(){this._slide($n)}pause(){this._isSliding&&x(this._element),this._clearInterval()}cycle(){this._clearInterval(),this._updateInterval(),this._interval=setInterval(()=>this.nextWhenVisible(),this._config.interval)}_maybeEnableCycle(){this._config.ride&&(this._isSliding?Ue.one(this._element,Pr,()=>this.cycle()):this.cycle())}to(z){const ee=this._getItems();if(z>ee.length-1||z<0)return;if(this._isSliding)return void Ue.one(this._element,Pr,()=>this.to(z));const we=this._getItemIndex(this._getActive());if(we===z)return;const ot=z>we?Kn:$n;this._slide(ot,ee[z])}dispose(){this._swipeHelper&&this._swipeHelper.dispose(),super.dispose()}_configAfterMerge(z){return z.defaultInterval=z.interval,z}_addEventListeners(){this._config.keyboard&&Ue.on(this._element,Mo,z=>this._keydown(z)),this._config.pause==="hover"&&(Ue.on(this._element,Bo,()=>this.pause()),Ue.on(this._element,wr,()=>this._maybeEnableCycle())),this._config.touch&&Bi.isSupported()&&this._addTouchEventListeners()}_addTouchEventListeners(){for(const ee of zt.find(".carousel-item img",this._element))Ue.on(ee,Hr,we=>we.preventDefault());const z={leftCallback:()=>this._slide(this._directionToOrder(Us)),rightCallback:()=>this._slide(this._directionToOrder(Qs)),endCallback:()=>{this._config.pause==="hover"&&(this.pause(),this.touchTimeout&&clearTimeout(this.touchTimeout),this.touchTimeout=setTimeout(()=>this._maybeEnableCycle(),500+this._config.interval))}};this._swipeHelper=new Bi(this._element,z)}_keydown(z){if(/input|textarea/i.test(z.target.tagName))return;const ee=Cu[z.key];ee&&(z.preventDefault(),this._slide(this._directionToOrder(ee)))}_getItemIndex(z){return this._getItems().indexOf(z)}_setActiveIndicatorElement(z){if(!this._indicatorsElement)return;const ee=zt.findOne(No,this._indicatorsElement);ee.classList.remove(qa),ee.removeAttribute("aria-current");const we=zt.findOne(`[data-bs-slide-to="${z}"]`,this._indicatorsElement);we&&(we.classList.add(qa),we.setAttribute("aria-current","true"))}_updateInterval(){const z=this._activeElement||this._getActive();if(!z)return;const ee=Number.parseInt(z.getAttribute("data-bs-interval"),10);this._config.interval=ee||this._config.defaultInterval}_slide(z,ee=null){if(this._isSliding)return;const we=this._getActive(),ot=z===Kn,at=ee||Ve(this._getItems(),we,ot,this._config.wrap);if(at===we)return;const Ot=this._getItemIndex(at),ii=$i=>Ue.trigger(this._element,$i,{relatedTarget:at,direction:this._orderToDirection(z),from:this._getItemIndex(we),to:Ot});if(ii(tr).defaultPrevented||!we||!at)return;const Si=!!this._interval;this.pause(),this._isSliding=!0,this._setActiveIndicatorElement(Ot),this._activeElement=at;const Wi=ot?"carousel-item-start":"carousel-item-end",Ui=ot?"carousel-item-next":"carousel-item-prev";at.classList.add(Ui),Q(at),we.classList.add(Wi),at.classList.add(Wi),this._queueCallback(()=>{at.classList.remove(Wi,Ui),at.classList.add(qa),we.classList.remove(qa,Ui,Wi),this._isSliding=!1,ii(Pr)},we,this._isAnimated()),Si&&this.cycle()}_isAnimated(){return this._element.classList.contains("slide")}_getActive(){return zt.findOne(zh,this._element)}_getItems(){return zt.find(Vc,this._element)}_clearInterval(){this._interval&&(clearInterval(this._interval),this._interval=null)}_directionToOrder(z){return be()?z===Us?$n:Kn:z===Us?Kn:$n}_orderToDirection(z){return be()?z===$n?Us:Qs:z===$n?Qs:Us}static jQueryInterface(z){return this.each(function(){const ee=Xa.getOrCreateInstance(this,z);
3389if(typeof z!="number"){if(typeof z=="string"){if(ee[z]===void 0||z.startsWith("_")||z==="constructor")throw new TypeError(`No method named "${z}"`);ee[z]()}}else ee.to(z)})}}Ue.on(document,Ss,"[data-bs-slide], [data-bs-slide-to]",function(ce){const z=zt.getElementFromSelector(this);if(!z||!z.classList.contains(ga))return;ce.preventDefault();const ee=Xa.getOrCreateInstance(z),we=this.getAttribute("data-bs-slide-to");return we?(ee.to(we),void ee._maybeEnableCycle()):On.getDataAttribute(this,"slide")==="next"?(ee.next(),void ee._maybeEnableCycle()):(ee.prev(),void ee._maybeEnableCycle())}),Ue.on(window,El,()=>{const ce=zt.find('[data-bs-ride="carousel"]');for(const z of ce)Xa.getOrCreateInstance(z)}),ve(Xa);const Qe=".bs.collapse",X=`show${Qe}`,ie=`shown${Qe}`,ge=`hide${Qe}`,Ie=`hidden${Qe}`,Ce=`click${Qe}.data-api`,De="show",ke="collapse",Le="collapsing",Ze=`:scope .${ke} .${ke}`,rt='[data-bs-toggle="collapse"]',He={parent:null,toggle:!0},Lt={parent:"(null|element)",toggle:"boolean"};class Ht extends Hi{constructor(z,ee){super(z,ee),this._isTransitioning=!1,this._triggerArray=[];const we=zt.find(rt);for(const ot of we){const at=zt.getSelectorFromElement(ot),Ot=zt.find(at).filter(ii=>ii===this._element);at!==null&&Ot.length&&this._triggerArray.push(ot)}this._initializeChildren(),this._config.parent||this._addAriaAndCollapsedClass(this._triggerArray,this._isShown()),this._config.toggle&&this.toggle()}static get Default(){return He}static get DefaultType(){return Lt}static get NAME(){return"collapse"}toggle(){this._isShown()?this.hide():this.show()}show(){if(this._isTransitioning||this._isShown())return;let z=[];if(this._config.parent&&(z=this._getFirstLevelChildren(".collapse.show, .collapse.collapsing").filter(ot=>ot!==this._element).map(ot=>Ht.getOrCreateInstance(ot,{toggle:!1}))),z.length&&z[0]._isTransitioning||Ue.trigger(this._element,X).defaultPrevented)return;for(const ot of z)ot.hide();const ee=this._getDimension();this._element.classList.remove(ke),this._element.classList.add(Le),this._element.style[ee]=0,this._addAriaAndCollapsedClass(this._triggerArray,!0),this._isTransitioning=!0;const we=`scroll${ee[0].toUpperCase()+ee.slice(1)}`;this._queueCallback(()=>{this._isTransitioning=!1,this._element.classList.remove(Le),this._element.classList.add(ke,De),this._element.style[ee]="",Ue.trigger(this._element,ie)},this._element,!0),this._element.style[ee]=`${this._element[we]}px`}hide(){if(this._isTransitioning||!this._isShown()||Ue.trigger(this._element,ge).defaultPrevented)return;const z=this._getDimension();this._element.style[z]=`${this._element.getBoundingClientRect()[z]}px`,Q(this._element),this._element.classList.add(Le),this._element.classList.remove(ke,De);for(const ee of this._triggerArray){const we=zt.getElementFromSelector(ee);we&&!this._isShown(we)&&this._addAriaAndCollapsedClass([ee],!1)}this._isTransitioning=!0,this._element.style[z]="",this._queueCallback(()=>{this._isTransitioning=!1,this._element.classList.remove(Le),this._element.classList.add(ke),Ue.trigger(this._element,Ie)},this._element,!0)}_isShown(z=this._element){return z.classList.contains(De)}_configAfterMerge(z){return z.toggle=!!z.toggle,z.parent=A(z.parent),z}_getDimension(){return this._element.classList.contains("collapse-horizontal")?"width":"height"}_initializeChildren(){if(!this._config.parent)return;const z=this._getFirstLevelChildren(rt);for(const ee of z){const we=zt.getElementFromSelector(ee);we&&this._addAriaAndCollapsedClass([ee],this._isShown(we))}}_getFirstLevelChildren(z){const ee=zt.find(Ze,this._config.parent);return zt.find(z,this._config.parent).filter(we=>!ee.includes(we))}_addAriaAndCollapsedClass(z,ee){if(z.length)for(const we of z)we.classList.toggle("collapsed",!ee),we.setAttribute("aria-expanded",ee)}static jQueryInterface(z){const ee={};return typeof z=="string"&&/show|hide/.test(z)&&(ee.toggle=!1),this.each(function(){const we=Ht.getOrCreateInstance(this,ee);
3389if(typeof z=="string"){if(we[z]===void 0)throw new TypeError(`No method named "${z}"`);we[z]()}})}}Ue.on(document,Ce,rt,function(ce){(ce.target.tagName==="A"||ce.delegateTarget&&ce.delegateTarget.tagName==="A")&&ce.preventDefault();for(const z of zt.getMultipleElementsFromSelector(this))Ht.getOrCreateInstance(z,{toggle:!1}).toggle()}),ve(Ht);var qt="top",xi="bottom",Pi="right",Ri="left",Qi="auto",hs=[qt,xi,Pi,Ri],Yi="start",jn="end",Tn="clippingParents",Jn="viewport",Gn="popper",Hs="reference",ir=hs.reduce(function(ce,z){return ce.concat([z+"-"+Yi,z+"-"+jn])},[]),hr=[].concat(hs,[Qi]).reduce(function(ce,z){return ce.concat([z,z+"-"+Yi,z+"-"+jn])},[]),Dr="beforeRead",Ia="read",Gr="afterRead",Wr="beforeMain",Tr="main",Fr="afterMain",_a="beforeWrite",Al="write",$c="afterWrite",ac=[Dr,Ia,Gr,Wr,Tr,Fr,_a,Al,$c];function Vo(ce){return ce?(ce.nodeName||"").toLowerCase():null}function Jr(ce){if(ce==null)return window;if(ce.toString()!=="[object Window]"){var z=ce.ownerDocument;return z&&z.defaultView||window}return ce}function $o(ce){return ce instanceof Jr(ce).Element||ce instanceof Element}function co(ce){return ce instanceof Jr(ce).HTMLElement||ce instanceof HTMLElement}function Iu(ce){return typeof ShadowRoot<"u"&&(ce instanceof Jr(ce).ShadowRoot||ce instanceof ShadowRoot)}const jo={name:"applyStyles",enabled:!0,phase:"write",fn:function(ce){var z=ce.state;Object.keys(z.elements).forEach(function(ee){var we=z.styles[ee]||{},ot=z.attributes[ee]||{},at=z.elements[ee];co(at)&&Vo(at)&&(Object.assign(at.style,we),Object.keys(ot).forEach(function(Ot){var ii=ot[Ot];ii===!1?at.removeAttribute(Ot):at.setAttribute(Ot,ii===!0?"":ii)}))})},effect:function(ce){var z=ce.state,ee={popper:{position:z.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(z.elements.popper.style,ee.popper),z.styles=ee,z.elements.arrow&&Object.assign(z.elements.arrow.style,ee.arrow),function(){Object.keys(z.elements).forEach(function(we){var ot=z.elements[we],at=z.attributes[we]||{},Ot=Object.keys(z.styles.hasOwnProperty(we)?z.styles[we]:ee[we]).reduce(function(ii,Si){return ii[Si]="",ii},{});co(ot)&&Vo(ot)&&(Object.assign(ot.style,Ot),Object.keys(at).forEach(function(ii){ot.removeAttribute(ii)}))})}},requires:["computeStyles"]};function Yo(ce){return ce.split("-")[0]}var kr=Math.max,Po=Math.min,Do=Math.round;function Uo(){var ce=navigator.userAgentData;return ce!=null&&ce.brands&&Array.isArray(ce.brands)?ce.brands.map(function(z){return z.brand+"/"+z.version}).join(" "):navigator.userAgent}function Ma(){return!/^((?!chrome|android).)*safari/i.test(Uo())}function Qr(ce,z,ee){z===void 0&&(z=!1),ee===void 0&&(ee=!1);var we=ce.getBoundingClientRect(),ot=1,at=1;z&&co(ce)&&(ot=ce.offsetWidth>0&&Do(we.width)/ce.offsetWidth||1,at=ce.offsetHeight>0&&Do(we.height)/ce.offsetHeight||1);var Ot=($o(ce)?Jr(ce):window).visualViewport,ii=!Ma()&&ee,Si=(we.left+(ii&&Ot?Ot.offsetLeft:0))/ot,Wi=(we.top+(ii&&Ot?Ot.offsetTop:0))/at,Ui=we.width/ot,$i=we.height/at;return{width:Ui,height:$i,top:Wi,right:Si+Ui,bottom:Wi+$i,left:Si,x:Si,y:Wi}}function lc(ce){var z=Qr(ce),ee=ce.offsetWidth,we=ce.offsetHeight;return Math.abs(z.width-ee)<=1&&(ee=z.width),Math.abs(z.height-we)<=1&&(we=z.height),{x:ce.offsetLeft,y:ce.offsetTop,width:ee,height:we}}function Fh(ce,z){var ee=z.getRootNode&&z.getRootNode();if(ce.contains(z))return!0;if(ee&&Iu(ee)){var we=z;do{if(we&&ce.isSameNode(we))return!0;we=we.parentNode||we.host}while(we)}return!1}function eo(ce){return Jr(ce).getComputedStyle(ce)}function Mu(ce){return["table","td","th"].indexOf(Vo(ce))>=0}function Pa(ce){return(($o(ce)?ce.ownerDocument:ce.document)||window.document).documentElement}function Cl(ce){return Vo(ce)==="html"?ce:ce.assignedSlot||ce.parentNode||(Iu(ce)?ce.host:null)||Pa(ce)}function to(ce){return co(ce)&&eo(ce).position!=="fixed"?ce.offsetParent:null}function Il(ce){for(var z=Jr(ce),ee=to(ce);ee&&Mu(ee)&&eo(ee).position==="static";)ee=to(ee);return ee&&(Vo(ee)==="html"||Vo(ee)==="body"&&eo(ee).position==="static")?z:ee||function(we){var ot=/firefox/i.test(Uo());if(/Trident/i.test(Uo())&&co(we)&&eo(we).position==="fixed")return null;var at=Cl(we);for(Iu(at)&&(at=at.host);co(at)&&["html","body"].indexOf(Vo(at))<0;){var Ot=eo(at);if(Ot.transform!=="none"||Ot.perspective!=="none"||Ot.contain==="paint"||["transform","perspective"].indexOf(Ot.willChange)!==-1||ot&&Ot.willChange==="filter"||ot&&Ot.filter&&Ot.filter!=="none")return at;at=at.parentNode}return null}(ce)||z}function jc(ce){return["top","bottom"].indexOf(ce)>=0?"x":"y"}function Da(ce,z,ee){return kr(ce,Po(z,ee))}function hf(ce){return Object.assign({},{top:0,right:0,bottom:0,left:0},ce)}function Pu(ce,z){return z.reduce(function(ee,we){return ee[we]=ce,ee},{})}const Du={name:"arrow",enabled:!0,phase:"main",fn:function(ce){var z,ee=ce.state,we=ce.name,ot=ce.options,at=ee.elements.arrow,Ot=ee.modifiersData.popperOffsets,ii=Yo(ee.placement),Si=jc(ii),Wi=[Ri,Pi].indexOf(ii)>=0?"height":"width";if(at&&Ot){var Ui=function(gs,qs){return hf(typeof(gs=typeof gs=="function"?gs(Object.assign({},qs.rects,{placement:qs.placement})):gs)!="number"?gs:Pu(gs,hs))}(ot.padding,ee),$i=lc(at),xn=Si==="y"?qt:Ri,wn=Si==="y"?xi:Pi,kn=ee.rects.reference[Wi]+ee.rects.reference[Si]-Ot[Si]-ee.rects.popper[Wi],Ln=Ot[Si]-ee.rects.reference[Si],Fn=Il(at),Ns=Fn?Si==="y"?Fn.clientHeight||0:Fn.clientWidth||0:0,Gs=kn/2-Ln/2,os=Ui[xn],As=Ns-$i[Wi]-Ui[wn],Bn=Ns/2-$i[Wi]/2+Gs,ms=Da(os,Bn,As),Ws=Si;ee.modifiersData[we]=((z={})[Ws]=ms,z.centerOffset=ms-Bn,z)}},effect:function(ce){var z=ce.state,ee=ce.options.element,we=ee===void 0?"[data-popper-arrow]":ee;we!=null&&(typeof we!="string"||(we=z.elements.popper.querySelector(we)))&&Fh(z.elements.popper,we)&&(z.elements.arrow=we)},requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function _n(ce){return ce.split("-")[1]}var Uc={top:"auto",right:"auto",bottom:"auto",left:"auto"};function cc(ce){var z,ee=ce.popper,we=ce.popperRect,ot=ce.placement,at=ce.variation,Ot=ce.offsets,ii=ce.position,Si=ce.gpuAcceleration,Wi=ce.adaptive,Ui=ce.roundOffsets,$i=ce.isFixed,xn=Ot.x,wn=xn===void 0?0:xn,kn=Ot.y,Ln=kn===void 0?0:kn,Fn=typeof Ui=="function"?Ui({x:wn,y:Ln}):{x:wn,y:Ln};wn=Fn.x,Ln=Fn.y;var Ns=Ot.hasOwnProperty("x"),Gs=Ot.hasOwnProperty("y"),os=Ri,As=qt,Bn=window;if(Wi){var ms=Il(ee),Ws="clientHeight",gs="clientWidth";ms===Jr(ee)&&eo(ms=Pa(ee)).position!=="static"&&ii==="absolute"&&(Ws="scrollHeight",gs="scrollWidth"),(ot===qt||(ot===Ri||ot===Pi)&&at===jn)&&(As=xi,Ln-=($i&&ms===Bn&&Bn.visualVie
3389wport?Bn.visualViewport.height:ms[Ws])-we.height,Ln*=Si?1:-1),ot!==Ri&&(ot!==qt&&ot!==xi||at!==jn)||(os=Pi,wn-=($i&&ms===Bn&&Bn.visualViewport?Bn.visualViewport.width:ms[gs])-we.width,wn*=Si?1:-1)}var qs,dr=Object.assign({position:ii},Wi&&Uc),_o=Ui===!0?function(yo,Sr){var so=yo.x,vo=yo.y,nr=Sr.devicePixelRatio||1;return{x:Do(so*nr)/nr||0,y:Do(vo*nr)/nr||0}}({x:wn,y:Ln},Jr(ee)):{x:wn,y:Ln};return wn=_o.x,Ln=_o.y,Si?Object.assign({},dr,((qs={})[As]=Gs?"0":"",qs[os]=Ns?"0":"",qs.transform=(Bn.devicePixelRatio||1)<=1?"translate("+wn+"px, "+Ln+"px)":"translate3d("+wn+"px, "+Ln+"px, 0)",qs)):Object.assign({},dr,((z={})[As]=Gs?Ln+"px":"",z[os]=Ns?wn+"px":"",z.transform="",z))}const df={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:function(ce){var z=ce.state,ee=ce.options,we=ee.gpuAcceleration,ot=we===void 0||we,at=ee.adaptive,Ot=at===void 0||at,ii=ee.roundOffsets,Si=ii===void 0||ii,Wi={placement:Yo(z.placement),variation:_n(z.placement),popper:z.elements.popper,popperRect:z.rects.popper,gpuAcceleration:ot,isFixed:z.options.strategy==="fixed"};z.modifiersData.popperOffsets!=null&&(z.styles.popper=Object.assign({},z.styles.popper,cc(Object.assign({},Wi,{offsets:z.modifiersData.popperOffsets,position:z.options.strategy,adaptive:Ot,roundOffsets:Si})))),z.modifiersData.arrow!=null&&(z.styles.arrow=Object.assign({},z.styles.arrow,cc(Object.assign({},Wi,{offsets:z.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:Si})))),z.attributes.popper=Object.assign({},z.attributes.popper,{"data-popper-placement":z.placement})},data:{}};var ku={passive:!0};const Ya={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:function(ce){var z=ce.state,ee=ce.instance,we=ce.options,ot=we.scroll,at=ot===void 0||ot,Ot=we.resize,ii=Ot===void 0||Ot,Si=Jr(z.elements.popper),Wi=[].concat(z.scrollParents.reference,z.scrollParents.popper);return at&&Wi.forEach(function(Ui){Ui.addEventListener("scroll",ee.update,ku)}),ii&&Si.addEventListener("resize",ee.update,ku),function(){at&&Wi.forEach(function(Ui){Ui.removeEventListener("scroll",ee.update,ku)}),ii&&Si.removeEventListener("resize",ee.update,ku)}},data:{}};var Ml={left:"right",right:"left",bottom:"top",top:"bottom"};function Ka(ce){return ce.replace(/left|right|bottom|top/g,function(z){return Ml[z]})}var Bp={start:"end",end:"start"};function Bh(ce){return ce.replace(/start|end/g,function(z){return Bp[z]})}function Ja(ce){var z=Jr(ce);return{scrollLeft:z.pageXOffset,scrollTop:z.pageYOffset}}function uc(ce){return Qr(Pa(ce)).left+Ja(ce).scrollLeft}function Pl(ce){var z=eo(ce),ee=z.overflow,we=z.overflowX,ot=z.overflowY;return/auto|scroll|overlay|hidden/.test(ee+ot+we)}function Lu(ce){return["html","body","#document"].indexOf(Vo(ce))>=0?ce.ownerDocument.body:co(ce)&&Pl(ce)?ce:Lu(Cl(ce))}function hc(ce,z){var ee;z===void 0&&(z=[]);var we=Lu(ce),ot=we===((ee=ce.ownerDocument)==null?void 0:ee.body),at=Jr(we),Ot=ot?[at].concat(at.visualViewport||[],Pl(we)?we:[]):we,ii=z.concat(Ot);return ot?ii:ii.concat(hc(Cl(Ot)))}function uo(ce){return Object.assign({},ce,{left:ce.x,top:ce.y,right:ce.x+ce.width,bottom:ce.y+ce.height})}function Qa(ce,z,ee){return z===Jn?uo(function(we,ot){var at=Jr(we),Ot=Pa(we),ii=at.visualViewport,Si=Ot.clientWidth,Wi=Ot.clientHeight,Ui=0,$i=0;if(ii){Si=ii.width,Wi=ii.height;var xn=Ma();(xn||!xn&&ot==="fixed")&&(Ui=ii.offsetLeft,$i=ii.offsetTop)}return{width:Si,height:Wi,x:Ui+uc(we),y:$i}}(ce,ee)):$o(z)?function(we,ot){var at=Qr(we,!1,ot==="fixed");return at.top=at.top+we.clientTop,at.left=at.left+we.clientLeft,at.bottom=at.top+we.clientHeight,at.right=at.left+we.clientWidth,at.width=we.clientWidth,at.height=we.clientHeight,at.x=at.left,at.y=at.top,at}(z,ee):uo(function(we){var ot,at=Pa(we),Ot=Ja(we),ii=(ot=we.ownerDocument)==null?void 0:ot.body,Si=kr(at.scrollWidth,at.clientWidth,ii?ii.scrollWidth:0,ii?ii.clientWidth:0),Wi=kr(at.scrollHeight,at.clientHeight,ii?ii.scrollHeight:0,ii?ii.clientHeight:0),Ui=-Ot.scrollLeft+uc(we),$i=-Ot.scrollTop;return eo(ii||at).direction==="rtl"&&(Ui+=kr(at.clientWidth,ii?ii.clientWidth:0)-Si),{width:Si,height:Wi,x:Ui,y:$i}}(Pa(ce)))}function Nh(ce){var z,ee=ce.reference,we=ce.element,ot=ce.placement,at=ot?Yo(ot):null,Ot=ot?_n(ot):null,ii=ee.x+ee.width/2-we.width/2,Si=ee.y+ee.height/2-we.height/2;switch(at){case qt:z={x:ii,y:ee.y-we.height};break;case xi:z={x:ii,y:ee.y+ee.height};break;case Pi:z={x:ee.x+ee.width,y:Si};break;case Ri:z={x:ee.x-we.width,y:Si};break;default:z={x:ee.x,y:ee.y}}var Wi=at?jc(at):null;if(Wi!=null){var Ui=Wi==="y"?"height":"width";switch(Ot){case Yi:z[Wi]=z[Wi]-(ee[Ui]/2-we[Ui]/2);break;case jn:z[Wi]=z[Wi]+(ee[Ui]/2-we[Ui]/2)}
3389}return z}function Dl(ce,z){z===void 0&&(z={});var ee=z,we=ee.placement,ot=we===void 0?ce.placement:we,at=ee.strategy,Ot=at===void 0?ce.strategy:at,ii=ee.boundary,Si=ii===void 0?Tn:ii,Wi=ee.rootBoundary,Ui=Wi===void 0?Jn:Wi,$i=ee.elementContext,xn=$i===void 0?Gn:$i,wn=ee.altBoundary,kn=wn!==void 0&&wn,Ln=ee.padding,Fn=Ln===void 0?0:Ln,Ns=hf(typeof Fn!="number"?Fn:Pu(Fn,hs)),Gs=xn===Gn?Hs:Gn,os=ce.rects.popper,As=ce.elements[kn?Gs:xn],Bn=function(Sr,so,vo,nr){var Wo=so==="clippingParents"?function(Os){var Nr=hc(Cl(Os)),Vt=["absolute","fixed"].indexOf(eo(Os).position)>=0&&co(Os)?Il(Os):Os;return $o(Vt)?Nr.filter(function(na){return $o(na)&&Fh(na,Vt)&&Vo(na)!=="body"}):[]}(Sr):[].concat(so),ia=[].concat(Wo,[vo]),rl=ia[0],Lr=ia.reduce(function(Os,Nr){var Vt=Qa(Sr,Nr,nr);return Os.top=kr(Vt.top,Os.top),Os.right=Po(Vt.right,Os.right),Os.bottom=Po(Vt.bottom,Os.bottom),Os.left=kr(Vt.left,Os.left),Os},Qa(Sr,rl,nr));return Lr.width=Lr.right-Lr.left,Lr.height=Lr.bottom-Lr.top,Lr.x=Lr.left,Lr.y=Lr.top,Lr}($o(As)?As:As.contextElement||Pa(ce.elements.popper),Si,Ui,Ot),ms=Qr(ce.elements.reference),Ws=Nh({reference:ms,element:os,strategy:"absolute",placement:ot}),gs=uo(Object.assign({},os,Ws)),qs=xn===Gn?gs:ms,dr={top:Bn.top-qs.top+Ns.top,bottom:qs.bottom-Bn.bottom+Ns.bottom,left:Bn.left-qs.left+Ns.left,right:qs.right-Bn.right+Ns.right},_o=ce.modifiersData.offset;if(xn===Gn&&_o){var yo=_o[ot];Object.keys(dr).forEach(function(Sr){var so=[Pi,xi].indexOf(Sr)>=0?1:-1,vo=[qt,xi].indexOf(Sr)>=0?"y":"x";dr[Sr]+=yo[vo]*so})}return dr}function Vh(ce,z){z===void 0&&(z={});var ee=z,we=ee.placement,ot=ee.boundary,at=ee.rootBoundary,Ot=ee.padding,ii=ee.flipVariations,Si=ee.allowedAutoPlacements,Wi=Si===void 0?hr:Si,Ui=_n(we),$i=Ui?ii?ir:ir.filter(function(kn){return _n(kn)===Ui}):hs,xn=$i.filter(function(kn){return Wi.indexOf(kn)>=0});xn.length===0&&(xn=$i);var wn=xn.reduce(function(kn,Ln){return kn[Ln]=Dl(ce,{placement:Ln,boundary:ot,rootBoundary:at,padding:Ot})[Yo(Ln)],kn},{});return Object.keys(wn).sort(function(kn,Ln){return wn[kn]-wn[Ln]})}const kl={name:"flip",enabled:!0,phase:"main",fn:function(ce){var z=ce.state,ee=ce.options,we=ce.name;if(!z.modifiersData[we]._skip){for(var ot=ee.mainAxis,at=ot===void 0||ot,Ot=ee.altAxis,ii=Ot===void 0||Ot,Si=ee.fallbackPlacements,Wi=ee.padding,Ui=ee.boundary,$i=ee.rootBoundary,xn=ee.altBoundary,wn=ee.flipVariations,kn=wn===void 0||wn,Ln=ee.allowedAutoPlacements,Fn=z.options.placement,Ns=Yo(Fn),Gs=Si||(Ns!==Fn&&kn?function(Os){if(Yo(Os)===Qi)return[];var Nr=Ka(Os);return[Bh(Os),Nr,Bh(Nr)]}(Fn):[Ka(Fn)]),os=[Fn].concat(Gs).reduce(function(Os,Nr){return Os.concat(Yo(Nr)===Qi?Vh(z,{placement:Nr,boundary:Ui,rootBoundary:$i,padding:Wi,flipVariations:kn,allowedAutoPlacements:Ln}):Nr)},[]),As=z.rects.reference,Bn=z.rects.popper,ms=new Map,Ws=!0,gs=os[0],qs=0;qs<os.length;qs++){var dr=os[qs],_o=Yo(dr),yo=_n(dr)===Yi,Sr=[qt,xi].indexOf(_o)>=0,so=Sr?"width":"height",vo=Dl(z,{placement:dr,boundary:Ui,rootBoundary:$i,altBoundary:xn,padding:Wi}),nr=Sr?yo?Pi:Ri:yo?xi:qt;As[so]>Bn[so]&&(nr=Ka(nr));var Wo=Ka(nr),ia=[];if(at&&ia.push(vo[_o]<=0),ii&&ia.push(vo[nr]<=0,vo[Wo]<=0),ia.every(function(Os){return Os})){gs=dr,Ws=!1;break}ms.set(dr,ia)}if(Ws)for(var rl=function(Os){var Nr=os.find(function(Vt){var na=ms.get(Vt);if(na)return na.slice(0,Os).every(function(Ba){return Ba})});if(Nr)return gs=Nr,"break"},Lr=kn?3:1;Lr>0&&rl(Lr)!=="break";Lr--);z.placement!==gs&&(z.modifiersData[we]._skip=!0,z.placement=gs,z.reset=!0)}},requiresIfExists:["offset"],data:{_skip:!1}};function To(ce,z,ee){return ee===void 0&&(ee={x:0,y:0}),{top:ce.top-z.height-ee.y,right:ce.right-z.width+ee.x,bottom:ce.bottom-z.height+ee.y,left:ce.left-z.width-ee.x}}function $h(ce){return[qt,Pi,xi,Ri].some(function(z){return ce[z]>=0})}const Ru={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:function(ce){var z=ce.state,ee=ce.name,we=z.rects.reference,ot=z.rects.popper,at=z.modifiersData.preventOverflow,Ot=Dl(z,{elementContext:"reference"}),ii=Dl(z,{altBoundary:!0}),Si=To(Ot,we),Wi=To(ii,ot,at),Ui=$h(Si),$i=$h(Wi);z.modifiersData[ee]={referenceClippingOffsets:Si,popperEscapeOffsets:Wi,isReferenceHidden:Ui,hasPopperEscaped:$i},z.attributes.popper=Object.assign({},z.attributes.popper,{"data-popper-reference-hidden":Ui,"data-popper-escaped":$i})}},Hc={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:function(ce){var z=ce.state,ee=ce.options,we=ce.name,ot=ee.offset,at=ot===void 0?[0,0]:ot,Ot=hr.reduce(function(Ui,$i
3389){return Ui[$i]=function(xn,wn,kn){var Ln=Yo(xn),Fn=[Ri,qt].indexOf(Ln)>=0?-1:1,Ns=typeof kn=="function"?kn(Object.assign({},wn,{placement:xn})):kn,Gs=Ns[0],os=Ns[1];return Gs=Gs||0,os=(os||0)*Fn,[Ri,Pi].indexOf(Ln)>=0?{x:os,y:Gs}:{x:Gs,y:os}}($i,z.rects,at),Ui},{}),ii=Ot[z.placement],Si=ii.x,Wi=ii.y;z.modifiersData.popperOffsets!=null&&(z.modifiersData.popperOffsets.x+=Si,z.modifiersData.popperOffsets.y+=Wi),z.modifiersData[we]=Ot}},Cn={name:"popperOffsets",enabled:!0,phase:"read",fn:function(ce){var z=ce.state,ee=ce.name;z.modifiersData[ee]=Nh({reference:z.rects.reference,element:z.rects.popper,strategy:"absolute",placement:z.placement})},data:{}},ff={name:"preventOverflow",enabled:!0,phase:"main",fn:function(ce){var z=ce.state,ee=ce.options,we=ce.name,ot=ee.mainAxis,at=ot===void 0||ot,Ot=ee.altAxis,ii=Ot!==void 0&&Ot,Si=ee.boundary,Wi=ee.rootBoundary,Ui=ee.altBoundary,$i=ee.padding,xn=ee.tether,wn=xn===void 0||xn,kn=ee.tetherOffset,Ln=kn===void 0?0:kn,Fn=Dl(z,{boundary:Si,rootBoundary:Wi,padding:$i,altBoundary:Ui}),Ns=Yo(z.placement),Gs=_n(z.placement),os=!Gs,As=jc(Ns),Bn=As==="x"?"y":"x",ms=z.modifiersData.popperOffsets,Ws=z.rects.reference,gs=z.rects.popper,qs=typeof Ln=="function"?Ln(Object.assign({},z.rects,{placement:z.placement})):Ln,dr=typeof qs=="number"?{mainAxis:qs,altAxis:qs}:Object.assign({mainAxis:0,altAxis:0},qs),_o=z.modifiersData.offset?z.modifiersData.offset[z.placement]:null,yo={x:0,y:0};if(ms){if(at){var Sr,so=As==="y"?qt:Ri,vo=As==="y"?xi:Pi,nr=As==="y"?"height":"width",Wo=ms[As],ia=Wo+Fn[so],rl=Wo-Fn[vo],Lr=wn?-gs[nr]/2:0,Os=Gs===Yi?Ws[nr]:gs[nr],Nr=Gs===Yi?-gs[nr]:-Ws[nr],Vt=z.elements.arrow,na=wn&&Vt?lc(Vt):{width:0,height:0},Ba=z.modifiersData["arrow#persistent"]?z.modifiersData["arrow#persistent"].padding:{top:0,right:0,bottom:0,left:0},ol=Ba[so],al=Ba[vo],mi=Da(0,Ws[nr],na[nr]),Mf=os?Ws[nr]/2-Lr-mi-ol-dr.mainAxis:Os-mi-ol-dr.mainAxis,kg=os?-Ws[nr]/2+Lr+mi+al+dr.mainAxis:Nr+mi+al+dr.mainAxis,ld=z.elements.arrow&&Il(z.elements.arrow),Yu=ld?As==="y"?ld.clientTop||0:ld.clientLeft||0:0,Pf=(Sr=_o==null?void 0:_o[As])!=null?Sr:0,Lg=Wo+kg-Pf,Df=Da(wn?Po(ia,Wo+Mf-Pf-Yu):ia,Wo,wn?kr(rl,Lg):rl);ms[As]=Df,yo[As]=Df-Wo}if(ii){var rm,Rg=As==="x"?qt:Ri,kf=As==="x"?xi:Pi,ll=ms[Bn],nu=Bn==="y"?"height":"width",cd=ll+Fn[Rg],Ao=ll-Fn[kf],Na=[qt,Ri].indexOf(Ns)!==-1,Ul=(rm=_o==null?void 0:_o[Bn])!=null?rm:0,Ku=Na?cd:ll-Ws[nu]-gs[nu]-Ul+dr.altAxis,Ju=Na?ll+Ws[nu]+gs[nu]-Ul-dr.altAxis:Ao,Sc=wn&&Na?function(om,sa,Un){var su=Da(om,sa,Un);return su>Un?Un:su}(Ku,ll,Ju):Da(wn?Ku:cd,ll,wn?Ju:Ao);ms[Bn]=Sc,yo[Bn]=Sc-ll}z.modifiersData[we]=yo}},requiresIfExists:["offset"]};function gi(ce,z,ee){ee===void 0&&(ee=!1);var we,ot,at=co(z),Ot=co(z)&&function($i){var xn=$i.getBoundingClientRect(),wn=Do(xn.width)/$i.offsetWidth||1,kn=Do(xn.height)/$i.offsetHeight||1;return wn!==1||kn!==1}(z),ii=Pa(z),Si=Qr(ce,Ot,ee),Wi={scrollLeft:0,scrollTop:0},Ui={x:0,y:0};
3389return(at||!at&&!ee)&&((Vo(z)!=="body"||Pl(ii))&&(Wi=(we=z)!==Jr(we)&&co(we)?{scrollLeft:(ot=we).scrollLeft,scrollTop:ot.scrollTop}:Ja(we)),co(z)?((Ui=Qr(z,!0)).x+=z.clientLeft,Ui.y+=z.clientTop):ii&&(Ui.x=uc(ii))),{x:Si.left+Wi.scrollLeft-Ui.x,y:Si.top+Wi.scrollTop-Ui.y,width:Si.width,height:Si.height}}function Np(ce){var z=new Map,ee=new Set,we=[];function ot(at){ee.add(at.name),[].concat(at.requires||[],at.requiresIfExists||[]).forEach(function(Ot){if(!ee.has(Ot)){var ii=z.get(Ot);ii&&ot(ii)}}),we.push(at)}return ce.forEach(function(at){z.set(at.name,at)}),ce.forEach(function(at){ee.has(at.name)||ot(at)}),we}var Ou={placement:"bottom",modifiers:[],strategy:"absolute"};function zu(){for(var ce=arguments.length,z=new Array(ce),ee=0;ee<ce;ee++)z[ee]=arguments[ee];return!z.some(function(we){return!(we&&typeof we.getBoundingClientRect=="function")})}function Ll(ce){ce===void 0&&(ce={});var z=ce,ee=z.defaultModifiers,we=ee===void 0?[]:ee,ot=z.defaultOptions,at=ot===void 0?Ou:ot;return function(Ot,ii,Si){Si===void 0&&(Si=at);var Wi,Ui,$i={placement:"bottom",orderedModifiers:[],options:Object.assign({},Ou,at),modifiersData:{},elements:{reference:Ot,popper:ii},attributes:{},styles:{}},xn=[],wn=!1,kn={state:$i,setOptions:function(Fn){var Ns=typeof Fn=="function"?Fn($i.options):Fn;Ln(),$i.options=Object.assign({},at,$i.options,Ns),$i.scrollParents={reference:$o(Ot)?hc(Ot):Ot.contextElement?hc(Ot.contextElement):[],popper:hc(ii)};var Gs,os,As=function(Bn){var ms=Np(Bn);return ac.reduce(function(Ws,gs){return Ws.concat(ms.filter(function(qs){return qs.phase===gs}))},[])}((Gs=[].concat(we,$i.options.modifiers),os=Gs.reduce(function(Bn,ms){var Ws=Bn[ms.name];return Bn[ms.name]=Ws?Object.assign({},Ws,ms,{options:Object.assign({},Ws.options,ms.options),data:Object.assign({},Ws.data,ms.data)}):ms,Bn},{}),Object.keys(os).map(function(Bn){return os[Bn]})));return $i.orderedModifiers=As.filter(function(Bn){return Bn.enabled}),$i.orderedModifiers.forEach(function(Bn){var ms=Bn.name,Ws=Bn.options,gs=Ws===void 0?{}:Ws,qs=Bn.effect;if(typeof qs=="function"){var dr=qs({state:$i,name:ms,instance:kn,options:gs});xn.push(dr||function(){})}}),kn.update()},forceUpdate:function(){if(!wn){var Fn=$i.elements,Ns=Fn.reference,Gs=Fn.popper;if(zu(Ns,Gs)){$i.rects={reference:gi(Ns,Il(Gs),$i.options.strategy==="fixed"),popper:lc(Gs)},$i.reset=!1,$i.placement=$i.options.placement,$i.orderedModifiers.forEach(function(qs){return $i.modifiersData[qs.name]=Object.assign({},qs.data)});for(var os=0;os<$i.orderedModifiers.length;os++)if($i.reset!==!0){var As=$i.orderedModifiers[os],Bn=As.fn,ms=As.options,Ws=ms===void 0?{}:ms,gs=As.name;typeof Bn=="function"&&($i=Bn({state:$i,options:Ws,name:gs,instance:kn})||$i)}else $i.reset=!1,os=-1}}},update:(Wi=function(){return new Promise(function(Fn){kn.forceUpdate(),Fn($i)})},function(){return Ui||(Ui=new Promise(function(Fn){Promise.resolve().then(function(){Ui=void 0,Fn(Wi())})})),Ui}),destroy:function(){Ln(),wn=!0}};if(!zu(Ot,ii))return kn;function Ln(){xn.forEach(function(Fn){return Fn()}),xn=[]}return kn.setOptions(Si).then(function(Fn){!wn&&Si.onFirstUpdate&&Si.onFirstUpdate(Fn)}),kn}
vendor: 2,153 bytes, line 3389
3389}var Ko=Ll(),dc=Ll({defaultModifiers:[Ya,Cn,df,jo]}),ka=Ll({defaultModifiers:[Ya,Cn,df,jo,Hc,kl,ff,Du,Ru]});const ui=Object.freeze(Object.defineProperty({__proto__:null,afterMain:Fr,afterRead:Gr,afterWrite:$c,applyStyles:jo,arrow:Du,auto:Qi,basePlacements:hs,beforeMain:Wr,beforeRead:Dr,beforeWrite:_a,bottom:xi,clippingParents:Tn,computeStyles:df,createPopper:ka,createPopperBase:Ko,createPopperLite:dc,detectOverflow:Dl,end:jn,eventListeners:Ya,flip:kl,hide:Ru,left:Ri,main:Tr,modifierPhases:ac,offset:Hc,placements:hr,popper:Gn,popperGenerator:Ll,popperOffsets:Cn,preventOverflow:ff,read:Ia,reference:Hs,right:Pi,start:Yi,top:qt,variationPlacements:ir,viewport:Jn,write:Al},Symbol.toStringTag,{value:"Module"})),qn="dropdown",Sn=".bs.dropdown",io=".data-api",Rl="ArrowUp",zn="ArrowDown",fc=`hide${Sn}`,Fu=`hidden${Sn}`,Bu=`show${Sn}`,ho=`shown${Sn}`,or=`click${Sn}${io}`,Vp=`keydown${Sn}${io}`,Nu=`keyup${Sn}${io}`,Ol="show",Jo='[data-bs-toggle="dropdown"]:not(.disabled):not(:disabled)',zl=`${Jo}.${Ol}`,pc=".dropdown-menu",fo=be()?"top-end":"top-start",ya=be()?"top-start":"top-end",So=be()?"bottom-end":"bottom-start",$p=be()?"bottom-start":"bottom-end",Gc=be()?"left-start":"right-start",_r=be()?"right-start":"left-start",po={autoClose:!0,boundary:"clippingParents",display:"dynamic",offset:[0,2],popperConfig:null,reference:"toggle"},en={autoClose:"(boolean|string)",boundary:"(string|element)",display:"string",offset:"(array|string|function)",popperConfig:"(null|object|function)",reference:"(string|element|object)"};class Gt extends Hi{constructor(z,ee){super(z,ee),this._popper=null,this._parent=this._element.parentNode,this._menu=zt.next(this._element,pc)[0]||zt.prev(this._element,pc)[0]||zt.findOne(pc,this._parent),this._inNavbar=this._detectNavbar()}static get Default(){return po}static get DefaultType(){return en}static get NAME(){return qn}toggle(){return this._isShown()?this.hide():this.show()}show(){if(R(this._element)||this._isShown())return;const z={relatedTarget:this._element};if(!Ue.trigger(this._element,Bu,z).defaultPrevented){if(this._createPopper(),"ontouchstart"in document.documentElement&&!this._parent.closest(".
3389navbar-nav"))for(const ee of[].concat(...document.body.children))Ue.on(ee,"mouseover",j);this._element.focus(),this._element.setAttribute("aria-expanded",!0),this._menu.classList.add(Ol),this._element.classList.add(Ol),Ue.trigger(this._element,ho,z)}}hide(){if(R(this._element)||!this._isShown())return;const z={relatedTarget:this._element};this._completeHide(z)}dispose(){this._popper&&this._popper.destroy(),super.dispose()}update(){this._inNavbar=this._detectNavbar(),this._popper&&this._popper.update()}_completeHide(z){if(!Ue.trigger(this._element,fc,z).defaultPrevented){if("ontouchstart"in document.documentElement)for(const ee of[].concat(...document.body.children))Ue.off(ee,"mouseover",j);this._popper&&this._popper.destroy(),this._menu.classList.remove(Ol),this._element.classList.remove(Ol),this._element.setAttribute("aria-expanded","false"),On.removeDataAttribute(this._menu,"popper"),Ue.trigger(this._element,Fu,z)}}_getConfig(z){if(typeof(z=super._getConfig(z)).reference=="object"&&!s(z.reference)&&typeof z.reference.getBoundingClientRect!="function")throw new TypeError(`${qn.toUpperCase()}: Option "reference" provided type "object" without a required "getBoundingClientRect" method.`);return z}_createPopper(){if(ui===void 0)throw new TypeError("Bootstrap's dropdowns require Popper (https://popper.js.org)");let z=this._element;this._config.reference==="parent"?z=this._parent:s(this._config.reference)?z=A(this._config.reference):typeof this._config.reference=="object"&&(z=this._config.reference);const ee=this._getPopperConfig();this._popper=ka(z,this._menu,ee)}_isShown(){return this._menu.classList.contains(Ol)}_getPlacement(){const z=this._parent;if(z.classList.contains("dropend"))return Gc;if(z.classList.contains("dropstart"))return _r;if(z.classList.contains("dropup-center"))return"top";if(z.classList.contains("dropdown-center"))return"bottom";const ee=getComputedStyle(this._menu).getPropertyValue("--bs-position").trim()==="end";return z.classList.contains("dropup")?ee?ya:fo:ee?$p:So}
3389_detectNavbar(){return this._element.closest(".navbar")!==null}_getOffset(){const{offset:z}=this._config;return typeof z=="string"?z.split(",").map(ee=>Number.parseInt(ee,10)):typeof z=="function"?ee=>z(ee,this._element):z}_getPopperConfig(){const z={placement:this._getPlacement(),modifiers:[{name:"preventOverflow",options:{boundary:this._config.boundary}},{name:"offset",options:{offset:this._getOffset()}}]};return(this._inNavbar||this._config.display==="static")&&(On.setDataAttribute(this._menu,"popper","static"),z.modifiers=[{name:"applyStyles",enabled:!1}]),{...z,...Ee(this._config.popperConfig,[z])}}_selectMenuItem({key:z,target:ee}){const we=zt.find(".dropdown-menu .dropdown-item:not(.disabled):not(:disabled)",this._menu).filter(ot=>P(ot));we.length&&Ve(we,ee,z===zn,!we.includes(ee)).focus()}static jQueryInterface(z){return this.each(function(){const ee=Gt.getOrCreateInstance(this,z);if(typeof z=="string"){if(ee[z]===void 0)throw new TypeError(`No method named "${z}"`);ee[z]()}})}static clearMenus(z){if(z.button===2||z.type==="keyup"&&z.key!=="Tab")return;const ee=zt.find(zl);for(const we of ee){const ot=Gt.getInstance(we);if(!ot||ot._config.autoClose===!1)continue;const at=z.composedPath(),Ot=at.includes(ot._menu);if(at.includes(ot._element)||ot._config.autoClose==="inside"&&!Ot||ot._config.autoClose==="outside"&&Ot||ot._menu.contains(z.target)&&(z.type==="keyup"&&z.key==="Tab"||/input|select|option|textarea|form/i.test(z.target.tagName)))continue;const ii={relatedTarget:ot._element};z.type==="click"&&(ii.clickEvent=z),ot._completeHide(ii)}}static dataApiKeydownHandler(z){const ee=/input|textarea/i.test(z.target.tagName),we=z.key==="Escape",ot=[Rl,zn].includes(z.key);if(!ot&&!we||ee&&!we)return;z.preventDefault();const at=this.matches(Jo)?this:zt.prev(this,Jo)[0]||zt.next(this,Jo)[0]||zt.findOne(Jo,z.delegateTarget.parentNode),Ot=Gt.getOrCreateInstance(at);if(ot)return z.stopPropagation(),Ot.show(),void Ot._selectMenuItem(z);Ot._isShown()&&(z.stopPropagation(),Ot.hide(),at.focus())}}Ue.on(document,Vp,Jo,Gt.dataApiKeydownHandler),Ue.on(document,Vp,pc,Gt.dataApiKeydownHandler),Ue.on(document,or,Gt.clearMenus),Ue.on(document,Nu,Gt.clearMenus),Ue.on(document,or,Jo,function(ce){ce.preventDefault(),Gt.getOrCreateInstance(this).toggle()}),ve(Gt);const Wc="backdrop",Ii="show",Fl=`mousedown.bs.${Wc}`,qc={className:"modal-backdrop",clickCallback:null,isAnimated:!1,isVisible:!0,rootElement:"body"},Di={className:"string",clickCallback:"(function|null)",isAnimated:"boolean",isVisible:"boolean",rootElement:"(element|string)"};class pf extends hn{constructor(z){super(),this._config=this._getConfig(z),this._isAppended=!1,this._element=null}static get Default(){return qc}static get DefaultType(){return Di}static get NAME(){return Wc}show(z){if(!this._config.isVisible)return void Ee(z);this._append();const ee=this._getElement();this._config.isAnimated&&Q(ee),ee.classList.add(Ii),this._emulateAnimation(()=>{Ee(z)})}hide(z){this._config.isVisible?(this._getElement().classList.remove(Ii),this._emulateAnimation(()=>{this.dispose(),Ee(z)})):Ee(z)}dispose(){this._isAppended&&(Ue.off(this._element,Fl),this._element.remove(),this._isAppended=!1)}_getElement(){if(!this._element){const z=document.createElement("div");z.className=this._config.className,this._config.isAnimated&&z.classList.add("fade"),this._element=z}return this._element}_configAfterMerge(z){return z.rootElement=A(z.rootElement),z}_append(){if(this._isAppended)return;const z=this._getElement();this._config.rootElement.append(z),Ue.on(z,Fl,()=>{Ee(this._config.clickCallback)}),this._isAppended=!0}_emulateAnimation(z){je(z,this._getElement(),this._config.isAnimated)}}const ko=".bs.focustrap",jp=`focusin${ko}`,jh=`keydown.tab${ko}`,qr="backward",mo={autofocus:!0,trapElement:null},Zc={autofocus:"boolean",trapElement:"element"};class el extends hn{constructor(z){super(),this._config=this._getConfig(z),this._isActive=!1,this._lastTabNavDirection=null}static get Default(){return mo}static get DefaultType(){return Zc}static get NAME(){return"focustrap"}activate(){this._isActive||(this._config.autofocus&&this._config.trapElement.focus(),Ue.off(document,ko),Ue.on(document,jp,z=>this._handleFocusin(z)),Ue.on(document,jh,z=>this._handleKeydown(z)),this._isActive=!0)}deactivate(){this._isActive&&(this._isActive=!1,Ue.off(document,ko))}_handleFocusin(z){const{trapElement:ee}=this._config;if(z.target===document||z.target===ee||ee.contains(z.target))return;
vendor: 5,457 bytes, line 3389
3389const we=zt.focusableChildren(ee);we.length===0?ee.focus():this._lastTabNavDirection===qr?we[we.length-1].focus():we[0].focus()}_handleKeydown(z){z.key==="Tab"&&(this._lastTabNavDirection=z.shiftKey?qr:"forward")}}const Bl=".fixed-top, .fixed-bottom, .is-fixed, .sticky-top",Nl=".sticky-top",Br="padding-right",Xc="margin-right";class mc{constructor(){this._element=document.body}getWidth(){const z=document.documentElement.clientWidth;return Math.abs(window.innerWidth-z)}hide(){const z=this.getWidth();this._disableOverFlow(),this._setElementAttributes(this._element,Br,ee=>ee+z),this._setElementAttributes(Bl,Br,ee=>ee+z),this._setElementAttributes(Nl,Xc,ee=>ee-z)}reset(){this._resetElementAttributes(this._element,"overflow"),this._resetElementAttributes(this._element,Br),this._resetElementAttributes(Bl,Br),this._resetElementAttributes(Nl,Xc)}isOverflowing(){return this.getWidth()>0}_disableOverFlow(){this._saveInitialAttribute(this._element,"overflow"),this._element.style.overflow="hidden"}_setElementAttributes(z,ee,we){const ot=this.getWidth();this._applyManipulationCallback(z,at=>{if(at!==this._element&&window.innerWidth>at.clientWidth+ot)return;this._saveInitialAttribute(at,ee);const Ot=window.getComputedStyle(at).getPropertyValue(ee);at.style.setProperty(ee,`${we(Number.parseFloat(Ot))}px`)})}_saveInitialAttribute(z,ee){const we=z.style.getPropertyValue(ee);we&&On.setDataAttribute(z,ee,we)}_resetElementAttributes(z,ee){this._applyManipulationCallback(z,we=>{const ot=On.getDataAttribute(we,ee);ot!==null?(On.removeDataAttribute(we,ee),we.style.setProperty(ee,ot)):we.style.removeProperty(ee)})}_applyManipulationCallback(z,ee){if(s(z))ee(z);else for(const we of zt.find(z,this._element))ee(we)}}const Qo=".bs.modal",tl=`hide${Qo}`,mf=`hidePrevented${Qo}`,va=`hidden${Qo}`,Uh=`show${Qo}`,Vl=`shown${Qo}`,Eg=`resize${Qo}`,Ag=`click.dismiss${Qo}`,Up=`mousedown.dismiss${Qo}`,Hp=`keydown.dismiss${Qo}`,Cg=`click${Qo}.data-api`,Vu="modal-open",gf="show",La="modal-static",Gp={backdrop:!0,focus:!0,keyboard:!0},Wp={backdrop:"(boolean|string)",focus:"boolean",keyboard:"boolean"};class Eo extends Hi{constructor(z,ee){super(z,ee),this._dialog=zt.findOne(".modal-dialog",this._element),this._backdrop=this._initializeBackDrop(),this._focustrap=this._initializeFocusTrap(),this._isShown=!1,this._isTransitioning=!1,this._scrollBar=new mc,this._addEventListeners()}static get Default(){return Gp}static get DefaultType(){return Wp}static get NAME(){return"modal"}toggle(z){return this._isShown?this.hide():this.show(z)}show(z){this._isShown||this._isTransitioning||Ue.trigger(this._element,Uh,{relatedTarget:z}).defaultPrevented||(this._isShown=!0,this._isTransitioning=!0,this._scrollBar.hide(),document.body.classList.add(Vu),this._adjustDialog(),this._backdrop.show(()=>this._showElement(z)))}hide(){this._isShown&&!this._isTransitioning&&(Ue.trigger(this._element,tl).defaultPrevented||(this._isShown=!1,this._isTransitioning=!0,this._focustrap.deactivate(),this._element.classList.remove(gf),this._queueCallback(()=>this._hideModal(),this._element,this._isAnimated())))}dispose(){Ue.off(window,Qo),Ue.off(this._dialog,Qo),this._backdrop.dispose(),this._focustrap.deactivate(),super.dispose()}handleUpdate(){this._adjustDialog()}_initializeBackDrop(){return new pf({isVisible:!!this._config.backdrop,isAnimated:this._isAnimated()})}_initializeFocusTrap(){return new el({trapElement:this._element})}_showElement(z){document.body.contains(this._element)||document.body.append(this._element),this._element.style.display="block",this._element.removeAttribute("aria-hidden"),this._element.setAttribute("aria-modal",!0),this._element.setAttribute("role","dialog"),this._element.scrollTop=0;const ee=zt.findOne(".modal-body",this._dialog);ee&&(ee.scrollTop=0),Q(this._element),this._element.classList.add(gf),this._queueCallback(()=>{this._config.focus&&this._focustrap.activate(),this._isTransitioning=!1,Ue.trigger(this._element,Vl,{relatedTarget:z})},this._dialog,this._isAnimated())}_addEventListeners(){Ue.on(this._element,Hp,z=>{z.key==="Escape"&&(this._config.keyboard?this.hide():this._triggerBackdropTransition())}),Ue.on(window,Eg,()=>{this._isShown&&!this._isTransitioning&&this._adjustDialog()}),Ue.on(this._element,Up,z=>{Ue.one(this._element,Ag,ee=>{this._element===z.target&&this._element===ee.target&&(this._config.backdrop!=="static"?this._config.backdrop&&this.hide():this._triggerBackdropTransition())})})}_hideModal(){this._element.style.display="none",this._element.setAttribute("aria-hidden",!0),this._element.removeAttribute("aria-modal"),this._element.removeAttribute("role"),this._isTransitioning=!1,this._backdrop.hide(()=>{document.body.classList.remove(Vu),this._resetAdjustments(),this._scrollBar.reset(),Ue.trigger(this._element,va)})}_isAnimated(){return this._element.classList.contains("fade")}_triggerBackdropTransition(){if(Ue.trigger(this._element,mf).defaultPrevented)return;const z=this._element.scrollHeight>document.documentElement.clientHeight,ee=this._element.style.overflowY;ee==="hidden"||this._element.classList.contains(La)||(z||(this._element.style.overflowY="hidden"),this._element.classList.add(La),this._queueCallback(()=>{this._element.classList.remove(La),this._queueCallback(()=>{this._element.style.overflowY=ee},this._dialog)},this._dialog),this._element.focus())}_adjustDialog(){const z=this._element.scrollHeight>document.documentElement.clientHeight,ee=this._scrollBar.getWidth(),we=ee>0;
3389if(we&&!z){const ot=be()?"paddingLeft":"paddingRight";this._element.style[ot]=`${ee}px`}if(!we&&z){const ot=be()?"paddingRight":"paddingLeft";this._element.style[ot]=`${ee}px`}}_resetAdjustments(){this._element.style.paddingLeft="",this._element.style.paddingRight=""}static jQueryInterface(z,ee){return this.each(function(){const we=Eo.getOrCreateInstance(this,z);if(typeof z=="string"){if(we[z]===void 0)throw new TypeError(`No method named "${z}"`);we[z](ee)}})}}Ue.on(document,Cg,'[data-bs-toggle="modal"]',function(ce){const z=zt.getElementFromSelector(this);["A","AREA"].includes(this.tagName)&&ce.preventDefault(),Ue.one(z,Uh,we=>{we.defaultPrevented||Ue.one(z,va,()=>{P(this)&&this.focus()})});const ee=zt.findOne(".modal.show");ee&&Eo.getInstance(ee).hide(),Eo.getOrCreateInstance(z).toggle(this)}),ti(Eo),ve(Eo);const Ho=".bs.offcanvas",Hh=".data-api",ea=`load${Ho}${Hh}`,gc="show",_c="showing",Gh="hiding",$u=".offcanvas.show",Go=`show${Ho}`,Wh=`shown${Ho}`,Rt=`hide${Ho}`,qh=`hidePrevented${Ho}`,ju=`hidden${Ho}`,Zh=`resize${Ho}`,_f=`click${Ho}${Hh}`,yc=`keydown.dismiss${Ho}`,ta={backdrop:!0,keyboard:!0,scroll:!1},Yc={backdrop:"(boolean|string)",keyboard:"boolean",scroll:"boolean"};class go extends Hi{constructor(z,ee){super(z,ee),this._isShown=!1,this._backdrop=this._initializeBackDrop(),this._focustrap=this._initializeFocusTrap(),this._addEventListeners()}static get Default(){return ta}static get DefaultType(){return Yc}static get NAME(){return"offcanvas"}toggle(z){return this._isShown?this.hide():this.show(z)}show(z){this._isShown||Ue.trigger(this._element,Go,{relatedTarget:z}).defaultPrevented||(this._isShown=!0,this._backdrop.show(),this._config.scroll||new mc().hide(),this._element.setAttribute("aria-modal",!0),this._element.setAttribute("role","dialog"),this._element.classList.add(_c),this._queueCallback(()=>{this._config.scroll&&!this._config.backdrop||this._focustrap.activate(),this._element.classList.add(gc),this._element.classList.remove(_c),Ue.trigger(this._element,Wh,{relatedTarget:z})},this._element,!0))}hide(){this._isShown&&(Ue.trigger(this._element,Rt).defaultPrevented||(this._focustrap.deactivate(),this._element.blur(),this._isShown=!1,this._element.classList.add(Gh),this._backdrop.hide(),this._queueCallback(()=>{this._element.classList.remove(gc,Gh),this._element.removeAttribute("aria-modal"),this._element.removeAttribute("role"),this._config.scroll||new mc().reset(),Ue.trigger(this._element,ju)},this._element,!0)))}dispose(){this._backdrop.dispose(),this._focustrap.deactivate(),super.dispose()}_initializeBackDrop(){const z=!!this._config.backdrop;return new pf({className:"offcanvas-backdrop",isVisible:z,isAnimated:!0,rootElement:this._element.parentNode,clickCallback:z?()=>{this._config.backdrop!=="static"?this.hide():Ue.trigger(this._element,qh)}:null})}_initializeFocusTrap(){return new el({trapElement:this._element})}_addEventListeners(){Ue.on(this._element,yc,z=>{z.key==="Escape"&&(this._config.keyboard?this.hide():Ue.trigger(this._element,qh))})}static jQueryInterface(z){return this.each(function(){const ee=go.getOrCreateInstance(this,z);if(typeof z=="string"){if(ee[z]===void 0||z.startsWith("_")||z==="constructor")throw new TypeError(`No method named "${z}"`);ee[z](this)}})}}Ue.on(document,_f,'[data-bs-toggle="offcanvas"]',function(ce){const z=zt.getElementFromSelector(this);if(["A","AREA"].includes(this.tagName)&&ce.preventDefault(),R(this))return;Ue.one(z,ju,()=>{P(this)&&this.focus()});const ee=zt.findOne($u);ee&&ee!==z&&go.getInstance(ee).hide(),go.getOrCreateInstance(z).toggle(this)}),Ue.on(window,ea,()=>{for(const ce of zt.find($u))go.getOrCreateInstance(ce).show()}),Ue.on(window,Zh,()=>{for(const ce of zt.find("[aria-modal][class*=show][class*=offcanvas-]"))getComputedStyle(ce).position!=="fixed"&&go.getOrCreateInstance(ce).hide()}),ti(go),ve(go);const Kc={"*":["class","dir","id","lang","role",/^aria-[\w-]*$/i],a:["target","href","title","rel"],area:[],b:[],br:[],col:[],code:[],dd:[],div:[],dl:[],dt:[],em:[],hr:[],h1:[],h2:[],h3:[],h4:[],h5:[],h6:[],i:[],img:["src","srcset","alt","title","width","height"],li:[],ol:[],p:[],pre:[],s:[],small:[],span:[],sub:[],sup:[],strong:[],u:[],ul:[]},vc=new Set(["background","cite","href","itemtype","longdesc","poster","src","xlink:href"]),Jc=/^(?!javascript:)(?:[a-z0-9+.-]+:|[^&:/?#]*(?:[/?#]|$))/i,vn=(ce,z)=>{const ee=ce.nodeName.toLowerCase();return z.includes(ee)?!vc.has(ee)||!!Jc.test(ce.nodeValue):z.filter(we=>we instanceof RegExp).some(we=>we.test(ee))},yf={allowList:Kc,content:{},extraClass:"",html:!1,sanitize:!0,sanitizeFn:null,template:"<div></div>"},Ig={allowList:"object",content:"object",extraClass:"(string|function)",html:"boolean",sanitize:"boolean",sanitizeFn:"(null|function)",template:"string"},qp={entry:"(string|element|function|null)",selector:"(string|element)"};class vf extends hn{constructor(z){super(),this._config=this._getConfig(z)}static get Default(){return yf}static get DefaultType(){return Ig}static get NAME(){return"TemplateFactory"}getContent(){return Object.values(this._config.content).map(z=>
vendor: 4,693 bytes, line 3389
3389this._resolvePossibleFunction(z)).filter(Boolean)}hasContent(){return this.getContent().length>0}changeContent(z){return this._checkContent(z),this._config.content={...this._config.content,...z},this}toHtml(){const z=document.createElement("div");z.innerHTML=this._maybeSanitize(this._config.template);for(const[ot,at]of Object.entries(this._config.content))this._setContent(z,at,ot);const ee=z.children[0],we=this._resolvePossibleFunction(this._config.extraClass);return we&&ee.classList.add(...we.split(" ")),ee}_typeCheckConfig(z){super._typeCheckConfig(z),this._checkContent(z.content)}_checkContent(z){for(const[ee,we]of Object.entries(z))super._typeCheckConfig({selector:ee,entry:we},qp)}_setContent(z,ee,we){const ot=zt.findOne(we,z);ot&&((ee=this._resolvePossibleFunction(ee))?s(ee)?this._putElementInTemplate(A(ee),ot):this._config.html?ot.innerHTML=this._maybeSanitize(ee):ot.textContent=ee:ot.remove())}_maybeSanitize(z){return this._config.sanitize?function(ee,we,ot){if(!ee.length)return ee;if(ot&&typeof ot=="function")return ot(ee);const at=new window.DOMParser().parseFromString(ee,"text/html"),Ot=[].concat(...at.body.querySelectorAll("*"));for(const ii of Ot){const Si=ii.nodeName.toLowerCase();if(!Object.keys(we).includes(Si)){ii.remove();continue}const Wi=[].concat(...ii.attributes),Ui=[].concat(we["*"]||[],we[Si]||[]);for(const $i of Wi)vn($i,Ui)||ii.removeAttribute($i.nodeName)}return at.body.innerHTML}(z,this._config.allowList,this._config.sanitizeFn):z}_resolvePossibleFunction(z){return Ee(z,[this])}_putElementInTemplate(z,ee){if(this._config.html)return ee.innerHTML="",void ee.append(z);ee.textContent=z.textContent}}const xf=new Set(["sanitize","allowList","sanitizeFn"]),Es="fade",Xh="show",Zp=".modal",Xp="hide.bs.modal",Qc="hover",bf="focus",Yh={AUTO:"auto",TOP:"top",RIGHT:be()?"left":"right",BOTTOM:"bottom",LEFT:be()?"right":"left"},Mg={allowList:Kc,animation:!0,boundary:"clippingParents",container:!1,customClass:"",delay:0,fallbackPlacements:["top","right","bottom","left"],html:!1,offset:[0,6],placement:"top",popperConfig:null,sanitize:!0,sanitizeFn:null,selector:!1,template:'<div class="tooltip" role="tooltip"><div class="tooltip-arrow"></div><div class="tooltip-inner"></div></div>',title:"",trigger:"hover focus"},Yp={allowList:"object",animation:"boolean",boundary:"(string|element)",container:"(string|element|boolean)",customClass:"(string|function)",delay:"(number|object)",fallbackPlacements:"array",html:"boolean",offset:"(array|string|function)",placement:"(string|function)",popperConfig:"(null|object|function)",sanitize:"boolean",sanitizeFn:"(null|function)",selector:"(string|boolean)",template:"string",title:"(string|element|function)",trigger:"string"};class il extends Hi{constructor(z,ee){if(ui===void 0)throw new TypeError("Bootstrap's tooltips require Popper (https://popper.js.org)");super(z,ee),this._isEnabled=!0,this._timeout=0,this._isHovered=null,this._activeTrigger={},this._popper=null,this._templateFactory=null,this._newContent=null,this.tip=null,this._setListeners(),this._config.selector||this._fixTitle()}static get Default(){return Mg}static get DefaultType(){return Yp}static get NAME(){return"tooltip"}enable(){this._isEnabled=!0}disable(){this._isEnabled=!1}toggleEnabled(){this._isEnabled=!this._isEnabled}toggle(){this._isEnabled&&(this._activeTrigger.click=!this._activeTrigger.click,this._isShown()?this._leave():this._enter())}dispose(){clearTimeout(this._timeout),Ue.off(this._element.closest(Zp),Xp,this._hideModalHandler),this._element.getAttribute("data-bs-original-title")&&this._element.setAttribute("title",this._element.getAttribute("data-bs-original-title")),this._disposePopper(),super.dispose()}show(){if(this._element.style.display==="none")throw new Error("Please use show on visible elements");if(!this._isWithContent()||!this._isEnabled)return;const z=Ue.trigger(this._element,this.constructor.eventName("show")),ee=(V(this._element)||this._element.ownerDocument.documentElement).contains(this._element);if(z.defaultPrevented||!ee)return;this._disposePopper();const we=this._getTipElement();this._element.setAttribute("aria-describedby",we.getAttribute("id"));const{container:ot}=this._config;if(this._element.ownerDocument.documentElement.contains(this.tip)||(ot.append(we),Ue.trigger(this._element,this.constructor.eventName("inserted"))),this._popper=this._createPopper(we),we.classList.add(Xh),"ontouchstart"in document.documentElement)for(const at of[].concat(...document.body.children))Ue.on(at,"mouseover",j);this._queueCallback(()=>{Ue.trigger(this._element,this.constructor.eventName("shown")),this._isHovered===!1&&this._leave(),this._isHovered=!1},this.tip,this._isAnimated())}
3389hide(){if(this._isShown()&&!Ue.trigger(this._element,this.constructor.eventName("hide")).defaultPrevented){if(this._getTipElement().classList.remove(Xh),"ontouchstart"in document.documentElement)for(const z of[].concat(...document.body.children))Ue.off(z,"mouseover",j);this._activeTrigger.click=!1,this._activeTrigger[bf]=!1,this._activeTrigger[Qc]=!1,this._isHovered=null,this._queueCallback(()=>{this._isWithActiveTrigger()||(this._isHovered||this._disposePopper(),this._element.removeAttribute("aria-describedby"),Ue.trigger(this._element,this.constructor.eventName("hidden")))},this.tip,this._isAnimated())}}update(){this._popper&&this._popper.update()}_isWithContent(){return!!this._getTitle()}_getTipElement(){return this.tip||(this.tip=this._createTipElement(this._newContent||this._getContentForTemplate())),this.tip}_createTipElement(z){const ee=this._getTemplateFactory(z).toHtml();if(!ee)return null;ee.classList.remove(Es,Xh),ee.classList.add(`bs-${this.constructor.NAME}-auto`);const we=(ot=>{do ot+=Math.floor(1e6*Math.random());while(document.getElementById(ot));return ot})(this.constructor.NAME).toString();return ee.setAttribute("id",we),this._isAnimated()&&ee.classList.add(Es),ee}setContent(z){this._newContent=z,this._isShown()&&(this._disposePopper(),this.show())}_getTemplateFactory(z){return this._templateFactory?this._templateFactory.changeContent(z):this._templateFactory=new vf({...this._config,content:z,extraClass:this._resolvePossibleFunction(this._config.customClass)}),this._templateFactory}_getContentForTemplate(){return{".tooltip-inner":this._getTitle()}}_getTitle(){return this._resolvePossibleFunction(this._config.title)||this._element.getAttribute("data-bs-original-title")}_initializeOnDelegatedTarget(z){return this.constructor.getOrCreateInstance(z.delegateTarget,this._getDelegateConfig())}_isAnimated(){return this._config.animation||this.tip&&this.tip.classList.contains(Es)}_isShown(){return this.tip&&this.tip.classList.contains(Xh)}_createPopper(z){const ee=Ee(this._config.placement,[this,z,this._element]),we=Yh[ee.toUpperCase()];return ka(this._element,z,this._getPopperConfig(we))}_getOffset(){const{offset:z}=this._config;return typeof z=="string"?z.split(",").map(ee=>Number.parseInt(ee,10)):typeof z=="function"?ee=>z(ee,this._element):z}_resolvePossibleFunction(z){return Ee(z,[this._element])}_getPopperConfig(z){const ee={placement:z,modifiers:[{name:"flip",options:{fallbackPlacements:this._config.fallbackPlacements}},{name:"offset",options:{offset:this._getOffset()}},{name:"preventOverflow",options:{boundary:this._config.boundary}},{name:"arrow",options:{element:`.${this.constructor.NAME}-arrow`}},{name:"preSetPlacement",enabled:!0,phase:"beforeMain",fn:we=>{this._getTipElement().setAttribute("data-popper-placement",we.state.placement)}}]};return{...ee,...Ee(this._config.popperConfig,[ee])}}_setListeners(){const z=this._config.trigger.split(" ");for(const ee of z)if(ee==="click")Ue.on(this._element,this.constructor.eventName("click"),this._config.selector,we=>{this._initializeOnDelegatedTarget(we).toggle()});else if(ee!=="manual"){const we=ee===Qc?this.constructor.eventName("mouseenter"):this.constructor.eventName("focusin"),ot=ee===Qc?this.constructor.eventName("mouseleave"):this.constructor.eventName("focusout");Ue.on(this._element,we,this._config.selector,at=>{const Ot=this._initializeOnDelegatedTarget(at);Ot._activeTrigger[at.type==="focusin"?bf:Qc]=!0,Ot._enter()}),Ue.on(this._element,ot,this._config.selector,at=>{const Ot=this._initializeOnDelegatedTarget(at);Ot._activeTrigger[at.type==="focusout"?bf:Qc]=Ot._element.contains(at.relatedTarget),Ot._leave()})}this._hideModalHandler=()=>{this._element&&this.hide()},Ue.on(this._element.closest(Zp),Xp,this._hideModalHandler)}_fixTitle(){const z=this._element.getAttribute("title");z&&(this._element.getAttribute("aria-label")||this._element.textContent.trim()||this._element.setAttribute("aria-label",z),this._element.setAttribute("data-bs-original-title",z),this._element.removeAttribute("title"))}_enter(){this._isShown()||this._isHovered?this._isHovered=!0:(this._isHovered=!0,this._setTimeout(()=>{this._isHovered&&this.show()},this._config.delay.show))}_leave(){this._isWithActiveTrigger()||(this._isHovered=!1,this._setTimeout(()=>{this._isHovered||this.hide()},this._config.delay.hide))}_setTimeout(z,ee){clearTimeout(this._timeout),this._timeout=setTimeout(z,ee)}_isWithActiveTrigger(){return Object.values(this._activeTrigger).includes(!0)}_getConfig(z){const ee=On.getDataAttributes(this._element);for(const we of Object.keys(ee))xf.has(we)&&delete ee[we];return z={...ee,...typeof z=="object"&&z?z:{}},z=this._mergeConfigObj(z),z=this._configAfterMerge(z),this._typeCheckConfig(z),z}_configAfterMerge(z){return z.container=z.container===!1?document.body:A(z.container),typeof z.delay=="number"&&(z.delay={show:z.delay,hide:z.delay}),typeof z.title=="number"&&(z.title=z.title.toString()),typeof z.content=="number"&&(z.content=z.content.toString()),z}_getDelegateConfig(){const z={};for(const[ee,we]of Object.entries(this._config))this.constructor.Default[ee]!==we&&(z[ee]=we);return z.selector=!1,z.trigger="manual",z}_disposePopper(){this._popper&&(this._popper.destroy(),this._popper=null),this.tip&&(this.tip.remove(),this.tip=null)}static jQueryInterface(z){return this.each(function(){const ee=il.getOrCreateInstance(this,z);
vendor: 10,614 bytes, line 3389
3389if(typeof z=="string"){if(ee[z]===void 0)throw new TypeError(`No method named "${z}"`);ee[z]()}})}}ve(il);const Kh={...il.Default,content:"",offset:[0,8],placement:"right",template:'<div class="popover" role="tooltip"><div class="popover-arrow"></div><h3 class="popover-header"></h3><div class="popover-body"></div></div>',trigger:"click"},wf={...il.DefaultType,content:"(null|string|element|function)"};class Ra extends il{static get Default(){return Kh}static get DefaultType(){return wf}static get NAME(){return"popover"}_isWithContent(){return this._getTitle()||this._getContent()}_getContentForTemplate(){return{".popover-header":this._getTitle(),".popover-body":this._getContent()}}_getContent(){return this._resolvePossibleFunction(this._config.content)}static jQueryInterface(z){return this.each(function(){const ee=Ra.getOrCreateInstance(this,z);if(typeof z=="string"){if(ee[z]===void 0)throw new TypeError(`No method named "${z}"`);ee[z]()}})}}ve(Ra);const Uu=".bs.scrollspy",Kp=`activate${Uu}`,xc=`click${Uu}`,Hu=`load${Uu}.data-api`,nl="active",eu="[href]",bc=".nav-link",Jh=`${bc}, .nav-item > ${bc}, .list-group-item`,Tf={offset:null,rootMargin:"0px 0px -25%",smoothScroll:!1,target:null,threshold:[.1,.5,1]},Jp={offset:"(number|null)",rootMargin:"string",smoothScroll:"boolean",target:"element",threshold:"array"};class wc extends Hi{constructor(z,ee){super(z,ee),this._targetLinks=new Map,this._observableSections=new Map,this._rootElement=getComputedStyle(this._element).overflowY==="visible"?null:this._element,this._activeTarget=null,this._observer=null,this._previousScrollData={visibleEntryTop:0,parentScrollTop:0},this.refresh()}static get Default(){return Tf}static get DefaultType(){return Jp}static get NAME(){return"scrollspy"}refresh(){this._initializeTargetsAndObservables(),this._maybeEnableSmoothScroll(),this._observer?this._observer.disconnect():this._observer=this._getNewObserver();for(const z of this._observableSections.values())this._observer.observe(z)}dispose(){this._observer.disconnect(),super.dispose()}_configAfterMerge(z){return z.target=A(z.target)||document.body,z.rootMargin=z.offset?`${z.offset}px 0px -30%`:z.rootMargin,typeof z.threshold=="string"&&(z.threshold=z.threshold.split(",").map(ee=>Number.parseFloat(ee))),z}_maybeEnableSmoothScroll(){this._config.smoothScroll&&(Ue.off(this._config.target,xc),Ue.on(this._config.target,xc,eu,z=>{const ee=this._observableSections.get(z.target.hash);if(ee){z.preventDefault();const we=this._rootElement||window,ot=ee.offsetTop-this._element.offsetTop;if(we.scrollTo)return void we.scrollTo({top:ot,behavior:"smooth"});we.scrollTop=ot}}))}_getNewObserver(){const z={root:this._rootElement,threshold:this._config.threshold,rootMargin:this._config.rootMargin};return new IntersectionObserver(ee=>this._observerCallback(ee),z)}_observerCallback(z){const ee=Ot=>this._targetLinks.get(`#${Ot.target.id}`),we=Ot=>{this._previousScrollData.visibleEntryTop=Ot.target.offsetTop,this._process(ee(Ot))},ot=(this._rootElement||document.documentElement).scrollTop,at=ot>=this._previousScrollData.parentScrollTop;this._previousScrollData.parentScrollTop=ot;for(const Ot of z){if(!Ot.isIntersecting){this._activeTarget=null,this._clearActiveClass(ee(Ot));continue}const ii=Ot.target.offsetTop>=this._previousScrollData.visibleEntryTop;if(at&&ii){if(we(Ot),!ot)return}else at||ii||we(Ot)}}_initializeTargetsAndObservables(){this._targetLinks=new Map,this._observableSections=new Map;const z=zt.find(eu,this._config.target);for(const ee of z){if(!ee.hash||R(ee))continue;const we=zt.findOne(decodeURI(ee.hash),this._element);P(we)&&(this._targetLinks.set(decodeURI(ee.hash),ee),this._observableSections.set(ee.hash,we))}}_process(z){this._activeTarget!==z&&(this._clearActiveClass(this._config.target),this._activeTarget=z,z.classList.add(nl),this._activateParents(z),Ue.trigger(this._element,Kp,{relatedTarget:z}))}_activateParents(z){if(z.classList.contains("dropdown-item"))zt.findOne(".dropdown-toggle",z.closest(".dropdown")).classList.add(nl);else for(const ee of zt.parents(z,".nav, .list-group"))for(const we of zt.prev(ee,Jh))we.classList.add(nl)}_clearActiveClass(z){z.classList.remove(nl);const ee=zt.find(`${eu}.${nl}`,z);for(const we of ee)we.classList.remove(nl)}static jQueryInterface(z){return this.each(function(){const ee=wc.getOrCreateInstance(this,z);if(typeof z=="string"){if(ee[z]===void 0||z.startsWith("_")||z==="constructor")throw new TypeError(`No method named "${z}"`);ee[z]()}})}}Ue.on(window,Hu,()=>{for(const ce of zt.find('[data-bs-spy="scroll"]'))wc.getOrCreateInstance(ce)}),ve(wc);const Oa=".bs.tab",Gu=`hide${Oa}`,Qp=`hidden${Oa}`,em=`show${Oa}`,tm=`shown${Oa}`,tu=`click${Oa}`,im=`keydown${Oa}`,Pg=`load${Oa}`,Sf="ArrowLeft",nm="ArrowRight",Qh="ArrowUp",ed="ArrowDown",Wu="Home",td="End",sl="active",id="fade",$l="show",Tc=".dropdown-toggle",jl=`:not(${Tc})`,Ef='[data-bs-toggle="tab"], [data-bs-toggle="pill"], [data-bs-toggle="list"]',no=`.nav-link${jl}, .list-group-item${jl}, [role="tab"]${jl}, ${Ef}`,qu=`.${sl}[data-bs-toggle="tab"], .${sl}[data-bs-toggle="pill"], .${sl}[data-bs-toggle="list"]`;class za extends Hi{constructor(z){super(z),this._parent=this._element.closest('.list-group, .nav, [role="tablist"]'),this._parent&&(this._setInitialAttributes(this._parent,this._getChildren()),Ue.on(this._element,im,ee=>this._keydown(ee)))}static get NAME(){return"tab"}show(){const z=this._element;if(this._elemIsActive(z))return;const ee=this._getActiveElem(),we=ee?Ue.trigger(ee,Gu,{relatedTarget:z}):null;Ue.trigger(z,em,{relatedTarget:ee}).defaultPrevented||we&&we.defaultPrevented||(this._deactivate(ee,z),this._activate(z,ee))}_activate(z,ee){z&&(z.classList.add(sl),this._activate(zt.getElementFromSelector(z)),this._queueCallback(()=>{z.getAttribute("role")==="tab"?(z.removeAttribute("tabindex"),z.setAttribute("aria-selected",!0),this._toggleDropDown(z,!0),Ue.trigger(z,tm,{relatedTarget:ee})):z.classList.add($l)},z,z.classList.contains(id)))}_deactivate(z,ee){z&&(z.classList.remove(sl),z.blur(),this._deactivate(zt.getElementFromSelector(z)),this._queueCallback(()=>{z.getAttribute("role")==="tab"?(z.setAttribute("aria-selected",!1),z.setAttribute("tabindex","-1"),this._toggleDropDown(z,!1),Ue.trigger(z,Qp,{relatedTarget:ee})):z.classList.remove($l)},z,z.classList.contains(id)))}_keydown(z){if(![Sf,nm,Qh,ed,Wu,td].includes(z.key))return;z.stopPropagation(),z.preventDefault();const ee=this._getChildren().filter(ot=>!R(ot));let we;if([Wu,td].includes(z.key))we=ee[z.key===Wu?0:ee.length-1];else{const ot=[nm,ed].includes(z.key);we=Ve(ee,z.target,ot,!0)}we&&(we.focus({preventScroll:!0}),za.getOrCreateInstance(we).show())}_getChildren(){return zt.find(no,this._parent)}_getActiveElem(){return this._getChildren().find(z=>this._elemIsActive(z))||null}_setInitialAttributes(z,ee){this._setAttributeIfNotExists(z,"role","tablist");for(const we of ee)this._setInitialAttributesOnChild(we)}_setInitialAttributesOnChild(z){z=this._getInnerElement(z);const ee=this._elemIsActive(z),we=this._getOuterElement(z);z.setAttribute("aria-selected",ee),we!==z&&this._setAttributeIfNotExists(we,"role","presentation"),ee||z.setAttribute("tabindex","-1"),this._setAttributeIfNotExists(z,"role","tab"),this._setInitialAttributesOnTargetPanel(z)}_setInitialAttributesOnTargetPanel(z){const ee=zt.getElementFromSelector(z);ee&&(this._setAttributeIfNotExists(ee,"role","tabpanel"),z.id&&this._setAttributeIfNotExists(ee,"aria-labelledby",`${z.id}`))}_toggleDropDown(z,ee){const we=this._getOuterElement(z);if(!we.classList.contains("dropdown"))return;const ot=(at,Ot)=>{const ii=zt.findOne(at,we);ii&&ii.classList.toggle(Ot,ee)};ot(Tc,sl),ot(".dropdown-menu",$l),we.setAttribute("aria-expanded",ee)}_setAttributeIfNotExists(z,ee,we){z.hasAttribute(ee)||z.setAttribute(ee,we)}_elemIsActive(z){return z.classList.contains(sl)}_getInnerElement(z){return z.matches(no)?z:zt.findOne(no,z)}_getOuterElement(z){return z.closest(".nav-item, .list-group-item")||z}static jQueryInterface(z){return this.each(function(){const ee=za.getOrCreateInstance(this);if(typeof z=="string"){if(ee[z]===void 0||z.startsWith("_")||z==="constructor")throw new TypeError(`No method named "${z}"`);ee[z]()}})}}Ue.on(document,tu,Ef,function(ce){["A","AREA"].includes(this.tagName)&&ce.preventDefault(),R(this)||za.getOrCreateInstance(this).show()}),Ue.on(window,Pg,()=>{for(const ce of zt.find(qu))za.getOrCreateInstance(ce)}),ve(za);const xa=".bs.toast",nd=`mouseover${xa}`,sd=`mouseout${xa}`,Af=`focusin${xa}`,rd=`focusout${xa}`,Cf=`hide${xa}`,od=`hidden${xa}`,Zu=`show${xa}`,Xu=`shown${xa}`,If="hide",Fa="show",ad="showing",Dg={animation:"boolean",autohide:"boolean",delay:"number"},sm={animation:!0,autohide:!0,delay:5e3};class iu extends Hi{constructor(z,ee){super(z,ee),this._timeout=null,this._hasMouseInteraction=!1,this._hasKeyboardInteraction=!1,this._setListeners()}static get Default(){return sm}static get DefaultType(){return Dg}static get NAME(){return"toast"}show(){Ue.trigger(this._element,Zu).defaultPrevented||(this._clearTimeout(),this._config.animation&&this._element.classList.add("fade"),this._element.classList.remove(If),Q(this._element),this._element.classList.add(Fa,ad),this._queueCallback(()=>{this._element.classList.remove(ad),Ue.trigger(this._element,Xu),this._maybeScheduleHide()},this._element,this._config.animation))}hide(){this.isShown()&&(Ue.trigger(this._element,Cf).defaultPrevented||(this._element.classList.add(ad),this._queueCallback(()=>{this._element.classList.add(If),this._element.classList.remove(ad,Fa),Ue.trigger(this._element,od)},this._element,this._config.animation)))}dispose(){this._clearTimeout(),this.isShown()&&this._element.classList.remove(Fa),super.dispose()}isShown(){return this._element.classList.contains(Fa)}_maybeScheduleHide(){this._config.autohide&&(this._hasMouseInteraction||this._hasKeyboardInteraction||(this._timeout=setTimeout(()=>{this.hide()},this._config.delay)))}_onInteraction(z,ee){switch(z.type){case"mouseover":case"mouseout":this._hasMouseInteraction=ee;break;case"focusin":case"focusout":this._hasKeyboardInteraction=ee}if(ee)return void this._clearTimeout();const we=z.relatedTarget;this._element===we||this._element.contains(we)||this._maybeScheduleHide()}_setListeners(){Ue.on(this._element,nd,z=>this._onInteraction(z,!0)),Ue.on(this._element,sd,z=>this._onInteraction(z,!1)),Ue.on(this._element,Af,z=>this._onInteraction(z,!0)),Ue.on(this._element,rd,z=>this._onInteraction(z,!1))}_clearTimeout(){clearTimeout(this._timeout),this._timeout=null}static jQueryInterface(z){return this.each(function(){const ee=iu.getOrCreateInstance(this,z);
3389if(typeof z=="string"){if(ee[z]===void 0)throw new TypeError(`No method named "${z}"`);ee[z](this)}})}}return ti(iu),ve(iu),{Alert:Oe,Button:$t,Carousel:Xa,Collapse:Ht,Dropdown:Gt,Modal:Eo,Offcanvas:go,Popover:Ra,ScrollSpy:wc,Tab:za,Toast:iu,Tooltip:il}})}(gx)),gx.exports}fae();/*! 3390 * Font Awesome Free 6.7.2 by @fontawesome - https://fontawesome.com 3391 * License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) 3392 * Copyright 2024 Fonticons, Inc. 3393 */const pae={prefix:"fab",iconName:"linkedin-in",icon:[448,512,[],"f0e1","M100.28 448H7.4V148.9h92.88zM53.79 108.1C24.09 108.1 0 83.5 0 53.8a53.79 53.79 0 0 1 107.58 0c0 29.7-24.1 54.3-53.79 54.3zM447.9 448h-92.68V302.4c0-34.7-.7-79.2-48.29-79.2-48.29 0-55.69 37.7-55.69 76.7V448h-92.78V148.9h89.08v40.8h1.3c12.4-23.5 42.69-48.3 87.88-48.3 94 0 111.28 61.9 111.28 142.3V448z"]},mae={prefix:"fab",iconName:"facebook-f",icon:[320,512,[],"f39e","M80 299.3V512H196V299.3h86.5l18-97.8H196V166.9c0-51.7 20.3-71.5 72.7-71.5c16.3 0 29.4 .4 37 1.2V7.9C291.4 4 256.4 0 236.2 0C129.3 0 80 50.5 80 159.4v42.1H14v97.8H80z"]},gae={prefix:"fab",iconName:"instagram",icon:[448,512,[],"f16d","M224.1 141c-63.6 0-114.9 51.3-114.9 114.9s51.3 114.9 114.9 114.9S339 319.5 339 255.9 287.7 141 224.1 141zm0 189.6c-41.1 0-74.7-33.5-74.7-74.7s33.5-74.7 74.7-74.7 74.7 33.5 74.7 74.7-33.6 74.7-74.7 74.7zm146.4-194.3c0 14.9-12 26.8-26.8 26.8-14.9 0-26.8-12-26.8-26.8s12-26.8 26.8-26.8 26.8 12 26.8 26.8zm76.1 27.2c-1.7-35.9-9.9-67.7-36.2-93.9-26.2-26.2-58-34.4-93.9-36.2-37-2.1-147.9-2.1-184.9 0-35.8 1.7-67.6 9.9-93.9 36.1s-34.4 58-36.2 93.9c-2.1 37-2.1 147.9 0 184.9 1.7 35.9 9.9 67.7 36.2 93.9s58 34.4 93.9 36.2c37 2.1 147.9 2.1 184.9 0 35.9-1.7 67.7-9.9 93.9-36.2 26.2-26.2 34.4-58 36.2-93.9 2.1-37 2.1-147.8 0-184.8zM398.8 388c-7.8 19.6-22.9 34.7-42.6 42.6-29.5 11.7-99.5 9-132.1 9s-102.7 2.6-132.1-9c-19.6-7.8-34.7-22.9-42.6-42.6-11.7-29.5-9-99.5-9-132.1s-2.6-102.7 9-132.1c7.8-19.6 22.9-34.7 42.6-42.6 29.5-11.7 99.5-9 132.1-9s102.7-2.6 132.1 9c19.6 7.8 34.7 22.9 42.6 42.6 11.7 29.5 9 99.5 9 132.1s2.7 102.7-9 132.1z"]},_ae={prefix:"fab",iconName:"twitter",icon:[512,512,[],"f099","M459.37 151.716c.325 4.548.325 9.097.325 13.645 0 138.72-105.583 298.558-298.558 298.558-59.452 0-114.68-17.219-161.137-47.106 8.447.974 16.568 1.299 25.34 1.299 49.055 0 94.213-16.568 130.274-44.832-46.132-.975-84.792-31.188-98.112-72.772 6.498.974 12.995 1.624 19.818 1.624 9.421 0 18.843-1.3 27.614-3.573-48.081-9.747-84.143-51.98-84.143-102.985v-1.299c13.969 7.797 30.214 12.67 47.431 13.319-28.264-18.843-46.781-51.005-46.781-87.391 0-19.492 5.197-37.36 14.294-52.954 51.655 63.675 129.3 105.258 216.365 109.807-1.624-7.797-2.599-15.918-2.599-24.04 0-57.828 46.782-104.934 104.934-104.934 30.213 0 57.502 12.67 76.67 33.137 23.715-4.548 46.456-13.32 66.599-25.34-7.798 24.366-24.366 44.833-46.132 57.827 21.117-2.273 41.584-8.122 60.426-16.243-14.292 20.791-32.161 39.308-52.628 54.253z"]};oc.add(Yy,bW,_W,rS,bL,pW,JG,KG,WG,lW,mae,_ae,pae,gae,TW,HG,g1,AW,GW,jG,BW,oS,gW,DW,ZG,v1,XW,SL,zW,OW,UG,qW,uW,_1,y1,xL);const E1=xB(CB);E1.component("font-awesome-icon",Fs);E1.use(hae);E1.directive("scroll-reveal",{mounted:(n,t)=>{tc().reveal(n,t.value||{})}});E1.mount("#app");
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.