diff --git a/frontend/dist/frontend/index.html b/frontend/dist/frontend/index.html index 7c15d0a..8d2cbe0 100644 --- a/frontend/dist/frontend/index.html +++ b/frontend/dist/frontend/index.html @@ -9,6 +9,6 @@ - + \ No newline at end of file diff --git a/frontend/dist/frontend/main.615bbb2299d4b394.js b/frontend/dist/frontend/main.615bbb2299d4b394.js new file mode 100644 index 0000000..c3ca5a0 --- /dev/null +++ b/frontend/dist/frontend/main.615bbb2299d4b394.js @@ -0,0 +1 @@ +(self.webpackChunkfrontend=self.webpackChunkfrontend||[]).push([[179],{418:(zm,Au,ku)=>{"use strict";function or(e){return"function"==typeof e}function Zh(e){const n=e(r=>{Error.call(r),r.stack=(new Error).stack});return n.prototype=Object.create(Error.prototype),n.prototype.constructor=n,n}const Bm=Zh(e=>function(n){e(this),this.message=n?`${n.length} errors occurred during unsubscription:\n${n.map((r,i)=>`${i+1}) ${r.toString()}`).join("\n ")}`:"",this.name="UnsubscriptionError",this.errors=n});function b(e,t){if(e){const n=e.indexOf(t);0<=n&&e.splice(n,1)}}class _r{constructor(t){this.initialTeardown=t,this.closed=!1,this._parentage=null,this._finalizers=null}unsubscribe(){let t;if(!this.closed){this.closed=!0;const{_parentage:n}=this;if(n)if(this._parentage=null,Array.isArray(n))for(const o of n)o.remove(this);else n.remove(this);const{initialTeardown:r}=this;if(or(r))try{r()}catch(o){t=o instanceof Bm?o.errors:[o]}const{_finalizers:i}=this;if(i){this._finalizers=null;for(const o of i)try{Pl(o)}catch(c){t=t??[],c instanceof Bm?t=[...t,...c.errors]:t.push(c)}}if(t)throw new Bm(t)}}add(t){var n;if(t&&t!==this)if(this.closed)Pl(t);else{if(t instanceof _r){if(t.closed||t._hasParent(this))return;t._addParent(this)}(this._finalizers=null!==(n=this._finalizers)&&void 0!==n?n:[]).push(t)}}_hasParent(t){const{_parentage:n}=this;return n===t||Array.isArray(n)&&n.includes(t)}_addParent(t){const{_parentage:n}=this;this._parentage=Array.isArray(n)?(n.push(t),n):n?[n,t]:t}_removeParent(t){const{_parentage:n}=this;n===t?this._parentage=null:Array.isArray(n)&&b(n,t)}remove(t){const{_finalizers:n}=this;n&&b(n,t),t instanceof _r&&t._removeParent(this)}}_r.EMPTY=(()=>{const e=new _r;return e.closed=!0,e})();const Rs=_r.EMPTY;function us(e){return e instanceof _r||e&&"closed"in e&&or(e.remove)&&or(e.add)&&or(e.unsubscribe)}function Pl(e){or(e)?e():e.unsubscribe()}const Zt={onUnhandledError:null,onStoppedNotification:null,Promise:void 0,useDeprecatedSynchronousErrorHandling:!1,useDeprecatedNextContext:!1},Te={setTimeout(e,t,...n){const{delegate:r}=Te;return r?.setTimeout?r.setTimeout(e,t,...n):setTimeout(e,t,...n)},clearTimeout(e){const{delegate:t}=Te;return(t?.clearTimeout||clearTimeout)(e)},delegate:void 0};function Ni(e){Te.setTimeout(()=>{const{onUnhandledError:t}=Zt;if(!t)throw e;t(e)})}function Fs(){}const Os=wi("C",void 0,void 0);function wi(e,t,n){return{kind:e,value:t,error:n}}let no=null;function pn(e){if(Zt.useDeprecatedSynchronousErrorHandling){const t=!no;if(t&&(no={errorThrown:!1,error:null}),e(),t){const{errorThrown:n,error:r}=no;if(no=null,n)throw r}}else e()}class kc extends _r{constructor(t){super(),this.isStopped=!1,t?(this.destination=t,us(t)&&t.add(this)):this.destination=Pu}static create(t,n,r){return new ro(t,n,r)}next(t){this.isStopped?Hn(function Rl(e){return wi("N",e,void 0)}(t),this):this._next(t)}error(t){this.isStopped?Hn(function Fa(e){return wi("E",void 0,e)}(t),this):(this.isStopped=!0,this._error(t))}complete(){this.isStopped?Hn(Os,this):(this.isStopped=!0,this._complete())}unsubscribe(){this.closed||(this.isStopped=!0,super.unsubscribe(),this.destination=null)}_next(t){this.destination.next(t)}_error(t){try{this.destination.error(t)}finally{this.unsubscribe()}}_complete(){try{this.destination.complete()}finally{this.unsubscribe()}}}const Mo=Function.prototype.bind;function na(e,t){return Mo.call(e,t)}class Ls{constructor(t){this.partialObserver=t}next(t){const{partialObserver:n}=this;if(n.next)try{n.next(t)}catch(r){Oa(r)}}error(t){const{partialObserver:n}=this;if(n.error)try{n.error(t)}catch(r){Oa(r)}else Oa(t)}complete(){const{partialObserver:t}=this;if(t.complete)try{t.complete()}catch(n){Oa(n)}}}class ro extends kc{constructor(t,n,r){let i;if(super(),or(t)||!t)i={next:t??void 0,error:n??void 0,complete:r??void 0};else{let o;this&&Zt.useDeprecatedNextContext?(o=Object.create(t),o.unsubscribe=()=>this.unsubscribe(),i={next:t.next&&na(t.next,o),error:t.error&&na(t.error,o),complete:t.complete&&na(t.complete,o)}):i=t}this.destination=new Ls(i)}}function Oa(e){Zt.useDeprecatedSynchronousErrorHandling?function ii(e){Zt.useDeprecatedSynchronousErrorHandling&&no&&(no.errorThrown=!0,no.error=e)}(e):Ni(e)}function Hn(e,t){const{onStoppedNotification:n}=Zt;n&&Te.setTimeout(()=>n(e,t))}const Pu={closed:!0,next:Fs,error:function hs(e){throw e},complete:Fs},Tt="function"==typeof Symbol&&Symbol.observable||"@@observable";function qr(e){return e}function Ns(e){return 0===e.length?qr:1===e.length?e[0]:function(n){return e.reduce((r,i)=>i(r),n)}}let Nn=(()=>{class e{constructor(n){n&&(this._subscribe=n)}lift(n){const r=new e;return r.source=this,r.operator=n,r}subscribe(n,r,i){const o=function Na(e){return e&&e instanceof kc||function Fl(e){return e&&or(e.next)&&or(e.error)&&or(e.complete)}(e)&&us(e)}(n)?n:new ro(n,r,i);return pn(()=>{const{operator:c,source:d}=this;o.add(c?c.call(o,d):d?this._subscribe(o):this._trySubscribe(o))}),o}_trySubscribe(n){try{return this._subscribe(n)}catch(r){n.error(r)}}forEach(n,r){return new(r=Pc(r))((i,o)=>{const c=new ro({next:d=>{try{n(d)}catch(p){o(p),c.unsubscribe()}},error:o,complete:i});this.subscribe(c)})}_subscribe(n){var r;return null===(r=this.source)||void 0===r?void 0:r.subscribe(n)}[Tt](){return this}pipe(...n){return Ns(n)(this)}toPromise(n){return new(n=Pc(n))((r,i)=>{let o;this.subscribe(c=>o=c,c=>i(c),()=>r(o))})}}return e.create=t=>new e(t),e})();function Pc(e){var t;return null!==(t=e??Zt.Promise)&&void 0!==t?t:Promise}const Rc=Zh(e=>function(){e(this),this.name="ObjectUnsubscribedError",this.message="object unsubscribed"});let oi=(()=>{class e extends Nn{constructor(){super(),this.closed=!1,this.currentObservers=null,this.observers=[],this.isStopped=!1,this.hasError=!1,this.thrownError=null}lift(n){const r=new za(this,this);return r.operator=n,r}_throwIfClosed(){if(this.closed)throw new Rc}next(n){pn(()=>{if(this._throwIfClosed(),!this.isStopped){this.currentObservers||(this.currentObservers=Array.from(this.observers));for(const r of this.currentObservers)r.next(n)}})}error(n){pn(()=>{if(this._throwIfClosed(),!this.isStopped){this.hasError=this.isStopped=!0,this.thrownError=n;const{observers:r}=this;for(;r.length;)r.shift().error(n)}})}complete(){pn(()=>{if(this._throwIfClosed(),!this.isStopped){this.isStopped=!0;const{observers:n}=this;for(;n.length;)n.shift().complete()}})}unsubscribe(){this.isStopped=this.closed=!0,this.observers=this.currentObservers=null}get observed(){var n;return(null===(n=this.observers)||void 0===n?void 0:n.length)>0}_trySubscribe(n){return this._throwIfClosed(),super._trySubscribe(n)}_subscribe(n){return this._throwIfClosed(),this._checkFinalizedStatuses(n),this._innerSubscribe(n)}_innerSubscribe(n){const{hasError:r,isStopped:i,observers:o}=this;return r||i?Rs:(this.currentObservers=null,o.push(n),new _r(()=>{this.currentObservers=null,b(o,n)}))}_checkFinalizedStatuses(n){const{hasError:r,thrownError:i,isStopped:o}=this;r?n.error(i):o&&n.complete()}asObservable(){const n=new Nn;return n.source=this,n}}return e.create=(t,n)=>new za(t,n),e})();class za extends oi{constructor(t,n){super(),this.destination=t,this.source=n}next(t){var n,r;null===(r=null===(n=this.destination)||void 0===n?void 0:n.next)||void 0===r||r.call(n,t)}error(t){var n,r;null===(r=null===(n=this.destination)||void 0===n?void 0:n.error)||void 0===r||r.call(n,t)}complete(){var t,n;null===(n=null===(t=this.destination)||void 0===t?void 0:t.complete)||void 0===n||n.call(t)}_subscribe(t){var n,r;return null!==(r=null===(n=this.source)||void 0===n?void 0:n.subscribe(t))&&void 0!==r?r:Rs}}function ra(e){return or(e?.lift)}function mr(e){return t=>{if(ra(t))return t.lift(function(n){try{return e(n,this)}catch(r){this.error(r)}});throw new TypeError("Unable to lift unknown Observable type")}}function Qn(e,t,n,r,i){return new Ae(e,t,n,r,i)}class Ae extends kc{constructor(t,n,r,i,o,c){super(t),this.onFinalize=o,this.shouldUnsubscribe=c,this._next=n?function(d){try{n(d)}catch(p){t.error(p)}}:super._next,this._error=i?function(d){try{i(d)}catch(p){t.error(p)}finally{this.unsubscribe()}}:super._error,this._complete=r?function(){try{r()}catch(d){t.error(d)}finally{this.unsubscribe()}}:super._complete}unsubscribe(){var t;if(!this.shouldUnsubscribe||this.shouldUnsubscribe()){const{closed:n}=this;super.unsubscribe(),!n&&(null===(t=this.onFinalize)||void 0===t||t.call(this))}}}function Pe(e,t){return mr((n,r)=>{let i=0;n.subscribe(Qn(r,o=>{r.next(e.call(t,o,i++))}))})}function so(e){return this instanceof so?(this.v=e,this):new so(e)}function Ll(e,t,n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var i,r=n.apply(e,t||[]),o=[];return i={},c("next"),c("throw"),c("return"),i[Symbol.asyncIterator]=function(){return this},i;function c(I){r[I]&&(i[I]=function(P){return new Promise(function(N,G){o.push([I,P,N,G])>1||d(I,P)})})}function d(I,P){try{!function p(I){I.value instanceof so?Promise.resolve(I.value.v).then(v,E):D(o[0][2],I)}(r[I](P))}catch(N){D(o[0][3],N)}}function v(I){d("next",I)}function E(I){d("throw",I)}function D(I,P){I(P),o.shift(),o.length&&d(o[0][0],o[0][1])}}function oa(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var n,t=e[Symbol.asyncIterator];return t?t.call(e):(e=function ia(e){var t="function"==typeof Symbol&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}(e),n={},r("next"),r("throw"),r("return"),n[Symbol.asyncIterator]=function(){return this},n);function r(o){n[o]=e[o]&&function(c){return new Promise(function(d,p){!function i(o,c,d,p){Promise.resolve(p).then(function(v){o({value:v,done:d})},c)}(d,p,(c=e[o](c)).done,c.value)})}}}const ao=e=>e&&"number"==typeof e.length&&"function"!=typeof e;function Zr(e){return or(e?.then)}function Vr(e){return or(e[Tt])}function pi(e){return Symbol.asyncIterator&&or(e?.[Symbol.asyncIterator])}function mi(e){return new TypeError(`You provided ${null!==e&&"object"==typeof e?"an invalid object":`'${e}'`} where a stream was expected. You can provide an Observable, Promise, ReadableStream, Array, AsyncIterable, or Iterable.`)}const J=function Bs(){return"function"==typeof Symbol&&Symbol.iterator?Symbol.iterator:"@@iterator"}();function V(e){return or(e?.[J])}function $(e){return Ll(this,arguments,function*(){const n=e.getReader();try{for(;;){const{value:r,done:i}=yield so(n.read());if(i)return yield so(void 0);yield yield so(r)}}finally{n.releaseLock()}})}function K(e){return or(e?.getReader)}function te(e){if(e instanceof Nn)return e;if(null!=e){if(Vr(e))return function ce(e){return new Nn(t=>{const n=e[Tt]();if(or(n.subscribe))return n.subscribe(t);throw new TypeError("Provided object does not correctly implement Symbol.observable")})}(e);if(ao(e))return function ge(e){return new Nn(t=>{for(let n=0;n{e.then(n=>{t.closed||(t.next(n),t.complete())},n=>t.error(n)).then(null,Ni)})}(e);if(pi(e))return xe(e);if(V(e))return function ue(e){return new Nn(t=>{for(const n of e)if(t.next(n),t.closed)return;t.complete()})}(e);if(K(e))return function Me(e){return xe($(e))}(e)}throw mi(e)}function xe(e){return new Nn(t=>{(function je(e,t){var n,r,i,o;return function ps(e,t,n,r){return new(n||(n=Promise))(function(o,c){function d(E){try{v(r.next(E))}catch(D){c(D)}}function p(E){try{v(r.throw(E))}catch(D){c(D)}}function v(E){E.done?o(E.value):function i(o){return o instanceof n?o:new n(function(c){c(o)})}(E.value).then(d,p)}v((r=r.apply(e,t||[])).next())})}(this,void 0,void 0,function*(){try{for(n=oa(e);!(r=yield n.next()).done;)if(t.next(r.value),t.closed)return}catch(c){i={error:c}}finally{try{r&&!r.done&&(o=n.return)&&(yield o.call(n))}finally{if(i)throw i.error}}t.complete()})})(e,t).catch(n=>t.error(n))})}function Ie(e,t,n,r=0,i=!1){const o=t.schedule(function(){n(),i?e.add(this.schedule(null,r)):this.unsubscribe()},r);if(e.add(o),!i)return o}function dt(e,t,n=1/0){return or(t)?dt((r,i)=>Pe((o,c)=>t(r,o,i,c))(te(e(r,i))),n):("number"==typeof t&&(n=t),mr((r,i)=>function Dt(e,t,n,r,i,o,c,d){const p=[];let v=0,E=0,D=!1;const I=()=>{D&&!p.length&&!v&&t.complete()},P=G=>v{o&&t.next(G),v++;let U=!1;te(n(G,E++)).subscribe(Qn(t,Z=>{i?.(Z),o?P(Z):t.next(Z)},()=>{U=!0},void 0,()=>{if(U)try{for(v--;p.length&&vN(Z)):N(Z)}I()}catch(Z){t.error(Z)}}))};return e.subscribe(Qn(t,P,()=>{D=!0,I()})),()=>{d?.()}}(r,i,e,n)))}function ft(e=1/0){return dt(qr,e)}const xt=new Nn(e=>e.complete());function nn(e){return e&&or(e.schedule)}function an(e){return e[e.length-1]}function sr(e){return nn(an(e))?e.pop():void 0}function kr(e,t=0){return mr((n,r)=>{n.subscribe(Qn(r,i=>Ie(r,e,()=>r.next(i),t),()=>Ie(r,e,()=>r.complete(),t),i=>Ie(r,e,()=>r.error(i),t)))})}function $a(e,t=0){return mr((n,r)=>{r.add(e.schedule(()=>n.subscribe(r),t))})}function Ha(e,t){if(!e)throw new Error("Iterable cannot be null");return new Nn(n=>{Ie(n,t,()=>{const r=e[Symbol.asyncIterator]();Ie(n,t,()=>{r.next().then(i=>{i.done?n.complete():n.next(i.value)})},0,!0)})})}function Cr(e,t){return t?function Ou(e,t){if(null!=e){if(Vr(e))return function Af(e,t){return te(e).pipe($a(t),kr(t))}(e,t);if(ao(e))return function ja(e,t){return new Nn(n=>{let r=0;return t.schedule(function(){r===e.length?n.complete():(n.next(e[r++]),n.closed||this.schedule())})})}(e,t);if(Zr(e))return function kf(e,t){return te(e).pipe($a(t),kr(t))}(e,t);if(pi(e))return Ha(e,t);if(V(e))return function Fu(e,t){return new Nn(n=>{let r;return Ie(n,t,()=>{r=e[J](),Ie(n,t,()=>{let i,o;try{({value:i,done:o}=r.next())}catch(c){return void n.error(c)}o?n.complete():n.next(i)},0,!0)}),()=>or(r?.return)&&r.return()})}(e,t);if(K(e))return function aa(e,t){return Ha($(e),t)}(e,t)}throw mi(e)}(e,t):te(e)}function Bl(e,t,...n){if(!0===t)return void e();if(!1===t)return;const r=new ro({next:()=>{r.unsubscribe(),e()}});return t(...n).subscribe(r)}function Bn(e){for(let t in e)if(e[t]===Bn)return t;throw Error("Could not find renamed property on target object.")}function Mn(e){if("string"==typeof e)return e;if(Array.isArray(e))return"["+e.map(Mn).join(", ")+"]";if(null==e)return""+e;if(e.overriddenName)return`${e.overriddenName}`;if(e.name)return`${e.name}`;const t=e.toString();if(null==t)return""+t;const n=t.indexOf("\n");return-1===n?t:t.substring(0,n)}function Lu(e,t){return null==e||""===e?null===t?"":t:null==t||""===t?e:e+" "+t}const Pf=Bn({__forward_ref__:Bn});function Yn(e){return e.__forward_ref__=Yn,e.toString=function(){return Mn(this())},e}function Mt(e){return function Vl(e){return"function"==typeof e&&e.hasOwnProperty(Pf)&&e.__forward_ref__===Yn}(e)?e():e}class nt extends Error{constructor(t,n){super(function wn(e,t){return`NG0${Math.abs(e)}${t?": "+t.trim():""}`}(t,n)),this.code=t}}function $t(e){return"string"==typeof e?e:null==e?"":String(e)}function Nu(e,t){throw new nt(-201,!1)}function Ui(e,t){null==e&&function Rn(e,t,n,r){throw new Error(`ASSERTION ERROR: ${e}`+(null==r?"":` [Expected=> ${n} ${r} ${t} <=Actual]`))}(t,e,null,"!=")}function Ot(e){return{token:e.token,providedIn:e.providedIn||null,factory:e.factory,value:void 0}}function Ei(e){return{providers:e.providers||[],imports:e.imports||[]}}function Uu(e){return Nc(e,gn)||Nc(e,ju)}function Nc(e,t){return e.hasOwnProperty(t)?e[t]:null}function Ga(e){return e&&(e.hasOwnProperty($u)||e.hasOwnProperty(qa))?e[$u]:null}const gn=Bn({\u0275prov:Bn}),$u=Bn({\u0275inj:Bn}),ju=Bn({ngInjectableDef:Bn}),qa=Bn({ngInjectorDef:Bn});var Rt=(()=>((Rt=Rt||{})[Rt.Default=0]="Default",Rt[Rt.Host=1]="Host",Rt[Rt.Self=2]="Self",Rt[Rt.SkipSelf=4]="SkipSelf",Rt[Rt.Optional=8]="Optional",Rt))();let la;function lo(e){const t=la;return la=e,t}function Hu(e,t,n){const r=Uu(e);return r&&"root"==r.providedIn?void 0===r.value?r.value=r.factory():r.value:n&Rt.Optional?null:void 0!==t?t:void Nu(Mn(e))}function Wo(e){return{toString:e}.toString()}var Xo=(()=>((Xo=Xo||{})[Xo.OnPush=0]="OnPush",Xo[Xo.Default=1]="Default",Xo))(),ms=(()=>{return(e=ms||(ms={}))[e.Emulated=0]="Emulated",e[e.None=2]="None",e[e.ShadowDom=3]="ShadowDom",ms;var e})();const er=(()=>typeof globalThis<"u"&&globalThis||typeof global<"u"&&global||typeof window<"u"&&window||typeof self<"u"&&typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&self)(),ca={},Cn=[],Za=Bn({\u0275cmp:Bn}),zc=Bn({\u0275dir:Bn}),Bc=Bn({\u0275pipe:Bn}),id=Bn({\u0275mod:Bn}),To=Bn({\u0275fac:Bn}),ua=Bn({__NG_ELEMENT_ID__:Bn});let Ao=0;function Vs(e){return Wo(()=>{const n=!0===e.standalone,r={},i={type:e.type,providersResolver:null,decls:e.decls,vars:e.vars,factory:null,template:e.template||null,consts:e.consts||null,ngContentSelectors:e.ngContentSelectors,hostBindings:e.hostBindings||null,hostVars:e.hostVars||0,hostAttrs:e.hostAttrs||null,contentQueries:e.contentQueries||null,declaredInputs:r,inputs:null,outputs:null,exportAs:e.exportAs||null,onPush:e.changeDetection===Xo.OnPush,directiveDefs:null,pipeDefs:null,standalone:n,dependencies:n&&e.dependencies||null,getStandaloneInjector:null,selectors:e.selectors||Cn,viewQuery:e.viewQuery||null,features:e.features||null,data:e.data||{},encapsulation:e.encapsulation||ms.Emulated,id:"c"+Ao++,styles:e.styles||Cn,_:null,setInput:null,schemas:e.schemas||null,tView:null},o=e.dependencies,c=e.features;return i.inputs=Nf(e.inputs,r),i.outputs=Nf(e.outputs),c&&c.forEach(d=>d(i)),i.directiveDefs=o?()=>("function"==typeof o?o():o).map(sd).filter(Wa):null,i.pipeDefs=o?()=>("function"==typeof o?o():o).map(kt).filter(Wa):null,i})}function sd(e){return Nt(e)||Xr(e)}function Wa(e){return null!==e}function ai(e){return Wo(()=>({type:e.type,bootstrap:e.bootstrap||Cn,declarations:e.declarations||Cn,imports:e.imports||Cn,exports:e.exports||Cn,transitiveCompileScopes:null,schemas:e.schemas||null,id:e.id||null}))}function Nf(e,t){if(null==e)return ca;const n={};for(const r in e)if(e.hasOwnProperty(r)){let i=e[r],o=i;Array.isArray(i)&&(o=i[1],i=i[0]),n[i]=r,t&&(t[i]=o)}return n}const Lt=Vs;function $i(e){return{type:e.type,name:e.name,factory:null,pure:!1!==e.pure,standalone:!0===e.standalone,onDestroy:e.type.prototype.ngOnDestroy||null}}function Nt(e){return e[Za]||null}function Xr(e){return e[zc]||null}function kt(e){return e[Bc]||null}function cn(e,t){const n=e[id]||null;if(!n&&!0===t)throw new Error(`Type ${Mn(e)} does not have '\u0275mod' property.`);return n}function Xe(e){return Array.isArray(e)&&"object"==typeof e[1]}function ho(e){return Array.isArray(e)&&!0===e[1]}function cd(e){return 0!=(8&e.flags)}function Zu(e){return 2==(2&e.flags)}function jl(e){return 1==(1&e.flags)}function ko(e){return null!==e.template}function Uc(e){return 0!=(256&e[2])}function _s(e,t){return e.hasOwnProperty(To)?e[To]:null}class wt{constructor(t,n,r){this.previousValue=t,this.currentValue=n,this.firstChange=r}isFirstChange(){return this.firstChange}}function yt(){return el}function el(e){return e.type.prototype.ngOnChanges&&(e.setInput=md),pd}function pd(){const e=jc(this),t=e?.current;if(t){const n=e.previous;if(n===ca)e.previous=t;else for(let r in t)n[r]=t[r];e.current=null,this.ngOnChanges(t)}}function md(e,t,n,r){const i=jc(e)||function Ko(e,t){return e[Di]=t}(e,{previous:ca,current:null}),o=i.current||(i.current={}),c=i.previous,d=this.declaredInputs[n],p=c[d];o[d]=new wt(p&&p.currentValue,t,c===ca),e[r]=t}yt.ngInherit=!0;const Di="__ngSimpleChanges__";function jc(e){return e[Di]||null}function Sr(e){for(;Array.isArray(e);)e=e[0];return e}function Si(e,t){return Sr(t[e.index])}function Zl(e,t){return e.data[t]}function Mi(e,t){const n=t[e];return Xe(n)?n:n[0]}function Wl(e){return 64==(64&e[2])}function vs(e,t){return null==t?null:e[t]}function Hs(e){e[18]=0}function Xl(e,t){e[5]+=t;let n=e,r=e[3];for(;null!==r&&(1===t&&1===n[5]||-1===t&&0===n[5]);)r[5]+=t,n=r,r=r[3]}const Vt={lFrame:ie(null),bindingsEnabled:!0};function qc(){return Vt.bindingsEnabled}function He(){return Vt.lFrame.lView}function en(){return Vt.lFrame.tView}function ma(e){return Vt.lFrame.contextLView=e,e[8]}function Gs(e){return Vt.lFrame.contextLView=null,e}function Pr(){let e=ih();for(;null!==e&&64===e.type;)e=e.parent;return e}function ih(){return Vt.lFrame.currentTNode}function bs(e,t){const n=Vt.lFrame;n.currentTNode=e,n.isParent=t}function wd(){return Vt.lFrame.isParent}function h(){const e=Vt.lFrame;let t=e.bindingRootIndex;return-1===t&&(t=e.bindingRootIndex=e.tView.bindingStartIndex),t}function w(){return Vt.lFrame.bindingIndex++}function R(e,t){const n=Vt.lFrame;n.bindingIndex=n.bindingRootIndex=e,L(t)}function L(e){Vt.lFrame.currentDirectiveIndex=e}function Q(){return Vt.lFrame.currentQueryIndex}function ee(e){Vt.lFrame.currentQueryIndex=e}function Y(e){const t=e[1];return 2===t.type?t.declTNode:1===t.type?e[6]:null}function ae(e,t,n){if(n&Rt.SkipSelf){let i=t,o=e;for(;!(i=i.parent,null!==i||n&Rt.Host||(i=Y(o),null===i||(o=o[15],10&i.type))););if(null===i)return!1;t=i,e=o}const r=Vt.lFrame=ye();return r.currentTNode=t,r.lView=e,!0}function _e(e){const t=ye(),n=e[1];Vt.lFrame=t,t.currentTNode=n.firstChild,t.lView=e,t.tView=n,t.contextLView=e,t.bindingIndex=n.bindingStartIndex,t.inI18n=!1}function ye(){const e=Vt.lFrame,t=null===e?null:e.child;return null===t?ie(e):t}function ie(e){const t={currentTNode:null,isParent:!0,lView:null,tView:null,selectedIndex:-1,contextLView:null,elementDepthCount:0,currentNamespace:null,currentDirectiveIndex:-1,bindingRootIndex:-1,bindingIndex:-1,currentQueryIndex:0,parent:e,child:null,inI18n:!1};return null!==e&&(e.child=t),t}function we(){const e=Vt.lFrame;return Vt.lFrame=e.parent,e.currentTNode=null,e.lView=null,e}const De=we;function Se(){const e=we();e.isParent=!0,e.tView=null,e.selectedIndex=-1,e.contextLView=null,e.elementDepthCount=0,e.currentDirectiveIndex=-1,e.currentNamespace=null,e.bindingRootIndex=-1,e.bindingIndex=-1,e.currentQueryIndex=0}function Le(){return Vt.lFrame.selectedIndex}function Ne(e){Vt.lFrame.selectedIndex=e}function ht(){Vt.lFrame.currentNamespace="svg"}function Ht(e,t){for(let n=t.directiveStart,r=t.directiveEnd;n=r)break}else t[p]<0&&(e[18]+=65536),(d>11>16&&(3&e[2])===t){e[2]+=2048;try{o.call(d)}finally{}}}else try{o.call(d)}finally{}}class li{constructor(t,n,r){this.factory=t,this.resolving=!1,this.canSeeViewProviders=n,this.injectImpl=r}}function Yr(e,t,n){let r=0;for(;rt){c=o-1;break}}}for(;o>16}(e),r=t;for(;n>0;)r=r[15],n--;return r}let Cd=!0;function Mr(e){const t=Cd;return Cd=e,t}let Ed=0;const _a={};function lh(e,t){const n=Zm(e,t);if(-1!==n)return n;const r=t[1];r.firstCreatePass&&(e.injectorIndex=t.length,Zf(r.data,e),Zf(t,null),Zf(r.blueprint,null));const i=ch(e,t),o=e.injectorIndex;if(ya(i)){const c=Zs(i),d=xs(i,t),p=d[1].data;for(let v=0;v<8;v++)t[o+v]=d[c+v]|p[c+v]}return t[o+8]=i,o}function Zf(e,t){e.push(0,0,0,0,0,0,0,0,t)}function Zm(e,t){return-1===e.injectorIndex||e.parent&&e.parent.injectorIndex===e.injectorIndex||null===t[e.injectorIndex+8]?-1:e.injectorIndex}function ch(e,t){if(e.parent&&-1!==e.parent.injectorIndex)return e.parent.injectorIndex;let n=0,r=null,i=t;for(;null!==i;){if(r=R_(i),null===r)return-1;if(n++,i=i[15],-1!==r.injectorIndex)return r.injectorIndex|n<<16}return-1}function Dd(e,t,n){!function qf(e,t,n){let r;"string"==typeof n?r=n.charCodeAt(0)||0:n.hasOwnProperty(ua)&&(r=n[ua]),null==r&&(r=n[ua]=Ed++);const i=255&r;t.data[e+(i>>5)]|=1<=0?255&t:Wx:t}(n);if("function"==typeof o){if(!ae(t,e,r))return r&Rt.Host?uh(i,0,r):Oo(t,n,r,i);try{const c=o(r);if(null!=c||r&Rt.Optional)return c;Nu()}finally{De()}}else if("number"==typeof o){let c=null,d=Zm(e,t),p=-1,v=r&Rt.Host?t[16][6]:null;for((-1===d||r&Rt.SkipSelf)&&(p=-1===d?ch(e,t):t[d+8],-1!==p&&Kl(r,!1)?(c=t[1],d=Zs(p),t=xs(p,t)):d=-1);-1!==d;){const E=t[1];if(Ym(o,d,E.data)){const D=Zx(d,t,n,c,r,v);if(D!==_a)return D}p=t[d+8],-1!==p&&Kl(r,t[1].data[d+8]===v)&&Ym(o,d,t)?(c=E,d=Zs(p),t=xs(p,t)):d=-1}}return i}function Zx(e,t,n,r,i,o){const c=t[1],d=c.data[e+8],E=Wf(d,c,n,null==r?Zu(d)&&Cd:r!=c&&0!=(3&d.type),i&Rt.Host&&o===d);return null!==E?rl(t,c,E,d):_a}function Wf(e,t,n,r,i){const o=e.providerIndexes,c=t.data,d=1048575&o,p=e.directiveStart,E=o>>20,I=i?d+E:e.directiveEnd;for(let P=r?d:d+E;P=p&&N.type===n)return P}if(i){const P=c[p];if(P&&ko(P)&&P.type===n)return p}return null}function rl(e,t,n,r){let i=e[n];const o=t.data;if(function Ii(e){return e instanceof li}(i)){const c=i;c.resolving&&function Xh(e,t){const n=t?`. Dependency path: ${t.join(" > ")} > ${e}`:"";throw new nt(-200,`Circular dependency in DI detected for ${e}${n}`)}(function yn(e){return"function"==typeof e?e.name||e.toString():"object"==typeof e&&null!=e&&"function"==typeof e.type?e.type.name||e.type.toString():$t(e)}(o[n]));const d=Mr(c.canSeeViewProviders);c.resolving=!0;const p=c.injectImpl?lo(c.injectImpl):null;ae(e,r,Rt.Default);try{i=e[n]=c.factory(void 0,o,e,r),t.firstCreatePass&&n>=r.directiveStart&&function An(e,t,n){const{ngOnChanges:r,ngOnInit:i,ngDoCheck:o}=t.type.prototype;if(r){const c=el(t);(n.preOrderHooks||(n.preOrderHooks=[])).push(e,c),(n.preOrderCheckHooks||(n.preOrderCheckHooks=[])).push(e,c)}i&&(n.preOrderHooks||(n.preOrderHooks=[])).push(0-e,i),o&&((n.preOrderHooks||(n.preOrderHooks=[])).push(e,o),(n.preOrderCheckHooks||(n.preOrderCheckHooks=[])).push(e,o))}(n,o[n],t)}finally{null!==p&&lo(p),Mr(d),c.resolving=!1,De()}}return i}function Ym(e,t,n){return!!(n[t+(e>>5)]&1<{const r=function Jm(e){return function(...n){if(e){const r=e(...n);for(const i in r)this[i]=r[i]}}}(t);function i(...o){if(this instanceof i)return r.apply(this,o),this;const c=new i(...o);return d.annotation=c,d;function d(p,v,E){const D=p.hasOwnProperty(Jl)?p[Jl]:Object.defineProperty(p,Jl,{value:[]})[Jl];for(;D.length<=E;)D.push(null);return(D[E]=D[E]||[]).push(c),p}}return n&&(i.prototype=Object.create(n.prototype)),i.prototype.ngMetadataName=e,i.annotationCls=i,i})}class It{constructor(t,n){this._desc=t,this.ngMetadataName="InjectionToken",this.\u0275prov=void 0,"number"==typeof n?this.__NG_ELEMENT_ID__=n:void 0!==n&&(this.\u0275prov=Ot({token:this,providedIn:n.providedIn||"root",factory:n.factory}))}get multi(){return this}toString(){return`InjectionToken ${this._desc}`}}function go(e,t){void 0===t&&(t=e);for(let n=0;nArray.isArray(n)?il(n,t):t(n))}function z_(e,t,n){t>=e.length?e.push(n):e.splice(t,0,n)}function Qf(e,t){return t>=e.length-1?e.pop():e.splice(t,1)[0]}const ol={},tp="__NG_DI_FLAG__",np="ngTempTokenPath",s1=/\n/gm,$_="__source";let Rd;function Xc(e){const t=Rd;return Rd=e,t}function sg(e,t=Rt.Default){if(void 0===Rd)throw new nt(-203,!1);return null===Rd?Hu(e,void 0,t):Rd.get(e,t&Rt.Optional?null:void 0,t)}function St(e,t=Rt.Default){return(function $l(){return la}()||sg)(Mt(e),t)}function Fr(e,t=Rt.Default){return"number"!=typeof t&&(t=0|(t.optional&&8)|(t.host&&1)|(t.self&&2)|(t.skipSelf&&4)),St(e,t)}function rp(e){const t=[];for(let n=0;n((Wi=Wi||{})[Wi.Important=1]="Important",Wi[Wi.DashCase=2]="DashCase",Wi))();const lp=new Map;let ec=0;const up="__ngContext__";function ui(e,t){Xe(t)?(e[up]=t[20],function K_(e){lp.set(e[20],e)}(t)):e[up]=t}function wg(e,t){return undefined(e,t)}function Ud(e){const t=e[3];return ho(t)?t[3]:t}function _h(e){return rv(e[13])}function $d(e){return rv(e[4])}function rv(e){for(;null!==e&&!ho(e);)e=e[4];return e}function nc(e,t,n,r,i){if(null!=r){let o,c=!1;ho(r)?o=r:Xe(r)&&(c=!0,r=r[0]);const d=Sr(r);0===e&&null!==n?null==i?Ig(t,n,d):oc(t,n,d,i||null,!0):1===e&&null!==n?oc(t,n,d,i||null,!0):2===e?function qd(e,t,n){const r=vh(e,t);r&&function gp(e,t,n,r){e.removeChild(t,n,r)}(e,r,t,n)}(t,d,c):3===e&&t.destroyNode(d),null!=o&&function k1(e,t,n,r,i){const o=n[7];o!==Sr(n)&&nc(t,e,r,o,i);for(let d=10;d0&&(e[n-1][4]=r[4]);const o=Qf(e,10+t);!function pp(e,t){al(e,t,t[11],2,null,null),t[0]=null,t[6]=null}(r[1],r);const c=o[19];null!==c&&c.detachView(o[1]),r[3]=null,r[4]=null,r[2]&=-65}return r}function br(e,t){if(!(128&t[2])){const n=t[11];n.destroyNode&&al(e,t,n,3,null,null),function M1(e){let t=e[13];if(!t)return ic(e[1],e);for(;t;){let n=null;if(Xe(t))n=t[13];else{const r=t[10];r&&(n=r)}if(!n){for(;t&&!t[4]&&t!==e;)Xe(t)&&ic(t[1],t),t=t[3];null===t&&(t=e),Xe(t)&&ic(t[1],t),n=t&&t[4]}t=n}}(t)}}function ic(e,t){if(!(128&t[2])){t[2]&=-65,t[2]|=128,function lv(e,t){let n;if(null!=e&&null!=(n=e.destroyHooks))for(let r=0;r=0?r[i=v]():r[i=-v].unsubscribe(),o+=2}else{const c=r[i=n[o+1]];n[o].call(c)}if(null!==r){for(let o=i+1;o{const c=o;zg(c,n,[],r)&&(i||(i=[]),i.push(c))}),void 0!==i&&uv(i,n),n}function uv(e,t){for(let n=0;n{t.push(o)})}}function zg(e,t,n,r){if(!(e=Mt(e)))return!1;let i=null,o=Ga(e);const c=!o&&Nt(e);if(o||c){if(c&&!c.standalone)return!1;i=e}else{const p=e.ngModule;if(o=Ga(p),!o)return!1;i=p}const d=r.has(i);if(c){if(d)return!1;if(r.add(i),c.dependencies){const p="function"==typeof c.dependencies?c.dependencies():c.dependencies;for(const v of p)zg(v,t,n,r)}}else{if(!o)return!1;{if(null!=o.imports&&!d){let v;r.add(i);try{il(o.imports,E=>{zg(E,t,n,r)&&(v||(v=[]),v.push(E))})}finally{}void 0!==v&&uv(v,t)}if(!d){const v=_s(i)||(()=>new i);t.push({provide:i,useFactory:v,deps:Cn},{provide:Og,useValue:i,multi:!0},{provide:Wd,useValue:()=>St(i),multi:!0})}const p=o.providers;null==p||d||il(p,E=>{t.push(E)})}}return i!==e&&void 0!==e.providers}const F1=Bn({provide:String,useValue:Bn});function Bg(e){return null!==e&&"object"==typeof e&&F1 in e}function eu(e){return"function"==typeof e}const wh=new It("Set Injector scope."),Xd={},bo={};let Ss;function ac(){return void 0===Ss&&(Ss=new xp),Ss}class Ms{}class Vg extends Ms{constructor(t,n,r,i){super(),this.parent=n,this.source=r,this.scopes=i,this.records=new Map,this._ngOnDestroyHooks=new Set,this._onDestroyHooks=[],this._destroyed=!1,O1(t,c=>this.processProvider(c)),this.records.set(xa,wp(void 0,this)),i.has("environment")&&this.records.set(Ms,wp(void 0,this));const o=this.records.get(wh);null!=o&&"string"==typeof o.value&&this.scopes.add(o.value),this.injectorDefTypes=new Set(this.get(Og.multi,Cn,Rt.Self))}get destroyed(){return this._destroyed}destroy(){this.assertNotDestroyed(),this._destroyed=!0;try{for(const t of this._ngOnDestroyHooks)t.ngOnDestroy();for(const t of this._onDestroyHooks)t()}finally{this.records.clear(),this._ngOnDestroyHooks.clear(),this.injectorDefTypes.clear(),this._onDestroyHooks.length=0}}onDestroy(t){this._onDestroyHooks.push(t)}runInContext(t){this.assertNotDestroyed();const n=Xc(this),r=lo(void 0);try{return t()}finally{Xc(n),lo(r)}}get(t,n=ol,r=Rt.Default){this.assertNotDestroyed();const i=Xc(this),o=lo(void 0);try{if(!(r&Rt.SkipSelf)){let d=this.records.get(t);if(void 0===d){const p=function N6(e){return"function"==typeof e||"object"==typeof e&&e instanceof It}(t)&&Uu(t);d=p&&this.injectableDefInScope(p)?wp(ul(t),Xd):null,this.records.set(t,d)}if(null!=d)return this.hydrate(t,d)}return(r&Rt.Self?ac():this.parent).get(t,n=r&Rt.Optional&&n===ol?null:n)}catch(c){if("NullInjectorError"===c.name){if((c[np]=c[np]||[]).unshift(Mn(t)),i)throw c;return function c1(e,t,n,r){const i=e[np];throw t[$_]&&i.unshift(t[$_]),e.message=function j_(e,t,n,r=null){e=e&&"\n"===e.charAt(0)&&"\u0275"==e.charAt(1)?e.slice(2):e;let i=Mn(t);if(Array.isArray(t))i=t.map(Mn).join(" -> ");else if("object"==typeof t){let o=[];for(let c in t)if(t.hasOwnProperty(c)){let d=t[c];o.push(c+":"+("string"==typeof d?JSON.stringify(d):Mn(d)))}i=`{${o.join(", ")}}`}return`${n}${r?"("+r+")":""}[${i}]: ${e.replace(s1,"\n ")}`}("\n"+e.message,i,n,r),e.ngTokenPath=i,e[np]=null,e}(c,t,"R3InjectorError",this.source)}throw c}finally{lo(o),Xc(i)}}resolveInjectorInitializers(){const t=Xc(this),n=lo(void 0);try{const r=this.get(Wd.multi,Cn,Rt.Self);for(const i of r)i()}finally{Xc(t),lo(n)}}toString(){const t=[],n=this.records;for(const r of n.keys())t.push(Mn(r));return`R3Injector[${t.join(", ")}]`}assertNotDestroyed(){if(this._destroyed)throw new nt(205,!1)}processProvider(t){let n=eu(t=Mt(t))?t:Mt(t&&t.provide);const r=function F6(e){return Bg(e)?wp(void 0,e.useValue):wp(function O2(e,t,n){let r;if(eu(e)){const i=Mt(e);return _s(i)||ul(i)}if(Bg(e))r=()=>Mt(e.useValue);else if(function dv(e){return!(!e||!e.useFactory)}(e))r=()=>e.useFactory(...rp(e.deps||[]));else if(function hv(e){return!(!e||!e.useExisting)}(e))r=()=>St(Mt(e.useExisting));else{const i=Mt(e&&(e.useClass||e.provide));if(!function O6(e){return!!e.deps}(e))return _s(i)||ul(i);r=()=>new i(...rp(e.deps))}return r}(e),Xd)}(t);if(eu(t)||!0!==t.multi)this.records.get(n);else{let i=this.records.get(n);i||(i=wp(void 0,Xd,!0),i.factory=()=>rp(i.multi),this.records.set(n,i)),n=t,i.multi.push(t)}this.records.set(n,r)}hydrate(t,n){return n.value===Xd&&(n.value=bo,n.value=n.factory()),"object"==typeof n.value&&n.value&&function L6(e){return null!==e&&"object"==typeof e&&"function"==typeof e.ngOnDestroy}(n.value)&&this._ngOnDestroyHooks.add(n.value),n.value}injectableDefInScope(t){if(!t.providedIn)return!1;const n=Mt(t.providedIn);return"string"==typeof n?"any"===n||this.scopes.has(n):this.injectorDefTypes.has(n)}}function ul(e){const t=Uu(e),n=null!==t?t.factory:_s(e);if(null!==n)return n;if(e instanceof It)throw new nt(204,!1);if(e instanceof Function)return function R6(e){const t=e.length;if(t>0)throw function Ad(e,t){const n=[];for(let r=0;rn.factory(e):()=>new e}(e);throw new nt(204,!1)}function wp(e,t,n=!1){return{factory:e,value:t,multi:n?[]:void 0}}function z6(e){return!!e.\u0275providers}function O1(e,t){for(const n of e)Array.isArray(n)?O1(n,t):z6(n)?O1(n.\u0275providers,t):t(n)}class L2{}class U6{resolveComponentFactory(t){throw function V6(e){const t=Error(`No component factory found for ${Mn(e)}. Did you add it to @NgModule.entryComponents?`);return t.ngComponent=e,t}(t)}}let Ug=(()=>{class e{}return e.NULL=new U6,e})();function $6(){return Cp(Pr(),He())}function Cp(e,t){return new Xs(Si(e,t))}let Xs=(()=>{class e{constructor(n){this.nativeElement=n}}return e.__NG_ELEMENT_ID__=$6,e})();function j6(e){return e instanceof Xs?e.nativeElement:e}class z2{}let hl=(()=>{class e{}return e.__NG_ELEMENT_ID__=()=>function H6(){const e=He(),n=Mi(Pr().index,e);return(Xe(n)?n:e)[11]}(),e})(),G6=(()=>{class e{}return e.\u0275prov=Ot({token:e,providedIn:"root",factory:()=>null}),e})();class $g{constructor(t){this.full=t,this.major=t.split(".")[0],this.minor=t.split(".")[1],this.patch=t.split(".").slice(2).join(".")}}const q6=new $g("14.3.0"),L1={};function z1(e){return e.ngOriginalError}class Ep{constructor(){this._console=console}handleError(t){const n=this._findOriginalError(t);this._console.error("ERROR",t),n&&this._console.error("ORIGINAL ERROR",n)}_findOriginalError(t){let n=t&&z1(t);for(;n&&z1(n);)n=z1(n);return n||null}}function tu(e){return e instanceof Function?e():e}function V2(e,t,n){let r=e.length;for(;;){const i=e.indexOf(t,n);if(-1===i)return i;if(0===i||e.charCodeAt(i-1)<=32){const o=t.length;if(i+o===r||e.charCodeAt(i+o)<=32)return i}n=i+1}}const U2="ng-template";function rz(e,t,n){let r=0;for(;ro?"":i[D+1].toLowerCase();const P=8&r?I:null;if(P&&-1!==V2(P,v,0)||2&r&&v!==I){if(dl(r))return!1;c=!0}}}}else{if(!c&&!dl(r)&&!dl(p))return!1;if(c&&dl(p))continue;c=!1,r=p|1&r}}return dl(r)||c}function dl(e){return 0==(1&e)}function sz(e,t,n,r){if(null===t)return-1;let i=0;if(r||!n){let o=!1;for(;i-1)for(n++;n0?'="'+d+'"':"")+"]"}else 8&r?i+="."+c:4&r&&(i+=" "+c);else""!==i&&!dl(c)&&(t+=H2(o,i),i=""),r=c,o=o||!dl(r);n++}return""!==i&&(t+=H2(o,i)),t}const tn={};function xo(e){G2(en(),He(),Le()+e,!1)}function G2(e,t,n,r){if(!r)if(3==(3&t[2])){const o=e.preOrderCheckHooks;null!==o&&on(t,o,n)}else{const o=e.preOrderHooks;null!==o&&Fn(t,o,0,n)}Ne(n)}function X2(e,t=null,n=null,r){const i=Y2(e,t,n,r);return i.resolveInjectorInitializers(),i}function Y2(e,t=null,n=null,r,i=new Set){const o=[n||Cn,Lg(e)];return r=r||("object"==typeof e?void 0:Mn(e)),new Vg(o,t||ac(),r||null,i)}let Ys=(()=>{class e{static create(n,r){if(Array.isArray(n))return X2({name:""},r,n,"");{const i=n.name??"";return X2({name:i},n.parent,n.providers,i)}}}return e.THROW_IF_NOT_FOUND=ol,e.NULL=new xp,e.\u0275prov=Ot({token:e,providedIn:"any",factory:()=>St(xa)}),e.__NG_ELEMENT_ID__=-1,e})();function qe(e,t=Rt.Default){const n=He();return null===n?St(e,t):Xm(Pr(),n,Mt(e),t)}function j1(){throw new Error("invalid")}function fM(e,t){const n=e.contentQueries;if(null!==n)for(let r=0;r22&&G2(e,t,22,!1),n(r,i)}finally{Ne(o)}}function nw(e,t,n){!qc()||(function Jz(e,t,n,r){const i=n.directiveStart,o=n.directiveEnd;e.firstCreatePass||lh(n,t),ui(r,t);const c=n.initialInputs;for(let d=i;d0;){const n=e[--t];if("number"==typeof n&&n<0)return n}return 0})(d)!=p&&d.push(p),d.push(r,i,c)}}function wM(e,t){null!==e.hostBindings&&e.hostBindings(1,t)}function CM(e,t){t.flags|=2,(e.components||(e.components=[])).push(t.index)}function n8(e,t,n){if(n){if(t.exportAs)for(let r=0;r0&&aw(n)}}function aw(e){for(let r=_h(e);null!==r;r=$d(r))for(let i=10;i0&&aw(o)}const n=e[1].components;if(null!==n)for(let r=0;r0&&aw(i)}}function c8(e,t){const n=Mi(t,e),r=n[1];(function u8(e,t){for(let n=t.length;n-1&&(jd(t,r),Qf(n,r))}this._attachedToViewContainer=!1}br(this._lView[1],this._lView)}onDestroy(t){yM(this._lView[1],this._lView,null,t)}markForCheck(){lw(this._cdRefInjectingView||this._lView)}detach(){this._lView[2]&=-65}reattach(){this._lView[2]|=64}detectChanges(){bv(this._lView[1],this._lView,this.context)}checkNoChanges(){}attachToViewContainerRef(){if(this._appRef)throw new nt(902,!1);this._attachedToViewContainer=!0}detachFromAppRef(){this._appRef=null,function S1(e,t){al(e,t,t[11],2,null,null)}(this._lView[1],this._lView)}attachToAppRef(t){if(this._attachedToViewContainer)throw new nt(902,!1);this._appRef=t}}class h8 extends jg{constructor(t){super(t),this._view=t}detectChanges(){const t=this._view;bv(t[1],t,t[8],!1)}checkNoChanges(){}get context(){return null}}class hw extends Ug{constructor(t){super(),this.ngModule=t}resolveComponentFactory(t){const n=Nt(t);return new Hg(n,this.ngModule)}}function kM(e){const t=[];for(let n in e)e.hasOwnProperty(n)&&t.push({propName:e[n],templateName:n});return t}class f8{constructor(t,n){this.injector=t,this.parentInjector=n}get(t,n,r){const i=this.injector.get(t,L1,r);return i!==L1||n===L1?i:this.parentInjector.get(t,n,r)}}class Hg extends L2{constructor(t,n){super(),this.componentDef=t,this.ngModule=n,this.componentType=t.type,this.selector=function dz(e){return e.map(hz).join(",")}(t.selectors),this.ngContentSelectors=t.ngContentSelectors?t.ngContentSelectors:[],this.isBoundToModule=!!n}get inputs(){return kM(this.componentDef.inputs)}get outputs(){return kM(this.componentDef.outputs)}create(t,n,r,i){let o=(i=i||this.ngModule)instanceof Ms?i:i?.injector;o&&null!==this.componentDef.getStandaloneInjector&&(o=this.componentDef.getStandaloneInjector(o)||o);const c=o?new f8(t,o):t,d=c.get(z2,null);if(null===d)throw new nt(407,!1);const p=c.get(G6,null),v=d.createRenderer(null,this.componentDef),E=this.componentDef.selectors[0][0]||"div",D=r?function qz(e,t,n){return e.selectRootElement(t,n===ms.ShadowDom)}(v,r,this.componentDef.encapsulation):fp(v,E,function d8(e){const t=e.toLowerCase();return"svg"===t?"svg":"math"===t?"math":null}(E)),I=this.componentDef.onPush?288:272,P=iw(0,null,null,1,0,null,null,null,null,null),N=yv(null,P,null,I,null,null,d,v,p,c,null);let G,U;_e(N);try{const Z=function g8(e,t,n,r,i,o){const c=n[1];n[22]=e;const p=Mp(c,22,2,"#host",null),v=p.mergedAttrs=t.hostAttrs;null!==v&&(xv(p,v,!0),null!==e&&(Yr(i,e,v),null!==p.classes&&xh(i,e,p.classes),null!==p.styles&&vp(i,e,p.styles)));const E=r.createRenderer(e,t),D=yv(n,gM(t),null,t.onPush?32:16,n[22],p,r,E,o||null,null,null);return c.firstCreatePass&&(Dd(lh(p,n),c,t.type),CM(c,p),EM(p,n.length,1)),vv(n,D),n[22]=D}(D,this.componentDef,N,d,v);if(D)if(r)Yr(v,D,["ng-version",q6.full]);else{const{attrs:ne,classes:X}=function fz(e){const t=[],n=[];let r=1,i=2;for(;r0&&xh(v,D,X.join(" "))}if(U=Zl(P,22),void 0!==n){const ne=U.projection=[];for(let X=0;Xd(Sr(fe[r.index])):r.index;let re=null;if(!d&&p&&(re=function O8(e,t,n,r){const i=e.cleanup;if(null!=i)for(let o=0;op?d[p]:null}"string"==typeof c&&(o+=2)}return null}(e,t,i,r.index)),null!==re)(re.__ngLastListenerFn__||re).__ngNextListenerFn__=o,re.__ngLastListenerFn__=o,P=!1;else{o=ZM(r,t,D,o,!1);const fe=n.listen(Z,i,o);I.push(o,fe),E&&E.push(i,X,ne,ne+1)}}else o=ZM(r,t,D,o,!1);const N=r.outputs;let G;if(P&&null!==N&&(G=N[i])){const U=G.length;if(U)for(let Z=0;Z0;)t=t[15],e--;return t}(e,Vt.lFrame.contextLView))[8]}(e)}function Co(e,t=""){const n=He(),r=en(),i=e+22,o=r.firstCreatePass?Mp(r,i,1,t,null):r.data[i],c=n[i]=function rc(e,t){return e.createText(t)}(n[11],t);Hd(r,n,c,o),bs(o,!1)}function Up(e){return Jd("",e,""),Up}function Jd(e,t,n){const r=He(),i=function Ap(e,t,n,r){return Bo(e,w(),n)?t+$t(n)+r:tn}(r,e,t,n);return i!==tn&&ru(r,Le(),i),Jd}const Qd=void 0;var wB=["en",[["a","p"],["AM","PM"],Qd],[["AM","PM"],Qd,Qd],[["S","M","T","W","T","F","S"],["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],["Su","Mo","Tu","We","Th","Fr","Sa"]],Qd,[["J","F","M","A","M","J","J","A","S","O","N","D"],["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],["January","February","March","April","May","June","July","August","September","October","November","December"]],Qd,[["B","A"],["BC","AD"],["Before Christ","Anno Domini"]],0,[6,0],["M/d/yy","MMM d, y","MMMM d, y","EEEE, MMMM d, y"],["h:mm a","h:mm:ss a","h:mm:ss a z","h:mm:ss a zzzz"],["{1}, {0}",Qd,"{1} 'at' {0}",Qd],[".",",",";","%","+","-","E","\xd7","\u2030","\u221e","NaN",":"],["#,##0.###","#,##0%","\xa4#,##0.00","#E0"],"USD","$","US Dollar",{},"ltr",function xB(e){const n=Math.floor(Math.abs(e)),r=e.toString().replace(/^[^.]*\.?/,"").length;return 1===n&&0===r?1:5}];let $p={};function is(e){const t=function CB(e){return e.toLowerCase().replace(/_/g,"-")}(e);let n=NI(t);if(n)return n;const r=t.split("-")[0];if(n=NI(r),n)return n;if("en"===r)return wB;throw new nt(701,!1)}function NI(e){return e in $p||($p[e]=er.ng&&er.ng.common&&er.ng.common.locales&&er.ng.common.locales[e]),$p[e]}var vt=(()=>((vt=vt||{})[vt.LocaleId=0]="LocaleId",vt[vt.DayPeriodsFormat=1]="DayPeriodsFormat",vt[vt.DayPeriodsStandalone=2]="DayPeriodsStandalone",vt[vt.DaysFormat=3]="DaysFormat",vt[vt.DaysStandalone=4]="DaysStandalone",vt[vt.MonthsFormat=5]="MonthsFormat",vt[vt.MonthsStandalone=6]="MonthsStandalone",vt[vt.Eras=7]="Eras",vt[vt.FirstDayOfWeek=8]="FirstDayOfWeek",vt[vt.WeekendRange=9]="WeekendRange",vt[vt.DateFormat=10]="DateFormat",vt[vt.TimeFormat=11]="TimeFormat",vt[vt.DateTimeFormat=12]="DateTimeFormat",vt[vt.NumberSymbols=13]="NumberSymbols",vt[vt.NumberFormats=14]="NumberFormats",vt[vt.CurrencyCode=15]="CurrencyCode",vt[vt.CurrencySymbol=16]="CurrencySymbol",vt[vt.CurrencyName=17]="CurrencyName",vt[vt.Currencies=18]="Currencies",vt[vt.Directionality=19]="Directionality",vt[vt.PluralCase=20]="PluralCase",vt[vt.ExtraData=21]="ExtraData",vt))();const jp="en-US";let zI=jp;class ef{}class uT{}class hT extends ef{constructor(t,n){super(),this._parent=n,this._bootstrapComponents=[],this.destroyCbs=[],this.componentFactoryResolver=new hw(this);const r=cn(t);this._bootstrapComponents=tu(r.bootstrap),this._r3Injector=Y2(t,n,[{provide:ef,useValue:this},{provide:Ug,useValue:this.componentFactoryResolver}],Mn(t),new Set(["environment"])),this._r3Injector.resolveInjectorInitializers(),this.instance=this._r3Injector.get(t)}get injector(){return this._r3Injector}destroy(){const t=this._r3Injector;!t.destroyed&&t.destroy(),this.destroyCbs.forEach(n=>n()),this.destroyCbs=null}onDestroy(t){this.destroyCbs.push(t)}}class Sw extends uT{constructor(t){super(),this.moduleType=t}create(t){return new hT(this.moduleType,t)}}class wV extends ef{constructor(t,n,r){super(),this.componentFactoryResolver=new hw(this),this.instance=null;const i=new Vg([...t,{provide:ef,useValue:this},{provide:Ug,useValue:this.componentFactoryResolver}],n||ac(),r,new Set(["environment"]));this.injector=i,i.resolveInjectorInitializers()}destroy(){this.injector.destroy()}onDestroy(t){this.injector.onDestroy(t)}}function Pv(e,t,n=null){return new wV(e,t,n).injector}let CV=(()=>{class e{constructor(n){this._injector=n,this.cachedInjectors=new Map}getOrCreateStandaloneInjector(n){if(!n.standalone)return null;if(!this.cachedInjectors.has(n.id)){const r=Ng(0,n.type),i=r.length>0?Pv([r],this._injector,`Standalone[${n.type.name}]`):null;this.cachedInjectors.set(n.id,i)}return this.cachedInjectors.get(n.id)}ngOnDestroy(){try{for(const n of this.cachedInjectors.values())null!==n&&n.destroy()}finally{this.cachedInjectors.clear()}}}return e.\u0275prov=Ot({token:e,providedIn:"environment",factory:()=>new e(St(Ms))}),e})();function dT(e){e.getStandaloneInjector=t=>t.get(CV).getOrCreateStandaloneInjector(e)}function Iw(e,t,n,r){return function bT(e,t,n,r,i,o){const c=t+n;return Bo(e,c,i)?cc(e,c+1,o?r.call(o,i):r(i)):ey(e,c+1)}(He(),h(),e,t,n,r)}function vT(e,t,n,r,i,o){return function wT(e,t,n,r,i,o,c,d){const p=t+n;return function Ev(e,t,n,r,i){const o=Kd(e,t,n,r);return Bo(e,t+2,i)||o}(e,p,i,o,c)?cc(e,p+3,d?r.call(d,i,o,c):r(i,o,c)):ey(e,p+3)}(He(),h(),e,t,n,r,i,o)}function ey(e,t){const n=e[t];return n===tn?void 0:n}function ST(e,t,n,r){const i=e+22,o=He(),c=function pa(e,t){return e[t]}(o,i);return function ty(e,t){return e[1].data[t].pure}(o,i)?function xT(e,t,n,r,i,o,c){const d=t+n;return Kd(e,d,i,o)?cc(e,d+2,c?r.call(c,i,o):r(i,o)):ey(e,d+2)}(o,h(),t,c.transform,n,r,c):c.transform(n,r)}function Tw(e){return t=>{setTimeout(e,void 0,t)}}const Qr=class GV extends oi{constructor(t=!1){super(),this.__isAsync=t}emit(t){super.next(t)}subscribe(t,n,r){let i=t,o=n||(()=>null),c=r;if(t&&"object"==typeof t){const p=t;i=p.next?.bind(p),o=p.error?.bind(p),c=p.complete?.bind(p)}this.__isAsync&&(o=Tw(o),i&&(i=Tw(i)),c&&(c=Tw(c)));const d=super.subscribe({next:i,error:o,complete:c});return t instanceof _r&&t.add(d),d}};function qV(){return this._results[Yd()]()}class Aw{constructor(t=!1){this._emitDistinctChangesOnly=t,this.dirty=!0,this._results=[],this._changesDetected=!1,this._changes=null,this.length=0,this.first=void 0,this.last=void 0;const n=Yd(),r=Aw.prototype;r[n]||(r[n]=qV)}get changes(){return this._changes||(this._changes=new Qr)}get(t){return this._results[t]}map(t){return this._results.map(t)}filter(t){return this._results.filter(t)}find(t){return this._results.find(t)}reduce(t,n){return this._results.reduce(t,n)}forEach(t){this._results.forEach(t)}some(t){return this._results.some(t)}toArray(){return this._results.slice()}toString(){return this._results.toString()}reset(t,n){const r=this;r.dirty=!1;const i=go(t);(this._changesDetected=!function tg(e,t,n){if(e.length!==t.length)return!1;for(let r=0;r{class e{}return e.__NG_ELEMENT_ID__=XV,e})();const ZV=iu,WV=class extends ZV{constructor(t,n,r){super(),this._declarationLView=t,this._declarationTContainer=n,this.elementRef=r}createEmbeddedView(t,n){const r=this._declarationTContainer.tViews,i=yv(this._declarationLView,r,t,16,null,r.declTNode,null,null,null,null,n||null);i[17]=this._declarationLView[this._declarationTContainer.index];const c=this._declarationLView[19];return null!==c&&(i[19]=c.createEmbeddedView(r)),tw(r,i,t),new jg(i)}};function XV(){return Rv(Pr(),He())}function Rv(e,t){return 4&e.type?new WV(t,e,Cp(e,t)):null}let gl=(()=>{class e{}return e.__NG_ELEMENT_ID__=YV,e})();function YV(){return TT(Pr(),He())}const KV=gl,MT=class extends KV{constructor(t,n,r){super(),this._lContainer=t,this._hostTNode=n,this._hostLView=r}get element(){return Cp(this._hostTNode,this._hostLView)}get injector(){return new va(this._hostTNode,this._hostLView)}get parentInjector(){const t=ch(this._hostTNode,this._hostLView);if(ya(t)){const n=xs(t,this._hostLView),r=Zs(t);return new va(n[1].data[r+8],n)}return new va(null,this._hostLView)}clear(){for(;this.length>0;)this.remove(this.length-1)}get(t){const n=IT(this._lContainer);return null!==n&&n[t]||null}get length(){return this._lContainer.length-10}createEmbeddedView(t,n,r){let i,o;"number"==typeof r?i=r:null!=r&&(i=r.index,o=r.injector);const c=t.createEmbeddedView(n||{},o);return this.insert(c,i),c}createComponent(t,n,r,i,o){const c=t&&!function Td(e){return"function"==typeof e}(t);let d;if(c)d=n;else{const D=n||{};d=D.index,r=D.injector,i=D.projectableNodes,o=D.environmentInjector||D.ngModuleRef}const p=c?t:new Hg(Nt(t)),v=r||this.parentInjector;if(!o&&null==p.ngModule){const I=(c?v:this.parentInjector).get(Ms,null);I&&(o=I)}const E=p.create(v,i,void 0,o);return this.insert(E.hostView,d),E}insert(t,n){const r=t._lView,i=r[1];if(function th(e){return ho(e[3])}(r)){const E=this.indexOf(t);if(-1!==E)this.detach(E);else{const D=r[3],I=new MT(D,D[6],D[3]);I.detach(I.indexOf(t))}}const o=this._adjustIndex(n),c=this._lContainer;!function I1(e,t,n,r){const i=10+r,o=n.length;r>0&&(n[i-1][4]=t),r0)r.push(c[d/2]);else{const v=o[d+1],E=t[-p];for(let D=10;D{class e{constructor(n){this.appInits=n,this.resolve=Ov,this.reject=Ov,this.initialized=!1,this.done=!1,this.donePromise=new Promise((r,i)=>{this.resolve=r,this.reject=i})}runInitializers(){if(this.initialized)return;const n=[],r=()=>{this.done=!0,this.resolve()};if(this.appInits)for(let i=0;i{o.subscribe({complete:d,error:p})});n.push(c)}}Promise.all(n).then(()=>{r()}).catch(i=>{this.reject(i)}),0===n.length&&r(),this.initialized=!0}}return e.\u0275fac=function(n){return new(n||e)(St(Lv,8))},e.\u0275prov=Ot({token:e,factory:e.\u0275fac,providedIn:"root"}),e})();const iy=new It("AppId",{providedIn:"root",factory:function QT(){return`${$w()}${$w()}${$w()}`}});function $w(){return String.fromCharCode(97+Math.floor(25*Math.random()))}const eA=new It("Platform Initializer"),jw=new It("Platform ID",{providedIn:"platform",factory:()=>"unknown"}),tA=new It("appBootstrapListener");let SU=(()=>{class e{log(n){console.log(n)}warn(n){console.warn(n)}}return e.\u0275fac=function(n){return new(n||e)},e.\u0275prov=Ot({token:e,factory:e.\u0275fac,providedIn:"platform"}),e})();const ou=new It("LocaleId",{providedIn:"root",factory:()=>Fr(ou,Rt.Optional|Rt.SkipSelf)||function MU(){return typeof $localize<"u"&&$localize.locale||jp}()});class TU{constructor(t,n){this.ngModuleFactory=t,this.componentFactories=n}}let Hw=(()=>{class e{compileModuleSync(n){return new Sw(n)}compileModuleAsync(n){return Promise.resolve(this.compileModuleSync(n))}compileModuleAndAllComponentsSync(n){const r=this.compileModuleSync(n),o=tu(cn(n).declarations).reduce((c,d)=>{const p=Nt(d);return p&&c.push(new Hg(p)),c},[]);return new TU(r,o)}compileModuleAndAllComponentsAsync(n){return Promise.resolve(this.compileModuleAndAllComponentsSync(n))}clearCache(){}clearCacheFor(n){}getModuleId(n){}}return e.\u0275fac=function(n){return new(n||e)},e.\u0275prov=Ot({token:e,factory:e.\u0275fac,providedIn:"root"}),e})();const PU=(()=>Promise.resolve(0))();function Gw(e){typeof Zone>"u"?PU.then(()=>{e&&e.apply(null,null)}):Zone.current.scheduleMicroTask("scheduleMicrotask",e)}class Ri{constructor({enableLongStackTrace:t=!1,shouldCoalesceEventChangeDetection:n=!1,shouldCoalesceRunChangeDetection:r=!1}){if(this.hasPendingMacrotasks=!1,this.hasPendingMicrotasks=!1,this.isStable=!0,this.onUnstable=new Qr(!1),this.onMicrotaskEmpty=new Qr(!1),this.onStable=new Qr(!1),this.onError=new Qr(!1),typeof Zone>"u")throw new nt(908,!1);Zone.assertZonePatched();const i=this;if(i._nesting=0,i._outer=i._inner=Zone.current,Zone.AsyncStackTaggingZoneSpec){const o=Zone.AsyncStackTaggingZoneSpec;i._inner=i._inner.fork(new o("Angular"))}Zone.TaskTrackingZoneSpec&&(i._inner=i._inner.fork(new Zone.TaskTrackingZoneSpec)),t&&Zone.longStackTraceZoneSpec&&(i._inner=i._inner.fork(Zone.longStackTraceZoneSpec)),i.shouldCoalesceEventChangeDetection=!r&&n,i.shouldCoalesceRunChangeDetection=r,i.lastRequestAnimationFrameId=-1,i.nativeRequestAnimationFrame=function RU(){let e=er.requestAnimationFrame,t=er.cancelAnimationFrame;if(typeof Zone<"u"&&e&&t){const n=e[Zone.__symbol__("OriginalDelegate")];n&&(e=n);const r=t[Zone.__symbol__("OriginalDelegate")];r&&(t=r)}return{nativeRequestAnimationFrame:e,nativeCancelAnimationFrame:t}}().nativeRequestAnimationFrame,function LU(e){const t=()=>{!function OU(e){e.isCheckStableRunning||-1!==e.lastRequestAnimationFrameId||(e.lastRequestAnimationFrameId=e.nativeRequestAnimationFrame.call(er,()=>{e.fakeTopEventTask||(e.fakeTopEventTask=Zone.root.scheduleEventTask("fakeTopEventTask",()=>{e.lastRequestAnimationFrameId=-1,Zw(e),e.isCheckStableRunning=!0,qw(e),e.isCheckStableRunning=!1},void 0,()=>{},()=>{})),e.fakeTopEventTask.invoke()}),Zw(e))}(e)};e._inner=e._inner.fork({name:"angular",properties:{isAngularZone:!0},onInvokeTask:(n,r,i,o,c,d)=>{try{return iA(e),n.invokeTask(i,o,c,d)}finally{(e.shouldCoalesceEventChangeDetection&&"eventTask"===o.type||e.shouldCoalesceRunChangeDetection)&&t(),oA(e)}},onInvoke:(n,r,i,o,c,d,p)=>{try{return iA(e),n.invoke(i,o,c,d,p)}finally{e.shouldCoalesceRunChangeDetection&&t(),oA(e)}},onHasTask:(n,r,i,o)=>{n.hasTask(i,o),r===i&&("microTask"==o.change?(e._hasPendingMicrotasks=o.microTask,Zw(e),qw(e)):"macroTask"==o.change&&(e.hasPendingMacrotasks=o.macroTask))},onHandleError:(n,r,i,o)=>(n.handleError(i,o),e.runOutsideAngular(()=>e.onError.emit(o)),!1)})}(i)}static isInAngularZone(){return typeof Zone<"u"&&!0===Zone.current.get("isAngularZone")}static assertInAngularZone(){if(!Ri.isInAngularZone())throw new nt(909,!1)}static assertNotInAngularZone(){if(Ri.isInAngularZone())throw new nt(909,!1)}run(t,n,r){return this._inner.run(t,n,r)}runTask(t,n,r,i){const o=this._inner,c=o.scheduleEventTask("NgZoneEvent: "+i,t,FU,Ov,Ov);try{return o.runTask(c,n,r)}finally{o.cancelTask(c)}}runGuarded(t,n,r){return this._inner.runGuarded(t,n,r)}runOutsideAngular(t){return this._outer.run(t)}}const FU={};function qw(e){if(0==e._nesting&&!e.hasPendingMicrotasks&&!e.isStable)try{e._nesting++,e.onMicrotaskEmpty.emit(null)}finally{if(e._nesting--,!e.hasPendingMicrotasks)try{e.runOutsideAngular(()=>e.onStable.emit(null))}finally{e.isStable=!0}}}function Zw(e){e.hasPendingMicrotasks=!!(e._hasPendingMicrotasks||(e.shouldCoalesceEventChangeDetection||e.shouldCoalesceRunChangeDetection)&&-1!==e.lastRequestAnimationFrameId)}function iA(e){e._nesting++,e.isStable&&(e.isStable=!1,e.onUnstable.emit(null))}function oA(e){e._nesting--,qw(e)}class NU{constructor(){this.hasPendingMicrotasks=!1,this.hasPendingMacrotasks=!1,this.isStable=!0,this.onUnstable=new Qr,this.onMicrotaskEmpty=new Qr,this.onStable=new Qr,this.onError=new Qr}run(t,n,r){return t.apply(n,r)}runGuarded(t,n,r){return t.apply(n,r)}runOutsideAngular(t){return t()}runTask(t,n,r,i){return t.apply(n,r)}}const sA=new It(""),zv=new It("");let Yw,Ww=(()=>{class e{constructor(n,r,i){this._ngZone=n,this.registry=r,this._pendingCount=0,this._isZoneStable=!0,this._didWork=!1,this._callbacks=[],this.taskTrackingZone=null,Yw||(function zU(e){Yw=e}(i),i.addToWindow(r)),this._watchAngularEvents(),n.run(()=>{this.taskTrackingZone=typeof Zone>"u"?null:Zone.current.get("TaskTrackingZone")})}_watchAngularEvents(){this._ngZone.onUnstable.subscribe({next:()=>{this._didWork=!0,this._isZoneStable=!1}}),this._ngZone.runOutsideAngular(()=>{this._ngZone.onStable.subscribe({next:()=>{Ri.assertNotInAngularZone(),Gw(()=>{this._isZoneStable=!0,this._runCallbacksIfReady()})}})})}increasePendingRequestCount(){return this._pendingCount+=1,this._didWork=!0,this._pendingCount}decreasePendingRequestCount(){if(this._pendingCount-=1,this._pendingCount<0)throw new Error("pending async requests below zero");return this._runCallbacksIfReady(),this._pendingCount}isStable(){return this._isZoneStable&&0===this._pendingCount&&!this._ngZone.hasPendingMacrotasks}_runCallbacksIfReady(){if(this.isStable())Gw(()=>{for(;0!==this._callbacks.length;){let n=this._callbacks.pop();clearTimeout(n.timeoutId),n.doneCb(this._didWork)}this._didWork=!1});else{let n=this.getPendingTasks();this._callbacks=this._callbacks.filter(r=>!r.updateCb||!r.updateCb(n)||(clearTimeout(r.timeoutId),!1)),this._didWork=!0}}getPendingTasks(){return this.taskTrackingZone?this.taskTrackingZone.macroTasks.map(n=>({source:n.source,creationLocation:n.creationLocation,data:n.data})):[]}addCallback(n,r,i){let o=-1;r&&r>0&&(o=setTimeout(()=>{this._callbacks=this._callbacks.filter(c=>c.timeoutId!==o),n(this._didWork,this.getPendingTasks())},r)),this._callbacks.push({doneCb:n,timeoutId:o,updateCb:i})}whenStable(n,r,i){if(i&&!this.taskTrackingZone)throw new Error('Task tracking zone is required when passing an update callback to whenStable(). Is "zone.js/plugins/task-tracking" loaded?');this.addCallback(n,r,i),this._runCallbacksIfReady()}getPendingRequestCount(){return this._pendingCount}registerApplication(n){this.registry.registerApplication(n,this)}unregisterApplication(n){this.registry.unregisterApplication(n)}findProviders(n,r,i){return[]}}return e.\u0275fac=function(n){return new(n||e)(St(Ri),St(Xw),St(zv))},e.\u0275prov=Ot({token:e,factory:e.\u0275fac}),e})(),Xw=(()=>{class e{constructor(){this._applications=new Map}registerApplication(n,r){this._applications.set(n,r)}unregisterApplication(n){this._applications.delete(n)}unregisterAllApplications(){this._applications.clear()}getTestability(n){return this._applications.get(n)||null}getAllTestabilities(){return Array.from(this._applications.values())}getAllRootElements(){return Array.from(this._applications.keys())}findTestabilityInTree(n,r=!0){return Yw?.findTestabilityInTree(this,n,r)??null}}return e.\u0275fac=function(n){return new(n||e)},e.\u0275prov=Ot({token:e,factory:e.\u0275fac,providedIn:"platform"}),e})(),Dh=null;const aA=new It("AllowMultipleToken"),Kw=new It("PlatformDestroyListeners");class lA{constructor(t,n){this.name=t,this.token=n}}function uA(e,t,n=[]){const r=`Platform: ${t}`,i=new It(r);return(o=[])=>{let c=Jw();if(!c||c.injector.get(aA,!1)){const d=[...n,...o,{provide:i,useValue:!0}];e?e(d):function UU(e){if(Dh&&!Dh.get(aA,!1))throw new nt(400,!1);Dh=e;const t=e.get(dA);(function cA(e){const t=e.get(eA,null);t&&t.forEach(n=>n())})(e)}(function hA(e=[],t){return Ys.create({name:t,providers:[{provide:wh,useValue:"platform"},{provide:Kw,useValue:new Set([()=>Dh=null])},...e]})}(d,r))}return function jU(e){const t=Jw();if(!t)throw new nt(401,!1);return t}()}}function Jw(){return Dh?.get(dA)??null}let dA=(()=>{class e{constructor(n){this._injector=n,this._modules=[],this._destroyListeners=[],this._destroyed=!1}bootstrapModuleFactory(n,r){const i=function pA(e,t){let n;return n="noop"===e?new NU:("zone.js"===e?void 0:e)||new Ri(t),n}(r?.ngZone,function fA(e){return{enableLongStackTrace:!1,shouldCoalesceEventChangeDetection:!(!e||!e.ngZoneEventCoalescing)||!1,shouldCoalesceRunChangeDetection:!(!e||!e.ngZoneRunCoalescing)||!1}}(r)),o=[{provide:Ri,useValue:i}];return i.run(()=>{const c=Ys.create({providers:o,parent:this.injector,name:n.moduleType.name}),d=n.create(c),p=d.injector.get(Ep,null);if(!p)throw new nt(402,!1);return i.runOutsideAngular(()=>{const v=i.onError.subscribe({next:E=>{p.handleError(E)}});d.onDestroy(()=>{Vv(this._modules,d),v.unsubscribe()})}),function mA(e,t,n){try{const r=n();return Zg(r)?r.catch(i=>{throw t.runOutsideAngular(()=>e.handleError(i)),i}):r}catch(r){throw t.runOutsideAngular(()=>e.handleError(r)),r}}(p,i,()=>{const v=d.injector.get(Nv);return v.runInitializers(),v.donePromise.then(()=>(function BI(e){Ui(e,"Expected localeId to be defined"),"string"==typeof e&&(zI=e.toLowerCase().replace(/_/g,"-"))}(d.injector.get(ou,jp)||jp),this._moduleDoBootstrap(d),d))})})}bootstrapModule(n,r=[]){const i=gA({},r);return function BU(e,t,n){const r=new Sw(n);return Promise.resolve(r)}(0,0,n).then(o=>this.bootstrapModuleFactory(o,i))}_moduleDoBootstrap(n){const r=n.injector.get(Bv);if(n._bootstrapComponents.length>0)n._bootstrapComponents.forEach(i=>r.bootstrap(i));else{if(!n.instance.ngDoBootstrap)throw new nt(403,!1);n.instance.ngDoBootstrap(r)}this._modules.push(n)}onDestroy(n){this._destroyListeners.push(n)}get injector(){return this._injector}destroy(){if(this._destroyed)throw new nt(404,!1);this._modules.slice().forEach(r=>r.destroy()),this._destroyListeners.forEach(r=>r());const n=this._injector.get(Kw,null);n&&(n.forEach(r=>r()),n.clear()),this._destroyed=!0}get destroyed(){return this._destroyed}}return e.\u0275fac=function(n){return new(n||e)(St(Ys))},e.\u0275prov=Ot({token:e,factory:e.\u0275fac,providedIn:"platform"}),e})();function gA(e,t){return Array.isArray(t)?t.reduce(gA,e):{...e,...t}}let Bv=(()=>{class e{constructor(n,r,i){this._zone=n,this._injector=r,this._exceptionHandler=i,this._bootstrapListeners=[],this._views=[],this._runningTick=!1,this._stable=!0,this._destroyed=!1,this._destroyListeners=[],this.componentTypes=[],this.components=[],this._onMicrotaskEmptySubscription=this._zone.onMicrotaskEmpty.subscribe({next:()=>{this._zone.run(()=>{this.tick()})}});const o=new Nn(d=>{this._stable=this._zone.isStable&&!this._zone.hasPendingMacrotasks&&!this._zone.hasPendingMicrotasks,this._zone.runOutsideAngular(()=>{d.next(this._stable),d.complete()})}),c=new Nn(d=>{let p;this._zone.runOutsideAngular(()=>{p=this._zone.onStable.subscribe(()=>{Ri.assertNotInAngularZone(),Gw(()=>{!this._stable&&!this._zone.hasPendingMacrotasks&&!this._zone.hasPendingMicrotasks&&(this._stable=!0,d.next(!0))})})});const v=this._zone.onUnstable.subscribe(()=>{Ri.assertInAngularZone(),this._stable&&(this._stable=!1,this._zone.runOutsideAngular(()=>{d.next(!1)}))});return()=>{p.unsubscribe(),v.unsubscribe()}});this.isStable=function zl(...e){const t=sr(e),n=function si(e,t){return"number"==typeof an(e)?e.pop():t}(e,1/0),r=e;return r.length?1===r.length?te(r[0]):ft(n)(Cr(r,t)):xt}(o,c.pipe(function Wh(e={}){const{connector:t=(()=>new oi),resetOnError:n=!0,resetOnComplete:r=!0,resetOnRefCountZero:i=!0}=e;return o=>{let c,d,p,v=0,E=!1,D=!1;const I=()=>{d?.unsubscribe(),d=void 0},P=()=>{I(),c=p=void 0,E=D=!1},N=()=>{const G=c;P(),G?.unsubscribe()};return mr((G,U)=>{v++,!D&&!E&&I();const Z=p=p??t();U.add(()=>{v--,0===v&&!D&&!E&&(d=Bl(N,i))}),Z.subscribe(U),!c&&v>0&&(c=new ro({next:ne=>Z.next(ne),error:ne=>{D=!0,I(),d=Bl(P,n,ne),Z.error(ne)},complete:()=>{E=!0,I(),d=Bl(P,r),Z.complete()}}),te(G).subscribe(c))})(o)}}()))}get destroyed(){return this._destroyed}get injector(){return this._injector}bootstrap(n,r){const i=n instanceof L2;if(!this._injector.get(Nv).done)throw!i&&function Us(e){const t=Nt(e)||Xr(e)||kt(e);return null!==t&&t.standalone}(n),new nt(405,false);let c;c=i?n:this._injector.get(Ug).resolveComponentFactory(n),this.componentTypes.push(c.componentType);const d=function VU(e){return e.isBoundToModule}(c)?void 0:this._injector.get(ef),v=c.create(Ys.NULL,[],r||c.selector,d),E=v.location.nativeElement,D=v.injector.get(sA,null);return D?.registerApplication(E),v.onDestroy(()=>{this.detachView(v.hostView),Vv(this.components,v),D?.unregisterApplication(E)}),this._loadComponent(v),v}tick(){if(this._runningTick)throw new nt(101,!1);try{this._runningTick=!0;for(let n of this._views)n.detectChanges()}catch(n){this._zone.runOutsideAngular(()=>this._exceptionHandler.handleError(n))}finally{this._runningTick=!1}}attachView(n){const r=n;this._views.push(r),r.attachToAppRef(this)}detachView(n){const r=n;Vv(this._views,r),r.detachFromAppRef()}_loadComponent(n){this.attachView(n.hostView),this.tick(),this.components.push(n),this._injector.get(tA,[]).concat(this._bootstrapListeners).forEach(i=>i(n))}ngOnDestroy(){if(!this._destroyed)try{this._destroyListeners.forEach(n=>n()),this._views.slice().forEach(n=>n.destroy()),this._onMicrotaskEmptySubscription.unsubscribe()}finally{this._destroyed=!0,this._views=[],this._bootstrapListeners=[],this._destroyListeners=[]}}onDestroy(n){return this._destroyListeners.push(n),()=>Vv(this._destroyListeners,n)}destroy(){if(this._destroyed)throw new nt(406,!1);const n=this._injector;n.destroy&&!n.destroyed&&n.destroy()}get viewCount(){return this._views.length}warnIfDestroyed(){}}return e.\u0275fac=function(n){return new(n||e)(St(Ri),St(Ms),St(Ep))},e.\u0275prov=Ot({token:e,factory:e.\u0275fac,providedIn:"root"}),e})();function Vv(e,t){const n=e.indexOf(t);n>-1&&e.splice(n,1)}let _A=!0,oy=(()=>{class e{}return e.__NG_ELEMENT_ID__=qU,e})();function qU(e){return function ZU(e,t,n){if(Zu(e)&&!n){const r=Mi(e.index,t);return new jg(r,r)}return 47&e.type?new jg(t[16],t):null}(Pr(),He(),16==(16&e))}class CA{constructor(){}supports(t){return Gg(t)}create(t){return new QU(t)}}const JU=(e,t)=>t;class QU{constructor(t){this.length=0,this._linkedRecords=null,this._unlinkedRecords=null,this._previousItHead=null,this._itHead=null,this._itTail=null,this._additionsHead=null,this._additionsTail=null,this._movesHead=null,this._movesTail=null,this._removalsHead=null,this._removalsTail=null,this._identityChangesHead=null,this._identityChangesTail=null,this._trackByFn=t||JU}forEachItem(t){let n;for(n=this._itHead;null!==n;n=n._next)t(n)}forEachOperation(t){let n=this._itHead,r=this._removalsHead,i=0,o=null;for(;n||r;){const c=!r||n&&n.currentIndex{c=this._trackByFn(i,d),null!==n&&Object.is(n.trackById,c)?(r&&(n=this._verifyReinsertion(n,d,c,i)),Object.is(n.item,d)||this._addIdentityChange(n,d)):(n=this._mismatch(n,d,c,i),r=!0),n=n._next,i++}),this.length=i;return this._truncate(n),this.collection=t,this.isDirty}get isDirty(){return null!==this._additionsHead||null!==this._movesHead||null!==this._removalsHead||null!==this._identityChangesHead}_reset(){if(this.isDirty){let t;for(t=this._previousItHead=this._itHead;null!==t;t=t._next)t._nextPrevious=t._next;for(t=this._additionsHead;null!==t;t=t._nextAdded)t.previousIndex=t.currentIndex;for(this._additionsHead=this._additionsTail=null,t=this._movesHead;null!==t;t=t._nextMoved)t.previousIndex=t.currentIndex;this._movesHead=this._movesTail=null,this._removalsHead=this._removalsTail=null,this._identityChangesHead=this._identityChangesTail=null}}_mismatch(t,n,r,i){let o;return null===t?o=this._itTail:(o=t._prev,this._remove(t)),null!==(t=null===this._unlinkedRecords?null:this._unlinkedRecords.get(r,null))?(Object.is(t.item,n)||this._addIdentityChange(t,n),this._reinsertAfter(t,o,i)):null!==(t=null===this._linkedRecords?null:this._linkedRecords.get(r,i))?(Object.is(t.item,n)||this._addIdentityChange(t,n),this._moveAfter(t,o,i)):t=this._addAfter(new e$(n,r),o,i),t}_verifyReinsertion(t,n,r,i){let o=null===this._unlinkedRecords?null:this._unlinkedRecords.get(r,null);return null!==o?t=this._reinsertAfter(o,t._prev,i):t.currentIndex!=i&&(t.currentIndex=i,this._addToMoves(t,i)),t}_truncate(t){for(;null!==t;){const n=t._next;this._addToRemovals(this._unlink(t)),t=n}null!==this._unlinkedRecords&&this._unlinkedRecords.clear(),null!==this._additionsTail&&(this._additionsTail._nextAdded=null),null!==this._movesTail&&(this._movesTail._nextMoved=null),null!==this._itTail&&(this._itTail._next=null),null!==this._removalsTail&&(this._removalsTail._nextRemoved=null),null!==this._identityChangesTail&&(this._identityChangesTail._nextIdentityChange=null)}_reinsertAfter(t,n,r){null!==this._unlinkedRecords&&this._unlinkedRecords.remove(t);const i=t._prevRemoved,o=t._nextRemoved;return null===i?this._removalsHead=o:i._nextRemoved=o,null===o?this._removalsTail=i:o._prevRemoved=i,this._insertAfter(t,n,r),this._addToMoves(t,r),t}_moveAfter(t,n,r){return this._unlink(t),this._insertAfter(t,n,r),this._addToMoves(t,r),t}_addAfter(t,n,r){return this._insertAfter(t,n,r),this._additionsTail=null===this._additionsTail?this._additionsHead=t:this._additionsTail._nextAdded=t,t}_insertAfter(t,n,r){const i=null===n?this._itHead:n._next;return t._next=i,t._prev=n,null===i?this._itTail=t:i._prev=t,null===n?this._itHead=t:n._next=t,null===this._linkedRecords&&(this._linkedRecords=new EA),this._linkedRecords.put(t),t.currentIndex=r,t}_remove(t){return this._addToRemovals(this._unlink(t))}_unlink(t){null!==this._linkedRecords&&this._linkedRecords.remove(t);const n=t._prev,r=t._next;return null===n?this._itHead=r:n._next=r,null===r?this._itTail=n:r._prev=n,t}_addToMoves(t,n){return t.previousIndex===n||(this._movesTail=null===this._movesTail?this._movesHead=t:this._movesTail._nextMoved=t),t}_addToRemovals(t){return null===this._unlinkedRecords&&(this._unlinkedRecords=new EA),this._unlinkedRecords.put(t),t.currentIndex=null,t._nextRemoved=null,null===this._removalsTail?(this._removalsTail=this._removalsHead=t,t._prevRemoved=null):(t._prevRemoved=this._removalsTail,this._removalsTail=this._removalsTail._nextRemoved=t),t}_addIdentityChange(t,n){return t.item=n,this._identityChangesTail=null===this._identityChangesTail?this._identityChangesHead=t:this._identityChangesTail._nextIdentityChange=t,t}}class e${constructor(t,n){this.item=t,this.trackById=n,this.currentIndex=null,this.previousIndex=null,this._nextPrevious=null,this._prev=null,this._next=null,this._prevDup=null,this._nextDup=null,this._prevRemoved=null,this._nextRemoved=null,this._nextAdded=null,this._nextMoved=null,this._nextIdentityChange=null}}class t${constructor(){this._head=null,this._tail=null}add(t){null===this._head?(this._head=this._tail=t,t._nextDup=null,t._prevDup=null):(this._tail._nextDup=t,t._prevDup=this._tail,t._nextDup=null,this._tail=t)}get(t,n){let r;for(r=this._head;null!==r;r=r._nextDup)if((null===n||n<=r.currentIndex)&&Object.is(r.trackById,t))return r;return null}remove(t){const n=t._prevDup,r=t._nextDup;return null===n?this._head=r:n._nextDup=r,null===r?this._tail=n:r._prevDup=n,null===this._head}}class EA{constructor(){this.map=new Map}put(t){const n=t.trackById;let r=this.map.get(n);r||(r=new t$,this.map.set(n,r)),r.add(t)}get(t,n){const i=this.map.get(t);return i?i.get(t,n):null}remove(t){const n=t.trackById;return this.map.get(n).remove(t)&&this.map.delete(n),t}get isEmpty(){return 0===this.map.size}clear(){this.map.clear()}}function DA(e,t,n){const r=e.previousIndex;if(null===r)return r;let i=0;return n&&r{if(n&&n.key===i)this._maybeAddToChanges(n,r),this._appendAfter=n,n=n._next;else{const o=this._getOrCreateRecordForKey(i,r);n=this._insertBeforeOrAppend(n,o)}}),n){n._prev&&(n._prev._next=null),this._removalsHead=n;for(let r=n;null!==r;r=r._nextRemoved)r===this._mapHead&&(this._mapHead=null),this._records.delete(r.key),r._nextRemoved=r._next,r.previousValue=r.currentValue,r.currentValue=null,r._prev=null,r._next=null}return this._changesTail&&(this._changesTail._nextChanged=null),this._additionsTail&&(this._additionsTail._nextAdded=null),this.isDirty}_insertBeforeOrAppend(t,n){if(t){const r=t._prev;return n._next=t,n._prev=r,t._prev=n,r&&(r._next=n),t===this._mapHead&&(this._mapHead=n),this._appendAfter=t,t}return this._appendAfter?(this._appendAfter._next=n,n._prev=this._appendAfter):this._mapHead=n,this._appendAfter=n,null}_getOrCreateRecordForKey(t,n){if(this._records.has(t)){const i=this._records.get(t);this._maybeAddToChanges(i,n);const o=i._prev,c=i._next;return o&&(o._next=c),c&&(c._prev=o),i._next=null,i._prev=null,i}const r=new r$(t);return this._records.set(t,r),r.currentValue=n,this._addToAdditions(r),r}_reset(){if(this.isDirty){let t;for(this._previousMapHead=this._mapHead,t=this._previousMapHead;null!==t;t=t._next)t._nextPrevious=t._next;for(t=this._changesHead;null!==t;t=t._nextChanged)t.previousValue=t.currentValue;for(t=this._additionsHead;null!=t;t=t._nextAdded)t.previousValue=t.currentValue;this._changesHead=this._changesTail=null,this._additionsHead=this._additionsTail=null,this._removalsHead=null}}_maybeAddToChanges(t,n){Object.is(n,t.currentValue)||(t.previousValue=t.currentValue,t.currentValue=n,this._addToChanges(t))}_addToAdditions(t){null===this._additionsHead?this._additionsHead=this._additionsTail=t:(this._additionsTail._nextAdded=t,this._additionsTail=t)}_addToChanges(t){null===this._changesHead?this._changesHead=this._changesTail=t:(this._changesTail._nextChanged=t,this._changesTail=t)}_forEach(t,n){t instanceof Map?t.forEach(n):Object.keys(t).forEach(r=>n(t[r],r))}}class r${constructor(t){this.key=t,this.previousValue=null,this.currentValue=null,this._nextPrevious=null,this._next=null,this._prev=null,this._nextAdded=null,this._nextRemoved=null,this._nextChanged=null}}function MA(){return new jv([new CA])}let jv=(()=>{class e{constructor(n){this.factories=n}static create(n,r){if(null!=r){const i=r.factories.slice();n=n.concat(i)}return new e(n)}static extend(n){return{provide:e,useFactory:r=>e.create(n,r||MA()),deps:[[e,new Tr,new Od]]}}find(n){const r=this.factories.find(i=>i.supports(n));if(null!=r)return r;throw new nt(901,!1)}}return e.\u0275prov=Ot({token:e,providedIn:"root",factory:MA}),e})();function IA(){return new sy([new SA])}let sy=(()=>{class e{constructor(n){this.factories=n}static create(n,r){if(r){const i=r.factories.slice();n=n.concat(i)}return new e(n)}static extend(n){return{provide:e,useFactory:r=>e.create(n,r||IA()),deps:[[e,new Tr,new Od]]}}find(n){const r=this.factories.find(i=>i.supports(n));if(r)return r;throw new nt(901,!1)}}return e.\u0275prov=Ot({token:e,providedIn:"root",factory:IA}),e})();const s$=uA(null,"core",[]);let a$=(()=>{class e{constructor(n){}}return e.\u0275fac=function(n){return new(n||e)(St(Bv))},e.\u0275mod=ai({type:e}),e.\u0275inj=Ei({}),e})(),Hv=null;function fc(){return Hv}const ss=new It("DocumentToken");let rC=(()=>{class e{historyGo(n){throw new Error("Not implemented")}}return e.\u0275fac=function(n){return new(n||e)},e.\u0275prov=Ot({token:e,factory:function(){return function h$(){return St(TA)}()},providedIn:"platform"}),e})();const d$=new It("Location Initialized");let TA=(()=>{class e extends rC{constructor(n){super(),this._doc=n,this._init()}_init(){this.location=window.location,this._history=window.history}getBaseHrefFromDOM(){return fc().getBaseHref(this._doc)}onPopState(n){const r=fc().getGlobalEventTarget(this._doc,"window");return r.addEventListener("popstate",n,!1),()=>r.removeEventListener("popstate",n)}onHashChange(n){const r=fc().getGlobalEventTarget(this._doc,"window");return r.addEventListener("hashchange",n,!1),()=>r.removeEventListener("hashchange",n)}get href(){return this.location.href}get protocol(){return this.location.protocol}get hostname(){return this.location.hostname}get port(){return this.location.port}get pathname(){return this.location.pathname}get search(){return this.location.search}get hash(){return this.location.hash}set pathname(n){this.location.pathname=n}pushState(n,r,i){AA()?this._history.pushState(n,r,i):this.location.hash=i}replaceState(n,r,i){AA()?this._history.replaceState(n,r,i):this.location.hash=i}forward(){this._history.forward()}back(){this._history.back()}historyGo(n=0){this._history.go(n)}getState(){return this._history.state}}return e.\u0275fac=function(n){return new(n||e)(St(ss))},e.\u0275prov=Ot({token:e,factory:function(){return function f$(){return new TA(St(ss))}()},providedIn:"platform"}),e})();function AA(){return!!window.history.pushState}function iC(e,t){if(0==e.length)return t;if(0==t.length)return e;let n=0;return e.endsWith("/")&&n++,t.startsWith("/")&&n++,2==n?e+t.substring(1):1==n?e+t:e+"/"+t}function kA(e){const t=e.match(/#|\?|$/),n=t&&t.index||e.length;return e.slice(0,n-("/"===e[n-1]?1:0))+e.slice(n)}function lu(e){return e&&"?"!==e[0]?"?"+e:e}let sf=(()=>{class e{historyGo(n){throw new Error("Not implemented")}}return e.\u0275fac=function(n){return new(n||e)},e.\u0275prov=Ot({token:e,factory:function(){return Fr(RA)},providedIn:"root"}),e})();const PA=new It("appBaseHref");let RA=(()=>{class e extends sf{constructor(n,r){super(),this._platformLocation=n,this._removeListenerFns=[],this._baseHref=r??this._platformLocation.getBaseHrefFromDOM()??Fr(ss).location?.origin??""}ngOnDestroy(){for(;this._removeListenerFns.length;)this._removeListenerFns.pop()()}onPopState(n){this._removeListenerFns.push(this._platformLocation.onPopState(n),this._platformLocation.onHashChange(n))}getBaseHref(){return this._baseHref}prepareExternalUrl(n){return iC(this._baseHref,n)}path(n=!1){const r=this._platformLocation.pathname+lu(this._platformLocation.search),i=this._platformLocation.hash;return i&&n?`${r}${i}`:r}pushState(n,r,i,o){const c=this.prepareExternalUrl(i+lu(o));this._platformLocation.pushState(n,r,c)}replaceState(n,r,i,o){const c=this.prepareExternalUrl(i+lu(o));this._platformLocation.replaceState(n,r,c)}forward(){this._platformLocation.forward()}back(){this._platformLocation.back()}getState(){return this._platformLocation.getState()}historyGo(n=0){this._platformLocation.historyGo?.(n)}}return e.\u0275fac=function(n){return new(n||e)(St(rC),St(PA,8))},e.\u0275prov=Ot({token:e,factory:e.\u0275fac,providedIn:"root"}),e})(),p$=(()=>{class e extends sf{constructor(n,r){super(),this._platformLocation=n,this._baseHref="",this._removeListenerFns=[],null!=r&&(this._baseHref=r)}ngOnDestroy(){for(;this._removeListenerFns.length;)this._removeListenerFns.pop()()}onPopState(n){this._removeListenerFns.push(this._platformLocation.onPopState(n),this._platformLocation.onHashChange(n))}getBaseHref(){return this._baseHref}path(n=!1){let r=this._platformLocation.hash;return null==r&&(r="#"),r.length>0?r.substring(1):r}prepareExternalUrl(n){const r=iC(this._baseHref,n);return r.length>0?"#"+r:r}pushState(n,r,i,o){let c=this.prepareExternalUrl(i+lu(o));0==c.length&&(c=this._platformLocation.pathname),this._platformLocation.pushState(n,r,c)}replaceState(n,r,i,o){let c=this.prepareExternalUrl(i+lu(o));0==c.length&&(c=this._platformLocation.pathname),this._platformLocation.replaceState(n,r,c)}forward(){this._platformLocation.forward()}back(){this._platformLocation.back()}getState(){return this._platformLocation.getState()}historyGo(n=0){this._platformLocation.historyGo?.(n)}}return e.\u0275fac=function(n){return new(n||e)(St(rC),St(PA,8))},e.\u0275prov=Ot({token:e,factory:e.\u0275fac}),e})(),oC=(()=>{class e{constructor(n){this._subject=new Qr,this._urlChangeListeners=[],this._urlChangeSubscription=null,this._locationStrategy=n;const r=this._locationStrategy.getBaseHref();this._baseHref=kA(FA(r)),this._locationStrategy.onPopState(i=>{this._subject.emit({url:this.path(!0),pop:!0,state:i.state,type:i.type})})}ngOnDestroy(){this._urlChangeSubscription?.unsubscribe(),this._urlChangeListeners=[]}path(n=!1){return this.normalize(this._locationStrategy.path(n))}getState(){return this._locationStrategy.getState()}isCurrentPathEqualTo(n,r=""){return this.path()==this.normalize(n+lu(r))}normalize(n){return e.stripTrailingSlash(function g$(e,t){return e&&t.startsWith(e)?t.substring(e.length):t}(this._baseHref,FA(n)))}prepareExternalUrl(n){return n&&"/"!==n[0]&&(n="/"+n),this._locationStrategy.prepareExternalUrl(n)}go(n,r="",i=null){this._locationStrategy.pushState(i,"",n,r),this._notifyUrlChangeListeners(this.prepareExternalUrl(n+lu(r)),i)}replaceState(n,r="",i=null){this._locationStrategy.replaceState(i,"",n,r),this._notifyUrlChangeListeners(this.prepareExternalUrl(n+lu(r)),i)}forward(){this._locationStrategy.forward()}back(){this._locationStrategy.back()}historyGo(n=0){this._locationStrategy.historyGo?.(n)}onUrlChange(n){return this._urlChangeListeners.push(n),this._urlChangeSubscription||(this._urlChangeSubscription=this.subscribe(r=>{this._notifyUrlChangeListeners(r.url,r.state)})),()=>{const r=this._urlChangeListeners.indexOf(n);this._urlChangeListeners.splice(r,1),0===this._urlChangeListeners.length&&(this._urlChangeSubscription?.unsubscribe(),this._urlChangeSubscription=null)}}_notifyUrlChangeListeners(n="",r){this._urlChangeListeners.forEach(i=>i(n,r))}subscribe(n,r,i){return this._subject.subscribe({next:n,error:r,complete:i})}}return e.normalizeQueryParams=lu,e.joinWithSlash=iC,e.stripTrailingSlash=kA,e.\u0275fac=function(n){return new(n||e)(St(sf))},e.\u0275prov=Ot({token:e,factory:function(){return function m$(){return new oC(St(sf))}()},providedIn:"root"}),e})();function FA(e){return e.replace(/\/index.html$/,"")}var hi=(()=>((hi=hi||{})[hi.Format=0]="Format",hi[hi.Standalone=1]="Standalone",hi))(),kn=(()=>((kn=kn||{})[kn.Narrow=0]="Narrow",kn[kn.Abbreviated=1]="Abbreviated",kn[kn.Wide=2]="Wide",kn[kn.Short=3]="Short",kn))(),Hr=(()=>((Hr=Hr||{})[Hr.Short=0]="Short",Hr[Hr.Medium=1]="Medium",Hr[Hr.Long=2]="Long",Hr[Hr.Full=3]="Full",Hr))(),Ut=(()=>((Ut=Ut||{})[Ut.Decimal=0]="Decimal",Ut[Ut.Group=1]="Group",Ut[Ut.List=2]="List",Ut[Ut.PercentSign=3]="PercentSign",Ut[Ut.PlusSign=4]="PlusSign",Ut[Ut.MinusSign=5]="MinusSign",Ut[Ut.Exponential=6]="Exponential",Ut[Ut.SuperscriptingExponent=7]="SuperscriptingExponent",Ut[Ut.PerMille=8]="PerMille",Ut[Ut.Infinity=9]="Infinity",Ut[Ut.NaN=10]="NaN",Ut[Ut.TimeSeparator=11]="TimeSeparator",Ut[Ut.CurrencyDecimal=12]="CurrencyDecimal",Ut[Ut.CurrencyGroup=13]="CurrencyGroup",Ut))();function Gv(e,t){return Da(is(e)[vt.DateFormat],t)}function qv(e,t){return Da(is(e)[vt.TimeFormat],t)}function Zv(e,t){return Da(is(e)[vt.DateTimeFormat],t)}function Ea(e,t){const n=is(e),r=n[vt.NumberSymbols][t];if(typeof r>"u"){if(t===Ut.CurrencyDecimal)return n[vt.NumberSymbols][Ut.Decimal];if(t===Ut.CurrencyGroup)return n[vt.NumberSymbols][Ut.Group]}return r}function LA(e){if(!e[vt.ExtraData])throw new Error(`Missing extra locale data for the locale "${e[vt.LocaleId]}". Use "registerLocaleData" to load new data. See the "I18n guide" on angular.io to know more.`)}function Da(e,t){for(let n=t;n>-1;n--)if(typeof e[n]<"u")return e[n];throw new Error("Locale data API: locale data undefined")}function aC(e){const[t,n]=e.split(":");return{hours:+t,minutes:+n}}const T$=/^(\d{4,})-?(\d\d)-?(\d\d)(?:T(\d\d)(?::?(\d\d)(?::?(\d\d)(?:\.(\d+))?)?)?(Z|([+-])(\d\d):?(\d\d))?)?$/,ay={},A$=/((?:[^BEGHLMOSWYZabcdhmswyz']+)|(?:'(?:[^']|'')*')|(?:G{1,5}|y{1,4}|Y{1,4}|M{1,5}|L{1,5}|w{1,2}|W{1}|d{1,2}|E{1,6}|c{1,6}|a{1,5}|b{1,5}|B{1,5}|h{1,2}|H{1,2}|m{1,2}|s{1,2}|S{1,3}|z{1,4}|Z{1,5}|O{1,4}))([\s\S]*)/;var Fi=(()=>((Fi=Fi||{})[Fi.Short=0]="Short",Fi[Fi.ShortGMT=1]="ShortGMT",Fi[Fi.Long=2]="Long",Fi[Fi.Extended=3]="Extended",Fi))(),Gt=(()=>((Gt=Gt||{})[Gt.FullYear=0]="FullYear",Gt[Gt.Month=1]="Month",Gt[Gt.Date=2]="Date",Gt[Gt.Hours=3]="Hours",Gt[Gt.Minutes=4]="Minutes",Gt[Gt.Seconds=5]="Seconds",Gt[Gt.FractionalSeconds=6]="FractionalSeconds",Gt[Gt.Day=7]="Day",Gt))(),un=(()=>((un=un||{})[un.DayPeriods=0]="DayPeriods",un[un.Days=1]="Days",un[un.Months=2]="Months",un[un.Eras=3]="Eras",un))();function k$(e,t,n,r){let i=function V$(e){if(BA(e))return e;if("number"==typeof e&&!isNaN(e))return new Date(e);if("string"==typeof e){if(e=e.trim(),/^(\d{4}(-\d{1,2}(-\d{1,2})?)?)$/.test(e)){const[i,o=1,c=1]=e.split("-").map(d=>+d);return Wv(i,o-1,c)}const n=parseFloat(e);if(!isNaN(e-n))return new Date(n);let r;if(r=e.match(T$))return function U$(e){const t=new Date(0);let n=0,r=0;const i=e[8]?t.setUTCFullYear:t.setFullYear,o=e[8]?t.setUTCHours:t.setHours;e[9]&&(n=Number(e[9]+e[10]),r=Number(e[9]+e[11])),i.call(t,Number(e[1]),Number(e[2])-1,Number(e[3]));const c=Number(e[4]||0)-n,d=Number(e[5]||0)-r,p=Number(e[6]||0),v=Math.floor(1e3*parseFloat("0."+(e[7]||0)));return o.call(t,c,d,p,v),t}(r)}const t=new Date(e);if(!BA(t))throw new Error(`Unable to convert "${e}" into a date`);return t}(e);t=cu(n,t)||t;let d,c=[];for(;t;){if(d=A$.exec(t),!d){c.push(t);break}{c=c.concat(d.slice(1));const E=c.pop();if(!E)break;t=E}}let p=i.getTimezoneOffset();r&&(p=zA(r,p),i=function B$(e,t,n){const r=n?-1:1,i=e.getTimezoneOffset();return function z$(e,t){return(e=new Date(e.getTime())).setMinutes(e.getMinutes()+t),e}(e,r*(zA(t,i)-i))}(i,r,!0));let v="";return c.forEach(E=>{const D=function N$(e){if(cC[e])return cC[e];let t;switch(e){case"G":case"GG":case"GGG":t=Ir(un.Eras,kn.Abbreviated);break;case"GGGG":t=Ir(un.Eras,kn.Wide);break;case"GGGGG":t=Ir(un.Eras,kn.Narrow);break;case"y":t=vi(Gt.FullYear,1,0,!1,!0);break;case"yy":t=vi(Gt.FullYear,2,0,!0,!0);break;case"yyy":t=vi(Gt.FullYear,3,0,!1,!0);break;case"yyyy":t=vi(Gt.FullYear,4,0,!1,!0);break;case"Y":t=Jv(1);break;case"YY":t=Jv(2,!0);break;case"YYY":t=Jv(3);break;case"YYYY":t=Jv(4);break;case"M":case"L":t=vi(Gt.Month,1,1);break;case"MM":case"LL":t=vi(Gt.Month,2,1);break;case"MMM":t=Ir(un.Months,kn.Abbreviated);break;case"MMMM":t=Ir(un.Months,kn.Wide);break;case"MMMMM":t=Ir(un.Months,kn.Narrow);break;case"LLL":t=Ir(un.Months,kn.Abbreviated,hi.Standalone);break;case"LLLL":t=Ir(un.Months,kn.Wide,hi.Standalone);break;case"LLLLL":t=Ir(un.Months,kn.Narrow,hi.Standalone);break;case"w":t=lC(1);break;case"ww":t=lC(2);break;case"W":t=lC(1,!0);break;case"d":t=vi(Gt.Date,1);break;case"dd":t=vi(Gt.Date,2);break;case"c":case"cc":t=vi(Gt.Day,1);break;case"ccc":t=Ir(un.Days,kn.Abbreviated,hi.Standalone);break;case"cccc":t=Ir(un.Days,kn.Wide,hi.Standalone);break;case"ccccc":t=Ir(un.Days,kn.Narrow,hi.Standalone);break;case"cccccc":t=Ir(un.Days,kn.Short,hi.Standalone);break;case"E":case"EE":case"EEE":t=Ir(un.Days,kn.Abbreviated);break;case"EEEE":t=Ir(un.Days,kn.Wide);break;case"EEEEE":t=Ir(un.Days,kn.Narrow);break;case"EEEEEE":t=Ir(un.Days,kn.Short);break;case"a":case"aa":case"aaa":t=Ir(un.DayPeriods,kn.Abbreviated);break;case"aaaa":t=Ir(un.DayPeriods,kn.Wide);break;case"aaaaa":t=Ir(un.DayPeriods,kn.Narrow);break;case"b":case"bb":case"bbb":t=Ir(un.DayPeriods,kn.Abbreviated,hi.Standalone,!0);break;case"bbbb":t=Ir(un.DayPeriods,kn.Wide,hi.Standalone,!0);break;case"bbbbb":t=Ir(un.DayPeriods,kn.Narrow,hi.Standalone,!0);break;case"B":case"BB":case"BBB":t=Ir(un.DayPeriods,kn.Abbreviated,hi.Format,!0);break;case"BBBB":t=Ir(un.DayPeriods,kn.Wide,hi.Format,!0);break;case"BBBBB":t=Ir(un.DayPeriods,kn.Narrow,hi.Format,!0);break;case"h":t=vi(Gt.Hours,1,-12);break;case"hh":t=vi(Gt.Hours,2,-12);break;case"H":t=vi(Gt.Hours,1);break;case"HH":t=vi(Gt.Hours,2);break;case"m":t=vi(Gt.Minutes,1);break;case"mm":t=vi(Gt.Minutes,2);break;case"s":t=vi(Gt.Seconds,1);break;case"ss":t=vi(Gt.Seconds,2);break;case"S":t=vi(Gt.FractionalSeconds,1);break;case"SS":t=vi(Gt.FractionalSeconds,2);break;case"SSS":t=vi(Gt.FractionalSeconds,3);break;case"Z":case"ZZ":case"ZZZ":t=Yv(Fi.Short);break;case"ZZZZZ":t=Yv(Fi.Extended);break;case"O":case"OO":case"OOO":case"z":case"zz":case"zzz":t=Yv(Fi.ShortGMT);break;case"OOOO":case"ZZZZ":case"zzzz":t=Yv(Fi.Long);break;default:return null}return cC[e]=t,t}(E);v+=D?D(i,n,p):"''"===E?"'":E.replace(/(^'|'$)/g,"").replace(/''/g,"'")}),v}function Wv(e,t,n){const r=new Date(0);return r.setFullYear(e,t,n),r.setHours(0,0,0),r}function cu(e,t){const n=function y$(e){return is(e)[vt.LocaleId]}(e);if(ay[n]=ay[n]||{},ay[n][t])return ay[n][t];let r="";switch(t){case"shortDate":r=Gv(e,Hr.Short);break;case"mediumDate":r=Gv(e,Hr.Medium);break;case"longDate":r=Gv(e,Hr.Long);break;case"fullDate":r=Gv(e,Hr.Full);break;case"shortTime":r=qv(e,Hr.Short);break;case"mediumTime":r=qv(e,Hr.Medium);break;case"longTime":r=qv(e,Hr.Long);break;case"fullTime":r=qv(e,Hr.Full);break;case"short":const i=cu(e,"shortTime"),o=cu(e,"shortDate");r=Xv(Zv(e,Hr.Short),[i,o]);break;case"medium":const c=cu(e,"mediumTime"),d=cu(e,"mediumDate");r=Xv(Zv(e,Hr.Medium),[c,d]);break;case"long":const p=cu(e,"longTime"),v=cu(e,"longDate");r=Xv(Zv(e,Hr.Long),[p,v]);break;case"full":const E=cu(e,"fullTime"),D=cu(e,"fullDate");r=Xv(Zv(e,Hr.Full),[E,D])}return r&&(ay[n][t]=r),r}function Xv(e,t){return t&&(e=e.replace(/\{([^}]+)}/g,function(n,r){return null!=t&&r in t?t[r]:n})),e}function _l(e,t,n="-",r,i){let o="";(e<0||i&&e<=0)&&(i?e=1-e:(e=-e,o=n));let c=String(e);for(;c.length0||d>-n)&&(d+=n),e===Gt.Hours)0===d&&-12===n&&(d=12);else if(e===Gt.FractionalSeconds)return function P$(e,t){return _l(e,3).substring(0,t)}(d,t);const p=Ea(c,Ut.MinusSign);return _l(d,t,p,r,i)}}function Ir(e,t,n=hi.Format,r=!1){return function(i,o){return function F$(e,t,n,r,i,o){switch(n){case un.Months:return function b$(e,t,n){const r=is(e),o=Da([r[vt.MonthsFormat],r[vt.MonthsStandalone]],t);return Da(o,n)}(t,i,r)[e.getMonth()];case un.Days:return function v$(e,t,n){const r=is(e),o=Da([r[vt.DaysFormat],r[vt.DaysStandalone]],t);return Da(o,n)}(t,i,r)[e.getDay()];case un.DayPeriods:const c=e.getHours(),d=e.getMinutes();if(o){const v=function E$(e){const t=is(e);return LA(t),(t[vt.ExtraData][2]||[]).map(r=>"string"==typeof r?aC(r):[aC(r[0]),aC(r[1])])}(t),E=function D$(e,t,n){const r=is(e);LA(r);const o=Da([r[vt.ExtraData][0],r[vt.ExtraData][1]],t)||[];return Da(o,n)||[]}(t,i,r),D=v.findIndex(I=>{if(Array.isArray(I)){const[P,N]=I,G=c>=P.hours&&d>=P.minutes,U=c0?Math.floor(i/60):Math.ceil(i/60);switch(e){case Fi.Short:return(i>=0?"+":"")+_l(c,2,o)+_l(Math.abs(i%60),2,o);case Fi.ShortGMT:return"GMT"+(i>=0?"+":"")+_l(c,1,o);case Fi.Long:return"GMT"+(i>=0?"+":"")+_l(c,2,o)+":"+_l(Math.abs(i%60),2,o);case Fi.Extended:return 0===r?"Z":(i>=0?"+":"")+_l(c,2,o)+":"+_l(Math.abs(i%60),2,o);default:throw new Error(`Unknown zone width "${e}"`)}}}function NA(e){return Wv(e.getFullYear(),e.getMonth(),e.getDate()+(4-e.getDay()))}function lC(e,t=!1){return function(n,r){let i;if(t){const o=new Date(n.getFullYear(),n.getMonth(),1).getDay()-1,c=n.getDate();i=1+Math.floor((c+o)/7)}else{const o=NA(n),c=function L$(e){const t=Wv(e,0,1).getDay();return Wv(e,0,1+(t<=4?4:11)-t)}(o.getFullYear()),d=o.getTime()-c.getTime();i=1+Math.round(d/6048e5)}return _l(i,e,Ea(r,Ut.MinusSign))}}function Jv(e,t=!1){return function(n,r){return _l(NA(n).getFullYear(),e,Ea(r,Ut.MinusSign),t)}}const cC={};function zA(e,t){e=e.replace(/:/g,"");const n=Date.parse("Jan 01, 1970 00:00:00 "+e)/6e4;return isNaN(n)?t:n}function BA(e){return e instanceof Date&&!isNaN(e.valueOf())}function jA(e,t){t=encodeURIComponent(t);for(const n of e.split(";")){const r=n.indexOf("="),[i,o]=-1==r?[n,""]:[n.slice(0,r),n.slice(r+1)];if(i.trim()===t)return decodeURIComponent(o)}return null}let mC=(()=>{class e{constructor(n,r,i,o){this._iterableDiffers=n,this._keyValueDiffers=r,this._ngEl=i,this._renderer=o,this._iterableDiffer=null,this._keyValueDiffer=null,this._initialClasses=[],this._rawClass=null}set klass(n){this._removeClasses(this._initialClasses),this._initialClasses="string"==typeof n?n.split(/\s+/):[],this._applyClasses(this._initialClasses),this._applyClasses(this._rawClass)}set ngClass(n){this._removeClasses(this._rawClass),this._applyClasses(this._initialClasses),this._iterableDiffer=null,this._keyValueDiffer=null,this._rawClass="string"==typeof n?n.split(/\s+/):n,this._rawClass&&(Gg(this._rawClass)?this._iterableDiffer=this._iterableDiffers.find(this._rawClass).create():this._keyValueDiffer=this._keyValueDiffers.find(this._rawClass).create())}ngDoCheck(){if(this._iterableDiffer){const n=this._iterableDiffer.diff(this._rawClass);n&&this._applyIterableChanges(n)}else if(this._keyValueDiffer){const n=this._keyValueDiffer.diff(this._rawClass);n&&this._applyKeyValueChanges(n)}}_applyKeyValueChanges(n){n.forEachAddedItem(r=>this._toggleClass(r.key,r.currentValue)),n.forEachChangedItem(r=>this._toggleClass(r.key,r.currentValue)),n.forEachRemovedItem(r=>{r.previousValue&&this._toggleClass(r.key,!1)})}_applyIterableChanges(n){n.forEachAddedItem(r=>{if("string"!=typeof r.item)throw new Error(`NgClass can only toggle CSS classes expressed as strings, got ${Mn(r.item)}`);this._toggleClass(r.item,!0)}),n.forEachRemovedItem(r=>this._toggleClass(r.item,!1))}_applyClasses(n){n&&(Array.isArray(n)||n instanceof Set?n.forEach(r=>this._toggleClass(r,!0)):Object.keys(n).forEach(r=>this._toggleClass(r,!!n[r])))}_removeClasses(n){n&&(Array.isArray(n)||n instanceof Set?n.forEach(r=>this._toggleClass(r,!1)):Object.keys(n).forEach(r=>this._toggleClass(r,!1)))}_toggleClass(n,r){(n=n.trim())&&n.split(/\s+/g).forEach(i=>{r?this._renderer.addClass(this._ngEl.nativeElement,i):this._renderer.removeClass(this._ngEl.nativeElement,i)})}}return e.\u0275fac=function(n){return new(n||e)(qe(jv),qe(sy),qe(Xs),qe(hl))},e.\u0275dir=Lt({type:e,selectors:[["","ngClass",""]],inputs:{klass:["class","klass"],ngClass:"ngClass"},standalone:!0}),e})();class e7{constructor(t,n,r,i){this.$implicit=t,this.ngForOf=n,this.index=r,this.count=i}get first(){return 0===this.index}get last(){return this.index===this.count-1}get even(){return this.index%2==0}get odd(){return!this.even}}let qA=(()=>{class e{constructor(n,r,i){this._viewContainer=n,this._template=r,this._differs=i,this._ngForOf=null,this._ngForOfDirty=!0,this._differ=null}set ngForOf(n){this._ngForOf=n,this._ngForOfDirty=!0}set ngForTrackBy(n){this._trackByFn=n}get ngForTrackBy(){return this._trackByFn}set ngForTemplate(n){n&&(this._template=n)}ngDoCheck(){if(this._ngForOfDirty){this._ngForOfDirty=!1;const n=this._ngForOf;!this._differ&&n&&(this._differ=this._differs.find(n).create(this.ngForTrackBy))}if(this._differ){const n=this._differ.diff(this._ngForOf);n&&this._applyChanges(n)}}_applyChanges(n){const r=this._viewContainer;n.forEachOperation((i,o,c)=>{if(null==i.previousIndex)r.createEmbeddedView(this._template,new e7(i.item,this._ngForOf,-1,-1),null===c?void 0:c);else if(null==c)r.remove(null===o?void 0:o);else if(null!==o){const d=r.get(o);r.move(d,c),ZA(d,i)}});for(let i=0,o=r.length;i{ZA(r.get(i.currentIndex),i)})}static ngTemplateContextGuard(n,r){return!0}}return e.\u0275fac=function(n){return new(n||e)(qe(gl),qe(iu),qe(jv))},e.\u0275dir=Lt({type:e,selectors:[["","ngFor","","ngForOf",""]],inputs:{ngForOf:"ngForOf",ngForTrackBy:"ngForTrackBy",ngForTemplate:"ngForTemplate"},standalone:!0}),e})();function ZA(e,t){e.context.$implicit=t.item}let WA=(()=>{class e{constructor(n,r){this._viewContainer=n,this._context=new n7,this._thenTemplateRef=null,this._elseTemplateRef=null,this._thenViewRef=null,this._elseViewRef=null,this._thenTemplateRef=r}set ngIf(n){this._context.$implicit=this._context.ngIf=n,this._updateView()}set ngIfThen(n){XA("ngIfThen",n),this._thenTemplateRef=n,this._thenViewRef=null,this._updateView()}set ngIfElse(n){XA("ngIfElse",n),this._elseTemplateRef=n,this._elseViewRef=null,this._updateView()}_updateView(){this._context.$implicit?this._thenViewRef||(this._viewContainer.clear(),this._elseViewRef=null,this._thenTemplateRef&&(this._thenViewRef=this._viewContainer.createEmbeddedView(this._thenTemplateRef,this._context))):this._elseViewRef||(this._viewContainer.clear(),this._thenViewRef=null,this._elseTemplateRef&&(this._elseViewRef=this._viewContainer.createEmbeddedView(this._elseTemplateRef,this._context)))}static ngTemplateContextGuard(n,r){return!0}}return e.\u0275fac=function(n){return new(n||e)(qe(gl),qe(iu))},e.\u0275dir=Lt({type:e,selectors:[["","ngIf",""]],inputs:{ngIf:"ngIf",ngIfThen:"ngIfThen",ngIfElse:"ngIfElse"},standalone:!0}),e})();class n7{constructor(){this.$implicit=null,this.ngIf=null}}function XA(e,t){if(t&&!t.createEmbeddedView)throw new Error(`${e} must be a TemplateRef, but received '${Mn(t)}'.`)}const y7=new It("DATE_PIPE_DEFAULT_TIMEZONE");let KA=(()=>{class e{constructor(n,r){this.locale=n,this.defaultTimezone=r}transform(n,r="mediumDate",i,o){if(null==n||""===n||n!=n)return null;try{return k$(n,r,o||this.locale,i??this.defaultTimezone??void 0)}catch(c){throw function vl(e,t){return new nt(2100,!1)}()}}}return e.\u0275fac=function(n){return new(n||e)(qe(ou,16),qe(y7,24))},e.\u0275pipe=$i({name:"date",type:e,pure:!0,standalone:!0}),e})(),QA=(()=>{class e{}return e.\u0275fac=function(n){return new(n||e)},e.\u0275mod=ai({type:e}),e.\u0275inj=Ei({}),e})();let k7=(()=>{class e{}return e.\u0275prov=Ot({token:e,providedIn:"root",factory:()=>new P7(St(ss),window)}),e})();class P7{constructor(t,n){this.document=t,this.window=n,this.offset=()=>[0,0]}setOffset(t){this.offset=Array.isArray(t)?()=>t:t}getScrollPosition(){return this.supportsScrolling()?[this.window.pageXOffset,this.window.pageYOffset]:[0,0]}scrollToPosition(t){this.supportsScrolling()&&this.window.scrollTo(t[0],t[1])}scrollToAnchor(t){if(!this.supportsScrolling())return;const n=function R7(e,t){const n=e.getElementById(t)||e.getElementsByName(t)[0];if(n)return n;if("function"==typeof e.createTreeWalker&&e.body&&(e.body.createShadowRoot||e.body.attachShadow)){const r=e.createTreeWalker(e.body,NodeFilter.SHOW_ELEMENT);let i=r.currentNode;for(;i;){const o=i.shadowRoot;if(o){const c=o.getElementById(t)||o.querySelector(`[name="${t}"]`);if(c)return c}i=r.nextNode()}}return null}(this.document,t);n&&(this.scrollToElement(n),n.focus())}setHistoryScrollRestoration(t){if(this.supportScrollRestoration()){const n=this.window.history;n&&n.scrollRestoration&&(n.scrollRestoration=t)}}scrollToElement(t){const n=t.getBoundingClientRect(),r=n.left+this.window.pageXOffset,i=n.top+this.window.pageYOffset,o=this.offset();this.window.scrollTo(r-o[0],i-o[1])}supportScrollRestoration(){try{if(!this.supportsScrolling())return!1;const t=tk(this.window.history)||tk(Object.getPrototypeOf(this.window.history));return!(!t||!t.writable&&!t.set)}catch{return!1}}supportsScrolling(){try{return!!this.window&&!!this.window.scrollTo&&"pageXOffset"in this.window}catch{return!1}}}function tk(e){return Object.getOwnPropertyDescriptor(e,"scrollRestoration")}class nk{}class wC extends class s9 extends class u${}{constructor(){super(...arguments),this.supportsDOMEvents=!0}}{static makeCurrent(){!function c$(e){Hv||(Hv=e)}(new wC)}onAndCancel(t,n,r){return t.addEventListener(n,r,!1),()=>{t.removeEventListener(n,r,!1)}}dispatchEvent(t,n){t.dispatchEvent(n)}remove(t){t.parentNode&&t.parentNode.removeChild(t)}createElement(t,n){return(n=n||this.getDefaultDocument()).createElement(t)}createHtmlDocument(){return document.implementation.createHTMLDocument("fakeTitle")}getDefaultDocument(){return document}isElementNode(t){return t.nodeType===Node.ELEMENT_NODE}isShadowRoot(t){return t instanceof DocumentFragment}getGlobalEventTarget(t,n){return"window"===n?window:"document"===n?t:"body"===n?t.body:null}getBaseHref(t){const n=function a9(){return uy=uy||document.querySelector("base"),uy?uy.getAttribute("href"):null}();return null==n?null:function l9(e){n0=n0||document.createElement("a"),n0.setAttribute("href",e);const t=n0.pathname;return"/"===t.charAt(0)?t:`/${t}`}(n)}resetBaseElement(){uy=null}getUserAgent(){return window.navigator.userAgent}getCookie(t){return jA(document.cookie,t)}}let n0,uy=null;const ak=new It("TRANSITION_ID"),u9=[{provide:Lv,useFactory:function c9(e,t,n){return()=>{n.get(Nv).donePromise.then(()=>{const r=fc(),i=t.querySelectorAll(`style[ng-transition="${e}"]`);for(let o=0;o{class e{build(){return new XMLHttpRequest}}return e.\u0275fac=function(n){return new(n||e)},e.\u0275prov=Ot({token:e,factory:e.\u0275fac}),e})();const r0=new It("EventManagerPlugins");let o0=(()=>{class e{constructor(n,r){this._zone=r,this._eventNameToPlugin=new Map,n.forEach(i=>i.manager=this),this._plugins=n.slice().reverse()}addEventListener(n,r,i){return this._findPluginFor(r).addEventListener(n,r,i)}addGlobalEventListener(n,r,i){return this._findPluginFor(r).addGlobalEventListener(n,r,i)}getZone(){return this._zone}_findPluginFor(n){const r=this._eventNameToPlugin.get(n);if(r)return r;const i=this._plugins;for(let o=0;o{class e{constructor(){this._stylesSet=new Set}addStyles(n){const r=new Set;n.forEach(i=>{this._stylesSet.has(i)||(this._stylesSet.add(i),r.add(i))}),this.onStylesAdded(r)}onStylesAdded(n){}getAllStyles(){return Array.from(this._stylesSet)}}return e.\u0275fac=function(n){return new(n||e)},e.\u0275prov=Ot({token:e,factory:e.\u0275fac}),e})(),hy=(()=>{class e extends ck{constructor(n){super(),this._doc=n,this._hostNodes=new Map,this._hostNodes.set(n.head,[])}_addStylesToHost(n,r,i){n.forEach(o=>{const c=this._doc.createElement("style");c.textContent=o,i.push(r.appendChild(c))})}addHost(n){const r=[];this._addStylesToHost(this._stylesSet,n,r),this._hostNodes.set(n,r)}removeHost(n){const r=this._hostNodes.get(n);r&&r.forEach(uk),this._hostNodes.delete(n)}onStylesAdded(n){this._hostNodes.forEach((r,i)=>{this._addStylesToHost(n,i,r)})}ngOnDestroy(){this._hostNodes.forEach(n=>n.forEach(uk))}}return e.\u0275fac=function(n){return new(n||e)(St(ss))},e.\u0275prov=Ot({token:e,factory:e.\u0275fac}),e})();function uk(e){fc().remove(e)}const CC={svg:"http://www.w3.org/2000/svg",xhtml:"http://www.w3.org/1999/xhtml",xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/",math:"http://www.w3.org/1998/MathML/"},EC=/%COMP%/g;function s0(e,t,n){for(let r=0;r{if("__ngUnwrap__"===t)return e;!1===e(t)&&(t.preventDefault(),t.returnValue=!1)}}let DC=(()=>{class e{constructor(n,r,i){this.eventManager=n,this.sharedStylesHost=r,this.appId=i,this.rendererByCompId=new Map,this.defaultRenderer=new SC(n)}createRenderer(n,r){if(!n||!r)return this.defaultRenderer;switch(r.encapsulation){case ms.Emulated:{let i=this.rendererByCompId.get(r.id);return i||(i=new _9(this.eventManager,this.sharedStylesHost,r,this.appId),this.rendererByCompId.set(r.id,i)),i.applyToHost(n),i}case 1:case ms.ShadowDom:return new v9(this.eventManager,this.sharedStylesHost,n,r);default:if(!this.rendererByCompId.has(r.id)){const i=s0(r.id,r.styles,[]);this.sharedStylesHost.addStyles(i),this.rendererByCompId.set(r.id,this.defaultRenderer)}return this.defaultRenderer}}begin(){}end(){}}return e.\u0275fac=function(n){return new(n||e)(St(o0),St(hy),St(iy))},e.\u0275prov=Ot({token:e,factory:e.\u0275fac}),e})();class SC{constructor(t){this.eventManager=t,this.data=Object.create(null),this.destroyNode=null}destroy(){}createElement(t,n){return n?document.createElementNS(CC[n]||n,t):document.createElement(t)}createComment(t){return document.createComment(t)}createText(t){return document.createTextNode(t)}appendChild(t,n){(mk(t)?t.content:t).appendChild(n)}insertBefore(t,n,r){t&&(mk(t)?t.content:t).insertBefore(n,r)}removeChild(t,n){t&&t.removeChild(n)}selectRootElement(t,n){let r="string"==typeof t?document.querySelector(t):t;if(!r)throw new Error(`The selector "${t}" did not match any elements`);return n||(r.textContent=""),r}parentNode(t){return t.parentNode}nextSibling(t){return t.nextSibling}setAttribute(t,n,r,i){if(i){n=i+":"+n;const o=CC[i];o?t.setAttributeNS(o,n,r):t.setAttribute(n,r)}else t.setAttribute(n,r)}removeAttribute(t,n,r){if(r){const i=CC[r];i?t.removeAttributeNS(i,n):t.removeAttribute(`${r}:${n}`)}else t.removeAttribute(n)}addClass(t,n){t.classList.add(n)}removeClass(t,n){t.classList.remove(n)}setStyle(t,n,r,i){i&(Wi.DashCase|Wi.Important)?t.style.setProperty(n,r,i&Wi.Important?"important":""):t.style[n]=r}removeStyle(t,n,r){r&Wi.DashCase?t.style.removeProperty(n):t.style[n]=""}setProperty(t,n,r){t[n]=r}setValue(t,n){t.nodeValue=n}listen(t,n,r){return"string"==typeof t?this.eventManager.addGlobalEventListener(t,n,fk(r)):this.eventManager.addEventListener(t,n,fk(r))}}function mk(e){return"TEMPLATE"===e.tagName&&void 0!==e.content}class _9 extends SC{constructor(t,n,r,i){super(t),this.component=r;const o=s0(i+"-"+r.id,r.styles,[]);n.addStyles(o),this.contentAttr=function m9(e){return"_ngcontent-%COMP%".replace(EC,e)}(i+"-"+r.id),this.hostAttr=function g9(e){return"_nghost-%COMP%".replace(EC,e)}(i+"-"+r.id)}applyToHost(t){super.setAttribute(t,this.hostAttr,"")}createElement(t,n){const r=super.createElement(t,n);return super.setAttribute(r,this.contentAttr,""),r}}class v9 extends SC{constructor(t,n,r,i){super(t),this.sharedStylesHost=n,this.hostEl=r,this.shadowRoot=r.attachShadow({mode:"open"}),this.sharedStylesHost.addHost(this.shadowRoot);const o=s0(i.id,i.styles,[]);for(let c=0;c{class e extends lk{constructor(n){super(n)}supports(n){return!0}addEventListener(n,r,i){return n.addEventListener(r,i,!1),()=>this.removeEventListener(n,r,i)}removeEventListener(n,r,i){return n.removeEventListener(r,i)}}return e.\u0275fac=function(n){return new(n||e)(St(ss))},e.\u0275prov=Ot({token:e,factory:e.\u0275fac}),e})();const gk=["alt","control","meta","shift"],x9={"\b":"Backspace","\t":"Tab","\x7f":"Delete","\x1b":"Escape",Del:"Delete",Esc:"Escape",Left:"ArrowLeft",Right:"ArrowRight",Up:"ArrowUp",Down:"ArrowDown",Menu:"ContextMenu",Scroll:"ScrollLock",Win:"OS"},w9={alt:e=>e.altKey,control:e=>e.ctrlKey,meta:e=>e.metaKey,shift:e=>e.shiftKey};let C9=(()=>{class e extends lk{constructor(n){super(n)}supports(n){return null!=e.parseEventName(n)}addEventListener(n,r,i){const o=e.parseEventName(r),c=e.eventCallback(o.fullKey,i,this.manager.getZone());return this.manager.getZone().runOutsideAngular(()=>fc().onAndCancel(n,o.domEventName,c))}static parseEventName(n){const r=n.toLowerCase().split("."),i=r.shift();if(0===r.length||"keydown"!==i&&"keyup"!==i)return null;const o=e._normalizeKey(r.pop());let c="",d=r.indexOf("code");if(d>-1&&(r.splice(d,1),c="code."),gk.forEach(v=>{const E=r.indexOf(v);E>-1&&(r.splice(E,1),c+=v+".")}),c+=o,0!=r.length||0===o.length)return null;const p={};return p.domEventName=i,p.fullKey=c,p}static matchEventFullKeyCode(n,r){let i=x9[n.key]||n.key,o="";return r.indexOf("code.")>-1&&(i=n.code,o="code."),!(null==i||!i)&&(i=i.toLowerCase()," "===i?i="space":"."===i&&(i="dot"),gk.forEach(c=>{c!==i&&(0,w9[c])(n)&&(o+=c+".")}),o+=i,o===r)}static eventCallback(n,r,i){return o=>{e.matchEventFullKeyCode(o,n)&&i.runGuarded(()=>r(o))}}static _normalizeKey(n){return"esc"===n?"escape":n}}return e.\u0275fac=function(n){return new(n||e)(St(ss))},e.\u0275prov=Ot({token:e,factory:e.\u0275fac}),e})();const M9=uA(s$,"browser",[{provide:jw,useValue:"browser"},{provide:eA,useValue:function E9(){wC.makeCurrent()},multi:!0},{provide:ss,useFactory:function S9(){return function x(e){_=e}(document),document},deps:[]}]),vk=new It(""),bk=[{provide:zv,useClass:class h9{addToWindow(t){er.getAngularTestability=(r,i=!0)=>{const o=t.findTestabilityInTree(r,i);if(null==o)throw new Error("Could not find testability for element.");return o},er.getAllAngularTestabilities=()=>t.getAllTestabilities(),er.getAllAngularRootElements=()=>t.getAllRootElements(),er.frameworkStabilizers||(er.frameworkStabilizers=[]),er.frameworkStabilizers.push(r=>{const i=er.getAllAngularTestabilities();let o=i.length,c=!1;const d=function(p){c=c||p,o--,0==o&&r(c)};i.forEach(function(p){p.whenStable(d)})})}findTestabilityInTree(t,n,r){return null==n?null:t.getTestability(n)??(r?fc().isShadowRoot(n)?this.findTestabilityInTree(t,n.host,!0):this.findTestabilityInTree(t,n.parentElement,!0):null)}},deps:[]},{provide:sA,useClass:Ww,deps:[Ri,Xw,zv]},{provide:Ww,useClass:Ww,deps:[Ri,Xw,zv]}],xk=[{provide:wh,useValue:"root"},{provide:Ep,useFactory:function D9(){return new Ep},deps:[]},{provide:r0,useClass:b9,multi:!0,deps:[ss,Ri,jw]},{provide:r0,useClass:C9,multi:!0,deps:[ss]},{provide:DC,useClass:DC,deps:[o0,hy,iy]},{provide:z2,useExisting:DC},{provide:ck,useExisting:hy},{provide:hy,useClass:hy,deps:[ss]},{provide:o0,useClass:o0,deps:[r0,Ri]},{provide:nk,useClass:d9,deps:[]},[]];let I9=(()=>{class e{constructor(n){}static withServerTransition(n){return{ngModule:e,providers:[{provide:iy,useValue:n.appId},{provide:ak,useExisting:iy},u9]}}}return e.\u0275fac=function(n){return new(n||e)(St(vk,12))},e.\u0275mod=ai({type:e}),e.\u0275inj=Ei({providers:[...xk,...bk],imports:[QA,a$]}),e})(),wk=(()=>{class e{constructor(n){this._doc=n}getTitle(){return this._doc.title}setTitle(n){this._doc.title=n||""}}return e.\u0275fac=function(n){return new(n||e)(St(ss))},e.\u0275prov=Ot({token:e,factory:function(n){let r=null;return r=n?new n:function A9(){return new wk(St(ss))}(),r},providedIn:"root"}),e})();function Bt(...e){return Cr(e,sr(e))}typeof window<"u"&&window;class bl extends oi{constructor(t){super(),this._value=t}get value(){return this.getValue()}_subscribe(t){const n=super._subscribe(t);return!n.closed&&t.next(this._value),n}getValue(){const{hasError:t,thrownError:n,_value:r}=this;if(t)throw n;return this._throwIfClosed(),r}next(t){super.next(this._value=t)}}const a0=Zh(e=>function(){e(this),this.name="EmptyError",this.message="no elements in sequence"}),{isArray:z9}=Array,{getPrototypeOf:B9,prototype:V9,keys:U9}=Object;const{isArray:j9}=Array;function Ik(...e){const t=sr(e),n=function qn(e){return or(an(e))?e.pop():void 0}(e),{args:r,keys:i}=function Dk(e){if(1===e.length){const t=e[0];if(z9(t))return{args:t,keys:null};if(function $9(e){return e&&"object"==typeof e&&B9(e)===V9}(t)){const n=U9(t);return{args:n.map(r=>t[r]),keys:n}}}return{args:e,keys:null}}(e);if(0===r.length)return Cr([],t);const o=new Nn(function G9(e,t,n=qr){return r=>{Tk(t,()=>{const{length:i}=e,o=new Array(i);let c=i,d=i;for(let p=0;p{const v=Cr(e[p],t);let E=!1;v.subscribe(Qn(r,D=>{o[p]=D,E||(E=!0,d--),d||r.next(n(o.slice()))},()=>{--c||r.complete()}))},r)},r)}}(r,t,i?c=>function Mk(e,t){return e.reduce((n,r,i)=>(n[r]=t[i],n),{})}(i,c):qr));return n?o.pipe(function Sk(e){return Pe(t=>function H9(e,t){return j9(t)?e(...t):e(t)}(e,t))}(n)):o}function Tk(e,t,n){e?Ie(n,e,t):t()}function TC(...e){return function q9(){return ft(1)}()(Cr(e,sr(e)))}function Ak(e){return new Nn(t=>{te(e()).subscribe(t)})}function dy(e,t){const n=or(e)?e:()=>e,r=i=>i.error(n());return new Nn(t?i=>t.schedule(r,0,i):r)}function AC(){return mr((e,t)=>{let n=null;e._refCount++;const r=Qn(t,void 0,void 0,void 0,()=>{if(!e||e._refCount<=0||0<--e._refCount)return void(n=null);const i=e._connection,o=n;n=null,i&&(!o||i===o)&&i.unsubscribe(),t.unsubscribe()});e.subscribe(r),r.closed||(n=e.connect())})}class kk extends Nn{constructor(t,n){super(),this.source=t,this.subjectFactory=n,this._subject=null,this._refCount=0,this._connection=null,ra(t)&&(this.lift=t.lift)}_subscribe(t){return this.getSubject().subscribe(t)}getSubject(){const t=this._subject;return(!t||t.isStopped)&&(this._subject=this.subjectFactory()),this._subject}_teardown(){this._refCount=0;const{_connection:t}=this;this._subject=this._connection=null,t?.unsubscribe()}connect(){let t=this._connection;if(!t){t=this._connection=new _r;const n=this.getSubject();t.add(this.source.subscribe(Qn(n,void 0,()=>{this._teardown(),n.complete()},r=>{this._teardown(),n.error(r)},()=>this._teardown()))),t.closed&&(this._connection=null,t=_r.EMPTY)}return t}refCount(){return AC()(this)}}function pc(e,t){return mr((n,r)=>{let i=null,o=0,c=!1;const d=()=>c&&!i&&r.complete();n.subscribe(Qn(r,p=>{i?.unsubscribe();let v=0;const E=o++;te(e(p,E)).subscribe(i=Qn(r,D=>r.next(t?t(p,D,E,v++):D),()=>{i=null,d()}))},()=>{c=!0,d()}))})}function fy(e){return e<=0?()=>xt:mr((t,n)=>{let r=0;t.subscribe(Qn(n,i=>{++r<=e&&(n.next(i),e<=r&&n.complete())}))})}function uu(e,t){return mr((n,r)=>{let i=0;n.subscribe(Qn(r,o=>e.call(t,o,i++)&&r.next(o)))})}function l0(e){return mr((t,n)=>{let r=!1;t.subscribe(Qn(n,i=>{r=!0,n.next(i)},()=>{r||n.next(e),n.complete()}))})}function Pk(e=W9){return mr((t,n)=>{let r=!1;t.subscribe(Qn(n,i=>{r=!0,n.next(i)},()=>r?n.complete():n.error(e())))})}function W9(){return new a0}function Mh(e,t){const n=arguments.length>=2;return r=>r.pipe(e?uu((i,o)=>e(i,o,r)):qr,fy(1),n?l0(t):Pk(()=>new a0))}function Ih(e,t){return or(t)?dt(e,t,1):dt(e,1)}function Vo(e,t,n){const r=or(e)||t||n?{next:e,error:t,complete:n}:e;return r?mr((i,o)=>{var c;null===(c=r.subscribe)||void 0===c||c.call(r);let d=!0;i.subscribe(Qn(o,p=>{var v;null===(v=r.next)||void 0===v||v.call(r,p),o.next(p)},()=>{var p;d=!1,null===(p=r.complete)||void 0===p||p.call(r),o.complete()},p=>{var v;d=!1,null===(v=r.error)||void 0===v||v.call(r,p),o.error(p)},()=>{var p,v;d&&(null===(p=r.unsubscribe)||void 0===p||p.call(r)),null===(v=r.finalize)||void 0===v||v.call(r)}))}):qr}function Th(e){return mr((t,n)=>{let o,r=null,i=!1;r=t.subscribe(Qn(n,void 0,void 0,c=>{o=te(e(c,Th(e)(t))),r?(r.unsubscribe(),r=null,o.subscribe(n)):i=!0})),i&&(r.unsubscribe(),r=null,o.subscribe(n))})}function X9(e,t,n,r,i){return(o,c)=>{let d=n,p=t,v=0;o.subscribe(Qn(c,E=>{const D=v++;p=d?e(p,E,D):(d=!0,E),r&&c.next(p)},i&&(()=>{d&&c.next(p),c.complete()})))}}function Rk(e,t){return mr(X9(e,t,arguments.length>=2,!0))}function kC(e){return e<=0?()=>xt:mr((t,n)=>{let r=[];t.subscribe(Qn(n,i=>{r.push(i),e{for(const i of r)n.next(i);n.complete()},void 0,()=>{r=null}))})}function Fk(e,t){const n=arguments.length>=2;return r=>r.pipe(e?uu((i,o)=>e(i,o,r)):qr,kC(1),n?l0(t):Pk(()=>new a0))}function PC(e){return mr((t,n)=>{try{t.subscribe(n)}finally{n.add(e)}})}const bn="primary",py=Symbol("RouteTitle");class J9{constructor(t){this.params=t||{}}has(t){return Object.prototype.hasOwnProperty.call(this.params,t)}get(t){if(this.has(t)){const n=this.params[t];return Array.isArray(n)?n[0]:n}return null}getAll(t){if(this.has(t)){const n=this.params[t];return Array.isArray(n)?n:[n]}return[]}get keys(){return Object.keys(this.params)}}function qp(e){return new J9(e)}function Q9(e,t,n){const r=n.path.split("/");if(r.length>e.length||"full"===n.pathMatch&&(t.hasChildren()||r.lengthr[o]===i)}return e===t}function Lk(e){return Array.prototype.concat.apply([],e)}function Nk(e){return e.length>0?e[e.length-1]:null}function Eo(e,t){for(const n in e)e.hasOwnProperty(n)&&t(e[n],n)}function Ah(e){return yw(e)?e:Zg(e)?Cr(Promise.resolve(e)):Bt(e)}const nj={exact:function Vk(e,t,n){if(!lf(e.segments,t.segments)||!c0(e.segments,t.segments,n)||e.numberOfChildren!==t.numberOfChildren)return!1;for(const r in t.children)if(!e.children[r]||!Vk(e.children[r],t.children[r],n))return!1;return!0},subset:Uk},zk={exact:function rj(e,t){return mc(e,t)},subset:function ij(e,t){return Object.keys(t).length<=Object.keys(e).length&&Object.keys(t).every(n=>Ok(e[n],t[n]))},ignored:()=>!0};function Bk(e,t,n){return nj[n.paths](e.root,t.root,n.matrixParams)&&zk[n.queryParams](e.queryParams,t.queryParams)&&!("exact"===n.fragment&&e.fragment!==t.fragment)}function Uk(e,t,n){return $k(e,t,t.segments,n)}function $k(e,t,n,r){if(e.segments.length>n.length){const i=e.segments.slice(0,n.length);return!(!lf(i,n)||t.hasChildren()||!c0(i,n,r))}if(e.segments.length===n.length){if(!lf(e.segments,n)||!c0(e.segments,n,r))return!1;for(const i in t.children)if(!e.children[i]||!Uk(e.children[i],t.children[i],r))return!1;return!0}{const i=n.slice(0,e.segments.length),o=n.slice(e.segments.length);return!!(lf(e.segments,i)&&c0(e.segments,i,r)&&e.children[bn])&&$k(e.children[bn],t,o,r)}}function c0(e,t,n){return t.every((r,i)=>zk[n](e[i].parameters,r.parameters))}class af{constructor(t,n,r){this.root=t,this.queryParams=n,this.fragment=r}get queryParamMap(){return this._queryParamMap||(this._queryParamMap=qp(this.queryParams)),this._queryParamMap}toString(){return aj.serialize(this)}}class En{constructor(t,n){this.segments=t,this.children=n,this.parent=null,Eo(n,(r,i)=>r.parent=this)}hasChildren(){return this.numberOfChildren>0}get numberOfChildren(){return Object.keys(this.children).length}toString(){return u0(this)}}class my{constructor(t,n){this.path=t,this.parameters=n}get parameterMap(){return this._parameterMap||(this._parameterMap=qp(this.parameters)),this._parameterMap}toString(){return qk(this)}}function lf(e,t){return e.length===t.length&&e.every((n,r)=>n.path===t[r].path)}let jk=(()=>{class e{}return e.\u0275fac=function(n){return new(n||e)},e.\u0275prov=Ot({token:e,factory:function(){return new FC},providedIn:"root"}),e})();class FC{parse(t){const n=new gj(t);return new af(n.parseRootSegment(),n.parseQueryParams(),n.parseFragment())}serialize(t){const n=`/${gy(t.root,!0)}`,r=function uj(e){const t=Object.keys(e).map(n=>{const r=e[n];return Array.isArray(r)?r.map(i=>`${h0(n)}=${h0(i)}`).join("&"):`${h0(n)}=${h0(r)}`}).filter(n=>!!n);return t.length?`?${t.join("&")}`:""}(t.queryParams);return`${n}${r}${"string"==typeof t.fragment?`#${function lj(e){return encodeURI(e)}(t.fragment)}`:""}`}}const aj=new FC;function u0(e){return e.segments.map(t=>qk(t)).join("/")}function gy(e,t){if(!e.hasChildren())return u0(e);if(t){const n=e.children[bn]?gy(e.children[bn],!1):"",r=[];return Eo(e.children,(i,o)=>{o!==bn&&r.push(`${o}:${gy(i,!1)}`)}),r.length>0?`${n}(${r.join("//")})`:n}{const n=function sj(e,t){let n=[];return Eo(e.children,(r,i)=>{i===bn&&(n=n.concat(t(r,i)))}),Eo(e.children,(r,i)=>{i!==bn&&(n=n.concat(t(r,i)))}),n}(e,(r,i)=>i===bn?[gy(e.children[bn],!1)]:[`${i}:${gy(r,!1)}`]);return 1===Object.keys(e.children).length&&null!=e.children[bn]?`${u0(e)}/${n[0]}`:`${u0(e)}/(${n.join("//")})`}}function Hk(e){return encodeURIComponent(e).replace(/%40/g,"@").replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",")}function h0(e){return Hk(e).replace(/%3B/gi,";")}function OC(e){return Hk(e).replace(/\(/g,"%28").replace(/\)/g,"%29").replace(/%26/gi,"&")}function d0(e){return decodeURIComponent(e)}function Gk(e){return d0(e.replace(/\+/g,"%20"))}function qk(e){return`${OC(e.path)}${function cj(e){return Object.keys(e).map(t=>`;${OC(t)}=${OC(e[t])}`).join("")}(e.parameters)}`}const hj=/^[^\/()?;=#]+/;function f0(e){const t=e.match(hj);return t?t[0]:""}const dj=/^[^=?&#]+/,pj=/^[^&#]+/;class gj{constructor(t){this.url=t,this.remaining=t}parseRootSegment(){return this.consumeOptional("/"),""===this.remaining||this.peekStartsWith("?")||this.peekStartsWith("#")?new En([],{}):new En([],this.parseChildren())}parseQueryParams(){const t={};if(this.consumeOptional("?"))do{this.parseQueryParam(t)}while(this.consumeOptional("&"));return t}parseFragment(){return this.consumeOptional("#")?decodeURIComponent(this.remaining):null}parseChildren(){if(""===this.remaining)return{};this.consumeOptional("/");const t=[];for(this.peekStartsWith("(")||t.push(this.parseSegment());this.peekStartsWith("/")&&!this.peekStartsWith("//")&&!this.peekStartsWith("/(");)this.capture("/"),t.push(this.parseSegment());let n={};this.peekStartsWith("/(")&&(this.capture("/"),n=this.parseParens(!0));let r={};return this.peekStartsWith("(")&&(r=this.parseParens(!1)),(t.length>0||Object.keys(n).length>0)&&(r[bn]=new En(t,n)),r}parseSegment(){const t=f0(this.remaining);if(""===t&&this.peekStartsWith(";"))throw new nt(4009,!1);return this.capture(t),new my(d0(t),this.parseMatrixParams())}parseMatrixParams(){const t={};for(;this.consumeOptional(";");)this.parseParam(t);return t}parseParam(t){const n=f0(this.remaining);if(!n)return;this.capture(n);let r="";if(this.consumeOptional("=")){const i=f0(this.remaining);i&&(r=i,this.capture(r))}t[d0(n)]=d0(r)}parseQueryParam(t){const n=function fj(e){const t=e.match(dj);return t?t[0]:""}(this.remaining);if(!n)return;this.capture(n);let r="";if(this.consumeOptional("=")){const c=function mj(e){const t=e.match(pj);return t?t[0]:""}(this.remaining);c&&(r=c,this.capture(r))}const i=Gk(n),o=Gk(r);if(t.hasOwnProperty(i)){let c=t[i];Array.isArray(c)||(c=[c],t[i]=c),c.push(o)}else t[i]=o}parseParens(t){const n={};for(this.capture("(");!this.consumeOptional(")")&&this.remaining.length>0;){const r=f0(this.remaining),i=this.remaining[r.length];if("/"!==i&&")"!==i&&";"!==i)throw new nt(4010,!1);let o;r.indexOf(":")>-1?(o=r.slice(0,r.indexOf(":")),this.capture(o),this.capture(":")):t&&(o=bn);const c=this.parseChildren();n[o]=1===Object.keys(c).length?c[bn]:new En([],c),this.consumeOptional("//")}return n}peekStartsWith(t){return this.remaining.startsWith(t)}consumeOptional(t){return!!this.peekStartsWith(t)&&(this.remaining=this.remaining.substring(t.length),!0)}capture(t){if(!this.consumeOptional(t))throw new nt(4011,!1)}}function LC(e){return e.segments.length>0?new En([],{[bn]:e}):e}function p0(e){const t={};for(const r of Object.keys(e.children)){const o=p0(e.children[r]);(o.segments.length>0||o.hasChildren())&&(t[r]=o)}return function yj(e){if(1===e.numberOfChildren&&e.children[bn]){const t=e.children[bn];return new En(e.segments.concat(t.segments),t.children)}return e}(new En(e.segments,t))}function cf(e){return e instanceof af}function bj(e,t,n,r,i){if(0===n.length)return Zp(t.root,t.root,t.root,r,i);const o=function Xk(e){if("string"==typeof e[0]&&1===e.length&&"/"===e[0])return new Wk(!0,0,e);let t=0,n=!1;const r=e.reduce((i,o,c)=>{if("object"==typeof o&&null!=o){if(o.outlets){const d={};return Eo(o.outlets,(p,v)=>{d[v]="string"==typeof p?p.split("/"):p}),[...i,{outlets:d}]}if(o.segmentPath)return[...i,o.segmentPath]}return"string"!=typeof o?[...i,o]:0===c?(o.split("/").forEach((d,p)=>{0==p&&"."===d||(0==p&&""===d?n=!0:".."===d?t++:""!=d&&i.push(d))}),i):[...i,o]},[]);return new Wk(n,t,r)}(n);return o.toRoot()?Zp(t.root,t.root,new En([],{}),r,i):function c(p){const v=function wj(e,t,n,r){if(e.isAbsolute)return new Wp(t.root,!0,0);if(-1===r)return new Wp(n,n===t.root,0);return function Yk(e,t,n){let r=e,i=t,o=n;for(;o>i;){if(o-=i,r=r.parent,!r)throw new nt(4005,!1);i=r.segments.length}return new Wp(r,!1,i-o)}(n,r+(yy(e.commands[0])?0:1),e.numberOfDoubleDots)}(o,t,e.snapshot?._urlSegment,p),E=v.processChildren?vy(v.segmentGroup,v.index,o.commands):zC(v.segmentGroup,v.index,o.commands);return Zp(t.root,v.segmentGroup,E,r,i)}(e.snapshot?._lastPathIndex)}function yy(e){return"object"==typeof e&&null!=e&&!e.outlets&&!e.segmentPath}function _y(e){return"object"==typeof e&&null!=e&&e.outlets}function Zp(e,t,n,r,i){let c,o={};r&&Eo(r,(p,v)=>{o[v]=Array.isArray(p)?p.map(E=>`${E}`):`${p}`}),c=e===t?n:Zk(e,t,n);const d=LC(p0(c));return new af(d,o,i)}function Zk(e,t,n){const r={};return Eo(e.children,(i,o)=>{r[o]=i===t?n:Zk(i,t,n)}),new En(e.segments,r)}class Wk{constructor(t,n,r){if(this.isAbsolute=t,this.numberOfDoubleDots=n,this.commands=r,t&&r.length>0&&yy(r[0]))throw new nt(4003,!1);const i=r.find(_y);if(i&&i!==Nk(r))throw new nt(4004,!1)}toRoot(){return this.isAbsolute&&1===this.commands.length&&"/"==this.commands[0]}}class Wp{constructor(t,n,r){this.segmentGroup=t,this.processChildren=n,this.index=r}}function zC(e,t,n){if(e||(e=new En([],{})),0===e.segments.length&&e.hasChildren())return vy(e,t,n);const r=function Ej(e,t,n){let r=0,i=t;const o={match:!1,pathIndex:0,commandIndex:0};for(;i=n.length)return o;const c=e.segments[i],d=n[r];if(_y(d))break;const p=`${d}`,v=r0&&void 0===p)break;if(p&&v&&"object"==typeof v&&void 0===v.outlets){if(!Jk(p,v,c))return o;r+=2}else{if(!Jk(p,{},c))return o;r++}i++}return{match:!0,pathIndex:i,commandIndex:r}}(e,t,n),i=n.slice(r.commandIndex);if(r.match&&r.pathIndex{"string"==typeof o&&(o=[o]),null!==o&&(i[c]=zC(e.children[c],t,o))}),Eo(e.children,(o,c)=>{void 0===r[c]&&(i[c]=o)}),new En(e.segments,i)}}function BC(e,t,n){const r=e.segments.slice(0,t);let i=0;for(;i{"string"==typeof n&&(n=[n]),null!==n&&(t[r]=BC(new En([],{}),0,n))}),t}function Kk(e){const t={};return Eo(e,(n,r)=>t[r]=`${n}`),t}function Jk(e,t,n){return e==n.path&&mc(t,n.parameters)}class hu{constructor(t,n){this.id=t,this.url=n}}class VC extends hu{constructor(t,n,r="imperative",i=null){super(t,n),this.type=0,this.navigationTrigger=r,this.restoredState=i}toString(){return`NavigationStart(id: ${this.id}, url: '${this.url}')`}}class uf extends hu{constructor(t,n,r){super(t,n),this.urlAfterRedirects=r,this.type=1}toString(){return`NavigationEnd(id: ${this.id}, url: '${this.url}', urlAfterRedirects: '${this.urlAfterRedirects}')`}}class m0 extends hu{constructor(t,n,r,i){super(t,n),this.reason=r,this.code=i,this.type=2}toString(){return`NavigationCancel(id: ${this.id}, url: '${this.url}')`}}class Qk extends hu{constructor(t,n,r,i){super(t,n),this.error=r,this.target=i,this.type=3}toString(){return`NavigationError(id: ${this.id}, url: '${this.url}', error: ${this.error})`}}class Sj extends hu{constructor(t,n,r,i){super(t,n),this.urlAfterRedirects=r,this.state=i,this.type=4}toString(){return`RoutesRecognized(id: ${this.id}, url: '${this.url}', urlAfterRedirects: '${this.urlAfterRedirects}', state: ${this.state})`}}class Mj extends hu{constructor(t,n,r,i){super(t,n),this.urlAfterRedirects=r,this.state=i,this.type=7}toString(){return`GuardsCheckStart(id: ${this.id}, url: '${this.url}', urlAfterRedirects: '${this.urlAfterRedirects}', state: ${this.state})`}}class Ij extends hu{constructor(t,n,r,i,o){super(t,n),this.urlAfterRedirects=r,this.state=i,this.shouldActivate=o,this.type=8}toString(){return`GuardsCheckEnd(id: ${this.id}, url: '${this.url}', urlAfterRedirects: '${this.urlAfterRedirects}', state: ${this.state}, shouldActivate: ${this.shouldActivate})`}}class Tj extends hu{constructor(t,n,r,i){super(t,n),this.urlAfterRedirects=r,this.state=i,this.type=5}toString(){return`ResolveStart(id: ${this.id}, url: '${this.url}', urlAfterRedirects: '${this.urlAfterRedirects}', state: ${this.state})`}}class Aj extends hu{constructor(t,n,r,i){super(t,n),this.urlAfterRedirects=r,this.state=i,this.type=6}toString(){return`ResolveEnd(id: ${this.id}, url: '${this.url}', urlAfterRedirects: '${this.urlAfterRedirects}', state: ${this.state})`}}class kj{constructor(t){this.route=t,this.type=9}toString(){return`RouteConfigLoadStart(path: ${this.route.path})`}}class Pj{constructor(t){this.route=t,this.type=10}toString(){return`RouteConfigLoadEnd(path: ${this.route.path})`}}class Rj{constructor(t){this.snapshot=t,this.type=11}toString(){return`ChildActivationStart(path: '${this.snapshot.routeConfig&&this.snapshot.routeConfig.path||""}')`}}class Fj{constructor(t){this.snapshot=t,this.type=12}toString(){return`ChildActivationEnd(path: '${this.snapshot.routeConfig&&this.snapshot.routeConfig.path||""}')`}}class Oj{constructor(t){this.snapshot=t,this.type=13}toString(){return`ActivationStart(path: '${this.snapshot.routeConfig&&this.snapshot.routeConfig.path||""}')`}}class Lj{constructor(t){this.snapshot=t,this.type=14}toString(){return`ActivationEnd(path: '${this.snapshot.routeConfig&&this.snapshot.routeConfig.path||""}')`}}class eP{constructor(t,n,r){this.routerEvent=t,this.position=n,this.anchor=r,this.type=15}toString(){return`Scroll(anchor: '${this.anchor}', position: '${this.position?`${this.position[0]}, ${this.position[1]}`:null}')`}}class tP{constructor(t){this._root=t}get root(){return this._root.value}parent(t){const n=this.pathFromRoot(t);return n.length>1?n[n.length-2]:null}children(t){const n=UC(t,this._root);return n?n.children.map(r=>r.value):[]}firstChild(t){const n=UC(t,this._root);return n&&n.children.length>0?n.children[0].value:null}siblings(t){const n=$C(t,this._root);return n.length<2?[]:n[n.length-2].children.map(i=>i.value).filter(i=>i!==t)}pathFromRoot(t){return $C(t,this._root).map(n=>n.value)}}function UC(e,t){if(e===t.value)return t;for(const n of t.children){const r=UC(e,n);if(r)return r}return null}function $C(e,t){if(e===t.value)return[t];for(const n of t.children){const r=$C(e,n);if(r.length)return r.unshift(t),r}return[]}class du{constructor(t,n){this.value=t,this.children=n}toString(){return`TreeNode(${this.value})`}}function Xp(e){const t={};return e&&e.children.forEach(n=>t[n.value.outlet]=n),t}class nP extends tP{constructor(t,n){super(t),this.snapshot=n,jC(this,t)}toString(){return this.snapshot.toString()}}function rP(e,t){const n=function zj(e,t){const c=new g0([],{},{},"",{},bn,t,null,e.root,-1,{});return new oP("",new du(c,[]))}(e,t),r=new bl([new my("",{})]),i=new bl({}),o=new bl({}),c=new bl({}),d=new bl(""),p=new hf(r,i,c,d,o,bn,t,n.root);return p.snapshot=n.root,new nP(new du(p,[]),n)}class hf{constructor(t,n,r,i,o,c,d,p){this.url=t,this.params=n,this.queryParams=r,this.fragment=i,this.data=o,this.outlet=c,this.component=d,this.title=this.data?.pipe(Pe(v=>v[py]))??Bt(void 0),this._futureSnapshot=p}get routeConfig(){return this._futureSnapshot.routeConfig}get root(){return this._routerState.root}get parent(){return this._routerState.parent(this)}get firstChild(){return this._routerState.firstChild(this)}get children(){return this._routerState.children(this)}get pathFromRoot(){return this._routerState.pathFromRoot(this)}get paramMap(){return this._paramMap||(this._paramMap=this.params.pipe(Pe(t=>qp(t)))),this._paramMap}get queryParamMap(){return this._queryParamMap||(this._queryParamMap=this.queryParams.pipe(Pe(t=>qp(t)))),this._queryParamMap}toString(){return this.snapshot?this.snapshot.toString():`Future(${this._futureSnapshot})`}}function iP(e,t="emptyOnly"){const n=e.pathFromRoot;let r=0;if("always"!==t)for(r=n.length-1;r>=1;){const i=n[r],o=n[r-1];if(i.routeConfig&&""===i.routeConfig.path)r--;else{if(o.component)break;r--}}return function Bj(e){return e.reduce((t,n)=>({params:{...t.params,...n.params},data:{...t.data,...n.data},resolve:{...n.data,...t.resolve,...n.routeConfig?.data,...n._resolvedData}}),{params:{},data:{},resolve:{}})}(n.slice(r))}class g0{constructor(t,n,r,i,o,c,d,p,v,E,D,I){this.url=t,this.params=n,this.queryParams=r,this.fragment=i,this.data=o,this.outlet=c,this.component=d,this.title=this.data?.[py],this.routeConfig=p,this._urlSegment=v,this._lastPathIndex=E,this._correctedLastPathIndex=I??E,this._resolve=D}get root(){return this._routerState.root}get parent(){return this._routerState.parent(this)}get firstChild(){return this._routerState.firstChild(this)}get children(){return this._routerState.children(this)}get pathFromRoot(){return this._routerState.pathFromRoot(this)}get paramMap(){return this._paramMap||(this._paramMap=qp(this.params)),this._paramMap}get queryParamMap(){return this._queryParamMap||(this._queryParamMap=qp(this.queryParams)),this._queryParamMap}toString(){return`Route(url:'${this.url.map(r=>r.toString()).join("/")}', path:'${this.routeConfig?this.routeConfig.path:""}')`}}class oP extends tP{constructor(t,n){super(n),this.url=t,jC(this,n)}toString(){return sP(this._root)}}function jC(e,t){t.value._routerState=e,t.children.forEach(n=>jC(e,n))}function sP(e){const t=e.children.length>0?` { ${e.children.map(sP).join(", ")} } `:"";return`${e.value}${t}`}function HC(e){if(e.snapshot){const t=e.snapshot,n=e._futureSnapshot;e.snapshot=n,mc(t.queryParams,n.queryParams)||e.queryParams.next(n.queryParams),t.fragment!==n.fragment&&e.fragment.next(n.fragment),mc(t.params,n.params)||e.params.next(n.params),function ej(e,t){if(e.length!==t.length)return!1;for(let n=0;nmc(n.parameters,t[r].parameters))}(e.url,t.url);return n&&!(!e.parent!=!t.parent)&&(!e.parent||GC(e.parent,t.parent))}function by(e,t,n){if(n&&e.shouldReuseRoute(t.value,n.value.snapshot)){const r=n.value;r._futureSnapshot=t.value;const i=function Uj(e,t,n){return t.children.map(r=>{for(const i of n.children)if(e.shouldReuseRoute(r.value,i.value.snapshot))return by(e,r,i);return by(e,r)})}(e,t,n);return new du(r,i)}{if(e.shouldAttach(t.value)){const o=e.retrieve(t.value);if(null!==o){const c=o.route;return c.value._futureSnapshot=t.value,c.children=t.children.map(d=>by(e,d)),c}}const r=function $j(e){return new hf(new bl(e.url),new bl(e.params),new bl(e.queryParams),new bl(e.fragment),new bl(e.data),e.outlet,e.component,e)}(t.value),i=t.children.map(o=>by(e,o));return new du(r,i)}}const qC="ngNavigationCancelingError";function aP(e,t){const{redirectTo:n,navigationBehaviorOptions:r}=cf(t)?{redirectTo:t,navigationBehaviorOptions:void 0}:t,i=lP(!1,0,t);return i.url=n,i.navigationBehaviorOptions=r,i}function lP(e,t,n){const r=new Error("NavigationCancelingError: "+(e||""));return r[qC]=!0,r.cancellationCode=t,n&&(r.url=n),r}function cP(e){return uP(e)&&cf(e.url)}function uP(e){return e&&e[qC]}class jj{constructor(){this.outlet=null,this.route=null,this.resolver=null,this.injector=null,this.children=new xy,this.attachRef=null}}let xy=(()=>{class e{constructor(){this.contexts=new Map}onChildOutletCreated(n,r){const i=this.getOrCreateContext(n);i.outlet=r,this.contexts.set(n,i)}onChildOutletDestroyed(n){const r=this.getContext(n);r&&(r.outlet=null,r.attachRef=null)}onOutletDeactivated(){const n=this.contexts;return this.contexts=new Map,n}onOutletReAttached(n){this.contexts=n}getOrCreateContext(n){let r=this.getContext(n);return r||(r=new jj,this.contexts.set(n,r)),r}getContext(n){return this.contexts.get(n)||null}}return e.\u0275fac=function(n){return new(n||e)},e.\u0275prov=Ot({token:e,factory:e.\u0275fac,providedIn:"root"}),e})();const y0=!1;let hP=(()=>{class e{constructor(n,r,i,o,c){this.parentContexts=n,this.location=r,this.changeDetector=o,this.environmentInjector=c,this.activated=null,this._activatedRoute=null,this.activateEvents=new Qr,this.deactivateEvents=new Qr,this.attachEvents=new Qr,this.detachEvents=new Qr,this.name=i||bn,n.onChildOutletCreated(this.name,this)}ngOnDestroy(){this.parentContexts.getContext(this.name)?.outlet===this&&this.parentContexts.onChildOutletDestroyed(this.name)}ngOnInit(){if(!this.activated){const n=this.parentContexts.getContext(this.name);n&&n.route&&(n.attachRef?this.attach(n.attachRef,n.route):this.activateWith(n.route,n.injector))}}get isActivated(){return!!this.activated}get component(){if(!this.activated)throw new nt(4012,y0);return this.activated.instance}get activatedRoute(){if(!this.activated)throw new nt(4012,y0);return this._activatedRoute}get activatedRouteData(){return this._activatedRoute?this._activatedRoute.snapshot.data:{}}detach(){if(!this.activated)throw new nt(4012,y0);this.location.detach();const n=this.activated;return this.activated=null,this._activatedRoute=null,this.detachEvents.emit(n.instance),n}attach(n,r){this.activated=n,this._activatedRoute=r,this.location.insert(n.hostView),this.attachEvents.emit(n.instance)}deactivate(){if(this.activated){const n=this.component;this.activated.destroy(),this.activated=null,this._activatedRoute=null,this.deactivateEvents.emit(n)}}activateWith(n,r){if(this.isActivated)throw new nt(4013,y0);this._activatedRoute=n;const i=this.location,c=n._futureSnapshot.component,d=this.parentContexts.getOrCreateContext(this.name).children,p=new Hj(n,d,i.injector);if(r&&function Gj(e){return!!e.resolveComponentFactory}(r)){const v=r.resolveComponentFactory(c);this.activated=i.createComponent(v,i.length,p)}else this.activated=i.createComponent(c,{index:i.length,injector:p,environmentInjector:r??this.environmentInjector});this.changeDetector.markForCheck(),this.activateEvents.emit(this.activated.instance)}}return e.\u0275fac=function(n){return new(n||e)(qe(xy),qe(gl),function Sd(e){return function Wm(e,t){if("class"===t)return e.classes;if("style"===t)return e.styles;const n=e.attrs;if(n){const r=n.length;let i=0;for(;i{class e{}return e.\u0275fac=function(n){return new(n||e)},e.\u0275cmp=Vs({type:e,selectors:[["ng-component"]],standalone:!0,features:[dT],decls:1,vars:0,template:function(n,r){1&n&&Is(0,"router-outlet")},dependencies:[hP],encapsulation:2}),e})();function dP(e,t){return e.providers&&!e._injector&&(e._injector=Pv(e.providers,t,`Route: ${e.path}`)),e._injector??t}function XC(e){const t=e.children&&e.children.map(XC),n=t?{...e,children:t}:{...e};return!n.component&&!n.loadComponent&&(t||n.loadChildren)&&n.outlet&&n.outlet!==bn&&(n.component=ZC),n}function Sa(e){return e.outlet||bn}function fP(e,t){const n=e.filter(r=>Sa(r)===t);return n.push(...e.filter(r=>Sa(r)!==t)),n}function wy(e){if(!e)return null;if(e.routeConfig?._injector)return e.routeConfig._injector;for(let t=e.parent;t;t=t.parent){const n=t.routeConfig;if(n?._loadedInjector)return n._loadedInjector;if(n?._injector)return n._injector}return null}class Yj{constructor(t,n,r,i){this.routeReuseStrategy=t,this.futureState=n,this.currState=r,this.forwardEvent=i}activate(t){const n=this.futureState._root,r=this.currState?this.currState._root:null;this.deactivateChildRoutes(n,r,t),HC(this.futureState.root),this.activateChildRoutes(n,r,t)}deactivateChildRoutes(t,n,r){const i=Xp(n);t.children.forEach(o=>{const c=o.value.outlet;this.deactivateRoutes(o,i[c],r),delete i[c]}),Eo(i,(o,c)=>{this.deactivateRouteAndItsChildren(o,r)})}deactivateRoutes(t,n,r){const i=t.value,o=n?n.value:null;if(i===o)if(i.component){const c=r.getContext(i.outlet);c&&this.deactivateChildRoutes(t,n,c.children)}else this.deactivateChildRoutes(t,n,r);else o&&this.deactivateRouteAndItsChildren(n,r)}deactivateRouteAndItsChildren(t,n){t.value.component&&this.routeReuseStrategy.shouldDetach(t.value.snapshot)?this.detachAndStoreRouteSubtree(t,n):this.deactivateRouteAndOutlet(t,n)}detachAndStoreRouteSubtree(t,n){const r=n.getContext(t.value.outlet),i=r&&t.value.component?r.children:n,o=Xp(t);for(const c of Object.keys(o))this.deactivateRouteAndItsChildren(o[c],i);if(r&&r.outlet){const c=r.outlet.detach(),d=r.children.onOutletDeactivated();this.routeReuseStrategy.store(t.value.snapshot,{componentRef:c,route:t,contexts:d})}}deactivateRouteAndOutlet(t,n){const r=n.getContext(t.value.outlet),i=r&&t.value.component?r.children:n,o=Xp(t);for(const c of Object.keys(o))this.deactivateRouteAndItsChildren(o[c],i);r&&r.outlet&&(r.outlet.deactivate(),r.children.onOutletDeactivated(),r.attachRef=null,r.resolver=null,r.route=null)}activateChildRoutes(t,n,r){const i=Xp(n);t.children.forEach(o=>{this.activateRoutes(o,i[o.value.outlet],r),this.forwardEvent(new Lj(o.value.snapshot))}),t.children.length&&this.forwardEvent(new Fj(t.value.snapshot))}activateRoutes(t,n,r){const i=t.value,o=n?n.value:null;if(HC(i),i===o)if(i.component){const c=r.getOrCreateContext(i.outlet);this.activateChildRoutes(t,n,c.children)}else this.activateChildRoutes(t,n,r);else if(i.component){const c=r.getOrCreateContext(i.outlet);if(this.routeReuseStrategy.shouldAttach(i.snapshot)){const d=this.routeReuseStrategy.retrieve(i.snapshot);this.routeReuseStrategy.store(i.snapshot,null),c.children.onOutletReAttached(d.contexts),c.attachRef=d.componentRef,c.route=d.route.value,c.outlet&&c.outlet.attach(d.componentRef,d.route.value),HC(d.route.value),this.activateChildRoutes(t,null,c.children)}else{const d=wy(i.snapshot),p=d?.get(Ug)??null;c.attachRef=null,c.route=i,c.resolver=p,c.injector=d,c.outlet&&c.outlet.activateWith(i,c.injector),this.activateChildRoutes(t,null,c.children)}}else this.activateChildRoutes(t,null,r)}}class pP{constructor(t){this.path=t,this.route=this.path[this.path.length-1]}}class _0{constructor(t,n){this.component=t,this.route=n}}function Kj(e,t,n){const r=e._root;return Cy(r,t?t._root:null,n,[r.value])}function Yp(e,t){const n=Symbol(),r=t.get(e,n);return r===n?"function"!=typeof e||function td(e){return null!==Uu(e)}(e)?t.get(e):e:r}function Cy(e,t,n,r,i={canDeactivateChecks:[],canActivateChecks:[]}){const o=Xp(t);return e.children.forEach(c=>{(function Qj(e,t,n,r,i={canDeactivateChecks:[],canActivateChecks:[]}){const o=e.value,c=t?t.value:null,d=n?n.getContext(e.value.outlet):null;if(c&&o.routeConfig===c.routeConfig){const p=function eH(e,t,n){if("function"==typeof n)return n(e,t);switch(n){case"pathParamsChange":return!lf(e.url,t.url);case"pathParamsOrQueryParamsChange":return!lf(e.url,t.url)||!mc(e.queryParams,t.queryParams);case"always":return!0;case"paramsOrQueryParamsChange":return!GC(e,t)||!mc(e.queryParams,t.queryParams);default:return!GC(e,t)}}(c,o,o.routeConfig.runGuardsAndResolvers);p?i.canActivateChecks.push(new pP(r)):(o.data=c.data,o._resolvedData=c._resolvedData),Cy(e,t,o.component?d?d.children:null:n,r,i),p&&d&&d.outlet&&d.outlet.isActivated&&i.canDeactivateChecks.push(new _0(d.outlet.component,c))}else c&&Ey(t,d,i),i.canActivateChecks.push(new pP(r)),Cy(e,null,o.component?d?d.children:null:n,r,i)})(c,o[c.value.outlet],n,r.concat([c.value]),i),delete o[c.value.outlet]}),Eo(o,(c,d)=>Ey(c,n.getContext(d),i)),i}function Ey(e,t,n){const r=Xp(e),i=e.value;Eo(r,(o,c)=>{Ey(o,i.component?t?t.children.getContext(c):null:t,n)}),n.canDeactivateChecks.push(new _0(i.component&&t&&t.outlet&&t.outlet.isActivated?t.outlet.component:null,i))}function Dy(e){return"function"==typeof e}function YC(e){return e instanceof a0||"EmptyError"===e?.name}const v0=Symbol("INITIAL_VALUE");function Kp(){return pc(e=>Ik(e.map(t=>t.pipe(fy(1),function Z9(...e){const t=sr(e);return mr((n,r)=>{(t?TC(e,n,t):TC(e,n)).subscribe(r)})}(v0)))).pipe(Pe(t=>{for(const n of t)if(!0!==n){if(n===v0)return v0;if(!1===n||n instanceof af)return n}return!0}),uu(t=>t!==v0),fy(1)))}function mP(e){return function La(...e){return Ns(e)}(Vo(t=>{if(cf(t))throw aP(0,t)}),Pe(t=>!0===t))}const KC={matched:!1,consumedSegments:[],remainingSegments:[],parameters:{},positionalParamSegments:{}};function gP(e,t,n,r,i){const o=JC(e,t,n);return o.matched?function yH(e,t,n,r){const i=t.canMatch;return i&&0!==i.length?Bt(i.map(c=>{const d=Yp(c,e);return Ah(function sH(e){return e&&Dy(e.canMatch)}(d)?d.canMatch(t,n):e.runInContext(()=>d(t,n)))})).pipe(Kp(),mP()):Bt(!0)}(r=dP(t,r),t,n).pipe(Pe(c=>!0===c?o:{...KC})):Bt(o)}function JC(e,t,n){if(""===t.path)return"full"===t.pathMatch&&(e.hasChildren()||n.length>0)?{...KC}:{matched:!0,consumedSegments:[],remainingSegments:n,parameters:{},positionalParamSegments:{}};const i=(t.matcher||Q9)(n,e,t);if(!i)return{...KC};const o={};Eo(i.posParams,(d,p)=>{o[p]=d.path});const c=i.consumed.length>0?{...o,...i.consumed[i.consumed.length-1].parameters}:o;return{matched:!0,consumedSegments:i.consumed,remainingSegments:n.slice(i.consumed.length),parameters:c,positionalParamSegments:i.posParams??{}}}function b0(e,t,n,r,i="corrected"){if(n.length>0&&function bH(e,t,n){return n.some(r=>x0(e,t,r)&&Sa(r)!==bn)}(e,n,r)){const c=new En(t,function vH(e,t,n,r){const i={};i[bn]=r,r._sourceSegment=e,r._segmentIndexShift=t.length;for(const o of n)if(""===o.path&&Sa(o)!==bn){const c=new En([],{});c._sourceSegment=e,c._segmentIndexShift=t.length,i[Sa(o)]=c}return i}(e,t,r,new En(n,e.children)));return c._sourceSegment=e,c._segmentIndexShift=t.length,{segmentGroup:c,slicedSegments:[]}}if(0===n.length&&function xH(e,t,n){return n.some(r=>x0(e,t,r))}(e,n,r)){const c=new En(e.segments,function _H(e,t,n,r,i,o){const c={};for(const d of r)if(x0(e,n,d)&&!i[Sa(d)]){const p=new En([],{});p._sourceSegment=e,p._segmentIndexShift="legacy"===o?e.segments.length:t.length,c[Sa(d)]=p}return{...i,...c}}(e,t,n,r,e.children,i));return c._sourceSegment=e,c._segmentIndexShift=t.length,{segmentGroup:c,slicedSegments:n}}const o=new En(e.segments,e.children);return o._sourceSegment=e,o._segmentIndexShift=t.length,{segmentGroup:o,slicedSegments:n}}function x0(e,t,n){return(!(e.hasChildren()||t.length>0)||"full"!==n.pathMatch)&&""===n.path}function yP(e,t,n,r){return!!(Sa(e)===r||r!==bn&&x0(t,n,e))&&("**"===e.path||JC(t,e,n).matched)}function _P(e,t,n){return 0===t.length&&!e.children[n]}const w0=!1;class C0{constructor(t){this.segmentGroup=t||null}}class vP{constructor(t){this.urlTree=t}}function Sy(e){return dy(new C0(e))}function bP(e){return dy(new vP(e))}class DH{constructor(t,n,r,i,o){this.injector=t,this.configLoader=n,this.urlSerializer=r,this.urlTree=i,this.config=o,this.allowRedirects=!0}apply(){const t=b0(this.urlTree.root,[],[],this.config).segmentGroup,n=new En(t.segments,t.children);return this.expandSegmentGroup(this.injector,this.config,n,bn).pipe(Pe(o=>this.createUrlTree(p0(o),this.urlTree.queryParams,this.urlTree.fragment))).pipe(Th(o=>{if(o instanceof vP)return this.allowRedirects=!1,this.match(o.urlTree);throw o instanceof C0?this.noMatchError(o):o}))}match(t){return this.expandSegmentGroup(this.injector,this.config,t.root,bn).pipe(Pe(i=>this.createUrlTree(p0(i),t.queryParams,t.fragment))).pipe(Th(i=>{throw i instanceof C0?this.noMatchError(i):i}))}noMatchError(t){return new nt(4002,w0)}createUrlTree(t,n,r){const i=LC(t);return new af(i,n,r)}expandSegmentGroup(t,n,r,i){return 0===r.segments.length&&r.hasChildren()?this.expandChildren(t,n,r).pipe(Pe(o=>new En([],o))):this.expandSegment(t,r,n,r.segments,i,!0)}expandChildren(t,n,r){const i=[];for(const o of Object.keys(r.children))"primary"===o?i.unshift(o):i.push(o);return Cr(i).pipe(Ih(o=>{const c=r.children[o],d=fP(n,o);return this.expandSegmentGroup(t,d,c,o).pipe(Pe(p=>({segment:p,outlet:o})))}),Rk((o,c)=>(o[c.outlet]=c.segment,o),{}),Fk())}expandSegment(t,n,r,i,o,c){return Cr(r).pipe(Ih(d=>this.expandSegmentAgainstRoute(t,n,r,d,i,o,c).pipe(Th(v=>{if(v instanceof C0)return Bt(null);throw v}))),Mh(d=>!!d),Th((d,p)=>{if(YC(d))return _P(n,i,o)?Bt(new En([],{})):Sy(n);throw d}))}expandSegmentAgainstRoute(t,n,r,i,o,c,d){return yP(i,n,o,c)?void 0===i.redirectTo?this.matchSegmentAgainstRoute(t,n,i,o,c):d&&this.allowRedirects?this.expandSegmentAgainstRouteUsingRedirect(t,n,r,i,o,c):Sy(n):Sy(n)}expandSegmentAgainstRouteUsingRedirect(t,n,r,i,o,c){return"**"===i.path?this.expandWildCardWithParamsAgainstRouteUsingRedirect(t,r,i,c):this.expandRegularSegmentAgainstRouteUsingRedirect(t,n,r,i,o,c)}expandWildCardWithParamsAgainstRouteUsingRedirect(t,n,r,i){const o=this.applyRedirectCommands([],r.redirectTo,{});return r.redirectTo.startsWith("/")?bP(o):this.lineralizeSegments(r,o).pipe(dt(c=>{const d=new En(c,{});return this.expandSegment(t,d,n,c,i,!1)}))}expandRegularSegmentAgainstRouteUsingRedirect(t,n,r,i,o,c){const{matched:d,consumedSegments:p,remainingSegments:v,positionalParamSegments:E}=JC(n,i,o);if(!d)return Sy(n);const D=this.applyRedirectCommands(p,i.redirectTo,E);return i.redirectTo.startsWith("/")?bP(D):this.lineralizeSegments(i,D).pipe(dt(I=>this.expandSegment(t,n,r,I.concat(v),c,!1)))}matchSegmentAgainstRoute(t,n,r,i,o){return"**"===r.path?(t=dP(r,t),r.loadChildren?(r._loadedRoutes?Bt({routes:r._loadedRoutes,injector:r._loadedInjector}):this.configLoader.loadChildren(t,r)).pipe(Pe(d=>(r._loadedRoutes=d.routes,r._loadedInjector=d.injector,new En(i,{})))):Bt(new En(i,{}))):gP(n,r,i,t).pipe(pc(({matched:c,consumedSegments:d,remainingSegments:p})=>c?this.getChildConfig(t=r._injector??t,r,i).pipe(dt(E=>{const D=E.injector??t,I=E.routes,{segmentGroup:P,slicedSegments:N}=b0(n,d,p,I),G=new En(P.segments,P.children);if(0===N.length&&G.hasChildren())return this.expandChildren(D,I,G).pipe(Pe(X=>new En(d,X)));if(0===I.length&&0===N.length)return Bt(new En(d,{}));const U=Sa(r)===o;return this.expandSegment(D,G,I,N,U?bn:o,!0).pipe(Pe(ne=>new En(d.concat(ne.segments),ne.children)))})):Sy(n)))}getChildConfig(t,n,r){return n.children?Bt({routes:n.children,injector:t}):n.loadChildren?void 0!==n._loadedRoutes?Bt({routes:n._loadedRoutes,injector:n._loadedInjector}):function gH(e,t,n,r){const i=t.canLoad;return void 0===i||0===i.length?Bt(!0):Bt(i.map(c=>{const d=Yp(c,e);return Ah(function nH(e){return e&&Dy(e.canLoad)}(d)?d.canLoad(t,n):e.runInContext(()=>d(t,n)))})).pipe(Kp(),mP())}(t,n,r).pipe(dt(i=>i?this.configLoader.loadChildren(t,n).pipe(Vo(o=>{n._loadedRoutes=o.routes,n._loadedInjector=o.injector})):function CH(e){return dy(lP(w0,3))}())):Bt({routes:[],injector:t})}lineralizeSegments(t,n){let r=[],i=n.root;for(;;){if(r=r.concat(i.segments),0===i.numberOfChildren)return Bt(r);if(i.numberOfChildren>1||!i.children[bn])return dy(new nt(4e3,w0));i=i.children[bn]}}applyRedirectCommands(t,n,r){return this.applyRedirectCreateUrlTree(n,this.urlSerializer.parse(n),t,r)}applyRedirectCreateUrlTree(t,n,r,i){const o=this.createSegmentGroup(t,n.root,r,i);return new af(o,this.createQueryParams(n.queryParams,this.urlTree.queryParams),n.fragment)}createQueryParams(t,n){const r={};return Eo(t,(i,o)=>{if("string"==typeof i&&i.startsWith(":")){const d=i.substring(1);r[o]=n[d]}else r[o]=i}),r}createSegmentGroup(t,n,r,i){const o=this.createSegments(t,n.segments,r,i);let c={};return Eo(n.children,(d,p)=>{c[p]=this.createSegmentGroup(t,d,r,i)}),new En(o,c)}createSegments(t,n,r,i){return n.map(o=>o.path.startsWith(":")?this.findPosParam(t,o,i):this.findOrReturn(o,r))}findPosParam(t,n,r){const i=r[n.path.substring(1)];if(!i)throw new nt(4001,w0);return i}findOrReturn(t,n){let r=0;for(const i of n){if(i.path===t.path)return n.splice(r),i;r++}return t}}class MH{}class AH{constructor(t,n,r,i,o,c,d,p){this.injector=t,this.rootComponentType=n,this.config=r,this.urlTree=i,this.url=o,this.paramsInheritanceStrategy=c,this.relativeLinkResolution=d,this.urlSerializer=p}recognize(){const t=b0(this.urlTree.root,[],[],this.config.filter(n=>void 0===n.redirectTo),this.relativeLinkResolution).segmentGroup;return this.processSegmentGroup(this.injector,this.config,t,bn).pipe(Pe(n=>{if(null===n)return null;const r=new g0([],Object.freeze({}),Object.freeze({...this.urlTree.queryParams}),this.urlTree.fragment,{},bn,this.rootComponentType,null,this.urlTree.root,-1,{}),i=new du(r,n),o=new oP(this.url,i);return this.inheritParamsAndData(o._root),o}))}inheritParamsAndData(t){const n=t.value,r=iP(n,this.paramsInheritanceStrategy);n.params=Object.freeze(r.params),n.data=Object.freeze(r.data),t.children.forEach(i=>this.inheritParamsAndData(i))}processSegmentGroup(t,n,r,i){return 0===r.segments.length&&r.hasChildren()?this.processChildren(t,n,r):this.processSegment(t,n,r,r.segments,i)}processChildren(t,n,r){return Cr(Object.keys(r.children)).pipe(Ih(i=>{const o=r.children[i],c=fP(n,i);return this.processSegmentGroup(t,c,o,i)}),Rk((i,o)=>i&&o?(i.push(...o),i):null),function Y9(e,t=!1){return mr((n,r)=>{let i=0;n.subscribe(Qn(r,o=>{const c=e(o,i++);(c||t)&&r.next(o),!c&&r.complete()}))})}(i=>null!==i),l0(null),Fk(),Pe(i=>{if(null===i)return null;const o=xP(i);return function kH(e){e.sort((t,n)=>t.value.outlet===bn?-1:n.value.outlet===bn?1:t.value.outlet.localeCompare(n.value.outlet))}(o),o}))}processSegment(t,n,r,i,o){return Cr(n).pipe(Ih(c=>this.processSegmentAgainstRoute(c._injector??t,c,r,i,o)),Mh(c=>!!c),Th(c=>{if(YC(c))return _P(r,i,o)?Bt([]):Bt(null);throw c}))}processSegmentAgainstRoute(t,n,r,i,o){if(n.redirectTo||!yP(n,r,i,o))return Bt(null);let c;if("**"===n.path){const d=i.length>0?Nk(i).parameters:{},p=CP(r)+i.length;c=Bt({snapshot:new g0(i,d,Object.freeze({...this.urlTree.queryParams}),this.urlTree.fragment,DP(n),Sa(n),n.component??n._loadedComponent??null,n,wP(r),p,SP(n),p),consumedSegments:[],remainingSegments:[]})}else c=gP(r,n,i,t).pipe(Pe(({matched:d,consumedSegments:p,remainingSegments:v,parameters:E})=>{if(!d)return null;const D=CP(r)+p.length;return{snapshot:new g0(p,E,Object.freeze({...this.urlTree.queryParams}),this.urlTree.fragment,DP(n),Sa(n),n.component??n._loadedComponent??null,n,wP(r),D,SP(n),D),consumedSegments:p,remainingSegments:v}}));return c.pipe(pc(d=>{if(null===d)return Bt(null);const{snapshot:p,consumedSegments:v,remainingSegments:E}=d;t=n._injector??t;const D=n._loadedInjector??t,I=function PH(e){return e.children?e.children:e.loadChildren?e._loadedRoutes:[]}(n),{segmentGroup:P,slicedSegments:N}=b0(r,v,E,I.filter(U=>void 0===U.redirectTo),this.relativeLinkResolution);if(0===N.length&&P.hasChildren())return this.processChildren(D,I,P).pipe(Pe(U=>null===U?null:[new du(p,U)]));if(0===I.length&&0===N.length)return Bt([new du(p,[])]);const G=Sa(n)===o;return this.processSegment(D,I,P,N,G?bn:o).pipe(Pe(U=>null===U?null:[new du(p,U)]))}))}}function RH(e){const t=e.value.routeConfig;return t&&""===t.path&&void 0===t.redirectTo}function xP(e){const t=[],n=new Set;for(const r of e){if(!RH(r)){t.push(r);continue}const i=t.find(o=>r.value.routeConfig===o.value.routeConfig);void 0!==i?(i.children.push(...r.children),n.add(i)):t.push(r)}for(const r of n){const i=xP(r.children);t.push(new du(r.value,i))}return t.filter(r=>!n.has(r))}function wP(e){let t=e;for(;t._sourceSegment;)t=t._sourceSegment;return t}function CP(e){let t=e,n=t._segmentIndexShift??0;for(;t._sourceSegment;)t=t._sourceSegment,n+=t._segmentIndexShift??0;return n-1}function DP(e){return e.data||{}}function SP(e){return e.resolve||{}}function MP(e){return"string"==typeof e.title||null===e.title}function QC(e){return pc(t=>{const n=e(t);return n?Cr(n).pipe(Pe(()=>t)):Bt(t)})}let IP=(()=>{class e{buildTitle(n){let r,i=n.root;for(;void 0!==i;)r=this.getResolvedTitleForRoute(i)??r,i=i.children.find(o=>o.outlet===bn);return r}getResolvedTitleForRoute(n){return n.data[py]}}return e.\u0275fac=function(n){return new(n||e)},e.\u0275prov=Ot({token:e,factory:function(){return Fr(TP)},providedIn:"root"}),e})(),TP=(()=>{class e extends IP{constructor(n){super(),this.title=n}updateTitle(n){const r=this.buildTitle(n);void 0!==r&&this.title.setTitle(r)}}return e.\u0275fac=function(n){return new(n||e)(St(wk))},e.\u0275prov=Ot({token:e,factory:e.\u0275fac,providedIn:"root"}),e})();class UH{}class jH extends class $H{shouldDetach(t){return!1}store(t,n){}shouldAttach(t){return!1}retrieve(t){return null}shouldReuseRoute(t,n){return t.routeConfig===n.routeConfig}}{}const D0=new It("",{providedIn:"root",factory:()=>({})}),eE=new It("ROUTES");let tE=(()=>{class e{constructor(n,r){this.injector=n,this.compiler=r,this.componentLoaders=new WeakMap,this.childrenLoaders=new WeakMap}loadComponent(n){if(this.componentLoaders.get(n))return this.componentLoaders.get(n);if(n._loadedComponent)return Bt(n._loadedComponent);this.onLoadStartListener&&this.onLoadStartListener(n);const r=Ah(n.loadComponent()).pipe(Vo(o=>{this.onLoadEndListener&&this.onLoadEndListener(n),n._loadedComponent=o}),PC(()=>{this.componentLoaders.delete(n)})),i=new kk(r,()=>new oi).pipe(AC());return this.componentLoaders.set(n,i),i}loadChildren(n,r){if(this.childrenLoaders.get(r))return this.childrenLoaders.get(r);if(r._loadedRoutes)return Bt({routes:r._loadedRoutes,injector:r._loadedInjector});this.onLoadStartListener&&this.onLoadStartListener(r);const o=this.loadModuleFactoryOrRoutes(r.loadChildren).pipe(Pe(d=>{this.onLoadEndListener&&this.onLoadEndListener(r);let p,v,E=!1;Array.isArray(d)?v=d:(p=d.create(n).injector,v=Lk(p.get(eE,[],Rt.Self|Rt.Optional)));return{routes:v.map(XC),injector:p}}),PC(()=>{this.childrenLoaders.delete(r)})),c=new kk(o,()=>new oi).pipe(AC());return this.childrenLoaders.set(r,c),c}loadModuleFactoryOrRoutes(n){return Ah(n()).pipe(dt(r=>r instanceof uT||Array.isArray(r)?Bt(r):Cr(this.compiler.compileModuleAsync(r))))}}return e.\u0275fac=function(n){return new(n||e)(St(Ys),St(Hw))},e.\u0275prov=Ot({token:e,factory:e.\u0275fac,providedIn:"root"}),e})();class GH{}class qH{shouldProcessUrl(t){return!0}extract(t){return t}merge(t,n){return t}}function ZH(e){throw e}function WH(e,t,n){return t.parse("/")}const XH={paths:"exact",fragment:"ignored",matrixParams:"ignored",queryParams:"exact"},YH={paths:"subset",fragment:"ignored",matrixParams:"ignored",queryParams:"subset"};function kP(){const e=Fr(jk),t=Fr(xy),n=Fr(oC),r=Fr(Ys),i=Fr(Hw),o=Fr(eE,{optional:!0})??[],c=Fr(D0,{optional:!0})??{},d=Fr(TP),p=Fr(IP,{optional:!0}),v=Fr(GH,{optional:!0}),E=Fr(UH,{optional:!0}),D=new Do(null,e,t,n,r,i,Lk(o));return v&&(D.urlHandlingStrategy=v),E&&(D.routeReuseStrategy=E),D.titleStrategy=p??d,function KH(e,t){e.errorHandler&&(t.errorHandler=e.errorHandler),e.malformedUriErrorHandler&&(t.malformedUriErrorHandler=e.malformedUriErrorHandler),e.onSameUrlNavigation&&(t.onSameUrlNavigation=e.onSameUrlNavigation),e.paramsInheritanceStrategy&&(t.paramsInheritanceStrategy=e.paramsInheritanceStrategy),e.relativeLinkResolution&&(t.relativeLinkResolution=e.relativeLinkResolution),e.urlUpdateStrategy&&(t.urlUpdateStrategy=e.urlUpdateStrategy),e.canceledNavigationResolution&&(t.canceledNavigationResolution=e.canceledNavigationResolution)}(c,D),D}let Do=(()=>{class e{constructor(n,r,i,o,c,d,p){this.rootComponentType=n,this.urlSerializer=r,this.rootContexts=i,this.location=o,this.config=p,this.lastSuccessfulNavigation=null,this.currentNavigation=null,this.disposed=!1,this.navigationId=0,this.currentPageId=0,this.isNgZoneEnabled=!1,this.events=new oi,this.errorHandler=ZH,this.malformedUriErrorHandler=WH,this.navigated=!1,this.lastSuccessfulId=-1,this.afterPreactivation=()=>Bt(void 0),this.urlHandlingStrategy=new qH,this.routeReuseStrategy=new jH,this.onSameUrlNavigation="ignore",this.paramsInheritanceStrategy="emptyOnly",this.urlUpdateStrategy="deferred",this.relativeLinkResolution="corrected",this.canceledNavigationResolution="replace",this.configLoader=c.get(tE),this.configLoader.onLoadEndListener=I=>this.triggerEvent(new Pj(I)),this.configLoader.onLoadStartListener=I=>this.triggerEvent(new kj(I)),this.ngModule=c.get(ef),this.console=c.get(SU);const D=c.get(Ri);this.isNgZoneEnabled=D instanceof Ri&&Ri.isInAngularZone(),this.resetConfig(p),this.currentUrlTree=function tj(){return new af(new En([],{}),{},null)}(),this.rawUrlTree=this.currentUrlTree,this.browserUrlTree=this.currentUrlTree,this.routerState=rP(this.currentUrlTree,this.rootComponentType),this.transitions=new bl({id:0,targetPageId:0,currentUrlTree:this.currentUrlTree,currentRawUrl:this.currentUrlTree,extractedUrl:this.urlHandlingStrategy.extract(this.currentUrlTree),urlAfterRedirects:this.urlHandlingStrategy.extract(this.currentUrlTree),rawUrl:this.currentUrlTree,extras:{},resolve:null,reject:null,promise:Promise.resolve(!0),source:"imperative",restoredState:null,currentSnapshot:this.routerState.snapshot,targetSnapshot:null,currentRouterState:this.routerState,targetRouterState:null,guards:{canActivateChecks:[],canDeactivateChecks:[]},guardsResult:null}),this.navigations=this.setupNavigations(this.transitions),this.processNavigations()}get browserPageId(){return this.location.getState()?.\u0275routerPageId}setupNavigations(n){const r=this.events;return n.pipe(uu(i=>0!==i.id),Pe(i=>({...i,extractedUrl:this.urlHandlingStrategy.extract(i.rawUrl)})),pc(i=>{let o=!1,c=!1;return Bt(i).pipe(Vo(d=>{this.currentNavigation={id:d.id,initialUrl:d.rawUrl,extractedUrl:d.extractedUrl,trigger:d.source,extras:d.extras,previousNavigation:this.lastSuccessfulNavigation?{...this.lastSuccessfulNavigation,previousNavigation:null}:null}}),pc(d=>{const p=this.browserUrlTree.toString(),v=!this.navigated||d.extractedUrl.toString()!==p||p!==this.currentUrlTree.toString();if(("reload"===this.onSameUrlNavigation||v)&&this.urlHandlingStrategy.shouldProcessUrl(d.rawUrl))return PP(d.source)&&(this.browserUrlTree=d.extractedUrl),Bt(d).pipe(pc(D=>{const I=this.transitions.getValue();return r.next(new VC(D.id,this.serializeUrl(D.extractedUrl),D.source,D.restoredState)),I!==this.transitions.getValue()?xt:Promise.resolve(D)}),function SH(e,t,n,r){return pc(i=>function EH(e,t,n,r,i){return new DH(e,t,n,r,i).apply()}(e,t,n,i.extractedUrl,r).pipe(Pe(o=>({...i,urlAfterRedirects:o}))))}(this.ngModule.injector,this.configLoader,this.urlSerializer,this.config),Vo(D=>{this.currentNavigation={...this.currentNavigation,finalUrl:D.urlAfterRedirects},i.urlAfterRedirects=D.urlAfterRedirects}),function OH(e,t,n,r,i,o){return dt(c=>function TH(e,t,n,r,i,o,c="emptyOnly",d="legacy"){return new AH(e,t,n,r,i,c,d,o).recognize().pipe(pc(p=>null===p?function IH(e){return new Nn(t=>t.error(e))}(new MH):Bt(p)))}(e,t,n,c.urlAfterRedirects,r.serialize(c.urlAfterRedirects),r,i,o).pipe(Pe(d=>({...c,targetSnapshot:d}))))}(this.ngModule.injector,this.rootComponentType,this.config,this.urlSerializer,this.paramsInheritanceStrategy,this.relativeLinkResolution),Vo(D=>{if(i.targetSnapshot=D.targetSnapshot,"eager"===this.urlUpdateStrategy){if(!D.extras.skipLocationChange){const P=this.urlHandlingStrategy.merge(D.urlAfterRedirects,D.rawUrl);this.setBrowserUrl(P,D)}this.browserUrlTree=D.urlAfterRedirects}const I=new Sj(D.id,this.serializeUrl(D.extractedUrl),this.serializeUrl(D.urlAfterRedirects),D.targetSnapshot);r.next(I)}));if(v&&this.rawUrlTree&&this.urlHandlingStrategy.shouldProcessUrl(this.rawUrlTree)){const{id:I,extractedUrl:P,source:N,restoredState:G,extras:U}=d,Z=new VC(I,this.serializeUrl(P),N,G);r.next(Z);const ne=rP(P,this.rootComponentType).snapshot;return Bt(i={...d,targetSnapshot:ne,urlAfterRedirects:P,extras:{...U,skipLocationChange:!1,replaceUrl:!1}})}return this.rawUrlTree=d.rawUrl,d.resolve(null),xt}),Vo(d=>{const p=new Mj(d.id,this.serializeUrl(d.extractedUrl),this.serializeUrl(d.urlAfterRedirects),d.targetSnapshot);this.triggerEvent(p)}),Pe(d=>i={...d,guards:Kj(d.targetSnapshot,d.currentSnapshot,this.rootContexts)}),function lH(e,t){return dt(n=>{const{targetSnapshot:r,currentSnapshot:i,guards:{canActivateChecks:o,canDeactivateChecks:c}}=n;return 0===c.length&&0===o.length?Bt({...n,guardsResult:!0}):function cH(e,t,n,r){return Cr(e).pipe(dt(i=>function mH(e,t,n,r,i){const o=t&&t.routeConfig?t.routeConfig.canDeactivate:null;return o&&0!==o.length?Bt(o.map(d=>{const p=wy(t)??i,v=Yp(d,p);return Ah(function oH(e){return e&&Dy(e.canDeactivate)}(v)?v.canDeactivate(e,t,n,r):p.runInContext(()=>v(e,t,n,r))).pipe(Mh())})).pipe(Kp()):Bt(!0)}(i.component,i.route,n,t,r)),Mh(i=>!0!==i,!0))}(c,r,i,e).pipe(dt(d=>d&&function tH(e){return"boolean"==typeof e}(d)?function uH(e,t,n,r){return Cr(t).pipe(Ih(i=>TC(function dH(e,t){return null!==e&&t&&t(new Rj(e)),Bt(!0)}(i.route.parent,r),function hH(e,t){return null!==e&&t&&t(new Oj(e)),Bt(!0)}(i.route,r),function pH(e,t,n){const r=t[t.length-1],o=t.slice(0,t.length-1).reverse().map(c=>function Jj(e){const t=e.routeConfig?e.routeConfig.canActivateChild:null;return t&&0!==t.length?{node:e,guards:t}:null}(c)).filter(c=>null!==c).map(c=>Ak(()=>Bt(c.guards.map(p=>{const v=wy(c.node)??n,E=Yp(p,v);return Ah(function iH(e){return e&&Dy(e.canActivateChild)}(E)?E.canActivateChild(r,e):v.runInContext(()=>E(r,e))).pipe(Mh())})).pipe(Kp())));return Bt(o).pipe(Kp())}(e,i.path,n),function fH(e,t,n){const r=t.routeConfig?t.routeConfig.canActivate:null;if(!r||0===r.length)return Bt(!0);const i=r.map(o=>Ak(()=>{const c=wy(t)??n,d=Yp(o,c);return Ah(function rH(e){return e&&Dy(e.canActivate)}(d)?d.canActivate(t,e):c.runInContext(()=>d(t,e))).pipe(Mh())}));return Bt(i).pipe(Kp())}(e,i.route,n))),Mh(i=>!0!==i,!0))}(r,o,e,t):Bt(d)),Pe(d=>({...n,guardsResult:d})))})}(this.ngModule.injector,d=>this.triggerEvent(d)),Vo(d=>{if(i.guardsResult=d.guardsResult,cf(d.guardsResult))throw aP(0,d.guardsResult);const p=new Ij(d.id,this.serializeUrl(d.extractedUrl),this.serializeUrl(d.urlAfterRedirects),d.targetSnapshot,!!d.guardsResult);this.triggerEvent(p)}),uu(d=>!!d.guardsResult||(this.restoreHistory(d),this.cancelNavigationTransition(d,"",3),!1)),QC(d=>{if(d.guards.canActivateChecks.length)return Bt(d).pipe(Vo(p=>{const v=new Tj(p.id,this.serializeUrl(p.extractedUrl),this.serializeUrl(p.urlAfterRedirects),p.targetSnapshot);this.triggerEvent(v)}),pc(p=>{let v=!1;return Bt(p).pipe(function LH(e,t){return dt(n=>{const{targetSnapshot:r,guards:{canActivateChecks:i}}=n;if(!i.length)return Bt(n);let o=0;return Cr(i).pipe(Ih(c=>function NH(e,t,n,r){const i=e.routeConfig,o=e._resolve;return void 0!==i?.title&&!MP(i)&&(o[py]=i.title),function zH(e,t,n,r){const i=function BH(e){return[...Object.keys(e),...Object.getOwnPropertySymbols(e)]}(e);if(0===i.length)return Bt({});const o={};return Cr(i).pipe(dt(c=>function VH(e,t,n,r){const i=wy(t)??r,o=Yp(e,i);return Ah(o.resolve?o.resolve(t,n):i.runInContext(()=>o(t,n)))}(e[c],t,n,r).pipe(Mh(),Vo(d=>{o[c]=d}))),kC(1),function K9(e){return Pe(()=>e)}(o),Th(c=>YC(c)?xt:dy(c)))}(o,e,t,r).pipe(Pe(c=>(e._resolvedData=c,e.data=iP(e,n).resolve,i&&MP(i)&&(e.data[py]=i.title),null)))}(c.route,r,e,t)),Vo(()=>o++),kC(1),dt(c=>o===i.length?Bt(n):xt))})}(this.paramsInheritanceStrategy,this.ngModule.injector),Vo({next:()=>v=!0,complete:()=>{v||(this.restoreHistory(p),this.cancelNavigationTransition(p,"",2))}}))}),Vo(p=>{const v=new Aj(p.id,this.serializeUrl(p.extractedUrl),this.serializeUrl(p.urlAfterRedirects),p.targetSnapshot);this.triggerEvent(v)}))}),QC(d=>{const p=v=>{const E=[];v.routeConfig?.loadComponent&&!v.routeConfig._loadedComponent&&E.push(this.configLoader.loadComponent(v.routeConfig).pipe(Vo(D=>{v.component=D}),Pe(()=>{})));for(const D of v.children)E.push(...p(D));return E};return Ik(p(d.targetSnapshot.root)).pipe(l0(),fy(1))}),QC(()=>this.afterPreactivation()),Pe(d=>{const p=function Vj(e,t,n){const r=by(e,t._root,n?n._root:void 0);return new nP(r,t)}(this.routeReuseStrategy,d.targetSnapshot,d.currentRouterState);return i={...d,targetRouterState:p}}),Vo(d=>{this.currentUrlTree=d.urlAfterRedirects,this.rawUrlTree=this.urlHandlingStrategy.merge(d.urlAfterRedirects,d.rawUrl),this.routerState=d.targetRouterState,"deferred"===this.urlUpdateStrategy&&(d.extras.skipLocationChange||this.setBrowserUrl(this.rawUrlTree,d),this.browserUrlTree=d.urlAfterRedirects)}),((e,t,n)=>Pe(r=>(new Yj(t,r.targetRouterState,r.currentRouterState,n).activate(e),r)))(this.rootContexts,this.routeReuseStrategy,d=>this.triggerEvent(d)),Vo({next(){o=!0},complete(){o=!0}}),PC(()=>{o||c||this.cancelNavigationTransition(i,"",1),this.currentNavigation?.id===i.id&&(this.currentNavigation=null)}),Th(d=>{if(c=!0,uP(d)){cP(d)||(this.navigated=!0,this.restoreHistory(i,!0));const p=new m0(i.id,this.serializeUrl(i.extractedUrl),d.message,d.cancellationCode);if(r.next(p),cP(d)){const v=this.urlHandlingStrategy.merge(d.url,this.rawUrlTree),E={skipLocationChange:i.extras.skipLocationChange,replaceUrl:"eager"===this.urlUpdateStrategy||PP(i.source)};this.scheduleNavigation(v,"imperative",null,E,{resolve:i.resolve,reject:i.reject,promise:i.promise})}else i.resolve(!1)}else{this.restoreHistory(i,!0);const p=new Qk(i.id,this.serializeUrl(i.extractedUrl),d,i.targetSnapshot??void 0);r.next(p);try{i.resolve(this.errorHandler(d))}catch(v){i.reject(v)}}return xt}))}))}resetRootComponentType(n){this.rootComponentType=n,this.routerState.root.component=this.rootComponentType}setTransition(n){this.transitions.next({...this.transitions.value,...n})}initialNavigation(){this.setUpLocationChangeListener(),0===this.navigationId&&this.navigateByUrl(this.location.path(!0),{replaceUrl:!0})}setUpLocationChangeListener(){this.locationSubscription||(this.locationSubscription=this.location.subscribe(n=>{const r="popstate"===n.type?"popstate":"hashchange";"popstate"===r&&setTimeout(()=>{const i={replaceUrl:!0},o=n.state?.navigationId?n.state:null;if(o){const d={...o};delete d.navigationId,delete d.\u0275routerPageId,0!==Object.keys(d).length&&(i.state=d)}const c=this.parseUrl(n.url);this.scheduleNavigation(c,r,o,i)},0)}))}get url(){return this.serializeUrl(this.currentUrlTree)}getCurrentNavigation(){return this.currentNavigation}triggerEvent(n){this.events.next(n)}resetConfig(n){this.config=n.map(XC),this.navigated=!1,this.lastSuccessfulId=-1}ngOnDestroy(){this.dispose()}dispose(){this.transitions.complete(),this.locationSubscription&&(this.locationSubscription.unsubscribe(),this.locationSubscription=void 0),this.disposed=!0}createUrlTree(n,r={}){const{relativeTo:i,queryParams:o,fragment:c,queryParamsHandling:d,preserveFragment:p}=r,v=i||this.routerState.root,E=p?this.currentUrlTree.fragment:c;let D=null;switch(d){case"merge":D={...this.currentUrlTree.queryParams,...o};break;case"preserve":D=this.currentUrlTree.queryParams;break;default:D=o||null}return null!==D&&(D=this.removeEmptyProps(D)),bj(v,this.currentUrlTree,n,D,E??null)}navigateByUrl(n,r={skipLocationChange:!1}){const i=cf(n)?n:this.parseUrl(n),o=this.urlHandlingStrategy.merge(i,this.rawUrlTree);return this.scheduleNavigation(o,"imperative",null,r)}navigate(n,r={skipLocationChange:!1}){return function JH(e){for(let t=0;t{const o=n[i];return null!=o&&(r[i]=o),r},{})}processNavigations(){this.navigations.subscribe(n=>{this.navigated=!0,this.lastSuccessfulId=n.id,this.currentPageId=n.targetPageId,this.events.next(new uf(n.id,this.serializeUrl(n.extractedUrl),this.serializeUrl(this.currentUrlTree))),this.lastSuccessfulNavigation=this.currentNavigation,this.titleStrategy?.updateTitle(this.routerState.snapshot),n.resolve(!0)},n=>{this.console.warn(`Unhandled Navigation Error: ${n}`)})}scheduleNavigation(n,r,i,o,c){if(this.disposed)return Promise.resolve(!1);let d,p,v;c?(d=c.resolve,p=c.reject,v=c.promise):v=new Promise((I,P)=>{d=I,p=P});const E=++this.navigationId;let D;return"computed"===this.canceledNavigationResolution?(0===this.currentPageId&&(i=this.location.getState()),D=i&&i.\u0275routerPageId?i.\u0275routerPageId:o.replaceUrl||o.skipLocationChange?this.browserPageId??0:(this.browserPageId??0)+1):D=0,this.setTransition({id:E,targetPageId:D,source:r,restoredState:i,currentUrlTree:this.currentUrlTree,currentRawUrl:this.rawUrlTree,rawUrl:n,extras:o,resolve:d,reject:p,promise:v,currentSnapshot:this.routerState.snapshot,currentRouterState:this.routerState}),v.catch(I=>Promise.reject(I))}setBrowserUrl(n,r){const i=this.urlSerializer.serialize(n),o={...r.extras.state,...this.generateNgRouterState(r.id,r.targetPageId)};this.location.isCurrentPathEqualTo(i)||r.extras.replaceUrl?this.location.replaceState(i,"",o):this.location.go(i,"",o)}restoreHistory(n,r=!1){if("computed"===this.canceledNavigationResolution){const i=this.currentPageId-n.targetPageId;"popstate"!==n.source&&"eager"!==this.urlUpdateStrategy&&this.currentUrlTree!==this.currentNavigation?.finalUrl||0===i?this.currentUrlTree===this.currentNavigation?.finalUrl&&0===i&&(this.resetState(n),this.browserUrlTree=n.currentUrlTree,this.resetUrlToCurrentUrlTree()):this.location.historyGo(i)}else"replace"===this.canceledNavigationResolution&&(r&&this.resetState(n),this.resetUrlToCurrentUrlTree())}resetState(n){this.routerState=n.currentRouterState,this.currentUrlTree=n.currentUrlTree,this.rawUrlTree=this.urlHandlingStrategy.merge(this.currentUrlTree,n.rawUrl)}resetUrlToCurrentUrlTree(){this.location.replaceState(this.urlSerializer.serialize(this.rawUrlTree),"",this.generateNgRouterState(this.lastSuccessfulId,this.currentPageId))}cancelNavigationTransition(n,r,i){const o=new m0(n.id,this.serializeUrl(n.extractedUrl),r,i);this.triggerEvent(o),n.resolve(!1)}generateNgRouterState(n,r){return"computed"===this.canceledNavigationResolution?{navigationId:n,\u0275routerPageId:r}:{navigationId:n}}}return e.\u0275fac=function(n){j1()},e.\u0275prov=Ot({token:e,factory:function(){return kP()},providedIn:"root"}),e})();function PP(e){return"imperative"!==e}class RP{}let tG=(()=>{class e{constructor(n,r,i,o,c){this.router=n,this.injector=i,this.preloadingStrategy=o,this.loader=c}setUpPreloading(){this.subscription=this.router.events.pipe(uu(n=>n instanceof uf),Ih(()=>this.preload())).subscribe(()=>{})}preload(){return this.processRoutes(this.injector,this.router.config)}ngOnDestroy(){this.subscription&&this.subscription.unsubscribe()}processRoutes(n,r){const i=[];for(const o of r){o.providers&&!o._injector&&(o._injector=Pv(o.providers,n,`Route: ${o.path}`));const c=o._injector??n,d=o._loadedInjector??c;o.loadChildren&&!o._loadedRoutes&&void 0===o.canLoad||o.loadComponent&&!o._loadedComponent?i.push(this.preloadConfig(c,o)):(o.children||o._loadedRoutes)&&i.push(this.processRoutes(d,o.children??o._loadedRoutes))}return Cr(i).pipe(ft())}preloadConfig(n,r){return this.preloadingStrategy.preload(r,()=>{let i;i=r.loadChildren&&void 0===r.canLoad?this.loader.loadChildren(n,r):Bt(null);const o=i.pipe(dt(c=>null===c?Bt(void 0):(r._loadedRoutes=c.routes,r._loadedInjector=c.injector,this.processRoutes(c.injector??n,c.routes))));return r.loadComponent&&!r._loadedComponent?Cr([o,this.loader.loadComponent(r)]).pipe(ft()):o})}}return e.\u0275fac=function(n){return new(n||e)(St(Do),St(Hw),St(Ms),St(RP),St(tE))},e.\u0275prov=Ot({token:e,factory:e.\u0275fac,providedIn:"root"}),e})();const iE=new It("");let FP=(()=>{class e{constructor(n,r,i={}){this.router=n,this.viewportScroller=r,this.options=i,this.lastId=0,this.lastSource="imperative",this.restoredId=0,this.store={},i.scrollPositionRestoration=i.scrollPositionRestoration||"disabled",i.anchorScrolling=i.anchorScrolling||"disabled"}init(){"disabled"!==this.options.scrollPositionRestoration&&this.viewportScroller.setHistoryScrollRestoration("manual"),this.routerEventsSubscription=this.createScrollEvents(),this.scrollEventsSubscription=this.consumeScrollEvents()}createScrollEvents(){return this.router.events.subscribe(n=>{n instanceof VC?(this.store[this.lastId]=this.viewportScroller.getScrollPosition(),this.lastSource=n.navigationTrigger,this.restoredId=n.restoredState?n.restoredState.navigationId:0):n instanceof uf&&(this.lastId=n.id,this.scheduleScrollEvent(n,this.router.parseUrl(n.urlAfterRedirects).fragment))})}consumeScrollEvents(){return this.router.events.subscribe(n=>{n instanceof eP&&(n.position?"top"===this.options.scrollPositionRestoration?this.viewportScroller.scrollToPosition([0,0]):"enabled"===this.options.scrollPositionRestoration&&this.viewportScroller.scrollToPosition(n.position):n.anchor&&"enabled"===this.options.anchorScrolling?this.viewportScroller.scrollToAnchor(n.anchor):"disabled"!==this.options.scrollPositionRestoration&&this.viewportScroller.scrollToPosition([0,0]))})}scheduleScrollEvent(n,r){this.router.triggerEvent(new eP(n,"popstate"===this.lastSource?this.store[this.restoredId]:null,r))}ngOnDestroy(){this.routerEventsSubscription&&this.routerEventsSubscription.unsubscribe(),this.scrollEventsSubscription&&this.scrollEventsSubscription.unsubscribe()}}return e.\u0275fac=function(n){j1()},e.\u0275prov=Ot({token:e,factory:e.\u0275fac}),e})();function Jp(e,t){return{\u0275kind:e,\u0275providers:t}}function oE(e){return[{provide:eE,multi:!0,useValue:e}]}function LP(){const e=Fr(Ys);return t=>{const n=e.get(Bv);if(t!==n.components[0])return;const r=e.get(Do),i=e.get(NP);1===e.get(sE)&&r.initialNavigation(),e.get(zP,null,Rt.Optional)?.setUpPreloading(),e.get(iE,null,Rt.Optional)?.init(),r.resetRootComponentType(n.componentTypes[0]),i.closed||(i.next(),i.unsubscribe())}}const NP=new It("",{factory:()=>new oi}),sE=new It("",{providedIn:"root",factory:()=>1});const zP=new It("");function oG(e){return Jp(0,[{provide:zP,useExisting:tG},{provide:RP,useExisting:e}])}const BP=new It("ROUTER_FORROOT_GUARD"),sG=[oC,{provide:jk,useClass:FC},{provide:Do,useFactory:kP},xy,{provide:hf,useFactory:function OP(e){return e.routerState.root},deps:[Do]},tE];function aG(){return new lA("Router",Do)}let VP=(()=>{class e{constructor(n){}static forRoot(n,r){return{ngModule:e,providers:[sG,[],oE(n),{provide:BP,useFactory:hG,deps:[[Do,new Od,new Tr]]},{provide:D0,useValue:r||{}},r?.useHash?{provide:sf,useClass:p$}:{provide:sf,useClass:RA},{provide:iE,useFactory:()=>{const e=Fr(Do),t=Fr(k7),n=Fr(D0);return n.scrollOffset&&t.setOffset(n.scrollOffset),new FP(e,t,n)}},r?.preloadingStrategy?oG(r.preloadingStrategy).\u0275providers:[],{provide:lA,multi:!0,useFactory:aG},r?.initialNavigation?dG(r):[],[{provide:UP,useFactory:LP},{provide:tA,multi:!0,useExisting:UP}]]}}static forChild(n){return{ngModule:e,providers:[oE(n)]}}}return e.\u0275fac=function(n){return new(n||e)(St(BP,8))},e.\u0275mod=ai({type:e}),e.\u0275inj=Ei({imports:[ZC]}),e})();function hG(e){return"guarded"}function dG(e){return["disabled"===e.initialNavigation?Jp(3,[{provide:Lv,multi:!0,useFactory:()=>{const t=Fr(Do);return()=>{t.setUpLocationChangeListener()}}},{provide:sE,useValue:2}]).\u0275providers:[],"enabledBlocking"===e.initialNavigation?Jp(2,[{provide:sE,useValue:0},{provide:Lv,multi:!0,deps:[Ys],useFactory:t=>{const n=t.get(d$,Promise.resolve());let r=!1;return()=>n.then(()=>new Promise(o=>{const c=t.get(Do),d=t.get(NP);(function i(o){t.get(Do).events.pipe(uu(d=>d instanceof uf||d instanceof m0||d instanceof Qk),Pe(d=>d instanceof uf||d instanceof m0&&(0===d.code||1===d.code)&&null),uu(d=>null!==d),fy(1)).subscribe(()=>{o()})})(()=>{o(!0),r=!0}),c.afterPreactivation=()=>(o(!0),r||d.closed?Bt(void 0):d),c.initialNavigation()}))}}]).\u0275providers:[]]}const UP=new It(""),pG=[];let mG=(()=>{class e{}return e.\u0275fac=function(n){return new(n||e)},e.\u0275mod=ai({type:e}),e.\u0275inj=Ei({imports:[VP.forRoot(pG),VP]}),e})();class $P{}class jP{}class gc{constructor(t){this.normalizedNames=new Map,this.lazyUpdate=null,t?this.lazyInit="string"==typeof t?()=>{this.headers=new Map,t.split("\n").forEach(n=>{const r=n.indexOf(":");if(r>0){const i=n.slice(0,r),o=i.toLowerCase(),c=n.slice(r+1).trim();this.maybeSetNormalizedName(i,o),this.headers.has(o)?this.headers.get(o).push(c):this.headers.set(o,[c])}})}:()=>{this.headers=new Map,Object.keys(t).forEach(n=>{let r=t[n];const i=n.toLowerCase();"string"==typeof r&&(r=[r]),r.length>0&&(this.headers.set(i,r),this.maybeSetNormalizedName(n,i))})}:this.headers=new Map}has(t){return this.init(),this.headers.has(t.toLowerCase())}get(t){this.init();const n=this.headers.get(t.toLowerCase());return n&&n.length>0?n[0]:null}keys(){return this.init(),Array.from(this.normalizedNames.values())}getAll(t){return this.init(),this.headers.get(t.toLowerCase())||null}append(t,n){return this.clone({name:t,value:n,op:"a"})}set(t,n){return this.clone({name:t,value:n,op:"s"})}delete(t,n){return this.clone({name:t,value:n,op:"d"})}maybeSetNormalizedName(t,n){this.normalizedNames.has(n)||this.normalizedNames.set(n,t)}init(){this.lazyInit&&(this.lazyInit instanceof gc?this.copyFrom(this.lazyInit):this.lazyInit(),this.lazyInit=null,this.lazyUpdate&&(this.lazyUpdate.forEach(t=>this.applyUpdate(t)),this.lazyUpdate=null))}copyFrom(t){t.init(),Array.from(t.headers.keys()).forEach(n=>{this.headers.set(n,t.headers.get(n)),this.normalizedNames.set(n,t.normalizedNames.get(n))})}clone(t){const n=new gc;return n.lazyInit=this.lazyInit&&this.lazyInit instanceof gc?this.lazyInit:this,n.lazyUpdate=(this.lazyUpdate||[]).concat([t]),n}applyUpdate(t){const n=t.name.toLowerCase();switch(t.op){case"a":case"s":let r=t.value;if("string"==typeof r&&(r=[r]),0===r.length)return;this.maybeSetNormalizedName(t.name,n);const i=("a"===t.op?this.headers.get(n):void 0)||[];i.push(...r),this.headers.set(n,i);break;case"d":const o=t.value;if(o){let c=this.headers.get(n);if(!c)return;c=c.filter(d=>-1===o.indexOf(d)),0===c.length?(this.headers.delete(n),this.normalizedNames.delete(n)):this.headers.set(n,c)}else this.headers.delete(n),this.normalizedNames.delete(n)}}forEach(t){this.init(),Array.from(this.normalizedNames.keys()).forEach(n=>t(this.normalizedNames.get(n),this.headers.get(n)))}}class gG{encodeKey(t){return HP(t)}encodeValue(t){return HP(t)}decodeKey(t){return decodeURIComponent(t)}decodeValue(t){return decodeURIComponent(t)}}const _G=/%(\d[a-f0-9])/gi,vG={40:"@","3A":":",24:"$","2C":",","3B":";","3D":"=","3F":"?","2F":"/"};function HP(e){return encodeURIComponent(e).replace(_G,(t,n)=>vG[n]??t)}function T0(e){return`${e}`}class fu{constructor(t={}){if(this.updates=null,this.cloneFrom=null,this.encoder=t.encoder||new gG,t.fromString){if(t.fromObject)throw new Error("Cannot specify both fromString and fromObject.");this.map=function yG(e,t){const n=new Map;return e.length>0&&e.replace(/^\?/,"").split("&").forEach(i=>{const o=i.indexOf("="),[c,d]=-1==o?[t.decodeKey(i),""]:[t.decodeKey(i.slice(0,o)),t.decodeValue(i.slice(o+1))],p=n.get(c)||[];p.push(d),n.set(c,p)}),n}(t.fromString,this.encoder)}else t.fromObject?(this.map=new Map,Object.keys(t.fromObject).forEach(n=>{const r=t.fromObject[n],i=Array.isArray(r)?r.map(T0):[T0(r)];this.map.set(n,i)})):this.map=null}has(t){return this.init(),this.map.has(t)}get(t){this.init();const n=this.map.get(t);return n?n[0]:null}getAll(t){return this.init(),this.map.get(t)||null}keys(){return this.init(),Array.from(this.map.keys())}append(t,n){return this.clone({param:t,value:n,op:"a"})}appendAll(t){const n=[];return Object.keys(t).forEach(r=>{const i=t[r];Array.isArray(i)?i.forEach(o=>{n.push({param:r,value:o,op:"a"})}):n.push({param:r,value:i,op:"a"})}),this.clone(n)}set(t,n){return this.clone({param:t,value:n,op:"s"})}delete(t,n){return this.clone({param:t,value:n,op:"d"})}toString(){return this.init(),this.keys().map(t=>{const n=this.encoder.encodeKey(t);return this.map.get(t).map(r=>n+"="+this.encoder.encodeValue(r)).join("&")}).filter(t=>""!==t).join("&")}clone(t){const n=new fu({encoder:this.encoder});return n.cloneFrom=this.cloneFrom||this,n.updates=(this.updates||[]).concat(t),n}init(){null===this.map&&(this.map=new Map),null!==this.cloneFrom&&(this.cloneFrom.init(),this.cloneFrom.keys().forEach(t=>this.map.set(t,this.cloneFrom.map.get(t))),this.updates.forEach(t=>{switch(t.op){case"a":case"s":const n=("a"===t.op?this.map.get(t.param):void 0)||[];n.push(T0(t.value)),this.map.set(t.param,n);break;case"d":if(void 0===t.value){this.map.delete(t.param);break}{let r=this.map.get(t.param)||[];const i=r.indexOf(T0(t.value));-1!==i&&r.splice(i,1),r.length>0?this.map.set(t.param,r):this.map.delete(t.param)}}}),this.cloneFrom=this.updates=null)}}class A0{constructor(){this.map=new Map}set(t,n){return this.map.set(t,n),this}get(t){return this.map.has(t)||this.map.set(t,t.defaultValue()),this.map.get(t)}delete(t){return this.map.delete(t),this}has(t){return this.map.has(t)}keys(){return this.map.keys()}}function GP(e){return typeof ArrayBuffer<"u"&&e instanceof ArrayBuffer}function qP(e){return typeof Blob<"u"&&e instanceof Blob}function ZP(e){return typeof FormData<"u"&&e instanceof FormData}class My{constructor(t,n,r,i){let o;if(this.url=n,this.body=null,this.reportProgress=!1,this.withCredentials=!1,this.responseType="json",this.method=t.toUpperCase(),function bG(e){switch(e){case"DELETE":case"GET":case"HEAD":case"OPTIONS":case"JSONP":return!1;default:return!0}}(this.method)||i?(this.body=void 0!==r?r:null,o=i):o=r,o&&(this.reportProgress=!!o.reportProgress,this.withCredentials=!!o.withCredentials,o.responseType&&(this.responseType=o.responseType),o.headers&&(this.headers=o.headers),o.context&&(this.context=o.context),o.params&&(this.params=o.params)),this.headers||(this.headers=new gc),this.context||(this.context=new A0),this.params){const c=this.params.toString();if(0===c.length)this.urlWithParams=n;else{const d=n.indexOf("?");this.urlWithParams=n+(-1===d?"?":dD.set(I,t.setHeaders[I]),p)),t.setParams&&(v=Object.keys(t.setParams).reduce((D,I)=>D.set(I,t.setParams[I]),v)),new My(n,r,o,{params:v,headers:p,context:E,reportProgress:d,responseType:i,withCredentials:c})}}var bi=(()=>((bi=bi||{})[bi.Sent=0]="Sent",bi[bi.UploadProgress=1]="UploadProgress",bi[bi.ResponseHeader=2]="ResponseHeader",bi[bi.DownloadProgress=3]="DownloadProgress",bi[bi.Response=4]="Response",bi[bi.User=5]="User",bi))();class lE{constructor(t,n=200,r="OK"){this.headers=t.headers||new gc,this.status=void 0!==t.status?t.status:n,this.statusText=t.statusText||r,this.url=t.url||null,this.ok=this.status>=200&&this.status<300}}class cE extends lE{constructor(t={}){super(t),this.type=bi.ResponseHeader}clone(t={}){return new cE({headers:t.headers||this.headers,status:void 0!==t.status?t.status:this.status,statusText:t.statusText||this.statusText,url:t.url||this.url||void 0})}}class k0 extends lE{constructor(t={}){super(t),this.type=bi.Response,this.body=void 0!==t.body?t.body:null}clone(t={}){return new k0({body:void 0!==t.body?t.body:this.body,headers:t.headers||this.headers,status:void 0!==t.status?t.status:this.status,statusText:t.statusText||this.statusText,url:t.url||this.url||void 0})}}class WP extends lE{constructor(t){super(t,0,"Unknown Error"),this.name="HttpErrorResponse",this.ok=!1,this.message=this.status>=200&&this.status<300?`Http failure during parsing for ${t.url||"(unknown url)"}`:`Http failure response for ${t.url||"(unknown url)"}: ${t.status} ${t.statusText}`,this.error=t.error||null}}function uE(e,t){return{body:t,headers:e.headers,context:e.context,observe:e.observe,params:e.params,reportProgress:e.reportProgress,responseType:e.responseType,withCredentials:e.withCredentials}}let XP=(()=>{class e{constructor(n){this.handler=n}request(n,r,i={}){let o;if(n instanceof My)o=n;else{let p,v;p=i.headers instanceof gc?i.headers:new gc(i.headers),i.params&&(v=i.params instanceof fu?i.params:new fu({fromObject:i.params})),o=new My(n,r,void 0!==i.body?i.body:null,{headers:p,context:i.context,params:v,reportProgress:i.reportProgress,responseType:i.responseType||"json",withCredentials:i.withCredentials})}const c=Bt(o).pipe(Ih(p=>this.handler.handle(p)));if(n instanceof My||"events"===i.observe)return c;const d=c.pipe(uu(p=>p instanceof k0));switch(i.observe||"body"){case"body":switch(o.responseType){case"arraybuffer":return d.pipe(Pe(p=>{if(null!==p.body&&!(p.body instanceof ArrayBuffer))throw new Error("Response is not an ArrayBuffer.");return p.body}));case"blob":return d.pipe(Pe(p=>{if(null!==p.body&&!(p.body instanceof Blob))throw new Error("Response is not a Blob.");return p.body}));case"text":return d.pipe(Pe(p=>{if(null!==p.body&&"string"!=typeof p.body)throw new Error("Response is not a string.");return p.body}));default:return d.pipe(Pe(p=>p.body))}case"response":return d;default:throw new Error(`Unreachable: unhandled observe type ${i.observe}}`)}}delete(n,r={}){return this.request("DELETE",n,r)}get(n,r={}){return this.request("GET",n,r)}head(n,r={}){return this.request("HEAD",n,r)}jsonp(n,r){return this.request("JSONP",n,{params:(new fu).append(r,"JSONP_CALLBACK"),observe:"body",responseType:"json"})}options(n,r={}){return this.request("OPTIONS",n,r)}patch(n,r,i={}){return this.request("PATCH",n,uE(i,r))}post(n,r,i={}){return this.request("POST",n,uE(i,r))}put(n,r,i={}){return this.request("PUT",n,uE(i,r))}}return e.\u0275fac=function(n){return new(n||e)(St($P))},e.\u0275prov=Ot({token:e,factory:e.\u0275fac}),e})();class YP{constructor(t,n){this.next=t,this.interceptor=n}handle(t){return this.interceptor.intercept(t,this.next)}}const KP=new It("HTTP_INTERCEPTORS");let wG=(()=>{class e{intercept(n,r){return r.handle(n)}}return e.\u0275fac=function(n){return new(n||e)},e.\u0275prov=Ot({token:e,factory:e.\u0275fac}),e})();const CG=/^\)\]\}',?\n/;let JP=(()=>{class e{constructor(n){this.xhrFactory=n}handle(n){if("JSONP"===n.method)throw new Error("Attempted to construct Jsonp request without HttpClientJsonpModule installed.");return new Nn(r=>{const i=this.xhrFactory.build();if(i.open(n.method,n.urlWithParams),n.withCredentials&&(i.withCredentials=!0),n.headers.forEach((P,N)=>i.setRequestHeader(P,N.join(","))),n.headers.has("Accept")||i.setRequestHeader("Accept","application/json, text/plain, */*"),!n.headers.has("Content-Type")){const P=n.detectContentTypeHeader();null!==P&&i.setRequestHeader("Content-Type",P)}if(n.responseType){const P=n.responseType.toLowerCase();i.responseType="json"!==P?P:"text"}const o=n.serializeBody();let c=null;const d=()=>{if(null!==c)return c;const P=i.statusText||"OK",N=new gc(i.getAllResponseHeaders()),G=function EG(e){return"responseURL"in e&&e.responseURL?e.responseURL:/^X-Request-URL:/m.test(e.getAllResponseHeaders())?e.getResponseHeader("X-Request-URL"):null}(i)||n.url;return c=new cE({headers:N,status:i.status,statusText:P,url:G}),c},p=()=>{let{headers:P,status:N,statusText:G,url:U}=d(),Z=null;204!==N&&(Z=typeof i.response>"u"?i.responseText:i.response),0===N&&(N=Z?200:0);let ne=N>=200&&N<300;if("json"===n.responseType&&"string"==typeof Z){const X=Z;Z=Z.replace(CG,"");try{Z=""!==Z?JSON.parse(Z):null}catch(re){Z=X,ne&&(ne=!1,Z={error:re,text:Z})}}ne?(r.next(new k0({body:Z,headers:P,status:N,statusText:G,url:U||void 0})),r.complete()):r.error(new WP({error:Z,headers:P,status:N,statusText:G,url:U||void 0}))},v=P=>{const{url:N}=d(),G=new WP({error:P,status:i.status||0,statusText:i.statusText||"Unknown Error",url:N||void 0});r.error(G)};let E=!1;const D=P=>{E||(r.next(d()),E=!0);let N={type:bi.DownloadProgress,loaded:P.loaded};P.lengthComputable&&(N.total=P.total),"text"===n.responseType&&!!i.responseText&&(N.partialText=i.responseText),r.next(N)},I=P=>{let N={type:bi.UploadProgress,loaded:P.loaded};P.lengthComputable&&(N.total=P.total),r.next(N)};return i.addEventListener("load",p),i.addEventListener("error",v),i.addEventListener("timeout",v),i.addEventListener("abort",v),n.reportProgress&&(i.addEventListener("progress",D),null!==o&&i.upload&&i.upload.addEventListener("progress",I)),i.send(o),r.next({type:bi.Sent}),()=>{i.removeEventListener("error",v),i.removeEventListener("abort",v),i.removeEventListener("load",p),i.removeEventListener("timeout",v),n.reportProgress&&(i.removeEventListener("progress",D),null!==o&&i.upload&&i.upload.removeEventListener("progress",I)),i.readyState!==i.DONE&&i.abort()}})}}return e.\u0275fac=function(n){return new(n||e)(St(nk))},e.\u0275prov=Ot({token:e,factory:e.\u0275fac}),e})();const hE=new It("XSRF_COOKIE_NAME"),dE=new It("XSRF_HEADER_NAME");class QP{}let DG=(()=>{class e{constructor(n,r,i){this.doc=n,this.platform=r,this.cookieName=i,this.lastCookieString="",this.lastToken=null,this.parseCount=0}getToken(){if("server"===this.platform)return null;const n=this.doc.cookie||"";return n!==this.lastCookieString&&(this.parseCount++,this.lastToken=jA(n,this.cookieName),this.lastCookieString=n),this.lastToken}}return e.\u0275fac=function(n){return new(n||e)(St(ss),St(jw),St(hE))},e.\u0275prov=Ot({token:e,factory:e.\u0275fac}),e})(),fE=(()=>{class e{constructor(n,r){this.tokenService=n,this.headerName=r}intercept(n,r){const i=n.url.toLowerCase();if("GET"===n.method||"HEAD"===n.method||i.startsWith("http://")||i.startsWith("https://"))return r.handle(n);const o=this.tokenService.getToken();return null!==o&&!n.headers.has(this.headerName)&&(n=n.clone({headers:n.headers.set(this.headerName,o)})),r.handle(n)}}return e.\u0275fac=function(n){return new(n||e)(St(QP),St(dE))},e.\u0275prov=Ot({token:e,factory:e.\u0275fac}),e})(),SG=(()=>{class e{constructor(n,r){this.backend=n,this.injector=r,this.chain=null}handle(n){if(null===this.chain){const r=this.injector.get(KP,[]);this.chain=r.reduceRight((i,o)=>new YP(i,o),this.backend)}return this.chain.handle(n)}}return e.\u0275fac=function(n){return new(n||e)(St(jP),St(Ys))},e.\u0275prov=Ot({token:e,factory:e.\u0275fac}),e})(),MG=(()=>{class e{static disable(){return{ngModule:e,providers:[{provide:fE,useClass:wG}]}}static withOptions(n={}){return{ngModule:e,providers:[n.cookieName?{provide:hE,useValue:n.cookieName}:[],n.headerName?{provide:dE,useValue:n.headerName}:[]]}}}return e.\u0275fac=function(n){return new(n||e)},e.\u0275mod=ai({type:e}),e.\u0275inj=Ei({providers:[fE,{provide:KP,useExisting:fE,multi:!0},{provide:QP,useClass:DG},{provide:hE,useValue:"XSRF-TOKEN"},{provide:dE,useValue:"X-XSRF-TOKEN"}]}),e})(),IG=(()=>{class e{}return e.\u0275fac=function(n){return new(n||e)},e.\u0275mod=ai({type:e}),e.\u0275inj=Ei({providers:[XP,{provide:$P,useClass:SG},JP,{provide:jP,useExisting:JP}],imports:[MG.withOptions({cookieName:"XSRF-TOKEN",headerName:"X-XSRF-TOKEN"})]}),e})();class TG{encodeKey(t){return encodeURIComponent(t)}encodeValue(t){return encodeURIComponent(t)}decodeKey(t){return decodeURIComponent(t)}decodeValue(t){return decodeURIComponent(t)}}const AG=new It("basePath");class eR{constructor(t={}){this.apiKeys=t.apiKeys,this.username=t.username,this.password=t.password,this.accessToken=t.accessToken,this.basePath=t.basePath,this.withCredentials=t.withCredentials,this.encoder=t.encoder,this.encodeParam=t.encodeParam?t.encodeParam:n=>this.defaultEncodeParam(n),this.credentials=t.credentials?t.credentials:{}}selectHeaderContentType(t){if(0===t.length)return;const n=t.find(r=>this.isJsonMime(r));return void 0===n?t[0]:n}selectHeaderAccept(t){if(0===t.length)return;const n=t.find(r=>this.isJsonMime(r));return void 0===n?t[0]:n}isJsonMime(t){const n=new RegExp("^(application/json|[^;/ \t]+/[^;/ \t]+[+]json)[ \t]*(;.*)?$","i");return null!==t&&(n.test(t)||"application/json-patch+json"===t.toLowerCase())}lookupCredential(t){const n=this.credentials[t];return"function"==typeof n?n():n}defaultEncodeParam(t){const n="date-time"===t.dataFormat?t.value.toISOString():t.value;return encodeURIComponent(String(n))}}let pE=(()=>{class e{constructor(n,r,i){this.httpClient=n,this.basePath="http://localhost",this.defaultHeaders=new gc,this.configuration=new eR,i&&(this.configuration=i),"string"!=typeof this.configuration.basePath&&(Array.isArray(r)&&r.length>0&&(r=r[0]),"string"!=typeof r&&(r=this.basePath),this.configuration.basePath=r),this.encoder=this.configuration.encoder||new TG}addToHttpParams(n,r,i){return"object"!=typeof r||r instanceof Date?this.addToHttpParamsRecursive(n,r,i):this.addToHttpParamsRecursive(n,r)}addToHttpParamsRecursive(n,r,i){if(null==r)return n;if("object"==typeof r)if(Array.isArray(r))r.forEach(o=>n=this.addToHttpParamsRecursive(n,o,i));else if(r instanceof Date){if(null==i)throw Error("key may not be null if value is Date");n=n.append(i,r.toISOString().substr(0,10))}else Object.keys(r).forEach(o=>n=this.addToHttpParamsRecursive(n,r[o],null!=i?`${i}.${o}`:o));else{if(null==i)throw Error("key may not be null if value is not object or array");n=n.append(i,r)}return n}paxServiceGetDevice(n,r="body",i=!1,o){if(null==n)throw new Error("Required parameter id was null or undefined when calling paxServiceGetDevice.");let c=this.defaultHeaders,d=o&&o.httpHeaderAccept;void 0===d&&(d=this.configuration.selectHeaderAccept(["application/json"])),void 0!==d&&(c=c.set("Accept",d));let p=o&&o.context;void 0===p&&(p=new A0);let v="json";d&&(v=d.startsWith("text")?"text":this.configuration.isJsonMime(d)?"json":"blob");let E=`/api/v1/devices/${this.configuration.encodeParam({name:"id",value:n,in:"path",style:"simple",explode:!1,dataType:"string",dataFormat:void 0})}`;return this.httpClient.request("get",`${this.configuration.basePath}${E}`,{context:p,responseType:v,withCredentials:this.configuration.withCredentials,headers:c,observe:r,reportProgress:i})}paxServiceListData(n,r,i,o="body",c=!1,d){let p=new fu({encoder:this.encoder});null!=n&&(p=this.addToHttpParams(p,n,"since")),null!=r&&(p=this.addToHttpParams(p,r,"until")),null!=i&&(p=this.addToHttpParams(p,i,"limit"));let v=this.defaultHeaders,E=d&&d.httpHeaderAccept;void 0===E&&(E=this.configuration.selectHeaderAccept(["application/json"])),void 0!==E&&(v=v.set("Accept",E));let D=d&&d.context;void 0===D&&(D=new A0);let I="json";return E&&(I=E.startsWith("text")?"text":this.configuration.isJsonMime(E)?"json":"blob"),this.httpClient.request("get",`${this.configuration.basePath}/api/v1/data`,{context:D,params:p,responseType:I,withCredentials:this.configuration.withCredentials,headers:v,observe:o,reportProgress:c})}paxServiceListDevices(n="body",r=!1,i){let o=this.defaultHeaders,c=i&&i.httpHeaderAccept;void 0===c&&(c=this.configuration.selectHeaderAccept(["application/json"])),void 0!==c&&(o=o.set("Accept",c));let d=i&&i.context;void 0===d&&(d=new A0);let p="json";return c&&(p=c.startsWith("text")?"text":this.configuration.isJsonMime(c)?"json":"blob"),this.httpClient.request("get",`${this.configuration.basePath}/api/v1/devices`,{context:d,responseType:p,withCredentials:this.configuration.withCredentials,headers:o,observe:n,reportProgress:r})}}return e.\u0275fac=function(n){return new(n||e)(St(XP),St(AG,8),St(eR,8))},e.\u0275prov=Ot({token:e,factory:e.\u0275fac,providedIn:"root"}),e})();class kG extends _r{constructor(t,n){super()}schedule(t,n=0){return this}}const P0={setInterval(e,t,...n){const{delegate:r}=P0;return r?.setInterval?r.setInterval(e,t,...n):setInterval(e,t,...n)},clearInterval(e){const{delegate:t}=P0;return(t?.clearInterval||clearInterval)(e)},delegate:void 0},mE={now:()=>(mE.delegate||Date).now(),delegate:void 0};class Iy{constructor(t,n=Iy.now){this.schedulerActionCtor=t,this.now=n}schedule(t,n=0,r){return new this.schedulerActionCtor(this,t).schedule(r,n)}}Iy.now=mE.now;const tR=new class RG extends Iy{constructor(t,n=Iy.now){super(t,n),this.actions=[],this._active=!1}flush(t){const{actions:n}=this;if(this._active)return void n.push(t);let r;this._active=!0;do{if(r=t.execute(t.state,t.delay))break}while(t=n.shift());if(this._active=!1,r){for(;t=n.shift();)t.unsubscribe();throw r}}}(class PG extends kG{constructor(t,n){super(t,n),this.scheduler=t,this.work=n,this.pending=!1}schedule(t,n=0){var r;if(this.closed)return this;this.state=t;const i=this.id,o=this.scheduler;return null!=i&&(this.id=this.recycleAsyncId(o,i,n)),this.pending=!0,this.delay=n,this.id=null!==(r=this.id)&&void 0!==r?r:this.requestAsyncId(o,this.id,n),this}requestAsyncId(t,n,r=0){return P0.setInterval(t.flush.bind(t,this),r)}recycleAsyncId(t,n,r=0){if(null!=r&&this.delay===r&&!1===this.pending)return n;null!=n&&P0.clearInterval(n)}execute(t,n){if(this.closed)return new Error("executing a cancelled action");this.pending=!1;const r=this._execute(t,n);if(r)return r;!1===this.pending&&null!=this.id&&(this.id=this.recycleAsyncId(this.scheduler,this.id,null))}_execute(t,n){let i,r=!1;try{this.work(t)}catch(o){r=!0,i=o||new Error("Scheduled action threw falsy error")}if(r)return this.unsubscribe(),i}unsubscribe(){if(!this.closed){const{id:t,scheduler:n}=this,{actions:r}=n;this.work=this.state=this.scheduler=null,this.pending=!1,b(r,this),null!=t&&(this.id=this.recycleAsyncId(n,t,null)),this.delay=null,super.unsubscribe()}}}),FG=tR;class R0 extends oi{constructor(t=1/0,n=1/0,r=mE){super(),this._bufferSize=t,this._windowTime=n,this._timestampProvider=r,this._buffer=[],this._infiniteTimeWindow=!0,this._infiniteTimeWindow=n===1/0,this._bufferSize=Math.max(1,t),this._windowTime=Math.max(1,n)}next(t){const{isStopped:n,_buffer:r,_infiniteTimeWindow:i,_timestampProvider:o,_windowTime:c}=this;n||(r.push(t),!i&&r.push(o.now()+c)),this._trimBuffer(),super.next(t)}_subscribe(t){this._throwIfClosed(),this._trimBuffer();const n=this._innerSubscribe(t),{_infiniteTimeWindow:r,_buffer:i}=this,o=i.slice();for(let c=0;c{class e{constructor(n){this.paxService=n,this.errorMessage="",this.lastDataUpdate=new Date,this.dataSubject=new R0,this.activeDeviceSubject=new R0,this.allSamples=[],this.allActiveDevices=[],this.fetchData()}activeDevices(){return this.activeDeviceSubject}fetchData(){let r=""+((new Date).getTime()-864e5),i=""+(new Date).getTime();this.lastDataUpdate=new Date,this.paxService.paxServiceListData(r,i).subscribe({next:o=>{o.data&&(this.allSamples=o.data),this.allSamples.forEach(c=>{c.samples?.forEach(d=>{this.dataSubject.next({id:c.deviceId||"",name:c.deviceName||"",time:new Date(parseInt(d.timestamp)),ble:d.bluetoothCount||0,wifi:d.wifiCount||0})})}),this.allActiveDevices=this.allSamples.map(c=>({id:c.deviceId,name:c.deviceName,lat:c.lat,lon:c.lon})),this.allActiveDevices.forEach(c=>{this.activeDeviceSubject.next(c),this.allActiveDevices.push(c)})},error:o=>{this.errorMessage=o.message,this.activeDeviceSubject.error(o),this.dataSubject.complete()},complete:()=>{this.activeDeviceSubject.complete(),this.dataSubject.complete()}})}hasError(){return""!=this.errorMessage}allData(){return(new Date).getTime()-this.lastDataUpdate.getTime()>6e4&&(this.dataSubject=new R0,this.activeDeviceSubject=new R0,this.fetchData()),this.dataSubject}addMapMarkers(n){this.allActiveDevices.forEach(r=>{if(r.lat&&0!=r.lat&&r.lon&&0!=r.lon){let i=new F0.Marker({color:"#ff0000"});i.setLngLat([r.lat,r.lon]),i.addTo(n)}})}}return e.\u0275fac=function(n){return new(n||e)(St(pE))},e.\u0275prov=Ot({token:e,factory:e.\u0275fac,providedIn:"root"}),e})();function xl(e,t){return null==e||null==t?NaN:et?1:e>=t?0:NaN}function BG(e){return 0|e.length}function VG(e){return!(e>0)}function UG(e){return"object"!=typeof e||"length"in e?e:Array.from(e)}function Ty(e,t){return null==e||null==t?NaN:te?1:t>=e?0:NaN}function gE(e,t){let r,n=0,i=0,o=0;if(void 0===t)for(let c of e)null!=c&&(c=+c)>=c&&(r=c-i,i+=r/++n,o+=r*(c-i));else{let c=-1;for(let d of e)null!=(d=t(d,++c,e))&&(d=+d)>=d&&(r=d-i,i+=r/++n,o+=r*(d-i))}if(n>1)return o/(n-1)}function nR(e,t){const n=gE(e,t);return n&&Math.sqrt(n)}function Qp(e,t){let n,r;if(void 0===t)for(const i of e)null!=i&&(void 0===n?i>=i&&(n=r=i):(n>i&&(n=i),r=o&&(n=r=o):(n>o&&(n=o),r=r.length)return n(o);const d=new L0,p=r[c++];let v=-1;for(const E of o){const D=p(E,++v,o),I=d.get(D);I?I.push(E):d.set(D,[E])}for(const[E,D]of d)d.set(E,i(D,c));return t(d)}(e,0)}function As(e,t){let n;if(void 0===t)for(const r of e)null!=r&&(n=r)&&(n=r);else{let r=-1;for(let i of e)null!=(i=t(i,++r,e))&&(n=i)&&(n=i)}return n}function qG(e,t){let n,r=-1,i=-1;if(void 0===t)for(const o of e)++i,null!=o&&(n=o)&&(n=o,r=i);else for(let o of e)null!=(o=t(o,++i,e))&&(n=o)&&(n=o,r=i);return r}function ZG(e,t){let n=0,r=0;if(void 0===t)for(let i of e)null!=i&&(i=+i)>=i&&(++n,r+=i);else{let i=-1;for(let o of e)null!=(o=t(o,++i,e))&&(o=+o)>=o&&(++n,r+=o)}if(n)return r/n}function df(e,t){let n;if(void 0===t)for(const r of e)null!=r&&(n>r||void 0===n&&r>=r)&&(n=r);else{let r=-1;for(let i of e)null!=(i=t(i,++r,e))&&(n>i||void 0===n&&i>=i)&&(n=i)}return n}function bE(e,...t){if("function"!=typeof e[Symbol.iterator])throw new TypeError("values is not iterable");e=Array.from(e);let[n]=t;if(n&&2!==n.length||t.length>1){const r=Uint32Array.from(e,(i,o)=>o);return t.length>1?(t=t.map(i=>e.map(i)),r.sort((i,o)=>{for(const c of t){const d=ky(c[i],c[o]);if(d)return d}})):(n=e.map(n),r.sort((i,o)=>ky(n[i],n[o]))),function WG(e,t){return Array.from(t,n=>e[n])}(e,r)}return e.sort(xE(n))}function xE(e=xl){if(e===xl)return ky;if("function"!=typeof e)throw new TypeError("compare is not a function");return(t,n)=>{const r=e(t,n);return r||0===r?r:(0===e(n,n))-(0===e(t,t))}}function ky(e,t){return(null==e||!(e>=e))-(null==t||!(t>=t))||(et?1:0)}function cR(e,t,n=0,r=1/0,i){if(t=Math.floor(t),n=Math.floor(Math.max(0,n)),r=Math.floor(Math.min(e.length-1,r)),!(n<=t&&t<=r))return e;for(i=void 0===i?ky:xE(i);r>n;){if(r-n>600){const p=r-n+1,v=t-n+1,E=Math.log(p),D=.5*Math.exp(2*E/3),I=.5*Math.sqrt(E*D*(p-D)/p)*(v-p/2<0?-1:1);cR(e,t,Math.max(n,Math.floor(t-v*D/p+I)),Math.min(r,Math.floor(t+(p-v)*D/p+I)),i)}const o=e[t];let c=n,d=r;for(Py(e,n,t),i(e[r],o)>0&&Py(e,n,r);c0;)--d}0===i(e[n],o)?Py(e,n,d):(++d,Py(e,d,r)),d<=t&&(n=d+1),t<=d&&(r=d-1)}return e}function Py(e,t,n){const r=e[t];e[t]=e[n],e[n]=r}function uR(e){return null===e?NaN:+e}function N0(e,t,n){if(e=Float64Array.from(function*XG(e,t){if(void 0===t)for(let n of e)null!=n&&(n=+n)>=n&&(yield n);else{let n=-1;for(let r of e)null!=(r=t(r,++n,e))&&(r=+r)>=r&&(yield r)}}(e,n)),(r=e.length)&&!isNaN(t=+t)){if(t<=0||r<2)return df(e);if(t>=1)return As(e);var r,i=(r-1)*t,o=Math.floor(i),c=As(cR(e,o).subarray(0,o+1));return c+(df(e.subarray(o+1))-c)*(i-o)}}function YG(e,t,n=uR){if((r=e.length)&&!isNaN(t=+t)){if(t<=0||r<2)return+n(e[0],0,e);if(t>=1)return+n(e[r-1],r-1,e);var r,i=(r-1)*t,o=Math.floor(i),c=+n(e[o],o,e);return c+(+n(e[o+1],o+1,e)-c)*(i-o)}}function z0(e,t){return N0(e,.5,t)}function KG(e,t){let n,r=-1,i=-1;if(void 0===t)for(const o of e)++i,null!=o&&(n>o||void 0===n&&o>=o)&&(n=o,r=i);else for(let o of e)null!=(o=t(o,++i,e))&&(n>o||void 0===n&&o>=o)&&(n=o,r=i);return r}function hR(e,t){const n=new L0;if(void 0===t)for(let o of e)null!=o&&o>=o&&n.set(o,(n.get(o)||0)+1);else{let o=-1;for(let c of e)null!=(c=t(c,++o,e))&&c>=c&&n.set(c,(n.get(c)||0)+1)}let r,i=0;for(const[o,c]of n)c>i&&(i=c,r=o);return r}function dR(e,t,n){e=+e,t=+t,n=(i=arguments.length)<2?(t=e,e=0,1):i<3?1:+n;for(var r=-1,i=0|Math.max(0,Math.ceil((t-e)/n)),o=new Array(i);++rt(n[d],n[p]);let o,c;return(e=Uint32Array.from(n,(d,p)=>p)).sort(t===xl?(d,p)=>ky(n[d],n[p]):xE(i)),e.forEach((d,p)=>{const v=i(d,void 0===o?d:o);v>=0?((void 0===o||v>0)&&(o=d,c=p),r[d]=c):r[d]=NaN}),r}function B0(e,t){let n=0;if(void 0===t)for(let r of e)(r=+r)&&(n+=r);else{let r=-1;for(let i of e)(i=+t(i,++r,e))&&(n+=i)}return n}const JG=Math.sqrt(50),QG=Math.sqrt(10),eq=Math.sqrt(2);function V0(e,t,n){const r=(t-e)/Math.max(0,n),i=Math.floor(Math.log10(r)),o=r/Math.pow(10,i),c=o>=JG?10:o>=QG?5:o>=eq?2:1;let d,p,v;return i<0?(v=Math.pow(10,-i)/c,d=Math.round(e*v),p=Math.round(t*v),d/vt&&--p,v=-v):(v=Math.pow(10,i)*c,d=Math.round(e/v),p=Math.round(t/v),d*vt&&--p),p0))return[];if((e=+e)==(t=+t))return[e];const r=t=i))return[];const d=o-i+1,p=new Array(d);if(r)if(c<0)for(let v=0;v+e(t)}function oq(e,t){return t=Math.max(0,e.bandwidth()-2*t)/2,e.round()&&(t=Math.round(t)),n=>+e(n)+t}function sq(){return!this.__axis}function G0(e,t){var n=[],r=null,i=null,o=6,c=6,d=3,p=typeof window<"u"&&window.devicePixelRatio>1?0:.5,v=1===e||4===e?-1:1,E=4===e||2===e?"x":"y",D=1===e||3===e?nq:rq;function I(P){var N=r??(t.ticks?t.ticks.apply(t,n):t.domain()),G=i??(t.tickFormat?t.tickFormat.apply(t,n):tq),U=Math.max(o,0)+d,Z=t.range(),ne=+Z[0]+p,X=+Z[Z.length-1]+p,re=(t.bandwidth?oq:iq)(t.copy(),p),fe=P.selection?P.selection():P,ve=fe.selectAll(".domain").data([null]),Re=fe.selectAll(".tick").data(N,t).order(),We=Re.exit(),Ke=Re.enter().append("g").attr("class","tick"),lt=Re.select("line"),Ue=Re.select("text");ve=ve.merge(ve.enter().insert("path",".tick").attr("class","domain").attr("stroke","currentColor")),Re=Re.merge(Ke),lt=lt.merge(Ke.append("line").attr("stroke","currentColor").attr(E+"2",v*o)),Ue=Ue.merge(Ke.append("text").attr("fill","currentColor").attr(E,v*U).attr("dy",1===e?"0em":3===e?"0.71em":"0.32em")),P!==fe&&(ve=ve.transition(P),Re=Re.transition(P),lt=lt.transition(P),Ue=Ue.transition(P),We=We.transition(P).attr("opacity",1e-6).attr("transform",function(st){return isFinite(st=re(st))?D(st+p):this.getAttribute("transform")}),Ke.attr("opacity",1e-6).attr("transform",function(st){var Fe=this.parentNode.__axis;return D((Fe&&isFinite(Fe=Fe(st))?Fe:re(st))+p)})),We.remove(),ve.attr("d",4===e||2===e?c?"M"+v*c+","+ne+"H"+p+"V"+X+"H"+v*c:"M"+p+","+ne+"V"+X:c?"M"+ne+","+v*c+"V"+p+"H"+X+"V"+v*c:"M"+ne+","+p+"H"+X),Re.attr("opacity",1).attr("transform",function(st){return D(re(st)+p)}),lt.attr(E+"2",v*o),Ue.attr(E,v*U).text(G),fe.filter(sq).attr("fill","none").attr("font-size",10).attr("font-family","sans-serif").attr("text-anchor",2===e?"start":4===e?"end":"middle"),fe.each(function(){this.__axis=re})}return I.scale=function(P){return arguments.length?(t=P,I):t},I.ticks=function(){return n=Array.from(arguments),I},I.tickArguments=function(P){return arguments.length?(n=null==P?[]:Array.from(P),I):n.slice()},I.tickValues=function(P){return arguments.length?(r=null==P?null:Array.from(P),I):r&&r.slice()},I.tickFormat=function(P){return arguments.length?(i=P,I):i},I.tickSize=function(P){return arguments.length?(o=c=+P,I):o},I.tickSizeInner=function(P){return arguments.length?(o=+P,I):o},I.tickSizeOuter=function(P){return arguments.length?(c=+P,I):c},I.tickPadding=function(P){return arguments.length?(d=+P,I):d},I.offset=function(P){return arguments.length?(p=+P,I):p},I}function lq(){}function DE(e){return null==e?lq:function(){return this.querySelector(e)}}function uq(e){return null==e?[]:Array.isArray(e)?e:Array.from(e)}function hq(){return[]}function mR(e){return null==e?hq:function(){return this.querySelectorAll(e)}}function gR(e){return function(){return this.matches(e)}}function yR(e){return function(t){return t.matches(e)}}var pq=Array.prototype.find;function gq(){return this.firstElementChild}var _q=Array.prototype.filter;function vq(){return Array.from(this.children)}function _R(e){return new Array(e.length)}function q0(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}function Eq(e){return function(){return e}}function Dq(e,t,n,r,i,o){for(var d,c=0,p=t.length,v=o.length;ct?1:e>=t?0:NaN}q0.prototype={constructor:q0,appendChild:function(e){return this._parent.insertBefore(e,this._next)},insertBefore:function(e,t){return this._parent.insertBefore(e,t)},querySelector:function(e){return this._parent.querySelector(e)},querySelectorAll:function(e){return this._parent.querySelectorAll(e)}};var SE="http://www.w3.org/1999/xhtml";const tm={svg:"http://www.w3.org/2000/svg",xhtml:SE,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function Z0(e){var t=e+="",n=t.indexOf(":");return n>=0&&"xmlns"!==(t=e.slice(0,n))&&(e=e.slice(n+1)),tm.hasOwnProperty(t)?{space:tm[t],local:e}:e}function $q(e){return function(){this.removeAttribute(e)}}function jq(e){return function(){this.removeAttributeNS(e.space,e.local)}}function Hq(e,t){return function(){this.setAttribute(e,t)}}function Gq(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function qq(e,t){return function(){var n=t.apply(this,arguments);null==n?this.removeAttribute(e):this.setAttribute(e,n)}}function Zq(e,t){return function(){var n=t.apply(this,arguments);null==n?this.removeAttributeNS(e.space,e.local):this.setAttributeNS(e.space,e.local,n)}}function vR(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function Xq(e){return function(){this.style.removeProperty(e)}}function Yq(e,t,n){return function(){this.style.setProperty(e,t,n)}}function Kq(e,t,n){return function(){var r=t.apply(this,arguments);null==r?this.style.removeProperty(e):this.style.setProperty(e,r,n)}}function nm(e,t){return e.style.getPropertyValue(t)||vR(e).getComputedStyle(e,null).getPropertyValue(t)}function Qq(e){return function(){delete this[e]}}function eZ(e,t){return function(){this[e]=t}}function tZ(e,t){return function(){var n=t.apply(this,arguments);null==n?delete this[e]:this[e]=n}}function bR(e){return e.trim().split(/^|\s+/)}function ME(e){return e.classList||new xR(e)}function xR(e){this._node=e,this._names=bR(e.getAttribute("class")||"")}function wR(e,t){for(var n=ME(e),r=-1,i=t.length;++r=0&&(n=t.slice(r+1),t=t.slice(0,r)),{type:t,name:n}})}function PZ(e){return function(){var t=this.__on;if(t){for(var o,n=0,r=-1,i=t.length;n=0&&(this._names.splice(t,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(e){return this._names.indexOf(e)>=0}};var DR=[null];function Js(e,t){this._groups=e,this._parents=t}function SR(){return new Js([[document.documentElement]],DR)}Js.prototype=SR.prototype={constructor:Js,select:function cq(e){"function"!=typeof e&&(e=DE(e));for(var t=this._groups,n=t.length,r=new Array(n),i=0;i=X&&(X=ne+1);!(fe=U[X])&&++X=0;)(c=r[i])&&(o&&4^c.compareDocumentPosition(o)&&o.parentNode.insertBefore(c,o),o=c);return this},sort:function Fq(e){function t(D,I){return D&&I?e(D.__data__,I.__data__):!D-!I}e||(e=Oq);for(var n=this._groups,r=n.length,i=new Array(r),o=0;o1?this.each((null==t?Xq:"function"==typeof t?Kq:Yq)(e,t,n??"")):nm(this.node(),e)},property:function nZ(e,t){return arguments.length>1?this.each((null==t?Qq:"function"==typeof t?tZ:eZ)(e,t)):this.node()[e]},classed:function sZ(e,t){var n=bR(e+"");if(arguments.length<2){for(var r=ME(this.node()),i=-1,o=n.length;++i{}};function MR(){for(var r,e=0,t=arguments.length,n={};e=0&&(r=n.slice(i+1),n=n.slice(0,i)),n&&!t.hasOwnProperty(n))throw new Error("unknown type: "+n);return{type:n,name:r}})}function $Z(e,t){for(var i,n=0,r=e.length;n0)for(var i,o,n=new Array(i),r=0;r=0&&e._call.call(void 0,t),e=e._next;--rm}()}finally{rm=0,function ZZ(){for(var e,n,t=X0,r=1/0;t;)t._call?(r>t._time&&(r=t._time),e=t,t=t._next):(n=t._next,t._next=null,t=e?e._next=n:X0=n);Ny=e,AE(r)}(),ff=0}}function qZ(){var e=zy.now(),t=e-Y0;t>1e3&&(K0-=t,Y0=e)}function AE(e){rm||(Oy&&(Oy=clearTimeout(Oy)),e-ff>24?(e<1/0&&(Oy=setTimeout(PR,e-zy.now()-K0)),Ly&&(Ly=clearInterval(Ly))):(Ly||(Y0=zy.now(),Ly=setInterval(qZ,1e3)),rm=1,AR(PR)))}function RR(e,t,n){var r=new J0;return r.restart(i=>{r.stop(),e(i+t)},t=null==t?0:+t,n),r}J0.prototype=kR.prototype={constructor:J0,restart:function(e,t,n){if("function"!=typeof e)throw new TypeError("callback is not a function");n=(null==n?TE():+n)+(null==t?0:+t),!this._next&&Ny!==this&&(Ny?Ny._next=this:X0=this,Ny=this),this._call=e,this._time=n,AE()},stop:function(){this._call&&(this._call=null,this._time=1/0,AE())}};var WZ=jZ("start","end","cancel","interrupt"),XZ=[];function tb(e,t,n,r,i,o){var c=e.__transition;if(c){if(n in c)return}else e.__transition={};!function YZ(e,t,n){var i,r=e.__transition;function c(v){var E,D,I,P;if(1!==n.state)return p();for(E in r)if((P=r[E]).name===n.name){if(3===P.state)return RR(c);4===P.state?(P.state=6,P.timer.stop(),P.on.call("interrupt",e,e.__data__,P.index,P.group),delete r[E]):+E0)throw new Error("too late; already scheduled");return n}function yc(e,t){var n=wl(e,t);if(n.state>3)throw new Error("too late; already running");return n}function wl(e,t){var n=e.__transition;if(!n||!(n=n[t]))throw new Error("transition not found");return n}function Uo(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}var nb,NR=180/Math.PI,FE={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function zR(e,t,n,r,i,o){var c,d,p;return(c=Math.sqrt(e*e+t*t))&&(e/=c,t/=c),(p=e*n+t*r)&&(n-=e*p,r-=t*p),(d=Math.sqrt(n*n+r*r))&&(n/=d,r/=d,p/=d),e*r180?E+=360:E-v>180&&(v+=360),I.push({i:D.push(i(D)+"rotate(",null,r)-2,x:Uo(v,E)})):E&&D.push(i(D)+"rotate("+E+r)}(v.rotate,E.rotate,D,I),function d(v,E,D,I){v!==E?I.push({i:D.push(i(D)+"skewX(",null,r)-2,x:Uo(v,E)}):E&&D.push(i(D)+"skewX("+E+r)}(v.skewX,E.skewX,D,I),function p(v,E,D,I,P,N){if(v!==D||E!==I){var G=P.push(i(P)+"scale(",null,",",null,")");N.push({i:G-4,x:Uo(v,D)},{i:G-2,x:Uo(E,I)})}else(1!==D||1!==I)&&P.push(i(P)+"scale("+D+","+I+")")}(v.scaleX,v.scaleY,E.scaleX,E.scaleY,D,I),v=E=null,function(P){for(var U,N=-1,G=I.length;++N>8&15|t>>4&240,t>>4&15|240&t,(15&t)<<4|15&t,1):8===n?rb(t>>24&255,t>>16&255,t>>8&255,(255&t)/255):4===n?rb(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|240&t,((15&t)<<4|15&t)/255):null):(t=aW.exec(e))?new Ji(t[1],t[2],t[3],1):(t=lW.exec(e))?new Ji(255*t[1]/100,255*t[2]/100,255*t[3]/100,1):(t=cW.exec(e))?rb(t[1],t[2],t[3],t[4]):(t=uW.exec(e))?rb(255*t[1]/100,255*t[2]/100,255*t[3]/100,t[4]):(t=hW.exec(e))?qR(t[1],t[2]/100,t[3]/100,1):(t=dW.exec(e))?qR(t[1],t[2]/100,t[3]/100,t[4]):VR.hasOwnProperty(e)?jR(VR[e]):"transparent"===e?new Ji(NaN,NaN,NaN,0):null}function jR(e){return new Ji(e>>16&255,e>>8&255,255&e,1)}function rb(e,t,n,r){return r<=0&&(e=t=n=NaN),new Ji(e,t,n,r)}function LE(e){return e instanceof kh||(e=Ph(e)),e?new Ji((e=e.rgb()).r,e.g,e.b,e.opacity):new Ji}function Rh(e,t,n,r){return 1===arguments.length?LE(e):new Ji(e,t,n,r??1)}function Ji(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}function HR(){return`#${gf(this.r)}${gf(this.g)}${gf(this.b)}`}function GR(){const e=ib(this.opacity);return`${1===e?"rgb(":"rgba("}${mf(this.r)}, ${mf(this.g)}, ${mf(this.b)}${1===e?")":`, ${e})`}`}function ib(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function mf(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function gf(e){return((e=mf(e))<16?"0":"")+e.toString(16)}function qR(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new Cl(e,t,n,r)}function ZR(e){if(e instanceof Cl)return new Cl(e.h,e.s,e.l,e.opacity);if(e instanceof kh||(e=Ph(e)),!e)return new Cl;if(e instanceof Cl)return e;var t=(e=e.rgb()).r/255,n=e.g/255,r=e.b/255,i=Math.min(t,n,r),o=Math.max(t,n,r),c=NaN,d=o-i,p=(o+i)/2;return d?(c=t===o?(n-r)/d+6*(n0&&p<1?0:c,new Cl(c,d,p,e.opacity)}function NE(e,t,n,r){return 1===arguments.length?ZR(e):new Cl(e,t,n,r??1)}function Cl(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}function WR(e){return(e=(e||0)%360)<0?e+360:e}function ob(e){return Math.max(0,Math.min(1,e||0))}function zE(e,t,n){return 255*(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)}function XR(e,t,n,r,i){var o=e*e,c=o*e;return((1-3*e+3*o-c)*t+(4-6*o+3*c)*n+(1+3*e+3*o-3*c)*r+c*i)/6}im(kh,Ph,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:UR,formatHex:UR,formatHex8:function fW(){return this.rgb().formatHex8()},formatHsl:function pW(){return ZR(this).formatHsl()},formatRgb:$R,toString:$R}),im(Ji,Rh,By(kh,{brighter(e){return e=null==e?om:Math.pow(om,e),new Ji(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=null==e?.7:Math.pow(.7,e),new Ji(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new Ji(mf(this.r),mf(this.g),mf(this.b),ib(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:HR,formatHex:HR,formatHex8:function mW(){return`#${gf(this.r)}${gf(this.g)}${gf(this.b)}${gf(255*(isNaN(this.opacity)?1:this.opacity))}`},formatRgb:GR,toString:GR})),im(Cl,NE,By(kh,{brighter(e){return e=null==e?om:Math.pow(om,e),new Cl(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=null==e?.7:Math.pow(.7,e),new Cl(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+360*(this.h<0),t=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*t,i=2*n-r;return new Ji(zE(e>=240?e-240:e+120,i,r),zE(e,i,r),zE(e<120?e+240:e-120,i,r),this.opacity)},clamp(){return new Cl(WR(this.h),ob(this.s),ob(this.l),ib(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const e=ib(this.opacity);return`${1===e?"hsl(":"hsla("}${WR(this.h)}, ${100*ob(this.s)}%, ${100*ob(this.l)}%${1===e?")":`, ${e})`}`}}));const sb=e=>()=>e;function YR(e,t){return function(n){return e+n*t}}function BE(e,t){var n=t-e;return n?YR(e,n>180||n<-180?n-360*Math.round(n/360):n):sb(isNaN(e)?t:e)}function Qi(e,t){var n=t-e;return n?YR(e,n):sb(isNaN(e)?t:e)}const yf=function e(t){var n=function vW(e){return 1==(e=+e)?Qi:function(t,n){return n-t?function _W(e,t,n){return e=Math.pow(e,n),t=Math.pow(t,n)-e,n=1/n,function(r){return Math.pow(e+r*t,n)}}(t,n,e):sb(isNaN(t)?n:t)}}(t);function r(i,o){var c=n((i=Rh(i)).r,(o=Rh(o)).r),d=n(i.g,o.g),p=n(i.b,o.b),v=Qi(i.opacity,o.opacity);return function(E){return i.r=c(E),i.g=d(E),i.b=p(E),i.opacity=v(E),i+""}}return r.gamma=e,r}(1);function KR(e){return function(t){var c,d,n=t.length,r=new Array(n),i=new Array(n),o=new Array(n);for(c=0;c=1?(n=1,t-1):Math.floor(n*t),i=e[r],o=e[r+1];return XR((n-r/t)*t,r>0?e[r-1]:2*i-o,i,o,rn&&(o=t.slice(n,o),d[c]?d[c]+=o:d[++c]=o),(r=r[0])===(i=i[0])?d[c]?d[c]+=i:d[++c]=i:(d[++c]=null,p.push({i:c,x:Uo(r,i)})),n=UE.lastIndex;return n=0&&(t=t.slice(0,n)),!t||"start"===t})}(t)?RE:yc;return function(){var c=o(this,e),d=c.on;d!==r&&(i=(r=d).copy()).on(t,n),c.on=i}}var eX=Fy.prototype.constructor;function eF(e){return function(){this.style.removeProperty(e)}}function aX(e,t,n){return function(r){this.style.setProperty(e,t.call(this,r),n)}}function lX(e,t,n){var r,i;function o(){var c=t.apply(this,arguments);return c!==i&&(r=(i=c)&&aX(e,c,n)),r}return o._value=t,o}function fX(e){return function(t){this.textContent=e.call(this,t)}}function pX(e){var t,n;function r(){var i=e.apply(this,arguments);return i!==n&&(t=(n=i)&&fX(i)),t}return r._value=e,r}var _X=0;function pu(e,t,n,r){this._groups=e,this._parents=t,this._name=n,this._id=r}function tF(){return++_X}var mu=Fy.prototype;pu.prototype=function vX(e){return Fy().transition(e)}.prototype={constructor:pu,select:function JW(e){var t=this._name,n=this._id;"function"!=typeof e&&(e=DE(e));for(var r=this._groups,i=r.length,o=new Array(i),c=0;c2&&r.state<5,r.state=6,r.timer.stop(),r.on.call(i?"interrupt":"cancel",e,e.__data__,r.index,r.group),delete n[c]):o=!1;o&&delete e.__transition}}(this,e)})},Fy.prototype.transition=function CX(e){var t,n;e instanceof pu?(t=e._id,e=e._name):(t=tF(),(n=xX).time=TE(),e=null==e?null:e+"");for(var r=this._groups,i=r.length,o=0;o1?r[0]+r.slice(2):r,+e.slice(n+1)]}function cm(e){return(e=cb(Math.abs(e)))?e[1]:NaN}["w","e"].map(Uy),["n","s"].map(Uy),["n","w","e","s","nw","ne","sw","se"].map(Uy);var aF,FX=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function $y(e){if(!(t=FX.exec(e)))throw new Error("invalid format: "+e);var t;return new qE({fill:t[1],align:t[2],sign:t[3],symbol:t[4],zero:t[5],width:t[6],comma:t[7],precision:t[8]&&t[8].slice(1),trim:t[9],type:t[10]})}function qE(e){this.fill=void 0===e.fill?" ":e.fill+"",this.align=void 0===e.align?">":e.align+"",this.sign=void 0===e.sign?"-":e.sign+"",this.symbol=void 0===e.symbol?"":e.symbol+"",this.zero=!!e.zero,this.width=void 0===e.width?void 0:+e.width,this.comma=!!e.comma,this.precision=void 0===e.precision?void 0:+e.precision,this.trim=!!e.trim,this.type=void 0===e.type?"":e.type+""}function lF(e,t){var n=cb(e,t);if(!n)return e+"";var r=n[0],i=n[1];return i<0?"0."+new Array(-i).join("0")+r:r.length>i+1?r.slice(0,i+1)+"."+r.slice(i+1):r+new Array(i-r.length+2).join("0")}$y.prototype=qE.prototype,qE.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(void 0===this.width?"":Math.max(1,0|this.width))+(this.comma?",":"")+(void 0===this.precision?"":"."+Math.max(0,0|this.precision))+(this.trim?"~":"")+this.type};const cF={"%":(e,t)=>(100*e).toFixed(t),b:e=>Math.round(e).toString(2),c:e=>e+"",d:function kX(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString("en").replace(/,/g,""):e.toString(10)},e:(e,t)=>e.toExponential(t),f:(e,t)=>e.toFixed(t),g:(e,t)=>e.toPrecision(t),o:e=>Math.round(e).toString(8),p:(e,t)=>lF(100*e,t),r:lF,s:function LX(e,t){var n=cb(e,t);if(!n)return e+"";var r=n[0],i=n[1],o=i-(aF=3*Math.max(-8,Math.min(8,Math.floor(i/3))))+1,c=r.length;return o===c?r:o>c?r+new Array(o-c+1).join("0"):o>0?r.slice(0,o)+"."+r.slice(o):"0."+new Array(1-o).join("0")+cb(e,Math.max(0,t+o-1))[0]},X:e=>Math.round(e).toString(16).toUpperCase(),x:e=>Math.round(e).toString(16)};function uF(e){return e}var ub,um,fF,hF=Array.prototype.map,dF=["y","z","a","f","p","n","\xb5","m","","k","M","G","T","P","E","Z","Y"];!function zX(e){ub=function NX(e){var t=void 0===e.grouping||void 0===e.thousands?uF:function PX(e,t){return function(n,r){for(var i=n.length,o=[],c=0,d=e[0],p=0;i>0&&d>0&&(p+d+1>r&&(d=Math.max(1,r-p)),o.push(n.substring(i-=d,i+d)),!((p+=d+1)>r));)d=e[c=(c+1)%e.length];return o.reverse().join(t)}}(hF.call(e.grouping,Number),e.thousands+""),n=void 0===e.currency?"":e.currency[0]+"",r=void 0===e.currency?"":e.currency[1]+"",i=void 0===e.decimal?".":e.decimal+"",o=void 0===e.numerals?uF:function RX(e){return function(t){return t.replace(/[0-9]/g,function(n){return e[+n]})}}(hF.call(e.numerals,String)),c=void 0===e.percent?"%":e.percent+"",d=void 0===e.minus?"\u2212":e.minus+"",p=void 0===e.nan?"NaN":e.nan+"";function v(D){var I=(D=$y(D)).fill,P=D.align,N=D.sign,G=D.symbol,U=D.zero,Z=D.width,ne=D.comma,X=D.precision,re=D.trim,fe=D.type;"n"===fe?(ne=!0,fe="g"):cF[fe]||(void 0===X&&(X=12),re=!0,fe="g"),(U||"0"===I&&"="===P)&&(U=!0,I="0",P="=");var ve="$"===G?n:"#"===G&&/[boxX]/.test(fe)?"0"+fe.toLowerCase():"",Re="$"===G?r:/[%p]/.test(fe)?c:"",We=cF[fe],Ke=/[defgprs%]/.test(fe);function lt(Ue){var le,de,pe,st=ve,Fe=Re;if("c"===fe)Fe=We(Ue)+Fe,Ue="";else{var Oe=(Ue=+Ue)<0||1/Ue<0;if(Ue=isNaN(Ue)?p:We(Math.abs(Ue),X),re&&(Ue=function OX(e){e:for(var i,t=e.length,n=1,r=-1;n0&&(r=0)}return r>0?e.slice(0,r)+e.slice(i+1):e}(Ue)),Oe&&0==+Ue&&"+"!==N&&(Oe=!1),st=(Oe?"("===N?N:d:"-"===N||"("===N?"":N)+st,Fe=("s"===fe?dF[8+aF/3]:"")+Fe+(Oe&&"("===N?")":""),Ke)for(le=-1,de=Ue.length;++le(pe=Ue.charCodeAt(le))||pe>57){Fe=(46===pe?i+Ue.slice(le+1):Ue.slice(le))+Fe,Ue=Ue.slice(0,le);break}}ne&&!U&&(Ue=t(Ue,1/0));var Ye=st.length+Ue.length+Fe.length,Ze=Ye>1)+st+Ue+Fe+Ze.slice(Ye);break;default:Ue=Ze+st+Ue+Fe}return o(Ue)}return X=void 0===X?6:/[gprs]/.test(fe)?Math.max(1,Math.min(21,X)):Math.max(0,Math.min(20,X)),lt.toString=function(){return D+""},lt}return{format:v,formatPrefix:function E(D,I){var P=v(((D=$y(D)).type="f",D)),N=3*Math.max(-8,Math.min(8,Math.floor(cm(I)/3))),G=Math.pow(10,-N),U=dF[8+N/3];return function(Z){return P(G*Z)+U}}}}(e),um=ub.format,fF=ub.formatPrefix}({thousands:",",grouping:[3],currency:["$",""]});var hn=1e-6,Dn=Math.PI,ei=Dn/2,mF=Dn/4,Qs=2*Dn,as=180/Dn,ti=Dn/180,fr=Math.abs,hm=Math.atan,yu=Math.atan2,xn=Math.cos,gF=(Math,Math.exp),hb=(Math,Math,Math.log),ZE=Math.pow,sn=Math.sin,Ma=Math.sign||function(e){return e>0?1:e<0?-1:0},ks=Math.sqrt,WE=Math.tan;function yF(e){return e>1?0:e<-1?Dn:Math.acos(e)}function Ia(e){return e>1?ei:e<-1?-ei:Math.asin(e)}function Ta(){}function _F(){var t,e=[];return{point:function(n,r,i){t.push([n,r,i])},lineStart:function(){e.push(t=[])},lineEnd:Ta,rejoin:function(){e.length>1&&e.push(e.pop().concat(e.shift()))},result:function(){var n=e;return e=[],t=null,n}}}function db(e,t){return fr(e[0]-t[0])=0;--d)i.point((D=E[d])[0],D[1]);else r(I.x,I.p.x,-1,i);I=I.p}E=(I=I.o).z,P=!P}while(!I.v);i.lineEnd()}}}function bF(e){if(t=e.length){for(var t,i,n=0,r=e[0];++n0)do{I.point(0===P||3===P?e:n,P>1?r:t)}while((P=(P+D+4)%4)!==N);else I.point(E[0],E[1])}function c(v,E){return fr(v[0]-e)0?0:3:fr(v[0]-n)0?2:1:fr(v[1]-t)0?1:0:E>0?3:2}function d(v,E){return p(v.x,E.x)}function p(v,E){var D=c(v,1),I=c(E,1);return D!==I?D-I:0===D?E[1]-v[1]:1===D?v[0]-E[0]:2===D?v[1]-E[1]:E[0]-v[0]}return function(v){var I,P,N,G,U,Z,ne,X,re,fe,ve,E=v,D=_F(),Re={point:We,lineStart:function st(){Re.point=le,P&&P.push(N=[]),fe=!0,re=!1,ne=X=NaN},lineEnd:function Fe(){I&&(le(G,U),Z&&re&&D.rejoin(),I.push(D.result())),Re.point=We,re&&E.lineEnd()},polygonStart:function lt(){E=D,I=[],P=[],ve=!0},polygonEnd:function Ue(){var de=function Ke(){for(var de=0,pe=0,Oe=P.length;per&&(jn-Ft)*(r-ir)>(pr-ir)*(e-Ft)&&++de:pr<=r&&(jn-Ft)*(r-ir)<(pr-ir)*(e-Ft)&&--de;return de}(),pe=ve&&de,Oe=(I=xF(I)).length;(pe||Oe)&&(v.polygonStart(),pe&&(v.lineStart(),o(null,null,1,v),v.lineEnd()),Oe&&vF(I,d,de,o,v),v.polygonEnd()),E=v,I=P=N=null}};function We(de,pe){i(de,pe)&&E.point(de,pe)}function le(de,pe){var Oe=i(de,pe);if(P&&N.push([de,pe]),fe)G=de,U=pe,Z=Oe,fe=!1,Oe&&(E.lineStart(),E.point(de,pe));else if(Oe&&re)E.point(de,pe);else{var Ye=[ne=Math.max(pb,Math.min(jy,ne)),X=Math.max(pb,Math.min(jy,X))],Ze=[de=Math.max(pb,Math.min(jy,de)),pe=Math.max(pb,Math.min(jy,pe))];!function BX(e,t,n,r,i,o){var N,c=e[0],d=e[1],E=0,D=1,I=t[0]-c,P=t[1]-d;if(N=n-c,I||!(N>0)){if(N/=I,I<0){if(N0){if(N>D)return;N>E&&(E=N)}if(N=i-c,I||!(N<0)){if(N/=I,I<0){if(N>D)return;N>E&&(E=N)}else if(I>0){if(N0)){if(N/=P,P<0){if(N0){if(N>D)return;N>E&&(E=N)}if(N=o-d,P||!(N<0)){if(N/=P,P<0){if(N>D)return;N>E&&(E=N)}else if(P>0){if(N0&&(e[0]=c+E*I,e[1]=d+E*P),D<1&&(t[0]=c+D*I,t[1]=d+D*P),!0}}}}}(Ye,Ze,e,t,n,r)?Oe&&(E.lineStart(),E.point(de,pe),ve=!1):(re||(E.lineStart(),E.point(Ye[0],Ye[1])),E.point(Ze[0],Ze[1]),Oe||E.lineEnd(),ve=!1)}ne=de,X=pe,re=Oe}return Re}}const XE=e=>e;function mb(e,t){e&&EF.hasOwnProperty(e.type)&&EF[e.type](e,t)}var CF={Feature:function(e,t){mb(e.geometry,t)},FeatureCollection:function(e,t){for(var n=e.features,r=-1,i=n.length;++r0){for(c=t[--n];n>0&&(r=c,i=t[--n],c=r+i,o=i-(c-r),!o););n>0&&(o<0&&t[n-1]<0||o>0&&t[n-1]>0)&&(i=2*o,r=c+i,i==r-c&&(c=r))}return c}}var SF,MF,QE,eD,KE=new _u,JE=new _u,Fh={point:Ta,lineStart:Ta,lineEnd:Ta,polygonStart:function(){Fh.lineStart=UX,Fh.lineEnd=jX},polygonEnd:function(){Fh.lineStart=Fh.lineEnd=Fh.point=Ta,KE.add(fr(JE)),JE=new _u},result:function(){var e=KE/2;return KE=new _u,e}};function UX(){Fh.point=$X}function $X(e,t){Fh.point=IF,SF=QE=e,MF=eD=t}function IF(e,t){JE.add(eD*e-QE*t),QE=e,eD=t}function jX(){IF(SF,MF)}const TF=Fh;var fm=1/0,gb=fm,Hy=-fm,yb=Hy;const _b={point:function GX(e,t){eHy&&(Hy=e),tyb&&(yb=t)},lineStart:Ta,lineEnd:Ta,polygonStart:Ta,polygonEnd:Ta,result:function(){var e=[[fm,gb],[Hy,yb]];return Hy=yb=-(gb=fm=1/0),e}};var AF,kF,vc,bc,tD=0,nD=0,Gy=0,vb=0,bb=0,pm=0,rD=0,iD=0,qy=0,El={point:_f,lineStart:PF,lineEnd:RF,polygonStart:function(){El.lineStart=WX,El.lineEnd=XX},polygonEnd:function(){El.point=_f,El.lineStart=PF,El.lineEnd=RF},result:function(){var e=qy?[rD/qy,iD/qy]:pm?[vb/pm,bb/pm]:Gy?[tD/Gy,nD/Gy]:[NaN,NaN];return tD=nD=Gy=vb=bb=pm=rD=iD=qy=0,e}};function _f(e,t){tD+=e,nD+=t,++Gy}function PF(){El.point=qX}function qX(e,t){El.point=ZX,_f(vc=e,bc=t)}function ZX(e,t){var n=e-vc,r=t-bc,i=ks(n*n+r*r);vb+=i*(vc+e)/2,bb+=i*(bc+t)/2,pm+=i,_f(vc=e,bc=t)}function RF(){El.point=_f}function WX(){El.point=YX}function XX(){FF(AF,kF)}function YX(e,t){El.point=FF,_f(AF=vc=e,kF=bc=t)}function FF(e,t){var n=e-vc,r=t-bc,i=ks(n*n+r*r);vb+=i*(vc+e)/2,bb+=i*(bc+t)/2,pm+=i,rD+=(i=bc*e-vc*t)*(vc+e),iD+=i*(bc+t),qy+=3*i,_f(vc=e,bc=t)}const OF=El;function LF(e){this._context=e}LF.prototype={_radius:4.5,pointRadius:function(e){return this._radius=e,this},polygonStart:function(){this._line=0},polygonEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){0===this._line&&this._context.closePath(),this._point=NaN},point:function(e,t){switch(this._point){case 0:this._context.moveTo(e,t),this._point=1;break;case 1:this._context.lineTo(e,t);break;default:this._context.moveTo(e+this._radius,t),this._context.arc(e,t,this._radius,0,Qs)}},result:Ta};var sD,NF,zF,Zy,Wy,oD=new _u,xb={point:Ta,lineStart:function(){xb.point=KX},lineEnd:function(){sD&&BF(NF,zF),xb.point=Ta},polygonStart:function(){sD=!0},polygonEnd:function(){sD=null},result:function(){var e=+oD;return oD=new _u,e}};function KX(e,t){xb.point=BF,NF=Zy=e,zF=Wy=t}function BF(e,t){oD.add(ks((Zy-=e)*Zy+(Wy-=t)*Wy)),Zy=e,Wy=t}const VF=xb;let UF,wb,$F,jF;class HF{constructor(t){this._append=null==t?GF:function JX(e){const t=Math.floor(e);if(!(t>=0))throw new RangeError(`invalid digits: ${e}`);if(t>15)return GF;if(t!==UF){const n=10**t;UF=t,wb=function(i){let o=1;this._+=i[0];for(const c=i.length;o=0))throw new RangeError(`invalid digits: ${d}`);n=p}return null===t&&(o=new HF(n)),c},c.projection(e).digits(n).context(t)}function lD(e){return[yu(e[1],e[0]),Ia(e[2])]}function mm(e){var t=e[0],n=e[1],r=xn(n);return[r*xn(t),r*sn(t),sn(n)]}function Cb(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]}function Eb(e,t){return[e[1]*t[2]-e[2]*t[1],e[2]*t[0]-e[0]*t[2],e[0]*t[1]-e[1]*t[0]]}function cD(e,t){e[0]+=t[0],e[1]+=t[1],e[2]+=t[2]}function Db(e,t){return[e[0]*t,e[1]*t,e[2]*t]}function uD(e){var t=ks(e[0]*e[0]+e[1]*e[1]+e[2]*e[2]);e[0]/=t,e[1]/=t,e[2]/=t}function hD(e){return fr(e[0])<=Dn?e[0]:Ma(e[0])*((fr(e[0])+Dn)%Qs-Dn)}function qF(e,t,n,r){return function(i){var v,E,D,o=t(i),c=_F(),d=t(c),p=!1,I={point:P,lineStart:G,lineEnd:U,polygonStart:function(){I.point=Z,I.lineStart=ne,I.lineEnd=X,E=[],v=[]},polygonEnd:function(){I.point=P,I.lineStart=G,I.lineEnd=U,E=xF(E);var re=function QX(e,t){var n=hD(t),r=t[1],i=sn(r),o=[sn(n),-xn(n),0],c=0,d=0,p=new _u;1===i?r=ei+hn:-1===i&&(r=-ei-hn);for(var v=0,E=e.length;v=0?1:-1,lt=Ke*We,Ue=lt>Dn,st=U*ve;if(p.add(yu(st*Ke*sn(lt),Z*Re+st*xn(lt))),c+=Ue?We+Ke*Qs:We,Ue^N>=n^re>=n){var Fe=Eb(mm(P),mm(X));uD(Fe);var le=Eb(o,Fe);uD(le);var de=(Ue^We>=0?-1:1)*Ia(le[2]);(r>de||r===de&&(Fe[0]||Fe[1]))&&(d+=Ue^We>=0?1:-1)}}return(c<-hn||c0){for(p||(i.polygonStart(),p=!0),i.lineStart(),ve=0;ve1&&2&re&&fe.push(fe.pop().concat(fe.shift())),E.push(fe.filter(eY))}}return I}}function eY(e){return e.length>1}function tY(e,t){return((e=e.x)[0]<0?e[1]-ei-hn:ei-e[1])-((t=t.x)[0]<0?t[1]-ei-hn:ei-t[1])}const ZF=qF(function(){return!0},function nY(e){var i,t=NaN,n=NaN,r=NaN;return{lineStart:function(){e.lineStart(),i=1},point:function(o,c){var d=o>0?Dn:-Dn,p=fr(o-t);fr(p-Dn)0?ei:-ei),e.point(r,n),e.lineEnd(),e.lineStart(),e.point(d,n),e.point(o,n),i=0):r!==d&&p>=Dn&&(fr(t-r)hn?hm((sn(t)*(o=xn(r))*sn(n)-sn(r)*(i=xn(t))*sn(e))/(i*o*c)):(t+r)/2}(t,n,o,c),e.point(r,n),e.lineEnd(),e.lineStart(),e.point(d,n),i=0),e.point(t=o,n=c),r=d},lineEnd:function(){e.lineEnd(),t=n=NaN},clean:function(){return 2-i}}},function iY(e,t,n,r){var i;if(null==e)r.point(-Dn,i=n*ei),r.point(0,i),r.point(Dn,i),r.point(Dn,0),r.point(Dn,-i),r.point(0,-i),r.point(-Dn,-i),r.point(-Dn,0),r.point(-Dn,i);else if(fr(e[0]-t[0])>hn){var o=e[0]0,i=fr(t)>hn;function c(E,D){return xn(E)*xn(D)>t}function p(E,D,I){var G=[1,0,0],U=Eb(mm(E),mm(D)),Z=Cb(U,U),ne=U[0],X=Z-ne*ne;if(!X)return!I&&E;var re=t*Z/X,fe=-t*ne/X,ve=Eb(G,U),Re=Db(G,re);cD(Re,Db(U,fe));var Ke=ve,lt=Cb(Re,Ke),Ue=Cb(Ke,Ke),st=lt*lt-Ue*(Cb(Re,Re)-1);if(!(st<0)){var Fe=ks(st),le=Db(Ke,(-lt-Fe)/Ue);if(cD(le,Re),le=lD(le),!I)return le;var Ze,de=E[0],pe=D[0],Oe=E[1],Ye=D[1];pe0^le[1]<(fr(le[0]-de)Dn^(de<=le[0]&&le[0]<=pe)){var ir=Db(Ke,(-lt+Fe)/Ue);return cD(ir,Re),[le,lD(ir)]}}}function v(E,D){var I=r?e:Dn-e,P=0;return E<-I?P|=1:E>I&&(P|=2),D<-I?P|=4:D>I&&(P|=8),P}return qF(c,function d(E){var D,I,P,N,G;return{lineStart:function(){N=P=!1,G=1},point:function(U,Z){var X,ne=[U,Z],re=c(U,Z),fe=r?re?0:v(U,Z):re?v(U+(U<0?Dn:-Dn),Z):0;if(!D&&(N=P=re)&&E.lineStart(),re!==P&&(!(X=p(D,ne))||db(D,X)||db(ne,X))&&(ne[2]=1),re!==P)G=0,re?(E.lineStart(),X=p(ne,D),E.point(X[0],X[1])):(X=p(D,ne),E.point(X[0],X[1],2),E.lineEnd()),D=X;else if(i&&D&&r^re){var ve;!(fe&I)&&(ve=p(ne,D,!0))&&(G=0,r?(E.lineStart(),E.point(ve[0][0],ve[0][1]),E.point(ve[1][0],ve[1][1]),E.lineEnd()):(E.point(ve[1][0],ve[1][1]),E.lineEnd(),E.lineStart(),E.point(ve[0][0],ve[0][1],3)))}re&&(!D||!db(D,ne))&&E.point(ne[0],ne[1]),D=ne,P=re,I=fe},lineEnd:function(){P&&E.lineEnd(),D=null},clean:function(){return G|(N&&P)<<1}}},function o(E,D,I,P){!function WF(e,t,n,r,i,o){if(n){var c=xn(t),d=sn(t),p=r*n;null==i?(i=t+r*Qs,o=t-p/2):(i=XF(c,i),o=XF(c,o),(r>0?io)&&(i+=r*Qs));for(var v,E=i;r>0?E>o:EDn&&(e-=Math.round(e/Qs)*Qs),[e,t]}function YF(e,t,n){return(e%=Qs)?t||n?dD(JF(e),QF(t,n)):JF(e):t||n?QF(t,n):fD}function KF(e){return function(t,n){return fr(t+=e)>Dn&&(t-=Math.round(t/Qs)*Qs),[t,n]}}function JF(e){var t=KF(e);return t.invert=KF(-e),t}function QF(e,t){var n=xn(e),r=sn(e),i=xn(t),o=sn(t);function c(d,p){var v=xn(p),E=xn(d)*v,D=sn(d)*v,I=sn(p),P=I*n+E*r;return[yu(D*i-P*o,E*n-I*r),Ia(P*i+D*o)]}return c.invert=function(d,p){var v=xn(p),E=xn(d)*v,D=sn(d)*v,I=sn(p),P=I*i-D*o;return[yu(D*i+I*o,E*n+P*r),Ia(P*n-E*r)]},c}function pD(e){return{stream:Sb(e)}}function Sb(e){return function(t){var n=new mD;for(var r in e)n[r]=e[r];return n.stream=t,n}}function mD(){}function gD(e,t,n){var r=e.clipExtent&&e.clipExtent();return e.scale(150).translate([0,0]),null!=r&&e.clipExtent(null),dm(n,e.stream(_b)),t(_b.result()),null!=r&&e.clipExtent(r),e}function yD(e,t,n){return gD(e,function(r){var i=t[1][0]-t[0][0],o=t[1][1]-t[0][1],c=Math.min(i/(r[1][0]-r[0][0]),o/(r[1][1]-r[0][1])),d=+t[0][0]+(i-c*(r[1][0]+r[0][0]))/2,p=+t[0][1]+(o-c*(r[1][1]+r[0][1]))/2;e.scale(150*c).translate([d,p])},n)}function eO(e,t,n){return yD(e,[[0,0],t],n)}function tO(e,t,n){return gD(e,function(r){var i=+t,o=i/(r[1][0]-r[0][0]),c=(i-o*(r[1][0]+r[0][0]))/2,d=-o*r[0][1];e.scale(150*o).translate([c,d])},n)}function nO(e,t,n){return gD(e,function(r){var i=+t,o=i/(r[1][1]-r[0][1]),c=-o*r[0][0],d=(i-o*(r[1][1]+r[0][1]))/2;e.scale(150*o).translate([c,d])},n)}fD.invert=fD,mD.prototype={constructor:mD,point:function(e,t){this.stream.point(e,t)},sphere:function(){this.stream.sphere()},lineStart:function(){this.stream.lineStart()},lineEnd:function(){this.stream.lineEnd()},polygonStart:function(){this.stream.polygonStart()},polygonEnd:function(){this.stream.polygonEnd()}};var aY=xn(30*ti);function iO(e,t){return+t?function cY(e,t){function n(r,i,o,c,d,p,v,E,D,I,P,N,G,U){var Z=v-r,ne=E-i,X=Z*Z+ne*ne;if(X>4*t&&G--){var re=c+I,fe=d+P,ve=p+N,Re=ks(re*re+fe*fe+ve*ve),We=Ia(ve/=Re),Ke=fr(fr(ve)-1)t||fr((Z*Fe+ne*le)/X-.5)>.3||c*I+d*P+p*N2?de[2]%360*ti:0,Fe()):[d*as,p*as,v*as]},Ue.angle=function(de){return arguments.length?(D=de%360*ti,Fe()):D*as},Ue.reflectX=function(de){return arguments.length?(I=de?-1:1,Fe()):I<0},Ue.reflectY=function(de){return arguments.length?(P=de?-1:1,Fe()):P<0},Ue.precision=function(de){return arguments.length?(ve=iO(Re,fe=de*de),le()):ks(fe)},Ue.fitExtent=function(de,pe){return yD(Ue,de,pe)},Ue.fitSize=function(de,pe){return eO(Ue,de,pe)},Ue.fitWidth=function(de,pe){return tO(Ue,de,pe)},Ue.fitHeight=function(de,pe){return nO(Ue,de,pe)},function(){return t=e.apply(this,arguments),Ue.invert=t.invert&&st,Fe()}}function _D(e){var t=0,n=Dn/3,r=sO(e),i=r(t,n);return i.parallels=function(o){return arguments.length?r(t=o[0]*ti,n=o[1]*ti):[t*as,n*as]},i}function pY(e,t){var n=sn(e),r=(n+sn(t))/2;if(fr(r)=.12&&U<.234&&G>=-.425&&G<-.214?i:U>=.166&&U<.234&&G>=-.214&&G<-.115?c:n).invert(I)},E.stream=function(I){return e&&t===I?e:e=function mY(e){var t=e.length;return{point:function(n,r){for(var i=-1;++i2?e[2]*ti:0),t.invert=function(n){return(n=e.invert(n[0]*ti,n[1]*ti))[0]*=as,n[1]*=as,n},t}(t.rotate()).invert([0,0]));return o(null==c?[[I[0]-D,I[1]-D],[I[0]+D,I[1]+D]]:e===Ib?[[Math.max(I[0]-D,c),d],[Math.min(I[0]+D,p),v]]:[[c,Math.max(I[1]-D,d)],[p,Math.min(I[1]+D,v)]])}return t.scale=function(D){return arguments.length?(r(D),E()):r()},t.translate=function(D){return arguments.length?(i(D),E()):i()},t.center=function(D){return arguments.length?(n(D),E()):n()},t.clipExtent=function(D){return arguments.length?(null==D?c=d=p=v=null:(c=+D[0][0],d=+D[0][1],p=+D[1][0],v=+D[1][1]),E()):null==c?null:[[c,d],[p,v]]},E()}function Tb(e){return WE((ei+e)/2)}function bY(e,t){var n=xn(e),r=e===t?sn(e):hb(n/xn(t))/hb(Tb(t)/Tb(e)),i=n*ZE(Tb(e),r)/r;if(!r)return Ib;function o(c,d){i>0?d<-ei+hn&&(d=-ei+hn):d>ei-hn&&(d=ei-hn);var p=i/ZE(Tb(d),r);return[p*sn(r*c),i-p*xn(r*c)]}return o.invert=function(c,d){var p=i-d,v=Ma(r)*ks(c*c+p*p),E=yu(c,fr(p))*Ma(p);return p*r<0&&(E-=Dn*Ma(c)*Ma(p)),[E/r,2*hm(ZE(i/v,1/r))-ei]},o}function xY(){return _D(bY).scale(109.5).parallels([30,30])}function Ab(e,t){return[e,t]}function wY(){return Oh(Ab).scale(152.63)}function CY(e,t){var n=xn(e),r=e===t?sn(e):(n-xn(t))/(t-e),i=n/r+e;if(fr(r)2?r[2]+90:90]):[(r=n())[0],r[1],r[2]-90]},n([0,0,90]).scale(159.155)}function vD(e,t){return e=+e,t=+t,function(n){return Math.round(e*(1-n)+t*n)}}function yO(e){return function(t,n){var r=e((t=NE(t)).h,(n=NE(n)).h),i=Qi(t.s,n.s),o=Qi(t.l,n.l),c=Qi(t.opacity,n.opacity);return function(d){return t.h=r(d),t.s=i(d),t.l=o(d),t.opacity=c(d),t+""}}}dO.invert=function(e,t){for(var c,n=t,r=n*n,i=r*r*r,o=0;o<12&&(i=(r=(n-=c=(n*(Yy+Ky*r+i*(Jy+Qy*r))-t)/(Yy+3*Ky*r+i*(7*Jy+9*Qy*r)))*n)*r*r,!(fr(c)<1e-12));++o);return[kb*e*(Yy+3*Ky*r+i*(7*Jy+9*Qy*r))/xn(n),Ia(sn(n)/kb)]},fO.invert=Xy(hm),pO.invert=Xy(Ia),mO.invert=Xy(function(e){return 2*hm(e)}),gO.invert=function(e,t){return[-t,2*hm(gF(e))-ei]};const kY=yO(BE);yO(Qi);const _O=Math.PI/180,vO=180/Math.PI,CO=4/29,gm=6/29,EO=3*gm*gm;function DO(e){if(e instanceof Dl)return new Dl(e.l,e.a,e.b,e.opacity);if(e instanceof xc)return MO(e);e instanceof Ji||(e=LE(e));var o,c,t=ED(e.r),n=ED(e.g),r=ED(e.b),i=xD((.2225045*t+.7168786*n+.0606169*r)/1);return t===n&&n===r?o=c=i:(o=xD((.4360747*t+.3850649*n+.1430804*r)/.96422),c=xD((.0139322*t+.0971045*n+.7141733*r)/.82521)),new Dl(116*i-16,500*(o-i),200*(i-c),e.opacity)}function bD(e,t,n,r){return 1===arguments.length?DO(e):new Dl(e,t,n,r??1)}function Dl(e,t,n,r){this.l=+e,this.a=+t,this.b=+n,this.opacity=+r}function xD(e){return e>.008856451679035631?Math.pow(e,1/3):e/EO+CO}function wD(e){return e>gm?e*e*e:EO*(e-CO)}function CD(e){return 255*(e<=.0031308?12.92*e:1.055*Math.pow(e,1/2.4)-.055)}function ED(e){return(e/=255)<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4)}function SO(e){if(e instanceof xc)return new xc(e.h,e.c,e.l,e.opacity);if(e instanceof Dl||(e=DO(e)),0===e.a&&0===e.b)return new xc(NaN,0=0))throw new Error(`invalid digits: ${e}`);if(t>15)return AO;const n=10**t;return function(r){this._+=r[0];for(let i=1,o=r.length;ivf)if(Math.abs(D*p-v*E)>vf&&o){let P=r-c,N=i-d,G=p*p+v*v,U=P*P+N*N,Z=Math.sqrt(G),ne=Math.sqrt(I),X=o*Math.tan((MD-Math.acos((G+I-U)/(2*Z*ne)))/2),re=X/ne,fe=X/Z;Math.abs(re-1)>vf&&this._append`L${t+re*E},${n+re*D}`,this._append`A${o},${o},0,0,${+(D*P>E*N)},${this._x1=t+fe*p},${this._y1=n+fe*v}`}else this._append`L${this._x1=t},${this._y1=n}`}arc(t,n,r,i,o,c){if(t=+t,n=+n,c=!!c,(r=+r)<0)throw new Error(`negative radius: ${r}`);let d=r*Math.cos(i),p=r*Math.sin(i),v=t+d,E=n+p,D=1^c,I=c?i-o:o-i;null===this._x1?this._append`M${v},${E}`:(Math.abs(this._x1-v)>vf||Math.abs(this._y1-E)>vf)&&this._append`L${v},${E}`,r&&(I<0&&(I=I%ID+ID),I>BY?this._append`A${r},${r},0,1,${D},${t-d},${n-p}A${r},${r},0,1,${D},${this._x1=v},${this._y1=E}`:I>vf&&this._append`A${r},${r},0,${+(I>=MD)},${D},${this._x1=t+r*Math.cos(o)},${this._y1=n+r*Math.sin(o)}`)}rect(t,n,r,i){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+n}h${r=+r}v${+i}h${-r}Z`}toString(){return this._}}function bf(e=3){return new Rb(+e)}function wc(e,t){switch(arguments.length){case 0:break;case 1:this.range(e);break;default:this.range(t).domain(e)}return this}function Fb(e,t){switch(arguments.length){case 0:break;case 1:"function"==typeof e?this.interpolator(e):this.range(e);break;default:this.domain(e),"function"==typeof t?this.interpolator(t):this.range(t)}return this}const TD=Symbol("implicit");function AD(){var e=new L0,t=[],n=[],r=TD;function i(o){let c=e.get(o);if(void 0===c){if(r!==TD)return r;e.set(o,c=t.push(o)-1)}return n[c%n.length]}return i.domain=function(o){if(!arguments.length)return t.slice();t=[],e=new L0;for(const c of o)e.has(c)||e.set(c,t.push(c)-1);return i},i.range=function(o){return arguments.length?(n=Array.from(o),i):n.slice()},i.unknown=function(o){return arguments.length?(r=o,i):r},i.copy=function(){return AD(t,n).unknown(r)},wc.apply(i,arguments),i}function Ob(){var o,c,e=AD().unknown(void 0),t=e.domain,n=e.range,r=0,i=1,d=!1,p=0,v=0,E=.5;function D(){var I=t().length,P=i>>1;n(d[D],p)<0?v=D+1:E=D}while(vxl(e(d),p),r=(d,p)=>e(d)-p):(t=e===xl||e===Ty?e:jY,n=e,r=e),{left:i,center:function c(d,p,v=0,E=d.length){const D=i(d,p,v,E-1);return D>v&&r(d[D-1],p)>-r(d[D],p)?D-1:D},right:function o(d,p,v=0,E=d.length){if(v>>1;n(d[D],p)<=0?v=D+1:E=D}while(vt&&(n=e,e=t,t=n),function(r){return Math.max(e,Math.min(t,r))}}(e[0],e[I-1])),d=I>2?WY:ZY,p=v=null,D}function D(I){return null==I||isNaN(I=+I)?o:(p||(p=d(e.map(r),t,n)))(r(c(I)))}return D.invert=function(I){return c(i((v||(v=d(t,e.map(r),Uo)))(I)))},D.domain=function(I){return arguments.length?(e=Array.from(I,RD),E()):e.slice()},D.range=function(I){return arguments.length?(t=Array.from(I),E()):t.slice()},D.rangeRound=function(I){return t=Array.from(I),n=vD,E()},D.clamp=function(I){return arguments.length?(c=!!I||Aa,E()):c!==Aa},D.interpolate=function(I){return arguments.length?(n=I,E()):n},D.unknown=function(I){return arguments.length?(o=I,D):o},function(I,P){return r=I,i=P,E()}}function FO(){return Lb()(Aa,Aa)}function n_(e){var t=e.domain;return e.ticks=function(n){var r=t();return U0(r[0],r[r.length-1],n??10)},e.tickFormat=function(n,r){var i=t();return function JY(e,t,n,r){var o,i=CE(e,t,n);switch((r=$y(r??",f")).type){case"s":var c=Math.max(Math.abs(e),Math.abs(t));return null==r.precision&&!isNaN(o=function XY(e,t){return Math.max(0,3*Math.max(-8,Math.min(8,Math.floor(cm(t)/3)))-cm(Math.abs(e)))}(i,c))&&(r.precision=o),fF(r,c);case"":case"e":case"g":case"p":case"r":null==r.precision&&!isNaN(o=function YY(e,t){return e=Math.abs(e),t=Math.abs(t)-e,Math.max(0,cm(t)-cm(e))+1}(i,Math.max(Math.abs(e),Math.abs(t))))&&(r.precision=o-("e"===r.type));break;case"f":case"%":null==r.precision&&!isNaN(o=function KY(e){return Math.max(0,-cm(Math.abs(e)))}(i))&&(r.precision=o-2*("%"===r.type))}return um(r)}(i[0],i[i.length-1],n??10,r)},e.nice=function(n){null==n&&(n=10);var p,v,r=t(),i=0,o=r.length-1,c=r[i],d=r[o],E=10;for(d0;){if((v=wE(c,d,n))===p)return r[i]=c,r[o]=d,t(r);if(v>0)c=Math.floor(c/v)*v,d=Math.ceil(d/v)*v;else{if(!(v<0))break;c=Math.ceil(c*v)/v,d=Math.floor(d*v)/v}p=v}return e},e}function OD(){var e=FO();return e.copy=function(){return t_(e,OD())},wc.apply(e,arguments),n_(e)}function OO(e){var t;function n(r){return null==r||isNaN(r=+r)?t:r}return n.invert=n,n.domain=n.range=function(r){return arguments.length?(e=Array.from(r,RD),n):e.slice()},n.unknown=function(r){return arguments.length?(t=r,n):t},n.copy=function(){return OO(e).unknown(t)},e=arguments.length?Array.from(e,RD):[0,1],n_(n)}function LO(e,t){var c,n=0,r=(e=e.slice()).length-1,i=e[n],o=e[r];return o-e(-t,n)}function VO(e){const t=e(NO,zO),n=t.domain;let i,o,r=10;function c(){return i=function rK(e){return e===Math.E?Math.log:10===e&&Math.log10||2===e&&Math.log2||(e=Math.log(e),t=>Math.log(t)/e)}(r),o=function nK(e){return 10===e?tK:e===Math.E?Math.exp:t=>Math.pow(e,t)}(r),n()[0]<0?(i=BO(i),o=BO(o),e(QY,eK)):e(NO,zO),t}return t.base=function(d){return arguments.length?(r=+d,c()):r},t.domain=function(d){return arguments.length?(n(d),c()):n()},t.ticks=d=>{const p=n();let v=p[0],E=p[p.length-1];const D=E0){for(;I<=P;++I)for(N=1;NE)break;Z.push(G)}}else for(;I<=P;++I)for(N=r-1;N>=1;--N)if(G=I>0?N/o(-I):N*o(I),!(GE)break;Z.push(G)}2*Z.length{if(null==d&&(d=10),null==p&&(p=10===r?"s":","),"function"!=typeof p&&(!(r%1)&&null==(p=$y(p)).precision&&(p.trim=!0),p=um(p)),d===1/0)return p;const v=Math.max(1,r*d/t.ticks().length);return E=>{let D=E/o(Math.round(i(E)));return D*rn(LO(n(),{floor:d=>o(Math.floor(i(d))),ceil:d=>o(Math.ceil(i(d)))})),t}function UO(){const e=VO(Lb()).domain([1,10]);return e.copy=()=>t_(e,UO()).base(e.base()),wc.apply(e,arguments),e}function $O(e){return function(t){return Math.sign(t)*Math.log1p(Math.abs(t/e))}}function jO(e){return function(t){return Math.sign(t)*Math.expm1(Math.abs(t))*e}}function HO(e){var t=1,n=e($O(t),jO(t));return n.constant=function(r){return arguments.length?e($O(t=+r),jO(t)):t},n_(n)}function GO(){var e=HO(Lb());return e.copy=function(){return t_(e,GO()).constant(e.constant())},wc.apply(e,arguments)}function qO(e){return function(t){return t<0?-Math.pow(-t,e):Math.pow(t,e)}}function iK(e){return e<0?-Math.sqrt(-e):Math.sqrt(e)}function oK(e){return e<0?-e*e:e*e}function ZO(e){var t=e(Aa,Aa),n=1;function r(){return 1===n?e(Aa,Aa):.5===n?e(iK,oK):e(qO(n),qO(1/n))}return t.exponent=function(i){return arguments.length?(n=+i,r()):n},n_(t)}function LD(){var e=ZO(Lb());return e.copy=function(){return t_(e,LD()).exponent(e.exponent())},wc.apply(e,arguments),e}function WO(){var r,e=[],t=[],n=[];function i(){var c=0,d=Math.max(1,t.length);for(n=new Array(d-1);++c0?n[d-1]:e[0],d(e(o=new Date(+o)),o),i.ceil=o=>(e(o=new Date(o-1)),t(o,1),e(o),o),i.round=o=>{const c=i(o),d=i.ceil(o);return o-c(t(o=new Date(+o),null==c?1:Math.floor(c)),o),i.range=(o,c,d)=>{const p=[];if(o=i.ceil(o),d=null==d?1:Math.floor(d),!(o0))return p;let v;do{p.push(v=new Date(+o)),t(o,d),e(o)}while(vOi(c=>{if(c>=c)for(;e(c),!o(c);)c.setTime(c-1)},(c,d)=>{if(c>=c)if(d<0)for(;++d<=0;)for(;t(c,-1),!o(c););else for(;--d>=0;)for(;t(c,1),!o(c););}),n&&(i.count=(o,c)=>(BD.setTime(+o),VD.setTime(+c),e(BD),e(VD),Math.floor(n(BD,VD))),i.every=o=>(o=Math.floor(o),isFinite(o)&&o>0?o>1?i.filter(r?c=>r(c)%o==0:c=>i.count(0,c)%o==0):i:null)),i}const Nb=Oi(()=>{},(e,t)=>{e.setTime(+e+t)},(e,t)=>t-e);Nb.every=e=>(e=Math.floor(e),isFinite(e)&&e>0?e>1?Oi(t=>{t.setTime(Math.floor(t/e)*e)},(t,n)=>{t.setTime(+t+n*e)},(t,n)=>(n-t)/e):Nb:null);const wu=Oi(e=>{e.setTime(e-e.getMilliseconds())},(e,t)=>{e.setTime(+e+t*vu)},(e,t)=>(t-e)/vu,e=>e.getUTCSeconds()),zb=Oi(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*vu)},(e,t)=>{e.setTime(+e+t*ka)},(e,t)=>(t-e)/ka,e=>e.getMinutes()),Bb=Oi(e=>{e.setUTCSeconds(0,0)},(e,t)=>{e.setTime(+e+t*ka)},(e,t)=>(t-e)/ka,e=>e.getUTCMinutes()),Vb=Oi(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*vu-e.getMinutes()*ka)},(e,t)=>{e.setTime(+e+t*bu)},(e,t)=>(t-e)/bu,e=>e.getHours()),Ub=Oi(e=>{e.setUTCMinutes(0,0,0)},(e,t)=>{e.setTime(+e+t*bu)},(e,t)=>(t-e)/bu,e=>e.getUTCHours()),ym=Oi(e=>e.setHours(0,0,0,0),(e,t)=>e.setDate(e.getDate()+t),(e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*ka)/xu,e=>e.getDate()-1),r_=Oi(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/xu,e=>e.getUTCDate()-1),KO=Oi(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/xu,e=>Math.floor(e/xu));function xf(e){return Oi(t=>{t.setDate(t.getDate()-(t.getDay()+7-e)%7),t.setHours(0,0,0,0)},(t,n)=>{t.setDate(t.getDate()+7*n)},(t,n)=>(n-t-(n.getTimezoneOffset()-t.getTimezoneOffset())*ka)/ND)}const _m=xf(0),i_=xf(1),JO=xf(2),QO=xf(3),wf=xf(4),eL=xf(5),tL=xf(6);function Cf(e){return Oi(t=>{t.setUTCDate(t.getUTCDate()-(t.getUTCDay()+7-e)%7),t.setUTCHours(0,0,0,0)},(t,n)=>{t.setUTCDate(t.getUTCDate()+7*n)},(t,n)=>(n-t)/ND)}const vm=Cf(0),o_=Cf(1),nL=Cf(2),rL=Cf(3),Ef=Cf(4),iL=Cf(5),oL=Cf(6),bm=Oi(e=>{e.setDate(1),e.setHours(0,0,0,0)},(e,t)=>{e.setMonth(e.getMonth()+t)},(e,t)=>t.getMonth()-e.getMonth()+12*(t.getFullYear()-e.getFullYear()),e=>e.getMonth()),xm=Oi(e=>{e.setUTCDate(1),e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCMonth(e.getUTCMonth()+t)},(e,t)=>t.getUTCMonth()-e.getUTCMonth()+12*(t.getUTCFullYear()-e.getUTCFullYear()),e=>e.getUTCMonth()),Cc=Oi(e=>{e.setMonth(0,1),e.setHours(0,0,0,0)},(e,t)=>{e.setFullYear(e.getFullYear()+t)},(e,t)=>t.getFullYear()-e.getFullYear(),e=>e.getFullYear());Cc.every=e=>isFinite(e=Math.floor(e))&&e>0?Oi(t=>{t.setFullYear(Math.floor(t.getFullYear()/e)*e),t.setMonth(0,1),t.setHours(0,0,0,0)},(t,n)=>{t.setFullYear(t.getFullYear()+n*e)}):null;const Ec=Oi(e=>{e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCFullYear(e.getUTCFullYear()+t)},(e,t)=>t.getUTCFullYear()-e.getUTCFullYear(),e=>e.getUTCFullYear());function sL(e,t,n,r,i,o){const c=[[wu,1,vu],[wu,5,5e3],[wu,15,15e3],[wu,30,3e4],[o,1,ka],[o,5,5*ka],[o,15,15*ka],[o,30,30*ka],[i,1,bu],[i,3,3*bu],[i,6,6*bu],[i,12,12*bu],[r,1,xu],[r,2,2*xu],[n,1,ND],[t,1,YO],[t,3,3*YO],[e,1,zD]];function p(v,E,D){const I=Math.abs(E-v)/D,P=kD(([,,U])=>U).right(c,I);if(P===c.length)return e.every(CE(v/zD,E/zD,D));if(0===P)return Nb.every(Math.max(CE(v,E,D),1));const[N,G]=c[I/c[P-1][2]isFinite(e=Math.floor(e))&&e>0?Oi(t=>{t.setUTCFullYear(Math.floor(t.getUTCFullYear()/e)*e),t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)},(t,n)=>{t.setUTCFullYear(t.getUTCFullYear()+n*e)}):null;const[sK,aK]=sL(Ec,xm,vm,KO,Ub,Bb),[lK,cK]=sL(Cc,bm,_m,ym,Vb,zb);function UD(e){if(0<=e.y&&e.y<100){var t=new Date(-1,e.m,e.d,e.H,e.M,e.S,e.L);return t.setFullYear(e.y),t}return new Date(e.y,e.m,e.d,e.H,e.M,e.S,e.L)}function $D(e){if(0<=e.y&&e.y<100){var t=new Date(Date.UTC(-1,e.m,e.d,e.H,e.M,e.S,e.L));return t.setUTCFullYear(e.y),t}return new Date(Date.UTC(e.y,e.m,e.d,e.H,e.M,e.S,e.L))}function s_(e,t,n){return{y:e,m:t,d:n,H:0,M:0,S:0,L:0}}var wm,$b,jb,aL={"-":"",_:" ",0:"0"},eo=/^\s*\d+/,hK=/^%/,dK=/[\\^$*+?|[\]().{}]/g;function Zn(e,t,n){var r=e<0?"-":"",i=(r?-e:e)+"",o=i.length;return r+(o[t.toLowerCase(),n]))}function pK(e,t,n){var r=eo.exec(t.slice(n,n+1));return r?(e.w=+r[0],n+r[0].length):-1}function mK(e,t,n){var r=eo.exec(t.slice(n,n+1));return r?(e.u=+r[0],n+r[0].length):-1}function gK(e,t,n){var r=eo.exec(t.slice(n,n+2));return r?(e.U=+r[0],n+r[0].length):-1}function yK(e,t,n){var r=eo.exec(t.slice(n,n+2));return r?(e.V=+r[0],n+r[0].length):-1}function _K(e,t,n){var r=eo.exec(t.slice(n,n+2));return r?(e.W=+r[0],n+r[0].length):-1}function lL(e,t,n){var r=eo.exec(t.slice(n,n+4));return r?(e.y=+r[0],n+r[0].length):-1}function cL(e,t,n){var r=eo.exec(t.slice(n,n+2));return r?(e.y=+r[0]+(+r[0]>68?1900:2e3),n+r[0].length):-1}function vK(e,t,n){var r=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(t.slice(n,n+6));return r?(e.Z=r[1]?0:-(r[2]+(r[3]||"00")),n+r[0].length):-1}function bK(e,t,n){var r=eo.exec(t.slice(n,n+1));return r?(e.q=3*r[0]-3,n+r[0].length):-1}function xK(e,t,n){var r=eo.exec(t.slice(n,n+2));return r?(e.m=r[0]-1,n+r[0].length):-1}function uL(e,t,n){var r=eo.exec(t.slice(n,n+2));return r?(e.d=+r[0],n+r[0].length):-1}function wK(e,t,n){var r=eo.exec(t.slice(n,n+3));return r?(e.m=0,e.d=+r[0],n+r[0].length):-1}function hL(e,t,n){var r=eo.exec(t.slice(n,n+2));return r?(e.H=+r[0],n+r[0].length):-1}function CK(e,t,n){var r=eo.exec(t.slice(n,n+2));return r?(e.M=+r[0],n+r[0].length):-1}function EK(e,t,n){var r=eo.exec(t.slice(n,n+2));return r?(e.S=+r[0],n+r[0].length):-1}function DK(e,t,n){var r=eo.exec(t.slice(n,n+3));return r?(e.L=+r[0],n+r[0].length):-1}function SK(e,t,n){var r=eo.exec(t.slice(n,n+6));return r?(e.L=Math.floor(r[0]/1e3),n+r[0].length):-1}function MK(e,t,n){var r=hK.exec(t.slice(n,n+1));return r?n+r[0].length:-1}function IK(e,t,n){var r=eo.exec(t.slice(n));return r?(e.Q=+r[0],n+r[0].length):-1}function TK(e,t,n){var r=eo.exec(t.slice(n));return r?(e.s=+r[0],n+r[0].length):-1}function dL(e,t){return Zn(e.getDate(),t,2)}function AK(e,t){return Zn(e.getHours(),t,2)}function kK(e,t){return Zn(e.getHours()%12||12,t,2)}function PK(e,t){return Zn(1+ym.count(Cc(e),e),t,3)}function fL(e,t){return Zn(e.getMilliseconds(),t,3)}function RK(e,t){return fL(e,t)+"000"}function FK(e,t){return Zn(e.getMonth()+1,t,2)}function OK(e,t){return Zn(e.getMinutes(),t,2)}function LK(e,t){return Zn(e.getSeconds(),t,2)}function NK(e){var t=e.getDay();return 0===t?7:t}function zK(e,t){return Zn(_m.count(Cc(e)-1,e),t,2)}function pL(e){var t=e.getDay();return t>=4||0===t?wf(e):wf.ceil(e)}function BK(e,t){return e=pL(e),Zn(wf.count(Cc(e),e)+(4===Cc(e).getDay()),t,2)}function VK(e){return e.getDay()}function UK(e,t){return Zn(i_.count(Cc(e)-1,e),t,2)}function $K(e,t){return Zn(e.getFullYear()%100,t,2)}function jK(e,t){return Zn((e=pL(e)).getFullYear()%100,t,2)}function HK(e,t){return Zn(e.getFullYear()%1e4,t,4)}function GK(e,t){var n=e.getDay();return Zn((e=n>=4||0===n?wf(e):wf.ceil(e)).getFullYear()%1e4,t,4)}function qK(e){var t=e.getTimezoneOffset();return(t>0?"-":(t*=-1,"+"))+Zn(t/60|0,"0",2)+Zn(t%60,"0",2)}function mL(e,t){return Zn(e.getUTCDate(),t,2)}function ZK(e,t){return Zn(e.getUTCHours(),t,2)}function WK(e,t){return Zn(e.getUTCHours()%12||12,t,2)}function XK(e,t){return Zn(1+r_.count(Ec(e),e),t,3)}function gL(e,t){return Zn(e.getUTCMilliseconds(),t,3)}function YK(e,t){return gL(e,t)+"000"}function KK(e,t){return Zn(e.getUTCMonth()+1,t,2)}function JK(e,t){return Zn(e.getUTCMinutes(),t,2)}function QK(e,t){return Zn(e.getUTCSeconds(),t,2)}function eJ(e){var t=e.getUTCDay();return 0===t?7:t}function tJ(e,t){return Zn(vm.count(Ec(e)-1,e),t,2)}function yL(e){var t=e.getUTCDay();return t>=4||0===t?Ef(e):Ef.ceil(e)}function nJ(e,t){return e=yL(e),Zn(Ef.count(Ec(e),e)+(4===Ec(e).getUTCDay()),t,2)}function rJ(e){return e.getUTCDay()}function iJ(e,t){return Zn(o_.count(Ec(e)-1,e),t,2)}function oJ(e,t){return Zn(e.getUTCFullYear()%100,t,2)}function sJ(e,t){return Zn((e=yL(e)).getUTCFullYear()%100,t,2)}function aJ(e,t){return Zn(e.getUTCFullYear()%1e4,t,4)}function lJ(e,t){var n=e.getUTCDay();return Zn((e=n>=4||0===n?Ef(e):Ef.ceil(e)).getUTCFullYear()%1e4,t,4)}function cJ(){return"+0000"}function _L(){return"%"}function vL(e){return+e}function bL(e){return Math.floor(+e/1e3)}function fJ(e){return new Date(e)}function pJ(e){return e instanceof Date?+e:+new Date(+e)}function jD(e,t,n,r,i,o,c,d,p,v){var E=FO(),D=E.invert,I=E.domain,P=v(".%L"),N=v(":%S"),G=v("%I:%M"),U=v("%I %p"),Z=v("%a %d"),ne=v("%b %d"),X=v("%B"),re=v("%Y");function fe(ve){return(p(ve)=12)]},q:function Ft(bt){return 1+~~(bt.getMonth()/3)},Q:vL,s:bL,S:LK,u:NK,U:zK,V:BK,w:VK,W:UK,x:null,X:null,y:$K,Y:HK,Z:qK,"%":_L},re={a:function ir(bt){return c[bt.getUTCDay()]},A:function jn(bt){return o[bt.getUTCDay()]},b:function pr(bt){return p[bt.getUTCMonth()]},B:function xi(bt){return d[bt.getUTCMonth()]},c:null,d:mL,e:mL,f:YK,g:sJ,G:lJ,H:ZK,I:WK,j:XK,L:gL,m:KK,M:JK,p:function Wn(bt){return i[+(bt.getUTCHours()>=12)]},q:function zr(bt){return 1+~~(bt.getUTCMonth()/3)},Q:vL,s:bL,S:QK,u:eJ,U:tJ,V:nJ,w:rJ,W:iJ,x:null,X:null,y:oJ,Y:aJ,Z:cJ,"%":_L},fe={a:function lt(bt,Kt,Pn){var Je=P.exec(Kt.slice(Pn));return Je?(bt.w=N.get(Je[0].toLowerCase()),Pn+Je[0].length):-1},A:function Ue(bt,Kt,Pn){var Je=D.exec(Kt.slice(Pn));return Je?(bt.w=I.get(Je[0].toLowerCase()),Pn+Je[0].length):-1},b:function st(bt,Kt,Pn){var Je=Z.exec(Kt.slice(Pn));return Je?(bt.m=ne.get(Je[0].toLowerCase()),Pn+Je[0].length):-1},B:function Fe(bt,Kt,Pn){var Je=G.exec(Kt.slice(Pn));return Je?(bt.m=U.get(Je[0].toLowerCase()),Pn+Je[0].length):-1},c:function le(bt,Kt,Pn){return We(bt,t,Kt,Pn)},d:uL,e:uL,f:SK,g:cL,G:lL,H:hL,I:hL,j:wK,L:DK,m:xK,M:CK,p:function Ke(bt,Kt,Pn){var Je=v.exec(Kt.slice(Pn));return Je?(bt.p=E.get(Je[0].toLowerCase()),Pn+Je[0].length):-1},q:bK,Q:IK,s:TK,S:EK,u:mK,U:gK,V:yK,w:pK,W:_K,x:function de(bt,Kt,Pn){return We(bt,n,Kt,Pn)},X:function pe(bt,Kt,Pn){return We(bt,r,Kt,Pn)},y:cL,Y:lL,Z:vK,"%":MK};function ve(bt,Kt){return function(Pn){var So,qt,ri,Je=[],Br=-1,Jn=0,Gr=bt.length;for(Pn instanceof Date||(Pn=new Date(+Pn));++Br53)return null;"w"in Je||(Je.w=1),"Z"in Je?(Gr=(Jn=$D(s_(Je.y,0,1))).getUTCDay(),Jn=Gr>4||0===Gr?o_.ceil(Jn):o_(Jn),Jn=r_.offset(Jn,7*(Je.V-1)),Je.y=Jn.getUTCFullYear(),Je.m=Jn.getUTCMonth(),Je.d=Jn.getUTCDate()+(Je.w+6)%7):(Gr=(Jn=UD(s_(Je.y,0,1))).getDay(),Jn=Gr>4||0===Gr?i_.ceil(Jn):i_(Jn),Jn=ym.offset(Jn,7*(Je.V-1)),Je.y=Jn.getFullYear(),Je.m=Jn.getMonth(),Je.d=Jn.getDate()+(Je.w+6)%7)}else("W"in Je||"U"in Je)&&("w"in Je||(Je.w="u"in Je?Je.u%7:"W"in Je?1:0),Gr="Z"in Je?$D(s_(Je.y,0,1)).getUTCDay():UD(s_(Je.y,0,1)).getDay(),Je.m=0,Je.d="W"in Je?(Je.w+6)%7+7*Je.W-(Gr+5)%7:Je.w+7*Je.U-(Gr+6)%7);return"Z"in Je?(Je.H+=Je.Z/100|0,Je.M+=Je.Z%100,$D(Je)):UD(Je)}}function We(bt,Kt,Pn,Je){for(var So,qt,Br=0,Jn=Kt.length,Gr=Pn.length;Br=Gr)return-1;if(37===(So=Kt.charCodeAt(Br++))){if(So=Kt.charAt(Br++),!(qt=fe[So in aL?Kt.charAt(Br++):So])||(Je=qt(bt,Pn,Je))<0)return-1}else if(So!=Pn.charCodeAt(Je++))return-1}return Je}return X.x=ve(n,X),X.X=ve(r,X),X.c=ve(t,X),re.x=ve(n,re),re.X=ve(r,re),re.c=ve(t,re),{format:function(bt){var Kt=ve(bt+="",X);return Kt.toString=function(){return bt},Kt},parse:function(bt){var Kt=Re(bt+="",!1);return Kt.toString=function(){return bt},Kt},utcFormat:function(bt){var Kt=ve(bt+="",re);return Kt.toString=function(){return bt},Kt},utcParse:function(bt){var Kt=Re(bt+="",!0);return Kt.toString=function(){return bt},Kt}}}(e),$b=wm.format,jb=wm.utcFormat}({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]});const bJ=dn("1f77b4ff7f0e2ca02cd627289467bd8c564be377c27f7f7fbcbd2217becf"),xJ=dn("7fc97fbeaed4fdc086ffff99386cb0f0027fbf5b17666666"),wJ=dn("1b9e77d95f027570b3e7298a66a61ee6ab02a6761d666666"),CJ=dn("a6cee31f78b4b2df8a33a02cfb9a99e31a1cfdbf6fff7f00cab2d66a3d9affff99b15928"),EJ=dn("fbb4aeb3cde3ccebc5decbe4fed9a6ffffcce5d8bdfddaecf2f2f2"),DJ=dn("b3e2cdfdcdaccbd5e8f4cae4e6f5c9fff2aef1e2cccccccc"),SJ=dn("e41a1c377eb84daf4a984ea3ff7f00ffff33a65628f781bf999999"),MJ=dn("66c2a5fc8d628da0cbe78ac3a6d854ffd92fe5c494b3b3b3"),IJ=dn("8dd3c7ffffb3bebadafb807280b1d3fdb462b3de69fccde5d9d9d9bc80bdccebc5ffed6f"),TJ=dn("4e79a7f28e2ce1575976b7b259a14fedc949af7aa1ff9da79c755fbab0ab"),wr=e=>bW(e[e.length-1]);var DL=new Array(3).concat("d8b365f5f5f55ab4ac","a6611adfc27d80cdc1018571","a6611adfc27df5f5f580cdc1018571","8c510ad8b365f6e8c3c7eae55ab4ac01665e","8c510ad8b365f6e8c3f5f5f5c7eae55ab4ac01665e","8c510abf812ddfc27df6e8c3c7eae580cdc135978f01665e","8c510abf812ddfc27df6e8c3f5f5f5c7eae580cdc135978f01665e","5430058c510abf812ddfc27df6e8c3c7eae580cdc135978f01665e003c30","5430058c510abf812ddfc27df6e8c3f5f5f5c7eae580cdc135978f01665e003c30").map(dn);const SL=wr(DL);var ML=new Array(3).concat("af8dc3f7f7f77fbf7b","7b3294c2a5cfa6dba0008837","7b3294c2a5cff7f7f7a6dba0008837","762a83af8dc3e7d4e8d9f0d37fbf7b1b7837","762a83af8dc3e7d4e8f7f7f7d9f0d37fbf7b1b7837","762a839970abc2a5cfe7d4e8d9f0d3a6dba05aae611b7837","762a839970abc2a5cfe7d4e8f7f7f7d9f0d3a6dba05aae611b7837","40004b762a839970abc2a5cfe7d4e8d9f0d3a6dba05aae611b783700441b","40004b762a839970abc2a5cfe7d4e8f7f7f7d9f0d3a6dba05aae611b783700441b").map(dn);const IL=wr(ML);var TL=new Array(3).concat("e9a3c9f7f7f7a1d76a","d01c8bf1b6dab8e1864dac26","d01c8bf1b6daf7f7f7b8e1864dac26","c51b7de9a3c9fde0efe6f5d0a1d76a4d9221","c51b7de9a3c9fde0eff7f7f7e6f5d0a1d76a4d9221","c51b7dde77aef1b6dafde0efe6f5d0b8e1867fbc414d9221","c51b7dde77aef1b6dafde0eff7f7f7e6f5d0b8e1867fbc414d9221","8e0152c51b7dde77aef1b6dafde0efe6f5d0b8e1867fbc414d9221276419","8e0152c51b7dde77aef1b6dafde0eff7f7f7e6f5d0b8e1867fbc414d9221276419").map(dn);const AL=wr(TL);var kL=new Array(3).concat("998ec3f7f7f7f1a340","5e3c99b2abd2fdb863e66101","5e3c99b2abd2f7f7f7fdb863e66101","542788998ec3d8daebfee0b6f1a340b35806","542788998ec3d8daebf7f7f7fee0b6f1a340b35806","5427888073acb2abd2d8daebfee0b6fdb863e08214b35806","5427888073acb2abd2d8daebf7f7f7fee0b6fdb863e08214b35806","2d004b5427888073acb2abd2d8daebfee0b6fdb863e08214b358067f3b08","2d004b5427888073acb2abd2d8daebf7f7f7fee0b6fdb863e08214b358067f3b08").map(dn);const PL=wr(kL);var GD=new Array(3).concat("ef8a62f7f7f767a9cf","ca0020f4a58292c5de0571b0","ca0020f4a582f7f7f792c5de0571b0","b2182bef8a62fddbc7d1e5f067a9cf2166ac","b2182bef8a62fddbc7f7f7f7d1e5f067a9cf2166ac","b2182bd6604df4a582fddbc7d1e5f092c5de4393c32166ac","b2182bd6604df4a582fddbc7f7f7f7d1e5f092c5de4393c32166ac","67001fb2182bd6604df4a582fddbc7d1e5f092c5de4393c32166ac053061","67001fb2182bd6604df4a582fddbc7f7f7f7d1e5f092c5de4393c32166ac053061").map(dn);const qb=wr(GD);var RL=new Array(3).concat("ef8a62ffffff999999","ca0020f4a582bababa404040","ca0020f4a582ffffffbababa404040","b2182bef8a62fddbc7e0e0e09999994d4d4d","b2182bef8a62fddbc7ffffffe0e0e09999994d4d4d","b2182bd6604df4a582fddbc7e0e0e0bababa8787874d4d4d","b2182bd6604df4a582fddbc7ffffffe0e0e0bababa8787874d4d4d","67001fb2182bd6604df4a582fddbc7e0e0e0bababa8787874d4d4d1a1a1a","67001fb2182bd6604df4a582fddbc7ffffffe0e0e0bababa8787874d4d4d1a1a1a").map(dn);const FL=wr(RL);var qD=new Array(3).concat("fc8d59ffffbf91bfdb","d7191cfdae61abd9e92c7bb6","d7191cfdae61ffffbfabd9e92c7bb6","d73027fc8d59fee090e0f3f891bfdb4575b4","d73027fc8d59fee090ffffbfe0f3f891bfdb4575b4","d73027f46d43fdae61fee090e0f3f8abd9e974add14575b4","d73027f46d43fdae61fee090ffffbfe0f3f8abd9e974add14575b4","a50026d73027f46d43fdae61fee090e0f3f8abd9e974add14575b4313695","a50026d73027f46d43fdae61fee090ffffbfe0f3f8abd9e974add14575b4313695").map(dn);const Zb=wr(qD);var OL=new Array(3).concat("fc8d59ffffbf91cf60","d7191cfdae61a6d96a1a9641","d7191cfdae61ffffbfa6d96a1a9641","d73027fc8d59fee08bd9ef8b91cf601a9850","d73027fc8d59fee08bffffbfd9ef8b91cf601a9850","d73027f46d43fdae61fee08bd9ef8ba6d96a66bd631a9850","d73027f46d43fdae61fee08bffffbfd9ef8ba6d96a66bd631a9850","a50026d73027f46d43fdae61fee08bd9ef8ba6d96a66bd631a9850006837","a50026d73027f46d43fdae61fee08bffffbfd9ef8ba6d96a66bd631a9850006837").map(dn);const LL=wr(OL);var NL=new Array(3).concat("fc8d59ffffbf99d594","d7191cfdae61abdda42b83ba","d7191cfdae61ffffbfabdda42b83ba","d53e4ffc8d59fee08be6f59899d5943288bd","d53e4ffc8d59fee08bffffbfe6f59899d5943288bd","d53e4ff46d43fdae61fee08be6f598abdda466c2a53288bd","d53e4ff46d43fdae61fee08bffffbfe6f598abdda466c2a53288bd","9e0142d53e4ff46d43fdae61fee08be6f598abdda466c2a53288bd5e4fa2","9e0142d53e4ff46d43fdae61fee08bffffbfe6f598abdda466c2a53288bd5e4fa2").map(dn);const zL=wr(NL);var BL=new Array(3).concat("e5f5f999d8c92ca25f","edf8fbb2e2e266c2a4238b45","edf8fbb2e2e266c2a42ca25f006d2c","edf8fbccece699d8c966c2a42ca25f006d2c","edf8fbccece699d8c966c2a441ae76238b45005824","f7fcfde5f5f9ccece699d8c966c2a441ae76238b45005824","f7fcfde5f5f9ccece699d8c966c2a441ae76238b45006d2c00441b").map(dn);const VL=wr(BL);var UL=new Array(3).concat("e0ecf49ebcda8856a7","edf8fbb3cde38c96c688419d","edf8fbb3cde38c96c68856a7810f7c","edf8fbbfd3e69ebcda8c96c68856a7810f7c","edf8fbbfd3e69ebcda8c96c68c6bb188419d6e016b","f7fcfde0ecf4bfd3e69ebcda8c96c68c6bb188419d6e016b","f7fcfde0ecf4bfd3e69ebcda8c96c68c6bb188419d810f7c4d004b").map(dn);const $L=wr(UL);var jL=new Array(3).concat("e0f3dba8ddb543a2ca","f0f9e8bae4bc7bccc42b8cbe","f0f9e8bae4bc7bccc443a2ca0868ac","f0f9e8ccebc5a8ddb57bccc443a2ca0868ac","f0f9e8ccebc5a8ddb57bccc44eb3d32b8cbe08589e","f7fcf0e0f3dbccebc5a8ddb57bccc44eb3d32b8cbe08589e","f7fcf0e0f3dbccebc5a8ddb57bccc44eb3d32b8cbe0868ac084081").map(dn);const HL=wr(jL);var GL=new Array(3).concat("fee8c8fdbb84e34a33","fef0d9fdcc8afc8d59d7301f","fef0d9fdcc8afc8d59e34a33b30000","fef0d9fdd49efdbb84fc8d59e34a33b30000","fef0d9fdd49efdbb84fc8d59ef6548d7301f990000","fff7ecfee8c8fdd49efdbb84fc8d59ef6548d7301f990000","fff7ecfee8c8fdd49efdbb84fc8d59ef6548d7301fb300007f0000").map(dn);const qL=wr(GL);var ZL=new Array(3).concat("ece2f0a6bddb1c9099","f6eff7bdc9e167a9cf02818a","f6eff7bdc9e167a9cf1c9099016c59","f6eff7d0d1e6a6bddb67a9cf1c9099016c59","f6eff7d0d1e6a6bddb67a9cf3690c002818a016450","fff7fbece2f0d0d1e6a6bddb67a9cf3690c002818a016450","fff7fbece2f0d0d1e6a6bddb67a9cf3690c002818a016c59014636").map(dn);const WL=wr(ZL);var XL=new Array(3).concat("ece7f2a6bddb2b8cbe","f1eef6bdc9e174a9cf0570b0","f1eef6bdc9e174a9cf2b8cbe045a8d","f1eef6d0d1e6a6bddb74a9cf2b8cbe045a8d","f1eef6d0d1e6a6bddb74a9cf3690c00570b0034e7b","fff7fbece7f2d0d1e6a6bddb74a9cf3690c00570b0034e7b","fff7fbece7f2d0d1e6a6bddb74a9cf3690c00570b0045a8d023858").map(dn);const YL=wr(XL);var KL=new Array(3).concat("e7e1efc994c7dd1c77","f1eef6d7b5d8df65b0ce1256","f1eef6d7b5d8df65b0dd1c77980043","f1eef6d4b9dac994c7df65b0dd1c77980043","f1eef6d4b9dac994c7df65b0e7298ace125691003f","f7f4f9e7e1efd4b9dac994c7df65b0e7298ace125691003f","f7f4f9e7e1efd4b9dac994c7df65b0e7298ace125698004367001f").map(dn);const JL=wr(KL);var QL=new Array(3).concat("fde0ddfa9fb5c51b8a","feebe2fbb4b9f768a1ae017e","feebe2fbb4b9f768a1c51b8a7a0177","feebe2fcc5c0fa9fb5f768a1c51b8a7a0177","feebe2fcc5c0fa9fb5f768a1dd3497ae017e7a0177","fff7f3fde0ddfcc5c0fa9fb5f768a1dd3497ae017e7a0177","fff7f3fde0ddfcc5c0fa9fb5f768a1dd3497ae017e7a017749006a").map(dn);const e3=wr(QL);var t3=new Array(3).concat("edf8b17fcdbb2c7fb8","ffffcca1dab441b6c4225ea8","ffffcca1dab441b6c42c7fb8253494","ffffccc7e9b47fcdbb41b6c42c7fb8253494","ffffccc7e9b47fcdbb41b6c41d91c0225ea80c2c84","ffffd9edf8b1c7e9b47fcdbb41b6c41d91c0225ea80c2c84","ffffd9edf8b1c7e9b47fcdbb41b6c41d91c0225ea8253494081d58").map(dn);const n3=wr(t3);var r3=new Array(3).concat("f7fcb9addd8e31a354","ffffccc2e69978c679238443","ffffccc2e69978c67931a354006837","ffffccd9f0a3addd8e78c67931a354006837","ffffccd9f0a3addd8e78c67941ab5d238443005a32","ffffe5f7fcb9d9f0a3addd8e78c67941ab5d238443005a32","ffffe5f7fcb9d9f0a3addd8e78c67941ab5d238443006837004529").map(dn);const i3=wr(r3);var o3=new Array(3).concat("fff7bcfec44fd95f0e","ffffd4fed98efe9929cc4c02","ffffd4fed98efe9929d95f0e993404","ffffd4fee391fec44ffe9929d95f0e993404","ffffd4fee391fec44ffe9929ec7014cc4c028c2d04","ffffe5fff7bcfee391fec44ffe9929ec7014cc4c028c2d04","ffffe5fff7bcfee391fec44ffe9929ec7014cc4c02993404662506").map(dn);const s3=wr(o3);var a3=new Array(3).concat("ffeda0feb24cf03b20","ffffb2fecc5cfd8d3ce31a1c","ffffb2fecc5cfd8d3cf03b20bd0026","ffffb2fed976feb24cfd8d3cf03b20bd0026","ffffb2fed976feb24cfd8d3cfc4e2ae31a1cb10026","ffffccffeda0fed976feb24cfd8d3cfc4e2ae31a1cb10026","ffffccffeda0fed976feb24cfd8d3cfc4e2ae31a1cbd0026800026").map(dn);const l3=wr(a3);var c3=new Array(3).concat("deebf79ecae13182bd","eff3ffbdd7e76baed62171b5","eff3ffbdd7e76baed63182bd08519c","eff3ffc6dbef9ecae16baed63182bd08519c","eff3ffc6dbef9ecae16baed64292c62171b5084594","f7fbffdeebf7c6dbef9ecae16baed64292c62171b5084594","f7fbffdeebf7c6dbef9ecae16baed64292c62171b508519c08306b").map(dn);const u3=wr(c3);var h3=new Array(3).concat("e5f5e0a1d99b31a354","edf8e9bae4b374c476238b45","edf8e9bae4b374c47631a354006d2c","edf8e9c7e9c0a1d99b74c47631a354006d2c","edf8e9c7e9c0a1d99b74c47641ab5d238b45005a32","f7fcf5e5f5e0c7e9c0a1d99b74c47641ab5d238b45005a32","f7fcf5e5f5e0c7e9c0a1d99b74c47641ab5d238b45006d2c00441b").map(dn);const d3=wr(h3);var f3=new Array(3).concat("f0f0f0bdbdbd636363","f7f7f7cccccc969696525252","f7f7f7cccccc969696636363252525","f7f7f7d9d9d9bdbdbd969696636363252525","f7f7f7d9d9d9bdbdbd969696737373525252252525","fffffff0f0f0d9d9d9bdbdbd969696737373525252252525","fffffff0f0f0d9d9d9bdbdbd969696737373525252252525000000").map(dn);const p3=wr(f3);var m3=new Array(3).concat("efedf5bcbddc756bb1","f2f0f7cbc9e29e9ac86a51a3","f2f0f7cbc9e29e9ac8756bb154278f","f2f0f7dadaebbcbddc9e9ac8756bb154278f","f2f0f7dadaebbcbddc9e9ac8807dba6a51a34a1486","fcfbfdefedf5dadaebbcbddc9e9ac8807dba6a51a34a1486","fcfbfdefedf5dadaebbcbddc9e9ac8807dba6a51a354278f3f007d").map(dn);const g3=wr(m3);var y3=new Array(3).concat("fee0d2fc9272de2d26","fee5d9fcae91fb6a4acb181d","fee5d9fcae91fb6a4ade2d26a50f15","fee5d9fcbba1fc9272fb6a4ade2d26a50f15","fee5d9fcbba1fc9272fb6a4aef3b2ccb181d99000d","fff5f0fee0d2fcbba1fc9272fb6a4aef3b2ccb181d99000d","fff5f0fee0d2fcbba1fc9272fb6a4aef3b2ccb181da50f1567000d").map(dn);const _3=wr(y3);var v3=new Array(3).concat("fee6cefdae6be6550d","feeddefdbe85fd8d3cd94701","feeddefdbe85fd8d3ce6550da63603","feeddefdd0a2fdae6bfd8d3ce6550da63603","feeddefdd0a2fdae6bfd8d3cf16913d948018c2d04","fff5ebfee6cefdd0a2fdae6bfd8d3cf16913d948018c2d04","fff5ebfee6cefdd0a2fdae6bfd8d3cf16913d94801a636037f2704").map(dn);const b3=wr(v3);function x3(e){return e=Math.max(0,Math.min(1,e)),"rgb("+Math.max(0,Math.min(255,Math.round(-4.54-e*(35.34-e*(2381.73-e*(6402.7-e*(7024.72-2710.57*e)))))))+", "+Math.max(0,Math.min(255,Math.round(32.49+e*(170.73+e*(52.82-e*(131.46-e*(176.58-67.37*e)))))))+", "+Math.max(0,Math.min(255,Math.round(81.24+e*(442.36-e*(2482.43-e*(6167.24-e*(6614.94-2475.67*e)))))))+")"}var ZD=1.78277,WD=-.29227,Wb=-.90649,c_=1.97294,C3=c_*Wb,E3=c_*ZD,D3=ZD*WD- -.14861*Wb;function AJ(e){if(e instanceof Df)return new Df(e.h,e.s,e.l,e.opacity);e instanceof Ji||(e=LE(e));var n=e.g/255,r=e.b/255,i=(D3*r+C3*(e.r/255)-E3*n)/(D3+C3-E3),o=r-i,c=(c_*(n-i)-WD*o)/Wb,d=Math.sqrt(c*c+o*o)/(c_*i*(1-i)),p=d?Math.atan2(c,o)*vO-120:NaN;return new Df(p<0?p+360:p,d,i,e.opacity)}function Dc(e,t,n,r){return 1===arguments.length?AJ(e):new Df(e,t,n,r??1)}function Df(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}function S3(e){return function t(n){function r(i,o){var c=e((i=Dc(i)).h,(o=Dc(o)).h),d=Qi(i.s,o.s),p=Qi(i.l,o.l),v=Qi(i.opacity,o.opacity);return function(E){return i.h=c(E),i.s=d(E),i.l=p(Math.pow(E,n)),i.opacity=v(E),i+""}}return n=+n,r.gamma=t,r}(1)}im(Df,Dc,By(kh,{brighter(e){return e=null==e?om:Math.pow(om,e),new Df(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=null==e?.7:Math.pow(.7,e),new Df(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=isNaN(this.h)?0:(this.h+120)*_O,t=+this.l,n=isNaN(this.s)?0:this.s*t*(1-t),r=Math.cos(e),i=Math.sin(e);return new Ji(255*(t+n*(-.14861*r+ZD*i)),255*(t+n*(WD*r+Wb*i)),255*(t+n*(c_*r)),this.opacity)}})),S3(BE);var XD=S3(Qi);const M3=XD(Dc(300,.5,0),Dc(-240,.5,1));var I3=XD(Dc(-100,.75,.35),Dc(80,1.5,.8)),T3=XD(Dc(260,.75,.35),Dc(80,1.5,.8)),Xb=Dc();function A3(e){(e<0||e>1)&&(e-=Math.floor(e));var t=Math.abs(e-.5);return Xb.h=360*e-100,Xb.s=1.5-1.5*t,Xb.l=.8-.9*t,Xb+""}var Yb=Rh(),kJ=Math.PI/3,PJ=2*Math.PI/3;function k3(e){var t;return e=(.5-e)*Math.PI,Yb.r=255*(t=Math.sin(e))*t,Yb.g=255*(t=Math.sin(e+kJ))*t,Yb.b=255*(t=Math.sin(e+PJ))*t,Yb+""}function P3(e){return e=Math.max(0,Math.min(1,e)),"rgb("+Math.max(0,Math.min(255,Math.round(34.61+e*(1172.33-e*(10793.56-e*(33300.12-e*(38394.49-14825.05*e)))))))+", "+Math.max(0,Math.min(255,Math.round(23.31+e*(557.33+e*(1225.33-e*(3574.96-e*(1073.77+707.56*e)))))))+", "+Math.max(0,Math.min(255,Math.round(27.2+e*(3211.1-e*(15327.97-e*(27814-e*(22569.18-6838.66*e)))))))+")"}function Kb(e){var t=e.length;return function(n){return e[Math.max(0,Math.min(t-1,Math.floor(n*t)))]}}const R3=Kb(dn("44015444025645045745055946075a46085c460a5d460b5e470d60470e6147106347116447136548146748166848176948186a481a6c481b6d481c6e481d6f481f70482071482173482374482475482576482677482878482979472a7a472c7a472d7b472e7c472f7d46307e46327e46337f463480453581453781453882443983443a83443b84433d84433e85423f854240864241864142874144874045884046883f47883f48893e49893e4a893e4c8a3d4d8a3d4e8a3c4f8a3c508b3b518b3b528b3a538b3a548c39558c39568c38588c38598c375a8c375b8d365c8d365d8d355e8d355f8d34608d34618d33628d33638d32648e32658e31668e31678e31688e30698e306a8e2f6b8e2f6c8e2e6d8e2e6e8e2e6f8e2d708e2d718e2c718e2c728e2c738e2b748e2b758e2a768e2a778e2a788e29798e297a8e297b8e287c8e287d8e277e8e277f8e27808e26818e26828e26828e25838e25848e25858e24868e24878e23888e23898e238a8d228b8d228c8d228d8d218e8d218f8d21908d21918c20928c20928c20938c1f948c1f958b1f968b1f978b1f988b1f998a1f9a8a1e9b8a1e9c891e9d891f9e891f9f881fa0881fa1881fa1871fa28720a38620a48621a58521a68522a78522a88423a98324aa8325ab8225ac8226ad8127ad8128ae8029af7f2ab07f2cb17e2db27d2eb37c2fb47c31b57b32b67a34b67935b77937b87838b9773aba763bbb753dbc743fbc7340bd7242be7144bf7046c06f48c16e4ac16d4cc26c4ec36b50c46a52c56954c56856c66758c7655ac8645cc8635ec96260ca6063cb5f65cb5e67cc5c69cd5b6ccd5a6ece5870cf5773d05675d05477d1537ad1517cd2507fd34e81d34d84d44b86d54989d5488bd6468ed64590d74393d74195d84098d83e9bd93c9dd93ba0da39a2da37a5db36a8db34aadc32addc30b0dd2fb2dd2db5de2bb8de29bade28bddf26c0df25c2df23c5e021c8e020cae11fcde11dd0e11cd2e21bd5e21ad8e219dae319dde318dfe318e2e418e5e419e7e419eae51aece51befe51cf1e51df4e61ef6e620f8e621fbe723fde725"));var F3=Kb(dn("00000401000501010601010802010902020b02020d03030f03031204041405041606051806051a07061c08071e0907200a08220b09240c09260d0a290e0b2b100b2d110c2f120d31130d34140e36150e38160f3b180f3d19103f1a10421c10441d11471e114920114b21114e22115024125325125527125829115a2a115c2c115f2d11612f116331116533106734106936106b38106c390f6e3b0f703d0f713f0f72400f74420f75440f764510774710784910784a10794c117a4e117b4f127b51127c52137c54137d56147d57157e59157e5a167e5c167f5d177f5f187f601880621980641a80651a80671b80681c816a1c816b1d816d1d816e1e81701f81721f817320817521817621817822817922827b23827c23827e24828025828125818326818426818627818827818928818b29818c29818e2a81902a81912b81932b80942c80962c80982d80992d809b2e7f9c2e7f9e2f7fa02f7fa1307ea3307ea5317ea6317da8327daa337dab337cad347cae347bb0357bb2357bb3367ab5367ab73779b83779ba3878bc3978bd3977bf3a77c03a76c23b75c43c75c53c74c73d73c83e73ca3e72cc3f71cd4071cf4070d0416fd2426fd3436ed5446dd6456cd8456cd9466bdb476adc4869de4968df4a68e04c67e24d66e34e65e44f64e55064e75263e85362e95462ea5661eb5760ec5860ed5a5fee5b5eef5d5ef05f5ef1605df2625df2645cf3655cf4675cf4695cf56b5cf66c5cf66e5cf7705cf7725cf8745cf8765cf9785df9795df97b5dfa7d5efa7f5efa815ffb835ffb8560fb8761fc8961fc8a62fc8c63fc8e64fc9065fd9266fd9467fd9668fd9869fd9a6afd9b6bfe9d6cfe9f6dfea16efea36ffea571fea772fea973feaa74feac76feae77feb078feb27afeb47bfeb67cfeb77efeb97ffebb81febd82febf84fec185fec287fec488fec68afec88cfeca8dfecc8ffecd90fecf92fed194fed395fed597fed799fed89afdda9cfddc9efddea0fde0a1fde2a3fde3a5fde5a7fde7a9fde9aafdebacfcecaefceeb0fcf0b2fcf2b4fcf4b6fcf6b8fcf7b9fcf9bbfcfbbdfcfdbf")),O3=Kb(dn("00000401000501010601010802010a02020c02020e03021004031204031405041706041907051b08051d09061f0a07220b07240c08260d08290e092b10092d110a30120a32140b34150b37160b39180c3c190c3e1b0c411c0c431e0c451f0c48210c4a230c4c240c4f260c51280b53290b552b0b572d0b592f0a5b310a5c320a5e340a5f3609613809623909633b09643d09653e0966400a67420a68440a68450a69470b6a490b6a4a0c6b4c0c6b4d0d6c4f0d6c510e6c520e6d540f6d550f6d57106e59106e5a116e5c126e5d126e5f136e61136e62146e64156e65156e67166e69166e6a176e6c186e6d186e6f196e71196e721a6e741a6e751b6e771c6d781c6d7a1d6d7c1d6d7d1e6d7f1e6c801f6c82206c84206b85216b87216b88226a8a226a8c23698d23698f24699025689225689326679526679727669827669a28659b29649d29649f2a63a02a63a22b62a32c61a52c60a62d60a82e5fa92e5eab2f5ead305dae305cb0315bb1325ab3325ab43359b63458b73557b93556ba3655bc3754bd3853bf3952c03a51c13a50c33b4fc43c4ec63d4dc73e4cc83f4bca404acb4149cc4248ce4347cf4446d04545d24644d34743d44842d54a41d74b3fd84c3ed94d3dda4e3cdb503bdd513ade5238df5337e05536e15635e25734e35933e45a31e55c30e65d2fe75e2ee8602de9612bea632aeb6429eb6628ec6726ed6925ee6a24ef6c23ef6e21f06f20f1711ff1731df2741cf3761bf37819f47918f57b17f57d15f67e14f68013f78212f78410f8850ff8870ef8890cf98b0bf98c0af98e09fa9008fa9207fa9407fb9606fb9706fb9906fb9b06fb9d07fc9f07fca108fca309fca50afca60cfca80dfcaa0ffcac11fcae12fcb014fcb216fcb418fbb61afbb81dfbba1ffbbc21fbbe23fac026fac228fac42afac62df9c72ff9c932f9cb35f8cd37f8cf3af7d13df7d340f6d543f6d746f5d949f5db4cf4dd4ff4df53f4e156f3e35af3e55df2e661f2e865f2ea69f1ec6df1ed71f1ef75f1f179f2f27df2f482f3f586f3f68af4f88ef5f992f6fa96f8fb9af9fc9dfafda1fcffa4")),L3=Kb(dn("0d088710078813078916078a19068c1b068d1d068e20068f2206902406912605912805922a05932c05942e05952f059631059733059735049837049938049a3a049a3c049b3e049c3f049c41049d43039e44039e46039f48039f4903a04b03a14c02a14e02a25002a25102a35302a35502a45601a45801a45901a55b01a55c01a65e01a66001a66100a76300a76400a76600a76700a86900a86a00a86c00a86e00a86f00a87100a87201a87401a87501a87701a87801a87a02a87b02a87d03a87e03a88004a88104a78305a78405a78606a68707a68808a68a09a58b0aa58d0ba58e0ca48f0da4910ea3920fa39410a29511a19613a19814a099159f9a169f9c179e9d189d9e199da01a9ca11b9ba21d9aa31e9aa51f99a62098a72197a82296aa2395ab2494ac2694ad2793ae2892b02991b12a90b22b8fb32c8eb42e8db52f8cb6308bb7318ab83289ba3388bb3488bc3587bd3786be3885bf3984c03a83c13b82c23c81c33d80c43e7fc5407ec6417dc7427cc8437bc9447aca457acb4679cc4778cc4977cd4a76ce4b75cf4c74d04d73d14e72d24f71d35171d45270d5536fd5546ed6556dd7566cd8576bd9586ada5a6ada5b69db5c68dc5d67dd5e66de5f65de6164df6263e06363e16462e26561e26660e3685fe4695ee56a5de56b5de66c5ce76e5be76f5ae87059e97158e97257ea7457eb7556eb7655ec7754ed7953ed7a52ee7b51ef7c51ef7e50f07f4ff0804ef1814df1834cf2844bf3854bf3874af48849f48948f58b47f58c46f68d45f68f44f79044f79143f79342f89441f89540f9973ff9983ef99a3efa9b3dfa9c3cfa9e3bfb9f3afba139fba238fca338fca537fca636fca835fca934fdab33fdac33fdae32fdaf31fdb130fdb22ffdb42ffdb52efeb72dfeb82cfeba2cfebb2bfebd2afebe2afec029fdc229fdc328fdc527fdc627fdc827fdca26fdcb26fccd25fcce25fcd025fcd225fbd324fbd524fbd724fad824fada24f9dc24f9dd25f8df25f8e125f7e225f7e425f6e626f6e826f5e926f5eb27f4ed27f3ee27f3f027f2f227f1f426f1f525f0f724f0f921"));function YD(e){return"string"==typeof e?new Js([[document.querySelector(e)]],[document.documentElement]):new Js([[e]],DR)}function Cm(e){return function(){return e}}function N3(e){this._context=e}function Jb(e){return new N3(e)}function OJ(e){return e[0]}function LJ(e){return e[1]}N3.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:this._context.lineTo(e,t)}}},Math,Math;const z3=Math.cos,KD=(Math,Math.min),Qb=Math.sin,Li=Math.sqrt,Em=Math.PI,ex=2*Em,zJ=Li(3),U3={draw(e,t){const n=.59436*Li(t+KD(t/28,.75)),r=n/2,i=r*zJ;e.moveTo(0,n),e.lineTo(0,-n),e.moveTo(-i,-r),e.lineTo(i,r),e.moveTo(-i,r),e.lineTo(i,-r)}},u_={draw(e,t){const n=Li(t/Em);e.moveTo(n,0),e.arc(0,0,n,0,ex)}},$3={draw(e,t){const n=Li(t/5)/2;e.moveTo(-3*n,-n),e.lineTo(-n,-n),e.lineTo(-n,-3*n),e.lineTo(n,-3*n),e.lineTo(n,-n),e.lineTo(3*n,-n),e.lineTo(3*n,n),e.lineTo(n,n),e.lineTo(n,3*n),e.lineTo(-n,3*n),e.lineTo(-n,n),e.lineTo(-3*n,n),e.closePath()}},j3=Li(1/3),BJ=2*j3,H3={draw(e,t){const n=Li(t/BJ),r=n*j3;e.moveTo(0,-n),e.lineTo(r,0),e.lineTo(0,n),e.lineTo(-r,0),e.closePath()}},G3={draw(e,t){const n=.62625*Li(t);e.moveTo(0,-n),e.lineTo(n,0),e.lineTo(0,n),e.lineTo(-n,0),e.closePath()}},q3={draw(e,t){const n=.87559*Li(t-KD(t/7,2));e.moveTo(-n,0),e.lineTo(n,0),e.moveTo(0,n),e.lineTo(0,-n)}},Z3={draw(e,t){const n=Li(t),r=-n/2;e.rect(r,r,n,n)}},W3={draw(e,t){const n=.4431*Li(t);e.moveTo(n,n),e.lineTo(n,-n),e.lineTo(-n,-n),e.lineTo(-n,n),e.closePath()}},X3=Qb(Em/10)/Qb(7*Em/10),UJ=Qb(ex/10)*X3,$J=-z3(ex/10)*X3,Y3={draw(e,t){const n=Li(.8908130915292852*t),r=UJ*n,i=$J*n;e.moveTo(0,-n),e.lineTo(r,i);for(let o=1;o<5;++o){const c=ex*o/5,d=z3(c),p=Qb(c);e.lineTo(p*n,-d*n),e.lineTo(d*r-p*i,p*r+d*i)}e.closePath()}},JD=Li(3),K3={draw(e,t){const n=-Li(t/(3*JD));e.moveTo(0,2*n),e.lineTo(-JD*n,-n),e.lineTo(JD*n,-n),e.closePath()}},jJ=Li(3),J3={draw(e,t){const n=.6824*Li(t),r=n/2,i=n*jJ/2;e.moveTo(0,-n),e.lineTo(i,r),e.lineTo(-i,r),e.closePath()}},Pa=-.5,Ra=Li(3)/2,QD=1/Li(12),HJ=3*(QD/2+1),Q3={draw(e,t){const n=Li(t/HJ),r=n/2,i=n*QD,o=r,c=n*QD+n,d=-o,p=c;e.moveTo(r,i),e.lineTo(o,c),e.lineTo(d,p),e.lineTo(Pa*r-Ra*i,Ra*r+Pa*i),e.lineTo(Pa*o-Ra*c,Ra*o+Pa*c),e.lineTo(Pa*d-Ra*p,Ra*d+Pa*p),e.lineTo(Pa*r+Ra*i,Pa*i-Ra*r),e.lineTo(Pa*o+Ra*c,Pa*c-Ra*o),e.lineTo(Pa*d+Ra*p,Pa*p-Ra*d),e.closePath()}},eN={draw(e,t){const n=.6189*Li(t-KD(t/6,1.7));e.moveTo(-n,-n),e.lineTo(n,n),e.moveTo(-n,n),e.lineTo(n,-n)}},GJ=[u_,$3,H3,Z3,Y3,K3,Q3],qJ=[u_,q3,eN,J3,U3,W3,G3];function Nh(){}function tx(e,t,n){e._context.bezierCurveTo((2*e._x0+e._x1)/3,(2*e._y0+e._y1)/3,(e._x0+2*e._x1)/3,(e._y0+2*e._y1)/3,(e._x0+4*e._x1+t)/6,(e._y0+4*e._y1+n)/6)}function nx(e){this._context=e}function tN(e){this._context=e}function nN(e){this._context=e}nx.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){switch(this._point){case 3:tx(this,this._x1,this._y1);case 2:this._context.lineTo(this._x1,this._y1)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,this._context.lineTo((5*this._x0+this._x1)/6,(5*this._y0+this._y1)/6);default:tx(this,e,t)}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}},tN.prototype={areaStart:Nh,areaEnd:Nh,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._y0=this._y1=this._y2=this._y3=this._y4=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:this._context.moveTo(this._x2,this._y2),this._context.closePath();break;case 2:this._context.moveTo((this._x2+2*this._x3)/3,(this._y2+2*this._y3)/3),this._context.lineTo((this._x3+2*this._x2)/3,(this._y3+2*this._y2)/3),this._context.closePath();break;case 3:this.point(this._x2,this._y2),this.point(this._x3,this._y3),this.point(this._x4,this._y4)}},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._x2=e,this._y2=t;break;case 1:this._point=2,this._x3=e,this._y3=t;break;case 2:this._point=3,this._x4=e,this._y4=t,this._context.moveTo((this._x0+4*this._x1+e)/6,(this._y0+4*this._y1+t)/6);break;default:tx(this,e,t)}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}},nN.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){(this._line||0!==this._line&&3===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3;var n=(this._x0+4*this._x1+e)/6,r=(this._y0+4*this._y1+t)/6;this._line?this._context.lineTo(n,r):this._context.moveTo(n,r);break;case 3:this._point=4;default:tx(this,e,t)}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};class rN{constructor(t,n){this._context=t,this._x=n}areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._point=0}lineEnd(){(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line}point(t,n){switch(t=+t,n=+n,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,n):this._context.moveTo(t,n);break;case 1:this._point=2;default:this._x?this._context.bezierCurveTo(this._x0=(this._x0+t)/2,this._y0,this._x0,n,t,n):this._context.bezierCurveTo(this._x0,this._y0=(this._y0+n)/2,t,this._y0,t,n)}this._x0=t,this._y0=n}}function iN(e,t){this._basis=new nx(e),this._beta=t}iN.prototype={lineStart:function(){this._x=[],this._y=[],this._basis.lineStart()},lineEnd:function(){var e=this._x,t=this._y,n=e.length-1;if(n>0)for(var p,r=e[0],i=t[0],o=e[n]-r,c=t[n]-i,d=-1;++d<=n;)this._basis.point(this._beta*e[d]+(1-this._beta)*(r+(p=d/n)*o),this._beta*t[d]+(1-this._beta)*(i+p*c));this._x=this._y=null,this._basis.lineEnd()},point:function(e,t){this._x.push(+e),this._y.push(+t)}};const QJ=function e(t){function n(r){return 1===t?new nx(r):new iN(r,t)}return n.beta=function(r){return e(+r)},n}(.85);function rx(e,t,n){e._context.bezierCurveTo(e._x1+e._k*(e._x2-e._x0),e._y1+e._k*(e._y2-e._y0),e._x2+e._k*(e._x1-t),e._y2+e._k*(e._y1-n),e._x2,e._y2)}function eS(e,t){this._context=e,this._k=(1-t)/6}eS.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:rx(this,this._x1,this._y1)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2,this._x1=e,this._y1=t;break;case 2:this._point=3;default:rx(this,e,t)}this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};const eQ=function e(t){function n(r){return new eS(r,t)}return n.tension=function(r){return e(+r)},n}(0);function tS(e,t){this._context=e,this._k=(1-t)/6}tS.prototype={areaStart:Nh,areaEnd:Nh,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:this._context.moveTo(this._x3,this._y3),this._context.closePath();break;case 2:this._context.lineTo(this._x3,this._y3),this._context.closePath();break;case 3:this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5)}},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._x3=e,this._y3=t;break;case 1:this._point=2,this._context.moveTo(this._x4=e,this._y4=t);break;case 2:this._point=3,this._x5=e,this._y5=t;break;default:rx(this,e,t)}this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};const tQ=function e(t){function n(r){return new tS(r,t)}return n.tension=function(r){return e(+r)},n}(0);function nS(e,t){this._context=e,this._k=(1-t)/6}nS.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){(this._line||0!==this._line&&3===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:rx(this,e,t)}this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};const nQ=function e(t){function n(r){return new nS(r,t)}return n.tension=function(r){return e(+r)},n}(0);function rS(e,t,n){var r=e._x1,i=e._y1,o=e._x2,c=e._y2;if(e._l01_a>1e-12){var d=2*e._l01_2a+3*e._l01_a*e._l12_a+e._l12_2a,p=3*e._l01_a*(e._l01_a+e._l12_a);r=(r*d-e._x0*e._l12_2a+e._x2*e._l01_2a)/p,i=(i*d-e._y0*e._l12_2a+e._y2*e._l01_2a)/p}if(e._l23_a>1e-12){var v=2*e._l23_2a+3*e._l23_a*e._l12_a+e._l12_2a,E=3*e._l23_a*(e._l23_a+e._l12_a);o=(o*v+e._x1*e._l23_2a-t*e._l12_2a)/E,c=(c*v+e._y1*e._l23_2a-n*e._l12_2a)/E}e._context.bezierCurveTo(r,i,o,c,e._x2,e._y2)}function oN(e,t){this._context=e,this._alpha=t}oN.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:this.point(this._x2,this._y2)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){if(e=+e,t=+t,this._point){var n=this._x2-e,r=this._y2-t;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+r*r,this._alpha))}switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3;default:rS(this,e,t)}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};const rQ=function e(t){function n(r){return t?new oN(r,t):new eS(r,0)}return n.alpha=function(r){return e(+r)},n}(.5);function sN(e,t){this._context=e,this._alpha=t}sN.prototype={areaStart:Nh,areaEnd:Nh,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 1:this._context.moveTo(this._x3,this._y3),this._context.closePath();break;case 2:this._context.lineTo(this._x3,this._y3),this._context.closePath();break;case 3:this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5)}},point:function(e,t){if(e=+e,t=+t,this._point){var n=this._x2-e,r=this._y2-t;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+r*r,this._alpha))}switch(this._point){case 0:this._point=1,this._x3=e,this._y3=t;break;case 1:this._point=2,this._context.moveTo(this._x4=e,this._y4=t);break;case 2:this._point=3,this._x5=e,this._y5=t;break;default:rS(this,e,t)}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};const iQ=function e(t){function n(r){return t?new sN(r,t):new tS(r,0)}return n.alpha=function(r){return e(+r)},n}(.5);function aN(e,t){this._context=e,this._alpha=t}aN.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){(this._line||0!==this._line&&3===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){if(e=+e,t=+t,this._point){var n=this._x2-e,r=this._y2-t;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+r*r,this._alpha))}switch(this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:rS(this,e,t)}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};const oQ=function e(t){function n(r){return t?new aN(r,t):new nS(r,0)}return n.alpha=function(r){return e(+r)},n}(.5);function lN(e){this._context=e}function cN(e){return e<0?-1:1}function uN(e,t,n){var r=e._x1-e._x0,i=t-e._x1,o=(e._y1-e._y0)/(r||i<0&&-0),c=(n-e._y1)/(i||r<0&&-0),d=(o*i+c*r)/(r+i);return(cN(o)+cN(c))*Math.min(Math.abs(o),Math.abs(c),.5*Math.abs(d))||0}function hN(e,t){var n=e._x1-e._x0;return n?(3*(e._y1-e._y0)/n-t)/2:t}function iS(e,t,n){var r=e._x0,o=e._x1,c=e._y1,d=(o-r)/3;e._context.bezierCurveTo(r+d,e._y0+d*t,o-d,c-d*n,o,c)}function ix(e){this._context=e}function dN(e){this._context=new fN(e)}function fN(e){this._context=e}function pN(e){this._context=e}function mN(e){var t,r,n=e.length-1,i=new Array(n),o=new Array(n),c=new Array(n);for(i[0]=0,o[0]=2,c[0]=e[0]+2*e[1],t=1;t=0;--t)i[t]=(c[t]-i[t+1])/o[t];for(o[n-1]=(e[n]+i[n-1])/2,t=0;t0&&isFinite(e)?e:NaN}function sS(e){return e<0&&isFinite(e)?e:NaN}lN.prototype={areaStart:Nh,areaEnd:Nh,lineStart:function(){this._point=0},lineEnd:function(){this._point&&this._context.closePath()},point:function(e,t){e=+e,t=+t,this._point?this._context.lineTo(e,t):(this._point=1,this._context.moveTo(e,t))}},ix.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=this._t0=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x1,this._y1);break;case 3:iS(this,this._t0,hN(this,this._t0))}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){var n=NaN;if(t=+t,(e=+e)!==this._x1||t!==this._y1){switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,iS(this,hN(this,n=uN(this,e,t)),n);break;default:iS(this,this._t0,n=uN(this,e,t))}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t,this._t0=n}}},(dN.prototype=Object.create(ix.prototype)).point=function(e,t){ix.prototype.point.call(this,t,e)},fN.prototype={moveTo:function(e,t){this._context.moveTo(t,e)},closePath:function(){this._context.closePath()},lineTo:function(e,t){this._context.lineTo(t,e)},bezierCurveTo:function(e,t,n,r,i,o){this._context.bezierCurveTo(t,e,r,n,o,i)}},pN.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=[],this._y=[]},lineEnd:function(){var e=this._x,t=this._y,n=e.length;if(n)if(this._line?this._context.lineTo(e[0],t[0]):this._context.moveTo(e[0],t[0]),2===n)this._context.lineTo(e[1],t[1]);else for(var r=mN(e),i=mN(t),o=0,c=1;c=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:if(this._t<=0)this._context.lineTo(this._x,t),this._context.lineTo(e,t);else{var n=this._x*(1-this._t)+e*this._t;this._context.lineTo(n,this._y),this._context.lineTo(n,t)}}this._x=e,this._y=t}},Dm.prototype={constructor:Dm,scale:function(e){return 1===e?this:new Dm(this.k*e,this.x,this.y)},translate:function(e,t){return 0===e&0===t?this:new Dm(this.k,this.x+this.k*e,this.y+this.k*t)},apply:function(e){return[e[0]*this.k+this.x,e[1]*this.k+this.y]},applyX:function(e){return e*this.k+this.x},applyY:function(e){return e*this.k+this.y},invert:function(e){return[(e[0]-this.x)/this.k,(e[1]-this.y)/this.k]},invertX:function(e){return(e-this.x)/this.k},invertY:function(e){return(e-this.y)/this.k},rescaleX:function(e){return e.copy().domain(e.range().map(this.invertX,this).map(e.invert,e))},rescaleY:function(e){return e.copy().domain(e.range().map(this.invertY,this).map(e.invert,e))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}},new Dm(1,0,0);const bQ=/^(?:[-+]\d{2})?\d{4}(?:-\d{2}(?:-\d{2})?)?(?:T\d{2}:\d{2}(?::\d{2}(?:\.\d{3})?)?(?:Z|[-+]\d{2}:?\d{2})?)?$/;function vN(e,t){return bQ.test(e+="")?new Date(e):"function"==typeof t?t(e):t}const xQ=new Map([["second",wu],["minute",zb],["hour",Vb],["day",ym],["week",_m],["month",bm],["quarter",bm.every(3)],["half",bm.every(6)],["year",Cc],["monday",i_],["tuesday",JO],["wednesday",QO],["thursday",wf],["friday",eL],["saturday",tL],["sunday",_m]]),wQ=new Map([["second",wu],["minute",Bb],["hour",Ub],["day",r_],["week",vm],["month",xm],["quarter",xm.every(3)],["half",xm.every(6)],["year",Ec],["monday",o_],["tuesday",nL],["wednesday",rL],["thursday",Ef],["friday",iL],["saturday",oL],["sunday",vm]]);function CQ(e){const t=xQ.get(`${e}`.toLowerCase());if(!t)throw new Error(`unknown interval: ${e}`);return t}function EQ(e){const t=wQ.get(`${e}`.toLowerCase());if(!t)throw new Error(`unknown interval: ${e}`);return t}const h_=Object.getPrototypeOf(Uint8Array),DQ=Object.prototype.toString;function Sc(e,t,n){const r=typeof t;return"string"===r?bN(e,MQ(t),n):"function"===r?bN(e,t,n):"number"===r||t instanceof Date||"boolean"===r?Ho(e,Mm(t),n):function xN(e,t){return void 0===t?Mc(e):e instanceof t?e:t.prototype instanceof h_&&!(e instanceof h_)?t.from(e,lS):t.from(e)}("function"==typeof t?.transform?t.transform(e):t,n)}function bN(e,t,n){return Ho(e,n?.prototype instanceof h_?function SQ(e){return(t,n)=>lS(e(t,n))}(t):t,n)}const MQ=e=>t=>t[e],IQ=(e,t)=>t,Cu={transform:e=>e},TQ=()=>!0,Il=e=>null==e?e:`${e}`,fi=e=>null==e?e:+e,wN=e=>e?e[0]:void 0,aS=e=>e?e[1]:void 0,Mm=e=>()=>e;function CN(e){const t=+`${e}`.slice(1)/100;return(n,r)=>N0(n,t,r)}function ax(e){return e instanceof h_?e:Ho(e,lS,Float64Array)}function lS(e){return null==e?NaN:Number(e)}function AQ(e){return Ho(e,kQ)}function kQ(e){return e instanceof Date&&!isNaN(e)?e:"string"==typeof e?vN(e):null==e||isNaN(e=+e)?void 0:new Date(e)}function Im(e,t){return void 0===e&&(e=t),null===e?[void 0,"none"]:ux(e)?[void 0,e]:[e,void 0]}function Ps(e,t){return void 0===e&&(e=t),null===e||"number"==typeof e?[void 0,e]:[e,void 0]}function EN(e,t,n){if(null!=e)return Eu(e,t,n)}function Eu(e,t,n){const r=`${e}`.toLowerCase();if(!n.includes(r))throw new Error(`invalid ${t}: ${e}`);return r}function Mc(e){return null==e||e instanceof Array||e instanceof h_?e:Array.from(e)}function Ho(e,t,n=Array){return null==e?e:e instanceof n?e.map(t):n.from(e,t)}function cS(e,t=Array){return e instanceof t?e.slice():t.from(e)}function Tm(e){return e?.toString===DQ}function Am(e){return Tm(e)&&(void 0!==e.type||void 0!==e.domain)}function lx(e){return Tm(e)&&"function"!=typeof e.transform}function km(e){return lx(e)&&void 0===e.value&&void 0===e.channel}function cx(e,t){return void 0===e&&void 0===t?[wN,aS]:[e,t]}function DN({z:e,fill:t,stroke:n}={}){return void 0===e&&([e]=Im(t)),void 0===e&&([e]=Im(n)),e}function d_(e){const t=e.length,n=new Uint32Array(t);for(let r=0;re[n])}function uS(e){return null!==e&&"object"==typeof e?e.valueOf():e}function f_(e,t){return"string"==typeof e?e:e&&void 0!==e.label?e.label:t}function hS(e,t){if(null!=e){if("number"==typeof e){const n=e;return{floor:r=>n*Math.floor(r/n),offset:r=>r+n,range:(r,i)=>dR(Math.ceil(r/n),i/n).map(o=>n*o)}}if("string"==typeof e)return("time"===t?CQ:EQ)(e);if("function"!=typeof e.floor)throw new Error("invalid interval; missing floor method");if("function"!=typeof e.offset)throw new Error("invalid interval; missing offset method");return e}}function p_(e,t){if((e=hS(e,t))&&"function"!=typeof e.range)throw new Error("invalid interval: missing range method");return e}function dS(e){return void 0===e||lx(e)?e:{value:e}}function zh(e){return e&&"function"==typeof e[Symbol.iterator]}function OQ(e){for(const t of e)if(null!=t)return"object"!=typeof t||t instanceof Date}function MN(e){for(const t of e){if(null==t)continue;const n=typeof t;return"string"===n||"boolean"===n}}function Tl(e){for(const t of e)if(null!=t)return t instanceof Date}function LQ(e){for(const t of e)if(null!=t)return"string"==typeof t&&isNaN(t)&&vN(t)}function NQ(e){for(const t of e)if(null!=t){if("string"!=typeof t)return!1;if(t.trim())return!isNaN(t)}}function fS(e,t){let n;for(const r of e)if(null!=r){if(!t(r))return!1;n=!0}return n}function ux(e){return"string"==typeof e&&("none"===(e=e.toLowerCase().trim())||"currentcolor"===e||e.startsWith("url(")&&e.endsWith(")")||e.startsWith("var(")&&e.endsWith(")")||null!==Ph(e))}function BQ(e){return"number"==typeof e&&(0<=e&&e<=1||isNaN(e))}function ea(e){return null==e||m_(e)}function m_(e){return/^\s*none\s*$/i.test(e)}function pS(e="middle"){return Eu(e,"frameAnchor",["middle","top-left","top","top-right","right","bottom-right","bottom","bottom-left","left"])}function g_(e){if(null!=e)return Ty(e[0],e[e.length-1])}function IN(e){return zh(e)?function $Q(e){console.warn("named iterables are deprecated; please use an object instead");const t=new Set;return Object.fromEntries(Array.from(e,n=>{const{name:r}=n;if(null==r)throw new Error("missing name");const i=`${r}`;if("__proto__"===i)throw new Error(`illegal name: ${i}`);if(t.has(i))throw new Error(`duplicate name: ${i}`);return t.add(i),[r,n]}))}(e):e}const Ic=Symbol("position"),Tc=Symbol("color"),hx=Symbol("radius"),dx=Symbol("length"),fx=Symbol("opacity"),px=Symbol("symbol"),ni=new Map([["x",Ic],["y",Ic],["fx",Ic],["fy",Ic],["r",hx],["color",Tc],["opacity",fx],["symbol",px],["length",dx]]),HQ=2/Math.sqrt(3),mS=new Map([["asterisk",U3],["circle",u_],["cross",$3],["diamond",H3],["diamond2",G3],["hexagon",{draw(e,t){const n=Math.sqrt(t/Math.PI),r=n*HQ,i=r/2;e.moveTo(0,r),e.lineTo(n,i),e.lineTo(n,-i),e.lineTo(0,-r),e.lineTo(-n,-i),e.lineTo(-n,i),e.closePath()}}],["plus",q3],["square",Z3],["square2",W3],["star",Y3],["times",eN],["triangle",K3],["triangle2",J3],["wye",Q3]]);function gS(e){return e&&"function"==typeof e.draw}function qQ(e){return!!gS(e)||"string"==typeof e&&mS.has(e.toLowerCase())}function yS(e){if(null==e||gS(e))return e;const t=mS.get(`${e}`.toLowerCase());if(t)return t;throw new Error(`invalid symbol: ${e}`)}function vS(e,t,n=YQ){if(null==e)return n(e);if("function"==typeof e.reduceIndex)return e;if("function"==typeof e.reduce&&Tm(e))return function QQ(e){return console.warn("deprecated reduce interface; implement reduceIndex instead."),{...e,reduceIndex:e.reduce.bind(e)}}(e);if("function"==typeof e)return function eee(e){return{reduceIndex:(t,n,r)=>e(Pm(n,t),r)}}(e);if(/^p\d{2}$/i.test(e))return Du(CN(e));switch(`${e}`.toLowerCase()){case"first":return FN;case"last":return nee;case"identity":return RN;case"count":return bS;case"distinct":return ree;case"sum":return null==t?bS:iee;case"proportion":return ON(t,"data");case"proportion-facet":return ON(t,"facet");case"deviation":return Du(nR);case"min":return Du(df);case"min-index":return Du(KG);case"max":return Du(As);case"max-index":return Du(qG);case"mean":return PN(ZG);case"median":return PN(z0);case"variance":return Du(gE);case"mode":return Du(hR)}return n(e)}function YQ(e){throw new Error(`invalid reduce: ${e}`)}function Du(e){return{reduceIndex:(t,n)=>e(t,r=>n[r])}}function PN(e){return{reduceIndex(t,n){const r=e(t,i=>n[i]);return Tl(n)?new Date(r):r}}}const RN={reduceIndex:(e,t)=>Pm(t,e)},FN={reduceIndex:(e,t)=>t[e[0]]},nee={reduceIndex:(e,t)=>t[e[e.length-1]]},bS={label:"Frequency",reduceIndex:e=>e.length},ree={label:"Distinct",reduceIndex(e,t){const n=new yE;for(const r of e)n.add(t[r]);return n.size}},iee=Du(B0);function ON(e,t){return null==e?{scope:t,label:"Frequency",reduceIndex:(n,r,i=1)=>n.length/i}:{scope:t,reduceIndex:(n,r,i=1)=>B0(n,o=>r[o])/i}}function y_(e,{scale:t,type:n,value:r,filter:i,hint:o},c){return LN(c,{scale:t,type:n,value:Sc(e,r),label:f_(r),filter:i,hint:o})}function LN(e,t){const{scale:n,value:r}=t;if(!0===n||"auto"===n)switch(e){case"fill":case"stroke":case"color":t.scale=!0!==n&&fS(r,ux)?null:"color";break;case"fillOpacity":case"strokeOpacity":t.scale=!0!==n&&fS(r,BQ)?null:"opacity";break;case"symbol":!0!==n&&fS(r,qQ)?(t.scale=null,t.value=Ho(r,yS)):t.scale="symbol";break;default:t.scale=ni.has(e)?e:null}else if(!1===n)t.scale=null;else if(null!=n&&!ni.has(n))throw new Error(`unknown scale: ${n}`);return t}function lee(e,t){for(const n in e){const r=e[n];if(r.scale===t)return r}}function cee(e,t){const n=e.original;if(n===e)return t;const r=t.value,i=t.value=[];for(let o=0;oMath.abs(o-r[c]),Float64Array)}function xS(e,t,n){let r=e[t];if(!r&&void 0!==n&&(r=e[n]),r)return r.value;throw new Error(`missing channel: ${t}`)}function uee([e,t],[n,r]){return Sm(t,r)||Sm(e,n)}function hee([e,t],[n,r]){return yN(t,r)||Sm(e,n)}let wS=0;function Sf(e){console.warn(e),++wS}const zN=Math.PI,Su=2*zN;function fee({projection:e,inset:t=0,insetTop:n=t,insetRight:r=t,insetBottom:i=t,insetLeft:o=t}={},c){if(null==e)return;if("function"==typeof e.stream)return e;let d,p,v="frame";if(Tm(e)){let fe;if(({type:e,domain:p,inset:fe,insetTop:n=(void 0!==fe?fe:n),insetRight:r=(void 0!==fe?fe:r),insetBottom:i=(void 0!==fe?fe:i),insetLeft:o=(void 0!==fe?fe:o),clip:v=v,...d}=e),null==e)return}"function"!=typeof e&&({type:e}=BN(e));const{width:E,height:D,marginLeft:I,marginRight:P,marginTop:N,marginBottom:G}=c,U=E-I-P-o-r,Z=D-N-G-n-i;if(e=e?.({width:U,height:Z,clip:v,...d}),null==e)return;v=function pee(e,t,n,r,i){if(!1===e||null==e||"number"==typeof e)return o=>o;if("frame"===(!0===e&&(e="frame"),`${e}`.toLowerCase()))return wF(t,n,r,i);throw new Error(`unknown projection clip type: ${e}`)}(v,I,N,E-P,D-G);let re,ne=I+o,X=N+n;if(null!=p){const[[fe,ve],[Re,We]]=aD(e).bounds(p),Ke=Math.min(U/(Re-fe),Z/(We-ve));Ke>0?(ne-=(Ke*(fe+Re)-U)/2,X-=(Ke*(ve+We)-Z)/2,re=pD({point(lt,Ue){this.stream.point(lt*Ke+ne,Ue*Ke+X)}})):Sf("Warning: the projection could not be fit to the specified domain; using the default scale.")}return re??(re=0===ne&&0===X?VN():pD({point(fe,ve){this.stream.point(fe+ne,ve+X)}})),{stream:fe=>e.stream(re.stream(v(fe)))}}function BN(e){switch(`${e}`.toLowerCase()){case"albers-usa":return Al(gY,.7463,.4673);case"albers":return gx(aO,.7463,.4673);case"azimuthal-equal-area":return Al(yY,4,4);case"azimuthal-equidistant":return Al(_Y,Su,Su);case"conic-conformal":return gx(xY,Su,Su);case"conic-equal-area":return gx(Mb,6.1702,2.9781);case"conic-equidistant":return gx(EY,7.312,3.6282);case"equal-earth":return Al(SY,5.4133,2.6347);case"equirectangular":return Al(wY,Su,zN);case"gnomonic":return Al(MY,3.4641,3.4641);case"identity":return{type:VN};case"reflect-y":return{type:mee};case"mercator":return Al(vY,Su,Su);case"orthographic":return Al(IY,2,2);case"stereographic":return Al(TY,2,2);case"transverse-mercator":return Al(AY,Su,Su);default:throw new Error(`unknown projection type: ${e}`)}}function Al(e,t,n){return{type:({width:r,height:i,rotate:o,precision:c=.15,clip:d})=>{const p=e();return null!=c&&p.precision?.(c),null!=o&&p.rotate?.(o),"number"==typeof d&&p.clipAngle?.(d),p.scale(Math.min(r/t,i/n)),p.translate([r/2,i/2]),p},aspectRatio:n/t}}function gx(e,t,n){const{type:r,aspectRatio:i}=Al(e,t,n);return{type:o=>{const{parallels:c,domain:d,width:p,height:v}=o,E=r(o);return null!=c&&(E.parallels(c),void 0===d&&E.fitSize([p,v],{type:"Sphere"})),E},aspectRatio:i}}const VN=Mm({stream:e=>e}),mee=Mm(pD({point(e,t){this.stream.point(e,-t)}}));function yx(e,t,n,r,i){const o=n[e]&&"x"===n[e].scale,c=n[t]&&"y"===n[t].scale;if(o&&c)!function gee(e,t,n,r){const i=n[e],o=n[t],c=i.length,d=n[e]=new Float64Array(c).fill(NaN),p=n[t]=new Float64Array(c).fill(NaN);let v;const E=r.stream({point(D,I){d[v]=D,p[v]=I}});for(v=0;v1===n?[e[3][1]]:2===n?[e[3][1],e[3][2]]:(n=Math.max(3,Math.floor(n)))>9?Sl(t,n):e[n]}function Mu(e,t){return({length:n})=>2===n?[e[3][0],e[3][2]]:(n=Math.max(3,Math.floor(n)))>11?Sl(t,n):e[n]}function $N(e,t){return({length:n})=>2===n?[e[3][2],e[3][0]]:(n=Math.max(3,Math.floor(n)))>11?Sl(r=>t(1-r),n):e[n].slice().reverse()}function Iu(e){return({length:t})=>Sl(e,Math.max(2,Math.floor(t)))}function jN(e){return({length:t})=>Sl(e,Math.floor(t)+1).slice(0,-1)}function HN(e){const t=`${e}`.toLowerCase();if(!UN.has(t))throw new Error(`unknown ordinal scheme: ${t}`);return UN.get(t)}function vx(e,t){const n=HN(e),r="function"==typeof n?n({length:t}):n;return r.length!==t?r.slice(0,t):r}const GN=new Map([["brbg",SL],["prgn",IL],["piyg",AL],["puor",PL],["rdbu",qb],["rdgy",FL],["rdylbu",Zb],["rdylgn",LL],["spectral",zL],["burd",e=>qb(1-e)],["buylrd",e=>Zb(1-e)],["blues",u3],["greens",d3],["greys",p3],["purples",g3],["reds",_3],["oranges",b3],["turbo",P3],["viridis",R3],["magma",F3],["inferno",O3],["plasma",L3],["cividis",x3],["cubehelix",M3],["warm",I3],["cool",T3],["bugn",VL],["bupu",$L],["gnbu",HL],["orrd",qL],["pubugn",WL],["pubu",YL],["purd",JL],["rdpu",e3],["ylgnbu",n3],["ylgn",i3],["ylorbr",s3],["ylorrd",l3],["rainbow",A3],["sinebow",k3]]);function ES(e){const t=`${e}`.toLowerCase();if(!GN.has(t))throw new Error(`unknown quantitative scheme: ${t}`);return GN.get(t)}const bee=new Set(["brbg","prgn","piyg","puor","rdbu","rdgy","rdylbu","rdylgn","spectral","burd","buylrd"]);function qN(e){return null!=e&&bee.has(`${e}`.toLowerCase())}const ZN=e=>t=>e(1-t),DS=[0,1],WN=new Map([["number",Uo],["rgb",yf],["hsl",kY],["hcl",FY],["lab",function RY(e,t){var n=Qi((e=bD(e)).l,(t=bD(t)).l),r=Qi(e.a,t.a),i=Qi(e.b,t.b),o=Qi(e.opacity,t.opacity);return function(c){return e.l=n(c),e.a=r(c),e.b=i(c),e.opacity=o(c),e+""}}]]);function XN(e){const t=`${e}`.toLowerCase();if(!WN.has(t))throw new Error(`unknown interpolator: ${t}`);return WN.get(t)}function __(e,t,n,{type:r,nice:i,clamp:o,zero:c,domain:d=KN(e,n),unknown:p,round:v,scheme:E,interval:D,range:I=(ni.get(e)===hx?kee(n,d):ni.get(e)===dx?Pee(n,d):ni.get(e)===fx?DS:void 0),interpolate:P=(ni.get(e)===Tc?null==E&&void 0!==I?yf:ES(void 0!==E?E:"cyclical"===r?"rainbow":"turbo"):v?vD:Uo),reverse:N}){if(D=p_(D,r),("cyclical"===r||"sequential"===r)&&(r="linear"),N=!!N,"function"!=typeof P&&(P=XN(P)),1===P.length?(N&&(P=ZN(P),N=!1),void 0===I&&2===(I=Float64Array.from(d,(G,U)=>U/(d.length-1))).length&&(I=DS),t.interpolate((I===DS?Mm:MS)(P))):t.interpolate(P),c){const[G,U]=Qp(d);(G>0||U<0)&&(g_(d=cS(d))!==Math.sign(G)?d[d.length-1]=0:d[0]=0)}return N&&(d=$0(d)),t.domain(d).unknown(p),i&&(t.nice(function xee(e,t){return!0===e?void 0:"number"==typeof e?e:function RQ(e,t){if((e=p_(e,t))&&"function"!=typeof e.ceil)throw new Error("invalid interval: missing ceil method");return e}(e,t)}(i,r)),d=t.domain()),void 0!==I&&t.range(I),o&&t.clamp(o),{type:r,domain:d,range:I,scale:t,interpolate:P,interval:D}}function YN(e,t,{exponent:n=1,...r}){return __(e,LD().exponent(n),t,{...r,type:"pow"})}function Eee(e,t,{base:n=10,domain:r=Ree(t),...i}){return __(e,UO().base(n),t,{...i,domain:r})}function Dee(e,t,{constant:n=1,...r}){return __(e,GO().constant(n),t,r)}function See(e,t,{range:n,quantiles:r=(void 0===n?5:(n=[...n]).length),n:i=r,scheme:o="rdylbu",domain:c=Fee(t),unknown:d,interpolate:p,reverse:v}){return void 0===n&&(n=void 0!==p?Sl(p,i):ni.get(e)===Tc?vx(o,i):void 0),c.length>0&&(c=WO(c,void 0===n?{length:i}:n).quantiles()),SS(e,0,{domain:c,range:n,reverse:v,unknown:d})}function SS(e,t,{domain:n=[0],unknown:r,scheme:i="rdylbu",interpolate:o,range:c=(void 0!==o?Sl(o,n.length+1):ni.get(e)===Tc?vx(i,n.length+1):void 0),reverse:d}){const p=g_(n=Mc(n));if(!isNaN(p)&&!function Iee(e,t){for(let n=1,r=e.length,i=e[0];nvoid 0===n?n:df(n,t)),As(e,({value:n})=>void 0===n?n:As(n,t))]:[0,1]}function KN(e,t){const n=ni.get(e);return(n===hx||n===fx||n===dx?Aee:v_)(t)}function Aee(e){return[0,e.length?As(e,({value:t})=>void 0===t?t:As(t,_N)):1]}function kee(e,t){const n=e.find(({radius:c})=>void 0!==c);if(void 0!==n)return[0,n.radius];const r=N0(e,.5,({value:c})=>void 0===c?NaN:N0(c,.25,sx)),i=t.map(c=>3*Math.sqrt(c/r)),o=30/As(i);return o<1?i.map(c=>c*o):i}function Pee(e,t){const n=z0(e,({value:o})=>void 0===o?NaN:z0(o,Math.abs)),r=t.map(o=>12*o/n),i=60/As(r);return i<1?r.map(o=>o*i):r}function Ree(e){for(const{value:t}of e)if(void 0!==t)for(let n of t){if(n>0)return v_(e,sx);if(n<0)return v_(e,sS)}return[1,10]}function Fee(e){const t=[];for(const{value:n}of e)if(void 0!==n)for(const r of n)t.push(r);return t}function MS(e){return(t,n)=>r=>e(t+r*(n-t))}function bx(e,t,n,r,{type:i,nice:o,clamp:c,domain:d=v_(r),unknown:p,pivot:v=0,scheme:E,range:D,symmetric:I=!0,interpolate:P=(ni.get(e)===Tc?null==E&&void 0!==D?yf:ES(void 0!==E?E:"rdbu"):Uo),reverse:N}){v=+v;let[G,U]=d;if(Ty(G,U)<0&&([G,U]=[U,G],N=!N),G=Math.min(G,v),U=Math.max(U,v),"function"!=typeof P&&(P=XN(P)),void 0!==D&&(P=1===P.length?MS(P)(...D):SD(P,D)),N&&(P=ZN(P)),I){const Z=n.apply(v),ne=Z-n.apply(G),X=n.apply(U)-Z;neX&&(U=n.invert(Z+ne))}return t.domain([G,v,U]).unknown(p).interpolator(P),c&&t.clamp(c),o&&t.nice(o),{type:i,domain:[G,U],pivot:v,interpolate:P,scale:t}}function Oee(e,t,n){return bx(e,wL(),Bee,t,n)}function JN(e,t,{exponent:n=1,...r}){return bx(e,HD().exponent(n=+n),function $ee(e){return.5===e?Uee:{apply:t=>Math.sign(t)*Math.pow(Math.abs(t),e),invert:t=>Math.sign(t)*Math.pow(Math.abs(t),1/e)}}(n),t,{...r,type:"diverging-pow"})}function Nee(e,t,{base:n=10,pivot:r=1,domain:i=v_(t,r<0?sS:sx),...o}){return bx(e,CL().base(n=+n),Vee,t,{domain:i,pivot:r,...o})}function zee(e,t,{constant:n=1,...r}){return bx(e,EL().constant(n=+n),function jee(e){return{apply:t=>Math.sign(t)*Math.log1p(Math.abs(t/e)),invert:t=>Math.sign(t)*Math.expm1(Math.abs(t))*e}}(n),t,r)}const Bee={apply:e=>e,invert:e=>e},Vee={apply:Math.log,invert:Math.exp},Uee={apply:e=>Math.sign(e)*Math.sqrt(Math.abs(e)),invert:e=>Math.sign(e)*(e*e)};function QN(e,t,n,r){return __(e,t,n,r)}const b_=Symbol("ordinal");function e5(e,t,n,{type:r,interval:i,domain:o,range:c,reverse:d,hint:p}){return i=p_(i,r),void 0===o&&(o=n5(n,i,e)),("categorical"===r||r===b_)&&(r="ordinal"),d&&(o=$0(o)),t.domain(o),void 0!==c&&("function"==typeof c&&(c=c(o)),t.range(c)),{type:r,domain:o,range:c,scale:t,hint:p,interval:i}}function t5(e,t,n,r){let{round:i}=n;return void 0!==i&&e.round(i=!!i),(e=e5(r,e,t,n)).round=i,e}function n5(e,t,n){const r=new yE;for(const{value:i,domain:o}of e){if(void 0!==o)return o();if(void 0!==i)for(const c of i)r.add(c)}if(void 0!==t){const[i,o]=Qp(r).map(t.floor,t);return t.range(i,t.offset(o))}if(r.size>1e4&&ni.get(n)===Ic)throw new Error(`implicit ordinal domain of ${n} scale has more than 10,000 values`);return bE(r,Sm)}function r5(e,t){let n;for(const{hint:r}of e){const i=r?.[t];if(void 0!==i)if(void 0===n)n=i;else if(n!==i)return}return n}function IS(e,{label:t,inset:n=0,insetTop:r=n,insetRight:i=n,insetBottom:o=n,insetLeft:c=n,round:d,nice:p,clamp:v,zero:E,align:D,padding:I,projection:P,facet:{label:N=t}={},...G}={}){const U={};for(const[Z,ne]of e){const X=G[Z],re=u5(Z,ne,{round:ni.get(Z)===Ic?d:void 0,nice:p,clamp:v,zero:E,align:D,padding:I,projection:P,...X});if(re){let{label:fe=("fx"===Z||"fy"===Z?N:t),percent:ve,transform:Re,inset:We,insetTop:Ke=(void 0!==We?We:"y"===Z?r:0),insetRight:lt=(void 0!==We?We:"x"===Z?i:0),insetBottom:Ue=(void 0!==We?We:"y"===Z?o:0),insetLeft:st=(void 0!==We?We:"x"===Z?c:0)}=X||{};if(null==Re)Re=void 0;else if("function"!=typeof Re)throw new Error("invalid scale transform; not a function");re.percent=!!ve,re.label=void 0===fe?Jee(ne,re):fe,re.transform=Re,"x"===Z||"fx"===Z?(re.insetLeft=+st,re.insetRight=+lt):("y"===Z||"fy"===Z)&&(re.insetTop=+Ke,re.insetBottom=+Ue),U[Z]=re}}return U}function i5(e){return Object.fromEntries(Object.entries(e).filter(([,{scale:t}])=>t).map(([t,{scale:n,type:r,interval:i,label:o}])=>(n.type=r,null!=i&&(n.interval=i),null!=o&&(n.label=o),[t,n])))}function Jee(e=[],t){let n;for(const{label:r}of e)if(void 0!==r)if(void 0===n)n=r;else if(n!==r)return;if(!(void 0===n||d5(t)&&/^(date|time|year)$/i.test(n)))return!Mf(t)&&t.percent&&(n=`${n} (%)`),{inferred:!0,toString:()=>n}}function TS(e){const{marginTop:t,marginRight:n,marginBottom:r,marginLeft:i,width:o,height:c,facet:{marginTop:d,marginRight:p,marginBottom:v,marginLeft:E}}=e;return{marginTop:Math.max(t,d),marginRight:Math.max(n,p),marginBottom:Math.max(r,v),marginLeft:Math.max(i,E),width:o,height:c}}function o5({fx:e,fy:t},n){const{marginTop:r,marginRight:i,marginBottom:o,marginLeft:c,width:d,height:p}=TS(n);return{marginTop:r,marginRight:i,marginBottom:o,marginLeft:c,width:e?e.scale.bandwidth()+c+i:d,height:t?t.scale.bandwidth()+r+o:p}}function s5(e,t){if(void 0===e.range){const{insetLeft:n,insetRight:r}=e,{width:i,marginLeft:o=0,marginRight:c=0}=t,d=o+n;e.range=[d,Math.max(d,i-c-r)],Mf(e)||(e.range=c5(e)),e.scale.range(e.range)}l5(e)}function a5(e,t){if(void 0===e.range){const{insetTop:n,insetBottom:r}=e,{height:i,marginTop:o=0,marginBottom:c=0}=t,d=o+n;e.range=[Math.max(d,i-c-r),d],Mf(e)?e.range.reverse():e.range=c5(e),e.scale.range(e.range)}l5(e)}function l5(e){void 0===e.round&&function tte({type:e}){return"point"===e||"band"===e}(e)&&function Qee({scale:e}){const t=e.domain().length,[n,r]=e.range(),i=e.paddingInner?e.paddingInner():1,o=e.paddingOuter?e.paddingOuter():e.padding(),c=t-i,d=Math.abs(r-n)/Math.max(1,c+2*o);return(d-Math.floor(d))*c}(e)<=30&&e.scale.round(!0)}function c5(e){const t=e.scale.domain().length+f5(e);if(!(t>2))return e.range;const[n,r]=e.range;return Array.from({length:t},(i,o)=>n+o/(t-1)*(r-n))}function AS(e,t,n){return u5(e,void 0===n?void 0:[{hint:n}],{...t})}function u5(e,t=[],n={}){const r=function ete(e,t,{type:n,domain:r,range:i,scheme:o,pivot:c,projection:d}){if("fx"===e||"fy"===e)return"band";("x"===e||"y"===e)&&null!=d&&(n=h5);for(const{type:E}of t)if(void 0!==E)if(void 0===n)n=E;else if(n!==E)throw new Error(`scale incompatible with channel: ${n} !== ${E}`);if(n===h5)return;if(void 0!==n)return n;if(void 0===r&&!t.some(({value:E})=>void 0!==E))return;const p=ni.get(e);if(p===hx)return"sqrt";if(p===fx||p===dx)return"linear";if(p===px)return"ordinal";if((r||i||[]).length>2)return kS(p);if(void 0!==r)return MN(r)?kS(p):Tl(r)?"utc":p!==Tc||null==c&&!qN(o)?"linear":"diverging";const v=t.map(({value:E})=>E).filter(E=>void 0!==E);return v.some(MN)?kS(p):v.some(Tl)?"utc":p!==Tc||null==c&&!qN(o)?"linear":"diverging"}(e,t,n);if(void 0===n.type&&void 0===n.domain&&void 0===n.range&&null==n.interval&&"fx"!==e&&"fy"!==e&&Mf({type:r})){const i=t.map(({value:o})=>o).filter(o=>void 0!==o);i.some(Tl)?Sf(`Warning: some data associated with the ${e} scale are dates. Dates are typically associated with a "utc" or "time" scale rather than a "${Rm(r)}" scale. If you are using a bar mark, you probably want a rect mark with the interval option instead; if you are using a group transform, you probably want a bin transform instead. If you want to treat this data as ordinal, you can specify the interval of the ${e} scale (e.g., d3.utcDay), or you can suppress this warning by setting the type of the ${e} scale to "${Rm(r)}".`):i.some(LQ)?Sf(`Warning: some data associated with the ${e} scale are strings that appear to be dates (e.g., YYYY-MM-DD). If these strings represent dates, you should parse them to Date objects. Dates are typically associated with a "utc" or "time" scale rather than a "${Rm(r)}" scale. If you are using a bar mark, you probably want a rect mark with the interval option instead; if you are using a group transform, you probably want a bin transform instead. If you want to treat this data as ordinal, you can suppress this warning by setting the type of the ${e} scale to "${Rm(r)}".`):i.some(NQ)&&Sf(`Warning: some data associated with the ${e} scale are strings that appear to be numbers. If these strings represent numbers, you should parse or coerce them to numbers. Numbers are typically associated with a "linear" scale rather than a "${Rm(r)}" scale. If you want to treat this data as ordinal, you can specify the interval of the ${e} scale (e.g., 1 for integers), or you can suppress this warning by setting the type of the ${e} scale to "${Rm(r)}".`)}switch(n.type=r,r){case"diverging":case"diverging-sqrt":case"diverging-pow":case"diverging-log":case"diverging-symlog":case"cyclical":case"sequential":case"linear":case"sqrt":case"threshold":case"quantile":case"pow":case"log":case"symlog":n=wx(t,n,ax);break;case"identity":switch(ni.get(e)){case Ic:n=wx(t,n,ax);break;case px:n=wx(t,n,nte)}break;case"utc":case"time":n=wx(t,n,AQ)}switch(r){case"diverging":return Oee(e,t,n);case"diverging-sqrt":return function Lee(e,t,n){return JN(e,t,{...n,exponent:.5})}(e,t,n);case"diverging-pow":return JN(e,t,n);case"diverging-log":return Nee(e,t,n);case"diverging-symlog":return zee(e,t,n);case"categorical":case"ordinal":case b_:return function qee(e,t,{type:n,interval:r,domain:i,range:o,scheme:c,unknown:d,...p}){let v;if(r=p_(r,n),void 0===i&&(i=n5(t,r,e)),ni.get(e)===px)v=function Xee(e){return{fill:r5(e,"fill"),stroke:r5(e,"stroke")}}(t),o=void 0===o?function Yee(e){return ea(e.fill)?qJ:GJ}(v):Ho(o,yS);else if(ni.get(e)===Tc&&(void 0===o&&("ordinal"===n||n===b_)&&(o=function vee(e,t="greys"){const n=new Set,[r,i]=vx(t,2);for(const o of e)if(null!=o)if(!0===o)n.add(i);else{if(!1!==o)return;n.add(r)}return[...n]}(i,c),void 0!==o&&(c=void 0)),void 0===c&&void 0===o&&(c="ordinal"===n?"turbo":"tableau10"),void 0!==c))if(void 0!==o){const E=ES(c),D=o[0],I=o[1]-o[0];o=({length:P})=>Sl(N=>E(D+I*N),P)}else o=HN(c);if(d===TD)throw new Error(`implicit unknown on ${e} scale is not supported`);return e5(e,AD().unknown(d),t,{...p,type:n,domain:i,range:o,hint:v})}(e,t,n);case"cyclical":case"sequential":case"linear":return function wee(e,t,n){return __(e,OD(),t,n)}(e,t,n);case"sqrt":return function Cee(e,t,n){return YN(e,t,{...n,exponent:.5})}(e,t,n);case"threshold":return SS(e,0,n);case"quantile":return See(e,t,n);case"quantize":return function Mee(e,t,{range:n,n:r=(void 0===n?5:(n=[...n]).length),scheme:i="rdylbu",domain:o=KN(e,t),unknown:c,interpolate:d,reverse:p}){const[v,E]=Qp(o);let D;return void 0===n?(D=U0(v,E,r),D[0]<=v&&D.splice(0,1),D[D.length-1]>=E&&D.pop(),r=D.length+1,n=void 0!==d?Sl(d,r):ni.get(e)===Tc?vx(i,r):void 0):(D=Sl(Uo(v,E),r+1).slice(1,-1),v instanceof Date&&(D=D.map(I=>new Date(I)))),g_(Mc(o))<0&&D.reverse(),SS(e,0,{domain:D,range:n,reverse:p,unknown:c})}(e,t,n);case"pow":return YN(e,t,n);case"log":return Eee(e,t,n);case"symlog":return Dee(e,t,n);case"utc":return function Gee(e,t,n){return QN(e,function gJ(){return wc.apply(jD(sK,aK,Ec,xm,vm,r_,Ub,Bb,wu,jb).domain([Date.UTC(2e3,0,1),Date.UTC(2e3,0,2)]),arguments)}(),t,n)}(e,t,n);case"time":return function Hee(e,t,n){return QN(e,function mJ(){return wc.apply(jD(lK,cK,Cc,bm,_m,ym,Vb,zb,wu,$b).domain([new Date(2e3,0,1),new Date(2e3,0,2)]),arguments)}(),t,n)}(e,t,n);case"point":return function Zee(e,t,{align:n=.5,padding:r=.5,...i}){return t5(function $Y(){return kO(Ob.apply(null,arguments).paddingInner(1))}().align(n).padding(r),t,i,e)}(e,t,n);case"band":return function Wee(e,t,{align:n=.5,padding:r=.1,paddingInner:i=r,paddingOuter:o=("fx"===e||"fy"===e?0:r),...c}){return t5(Ob().align(n).paddingInner(i).paddingOuter(o),t,c,e)}(e,t,n);case"identity":return ni.get(e)===Ic?function Tee(){return{type:"identity",scale:OO()}}():{type:"identity"};case void 0:return;default:throw new Error(`unknown scale type: ${r}`)}}function Rm(e){return"symbol"==typeof e?e.description:e}const h5={toString:()=>"projection"};function kS(e){switch(e){case Ic:return"point";case Tc:return b_;default:return"ordinal"}}function d5({type:e}){return"time"===e||"utc"===e}function Mf({type:e}){return"ordinal"===e||"point"===e||"band"===e||e===b_}function f5({type:e}){return"threshold"===e}function xx(e){if(void 0===e)return!0;const t=e.domain(),n=e(t[0]);for(let r=1,i=t.length;r((n?.length!==r.length||n.some((i,o)=>i!==r[o]))&&(n=r,t=e(...r)),t)}const ste=PS(e=>new Intl.NumberFormat(e));function m5(e){return function ite(e,t){if(e instanceof Date||(e=new Date(+e)),isNaN(e))return"function"==typeof t?t(e):t;const n=e.getUTCHours(),r=e.getUTCMinutes(),i=e.getUTCSeconds(),o=e.getUTCMilliseconds();return`${function ote(e){return e<0?`-${Tu(-e,6)}`:e>9999?`+${Tu(e,6)}`:Tu(e,4)}(e.getUTCFullYear())}-${Tu(e.getUTCMonth()+1,2)}-${Tu(e.getUTCDate(),2)}${n||r||i||o?`T${Tu(n,2)}:${Tu(r,2)}${i||o?`:${Tu(i,2)}${o?`.${Tu(o,3)}`:""}`:""}Z`:""}`}(e,"Invalid Date")}PS((e,t)=>new Intl.DateTimeFormat(e,{timeZone:"UTC",...t&&{month:t}})),PS((e,t)=>new Intl.DateTimeFormat(e,{timeZone:"UTC",...t&&{weekday:t}}));const Cx=function ute(e="en-US"){const t=function cte(e="en-US"){const t=ste(e);return n=>null==n||isNaN(n)?void 0:t.format(n)}(e);return n=>(n instanceof Date?m5:"number"==typeof n?t:Il)(n)}(),ta=typeof window<"u"&&window.devicePixelRatio>1?0:.5;let hte=0;function g5(){return"plot-clip-"+ ++hte}function dte(e,{title:t,href:n,ariaLabel:r,ariaDescription:i,ariaHidden:o,target:c,fill:d,fillOpacity:p,stroke:v,strokeWidth:E,strokeOpacity:D,strokeLinejoin:I,strokeLinecap:P,strokeMiterlimit:N,strokeDasharray:G,strokeDashoffset:U,opacity:Z,mixBlendMode:ne,paintOrder:X,pointerEvents:re,shapeRendering:fe},{ariaLabel:ve,fill:Re="currentColor",fillOpacity:We,stroke:Ke="none",strokeOpacity:lt,strokeWidth:Ue,strokeLinecap:st,strokeLinejoin:Fe,strokeMiterlimit:le,paintOrder:de}){null===Re&&(d=null,p=null),null===Ke&&(v=null,D=null),ea(Re)?!ea(Ke)&&!ea(d)&&(Ke="none"):ea(Ke)&&!ea(v)&&(Re="none");const[pe,Oe]=Im(d,Re),[Ye,Ze]=Ps(p,We),[et,_t]=Im(v,Ke),[Ft,ir]=Ps(D,lt),[jn,pr]=Ps(Z);m_(_t)||(void 0===E&&(E=Ue),void 0===P&&(P=st),void 0===I&&(I=Fe),void 0===N&&!function VQ(e){return/^\s*round\s*$/i.test(e)}(I)&&(N=le),!m_(Oe)&&void 0===X&&(X=de));const[xi,Wn]=Ps(E);return null!==Re&&(e.fill=ls(Oe,"currentColor"),e.fillOpacity=x_(Ze,1)),null!==Ke&&(e.stroke=ls(_t,"none"),e.strokeWidth=x_(Wn,1),e.strokeOpacity=x_(ir,1),e.strokeLinejoin=ls(I,"miter"),e.strokeLinecap=ls(P,"butt"),e.strokeMiterlimit=x_(N,4),e.strokeDasharray=ls(G,"none"),e.strokeDashoffset=ls(U,"0")),e.target=Il(c),e.ariaLabel=Il(ve),e.ariaDescription=Il(i),e.ariaHidden=Il(o),e.opacity=x_(pr,1),e.mixBlendMode=ls(ne,"normal"),e.paintOrder=ls(X,"normal"),e.pointerEvents=ls(re,"auto"),e.shapeRendering=ls(fe,"auto"),{title:{value:t,optional:!0},href:{value:n,optional:!0},ariaLabel:{value:r,optional:!0},fill:{value:pe,scale:"auto",optional:!0},fillOpacity:{value:Ye,scale:"auto",optional:!0},stroke:{value:et,scale:"auto",optional:!0},strokeOpacity:{value:Ft,scale:"auto",optional:!0},strokeWidth:{value:xi,optional:!0},opacity:{value:jn,scale:"auto",optional:!0}}}function mte(e,t){t&&e.text(n=>Cx(t[n]))}function gte(e,t){t&&e.text(([n])=>Cx(t[n]))}function Fm(e,{target:t},{ariaLabel:n,title:r,fill:i,fillOpacity:o,stroke:c,strokeOpacity:d,strokeWidth:p,opacity:v,href:E}){n&&fn(e,"aria-label",D=>n[D]),i&&fn(e,"fill",D=>i[D]),o&&fn(e,"fill-opacity",D=>o[D]),c&&fn(e,"stroke",D=>c[D]),d&&fn(e,"stroke-opacity",D=>d[D]),p&&fn(e,"stroke-width",D=>p[D]),v&&fn(e,"opacity",D=>v[D]),E&&y5(e,D=>E[D],t),function fte(e,t){t&&e.filter(n=>oS(t[n])).append("title").call(mte,t)}(e,r)}function yte(e,{target:t},{ariaLabel:n,title:r,fill:i,fillOpacity:o,stroke:c,strokeOpacity:d,strokeWidth:p,opacity:v,href:E}){n&&fn(e,"aria-label",([D])=>n[D]),i&&fn(e,"fill",([D])=>i[D]),o&&fn(e,"fill-opacity",([D])=>o[D]),c&&fn(e,"stroke",([D])=>c[D]),d&&fn(e,"stroke-opacity",([D])=>d[D]),p&&fn(e,"stroke-width",([D])=>p[D]),v&&fn(e,"opacity",([D])=>v[D]),E&&y5(e,([D])=>E[D],t),function pte(e,t){t&&e.filter(([n])=>oS(t[n])).append("title").call(gte,t)}(e,r)}function Bh(e,t,n,r){(function wte(e,t,n,r){let i;switch(t.clip){case"frame":{const{width:o,height:c,marginLeft:d,marginRight:p,marginTop:v,marginBottom:E}=n,D=g5();i=`url(#${D})`,e=Go("svg:g",r).call(I=>I.append("svg:clipPath").attr("id",D).append("rect").attr("x",d).attr("y",v).attr("width",o-p-d).attr("height",c-v-E)).each(function(){this.appendChild(e.node()),e.node=()=>this});break}case"sphere":{const{projection:o}=r;if(!o)throw new Error('the "sphere" clip option requires a projection');const c=g5();i=`url(#${c})`,e.append("clipPath").attr("id",c).append("path").attr("d",aD(o)({type:"Sphere"}));break}}fn(e,"aria-label",t.ariaLabel),fn(e,"aria-description",t.ariaDescription),fn(e,"aria-hidden",t.ariaHidden),fn(e,"clip-path",i)})(e,t,n,r),fn(e,"fill",t.fill),fn(e,"fill-opacity",t.fillOpacity),fn(e,"stroke",t.stroke),fn(e,"stroke-width",t.strokeWidth),fn(e,"stroke-opacity",t.strokeOpacity),fn(e,"stroke-linejoin",t.strokeLinejoin),fn(e,"stroke-linecap",t.strokeLinecap),fn(e,"stroke-miterlimit",t.strokeMiterlimit),fn(e,"stroke-dasharray",t.strokeDasharray),fn(e,"stroke-dashoffset",t.strokeDashoffset),fn(e,"shape-rendering",t.shapeRendering),fn(e,"paint-order",t.paintOrder),fn(e,"pointer-events",t.pointerEvents)}function Vh(e,t){(function Cte(e,t,n){null!=n&&e.style(t,n)})(e,"mix-blend-mode",t.mixBlendMode),fn(e,"opacity",t.opacity)}function y5(e,t,n){e.each(function(r){const i=t(r);if(null!=i){const o=this.ownerDocument.createElementNS(tm.svg,"a");o.setAttribute("fill","inherit"),o.setAttributeNS(tm.xlink,"href",i),null!=n&&o.setAttribute("target",n),this.parentNode.insertBefore(o,this).appendChild(this)}})}function fn(e,t,n){null!=n&&e.attr(t,n)}function Uh(e,t,{x:n,y:r},i=ta,o=ta){i+=t.dx,o+=t.dy,n?.bandwidth&&(i+=n.bandwidth()/2),r?.bandwidth&&(o+=r.bandwidth()/2),(i||o)&&e.attr("transform",`translate(${i},${o})`)}function ls(e,t){if((e=Il(e))!==t)return e}function x_(e,t){if((e=fi(e))!==t)return e}const Ete=/^-?([_a-z]|[\240-\377]|\\[0-9a-f]{1,6}(\r\n|[ \t\r\n\f])?|\\[^\r\n\f0-9a-f])([_a-z0-9-]|[\240-\377]|\\[0-9a-f]{1,6}(\r\n|[ \t\r\n\f])?|\\[^\r\n\f0-9a-f])*$/i;function RS(e){if(void 0===e)return`plot-${Math.random().toString(16).slice(2)}`;if(!Ete.test(e=`${e}`))throw new Error(`invalid class name: ${e}`);return e}function FS(e,t){if("string"==typeof t)e.property("style",t);else if(null!=t)for(const n of e)Object.assign(n.style,t)}function OS({frameAnchor:e},{width:t,height:n,marginTop:r,marginRight:i,marginBottom:o,marginLeft:c}){return[/left$/.test(e)?c:/right$/.test(e)?t-i:(c+t-i)/2,/^top/.test(e)?r:/^bottom/.test(e)?n-o:(r+n-o)/2]}function Ste({x:e,y:t,fy:n,fx:r},i,{projection:o,aspectRatio:c},{width:d,marginTopDefault:p,marginRightDefault:v,marginBottomDefault:E,marginLeftDefault:D}){const I=n?n.scale.domain().length:1,P=function yee(e,t){if("function"==typeof e?.stream)return.618;if(Tm(e)&&(e=e.type),null==e)return function _ee(e){for(const t of e)if(t.channels.geometry)return!0;return!1}(t)?.618:void 0;if("function"!=typeof e){const{aspectRatio:n}=BN(e);if(n)return n}return.618}(o,i);if(P){const G=r?r.scale.domain().length:1,Z=Math.max(.1,Math.min(10,(1.1*I-.1)/(1.1*G-.1)*P));return Math.round((d-D-v)*Z+p+E)}const N=t?Mf(t)?t.scale.domain().length:Math.max(7,17/I):1;if(null!=c){if(c=+c,!(isFinite(c)&&c>0))throw new Error(`invalid aspectRatio: ${c}`);const G=_5("y",t)/(_5("x",e)*c),U=r?r.scale.bandwidth():1,Z=n?n.scale.bandwidth():1;return(G*(U*(d-D-v)-e.insetLeft-e.insetRight)+t.insetTop+t.insetBottom)/Z+p+E}return!(!t&&!n)*Math.max(1,Math.min(60,N*I))*20+30*!!r+60}function _5(e,t){if(!t)throw new Error(`aspectRatio requires ${e} scale`);const{type:n,domain:r}=t;let i;switch(n){case"linear":case"utc":case"time":i=Number;break;case"pow":{const d=t.scale.exponent();i=p=>Math.pow(p,d);break}case"log":i=Math.log;break;case"point":case"band":return r.length;default:throw new Error(`unsupported ${e} scale for aspectRatio: ${n}`)}const[o,c]=Qp(r);return Math.abs(i(c)-i(o))}function LS(e,{fx:t,fy:n}){const r=d_(e),i=t?.value,o=n?.value;return t&&n?Ay(r,c=>(c.fx=i[c[0]],c.fy=o[c[0]],c),c=>i[c],c=>o[c]):t?Ay(r,c=>(c.fx=i[c[0]],c),c=>i[c]):Ay(r,c=>(c.fy=o[c[0]],c),c=>o[c])}function Ate(e){const t=[],n=new Uint32Array(B0(e,r=>r.length));for(const r of e){let i=0;for(const o of e)r!==o&&(n.set(o,i),i+=o.length);t.push(n.slice(0,i))}return t}const kte=new Map([["top",NS],["right",VS],["bottom",zS],["left",BS],["top-left",Ex(NS,BS)],["top-right",Ex(NS,VS)],["bottom-left",Ex(zS,BS)],["bottom-right",Ex(zS,VS)],["top-empty",function Rte(e,{y:t},{x:n,y:r,empty:i}){if(i)return!1;const o=t?.indexOf(r);if(o>0){const c=t[o-1];return e.find(d=>d.x===n&&d.y===c)?.empty}}],["right-empty",function Lte(e,{x:t},{x:n,y:r,empty:i}){if(i)return!1;const o=t?.indexOf(n);if(od.x===c&&d.y===r)?.empty}}],["bottom-empty",function Fte(e,{y:t},{x:n,y:r,empty:i}){if(i)return!1;const o=t?.indexOf(r);if(od.x===n&&d.y===c)?.empty}}],["left-empty",function Ote(e,{x:t},{x:n,y:r,empty:i}){if(i)return!1;const o=t?.indexOf(n);if(o>0){const c=t[o-1];return e.find(d=>d.x===c&&d.y===r)?.empty}}],["empty",function Nte(e,t,{empty:n}){return n}]]);function NS(e,{y:t},{y:n}){return!t||0===t.indexOf(n)}function zS(e,{y:t},{y:n}){return!t||t.indexOf(n)===t.length-1}function BS(e,{x:t},{x:n}){return!t||0===t.indexOf(n)}function VS(e,{x:t},{x:n}){return!t||t.indexOf(n)===t.length-1}function Ex(e,t){return function(){return e.apply(null,arguments)&&t.apply(null,arguments)}}function US(e,{channels:{fx:t,fy:n},groups:r}){return e.map(t&&n?({x:i,y:o})=>r.get(i)?.get(o)??[]:t?({x:i})=>r.get(i)??[]:({y:i})=>r.get(i)??[])}function v5(e){return Mf(e)&&void 0===e.interval?void 0:"tabular-nums"}function b5(e,t){if(null==t)return t;const n=e(t);if(!n)throw new Error(`scale not found: ${t}`);return n}function x5(e,t={},n,r){let{columns:i,tickFormat:o,fontVariant:c=v5(e),swatchSize:d=15,swatchWidth:p=d,swatchHeight:v=d,marginLeft:E=0,className:D,style:I,width:P}=t;const N=_x(t);D=RS(D),o=function zte(e,t){return void 0===e?Tl(t)?m5:Il:"function"==typeof e?e:("string"==typeof e?Tl(t)?jb:um:Mm)(e)}(o,e.domain);const G=Go("div",N).attr("class",D).attr("style",`\n --swatchWidth: ${+p}px;\n --swatchHeight: ${+v}px;\n `);let U;return null!=i?(U=`\n .${D}-swatch {\n display: flex;\n align-items: center;\n break-inside: avoid;\n padding-bottom: 1px;\n }\n .${D}-swatch::before {\n flex-shrink: 0;\n }\n .${D}-label {\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n }\n `,G.style("columns",i).selectAll().data(e.domain).enter().append("div").attr("class",`${D}-swatch`).call(n,e).call(Z=>Z.append("div").attr("class",`${D}-label`).attr("title",o).text(o))):(U=`\n .${D} {\n display: flex;\n align-items: center;\n min-height: 33px;\n flex-wrap: wrap;\n }\n .${D}-swatch {\n display: inline-flex;\n align-items: center;\n margin-right: 1em;\n }\n `,G.selectAll().data(e.domain).enter().append("span").attr("class",`${D}-swatch`).call(n,e).append(function(){return this.ownerDocument.createTextNode(o.apply(this,arguments))})),G.call(Z=>Z.insert("style","*").text(`\n .${D} {\n font-family: system-ui, sans-serif;\n font-size: 10px;\n margin-bottom: 0.5em;${void 0===E?"":`\n margin-left: ${+E}px;`}${void 0===P?"":`\n width: ${P}px;`}\n }\n ${r(D)}\n ${U}\n `)).style("font-variant",ls(c,"normal")).call(FS,I).node()}const Dx=new Map([["symbol",function Ute(e,{fill:t=(void 0!==e.hint?.fill?e.hint.fill:"none"),fillOpacity:n=1,stroke:r=(void 0!==e.hint?.stroke?e.hint.stroke:ea(t)?"currentColor":"none"),strokeOpacity:i=1,strokeWidth:o=1.5,r:c=4.5,...d}={},p){const[v,E]=Im(t),[D,I]=Im(r),P=b5(p,v),N=b5(p,D),G=c*c*Math.PI;return n=Ps(n)[1],i=Ps(i)[1],o=Ps(o)[1],x5(e,d,U=>U.append("svg").attr("viewBox","-8 -8 16 16").attr("fill","color"===v?Z=>P.scale(Z):null).attr("stroke","color"===D?Z=>N.scale(Z):null).append("path").attr("d",Z=>{const ne=bf();return e.scale(Z).draw(ne,G),ne}),U=>`.${U}-swatch > svg {\n width: var(--swatchWidth);\n height: var(--swatchHeight);\n margin-right: 0.5em;\n overflow: visible;\n fill: ${E};\n fill-opacity: ${n};\n stroke: ${I};\n stroke-width: ${o}px;\n stroke-opacity: ${i};\n }`)}],["color",w5],["opacity",function Hte({type:e,interpolate:t,...n},{legend:r=!0,color:i=Rh(0,0,0),...o}){if(!t)throw new Error(`${e} opacity scales are not supported`);if(!0===r&&(r="ramp"),"ramp"!==`${r}`.toLowerCase())throw new Error(`${r} opacity legends are not supported`);return w5({type:e,...n,interpolate:Gte(i)},{legend:r,...o})}]]);function $S(e,{label:t,ticks:n,tickFormat:r}={},i){return function UQ(e={},...t){let n=e;for(const r of t)for(const i in r)if(void 0===n[i]){const o=r[i];n===e?n={...n,[i]:o}:n[i]=o}return n}(i,e,{label:t,ticks:n,tickFormat:r})}function w5(e,{legend:t=!0,...n}){if(!0===t&&(t="ordinal"===e.type?"swatches":"ramp"),void 0!==e.domain)switch(`${t}`.toLowerCase()){case"swatches":return function Vte(e,{opacity:t,...n}={}){if(!Mf(e)&&!f5(e))throw new Error(`swatches legend requires ordinal or threshold color scale (not ${e.type})`);return x5(e,n,(r,i)=>r.append("svg").attr("fill",i.scale).attr("fill-opacity",Ps(t)[1]).append("rect").attr("width","100%").attr("height","100%"),r=>`.${r}-swatch svg {\n width: var(--swatchWidth);\n height: var(--swatchHeight);\n margin-right: 0.5em;\n }`)}(e,n);case"ramp":return function Bte(e,t){let{label:n=e.label,tickSize:r=6,width:i=240,height:o=44+r,marginTop:c=18,marginRight:d=0,marginBottom:p=16+r,marginLeft:v=0,style:E,ticks:D=(i-v-d)/64,tickFormat:I,fontVariant:P=v5(e),round:N=!0,opacity:G,className:U}=t;const Z=_x(t);U=RS(U),G=Ps(G)[1],null===I&&(I=()=>null);const ne=Go("svg",Z).attr("class",U).attr("font-family","system-ui, sans-serif").attr("font-size",10).attr("width",i).attr("height",o).attr("viewBox",`0 0 ${i} ${o}`).call(st=>st.append("style").text(`\n .${U} {\n display: block;\n background: white;\n height: auto;\n height: intrinsic;\n max-width: 100%;\n overflow: visible;\n }\n .${U} text {\n white-space: pre;\n }\n `)).call(FS,E);let re,X=st=>st.selectAll(".tick line").attr("y1",c+p-o);const fe=N?(st,Fe)=>st.rangeRound(Fe):(st,Fe)=>st.range(Fe),{type:ve,domain:Re,range:We,interpolate:Ke,scale:lt,pivot:Ue}=e;if(Ke){const st=void 0===We?Ke:SD(1===Ke.length?MS(Ke):Ke,We);re=fe(lt.copy(),Sl(Uo(v,i-d),Math.min(Re.length+(void 0!==Ue),void 0===We?1/0:We.length)));const Fe=256,le=Z.document.createElement("canvas");le.width=Fe,le.height=1;const de=le.getContext("2d");for(let pe=0,Oe=Fe-1;pele:"string"==typeof I?um(I):I;re=fe(OD().domain([-1,We.length-1]),[v,i-d]),ne.append("g").attr("fill-opacity",G).selectAll().data(We).enter().append("rect").attr("x",(le,de)=>re(de-1)).attr("y",c).attr("width",(le,de)=>re(de)-re(de-1)).attr("height",o-c-p).attr("fill",le=>le),D=Ho(st,(le,de)=>de),I=le=>Fe(st[le],le)}else re=fe(Ob().domain(Re),[v,i-d]),ne.append("g").attr("fill-opacity",G).selectAll().data(Re).enter().append("rect").attr("x",re).attr("y",c).attr("width",Math.max(0,re.bandwidth()-1)).attr("height",o-c-p).attr("fill",lt),X=()=>{};return ne.append("g").attr("transform",`translate(0,${o-p})`).call(function aq(e){return G0(3,e)}(re).ticks(Array.isArray(D)?null:D,"string"==typeof I?I:void 0).tickFormat("function"==typeof I?I:void 0).tickSize(r).tickValues(Array.isArray(D)?D:null)).attr("font-size",null).attr("font-family",null).attr("font-variant",ls(P,"normal")).call(X).call(st=>st.select(".domain").remove()),void 0!==n&&ne.append("text").attr("x",v).attr("y",c-6).attr("fill","currentColor").attr("font-weight","bold").text(n),ne.node()}(e,n);default:throw new Error(`unknown legend type: ${t}`)}}function Gte(e){const{r:t,g:n,b:r}=Rh(e)||Rh(0,0,0);return i=>`rgba(${t},${n},${r},${i})`}function jS({filter:e,sort:t,reverse:n,transform:r,initializer:i,...o}={},c){if(void 0===r&&(null!=e&&(r=qS(e)),null!=t&&!km(t)&&(r=HS(r,WS(t))),n&&(r=HS(r,ZS))),null!=c&&null!=i)throw new Error("transforms cannot be applied after initializers");return{...o,...(null===t||km(t))&&{sort:t},transform:HS(r,c)}}function Sx({filter:e,sort:t,reverse:n,initializer:r,...i}={},o){return void 0===r&&(null!=e&&(r=qS(e)),null!=t&&!km(t)&&(r=GS(r,WS(t))),n&&(r=GS(r,ZS))),{...i,...(null===t||km(t))&&{sort:t},initializer:GS(r,o)}}function HS(e,t){return null==e?null===t?void 0:t:null==t?null===e?void 0:e:function(n,r){return({data:n,facets:r}=e.call(this,n,r)),t.call(this,Mc(n),r)}}function GS(e,t){return null==e?null===t?void 0:t:null==t?null===e?void 0:e:function(n,r,i,...o){let c,d,p,v,E,D;return({data:d=n,facets:p=r,channels:c}=e.call(this,n,r,i,...o)),({data:E=d,facets:D=p,channels:v}=t.call(this,d,p,{...i,...c},...o)),{data:E,facets:D,channels:{...c,...v}}}}function Mx(e,t){return(null!=e.initializer?Sx:jS)(e,t)}function qS(e){return(t,n)=>{const r=Sc(t,e);return{data:t,facets:n.map(i=>i.filter(o=>r[o]))}}}function ZS(e,t){return{data:e,facets:t.map(n=>n.slice().reverse())}}function WS(e){return("function"==typeof e&&1!==e.length?Wte:C5)(e)}function Wte(e){return(t,n)=>{const r=(i,o)=>e(t[i],t[o]);return{data:t,facets:n.map(i=>i.slice().sort(r))}}}function C5(e){let t,n;if(({channel:t,value:e,order:n=Sm}={...dS(e)}),"function"!=typeof n)switch(`${n}`.toLowerCase()){case"ascending":n=Sm;break;case"descending":n=yN;break;default:throw new Error(`invalid order: ${n}`)}return(r,i,o)=>{let c;if(void 0===t)c=Sc(r,e);else{if(void 0===o)throw new Error("channel sort requires an initializer");if(c=o[t],!c)return{};c=c.value}const d=(p,v)=>n(c[p],c[v]);return{data:r,facets:i.map(p=>p.slice().sort(d))}}}class kl{constructor(t,n={},r={},i){const{facet:o="auto",facetAnchor:c,fx:d,fy:p,sort:v,dx:E=0,dy:D=0,margin:I=0,marginTop:P=I,marginRight:N=I,marginBottom:G=I,marginLeft:U=I,clip:Z,channels:ne}=r;if(this.data=t,this.sort=km(v)?v:null,this.initializer=Sx(r).initializer,this.transform=this.initializer?r.transform:jS(r).transform,null===o||!1===o?this.facet=null:(this.facet=Eu(!0===o?"include":o,"facet",["auto","include","exclude","super"]),this.fx=d,this.fy=p),this.facetAnchor=function Pte(e){if(null==e)return null;const t=kte.get(`${e}`.toLowerCase());if(t)return t;throw new Error(`invalid facet anchor: ${e}`)}(c),n=IN(n),void 0!==ne&&(n={...IN(ne),...n}),void 0!==i&&(n={...dte(this,r,i),...n}),this.channels=Object.fromEntries(Object.entries(n).map(([X,re])=>{const{value:fe}=re;return lx(fe)&&(re={...re,value:fe.value},void 0!==fe.scale&&(re.scale=fe.scale)),[X,re]}).filter(([X,{value:re,optional:fe}])=>{if(null!=re)return!0;if(fe)return!1;throw new Error(`missing channel value: ${X}`)})),this.dx=+E,this.dy=+D,this.marginTop=+P,this.marginRight=+N,this.marginBottom=+G,this.marginLeft=+U,this.clip=function xte(e){return!0===e?e="frame":!1===e&&(e=null),EN(e,"clip",["frame","sphere"])}(Z),"super"===this.facet){if(d||p)throw new Error("super-faceting cannot use fx or fy");for(const X in this.channels){const{scale:re}=n[X];if("x"===re||"y"===re)throw new Error("super-faceting cannot use x or y")}}}initialize(t,n){let r=Mc(this.data);void 0===t&&null!=r&&(t=[d_(r)]);const i=t;null!=this.transform&&(({facets:t,data:r}=this.transform(r,t)),r=Mc(r)),void 0!==t&&(t.original=i);const o=function oee(e,t){return Object.fromEntries(Object.entries(e).map(([n,r])=>[n,y_(t,r,n)]))}(this.channels,r);return null!=this.sort&&function aee(e,t,n,r,i){const{reverse:o,reduce:c=!0,limit:d}=i;for(const p in i){if(!ni.has(p))continue;let{value:v,reverse:E=o,reduce:D=c,limit:I=d}=dS(i[p]);if(void 0===E&&(E="width"===v||"height"===v),null==D||!1===D)continue;const P="fx"===p||"fy"===p?cee(t,r[p]):lee(n,p);if(!P)throw new Error(`missing channel for scale: ${p}`);const N=P.value,[G=0,U=1/0]=zh(I)?I:I<0?[I]:[0,I];if(null==v)P.domain=()=>{let Z=Array.from(new yE(N));return E&&(Z=Z.reverse()),(0!==G||U!==1/0)&&(Z=Z.slice(G,U)),Z};else{const Z="data"===v?e:"height"===v?NN(n,"y1","y2"):"width"===v?NN(n,"x1","x2"):xS(n,v,"y"===v?"y2":"x"===v?"x2":void 0),ne=vS(!0===D?"max":D,Z);P.domain=()=>{let X=Ay(d_(N),re=>ne.reduceIndex(re,Z),re=>N[re]);return X=bE(X,E?hee:uee),(0!==G||U!==1/0)&&(X=X.slice(G,U)),X.map(wN)}}}}(r,t,o,n,this.sort),{data:r,facets:t,channels:o}}filter(t,n,r){for(const i in n){const{filter:o=Ml}=n[i];if(null!==o){const c=r[i];t=t.filter(d=>o(c[d]))}}return t}project(t,n,r){yx("x","y",t,n,r),yx("x1","y1",t,n,r),yx("x2","y2",t,n,r)}scale(t,n,r){const i=function see(e,t){const n=Object.fromEntries(Object.entries(e).map(([r,{scale:i,value:o}])=>{const c=null==i?null:t[i];return[r,null==c?o:Ho(o,c)]}));return n.channels=e,n}(t,n);return r.projection&&this.project(t,i,r),i}}function E5(...e){return e.plot=kl.prototype.plot,e}const D5=Math.PI/180;function S5({inset:e,insetLeft:t,insetRight:n,...r}={}){return[t,n]=I5(e,t,n),{inset:e,insetLeft:t,insetRight:n,...r}}function M5({inset:e,insetTop:t,insetBottom:n,...r}={}){return[t,n]=I5(e,t,n),{inset:e,insetTop:t,insetBottom:n,...r}}function I5(e,t,n){return void 0===e&&void 0===t&&void 0===n?ta?[1,0]:[.5,.5]:[t,n]}function T5(e,{interval:t}){return(e={...dS(e)}).interval=hS(void 0===e.interval?t:e.interval),e}function Ix(e,t,n,r){const{[e]:i,[`${e}1`]:o,[`${e}2`]:c}=n,{value:d,interval:p}=T5(i,n);if(null==d||null==p&&!r)return n;const v=f_(i);if(null==p){let P;const N={transform:G=>P||(P=Sc(G,d)),label:v};return{...n,[e]:void 0,[`${e}1`]:void 0===o?N:o,[`${e}2`]:void 0===c?N:c}}let E,D;function I(P){return void 0!==D&&P===E?D:D=Ho(Sc(E=P,d),N=>p.floor(N))}return t({...n,[e]:void 0,[`${e}1`]:void 0===o?{transform:I,label:v}:o,[`${e}2`]:void 0===c?{transform:P=>I(P).map(N=>p.offset(N)),label:v}:c})}function A5(e,t,n){const{[e]:r}=n,{value:i,interval:o}=T5(r,n);return null==i||null==o?n:t({...n,[e]:{label:f_(r),transform:c=>{const d=Ho(Sc(c,i),v=>o.floor(v)),p=d.map(v=>o.offset(v));return d.map(Tl(d)?(v,E)=>null==v||isNaN(v=+v)||null==(E=p[E])||isNaN(E=+E)?void 0:new Date((v+E)/2):(v,E)=>null==v||null==(E=p[E])?NaN:(+v+ +E)/2)}}})}const k5={ariaLabel:"rule",fill:null,stroke:"currentColor"};class Qte extends kl{constructor(t,n={}){const{x:r,y1:i,y2:o,inset:c=0,insetTop:d=c,insetBottom:p=c}=n;super(t,{x:{value:r,scale:"x",optional:!0},y1:{value:i,scale:"y",optional:!0},y2:{value:o,scale:"y",optional:!0}},n,k5),this.insetTop=fi(d),this.insetBottom=fi(p)}render(t,n,r,i,o){const{x:c,y:d}=n,{x:p,y1:v,y2:E}=r,{width:D,height:I,marginTop:P,marginRight:N,marginLeft:G,marginBottom:U}=i,{insetTop:Z,insetBottom:ne}=this;return Go("svg:g",o).call(Bh,this,i).call(Uh,this,{x:p&&c},ta,0).call(X=>X.selectAll().data(t).enter().append("line").call(Vh,this).attr("x1",p?re=>p[re]:(G+D-N)/2).attr("x2",p?re=>p[re]:(G+D-N)/2).attr("y1",v&&!xx(d)?re=>v[re]+Z:P+Z).attr("y2",E&&!xx(d)?d.bandwidth?re=>E[re]+d.bandwidth()-ne:re=>E[re]-ne:I-U-ne).call(Fm,this,r)).node()}}class ene extends kl{constructor(t,n={}){const{x1:r,x2:i,y:o,inset:c=0,insetRight:d=c,insetLeft:p=c}=n;super(t,{y:{value:o,scale:"y",optional:!0},x1:{value:r,scale:"x",optional:!0},x2:{value:i,scale:"x",optional:!0}},n,k5),this.insetRight=fi(d),this.insetLeft=fi(p)}render(t,n,r,i,o){const{x:c,y:d}=n,{y:p,x1:v,x2:E}=r,{width:D,height:I,marginTop:P,marginRight:N,marginLeft:G,marginBottom:U}=i,{insetLeft:Z,insetRight:ne}=this;return Go("svg:g",o).call(Bh,this,i,o).call(Uh,this,{y:p&&d},0,ta).call(X=>X.selectAll().data(t).enter().append("line").call(Vh,this).attr("x1",v&&!xx(c)?re=>v[re]+Z:G+Z).attr("x2",E&&!xx(c)?c.bandwidth?re=>E[re]+c.bandwidth()-ne:re=>E[re]-ne:D-N-ne).attr("y1",p?re=>p[re]:(P+I-U)/2).attr("y2",p?re=>p[re]:(P+I-U)/2).call(Fm,this,r)).node()}}function tne(e,t){let{x:n=Cu,y:r,y1:i,y2:o,...c}=function Yte(e={}){return Ix("y",M5,e)}(t);return[i,o]=P5(r,i,o),new Qte(e,{...c,x:n,y1:i,y2:o})}function nne(e,t){let{y:n=Cu,x:r,x1:i,x2:o,...c}=function Xte(e={}){return Ix("x",S5,e)}(t);return[i,o]=P5(r,i,o),new ene(e,{...c,y:n,x1:i,x2:o})}function P5(e,t,n){if(void 0===e){if(void 0===t){if(void 0!==n)return[0,n]}else if(void 0===n)return[0,t]}else{if(void 0===t)return void 0===n?[0,e]:[e,n];if(void 0===n)return[e,t]}return[t,n]}function XS(e,...t){let n=t.length;for(let r=0,i=!0;r{let i=e[0];for(let o=0;oSc(t,e,Float64Array),label:f_(e)}),optional:!0},text:{value:o,filter:oS,optional:!0}},n,rne),this.rotate=re,this.textAnchor=ls(d,"middle"),this.lineAnchor=Eu(p,"lineAnchor",["top","middle","bottom"]),this.lineHeight=+v,this.lineWidth=+E,this.textOverflow=function ine(e){return null==e?null:Eu(e,"textOverflow",["clip","ellipsis","clip-start","clip-end","ellipsis-start","ellipsis-middle","ellipsis-end"]).replace(/^(clip|ellipsis)$/,"$1-end")}(D),this.monospace=!!I,this.fontFamily=Il(P),this.fontSize=ve,this.fontStyle=Il(G),this.fontVariant=Il(U),this.fontWeight=Il(Z),this.frameAnchor=pS(c),!(this.lineWidth>=0))throw new Error(`invalid lineWidth: ${E}`);var e;this.splitLines=function pne({monospace:e,lineWidth:t,textOverflow:n}){if(null!=n||t==1/0)return o=>o.split(/\r\n?|\n/g);const r=e?N5:L5,i=100*t;return o=>function dne(e,t,n){const r=[];let i,o=0;for(const[c,d,p]of function*fne(e){let t=0,n=0;const r=e.length;for(;ni&&n(e,i,d)>t&&(r.push(e.slice(i,o)+("\xad"===e[o-1]?"-":"")),i=c),p?(r.push(e.slice(i,d)),i=void 0):o=d;return r}(o,i,r)}(this),this.clipLine=function mne({monospace:e,lineWidth:t,textOverflow:n}){if(null==n||t==1/0)return o=>o;const r=e?N5:L5,i=100*t;switch(n){case"clip-start":return o=>B5(o,i,r,"");case"clip-end":return o=>z5(o,i,r,"");case"ellipsis-start":return o=>B5(o,i,r,"\u2026");case"ellipsis-middle":return o=>function gne(e,t,n,r){const i=n(e=e.trim());if(i<=t)return e;const o=n(r)/2,[c,d]=Tx(e,t/2,n,o),[p]=Tx(e,i-t/2-d+o,n,-o);return p<0?r:e.slice(0,c).trimEnd()+r+e.slice(Om(e,p)).trimStart()}(o,i,r,"\u2026");case"ellipsis-end":return o=>z5(o,i,r,"\u2026")}}(this)}render(t,n,r,i,o){const{x:c,y:d}=n,{x:p,y:v,rotate:E,text:D,title:I,fontSize:P}=r,{rotate:N}=this,[G,U]=OS(this,i);return Go("svg:g",o).call(Bh,this,i,o).call(lne,this,D,i).call(Uh,this,{x:p&&c,y:v&&d}).call(Z=>Z.selectAll().data(t).enter().append("text").call(Vh,this).call(one,this,D,I).attr("transform",XS`translate(${p?ne=>p[ne]:G},${v?ne=>v[ne]:U})${E?ne=>` rotate(${E[ne]})`:N?` rotate(${N})`:""}`).call(fn,"font-size",P&&(ne=>P[ne])).call(Fm,this,r)).node()}}function one(e,t,n,r){if(!n)return;const{lineAnchor:i,lineHeight:o,textOverflow:c,splitLines:d,clipLine:p}=t;e.each(function(v){const E=d(Cx(n[v])??"").map(p),D=E.length,I="top"===i?.71:"bottom"===i?1-D:(164-100*D)/200;if(D>1)for(let P=0;Pt){for(o+=r;o>t&&c>0;)d=c,c=i.pop(),o-=n(e,c,d);return[c,t-o]}o+=v,i.push(c)}return[-1,0]}function z5(e,t,n,r){e=e.trim();const i=n(r),[o]=Tx(e,t,n,i);return o<0?e:e.slice(0,o).trimEnd()+r}function B5(e,t,n,r){const i=n(e=e.trim());if(i<=t)return e;const o=n(r),[c]=Tx(e,i-t+o,n,-o);return c<0?r:r+e.slice(Om(e,c)).trimStart()}const KS=/[\p{Combining_Mark}\p{Emoji_Modifier}]+/uy,V5=/\p{Extended_Pictographic}/uy;function Om(e,t){return t+=function yne(e,t){const n=e.charCodeAt(t);if(n>=55296&&n<56320){const r=e.charCodeAt(t+1);return r>=56320&&r<57344}return!1}(e,t)?2:1,function vne(e,t){return!U5(e,t)&&(KS.lastIndex=t,KS.test(e))}(e,t)&&(t=KS.lastIndex),function _ne(e,t){return 8205===e.charCodeAt(t)}(e,t)?Om(e,t+1):t}function U5(e,t){return e.charCodeAt(t)<128}function $5(e,t){return!U5(e,t)&&(V5.lastIndex=t,V5.test(e))}const j5={ariaLabel:"vector",fill:"none",stroke:"currentColor",strokeWidth:1.5,strokeLinejoin:"round",strokeLinecap:"round"},H5=3.5,bne=5*H5,G5={draw(e,t,n){const r=t*n/bne;e.moveTo(0,0),e.lineTo(0,-t),e.moveTo(-r,r-t),e.lineTo(0,-t),e.lineTo(r,r-t)}},xne=new Map([["arrow",G5],["spike",{draw(e,t,n){e.moveTo(-n,0),e.lineTo(0,-t),e.lineTo(n,0)}}]]);class JS extends kl{constructor(t,n={}){const{x:r,y:i,r:o=H5,length:c,rotate:d,shape:p=G5,anchor:v="middle",frameAnchor:E}=n,[D,I]=Ps(c,12),[P,N]=Ps(d,0);super(t,{x:{value:r,scale:"x",optional:!0},y:{value:i,scale:"y",optional:!0},length:{value:D,scale:"length",optional:!0},rotate:{value:P,optional:!0}},n,j5),this.r=+o,this.length=I,this.rotate=N,this.shape=function Cne(e){if(function wne(e){return e&&"function"==typeof e.draw}(e))return e;const t=xne.get(`${e}`.toLowerCase());if(t)return t;throw new Error(`invalid shape: ${e}`)}(p),this.anchor=Eu(v,"anchor",["start","middle","end"]),this.frameAnchor=pS(E)}render(t,n,r,i,o){const{x:c,y:d}=n,{x:p,y:v,length:E,rotate:D}=r,{length:I,rotate:P,anchor:N,shape:G,r:U}=this,[Z,ne]=OS(this,i);return Go("svg:g",o).call(Bh,this,i,o).call(Uh,this,{x:p&&c,y:v&&d}).call(X=>X.selectAll().data(t).enter().append("path").call(Vh,this).attr("transform",XS`translate(${p?re=>p[re]:Z},${v?re=>v[re]:ne})${D?re=>` rotate(${D[re]})`:P?` rotate(${P})`:""}${"start"===N?"":"end"===N?E?re=>` translate(0,${E[re]})`:` translate(0,${I})`:E?re=>` translate(0,${E[re]/2})`:` translate(0,${I/2})`}`).attr("d",E?re=>{const fe=bf();return G.draw(fe,E[re],U),fe}:(()=>{const re=bf();return G.draw(re,I,U),re})()).call(Fm,this,r)).node()}}function Dne(e,t={}){const{x:n=Cu,...r}=t;return new JS(e,{...r,x:n})}function Sne(e,t={}){const{y:n=Cu,...r}=t;return new JS(e,{...r,y:n})}function $h(e,t){return arguments.length<2&&!zh(e)&&(t=e,e=null),void 0===t&&(t={}),[e,t]}function Ax({anchor:e}={},t){return void 0===e?t[0]:Eu(e,"anchor",t)}function Z5(e){return Ax(e,["left","right"])}function W5(e){return Ax(e,["right","left"])}function X5(e){return Ax(e,["bottom","top"])}function Y5(e){return Ax(e,["top","bottom"])}function K5(){const[e,t]=$h(...arguments);return Q5("y",Z5(t),e,t)}function Mne(){const[e,t]=$h(...arguments);return Q5("fy",W5(t),e,t)}function J5(){const[e,t]=$h(...arguments);return e4("x",X5(t),e,t)}function Ine(){const[e,t]=$h(...arguments);return e4("fx",Y5(t),e,t)}function Q5(e,t,n,{color:r="currentColor",opacity:i=1,stroke:o=r,strokeOpacity:c=i,strokeWidth:d=1,fill:p=r,fillOpacity:v=i,textAnchor:E,textStroke:D,textStrokeOpacity:I,textStrokeWidth:P,tickSize:N=("y"===e?6:0),tickPadding:G,tickRotate:U,x:Z,marginTop:ne=20,marginRight:X=("right"===t?40:0),marginBottom:re=20,marginLeft:fe=("left"===t?40:0),label:ve,labelOffset:Re,labelAnchor:We,...Ke}){return N=fi(N),G=fi(G),U=fi(U),void 0!==We&&(We=Eu(We,"labelAnchor",["center","top","bottom"])),E5(N&&!ea(o)?function Tne(e,t,n,{strokeWidth:r=1,strokeLinecap:i=null,strokeLinejoin:o=null,facetAnchor:c=t+("y"===e?"-empty":""),frameAnchor:d=t,tickSize:p,inset:v=0,insetLeft:E=v,insetRight:D=v,dx:I=0,y:P=("y"===e?void 0:null),...N}){return Lm(Sne,e,`${e}-axis tick`,n,{strokeWidth:r,strokeLinecap:i,strokeLinejoin:o,facetAnchor:c,frameAnchor:d,y:P,...N,dx:"left"===t?+I-ta+ +E:+I+ta-D,anchor:"start",length:p,shape:"left"===t?Vne:Une})}(e,t,n,{stroke:o,strokeOpacity:c,strokeWidth:d,tickSize:N,tickPadding:G,tickRotate:U,x:Z,...Ke}):null,ea(p)?null:function kne(e,t,n,{facetAnchor:r=t+("y"===e?"-empty":""),frameAnchor:i=t,tickSize:o,tickRotate:c=0,tickPadding:d=Math.max(3,9-o)+(Math.abs(c)>60?4*Math.cos(c*D5):0),tickFormat:p,text:v=("function"==typeof p?p:void 0),textAnchor:E=(Math.abs(c)>60?"middle":"left"===t?"end":"start"),lineAnchor:D=(c>60?"top":c<-60?"bottom":"middle"),fontVariant:I,inset:P=0,insetLeft:N=P,insetRight:G=P,dx:U=0,y:Z=("y"===e?void 0:null),...ne}){return Lm(ane,e,`${e}-axis tick label`,n,{facetAnchor:r,frameAnchor:i,text:void 0===v?null:v,textAnchor:E,lineAnchor:D,fontVariant:I,rotate:c,y:Z,...ne,dx:"left"===t?+U-o-d+ +N:+U+ +o+ +d-G},function(X,re,fe){void 0===I&&(this.fontVariant=o4(X)),void 0===v&&(fe.text=i4(X,re,p))})}(e,t,n,{fill:p,fillOpacity:v,stroke:D,strokeOpacity:I,strokeWidth:P,textAnchor:E,tickSize:N,tickPadding:G,tickRotate:U,x:Z,marginTop:ne,marginRight:X,marginBottom:re,marginLeft:fe,...Ke}),ea(p)||null===ve?null:F5([],{fill:p,fillOpacity:v,...Ke,lineWidth:void 0,textOverflow:void 0,facet:"super",x:null,y:null,initializer:function(lt,Ue,st,Fe,le){const de=Fe[e],{marginTop:pe,marginRight:Oe,marginBottom:Ye,marginLeft:Ze}="y"===e&&le.inset||le,et=We??(de.bandwidth?"center":"top"),_t=Re??("right"===t?Oe:Ze)-3;return"center"===et?(this.textAnchor=void 0,this.lineAnchor="right"===t?"bottom":"top",this.frameAnchor=t,this.rotate=-90):(this.textAnchor="right"===t?"end":"start",this.lineAnchor=et,this.frameAnchor=`${et}-${t}`,this.rotate=0),this.dy="top"===et?3-pe:"bottom"===et?Ye-3:0,this.dx="right"===t?_t:-_t,this.ariaLabel=`${e}-axis label`,{facets:[[0]],channels:{text:{value:[void 0===ve?s4(e,de,et):ve]}}}}}))}function e4(e,t,n,{color:r="currentColor",opacity:i=1,stroke:o=r,strokeOpacity:c=i,strokeWidth:d=1,fill:p=r,fillOpacity:v=i,textAnchor:E,textStroke:D,textStrokeOpacity:I,textStrokeWidth:P,tickSize:N=("x"===e?6:0),tickPadding:G,tickRotate:U,y:Z,marginTop:ne=("top"===t?30:0),marginRight:X=20,marginBottom:re=("bottom"===t?30:0),marginLeft:fe=20,label:ve,labelAnchor:Re,labelOffset:We,...Ke}){return N=fi(N),G=fi(G),U=fi(U),void 0!==Re&&(Re=Eu(Re,"labelAnchor",["center","left","right"])),E5(N&&!ea(o)?function Ane(e,t,n,{strokeWidth:r=1,strokeLinecap:i=null,strokeLinejoin:o=null,facetAnchor:c=t+("x"===e?"-empty":""),frameAnchor:d=t,tickSize:p,inset:v=0,insetTop:E=v,insetBottom:D=v,dy:I=0,x:P=("x"===e?void 0:null),...N}){return Lm(Dne,e,`${e}-axis tick`,n,{strokeWidth:r,strokeLinejoin:o,strokeLinecap:i,facetAnchor:c,frameAnchor:d,x:P,...N,dy:"bottom"===t?+I-ta-D:+I+ta+ +E,anchor:"start",length:p,shape:"bottom"===t?zne:Bne})}(e,t,n,{stroke:o,strokeOpacity:c,strokeWidth:d,tickSize:N,tickPadding:G,tickRotate:U,y:Z,...Ke}):null,ea(p)?null:function Pne(e,t,n,{facetAnchor:r=t+("x"===e?"-empty":""),frameAnchor:i=t,tickSize:o,tickRotate:c=0,tickPadding:d=Math.max(3,9-o)+(Math.abs(c)>=10?4*Math.cos(c*D5):0),tickFormat:p,text:v=("function"==typeof p?p:void 0),textAnchor:E=(Math.abs(c)>=10?c<0^"bottom"===t?"start":"end":"middle"),lineAnchor:D=(Math.abs(c)>=10?"middle":"bottom"===t?"top":"bottom"),fontVariant:I,inset:P=0,insetTop:N=P,insetBottom:G=P,dy:U=0,x:Z=("x"===e?void 0:null),...ne}){return Lm(sne,e,`${e}-axis tick label`,n,{facetAnchor:r,frameAnchor:i,text:void 0===v?null:v,textAnchor:E,lineAnchor:D,fontVariant:I,rotate:c,x:Z,...ne,dy:"bottom"===t?+U+ +o+ +d-G:+U-o-d+ +N},function(X,re,fe){void 0===I&&(this.fontVariant=o4(X)),void 0===v&&(fe.text=i4(X,re,p))})}(e,t,n,{fill:p,fillOpacity:v,stroke:D,strokeOpacity:I,strokeWidth:P,textAnchor:E,tickSize:N,tickPadding:G,tickRotate:U,y:Z,marginTop:ne,marginRight:X,marginBottom:re,marginLeft:fe,...Ke}),ea(p)||null===ve?null:F5([],{fill:p,fillOpacity:v,...Ke,lineWidth:void 0,textOverflow:void 0,facet:"super",x:null,y:null,initializer:function(lt,Ue,st,Fe,le){const de=Fe[e],{marginTop:pe,marginRight:Oe,marginBottom:Ye,marginLeft:Ze}="x"===e&&le.inset||le,et=Re??(de.bandwidth?"center":"right"),_t=We??("top"===t?pe:Ye)-3;return"center"===et?(this.frameAnchor=t,this.textAnchor=void 0):(this.frameAnchor=`${t}-${et}`,this.textAnchor="right"===et?"end":"start"),this.lineAnchor=t,this.dy="top"===t?-_t:_t,this.dx="right"===et?Oe-3:"left"===et?3-Ze:0,this.ariaLabel=`${e}-axis label`,{facets:[[0]],channels:{text:{value:[void 0===ve?s4(e,de,et):ve]}}}}}))}function Rne(){const[e,t]=$h(...arguments);return t4("y",Z5(t),e,t)}function Fne(){const[e,t]=$h(...arguments);return t4("fy",W5(t),e,t)}function One(){const[e,t]=$h(...arguments);return n4("x",X5(t),e,t)}function Lne(){const[e,t]=$h(...arguments);return n4("fx",Y5(t),e,t)}function t4(e,t,n,{y:r=("y"===e?void 0:null),x:i=null,x1:o=("left"===t?i:null),x2:c=("right"===t?i:null),...d}){return Lm(nne,e,`${e}-grid`,n,{y:r,x1:o,x2:c,...r4(d)})}function n4(e,t,n,{x:r=("x"===e?void 0:null),y:i=null,y1:o=("top"===t?i:null),y2:c=("bottom"===t?i:null),...d}){return Lm(tne,e,`${e}-grid`,n,{x:r,y1:o,y2:c,...r4(d)})}function r4({color:e="currentColor",opacity:t=.1,stroke:n=e,strokeOpacity:r=t,strokeWidth:i=1,...o}){return{stroke:n,strokeOpacity:r,strokeWidth:i,...o}}function Lm(e,t,n,r,i,o){let c;const d=e(r,Sx(i,function(p,v,E,D){const{[t]:I}=D;if(!I)throw new Error(`missing scale: ${t}`);let{ticks:P,tickSpacing:N,interval:G}=i;if(d5(I)&&"string"==typeof P&&(G=P,P=void 0),null==p){if(zh(P))p=Mc(P);else if(I.ticks)if(void 0!==P)p=I.ticks(P);else if(G=p_(void 0===G?I.interval:G,I.type),void 0!==G){const[U,Z]=Qp(I.domain());p=G.range(U,G.offset(G.floor(Z)))}else{const[U,Z]=Qp(I.range());P=(Z-U)/(void 0===N?"x"===t?80:35:N),p=I.ticks(P)}else p=I.domain();"y"===t||"x"===t?v=[d_(p)]:(c[t]={scale:t,value:Cu},v=void 0)}return o?.call(this,I,P,c),{data:p,facets:v,channels:Object.fromEntries(Object.entries(c).map(([U,Z])=>[U,{...Z,value:Sc(p,Z.value)}]))}}));return null==r?(c=d.channels,d.channels={}):c={},d.ariaLabel=n,d}function i4(e,t,n){return{value:Nne(e,t,n)}}function Nne(e,t,n){return e.tickFormat?e.tickFormat(zh(t)?null:t,n):void 0===n?Cx:"string"==typeof n?(Tl(e.domain())?jb:um)(n):Mm(n)}const zne={draw(e,t){e.moveTo(0,0),e.lineTo(0,t)}},Bne={draw(e,t){e.moveTo(0,0),e.lineTo(0,-t)}},Vne={draw(e,t){e.moveTo(0,0),e.lineTo(-t,0)}},Une={draw(e,t){e.moveTo(0,0),e.lineTo(t,0)}};function o4(e){return e.bandwidth&&void 0===e.interval?void 0:"tabular-nums"}function s4(e,t,n){const r=t.label;if(t.bandwidth||!r?.inferred)return r;const i=function $ne(e){return Math.sign(g_(e.domain()))*Math.sign(g_(e.range()))}(t);return i?"x"===e||"center"===n?"x"===e==i<0?`\u2190 ${r}`:`${r} \u2192`:`${i<0?"\u2191 ":"\u2193 "}${r}`:r}const jne={ariaLabel:"frame",fill:"none",stroke:"currentColor"},Hne={ariaLabel:"frame",fill:null,stroke:"currentColor",strokeLinecap:"square"};class Gne extends kl{constructor(t={}){const{anchor:n=null,inset:r=0,insetTop:i=r,insetRight:o=r,insetBottom:c=r,insetLeft:d=r,rx:p,ry:v}=t;super(void 0,void 0,t,null==n?jne:Hne),this.anchor=EN(n,"anchor",["top","right","bottom","left"]),this.insetTop=fi(i),this.insetRight=fi(o),this.insetBottom=fi(c),this.insetLeft=fi(d),this.rx=fi(p),this.ry=fi(v)}render(t,n,r,i,o){const{marginTop:c,marginRight:d,marginBottom:p,marginLeft:v,width:E,height:D}=i,{anchor:I,insetTop:P,insetRight:N,insetBottom:G,insetLeft:U,rx:Z,ry:ne}=this,X=v+U,re=E-d-N,fe=c+P,ve=D-p-G;return Go(I?"svg:line":"svg:rect",o).call(Bh,this,i,o).call(Vh,this).call(Uh,this,{}).call("left"===I?Re=>Re.attr("x1",X).attr("x2",X).attr("y1",fe).attr("y2",ve):"right"===I?Re=>Re.attr("x1",re).attr("x2",re).attr("y1",fe).attr("y2",ve):"top"===I?Re=>Re.attr("x1",X).attr("x2",re).attr("y1",fe).attr("y2",fe):"bottom"===I?Re=>Re.attr("x1",X).attr("x2",re).attr("y1",ve).attr("y2",ve):Re=>Re.attr("x",X).attr("y",fe).attr("width",re-X).attr("height",ve-fe).attr("rx",Z).attr("ry",ne)).node()}}function QS(e){return new Gne(e)}function e2(e={}){const{facet:t,style:n,caption:r,ariaLabel:i,ariaDescription:o}=e,c=RS(e.className),d=void 0===e.marks?[]:a4(e.marks),p=function Yne(e,t){if(null==e)return;const{x:n,y:r}=e;if(null==n&&null==r)return;const i=Mc(e.data??n??r);if(void 0===i)throw new Error("missing facet data");const o={};null!=n&&(o.fx=y_(i,{value:n,scale:"fx"})),null!=r&&(o.fy=y_(i,{value:r,scale:"fy"})),t2(o,t);return{channels:o,groups:LS(i,o),data:e.data}}(t,e),v=new Map;for(const Fe of d){const le=c4(Fe,p,e);le&&v.set(Fe,le)}const E=new Map;p&&w_(E,[p]),w_(E,v);const D=a4(function Kne(e,t,n){let{projection:r,x:i={},y:o={},fx:c={},fy:d={},axis:p,grid:v,facet:E={},facet:{axis:D=p,grid:I}=E,x:{axis:P=p,grid:N=(null===P?null:v)}=i,y:{axis:G=p,grid:U=(null===G?null:v)}=o,fx:{axis:Z=D,grid:ne=(null===Z?null:I)}=c,fy:{axis:X=D,grid:re=(null===X?null:I)}=d}=n;(r||!Am(i)&&!u4("x",e))&&(P=N=null),(r||!Am(o)&&!u4("y",e))&&(G=U=null),t.has("fx")||(Z=ne=null),t.has("fy")||(X=re=null),void 0===P&&(P=!Rx(e,"x")),void 0===G&&(G=!Rx(e,"y")),void 0===Z&&(Z=!Rx(e,"fx")),void 0===X&&(X=!Rx(e,"fy")),!0===P&&(P="bottom"),!0===G&&(G="left"),!0===Z&&(Z="top"===P||null===P?"bottom":"top"),!0===X&&(X="right"===G||null===G?"left":"right");const fe=[];return Px(fe,re,Fne,d),kx(fe,X,Mne,"right","left",E,d),Px(fe,ne,Lne,c),kx(fe,Z,Ine,"top","bottom",E,c),Px(fe,U,Rne,o),kx(fe,G,K5,"left","right",n,o),Px(fe,N,One,i),kx(fe,P,J5,"bottom","top",n,i),fe}(d,E,e));for(const Fe of D){const le=c4(Fe,p,e);le&&v.set(Fe,le)}d.unshift(...D);const I=function Mte(e,t){const{fx:n,fy:r}=IS(e,t),i=n?.scale.domain(),o=r?.scale.domain();return i&&o?function jG(...e){const t="function"==typeof e[e.length-1]&&function $G(e){return t=>e(...t)}(e.pop()),n=(e=e.map(UG)).map(BG),r=e.length-1,i=new Array(r+1).fill(0),o=[];if(r<0||n.some(VG))return o;for(;;){o.push(i.map((d,p)=>e[p][d]));let c=r;for(;++i[c]===n[c];){if(0===c)return t?o.map(t):o;i[c--]=0}}}(i,o).map(([c,d],p)=>({x:c,y:d,i:p})):i?i.map((c,d)=>({x:c,i:d})):o?o.map((c,d)=>({y:c,i:d})):void 0}(E,e);if(void 0!==I){const Fe=p?US(I,p):void 0;for(const de of d){if(null===de.facet||"super"===de.facet)continue;const pe=v.get(de);void 0!==pe&&(pe.facetsIndex=null!=de.fx||null!=de.fy?US(I,pe):Fe)}const le=new Set;for(const{facetsIndex:de}of v.values())de?.forEach((pe,Oe)=>{pe?.length>0&&le.add(Oe)});I.forEach(0de.empty=!le.has(pe):de=>de.empty=!1);for(const de of d)if("exclude"===de.facet){const pe=v.get(de);void 0!==pe&&(pe.facetsIndex=Ate(pe.facetsIndex))}}for(const Fe of ni.keys())Am(e[Fe])&&"fx"!==Fe&&"fy"!==Fe&&E.set(Fe,[]);const P=new Map;for(const Fe of d){if(P.has(Fe))throw new Error("duplicate mark; each mark must be unique");const{facetsIndex:le,channels:de}=v.get(Fe)??{},{data:pe,facets:Oe,channels:Ye}=Fe.initialize(le,de);t2(Ye,e),P.set(Fe,{data:pe,facets:Oe,channels:Ye})}const N=IS(w_(E,P),e),G=i5(N),U=function Dte(e,t,n={}){let r=.5-ta,i=.5+ta,o=.5+ta,c=.5-ta;for(const{marginTop:G,marginRight:U,marginBottom:Z,marginLeft:ne}of t)G>r&&(r=G),U>i&&(i=U),Z>o&&(o=Z),ne>c&&(c=ne);let{margin:d,marginTop:p=(void 0!==d?d:r),marginRight:v=(void 0!==d?d:i),marginBottom:E=(void 0!==d?d:o),marginLeft:D=(void 0!==d?d:c)}=n;p=+p,v=+v,E=+E,D=+D;let{width:I=640,height:P=Ste(e,t,n,{width:I,marginTopDefault:r,marginRightDefault:i,marginBottomDefault:o,marginLeftDefault:c})+Math.max(0,p-r+E-o)}=n;I=+I,P=+P;const N={width:I,height:P,marginTop:p,marginRight:v,marginBottom:E,marginLeft:D};if(e.fx||e.fy){let{margin:G,marginTop:U=(void 0!==G?G:p),marginRight:Z=(void 0!==G?G:v),marginBottom:ne=(void 0!==G?G:E),marginLeft:X=(void 0!==G?G:D)}=n.facet??{};U=+U,Z=+Z,ne=+ne,X=+X,N.facet={marginTop:U,marginRight:Z,marginBottom:ne,marginLeft:X}}return N}(N,d,e);!function Kee(e,t){const{x:n,y:r,fx:i,fy:o}=e,c=i||o?TS(t):t;i&&s5(i,c),o&&a5(o,c);const d=i||o?o5(e,t):t;n&&s5(n,d),r&&a5(r,d)}(N,U);const{fx:Z,fy:ne}=G,X=Z||ne?o5(N,U):U,re=Z||ne?function ire({fx:e,fy:t},n){const{marginTop:r,marginRight:i,marginBottom:o,marginLeft:c,width:d,height:p}=TS(n),v=e&&h4(e),E=t&&h4(t);return{marginTop:t?E[0]:r,marginRight:e?d-v[1]:i,marginBottom:t?p-E[1]:o,marginLeft:e?v[0]:c,inset:{marginTop:n.marginTop,marginRight:n.marginRight,marginBottom:n.marginBottom,marginLeft:n.marginLeft},width:d,height:p}}(G,U):U,fe=_x(e,X),ve=new Set;for(const[Fe,le]of P)if(null!=Fe.initializer){const pe=Fe.initializer(le.data,le.facets,le.channels,G,"super"===Fe.facet?re:X,fe);if(void 0!==pe.data&&(le.data=pe.data),void 0!==pe.facets&&(le.facets=pe.facets),void 0!==pe.channels){Xne(pe.channels),Object.assign(le.channels,pe.channels);for(const Ze of Object.values(pe.channels)){const{scale:et}=Ze;null!=et&&ni.get(et)!==Ic&&(l4(Ze,e),ve.add(et))}const{fx:Oe,fy:Ye}=pe.channels;if(null!=Oe||null!=Ye){const Ze=v.get(Fe)??{channels:{}};null!=Oe&&(Ze.channels.fx=Oe),null!=Ye&&(Ze.channels.fy=Ye),Ze.groups=LS(le.data,Ze.channels),Ze.facetsIndex=le.facets=US(I,Ze),v.set(Fe,Ze)}}}if(ve.size){const Fe=new Map;w_(Fe,P,pe=>ve.has(pe)),w_(E,P,pe=>ve.has(pe));const le=function rre(e,t){for(const n in e){const r=e[n],i=t[n];void 0===r.label&&i&&(r.label=i.label)}return e}(IS(Fe,e),N),de=i5(le);Object.assign(N,le),Object.assign(G,de)}for(const[Fe,le]of P)le.values=Fe.scale(le.channels,G,fe);const{width:Re,height:We}=U,Ke=Go("svg",fe).attr("class",c).attr("fill","currentColor").attr("font-family","system-ui, sans-serif").attr("font-size",10).attr("text-anchor","middle").attr("width",Re).attr("height",We).attr("viewBox",`0 0 ${Re} ${We}`).attr("aria-label",i).attr("aria-description",o).call(Fe=>Fe.append("style").text(`\n .${c} {\n display: block;\n background: white;\n height: auto;\n height: intrinsic;\n max-width: 100%;\n }\n .${c} text,\n .${c} tspan {\n white-space: pre;\n }\n `)).call(FS,n).node();if(void 0!==I){const Fe={x:Z?.domain(),y:ne?.domain()};I.sort(function Ite({x:e,y:t}){const n=e&&new Map(e.map((i,o)=>[i,o])),r=t&&new Map(t.map((i,o)=>[i,o]));return e&&t?(i,o)=>n.get(i.x)-n.get(o.x)||r.get(i.y)-r.get(o.y):e?(i,o)=>n.get(i.x)-n.get(o.x):(i,o)=>r.get(i.y)-r.get(o.y)}(Fe)),YD(Ke).selectAll().data(I).enter().append("g").attr("aria-label","facet").attr("transform",function Tte(e,t,{marginTop:n,marginLeft:r}){return e&&t?({x:i,y:o})=>`translate(${e(i)-r},${t(o)-n})`:e?({x:i})=>`translate(${e(i)-r},0)`:({y:i})=>`translate(0,${t(i)-n})`}(Z,ne,U)).each(function(le){let de=!0;for(const pe of d){if("super"===pe.facet)continue;const{channels:Oe,values:Ye,facets:Ze}=P.get(pe);if(!(pe.facetAnchor?.(I,Fe,le)??!le.empty))continue;let et=null;if(Ze){if(et=Ze[v.has(pe)?le.i:0],et=pe.filter(et,Oe,Ye),0===et.length)continue;et.fi=le.i}const _t=pe.render(et,G,Ye,X,fe);null!=_t&&(de=!1,this.appendChild(_t))}de&&this.remove()})}for(const Fe of d){if(void 0!==I&&"super"!==Fe.facet)continue;const{channels:le,values:de,facets:pe}=P.get(Fe);let Oe=null;if(pe&&(Oe=pe[0],Oe=Fe.filter(Oe,le,de),0===Oe.length))continue;const Ye=Fe.render(Oe,G,de,re,fe);null!=Ye&&Ke.appendChild(Ye)}let lt=Ke;const Ue=function qte(e,t,n){const r=[];for(const[i,o]of Dx){const c=n[i];if(c?.legend&&i in e){const d=o(e[i],$S(t,e[i],c),p=>e[p]);null!=d&&r.push(d)}}return r}(N,fe,e);if(null!=r||Ue.length>0){const{document:Fe}=fe;lt=Fe.createElement("figure"),lt.style.maxWidth="initial";for(const le of Ue)lt.appendChild(le);if(lt.appendChild(Ke),null!=r){const le=Fe.createElement("figcaption");le.appendChild(r instanceof Node?r:Fe.createTextNode(r)),lt.appendChild(le)}}lt.scale=function rte(e){return t=>{if(!ni.has(t=`${t}`))throw new Error(`unknown scale: ${t}`);return t in e?function p5({scale:e,type:t,domain:n,range:r,interpolate:i,interval:o,transform:c,percent:d,pivot:p}){if("identity"===t)return{type:"identity",apply:E=>E,invert:E=>E};const v=e.unknown?e.unknown():void 0;return{type:t,domain:cS(n),...void 0!==r&&{range:cS(r)},...void 0!==c&&{transform:c},...d&&{percent:d},...void 0!==v&&{unknown:v},...void 0!==o&&{interval:o},...void 0!==i&&{interpolate:i},...e.clamp&&{clamp:e.clamp()},...void 0!==p&&{pivot:p,symmetric:!1},...e.base&&{base:e.base()},...e.exponent&&{exponent:e.exponent()},...e.constant&&{constant:e.constant()},...e.align&&{align:e.align(),round:e.round()},...e.padding&&(e.paddingInner?{paddingInner:e.paddingInner(),paddingOuter:e.paddingOuter()}:{padding:e.padding()}),...e.bandwidth&&{bandwidth:e.bandwidth(),step:e.step()},apply:E=>e(E),...e.invert&&{invert:E=>e.invert(E)}}}(e[t]):void 0}}(N),lt.legend=function jte(e,t,n={}){return(r,i)=>{if(!Dx.has(r))throw new Error(`unknown legend type: ${r}`);if(r in e)return Dx.get(r)(e[r],$S(t,n[r],i),o=>e[o])}}(N,fe,e);const st=function dee(){const e=wS;return wS=0,e}();return st>0&&YD(Ke).append("text").attr("x",Re).attr("y",20).attr("dy","-1em").attr("text-anchor","end").attr("font-family","initial").text("\u26a0\ufe0f").append("title").text(`${st.toLocaleString("en-US")} warning${1===st?"":"s"}. Please check the console.`),lt}function a4(e){return e.flat(1/0).filter(t=>null!=t).map(Zne)}function Zne(e){return"function"==typeof e.render?e:new Wne(e)}kl.prototype.plot=function qne({marks:e=[],...t}={}){return e2({...t,marks:[...e,this]})};class Wne extends kl{constructor(t){if("function"!=typeof t)throw new TypeError("invalid mark; missing render function");super(),this.render=t}render(){}}function t2(e,t){for(const n in e)l4(e[n],t);return e}function l4(e,t){const{scale:n}=e;if(null==n)return;const{type:r,percent:i,interval:o,transform:c=(i?d=>100*d:hS(o,r)?.floor)}=t[n]??{};null!=c&&(e.value=Ho(e.value,c))}function Xne(e){for(const t in e)LN(t,e[t])}function w_(e,t,n=TQ){for(const{channels:r}of t.values())for(const i in r){const o=r[i],{scale:c}=o;if(null!=c&&n(c)){const d=e.get(c);void 0!==d?d.push(o):e.set(c,[o])}}return e}function c4(e,t,n){if(null===e.facet||"super"===e.facet)return;const{fx:r,fy:i}=e;if(null!=r||null!=i){const p=Mc(e.data??r??i);if(void 0===p)throw new Error(`missing facet data in ${e.ariaLabel}`);if(null===p)return;const v={};return null!=r&&(v.fx=y_(p,{value:r,scale:"fx"})),null!=i&&(v.fy=y_(p,{value:i,scale:"fy"})),t2(v,n),{channels:v,groups:LS(p,v)}}if(void 0===t)return;const{channels:o,groups:c,data:d}=t;if("auto"!==e.facet||e.data===d)return{channels:o,groups:c};(c.size>1||1===c.size&&o.fx&&o.fy&&[...c][0][1].size>1)&&Mc(e.data)?.length===d.length&&Sf(`Warning: the ${e.ariaLabel} mark appears to use faceted data, but isn\u2019t faceted. The mark data has the same length as the facet data and the mark facet option is "auto", but the mark data and facet data are distinct. If this mark should be faceted, set the mark facet option to true; otherwise, suppress this warning by setting the mark facet option to false.`)}function kx(e,t,n,r,i,o,c){if(!t)return;const d=function Jne(e){return/^\s*both\s*$/i.test(e)}(t);c=function Qne(e,t,{line:n=t.line,ticks:r,tickSize:i,tickSpacing:o,tickPadding:c,tickFormat:d,tickRotate:p,fontVariant:v,ariaLabel:E,ariaDescription:D,label:I=t.label,labelAnchor:P,labelOffset:N}){return{anchor:e,line:n,ticks:r,tickSize:i,tickSpacing:o,tickPadding:c,tickFormat:d,tickRotate:p,fontVariant:v,ariaLabel:E,ariaDescription:D,label:I,labelAnchor:P,labelOffset:N}}(d?r:t,o,c);const{line:p}=c;(n===K5||n===J5)&&p&&!m_(p)&&e.push(QS(function ere(e){const{anchor:t,line:n}=e;return{anchor:t,facetAnchor:t+"-empty",stroke:!0===n?void 0:n}}(c))),e.push(n(c)),d&&e.push(n({...c,anchor:i,label:null}))}function Px(e,t,n,r){!t||m_(t)||e.push(n(function tre(e,{stroke:t=(ux(e)?e:void 0),ticks:n=(nre(e)?e:void 0),tickSpacing:r,ariaLabel:i,ariaDescription:o}){return{stroke:t,ticks:n,tickSpacing:r,ariaLabel:i,ariaDescription:o}}(t,r)))}function nre(e){switch(typeof e){case"number":return!0;case"string":return!ux(e)}return zh(e)||"function"==typeof e?.range}function Rx(e,t){const n=`${t}-axis `;return e.some(r=>r.ariaLabel?.startsWith(n))}function u4(e,t){for(const n of t)for(const r in n.channels)if(n.channels[r].scale===e)return!0;return!1}function h4(e){const t=e.domain();let n=e(t[0]),r=e(t[t.length-1]);return rre.selectAll().data(t).enter().append(ne?"circle":"path").call(Vh,this).call(ne?fe=>{fe.attr("cx",p?ve=>p[ve]:U).attr("cy",v?ve=>v[ve]:Z).attr("r",E?ve=>E[ve]:P)}:fe=>{fe.attr("transform",XS`translate(${p?ve=>p[ve]:U},${v?ve=>v[ve]:Z})${D?ve=>` rotate(${D[ve]})`:N?` rotate(${N})`:""}`).attr("d",E&&I?ve=>{const Re=bf();return I[ve].draw(Re,E[ve]*E[ve]*Math.PI),Re}:E?ve=>{const Re=bf();return G.draw(Re,E[ve]*E[ve]*Math.PI),Re}:I?ve=>{const Re=bf();return I[ve].draw(Re,X),Re}:(()=>{const ve=bf();return G.draw(ve,X),ve})())}).call(Fm,this,r)).node()}}function Fx(e,t={}){let{x:n,y:r,...i}=t;return void 0===t.frameAnchor&&([n,r]=cx(n,r)),new n2(e,{...i,x:n,y:r})}const are=new Map([["basis",function ZJ(e){return new nx(e)}],["basis-closed",function WJ(e){return new tN(e)}],["basis-open",function XJ(e){return new nN(e)}],["bundle",QJ],["bump-x",function KJ(e){return new rN(e,!0)}],["bump-y",function JJ(e){return new rN(e,!1)}],["cardinal",eQ],["cardinal-closed",tQ],["cardinal-open",nQ],["catmull-rom",rQ],["catmull-rom-closed",iQ],["catmull-rom-open",oQ],["linear",Jb],["linear-closed",function sQ(e){return new lN(e)}],["monotone-x",function aQ(e){return new ix(e)}],["monotone-y",function lQ(e){return new dN(e)}],["natural",function cQ(e){return new pN(e)}],["step",function uQ(e){return new ox(e,.5)}],["step-after",function dQ(e){return new ox(e,1)}],["step-before",function hQ(e){return new ox(e,0)}]]);function Ox(e){return Jb(e)}function r2(e){if(null==e||!1===e)return null;if(!0===e)return d4;if("function"==typeof e)return e;switch(`${e}`.toLowerCase()){case"none":return null;case"arrow":return hre;case"dot":return dre;case"circle":case"circle-fill":return d4;case"circle-stroke":return fre}throw new Error(`invalid marker: ${e}`)}function hre(e,t){return Go("svg:marker",t).attr("viewBox","-5 -5 10 10").attr("markerWidth",6.67).attr("markerHeight",6.67).attr("orient","auto").attr("fill","none").attr("stroke",e).attr("stroke-width",1.5).attr("stroke-linecap","round").attr("stroke-linejoin","round").call(n=>n.append("path").attr("d","M-1.5,-3l3,3l-3,3")).node()}function dre(e,t){return Go("svg:marker",t).attr("viewBox","-5 -5 10 10").attr("markerWidth",6.67).attr("markerHeight",6.67).attr("fill",e).attr("stroke","none").call(n=>n.append("circle").attr("r",2.5)).node()}function d4(e,t){return Go("svg:marker",t).attr("viewBox","-5 -5 10 10").attr("markerWidth",6.67).attr("markerHeight",6.67).attr("fill",e).attr("stroke","white").attr("stroke-width",1.5).call(n=>n.append("circle").attr("r",3)).node()}function fre(e,t){return Go("svg:marker",t).attr("viewBox","-5 -5 10 10").attr("markerWidth",6.67).attr("markerHeight",6.67).attr("fill","white").attr("stroke",e).attr("stroke-width",1.5).call(n=>n.append("circle").attr("r",3)).node()}let pre=0;function mre(e,t,{stroke:n},r){return function f4(e,{markerStart:t,markerMid:n,markerEnd:r,stroke:i},o=(()=>i),c){const d=new Map;function p(v){return function(E){const D=o(E);let I=d.get(v);I||d.set(v,I=new Map);let P=I.get(D);if(!P){const N=this.parentNode.insertBefore(v(D,c),this),G="plot-marker-"+ ++pre;N.setAttribute("id",G),I.set(D,P=`url(#${G})`)}return P}}t&&e.attr("marker-start",p(t)),n&&e.attr("marker-mid",p(n)),r&&e.attr("marker-end",p(r))}(e,t,n&&(([i])=>n[i]),r)}const gre={ariaLabel:"line",fill:"none",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round",strokeMiterlimit:1};class o2 extends kl{constructor(t,n={}){const{x:r,y:i,z:o,curve:c,tension:d}=n;super(t,{x:{value:r,scale:"x"},y:{value:i,scale:"y"},z:{value:DN(n),optional:!0}},n,gre),this.z=o,this.curve=function cre(e=Ox,t){return"function"!=typeof e&&"auto"===`${e}`.toLowerCase()?Ox:function lre(e=Jb,t){if("function"==typeof e)return e;const n=are.get(`${e}`.toLowerCase());if(!n)throw new Error(`unknown curve: ${e}`);if(void 0!==t){if("beta"in n)return n.beta(t);if("tension"in n)return n.tension(t);if("alpha"in n)return n.alpha(t)}return n}(e,t)}(c,d),function ure(e,{marker:t,markerStart:n=t,markerMid:r=t,markerEnd:i=t}={}){e.markerStart=r2(n),e.markerMid=r2(r),e.markerEnd=r2(i)}(this,n)}filter(t){return t}project(t,n,r){this.curve!==Ox&&super.project(t,n,r)}render(t,n,r,i,o){const{x:c,y:d}=r,{curve:p}=this;return Go("svg:g",o).call(Bh,this,i,o).call(Uh,this,n).call(v=>v.selectAll().data(function*bte(e,t,{z:n},r){const{z:i}=r,o=function _te({ariaLabel:e,title:t,fill:n,fillOpacity:r,stroke:i,strokeOpacity:o,strokeWidth:c,opacity:d,href:p}){return[e,t,n,r,i,o,c,d,p].filter(v=>void 0!==v)}(r),c=[...t,...o];for(const d of i?function vte(e,t,n){const r=sR(e,i=>t[i]);return void 0===n&&r.size>e.length>>1&&Sf("Warning: the implicit z channel has high cardinality. This may occur when the fill or stroke channel is associated with quantitative data rather than ordinal or categorical data. You can suppress this warning by setting the z option explicitly; if this data represents a single series, set z to null."),r.values()}(e,i,n):[e]){let p,v;e:for(const E of d){for(const D of c)if(!Ml(D[E])){v&&v.push(-1);continue e}if(void 0!==p){v.push(E);for(let D=0;DuS(P[E])),v=[E];continue e}}else v&&(yield v),p=o.map(D=>uS(D[E])),v=[E]}v&&(yield v)}}(t,[c,d],this,r)).enter().append("path").call(Vh,this).call(yte,this,r).call(mre,this,r,o).attr("d",p===Ox&&o.projection?function yre(e,t,n){const r=aD(e);return t=ax(t),n=ax(n),i=>{let o=[];const c=[o];for(const d of i)-1===d?(o=[],c.push(o)):o.push([t[d],n[d]]);return r({type:"MultiLineString",coordinates:c})}}(o.projection,c,d):function NJ(e,t){var n=Cm(!0),r=null,i=Jb,o=null,c=function FJ(e){let t=3;return e.digits=function(n){if(!arguments.length)return t;if(null==n)t=null;else{const r=Math.floor(n);if(!(r>=0))throw new RangeError(`invalid digits: ${n}`);t=r}return e},()=>new Rb(t)}(d);function d(p){var v,D,P,E=(p=function RJ(e){return"object"==typeof e&&"length"in e?e:Array.from(e)}(p)).length,I=!1;for(null==r&&(o=i(P=c())),v=0;v<=E;++v)!(vE>=0).x(E=>c[E]).y(E=>d[E]))).node()}}function p4(e,t={}){let{x:n,y:r,...i}=t;return[n,r]=cx(n,r),new o2(e,{...i,x:n,y:r})}function _re(e,t={}){return m4(Object.fromEntries(["y","y1","y2"].filter(n=>null!=t[n]).map(n=>[n,e])),t)}const m4=function vre(e={},t={}){const n=DN(t),r=Object.entries(e).map(([i,o])=>{const c=function PQ(e,t){if(void 0!==t[e])return t[e];switch(e){case"x1":case"x2":e="x";break;case"y1":case"y2":e="y"}return t[e]}(i,t);if(null==c)throw new Error(`missing channel: ${i}`);const[d,p]=function SN(e){let t;return[{transform:()=>t,label:f_(e)},n=>t=n]}(c);return{key:i,input:c,output:d,setOutput:p,map:bre(o)}});return{...jS(t,(i,o)=>{const c=Sc(i,n),d=r.map(({input:v})=>Sc(i,v)),p=r.map(({setOutput:v})=>v(new Array(i.length)));for(const v of o)for(const E of c?sR(v,D=>c[D]).values():[v])r.forEach(({map:D},I)=>D.mapIndex(E,d[I],p[I]));return{data:i,facets:o}}),...Object.fromEntries(r.map(({key:i,output:o})=>[i,o]))}};function bre(e){if(null==e)throw new Error("missing map");if("function"==typeof e.mapIndex)return e;if("function"==typeof e.map&&Tm(e))return function xre(e){return console.warn("deprecated map interface; implement mapIndex instead."),{mapIndex:e.map.bind(e)}}(e);if("function"==typeof e)return s2(e);switch(`${e}`.toLowerCase()){case"cumsum":return Cre;case"rank":return s2(fR);case"quantile":return s2(wre)}throw new Error(`invalid map: ${e}`)}function wre(e){const t=function zG(e,t){let n=0;if(void 0===t)for(let r of e)null!=r&&(r=+r)>=r&&++n;else{let r=-1;for(let i of e)null!=(i=t(i,++r,e))&&(i=+i)>=i&&++n}return n}(e)-1;return fR(e).map(n=>n/t)}function s2(e){return{mapIndex(t,n,r){const i=e(Pm(n,t));if(i.length!==t.length)throw new Error("map function returned a mismatched length");for(let o=0,c=t.length;o0))throw new Error(`invalid k: ${t}`);return function Sre(e="mean"){if("string"==typeof e){if(/^p\d{2}$/i.test(e))return Lx(CN(e));switch(e.toLowerCase()){case"deviation":return Lx(nR);case"max":return Nx(As);case"mean":return Mre;case"median":return Lx(z0);case"min":return Nx(df);case"mode":return Nx(hR);case"sum":return _4;case"variance":return Lx(gE);case"difference":return Are;case"ratio":return kre;case"first":return Pre;case"last":return Rre}}if("function"!=typeof e)throw new Error(`invalid reduce: ${e}`);return Nx(e)}(n)(t,function Ere(e="middle",t){switch(`${e}`.toLowerCase()){case"middle":return t-1>>1;case"start":return 0;case"end":return t-1}throw new Error(`invalid anchor: ${e}`)}(i,t),o)}function a2(e,t,n){return e.subarray?e.subarray(t,n):e.slice(t,n)}function Lx(e){return(t,n,r)=>r?{mapIndex(i,o,c){const d=Float64Array.from(i,v=>null===o[v]?NaN:o[v]);let p=0;for(let v=0;vnull===o[p]?NaN:o[p]);for(let p=-n;p<0;++p)c[i[p+n]]=e(d.subarray(0,p+t));for(let p=0,v=i.length-n;pr?{mapIndex(i,o,c){let d=0;for(let p=0;p=n;--i){const o=e[t[i]];if(Ml(o))return o}}function v4(e,t,n,r){for(let i=n+r;n=n;--i){let o=e[t[i]];if(null!==o&&!isNaN(o=+o))return o}}function Are(e,t,n){return n?{mapIndex(r,i,o){for(let c=0,d=r.length-e;c{class e{constructor(n){this.samples=n,this.device={},this.cameraBearing=0,this.enableRotation=!1}ngOnInit(){}ngOnChanges(){this.flyToMarker(this.device,this.map)}ngAfterViewInit(){this.map||(this.map=new F0.Map({container:this.mapContainer.nativeElement,style:"https://pax.lab5e.com/map/styles/basic.json",center:[10.14,63.42],zoom:3,maxBounds:[[9.78,63.17],[10.97,63.56]]}),this.map.addControl(new F0.NavigationControl),this.map.addControl(new F0.AttributionControl({compact:!1,customAttribution:"Style \xa9 MapTiler | Data \xa9 OpenStreetMap contributors"})),this.samples.activeDevices().subscribe({complete:()=>{this.samples.addMapMarkers(this.map)}}),this.flyToMarker(this.device,this.map))}ngOnDestroy(){this.enableRotation=!1,this.map?.remove()}flyToMarker(n,r){if(!n||!r)return;if(!n.lat||0==n.lat||!n.lon||0==n.lon)return this.enableRotation=!1,this.cameraBearing=0,void this.map?.flyTo({center:[10.14,63.42],zoom:3,pitch:0,bearing:0,speed:2,curve:2,easing:o=>o,essential:!0});this.enableRotation&&(this.enableRotation=!1,this.cameraBearing=0),this.map?.flyTo({center:[n.lat,n.lon],zoom:16,pitch:45,bearing:0,speed:1,curve:1,easing:o=>o,essential:!0});let i=o=>{!this.enableRotation||(r.rotateTo(this.cameraBearing,{duration:0}),this.cameraBearing+=.25,this.cameraBearing>=360&&(this.cameraBearing=0),requestAnimationFrame(i))};this.map?.on("click",()=>{this.enableRotation=!1}),this.map?.once("moveend",()=>{this.enableRotation=!0,i(0)})}}return e.\u0275fac=function(n){return new(n||e)(qe(O0))},e.\u0275cmp=Vs({type:e,selectors:[["app-device-map-view"]],viewQuery:function(n,r){if(1&n&&ny(Fre,5),2&n){let i;tf(i=nf())&&(r.mapContainer=i.first)}},inputs:{device:"device"},features:[yt],decls:2,vars:0,consts:[[1,"map"],["map",""]],template:function(n,r){1&n&&Is(0,"div",0,1)},styles:[".map[_ngcontent-%COMP%]{overflow:hidden;border-radius:1em;border:solid 1px silver;width:100%;height:100%}"]}),e})();const Ore=["chart"],Lre=function(e,t,n){return{"density-high":e,"density-norm":t,"density-low":n}};let Nre=(()=>{class e{constructor(n,r,i){this.samples=n,this.renderer=r,this.cd=i,this.device={},this.metricDensityPercent=0,this.metricSampleCount=0,this.metricWifi=0,this.metricBLE=0,this.data=[],this.errorMessage=""}ngOnInit(){}ngAfterViewInit(){this.loadData()}ngOnChanges(n){this.chartRef&&this.loadData()}loadData(){var n=[];this.samples.allData().subscribe({next:r=>{r.id==this.device.id&&n.push(r)},complete:()=>{this.data=n,this.showChart(),this.buildMetrics(),this.cd.detectChanges()}})}showChart(){this.chart&&this.renderer.removeChild(this.chartRef?.nativeElement,this.chart,!1);let n=this.chartRef?.nativeElement.offsetWidth,r=this.chartRef?.nativeElement.height,i=df(this.data,c=>c.time),o=As(this.data,c=>c.time);this.chart=e2({width:n,height:r,margin:50,inset:5,y:{grid:!0,label:"Antall"},x:{label:"Klokkeslett",grid:!0,tickFormat:$b("%H:%M"),domain:[i,o]},marks:[Fx(this.data,{x:c=>c.time,y:"ble",stroke:"darkblue",opacity:.2}),p4(this.data,g4({reduce:"mean",k:20,anchor:"middle"},{x:"time",y:"ble",stroke:"darkblue",strokeWidth:2,opacity:.8})),Fx(this.data,{x:"time",y:"wifi",stroke:"salmon",opacity:.3}),p4(this.data,g4({reduce:"mean",k:20,anchor:"middle"},{x:"time",y:"wifi",stroke:"salmon",strokeWidth:2,opacity:.9})),QS()],color:{legend:!1,domain:["wifi","salmon"],range:["red","darkblue"]},style:{fontFamily:"sans-serif",fontSize:"10pt",background:"#eeeeee",fill:"#808080"}}),this.renderer.appendChild(this.chartRef?.nativeElement,this.chart)}buildMetrics(){let n=As(this.data,p=>p.ble)||0,r=As(this.data,p=>p.wifi)||0,o=this.data.length-1,d=Math.round(100*(this.data[o].ble+this.data[o].wifi)/(n+r));this.metricBLE=n,this.metricWifi=r,this.metricSampleCount=this.data.length,this.metricDensityPercent=d}}return e.\u0275fac=function(n){return new(n||e)(qe(O0),qe(hl),qe(oy))},e.\u0275cmp=Vs({type:e,selectors:[["app-device-view"]],viewQuery:function(n,r){if(1&n&&ny(Ore,5),2&n){let i;tf(i=nf())&&(r.chartRef=i.first)}},inputs:{device:"device"},features:[yt],decls:31,vars:15,consts:[[1,"device-status-page"],[1,"data"],["id","chart",1,"chart"],["chart",""],[1,"device-info"],[1,"metric","ble-metric"],[1,"metric-value"],[1,"metric-desc"],[1,"metric","wifi-metric"],[1,"metric","sample-metric"],[1,"metric",3,"ngClass"],[1,"location"],[3,"device"]],template:function(n,r){1&n&&(xr(0,"div",0)(1,"div",1)(2,"h2"),Co(3),yr(),Is(4,"div",2,3),Co(6),function DT(e,t){const n=en();let r;const i=e+22;n.firstCreatePass?(r=function VV(e,t){if(t)for(let n=t.length-1;n>=0;n--){const r=t[n];if(e===r.name)return r}}(t,n.pipeRegistry),n.data[i]=r,r.onDestroy&&(n.destroyHooks||(n.destroyHooks=[])).push(i,r.onDestroy)):r=n.data[i];const o=r.factory||(r.factory=_s(r.type)),c=lo(qe);try{const d=Mr(!1),p=o();return Mr(d),function k8(e,t,n,r){n>=e.data.length&&(e.data[n]=null,e.blueprint[n]=null),t[n]=r}(n,He(),i,p),p}finally{lo(c)}}(7,"date"),yr(),xr(8,"div",4)(9,"div",5)(10,"div",6),Co(11),yr(),xr(12,"div",7),Co(13,"Maks antall bluetooth-enheter"),yr()(),xr(14,"div",8)(15,"div",6),Co(16),yr(),xr(17,"div",7),Co(18,"Maks antall WiFi-enheter"),yr()(),xr(19,"div",9)(20,"div",6),Co(21),yr(),xr(22,"div",7),Co(23,"M\xe5linger i perioden"),yr()(),xr(24,"div",10)(25,"div",6),Co(26),yr(),xr(27,"div",7),Co(28,"Folketetthet av maks"),yr()()(),xr(29,"div",11),Is(30,"app-device-map-view",12),yr()()),2&n&&(xo(3),Up(r.device.name),xo(3),Jd(" Sist oppdatert ",ST(7,8,r.samples.lastDataUpdate,"YYYY-MM-dd HH:mm")," "),xo(5),Up(r.metricBLE),xo(5),Up(r.metricWifi),xo(5),Up(r.metricSampleCount),xo(3),Ca("ngClass",vT(11,Lre,r.metricDensityPercent>70,r.metricDensityPercent<=70&&r.metricDensityPercent>=30,r.metricDensityPercent<30)),xo(2),Jd("",r.metricDensityPercent,"%"),xo(4),Ca("device",r.device))},dependencies:[mC,x4,KA],styles:[".device-status-page[_ngcontent-%COMP%]{display:grid;grid-template-columns:repeat(2,1fr);grid-template-rows:repeat(2,1fr);grid-row-gap:10px;grid-column-gap:10px;height:100%}.device-info[_ngcontent-%COMP%]{display:grid;grid-template-columns:repeat(2,1fr);grid-template-rows:1fr 1fr;grid-column-gap:1em;grid-row-gap:1em}.metric[_ngcontent-%COMP%]{background-color:#2696f9;color:#fff;border-radius:1em;display:grid;grid-template-columns:1fr;grid-template-rows:3fr 1fr}.metric-value[_ngcontent-%COMP%]{font-size:6vh;text-align:center;margin-top:auto;margin-bottom:auto}.metric-desc[_ngcontent-%COMP%]{font-size:1vw;text-align:center}.location[_ngcontent-%COMP%]{background-color:#ddd;border-radius:1em}.data[_ngcontent-%COMP%]{grid-column:span 2;vertical-align:middle}.chart[_ngcontent-%COMP%]{padding:1em;width:80vw}.wifi-metric[_ngcontent-%COMP%]{background-color:salmon}.ble-metric[_ngcontent-%COMP%]{background-color:#00008b}.sample-metric[_ngcontent-%COMP%]{background-color:#aaa}.density-high[_ngcontent-%COMP%]{background-color:red}.density-norm[_ngcontent-%COMP%]{background-color:#aaa}.density-low[_ngcontent-%COMP%]{background-color:green}"]}),e})();class zre extends kl{constructor(t,n,r={},i){super(t,n,r,i);const{inset:o=0,insetTop:c=o,insetRight:d=o,insetBottom:p=o,insetLeft:v=o,rx:E,ry:D}=r;this.insetTop=fi(c),this.insetRight=fi(d),this.insetBottom=fi(p),this.insetLeft=fi(v),this.rx=ls(E,"auto"),this.ry=ls(D,"auto")}render(t,n,r,i,o){const{rx:c,ry:d}=this;return Go("svg:g",o).call(Bh,this,i,o).call(this._transform,this,n).call(p=>p.selectAll().data(t).enter().append("rect").call(Vh,this).attr("x",this._x(n,r,i)).attr("width",this._width(n,r,i)).attr("y",this._y(n,r,i)).attr("height",this._height(n,r,i)).call(fn,"rx",c).call(fn,"ry",d).call(Fm,this,r)).node()}_x(t,{x:n},{marginLeft:r}){const{insetLeft:i}=this;return n?o=>n[o]+i:r+i}_y(t,{y:n},{marginTop:r}){const{insetTop:i}=this;return n?o=>n[o]+i:r+i}_width({x:t},{x:n},{marginRight:r,marginLeft:i,width:o}){const{insetLeft:c,insetRight:d}=this,p=n&&t?t.bandwidth():o-r-i;return Math.max(0,p-c-d)}_height({y:t},{y:n},{marginTop:r,marginBottom:i,height:o}){const{insetTop:c,insetBottom:d}=this,p=n&&t?t.bandwidth():o-r-i;return Math.max(0,p-c-d)}}const Ure={ariaLabel:"cell"};class l2 extends zre{constructor(t,{x:n,y:r,...i}={}){super(t,{x:{value:n,scale:"x",type:"band",optional:!0},y:{value:r,scale:"y",type:"band",optional:!0}},i,Ure)}_transform(t,n){t.call(Uh,n,{},0,0)}}function $re(e,t={}){let{x:n,y:r,...i}=t;return[n,r]=cx(n,r),new l2(e,{...i,x:n,y:r})}const jre=["chart"],Hre=["legend"];let Gre=(()=>{class e{constructor(n,r){this.samples=n,this.renderer=r,this.data=[]}ngOnInit(){}ngAfterViewInit(){this.samples.allData().subscribe({next:n=>{this.data.push(n)},complete:()=>{this.showChart()}})}ngOnDestroy(){this.chart&&this.renderer.removeChild(this.chartRef?.nativeElement,this.chart,!1),this.legend&&this.renderer.removeChild(this.legendRef?.nativeElement,this.legend,!1)}showChart(){this.chart&&this.renderer.removeChild(this.chartRef?.nativeElement,this.chart,!1);let n=this.chartRef?.nativeElement.offsetWidth,r=As(this.data,o=>o.ble+o.wifi)||1;const i=$b("%m-%d %H:00");this.chart=e2({width:n,marginLeft:250,marginBottom:100,x:{label:"Tid",tickRotate:-90},y:{label:"Enhet"},marks:[$re(this.data,{x:o=>i(o.time),y:"name",fill:o=>o.ble+o.wifi}),QS()],color:{legend:!1,scheme:"gnbu",reverse:!1,type:"linear"},style:{fontFamily:"sans-serif",fontSize:"10pt",background:"#eeeeee",fill:"#808080"}}),this.renderer.appendChild(this.chartRef?.nativeElement,this.chart),this.legend||(this.legend=function $te(e={}){for(const[t,n]of Dx){const r=e[t];if(Am(r)){const i=_x(e);let o;if("symbol"===t){const{fill:c,stroke:d=(void 0===c&&Am(e.color)?"color":void 0)}=e;o={fill:c,stroke:d}}return n(AS(t,r,o),$S(i,r,e),c=>Am(e[c])?AS(c,e[c]):null)}}throw new Error("unknown legend type; no scale found")}({color:{domain:[0,r],ticks:3,scheme:"gnbu",reverse:!1,type:"linear"},width:350,ticks:5,label:"Antall enheter",style:{background:"#eeeeee"}}),this.renderer.appendChild(this.legendRef?.nativeElement,this.legend))}}return e.\u0275fac=function(n){return new(n||e)(qe(O0),qe(hl))},e.\u0275cmp=Vs({type:e,selectors:[["app-device-overview"]],viewQuery:function(n,r){if(1&n&&(ny(jre,5),ny(Hre,5)),2&n){let i;tf(i=nf())&&(r.chartRef=i.first),tf(i=nf())&&(r.legendRef=i.first)}},decls:10,vars:0,consts:[[1,"overview-page"],[1,"cell-chart"],["id","chart",1,"chart"],["chart",""],["id","legend",1,"legend"],["legend",""],[1,"allmap"]],template:function(n,r){1&n&&(xr(0,"div",0)(1,"div",1)(2,"h2"),Co(3,"Per enhet"),yr(),Is(4,"div",2,3)(6,"div",4,5),yr(),xr(8,"div",6),Is(9,"app-device-map-view"),yr()())},dependencies:[x4],styles:[".overview-page[_ngcontent-%COMP%]{display:grid;grid-template-columns:1fr;grid-template-rows:1fr 1fr;grid-row-gap:10px;grid-column-gap:10px;height:100%}.cell-chart[_ngcontent-%COMP%]{padding:1em;border:solid 1px silver;border-radius:1em;display:flex;flex-direction:column}.cell-chart[_ngcontent-%COMP%] .legend[_ngcontent-%COMP%]{margin-top:2em;margin-right:0;margin-left:auto}.chart[_ngcontent-%COMP%], .allmap[_ngcontent-%COMP%]{width:100%}"]}),e})();function qre(e,t){if(1&e){const n=Dv();ht(),xr(0,"svg",16),wo("click",function(){return ma(n),Gs(Bp().autoPlay(!1))}),Is(1,"path",17),yr()}}function Zre(e,t){if(1&e){const n=Dv();ht(),xr(0,"svg",16),wo("click",function(){return ma(n),Gs(Bp().autoPlay(!0))}),Is(1,"path",18),yr()}}const C4=function(e){return{active:e}};function Wre(e,t){if(1&e){const n=Dv();xr(0,"div",9),wo("click",function(){const o=ma(n).$implicit;return Gs(Bp().setActiveDevice(o))}),xr(1,"div",10),Co(2),yr(),xr(3,"div",11),Co(4),yr()()}if(2&e){const n=t.$implicit,r=Bp();Ca("ngClass",Iw(3,C4,r.activeDevice==n)),xo(2),Jd(" ",n.name," "),xo(2),Jd(" Id: ",n.id," ")}}function Xre(e,t){1&e&&Is(0,"app-device-overview")}function Yre(e,t){1&e&&Is(0,"app-device-view",19),2&e&&Ca("device",Bp().activeDevice)}let Kre=(()=>{class e{constructor(n){this.samples=n,this.activeDevices=[],this.autoPlayEnabled=!1,this.activeStep=0;let r=[];this.samples.activeDevices().subscribe({next:i=>{r.push(i)},complete:()=>{this.activeDevices=r}})}ngOnInit(){}setActiveDevice(n){this.activeDevice=n}autoPlay(n){if(!n)return this.autoPlayEnabled=!1,void this.autoPlayer?.unsubscribe();this.activeStep=-1,this.activeDevice=void 0,this.autoPlayEnabled=!0,this.autoPlayer=function NG(e=0,t=tR){return e<0&&(e=0),function LG(e=0,t,n=FG){let r=-1;return null!=t&&(nn(t)?n=t:r=t),new Nn(i=>{let o=function OG(e){return e instanceof Date&&!isNaN(e)}(e)?+e-n.now():e;o<0&&(o=0);let c=0;return n.schedule(function(){i.closed||(i.next(c++),0<=r?this.schedule(void 0,r):i.complete())},o)})}(e,e,t)}(15e3).subscribe(r=>this.autoStep())}autoStep(){if(this.autoPlayEnabled){if(this.activeStep++,this.activeStep>=this.activeDevices.length&&(this.activeStep=-1),-1==this.activeStep)return void(this.activeDevice=void 0);this.activeDevice=this.activeDevices[this.activeStep]}}}return e.\u0275fac=function(n){return new(n||e)(qe(O0))},e.\u0275cmp=Vs({type:e,selectors:[["app-main-page"]],decls:20,vars:8,consts:[[1,"page"],[1,"heading"],[1,"logo"],["src","/assets/trondheim_kommune.png"],[1,"title"],[1,"autoplay"],["fill","white","class","start-stop","height","32px","width","32px","version","1.1","xmlns","http://www.w3.org/2000/svg",0,"xmlns","xlink","http://www.w3.org/1999/xlink","viewBox","0 0 512 512",0,"xml","space","preserve",3,"click",4,"ngIf"],[1,"content"],[1,"list"],[1,"list-item",3,"ngClass","click"],[1,"item-title"],[1,"item-subtitle"],["class","list-item",3,"ngClass","click",4,"ngFor","ngForOf"],[1,"detail"],[4,"ngIf"],[3,"device",4,"ngIf"],["fill","white","height","32px","width","32px","version","1.1","xmlns","http://www.w3.org/2000/svg",0,"xmlns","xlink","http://www.w3.org/1999/xlink","viewBox","0 0 512 512",0,"xml","space","preserve",1,"start-stop",3,"click"],["d","M256,0C114.615,0,0,114.615,0,256s114.615,256,256,256s256-114.615,256-256S397.385,0,256,0z M336,320\n\tc0,8.837-7.163,16-16,16H192c-8.837,0-16-7.163-16-16V192c0-8.837,7.163-16,16-16h128c8.837,0,16,7.163,16,16V320z"],["d","M256,0C114.617,0,0,114.615,0,256s114.617,256,256,256s256-114.615,256-256S397.383,0,256,0z M344.48,269.57l-128,80\n c-2.59,1.617-5.535,2.43-8.48,2.43c-2.668,0-5.34-0.664-7.758-2.008C195.156,347.172,192,341.82,192,336V176\n c0-5.82,3.156-11.172,8.242-13.992c5.086-2.836,11.305-2.664,16.238,0.422l128,80c4.676,2.93,7.52,8.055,7.52,13.57\n S349.156,266.641,344.48,269.57z"],[3,"device"]],template:function(n,r){1&n&&(xr(0,"div",0)(1,"div",1)(2,"span",2),Is(3,"img",3),yr(),xr(4,"span",4),Co(5," PAX - Persontelling "),yr(),xr(6,"span",5),zp(7,qre,2,0,"svg",6),zp(8,Zre,2,0,"svg",6),yr()(),xr(9,"div",7)(10,"div",8)(11,"div",9),wo("click",function(){return r.setActiveDevice()}),xr(12,"div",10),Co(13," Alle "),yr(),xr(14,"div",11),Co(15," Vis aggregerte data for alle tellere "),yr()(),zp(16,Wre,5,5,"div",12),yr(),xr(17,"div",13),zp(18,Xre,1,0,"app-device-overview",14),zp(19,Yre,1,1,"app-device-view",15),yr()()()),2&n&&(xo(7),Ca("ngIf",r.autoPlayEnabled),xo(1),Ca("ngIf",!r.autoPlayEnabled),xo(3),Ca("ngClass",Iw(6,C4,null==r.activeDevice)),xo(5),Ca("ngForOf",r.activeDevices),xo(2),Ca("ngIf",null==r.activeDevice),xo(1),Ca("ngIf",null!=r.activeDevice))},dependencies:[mC,qA,WA,Nre,Gre],styles:[".page[_ngcontent-%COMP%]{margin:0;padding:0;width:100vw;height:100vh;background-color:#eee;display:flex;flex-direction:column}.heading[_ngcontent-%COMP%]{color:#fff;background-color:#009bdf;display:flex;flex-direction:row;align-items:center;justify-content:center;height:5em}.logo[_ngcontent-%COMP%]{min-width:250px}.start-stop[_ngcontent-%COMP%]{cursor:pointer}.heading[_ngcontent-%COMP%] .title[_ngcontent-%COMP%]{font-size:24pt}.content[_ngcontent-%COMP%]{height:calc(100vh - 5em);background-color:gray;display:flex;flex-direction:row}.list[_ngcontent-%COMP%]{direction:rtl;width:20em;min-height:100%;background-color:#ddd;display:flex;flex-direction:column;overflow-y:auto}.list-item[_ngcontent-%COMP%]{direction:ltr;width:100%;height:6em!important}.list-item[_ngcontent-%COMP%]:not(.active){border-bottom:solid 1px #cccccc}.list-item[_ngcontent-%COMP%]:hover:not(.active){background-color:#80add3;cursor:pointer}.active[_ngcontent-%COMP%]{background-color:#eee;color:#000;box-shadow:10px 5px 5px silver}.item-title[_ngcontent-%COMP%]{font-size:14pt;margin-top:1em;margin-left:1em}.item-subtitle[_ngcontent-%COMP%]{font-size:10pt;color:gray;margin-top:.5em;margin-left:2em;margin-bottom:1em;font-weight:light}.detail[_ngcontent-%COMP%]{background-color:#eee;flex:auto 1;padding:1em}.autoplay[_ngcontent-%COMP%]{margin-right:1em;margin-left:auto}"]}),e})(),Jre=(()=>{class e{constructor(n){this.paxService=n,this.title="PAX",this.paxService.configuration.basePath="https://pax.lab5e.com"}}return e.\u0275fac=function(n){return new(n||e)(qe(pE))},e.\u0275cmp=Vs({type:e,selectors:[["app-root"]],decls:1,vars:0,template:function(n,r){1&n&&Is(0,"app-main-page")},dependencies:[Kre]}),e})(),f6=(()=>{class e{}return e.\u0275fac=function(n){return new(n||e)},e.\u0275mod=ai({type:e}),e.\u0275inj=Ei({}),e})();const C2=new It("NgModelWithFormControlWarning");let A6=(()=>{class e{}return e.\u0275fac=function(n){return new(n||e)},e.\u0275mod=ai({type:e}),e.\u0275inj=Ei({imports:[f6]}),e})(),Jie=(()=>{class e{}return e.\u0275fac=function(n){return new(n||e)},e.\u0275mod=ai({type:e}),e.\u0275inj=Ei({imports:[A6]}),e})(),Qie=(()=>{class e{static withConfig(n){return{ngModule:e,providers:[{provide:C2,useValue:n.warnOnNgModelWithFormControl}]}}}return e.\u0275fac=function(n){return new(n||e)},e.\u0275mod=ai({type:e}),e.\u0275inj=Ei({imports:[A6]}),e})(),ooe=(()=>{class e{}return e.\u0275fac=function(n){return new(n||e)},e.\u0275mod=ai({type:e}),e.\u0275inj=Ei({imports:[QA]}),e})(),soe=(()=>{class e{}return e.\u0275fac=function(n){return new(n||e)},e.\u0275mod=ai({type:e,bootstrap:[Jre]}),e.\u0275inj=Ei({imports:[I9,mG,Jie,Qie,IG,ooe]}),e})();(function GU(){_A=!1})(),M9().bootstrapModule(soe).catch(e=>console.error(e))},943:function(zm){zm.exports=function(){"use strict";var Au,ku,or;function Zh(b,_r){if(Au)if(ku){var Rs="var sharedChunk = {}; ("+Au+")(sharedChunk); ("+ku+")(sharedChunk);",us={};Au(us),or=_r(us),typeof window<"u"&&(or.workerUrl=window.URL.createObjectURL(new Blob([Rs],{type:"text/javascript"})))}else ku=_r;else Au=_r}return Zh(0,function(b){var _r=Rs;function Rs(l,s,u,f){this.cx=3*l,this.bx=3*(u-l)-this.cx,this.ax=1-this.cx-this.bx,this.cy=3*s,this.by=3*(f-s)-this.cy,this.ay=1-this.cy-this.by,this.p1x=l,this.p1y=s,this.p2x=u,this.p2y=f}function us(l,s,u,f){const _=new _r(l,s,u,f);return function(x){return _.solve(x)}}Rs.prototype={sampleCurveX:function(l){return((this.ax*l+this.bx)*l+this.cx)*l},sampleCurveY:function(l){return((this.ay*l+this.by)*l+this.cy)*l},sampleCurveDerivativeX:function(l){return(3*this.ax*l+2*this.bx)*l+this.cx},solveCurveX:function(l,s){if(void 0===s&&(s=1e-6),l<0)return 0;if(l>1)return 1;for(var u=l,f=0;f<8;f++){var _=this.sampleCurveX(u)-l;if(Math.abs(_)_?C=u:M=u,u=.5*(M-C)+C;return u},solve:function(l,s){return this.sampleCurveY(this.solveCurveX(l,s))}};const Pl=us(.25,.1,.25,1);function Zt(l,s,u){return Math.min(u,Math.max(s,l))}function Te(l,s,u){const f=u-s,_=((l-s)%f+f)%f+s;return _===s?u:_}function Ni(l,...s){for(const u of s)for(const f in u)l[f]=u[f];return l}let Fs=1;function Os(l,s){l.forEach(u=>{s[u]&&(s[u]=s[u].bind(s))})}function Fa(l,s,u){const f={};for(const _ in l)f[_]=s.call(u||this,l[_],_,l);return f}function Rl(l,s,u){const f={};for(const _ in l)s.call(u||this,l[_],_,l)&&(f[_]=l[_]);return f}function wi(l){return Array.isArray(l)?l.map(wi):"object"==typeof l&&l?Fa(l,wi):l}const no={};function pn(l){no[l]||(typeof console<"u"&&console.warn(l),no[l]=!0)}function ii(l,s,u){return(u.y-l.y)*(s.x-l.x)>(s.y-l.y)*(u.x-l.x)}function kc(l){let s=0;for(let u,f,_=0,x=l.length,C=x-1;_cancelAnimationFrame(s)}},getImageData(l,s=0){return this.getImageCanvasContext(l).getImageData(-s,-s,l.width+2*s,l.height+2*s)},getImageCanvasContext(l){const s=window.document.createElement("canvas"),u=s.getContext("2d",{willReadFrequently:!0});if(!u)throw new Error("failed to create canvas 2d context");return s.width=l.width,s.height=l.height,u.drawImage(l,0,0,l.width,l.height),u},resolveURL:l=>(hs||(hs=document.createElement("a")),hs.href=l,hs.href),hardwareConcurrency:typeof navigator<"u"&&navigator.hardwareConcurrency||4,get prefersReducedMotion(){return!!matchMedia&&(null==Hn&&(Hn=matchMedia("(prefers-reduced-motion: reduce)")),Hn.matches)}};var Tt=qr;function qr(l,s){this.x=l,this.y=s}qr.prototype={clone:function(){return new qr(this.x,this.y)},add:function(l){return this.clone()._add(l)},sub:function(l){return this.clone()._sub(l)},multByPoint:function(l){return this.clone()._multByPoint(l)},divByPoint:function(l){return this.clone()._divByPoint(l)},mult:function(l){return this.clone()._mult(l)},div:function(l){return this.clone()._div(l)},rotate:function(l){return this.clone()._rotate(l)},rotateAround:function(l,s){return this.clone()._rotateAround(l,s)},matMult:function(l){return this.clone()._matMult(l)},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(l){return this.x===l.x&&this.y===l.y},dist:function(l){return Math.sqrt(this.distSqr(l))},distSqr:function(l){var s=l.x-this.x,u=l.y-this.y;return s*s+u*u},angle:function(){return Math.atan2(this.y,this.x)},angleTo:function(l){return Math.atan2(this.y-l.y,this.x-l.x)},angleWith:function(l){return this.angleWithSep(l.x,l.y)},angleWithSep:function(l,s){return Math.atan2(this.x*s-this.y*l,this.x*l+this.y*s)},_matMult:function(l){var s=l[2]*this.x+l[3]*this.y;return this.x=l[0]*this.x+l[1]*this.y,this.y=s,this},_add:function(l){return this.x+=l.x,this.y+=l.y,this},_sub:function(l){return this.x-=l.x,this.y-=l.y,this},_mult:function(l){return this.x*=l,this.y*=l,this},_div:function(l){return this.x/=l,this.y/=l,this},_multByPoint:function(l){return this.x*=l.x,this.y*=l.y,this},_divByPoint:function(l){return this.x/=l.x,this.y/=l.y,this},_unit:function(){return this._div(this.mag()),this},_perp:function(){var l=this.y;return this.y=this.x,this.x=-l,this},_rotate:function(l){var s=Math.cos(l),u=Math.sin(l),f=u*this.x+s*this.y;return this.x=s*this.x-u*this.y,this.y=f,this},_rotateAround:function(l,s){var u=Math.cos(l),f=Math.sin(l),_=s.y+f*(this.x-s.x)+u*(this.y-s.y);return this.x=s.x+u*(this.x-s.x)-f*(this.y-s.y),this.y=_,this},_round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}},qr.convert=function(l){return l instanceof qr?l:Array.isArray(l)?new qr(l[0],l[1]):l};const La={MAX_PARALLEL_IMAGE_REQUESTS:16,MAX_PARALLEL_IMAGE_REQUESTS_PER_FRAME:8,REGISTERED_PROTOCOLS:{}};class Ns extends Error{constructor(s,u,f,_){super(`AJAXError: ${u} (${s}): ${f}`),this.status=s,this.statusText=u,this.url=f,this.body=_}}const Nn=Mo()?()=>self.worker&&self.worker.referrer:()=>("blob:"===window.location.protocol?window.parent:window).location.href;function Pc(l,s){const u=new AbortController,f=new Request(l.url,{method:l.method||"GET",body:l.body,credentials:l.credentials,headers:l.headers,referrer:Nn(),signal:u.signal});let _=!1,x=!1;return"json"===l.type&&f.headers.set("Accept","application/json"),x||fetch(f).then(C=>{return C.ok?(M=C,void("arrayBuffer"===l.type?M.arrayBuffer():"json"===l.type?M.json():M.text()).then(A=>{x||(_=!0,s(null,A,M.headers.get("Cache-Control"),M.headers.get("Expires")))}).catch(A=>{x||s(new Error(A.message))})):C.blob().then(M=>s(new Ns(C.status,C.statusText,l.url,M)));var M}).catch(C=>{20!==C.code&&s(new Error(C.message))}),{cancel:()=>{x=!0,_||u.abort()}}}const Fl=function(l,s){if(/:\/\//.test(l.url)&&!/^https?:|^file:/.test(l.url)){if(Mo()&&self.worker&&self.worker.actor)return self.worker.actor.send("getResource",l,s);if(!Mo()){const f=l.url.substring(0,l.url.indexOf("://"));return(La.REGISTERED_PROTOCOLS[f]||Pc)(l,s)}}if(!(/^file:/.test(u=l.url)||/^file:/.test(Nn())&&!/^\w+:/.test(u))){if(fetch&&Request&&AbortController&&Object.prototype.hasOwnProperty.call(Request.prototype,"signal"))return Pc(l,s);if(Mo()&&self.worker&&self.worker.actor)return self.worker.actor.send("getResource",l,s,void 0,!0)}var u;return function(f,_){const x=new XMLHttpRequest;x.open(f.method||"GET",f.url,!0),"arrayBuffer"===f.type&&(x.responseType="arraybuffer");for(const C in f.headers)x.setRequestHeader(C,f.headers[C]);return"json"===f.type&&(x.responseType="text",x.setRequestHeader("Accept","application/json")),x.withCredentials="include"===f.credentials,x.onerror=()=>{_(new Error(x.statusText))},x.onload=()=>{if((x.status>=200&&x.status<300||0===x.status)&&null!==x.response){let C=x.response;if("json"===f.type)try{C=JSON.parse(x.response)}catch(M){return _(M)}_(null,C,x.getResponseHeader("Cache-Control"),x.getResponseHeader("Expires"))}else{const C=new Blob([x.response],{type:x.getResponseHeader("Content-Type")});_(new Ns(x.status,x.statusText,f.url,C))}},x.send(f.body),{cancel:()=>x.abort()}}(l,s)},Na=function(l,s){return Fl(Ni(l,{type:"arrayBuffer"}),s)};function Rc(l){const s=window.document.createElement("a");return s.href=l,s.protocol===window.document.location.protocol&&s.host===window.document.location.host}function oi(l,s,u){u[l]&&-1!==u[l].indexOf(s)||(u[l]=u[l]||[],u[l].push(s))}function za(l,s,u){if(u&&u[l]){const f=u[l].indexOf(s);-1!==f&&u[l].splice(f,1)}}class ra{constructor(s,u={}){Ni(this,u),this.type=s}}class mr extends ra{constructor(s,u={}){super("error",Ni({error:s},u))}}class Qn{on(s,u){return this._listeners=this._listeners||{},oi(s,u,this._listeners),this}off(s,u){return za(s,u,this._listeners),za(s,u,this._oneTimeListeners),this}once(s,u){return u?(this._oneTimeListeners=this._oneTimeListeners||{},oi(s,u,this._oneTimeListeners),this):new Promise(f=>this.once(s,f))}fire(s,u){"string"==typeof s&&(s=new ra(s,u||{}));const f=s.type;if(this.listens(f)){s.target=this;const _=this._listeners&&this._listeners[f]?this._listeners[f].slice():[];for(const M of _)M.call(this,s);const x=this._oneTimeListeners&&this._oneTimeListeners[f]?this._oneTimeListeners[f].slice():[];for(const M of x)za(f,M,this._oneTimeListeners),M.call(this,s);const C=this._eventedParent;C&&(Ni(s,"function"==typeof this._eventedParentData?this._eventedParentData():this._eventedParentData),C.fire(s))}else s instanceof mr&&console.error(s.error);return this}listens(s){return this._listeners&&this._listeners[s]&&this._listeners[s].length>0||this._oneTimeListeners&&this._oneTimeListeners[s]&&this._oneTimeListeners[s].length>0||this._eventedParent&&this._eventedParent.listens(s)}setEventedParent(s,u){return this._eventedParent=s,this._eventedParentData=u,this}}var Ae={$version:8,$root:{version:{required:!0,type:"enum",values:[8]},name:{type:"string"},metadata:{type:"*"},center:{type:"array",value:"number"},zoom:{type:"number"},bearing:{type:"number",default:0,period:360,units:"degrees"},pitch:{type:"number",default:0,units:"degrees"},light:{type:"light"},terrain:{type:"terrain"},sources:{required:!0,type:"sources"},sprite:{type:"sprite"},glyphs:{type:"string"},transition:{type:"transition"},layers:{required:!0,type:"array",value:"layer"}},sources:{"*":{type:"source"}},source:["source_vector","source_raster","source_raster_dem","source_geojson","source_video","source_image"],source_vector:{type:{required:!0,type:"enum",values:{vector:{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},scheme:{type:"enum",values:{xyz:{},tms:{}},default:"xyz"},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},attribution:{type:"string"},promoteId:{type:"promoteId"},volatile:{type:"boolean",default:!1},"*":{type:"*"}},source_raster:{type:{required:!0,type:"enum",values:{raster:{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},tileSize:{type:"number",default:512,units:"pixels"},scheme:{type:"enum",values:{xyz:{},tms:{}},default:"xyz"},attribution:{type:"string"},volatile:{type:"boolean",default:!1},"*":{type:"*"}},source_raster_dem:{type:{required:!0,type:"enum",values:{"raster-dem":{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},tileSize:{type:"number",default:512,units:"pixels"},attribution:{type:"string"},encoding:{type:"enum",values:{terrarium:{},mapbox:{}},default:"mapbox"},volatile:{type:"boolean",default:!1},"*":{type:"*"}},source_geojson:{type:{required:!0,type:"enum",values:{geojson:{}}},data:{required:!0,type:"*"},maxzoom:{type:"number",default:18},attribution:{type:"string"},buffer:{type:"number",default:128,maximum:512,minimum:0},filter:{type:"*"},tolerance:{type:"number",default:.375},cluster:{type:"boolean",default:!1},clusterRadius:{type:"number",default:50,minimum:0},clusterMaxZoom:{type:"number"},clusterMinPoints:{type:"number"},clusterProperties:{type:"*"},lineMetrics:{type:"boolean",default:!1},generateId:{type:"boolean",default:!1},promoteId:{type:"promoteId"}},source_video:{type:{required:!0,type:"enum",values:{video:{}}},urls:{required:!0,type:"array",value:"string"},coordinates:{required:!0,type:"array",length:4,value:{type:"array",length:2,value:"number"}}},source_image:{type:{required:!0,type:"enum",values:{image:{}}},url:{required:!0,type:"string"},coordinates:{required:!0,type:"array",length:4,value:{type:"array",length:2,value:"number"}}},layer:{id:{type:"string",required:!0},type:{type:"enum",values:{fill:{},line:{},symbol:{},circle:{},heatmap:{},"fill-extrusion":{},raster:{},hillshade:{},background:{}},required:!0},metadata:{type:"*"},source:{type:"string"},"source-layer":{type:"string"},minzoom:{type:"number",minimum:0,maximum:24},maxzoom:{type:"number",minimum:0,maximum:24},filter:{type:"filter"},layout:{type:"layout"},paint:{type:"paint"}},layout:["layout_fill","layout_line","layout_circle","layout_heatmap","layout_fill-extrusion","layout_symbol","layout_raster","layout_hillshade","layout_background"],layout_background:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_fill:{"fill-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_circle:{"circle-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_heatmap:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},"layout_fill-extrusion":{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_line:{"line-cap":{type:"enum",values:{butt:{},round:{},square:{}},default:"butt",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"line-join":{type:"enum",values:{bevel:{},round:{},miter:{}},default:"miter",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"line-miter-limit":{type:"number",default:2,requires:[{"line-join":"miter"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-round-limit":{type:"number",default:1.05,requires:[{"line-join":"round"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_symbol:{"symbol-placement":{type:"enum",values:{point:{},line:{},"line-center":{}},default:"point",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"symbol-spacing":{type:"number",default:250,minimum:1,units:"pixels",requires:[{"symbol-placement":"line"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"symbol-avoid-edges":{type:"boolean",default:!1,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"symbol-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"symbol-z-order":{type:"enum",values:{auto:{},"viewport-y":{},source:{}},default:"auto",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-allow-overlap":{type:"boolean",default:!1,requires:["icon-image",{"!":"icon-overlap"}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-overlap":{type:"enum",values:{never:{},always:{},cooperative:{}},requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-ignore-placement":{type:"boolean",default:!1,requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-optional":{type:"boolean",default:!1,requires:["icon-image","text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-rotation-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-size":{type:"number",default:1,minimum:0,units:"factor of the original icon size",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-text-fit":{type:"enum",values:{none:{},width:{},height:{},both:{}},default:"none",requires:["icon-image","text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-text-fit-padding":{type:"array",value:"number",length:4,default:[0,0,0,0],units:"pixels",requires:["icon-image","text-field",{"icon-text-fit":["both","width","height"]}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-image":{type:"resolvedImage",tokens:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-rotate":{type:"number",default:0,period:360,units:"degrees",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-padding":{type:"padding",default:[2],units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-keep-upright":{type:"boolean",default:!1,requires:["icon-image",{"icon-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-offset":{type:"array",value:"number",length:2,default:[0,0],requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-anchor":{type:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},default:"center",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-pitch-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-pitch-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-rotation-alignment":{type:"enum",values:{map:{},viewport:{},"viewport-glyph":{},auto:{}},default:"auto",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-field":{type:"formatted",default:"",tokens:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-font":{type:"array",value:"string",default:["Open Sans Regular","Arial Unicode MS Regular"],requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-size":{type:"number",default:16,minimum:0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-max-width":{type:"number",default:10,minimum:0,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-line-height":{type:"number",default:1.2,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-letter-spacing":{type:"number",default:0,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-justify":{type:"enum",values:{auto:{},left:{},center:{},right:{}},default:"center",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-radial-offset":{type:"number",units:"ems",default:0,requires:["text-field"],"property-type":"data-driven",expression:{interpolated:!0,parameters:["zoom","feature"]}},"text-variable-anchor":{type:"array",value:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-anchor":{type:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},default:"center",requires:["text-field",{"!":"text-variable-anchor"}],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-max-angle":{type:"number",default:45,units:"degrees",requires:["text-field",{"symbol-placement":["line","line-center"]}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-writing-mode":{type:"array",value:"enum",values:{horizontal:{},vertical:{}},requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-rotate":{type:"number",default:0,period:360,units:"degrees",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-padding":{type:"number",default:2,minimum:0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-keep-upright":{type:"boolean",default:!0,requires:["text-field",{"text-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-transform":{type:"enum",values:{none:{},uppercase:{},lowercase:{}},default:"none",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-offset":{type:"array",value:"number",units:"ems",length:2,default:[0,0],requires:["text-field",{"!":"text-radial-offset"}],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-allow-overlap":{type:"boolean",default:!1,requires:["text-field",{"!":"text-overlap"}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-overlap":{type:"enum",values:{never:{},always:{},cooperative:{}},requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-ignore-placement":{type:"boolean",default:!1,requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-optional":{type:"boolean",default:!1,requires:["text-field","icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_raster:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_hillshade:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},filter:{type:"array",value:"*"},filter_operator:{type:"enum",values:{"==":{},"!=":{},">":{},">=":{},"<":{},"<=":{},in:{},"!in":{},all:{},any:{},none:{},has:{},"!has":{},within:{}}},geometry_type:{type:"enum",values:{Point:{},LineString:{},Polygon:{}}},function:{expression:{type:"expression"},stops:{type:"array",value:"function_stop"},base:{type:"number",default:1,minimum:0},property:{type:"string",default:"$zoom"},type:{type:"enum",values:{identity:{},exponential:{},interval:{},categorical:{}},default:"exponential"},colorSpace:{type:"enum",values:{rgb:{},lab:{},hcl:{}},default:"rgb"},default:{type:"*",required:!1}},function_stop:{type:"array",minimum:0,maximum:24,value:["number","color"],length:2},expression:{type:"array",value:"*",minimum:1},light:{anchor:{type:"enum",default:"viewport",values:{map:{},viewport:{}},"property-type":"data-constant",transition:!1,expression:{interpolated:!1,parameters:["zoom"]}},position:{type:"array",default:[1.15,210,30],length:3,value:"number","property-type":"data-constant",transition:!0,expression:{interpolated:!0,parameters:["zoom"]}},color:{type:"color","property-type":"data-constant",default:"#ffffff",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},intensity:{type:"number","property-type":"data-constant",default:.5,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0}},terrain:{source:{type:"string",required:!0},exaggeration:{type:"number",minimum:0,default:1}},paint:["paint_fill","paint_line","paint_circle","paint_heatmap","paint_fill-extrusion","paint_symbol","paint_raster","paint_hillshade","paint_background"],paint_fill:{"fill-antialias":{type:"boolean",default:!0,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"fill-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-outline-color":{type:"color",transition:!0,requires:[{"!":"fill-pattern"},{"fill-antialias":!0}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["fill-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"}},"paint_fill-extrusion":{"fill-extrusion-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"fill-extrusion-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["fill-extrusion-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"},"fill-extrusion-height":{type:"number",default:0,minimum:0,units:"meters",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-base":{type:"number",default:0,minimum:0,units:"meters",transition:!0,requires:["fill-extrusion-height"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-vertical-gradient":{type:"boolean",default:!0,transition:!1,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},paint_line:{"line-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"line-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["line-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"line-width":{type:"number",default:1,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-gap-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-offset":{type:"number",default:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-dasharray":{type:"array",value:"number",minimum:0,transition:!0,units:"line widths",requires:[{"!":"line-pattern"}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"cross-faded"},"line-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"},"line-gradient":{type:"color",transition:!1,requires:[{"!":"line-dasharray"},{"!":"line-pattern"},{source:"geojson",has:{lineMetrics:!0}}],expression:{interpolated:!0,parameters:["line-progress"]},"property-type":"color-ramp"}},paint_circle:{"circle-radius":{type:"number",default:5,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-blur":{type:"number",default:0,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"circle-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["circle-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-pitch-scale":{type:"enum",values:{map:{},viewport:{}},default:"map",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-pitch-alignment":{type:"enum",values:{map:{},viewport:{}},default:"viewport",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-stroke-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-stroke-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-stroke-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"}},paint_heatmap:{"heatmap-radius":{type:"number",default:30,minimum:1,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"heatmap-weight":{type:"number",default:1,minimum:0,transition:!1,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"heatmap-intensity":{type:"number",default:1,minimum:0,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"heatmap-color":{type:"color",default:["interpolate",["linear"],["heatmap-density"],0,"rgba(0, 0, 255, 0)",.1,"royalblue",.3,"cyan",.5,"lime",.7,"yellow",1,"red"],transition:!1,expression:{interpolated:!0,parameters:["heatmap-density"]},"property-type":"color-ramp"},"heatmap-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_symbol:{"icon-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-color":{type:"color",default:"#000000",transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-color":{type:"color",default:"rgba(0, 0, 0, 0)",transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["icon-image","icon-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-color":{type:"color",default:"#000000",transition:!0,overridable:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-color":{type:"color",default:"rgba(0, 0, 0, 0)",transition:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["text-field","text-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},paint_raster:{"raster-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-hue-rotate":{type:"number",default:0,period:360,transition:!0,units:"degrees",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-brightness-min":{type:"number",default:0,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-brightness-max":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-saturation":{type:"number",default:0,minimum:-1,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-contrast":{type:"number",default:0,minimum:-1,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-resampling":{type:"enum",values:{linear:{},nearest:{}},default:"linear",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"raster-fade-duration":{type:"number",default:300,minimum:0,transition:!1,units:"milliseconds",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_hillshade:{"hillshade-illumination-direction":{type:"number",default:335,minimum:0,maximum:359,transition:!1,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-illumination-anchor":{type:"enum",values:{map:{},viewport:{}},default:"viewport",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-exaggeration":{type:"number",default:.5,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-shadow-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-highlight-color":{type:"color",default:"#FFFFFF",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-accent-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_background:{"background-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"background-pattern"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"background-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"cross-faded"},"background-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},transition:{duration:{type:"number",default:300,minimum:0,units:"milliseconds"},delay:{type:"number",default:0,minimum:0,units:"milliseconds"}},"property-type":{"data-driven":{type:"property-type"},"cross-faded":{type:"property-type"},"cross-faded-data-driven":{type:"property-type"},"color-ramp":{type:"property-type"},"data-constant":{type:"property-type"},constant:{type:"property-type"}},promoteId:{"*":{type:"string"}}};class Pe{constructor(s,u,f,_){this.message=(s?`${s}: `:"")+f,_&&(this.identifier=_),null!=u&&u.__line__&&(this.line=u.__line__)}}function Ba(l){const s=l.value;return s?[new Pe(l.key,s,"constants have been deprecated as of v8")]:[]}function zi(l,...s){for(const u of s)for(const f in u)l[f]=u[f];return l}function Vn(l){return l instanceof Number||l instanceof String||l instanceof Boolean?l.valueOf():l}function ds(l){if(Array.isArray(l))return l.map(ds);if(l instanceof Object&&!(l instanceof Number||l instanceof String||l instanceof Boolean)){const s={};for(const u in l)s[u]=ds(l[u]);return s}return Vn(l)}class Bi extends Error{constructor(s,u){super(u),this.message=u,this.key=s}}class Ol{constructor(s,u=[]){this.parent=s,this.bindings={};for(const[f,_]of u)this.bindings[f]=_}concat(s){return new Ol(this,s)}get(s){if(this.bindings[s])return this.bindings[s];if(this.parent)return this.parent.get(s);throw new Error(`${s} not found in scope.`)}has(s){return!!this.bindings[s]||!!this.parent&&this.parent.has(s)}}const fs={kind:"null"},rt={kind:"number"},Jt={kind:"string"},jt={kind:"boolean"},io={kind:"color"},ps={kind:"object"},At={kind:"value"},zs={kind:"collator"},Ci={kind:"formatted"},ia={kind:"padding"},oo={kind:"resolvedImage"};function Vi(l,s){return{kind:"array",itemType:l,N:s}}function zn(l){if("array"===l.kind){const s=zn(l.itemType);return"number"==typeof l.N?`array<${s}, ${l.N}>`:"value"===l.itemType.kind?"array":`array<${s}>`}return l.kind}const Fc=[fs,rt,Jt,jt,io,Ci,ps,Vi(At),ia,oo];function so(l,s){if("error"===s.kind)return null;if("array"===l.kind){if("array"===s.kind&&(0===s.N&&"value"===s.itemType.kind||!so(l.itemType,s.itemType))&&("number"!=typeof l.N||l.N===s.N))return null}else{if(l.kind===s.kind)return null;if("value"===l.kind)for(const u of Fc)if(!so(u,s))return null}return`Expected ${zn(l)} but found ${zn(s)} instead.`}function Ll(l,s){return s.some(u=>u.kind===l.kind)}function mn(l,s){return s.some(u=>"null"===u?null===l:"array"===u?Array.isArray(l):"object"===u?l&&!Array.isArray(l)&&"object"==typeof l:u===typeof l)}var oa,Oc={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 Va(l){return(l=Math.round(l))<0?0:l>255?255:l}function Ru(l){return Va("%"===l[l.length-1]?parseFloat(l)/100*255:parseInt(l))}function sa(l){return(s="%"===l[l.length-1]?parseFloat(l)/100:parseFloat(l))<0?0:s>1?1:s;var s}function Ua(l,s,u){return u<0?u+=1:u>1&&(u-=1),6*u<1?l+(s-l)*u*6:2*u<1?s:3*u<2?l+(s-l)*(2/3-u)*6:l}try{oa={}.parseCSSColor=function(l){var s,u=l.replace(/ /g,"").toLowerCase();if(u in Oc)return Oc[u].slice();if("#"===u[0])return 4===u.length?(s=parseInt(u.substr(1),16))>=0&&s<=4095?[(3840&s)>>4|(3840&s)>>8,240&s|(240&s)>>4,15&s|(15&s)<<4,1]:null:7===u.length&&(s=parseInt(u.substr(1),16))>=0&&s<=16777215?[(16711680&s)>>16,(65280&s)>>8,255&s,1]:null;var f=u.indexOf("("),_=u.indexOf(")");if(-1!==f&&_+1===u.length){var x=u.substr(0,f),C=u.substr(f+1,_-(f+1)).split(","),M=1;switch(x){case"rgba":if(4!==C.length)return null;M=sa(C.pop());case"rgb":return 3!==C.length?null:[Ru(C[0]),Ru(C[1]),Ru(C[2]),M];case"hsla":if(4!==C.length)return null;M=sa(C.pop());case"hsl":if(3!==C.length)return null;var A=(parseFloat(C[0])%360+360)%360/360,F=sa(C[1]),O=sa(C[2]),B=O<=.5?O*(F+1):O+F-O*F,H=2*O-B;return[Va(255*Ua(H,B,A+1/3)),Va(255*Ua(H,B,A)),Va(255*Ua(H,B,A-1/3)),M];default:return null}}return null}}catch{}class Sn{constructor(s,u,f,_=1){this.r=s,this.g=u,this.b=f,this.a=_}static parse(s){if(!s)return;if(s instanceof Sn)return s;if("string"!=typeof s)return;const u=oa(s);return u?new Sn(u[0]/255*u[3],u[1]/255*u[3],u[2]/255*u[3],u[3]):void 0}toString(){const[s,u,f,_]=this.toArray();return`rgba(${Math.round(s)},${Math.round(u)},${Math.round(f)},${_})`}toArray(){const{r:s,g:u,b:f,a:_}=this;return 0===_?[0,0,0,0]:[255*s/_,255*u/_,255*f/_,_]}}Sn.black=new Sn(0,0,0,1),Sn.white=new Sn(1,1,1,1),Sn.transparent=new Sn(0,0,0,0),Sn.red=new Sn(1,0,0,1);class Nl{constructor(s,u,f){this.sensitivity=s?u?"variant":"case":u?"accent":"base",this.locale=f,this.collator=new Intl.Collator(this.locale?this.locale:[],{sensitivity:this.sensitivity,usage:"search"})}compare(s,u){return this.collator.compare(s,u)}resolvedLocale(){return new Intl.Collator(this.locale?this.locale:[]).resolvedOptions().locale}}class ao{constructor(s,u,f,_,x){this.text=s,this.image=u,this.scale=f,this.fontStack=_,this.textColor=x}}class Zr{constructor(s){this.sections=s}static fromString(s){return new Zr([new ao(s,null,null,null,null)])}isEmpty(){return 0===this.sections.length||!this.sections.some(s=>0!==s.text.length||s.image&&0!==s.image.name.length)}static factory(s){return s instanceof Zr?s:Zr.fromString(s)}toString(){return 0===this.sections.length?"":this.sections.map(s=>s.text).join("")}}class Vr{constructor(s){this.values=s.slice()}static parse(s){if(s instanceof Vr)return s;if("number"==typeof s)return new Vr([s,s,s,s]);if(Array.isArray(s)&&!(s.length<1||s.length>4)){for(const u of s)if("number"!=typeof u)return;switch(s.length){case 1:s=[s[0],s[0],s[0],s[0]];break;case 2:s=[s[0],s[1],s[0],s[1]];break;case 3:s=[s[0],s[1],s[2],s[1]]}return new Vr(s)}}toString(){return JSON.stringify(this.values)}}class pi{constructor(s){this.name=s.name,this.available=s.available}toString(){return this.name}static fromString(s){return s?new pi({name:s,available:!1}):null}}function mi(l,s,u,f){return"number"==typeof l&&l>=0&&l<=255&&"number"==typeof s&&s>=0&&s<=255&&"number"==typeof u&&u>=0&&u<=255?void 0===f||"number"==typeof f&&f>=0&&f<=1?null:`Invalid rgba value [${[l,s,u,f].join(", ")}]: 'a' must be between 0 and 1.`:`Invalid rgba value [${("number"==typeof f?[l,s,u,f]:[l,s,u]).join(", ")}]: 'r', 'g', and 'b' must be between 0 and 255.`}function Bs(l){if(null===l||"string"==typeof l||"boolean"==typeof l||"number"==typeof l||l instanceof Sn||l instanceof Nl||l instanceof Zr||l instanceof Vr||l instanceof pi)return!0;if(Array.isArray(l)){for(const s of l)if(!Bs(s))return!1;return!0}if("object"==typeof l){for(const s in l)if(!Bs(l[s]))return!1;return!0}return!1}function J(l){if(null===l)return fs;if("string"==typeof l)return Jt;if("boolean"==typeof l)return jt;if("number"==typeof l)return rt;if(l instanceof Sn)return io;if(l instanceof Nl)return zs;if(l instanceof Zr)return Ci;if(l instanceof Vr)return ia;if(l instanceof pi)return oo;if(Array.isArray(l)){const s=l.length;let u;for(const f of l){const _=J(f);if(u){if(u===_)continue;u=At;break}u=_}return Vi(u||At,s)}return ps}function V(l){const s=typeof l;return null===l?"":"string"===s||"number"===s||"boolean"===s?String(l):l instanceof Sn||l instanceof Zr||l instanceof Vr||l instanceof pi?l.toString():JSON.stringify(l)}class ${constructor(s,u){this.type=s,this.value=u}static parse(s,u){if(2!==s.length)return u.error(`'literal' expression requires exactly one argument, but found ${s.length-1} instead.`);if(!Bs(s[1]))return u.error("invalid value");const f=s[1];let _=J(f);const x=u.expectedType;return"array"!==_.kind||0!==_.N||!x||"array"!==x.kind||"number"==typeof x.N&&0!==x.N||(_=x),new $(_,f)}evaluate(){return this.value}eachChild(){}outputDefined(){return!0}}class K{constructor(s){this.name="ExpressionEvaluationError",this.message=s}toJSON(){return this.message}}const te={string:Jt,number:rt,boolean:jt,object:ps};class ce{constructor(s,u){this.type=s,this.args=u}static parse(s,u){if(s.length<2)return u.error("Expected at least one argument.");let f,_=1;const x=s[0];if("array"===x){let M,A;if(s.length>2){const F=s[1];if("string"!=typeof F||!(F in te)||"object"===F)return u.error('The item type argument of "array" must be one of string, number, boolean',1);M=te[F],_++}else M=At;if(s.length>3){if(null!==s[2]&&("number"!=typeof s[2]||s[2]<0||s[2]!==Math.floor(s[2])))return u.error('The length argument to "array" must be a positive integer literal',2);A=s[2],_++}f=Vi(M,A)}else{if(!te[x])throw new Error(`Types doesn't contain name = ${x}`);f=te[x]}const C=[];for(;_s.outputDefined())}}const ge={"to-boolean":jt,"to-color":io,"to-number":rt,"to-string":Jt};class he{constructor(s,u){this.type=s,this.args=u}static parse(s,u){if(s.length<2)return u.error("Expected at least one argument.");const f=s[0];if(!ge[f])throw new Error(`Can't parse ${f} as it is not part of the known types`);if(("to-boolean"===f||"to-string"===f)&&2!==s.length)return u.error("Expected one argument.");const _=ge[f],x=[];for(let C=1;C4?`Invalid rbga value ${JSON.stringify(u)}: expected an array containing either three or four numeric values.`:mi(u[0],u[1],u[2],u[3]),!f))return new Sn(u[0]/255,u[1]/255,u[2]/255,u[3])}throw new K(f||`Could not parse color from value '${"string"==typeof u?u:JSON.stringify(u)}'`)}if("padding"===this.type.kind){let u;for(const f of this.args){u=f.evaluate(s);const _=Vr.parse(u);if(_)return _}throw new K(`Could not parse padding from value '${"string"==typeof u?u:JSON.stringify(u)}'`)}if("number"===this.type.kind){let u=null;for(const f of this.args){if(u=f.evaluate(s),null===u)return 0;const _=Number(u);if(!isNaN(_))return _}throw new K(`Could not convert ${JSON.stringify(u)} to number.`)}return"formatted"===this.type.kind?Zr.fromString(V(this.args[0].evaluate(s))):"resolvedImage"===this.type.kind?pi.fromString(V(this.args[0].evaluate(s))):V(this.args[0].evaluate(s))}eachChild(s){this.args.forEach(s)}outputDefined(){return this.args.every(s=>s.outputDefined())}}const ue=["Unknown","Point","LineString","Polygon"];class xe{constructor(){this.globals=null,this.feature=null,this.featureState=null,this.formattedSection=null,this._parseColorCache={},this.availableImages=null,this.canonical=null}id(){return this.feature&&"id"in this.feature?this.feature.id:null}geometryType(){return this.feature?"number"==typeof this.feature.type?ue[this.feature.type]:this.feature.type:null}geometry(){return this.feature&&"geometry"in this.feature?this.feature.geometry:null}canonicalID(){return this.canonical}properties(){return this.feature&&this.feature.properties||{}}parseColor(s){let u=this._parseColorCache[s];return u||(u=this._parseColorCache[s]=Sn.parse(s)),u}}class Me{constructor(s,u,f,_){this.name=s,this.type=u,this._evaluate=f,this.args=_}evaluate(s){return this._evaluate(s,this.args)}eachChild(s){this.args.forEach(s)}outputDefined(){return!1}static parse(s,u){const f=s[0],_=Me.definitions[f];if(!_)return u.error(`Unknown expression "${f}". If you wanted a literal array, use ["literal", [...]].`,0);const x=Array.isArray(_)?_[0]:_.type,C=Array.isArray(_)?[[_[1],_[2]]]:_.overloads,M=C.filter(([F])=>!Array.isArray(F)||F.length===s.length-1);let A=null;for(const[F,O]of M){A=new zl(u.registry,u.path,null,u.scope);const B=[];let H=!1;for(let q=1;q{return H=B,Array.isArray(H)?`(${H.map(zn).join(", ")})`:`(${zn(H.type)}...)`;var H}).join(" | "),O=[];for(let B=1;B=s[2]||l[1]<=s[1]||l[3]>=s[3])}function ft(l,s){const u=(180+l[0])/360,f=(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+l[1]*Math.PI/360)))/360,_=Math.pow(2,s.z);return[Math.round(u*_*Ie),Math.round(f*_*Ie)]}function xt(l,s,u){const f=l[0]-s[0],_=l[1]-s[1],x=l[0]-u[0],C=l[1]-u[1];return f*C-x*_==0&&f*x<=0&&_*C<=0}function ln(l,s){let u=!1;for(let C=0,M=s.length;C(f=l)[1]!=(x=A[F+1])[1]>f[1]&&f[0]<(x[0]-_[0])*(f[1]-_[1])/(x[1]-_[1])+_[0]&&(u=!u)}}var f,_,x;return u}function Gn(l,s){for(let u=0;u0&&M<0||C<0&&M>0}function an(l,s,u){for(const F of u)for(let O=0;Ou[2]){const _=.5*f;let x=l[0]-u[0]>_?-f:u[0]-l[0]>_?f:0;0===x&&(x=l[0]-u[2]>_?-f:u[2]-l[0]>_?f:0),l[0]+=x}Dt(s,l)}function Af(l,s,u,f){const _=Math.pow(2,f.z)*Ie,x=[f.x*Ie,f.y*Ie],C=[];for(const M of l)for(const A of M){const F=[A.x+x[0],A.y+x[1]];$a(F,s,u,_),C.push(F)}return C}function kf(l,s,u,f){const _=Math.pow(2,f.z)*Ie,x=[f.x*Ie,f.y*Ie],C=[];for(const A of l){const F=[];for(const O of A){const B=[O.x+x[0],O.y+x[1]];Dt(s,B),F.push(B)}C.push(F)}if(s[2]-s[0]<=_/2){(M=s)[0]=M[1]=1/0,M[2]=M[3]=-1/0;for(const A of C)for(const F of A)$a(F,s,u,_)}var M;return C}class ja{constructor(s,u){this.type=jt,this.geojson=s,this.geometries=u}static parse(s,u){if(2!==s.length)return u.error(`'within' expression requires exactly one argument, but found ${s.length-1} instead.`);if(Bs(s[1])){const f=s[1];if("FeatureCollection"===f.type)for(let _=0;_{s&&!Fu(u)&&(s=!1)}),s}function Ha(l){if(l instanceof Me&&"feature-state"===l.name)return!1;let s=!0;return l.eachChild(u=>{s&&!Ha(u)&&(s=!1)}),s}function aa(l,s){if(l instanceof Me&&s.indexOf(l.name)>=0)return!1;let u=!0;return l.eachChild(f=>{u&&!aa(f,s)&&(u=!1)}),u}class Ou{constructor(s,u){this.type=u.type,this.name=s,this.boundExpression=u}static parse(s,u){if(2!==s.length||"string"!=typeof s[1])return u.error("'var' expression requires exactly one string literal argument.");const f=s[1];return u.scope.has(f)?new Ou(f,u.scope.get(f)):u.error(`Unknown variable "${f}". Make sure "${f}" has been bound in an enclosing "let" expression before using it.`,1)}evaluate(s){return this.boundExpression.evaluate(s)}eachChild(){}outputDefined(){return!1}}class Cr{constructor(s,u=[],f,_=new Ol,x=[]){this.registry=s,this.path=u,this.key=u.map(C=>`[${C}]`).join(""),this.scope=_,this.errors=x,this.expectedType=f}parse(s,u,f,_,x={}){return u?this.concat(u,f,_)._parse(s,x):this._parse(s,x)}_parse(s,u){function f(_,x,C){return"assert"===C?new ce(x,[_]):"coerce"===C?new he(x,[_]):_}if(null!==s&&"string"!=typeof s&&"boolean"!=typeof s&&"number"!=typeof s||(s=["literal",s]),Array.isArray(s)){if(0===s.length)return this.error('Expected an array with at least one element. If you wanted a literal array, use ["literal", []].');const _=s[0];if("string"!=typeof _)return this.error(`Expression name must be a string, but found ${typeof _} instead. If you wanted a literal array, use ["literal", [...]].`,0),null;const x=this.registry[_];if(x){let C=x.parse(s,this);if(!C)return null;if(this.expectedType){const M=this.expectedType,A=C.type;if("string"!==M.kind&&"number"!==M.kind&&"boolean"!==M.kind&&"object"!==M.kind&&"array"!==M.kind||"value"!==A.kind)if("color"!==M.kind&&"formatted"!==M.kind&&"resolvedImage"!==M.kind||"value"!==A.kind&&"string"!==A.kind)if("padding"!==M.kind||"value"!==A.kind&&"number"!==A.kind&&"array"!==A.kind){if(this.checkSubtype(M,A))return null}else C=f(C,M,u.typeAnnotation||"coerce");else C=f(C,M,u.typeAnnotation||"coerce");else C=f(C,M,u.typeAnnotation||"assert")}if(!(C instanceof $)&&"resolvedImage"!==C.type.kind&&Wh(C)){const M=new xe;try{C=new $(C.type,C.evaluate(M))}catch(A){return this.error(A.message),null}}return C}return this.error(`Unknown expression "${_}". If you wanted a literal array, use ["literal", [...]].`,0)}return this.error(void 0===s?"'undefined' value invalid. Use null instead.":"object"==typeof s?'Bare objects invalid. Use ["literal", {...}] instead.':`Expected an array, but found ${typeof s} instead.`)}concat(s,u,f){const _="number"==typeof s?this.path.concat(s):this.path,x=f?this.scope.concat(f):this.scope;return new Cr(this.registry,_,u||null,x,this.errors)}error(s,...u){const f=`${this.key}${u.map(_=>`[${_}]`).join("")}`;this.errors.push(new Bi(f,s))}checkSubtype(s,u){const f=so(s,u);return f&&this.error(f),f}}var zl=Cr;function Wh(l){if(l instanceof Ou)return Wh(l.boundExpression);if(l instanceof Me&&"error"===l.name||l instanceof je||l instanceof ja)return!1;const s=l instanceof he||l instanceof ce;let u=!0;return l.eachChild(f=>{u=s?u&&Wh(f):u&&f instanceof $}),!!u&&Fu(l)&&aa(l,["zoom","heatmap-density","line-progress","accumulated","is-supported-script"])}function Bl(l,s){const u=l.length-1;let f,_,x=0,C=u,M=0;for(;x<=C;)if(M=Math.floor((x+C)/2),f=l[M],_=l[M+1],f<=s){if(M===u||s<_)return M;x=M+1}else{if(!(f>s))throw new K("Input is not a number.");C=M-1}return 0}class Bn{constructor(s,u,f){this.type=s,this.input=u,this.labels=[],this.outputs=[];for(const[_,x]of f)this.labels.push(_),this.outputs.push(x)}static parse(s,u){if(s.length-1<4)return u.error(`Expected at least 4 arguments, but found only ${s.length-1}.`);if((s.length-1)%2!=0)return u.error("Expected an even number of arguments.");const f=u.parse(s[1],1,rt);if(!f)return null;const _=[];let x=null;u.expectedType&&"value"!==u.expectedType.kind&&(x=u.expectedType);for(let C=1;C=M)return u.error('Input/output pairs for "step" expressions must be arranged with input values in strictly ascending order.',F);const B=u.parse(A,O,x);if(!B)return null;x=x||B.type,_.push([M,B])}return new Bn(x,f,_)}evaluate(s){const u=this.labels,f=this.outputs;if(1===u.length)return f[0].evaluate(s);const _=this.input.evaluate(s);if(_<=u[0])return f[0].evaluate(s);const x=u.length;return _>=u[x-1]?f[x-1].evaluate(s):f[Bl(u,_)].evaluate(s)}eachChild(s){s(this.input);for(const u of this.outputs)s(u)}outputDefined(){return this.outputs.every(s=>s.outputDefined())}}function Xn(l,s,u){return l*(1-u)+s*u}var Mn=Object.freeze({__proto__:null,array:function(l,s,u){return l.map((f,_)=>Xn(f,s[_],u))},color:function(l,s,u){return new Sn(Xn(l.r,s.r,u),Xn(l.g,s.g,u),Xn(l.b,s.b,u),Xn(l.a,s.a,u))},number:Xn,padding:function(l,s,u){const f=l.values,_=s.values;return new Vr([Xn(f[0],_[0],u),Xn(f[1],_[1],u),Xn(f[2],_[2],u),Xn(f[3],_[3],u)])}});const Yn=4/29,Mt=6/29,Vl=3*Mt*Mt,Rf=Math.PI/180,nt=180/Math.PI;function wn(l){return l>.008856451679035631?Math.pow(l,1/3):l/Vl+Yn}function $t(l){return l>Mt?l*l*l:Vl*(l-Yn)}function yn(l){return 255*(l<=.0031308?12.92*l:1.055*Math.pow(l,1/2.4)-.055)}function Xh(l){return(l/=255)<=.04045?l/12.92:Math.pow((l+.055)/1.055,2.4)}function Ff(l){const s=Xh(l.r),u=Xh(l.g),f=Xh(l.b),_=wn((.4124564*s+.3575761*u+.1804375*f)/.95047),x=wn((.2126729*s+.7151522*u+.072175*f)/1);return{l:116*x-16,a:500*(_-x),b:200*(x-wn((.0193339*s+.119192*u+.9503041*f)/1.08883)),alpha:l.a}}function Yh(l){let s=(l.l+16)/116,u=isNaN(l.a)?s:s+l.a/500,f=isNaN(l.b)?s:s-l.b/200;return s=1*$t(s),u=.95047*$t(u),f=1.08883*$t(f),new Sn(yn(3.2404542*u-1.5371385*s-.4985314*f),yn(-.969266*u+1.8760108*s+.041556*f),yn(.0556434*u-.2040259*s+1.0572252*f),l.alpha)}function Nu(l,s,u){const f=s-l;return l+u*(f>180||f<-180?f-360*Math.round(f/360):f)}const Wr={forward:Ff,reverse:Yh,interpolate:function(l,s,u){return{l:Xn(l.l,s.l,u),a:Xn(l.a,s.a,u),b:Xn(l.b,s.b,u),alpha:Xn(l.alpha,s.alpha,u)}}},Lc={forward:function(l){const{l:s,a:u,b:f}=Ff(l),_=Math.atan2(f,u)*nt;return{h:_<0?_+360:_,c:Math.sqrt(u*u+f*f),l:s,alpha:l.a}},reverse:function(l){const s=l.h*Rf,u=l.c;return Yh({l:l.l,a:Math.cos(s)*u,b:Math.sin(s)*u,alpha:l.alpha})},interpolate:function(l,s,u){return{h:Nu(l.h,s.h,u),c:Xn(l.c,s.c,u),l:Xn(l.l,s.l,u),alpha:Xn(l.alpha,s.alpha,u)}}};var Of=Object.freeze({__proto__:null,hcl:Lc,lab:Wr});class Io{constructor(s,u,f,_,x){this.type=s,this.operator=u,this.interpolation=f,this.input=_,this.labels=[],this.outputs=[];for(const[C,M]of x)this.labels.push(C),this.outputs.push(M)}static interpolationFactor(s,u,f,_){let x=0;if("exponential"===s.name)x=Zo(u,s.base,f,_);else if("linear"===s.name)x=Zo(u,1,f,_);else if("cubic-bezier"===s.name){const C=s.controlPoints;x=new _r(C[0],C[1],C[2],C[3]).solve(Zo(u,1,f,_))}return x}static parse(s,u){let[f,_,x,...C]=s;if(!Array.isArray(_)||0===_.length)return u.error("Expected an interpolation type expression.",1);if("linear"===_[0])_={name:"linear"};else if("exponential"===_[0]){const F=_[1];if("number"!=typeof F)return u.error("Exponential interpolation requires a numeric base.",1,1);_={name:"exponential",base:F}}else{if("cubic-bezier"!==_[0])return u.error(`Unknown interpolation type ${String(_[0])}`,1,0);{const F=_.slice(1);if(4!==F.length||F.some(O=>"number"!=typeof O||O<0||O>1))return u.error("Cubic bezier interpolation requires four numeric arguments with values between 0 and 1.",1);_={name:"cubic-bezier",controlPoints:F}}}if(s.length-1<4)return u.error(`Expected at least 4 arguments, but found only ${s.length-1}.`);if((s.length-1)%2!=0)return u.error("Expected an even number of arguments.");if(x=u.parse(x,2,rt),!x)return null;const M=[];let A=null;"interpolate-hcl"===f||"interpolate-lab"===f?A=io:u.expectedType&&"value"!==u.expectedType.kind&&(A=u.expectedType);for(let F=0;F=O)return u.error('Input/output pairs for "interpolate" expressions must be arranged with input values in strictly ascending order.',H);const W=u.parse(B,q,A);if(!W)return null;A=A||W.type,M.push([O,W])}return"number"===A.kind||"color"===A.kind||"padding"===A.kind||"array"===A.kind&&"number"===A.itemType.kind&&"number"==typeof A.N?new Io(A,f,_,x,M):u.error(`Type ${zn(A)} is not interpolatable.`)}evaluate(s){const u=this.labels,f=this.outputs;if(1===u.length)return f[0].evaluate(s);const _=this.input.evaluate(s);if(_<=u[0])return f[0].evaluate(s);const x=u.length;if(_>=u[x-1])return f[x-1].evaluate(s);const C=Bl(u,_),M=Io.interpolationFactor(this.interpolation,_,u[C],u[C+1]),A=f[C].evaluate(s),F=f[C+1].evaluate(s);return"interpolate"===this.operator?Mn[this.type.kind.toLowerCase()](A,F,M):"interpolate-hcl"===this.operator?Lc.reverse(Lc.interpolate(Lc.forward(A),Lc.forward(F),M)):Wr.reverse(Wr.interpolate(Wr.forward(A),Wr.forward(F),M))}eachChild(s){s(this.input);for(const u of this.outputs)s(u)}outputDefined(){return this.outputs.every(s=>s.outputDefined())}}function Zo(l,s,u,f){const _=f-u,x=l-u;return 0===_?0:1===s?x/_:(Math.pow(s,x)-1)/(Math.pow(s,_)-1)}class Kh{constructor(s,u){this.type=s,this.args=u}static parse(s,u){if(s.length<2)return u.error("Expectected at least one argument.");let f=null;const _=u.expectedType;_&&"value"!==_.kind&&(f=_);const x=[];for(const M of s.slice(1)){const A=u.parse(M,1+x.length,f,void 0,{typeAnnotation:"omit"});if(!A)return null;f=f||A.type,x.push(A)}if(!f)throw new Error("No output type");const C=_&&x.some(M=>so(_,M.type));return new Kh(C?At:f,x)}evaluate(s){let u,f=null,_=0;for(const x of this.args)if(_++,f=x.evaluate(s),f&&f instanceof pi&&!f.available&&(u||(u=f.name),f=null,_===this.args.length&&(f=u)),null!==f)break;return f}eachChild(s){this.args.forEach(s)}outputDefined(){return this.args.every(s=>s.outputDefined())}}class zu{constructor(s,u){this.type=u.type,this.bindings=[].concat(s),this.result=u}evaluate(s){return this.result.evaluate(s)}eachChild(s){for(const u of this.bindings)s(u[1]);s(this.result)}static parse(s,u){if(s.length<4)return u.error(`Expected at least 3 arguments, but found ${s.length-1} instead.`);const f=[];for(let x=1;x=f.length)throw new K(`Array index out of bounds: ${u} > ${f.length-1}.`);if(u!==Math.floor(u))throw new K(`Array index must be an integer, but found ${u} instead.`);return f[u]}eachChild(s){s(this.index),s(this.input)}outputDefined(){return!1}}class Lf{constructor(s,u){this.type=jt,this.needle=s,this.haystack=u}static parse(s,u){if(3!==s.length)return u.error(`Expected 2 arguments, but found ${s.length-1} instead.`);const f=u.parse(s[1],1,At),_=u.parse(s[2],2,At);return f&&_?Ll(f.type,[jt,Jt,rt,fs,At])?new Lf(f,_):u.error(`Expected first argument to be of type boolean, string, number or null, but found ${zn(f.type)} instead`):null}evaluate(s){const u=this.needle.evaluate(s),f=this.haystack.evaluate(s);if(!f)return!1;if(!mn(u,["boolean","string","number","null"]))throw new K(`Expected first argument to be of type boolean, string, number or null, but found ${zn(J(u))} instead.`);if(!mn(f,["string","array"]))throw new K(`Expected second argument to be of type array or string, but found ${zn(J(f))} instead.`);return f.indexOf(u)>=0}eachChild(s){s(this.needle),s(this.haystack)}outputDefined(){return!0}}class Bu{constructor(s,u,f){this.type=rt,this.needle=s,this.haystack=u,this.fromIndex=f}static parse(s,u){if(s.length<=2||s.length>=5)return u.error(`Expected 3 or 4 arguments, but found ${s.length-1} instead.`);const f=u.parse(s[1],1,At),_=u.parse(s[2],2,At);if(!f||!_)return null;if(!Ll(f.type,[jt,Jt,rt,fs,At]))return u.error(`Expected first argument to be of type boolean, string, number or null, but found ${zn(f.type)} instead`);if(4===s.length){const x=u.parse(s[3],3,rt);return x?new Bu(f,_,x):null}return new Bu(f,_)}evaluate(s){const u=this.needle.evaluate(s),f=this.haystack.evaluate(s);if(!mn(u,["boolean","string","number","null"]))throw new K(`Expected first argument to be of type boolean, string, number or null, but found ${zn(J(u))} instead.`);if(!mn(f,["string","array"]))throw new K(`Expected second argument to be of type array or string, but found ${zn(J(f))} instead.`);if(this.fromIndex){const _=this.fromIndex.evaluate(s);return f.indexOf(u,_)}return f.indexOf(u)}eachChild(s){s(this.needle),s(this.haystack),this.fromIndex&&s(this.fromIndex)}outputDefined(){return!1}}class Vu{constructor(s,u,f,_,x,C){this.inputType=s,this.type=u,this.input=f,this.cases=_,this.outputs=x,this.otherwise=C}static parse(s,u){if(s.length<5)return u.error(`Expected at least 4 arguments, but found only ${s.length-1}.`);if(s.length%2!=1)return u.error("Expected an even number of arguments.");let f,_;u.expectedType&&"value"!==u.expectedType.kind&&(_=u.expectedType);const x={},C=[];for(let F=2;FNumber.MAX_SAFE_INTEGER)return H.error(`Branch labels must be integers no larger than ${Number.MAX_SAFE_INTEGER}.`);if("number"==typeof W&&Math.floor(W)!==W)return H.error("Numeric branch labels must be integer values.");if(f){if(H.checkSubtype(f,J(W)))return null}else f=J(W);if(void 0!==x[String(W)])return H.error("Branch labels must be unique.");x[String(W)]=C.length}const q=u.parse(B,F,_);if(!q)return null;_=_||q.type,C.push(q)}const M=u.parse(s[1],1,At);if(!M)return null;const A=u.parse(s[s.length-1],s.length-1,_);return A?"value"!==M.type.kind&&u.concat(1).checkSubtype(f,M.type)?null:new Vu(f,_,M,x,C,A):null}evaluate(s){const u=this.input.evaluate(s);return(J(u)===this.inputType&&this.outputs[this.cases[u]]||this.otherwise).evaluate(s)}eachChild(s){s(this.input),this.outputs.forEach(s),s(this.otherwise)}outputDefined(){return this.outputs.every(s=>s.outputDefined())&&this.otherwise.outputDefined()}}class Qh{constructor(s,u,f){this.type=s,this.branches=u,this.otherwise=f}static parse(s,u){if(s.length<4)return u.error(`Expected at least 3 arguments, but found only ${s.length-1}.`);if(s.length%2!=0)return u.error("Expected an odd number of arguments.");let f;u.expectedType&&"value"!==u.expectedType.kind&&(f=u.expectedType);const _=[];for(let C=1;Cu.outputDefined())&&this.otherwise.outputDefined()}}class ed{constructor(s,u,f,_){this.type=s,this.input=u,this.beginIndex=f,this.endIndex=_}static parse(s,u){if(s.length<=2||s.length>=5)return u.error(`Expected 3 or 4 arguments, but found ${s.length-1} instead.`);const f=u.parse(s[1],1,At),_=u.parse(s[2],2,rt);if(!f||!_)return null;if(!Ll(f.type,[Vi(At),Jt,At]))return u.error(`Expected first argument to be of type array or string, but found ${zn(f.type)} instead`);if(4===s.length){const x=u.parse(s[3],3,rt);return x?new ed(f.type,f,_,x):null}return new ed(f.type,f,_)}evaluate(s){const u=this.input.evaluate(s),f=this.beginIndex.evaluate(s);if(!mn(u,["string","array"]))throw new K(`Expected first argument to be of type array or string, but found ${zn(J(u))} instead.`);if(this.endIndex){const _=this.endIndex.evaluate(s);return u.slice(f,_)}return u.slice(f)}eachChild(s){s(this.input),s(this.beginIndex),this.endIndex&&s(this.endIndex)}outputDefined(){return!1}}function Ui(l,s){return"=="===l||"!="===l?"boolean"===s.kind||"string"===s.kind||"number"===s.kind||"null"===s.kind||"value"===s.kind:"string"===s.kind||"number"===s.kind||"value"===s.kind}function Rn(l,s,u,f){return 0===f.compare(s,u)}function Ul(l,s,u){const f="=="!==l&&"!="!==l;return class P6{constructor(x,C,M){this.type=jt,this.lhs=x,this.rhs=C,this.collator=M,this.hasUntypedArgument="value"===x.type.kind||"value"===C.type.kind}static parse(x,C){if(3!==x.length&&4!==x.length)return C.error("Expected two or three arguments.");const M=x[0];let A=C.parse(x[1],1,At);if(!A)return null;if(!Ui(M,A.type))return C.concat(1).error(`"${M}" comparisons are not supported for type '${zn(A.type)}'.`);let F=C.parse(x[2],2,At);if(!F)return null;if(!Ui(M,F.type))return C.concat(2).error(`"${M}" comparisons are not supported for type '${zn(F.type)}'.`);if(A.type.kind!==F.type.kind&&"value"!==A.type.kind&&"value"!==F.type.kind)return C.error(`Cannot compare types '${zn(A.type)}' and '${zn(F.type)}'.`);f&&("value"===A.type.kind&&"value"!==F.type.kind?A=new ce(F.type,[A]):"value"!==A.type.kind&&"value"===F.type.kind&&(F=new ce(A.type,[F])));let O=null;if(4===x.length){if("string"!==A.type.kind&&"string"!==F.type.kind&&"value"!==A.type.kind&&"value"!==F.type.kind)return C.error("Cannot use collator to compare non-string types.");if(O=C.parse(x[3],3,zs),!O)return null}return new P6(A,F,O)}evaluate(x){const C=this.lhs.evaluate(x),M=this.rhs.evaluate(x);if(f&&this.hasUntypedArgument){const A=J(C),F=J(M);if(A.kind!==F.kind||"string"!==A.kind&&"number"!==A.kind)throw new K(`Expected arguments for "${l}" to be (string, string) or (number, number), but found (${A.kind}, ${F.kind}) instead.`)}if(this.collator&&!f&&this.hasUntypedArgument){const A=J(C),F=J(M);if("string"!==A.kind||"string"!==F.kind)return s(x,C,M)}return this.collator?u(x,C,M,this.collator.evaluate(x)):s(x,C,M)}eachChild(x){x(this.lhs),x(this.rhs),this.collator&&x(this.collator)}outputDefined(){return!0}}}const I_=Ul("==",function(l,s,u){return s===u},Rn),T_=Ul("!=",function(l,s,u){return s!==u},function(l,s,u,f){return!Rn(0,s,u,f)}),Ot=Ul("<",function(l,s,u){return s",function(l,s,u){return s>u},function(l,s,u,f){return f.compare(s,u)>0}),Ei=Ul("<=",function(l,s,u){return s<=u},function(l,s,u,f){return f.compare(s,u)<=0}),Uu=Ul(">=",function(l,s,u){return s>=u},function(l,s,u,f){return f.compare(s,u)>=0});class td{constructor(s,u,f,_,x){this.type=Jt,this.number=s,this.locale=u,this.currency=f,this.minFractionDigits=_,this.maxFractionDigits=x}static parse(s,u){if(3!==s.length)return u.error("Expected two arguments.");const f=u.parse(s[1],1,rt);if(!f)return null;const _=s[2];if("object"!=typeof _||Array.isArray(_))return u.error("NumberFormat options argument must be an object.");let x=null;if(_.locale&&(x=u.parse(_.locale,1,Jt),!x))return null;let C=null;if(_.currency&&(C=u.parse(_.currency,1,Jt),!C))return null;let M=null;if(_["min-fraction-digits"]&&(M=u.parse(_["min-fraction-digits"],1,rt),!M))return null;let A=null;return _["max-fraction-digits"]&&(A=u.parse(_["max-fraction-digits"],1,rt),!A)?null:new td(f,x,C,M,A)}evaluate(s){return new Intl.NumberFormat(this.locale?this.locale.evaluate(s):[],{style:this.currency?"currency":"decimal",currency:this.currency?this.currency.evaluate(s):void 0,minimumFractionDigits:this.minFractionDigits?this.minFractionDigits.evaluate(s):void 0,maximumFractionDigits:this.maxFractionDigits?this.maxFractionDigits.evaluate(s):void 0}).format(this.number.evaluate(s))}eachChild(s){s(this.number),this.locale&&s(this.locale),this.currency&&s(this.currency),this.minFractionDigits&&s(this.minFractionDigits),this.maxFractionDigits&&s(this.maxFractionDigits)}outputDefined(){return!1}}class Nc{constructor(s){this.type=Ci,this.sections=s}static parse(s,u){if(s.length<2)return u.error("Expected at least one argument.");const f=s[1];if(!Array.isArray(f)&&"object"==typeof f)return u.error("First argument must be an image or text section.");const _=[];let x=!1;for(let C=1;C<=s.length-1;++C){const M=s[C];if(x&&"object"==typeof M&&!Array.isArray(M)){x=!1;let A=null;if(M["font-scale"]&&(A=u.parse(M["font-scale"],1,rt),!A))return null;let F=null;if(M["text-font"]&&(F=u.parse(M["text-font"],1,Vi(Jt)),!F))return null;let O=null;if(M["text-color"]&&(O=u.parse(M["text-color"],1,io),!O))return null;const B=_[_.length-1];B.scale=A,B.font=F,B.textColor=O}else{const A=u.parse(s[C],1,At);if(!A)return null;const F=A.type.kind;if("string"!==F&&"value"!==F&&"null"!==F&&"resolvedImage"!==F)return u.error("Formatted text type must be 'string', 'value', 'image' or 'null'.");x=!0,_.push({content:A,scale:null,font:null,textColor:null})}}return new Nc(_)}evaluate(s){return new Zr(this.sections.map(u=>{const f=u.content.evaluate(s);return J(f)===oo?new ao("",f,null,null,null):new ao(V(f),null,u.scale?u.scale.evaluate(s):null,u.font?u.font.evaluate(s).join(","):null,u.textColor?u.textColor.evaluate(s):null)}))}eachChild(s){for(const u of this.sections)s(u.content),u.scale&&s(u.scale),u.font&&s(u.font),u.textColor&&s(u.textColor)}outputDefined(){return!1}}class nd{constructor(s){this.type=oo,this.input=s}static parse(s,u){if(2!==s.length)return u.error("Expected two arguments.");const f=u.parse(s[1],1,Jt);return f?new nd(f):u.error("No image name provided.")}evaluate(s){const u=this.input.evaluate(s),f=pi.fromString(u);return f&&s.availableImages&&(f.available=s.availableImages.indexOf(u)>-1),f}eachChild(s){s(this.input)}outputDefined(){return!1}}class rd{constructor(s){this.type=rt,this.input=s}static parse(s,u){if(2!==s.length)return u.error(`Expected 1 argument, but found ${s.length-1} instead.`);const f=u.parse(s[1],1);return f?"array"!==f.type.kind&&"string"!==f.type.kind&&"value"!==f.type.kind?u.error(`Expected argument of type string or array, but found ${zn(f.type)} instead.`):new rd(f):null}evaluate(s){const u=this.input.evaluate(s);if("string"==typeof u||Array.isArray(u))return u.length;throw new K(`Expected value to be of type string or array, but found ${zn(J(u))} instead.`)}eachChild(s){s(this.input)}outputDefined(){return!1}}const Ga={"==":I_,"!=":T_,">":Vm,"<":Ot,">=":Uu,"<=":Ei,array:ce,at:Jh,boolean:ce,case:Qh,coalesce:Kh,collator:je,format:Nc,image:nd,in:Lf,"index-of":Bu,interpolate:Io,"interpolate-hcl":Io,"interpolate-lab":Io,length:rd,let:zu,literal:$,match:Vu,number:ce,"number-format":td,object:ce,slice:ed,step:Bn,string:ce,"to-boolean":he,"to-color":he,"to-number":he,"to-string":he,var:Ou,within:ja};function gn(l,[s,u,f,_]){s=s.evaluate(l),u=u.evaluate(l),f=f.evaluate(l);const x=_?_.evaluate(l):1,C=mi(s,u,f,x);if(C)throw new K(C);return new Sn(s/255*x,u/255*x,f/255*x,x)}function $u(l,s){return l in s}function ju(l,s){const u=s[l];return void 0===u?null:u}function qa(l){return{type:l}}function Rt(l){return{result:"success",value:l}}function la(l){return{result:"error",value:l}}function $l(l){return"data-driven"===l["property-type"]||"cross-faded-data-driven"===l["property-type"]}function lo(l){return!!l.expression&&l.expression.parameters.indexOf("zoom")>-1}function Hu(l){return!!l.expression&&l.expression.interpolated}function Un(l){return l instanceof Number?"number":l instanceof String?"string":l instanceof Boolean?"boolean":Array.isArray(l)?"array":null===l?"null":typeof l}function Wo(l){return"object"==typeof l&&null!==l&&!Array.isArray(l)}function Xo(l){return l}function Um(l,s){const u="color"===s.type,f=l.stops&&"object"==typeof l.stops[0][0],_=f||!(f||void 0!==l.property),x=l.type||(Hu(s)?"exponential":"interval");if(u||"padding"===s.type){const F=u?Sn.parse:Vr.parse;(l=zi({},l)).stops&&(l.stops=l.stops.map(O=>[O[0],F(O[1])])),l.default=F(l.default?l.default:s.default)}if(l.colorSpace&&"rgb"!==l.colorSpace&&!Of[l.colorSpace])throw new Error(`Unknown color space: ${l.colorSpace}`);let C,M,A;if("exponential"===x)C=$m;else if("interval"===x)C=er;else if("categorical"===x){C=ms,M=Object.create(null);for(const F of l.stops)M[F[0]]=F[1];A=typeof l.stops[0][0]}else{if("identity"!==x)throw new Error(`Unknown function type "${x}"`);C=A_}if(f){const F={},O=[];for(let q=0;qq[0]),evaluate:({zoom:q},W)=>$m({stops:B,base:l.base},s,q).evaluate(q,W)}}if(_){const F="exponential"===x?{name:"exponential",base:void 0!==l.base?l.base:1}:null;return{kind:"camera",interpolationType:F,interpolationFactor:Io.interpolationFactor.bind(void 0,F),zoomStops:l.stops.map(O=>O[0]),evaluate:({zoom:O})=>C(l,s,O,M,A)}}return{kind:"source",evaluate(F,O){const B=O&&O.properties?O.properties[l.property]:void 0;return void 0===B?Gu(l.default,s.default):C(l,s,B,M,A)}}}function Gu(l,s,u){return void 0!==l?l:void 0!==s?s:void 0!==u?u:void 0}function ms(l,s,u,f,_){return Gu(typeof u===_?f[u]:void 0,l.default,s.default)}function er(l,s,u){if("number"!==Un(u))return Gu(l.default,s.default);const f=l.stops.length;if(1===f||u<=l.stops[0][0])return l.stops[0][1];if(u>=l.stops[f-1][0])return l.stops[f-1][1];const _=Bl(l.stops.map(x=>x[0]),u);return l.stops[_][1]}function $m(l,s,u){const f=void 0!==l.base?l.base:1;if("number"!==Un(u))return Gu(l.default,s.default);const _=l.stops.length;if(1===_||u<=l.stops[0][0])return l.stops[0][1];if(u>=l.stops[_-1][0])return l.stops[_-1][1];const x=Bl(l.stops.map(O=>O[0]),u),C=function(O,B,H,q){const W=q-H,se=O-H;return 0===W?0:1===B?se/W:(Math.pow(B,se)-1)/(Math.pow(B,W)-1)}(u,f,l.stops[x][0],l.stops[x+1][0]),M=l.stops[x][1],A=l.stops[x+1][1];let F=Mn[s.type]||Xo;if(l.colorSpace&&"rgb"!==l.colorSpace){const O=Of[l.colorSpace];F=(B,H)=>O.reverse(O.interpolate(O.forward(B),O.forward(H),C))}return"function"==typeof M.evaluate?{evaluate(...O){const B=M.evaluate.apply(void 0,O),H=A.evaluate.apply(void 0,O);if(void 0!==B&&void 0!==H)return F(B,H,C)}}:F(M,A,C)}function A_(l,s,u){switch(s.type){case"color":u=Sn.parse(u);break;case"formatted":u=Zr.fromString(u.toString());break;case"resolvedImage":u=pi.fromString(u.toString());break;case"padding":u=Vr.parse(u);break;default:Un(u)===s.type||"enum"===s.type&&s.values[u]||(u=void 0)}return Gu(u,l.default,s.default)}Me.register(Ga,{error:[{kind:"error"},[Jt],(l,[s])=>{throw new K(s.evaluate(l))}],typeof:[Jt,[At],(l,[s])=>zn(J(s.evaluate(l)))],"to-rgba":[Vi(rt,4),[io],(l,[s])=>s.evaluate(l).toArray()],rgb:[io,[rt,rt,rt],gn],rgba:[io,[rt,rt,rt,rt],gn],has:{type:jt,overloads:[[[Jt],(l,[s])=>$u(s.evaluate(l),l.properties())],[[Jt,ps],(l,[s,u])=>$u(s.evaluate(l),u.evaluate(l))]]},get:{type:At,overloads:[[[Jt],(l,[s])=>ju(s.evaluate(l),l.properties())],[[Jt,ps],(l,[s,u])=>ju(s.evaluate(l),u.evaluate(l))]]},"feature-state":[At,[Jt],(l,[s])=>ju(s.evaluate(l),l.featureState||{})],properties:[ps,[],l=>l.properties()],"geometry-type":[Jt,[],l=>l.geometryType()],id:[At,[],l=>l.id()],zoom:[rt,[],l=>l.globals.zoom],"heatmap-density":[rt,[],l=>l.globals.heatmapDensity||0],"line-progress":[rt,[],l=>l.globals.lineProgress||0],accumulated:[At,[],l=>void 0===l.globals.accumulated?null:l.globals.accumulated],"+":[rt,qa(rt),(l,s)=>{let u=0;for(const f of s)u+=f.evaluate(l);return u}],"*":[rt,qa(rt),(l,s)=>{let u=1;for(const f of s)u*=f.evaluate(l);return u}],"-":{type:rt,overloads:[[[rt,rt],(l,[s,u])=>s.evaluate(l)-u.evaluate(l)],[[rt],(l,[s])=>-s.evaluate(l)]]},"/":[rt,[rt,rt],(l,[s,u])=>s.evaluate(l)/u.evaluate(l)],"%":[rt,[rt,rt],(l,[s,u])=>s.evaluate(l)%u.evaluate(l)],ln2:[rt,[],()=>Math.LN2],pi:[rt,[],()=>Math.PI],e:[rt,[],()=>Math.E],"^":[rt,[rt,rt],(l,[s,u])=>Math.pow(s.evaluate(l),u.evaluate(l))],sqrt:[rt,[rt],(l,[s])=>Math.sqrt(s.evaluate(l))],log10:[rt,[rt],(l,[s])=>Math.log(s.evaluate(l))/Math.LN10],ln:[rt,[rt],(l,[s])=>Math.log(s.evaluate(l))],log2:[rt,[rt],(l,[s])=>Math.log(s.evaluate(l))/Math.LN2],sin:[rt,[rt],(l,[s])=>Math.sin(s.evaluate(l))],cos:[rt,[rt],(l,[s])=>Math.cos(s.evaluate(l))],tan:[rt,[rt],(l,[s])=>Math.tan(s.evaluate(l))],asin:[rt,[rt],(l,[s])=>Math.asin(s.evaluate(l))],acos:[rt,[rt],(l,[s])=>Math.acos(s.evaluate(l))],atan:[rt,[rt],(l,[s])=>Math.atan(s.evaluate(l))],min:[rt,qa(rt),(l,s)=>Math.min(...s.map(u=>u.evaluate(l)))],max:[rt,qa(rt),(l,s)=>Math.max(...s.map(u=>u.evaluate(l)))],abs:[rt,[rt],(l,[s])=>Math.abs(s.evaluate(l))],round:[rt,[rt],(l,[s])=>{const u=s.evaluate(l);return u<0?-Math.round(-u):Math.round(u)}],floor:[rt,[rt],(l,[s])=>Math.floor(s.evaluate(l))],ceil:[rt,[rt],(l,[s])=>Math.ceil(s.evaluate(l))],"filter-==":[jt,[Jt,At],(l,[s,u])=>l.properties()[s.value]===u.value],"filter-id-==":[jt,[At],(l,[s])=>l.id()===s.value],"filter-type-==":[jt,[Jt],(l,[s])=>l.geometryType()===s.value],"filter-<":[jt,[Jt,At],(l,[s,u])=>{const f=l.properties()[s.value],_=u.value;return typeof f==typeof _&&f<_}],"filter-id-<":[jt,[At],(l,[s])=>{const u=l.id(),f=s.value;return typeof u==typeof f&&u":[jt,[Jt,At],(l,[s,u])=>{const f=l.properties()[s.value],_=u.value;return typeof f==typeof _&&f>_}],"filter-id->":[jt,[At],(l,[s])=>{const u=l.id(),f=s.value;return typeof u==typeof f&&u>f}],"filter-<=":[jt,[Jt,At],(l,[s,u])=>{const f=l.properties()[s.value],_=u.value;return typeof f==typeof _&&f<=_}],"filter-id-<=":[jt,[At],(l,[s])=>{const u=l.id(),f=s.value;return typeof u==typeof f&&u<=f}],"filter->=":[jt,[Jt,At],(l,[s,u])=>{const f=l.properties()[s.value],_=u.value;return typeof f==typeof _&&f>=_}],"filter-id->=":[jt,[At],(l,[s])=>{const u=l.id(),f=s.value;return typeof u==typeof f&&u>=f}],"filter-has":[jt,[At],(l,[s])=>s.value in l.properties()],"filter-has-id":[jt,[],l=>null!==l.id()&&void 0!==l.id()],"filter-type-in":[jt,[Vi(Jt)],(l,[s])=>s.value.indexOf(l.geometryType())>=0],"filter-id-in":[jt,[Vi(At)],(l,[s])=>s.value.indexOf(l.id())>=0],"filter-in-small":[jt,[Jt,Vi(At)],(l,[s,u])=>u.value.indexOf(l.properties()[s.value])>=0],"filter-in-large":[jt,[Jt,Vi(At)],(l,[s,u])=>function(f,_,x,C){for(;x<=C;){const M=x+C>>1;if(_[M]===f)return!0;_[M]>f?C=M-1:x=M+1}return!1}(l.properties()[s.value],u.value,0,u.value.length-1)],all:{type:jt,overloads:[[[jt,jt],(l,[s,u])=>s.evaluate(l)&&u.evaluate(l)],[qa(jt),(l,s)=>{for(const u of s)if(!u.evaluate(l))return!1;return!0}]]},any:{type:jt,overloads:[[[jt,jt],(l,[s,u])=>s.evaluate(l)||u.evaluate(l)],[qa(jt),(l,s)=>{for(const u of s)if(u.evaluate(l))return!0;return!1}]]},"!":[jt,[jt],(l,[s])=>!s.evaluate(l)],"is-supported-script":[jt,[Jt],(l,[s])=>{const u=l.globals&&l.globals.isSupportedScript;return!u||u(s.evaluate(l))}],upcase:[Jt,[Jt],(l,[s])=>s.evaluate(l).toUpperCase()],downcase:[Jt,[Jt],(l,[s])=>s.evaluate(l).toLowerCase()],concat:[Jt,qa(At),(l,s)=>s.map(u=>V(u.evaluate(l))).join("")],"resolved-locale":[Jt,[zs],(l,[s])=>s.evaluate(l).resolvedLocale()]});class ca{constructor(s,u){var f;this.expression=s,this._warningHistory={},this._evaluator=new xe,this._defaultValue=u?"color"===(f=u).type&&Wo(f.default)?new Sn(0,0,0,0):"color"===f.type?Sn.parse(f.default)||null:"padding"===f.type?Vr.parse(f.default)||null:void 0===f.default?null:f.default:null,this._enumValues=u&&"enum"===u.type?u.values:null}evaluateWithoutErrorHandling(s,u,f,_,x,C){return this._evaluator.globals=s,this._evaluator.feature=u,this._evaluator.featureState=f,this._evaluator.canonical=_,this._evaluator.availableImages=x||null,this._evaluator.formattedSection=C,this.expression.evaluate(this._evaluator)}evaluate(s,u,f,_,x,C){this._evaluator.globals=s,this._evaluator.feature=u||null,this._evaluator.featureState=f||null,this._evaluator.canonical=_,this._evaluator.availableImages=x||null,this._evaluator.formattedSection=C||null;try{const M=this.expression.evaluate(this._evaluator);if(null==M||"number"==typeof M&&M!=M)return this._defaultValue;if(this._enumValues&&!(M in this._enumValues))throw new K(`Expected value to be one of ${Object.keys(this._enumValues).map(A=>JSON.stringify(A)).join(", ")}, but found ${JSON.stringify(M)} instead.`);return M}catch(M){return this._warningHistory[M.message]||(this._warningHistory[M.message]=!0,typeof console<"u"&&console.warn(M.message)),this._defaultValue}}}function Cn(l){return Array.isArray(l)&&l.length>0&&"string"==typeof l[0]&&l[0]in Ga}function Za(l,s){const u=new zl(Ga,[],s?function(_){const x={color:io,string:Jt,number:rt,enum:Jt,boolean:jt,formatted:Ci,padding:ia,resolvedImage:oo};return"array"===_.type?Vi(x[_.value]||At,_.length):x[_.type]}(s):void 0),f=u.parse(l,void 0,void 0,void 0,s&&"string"===s.type?{typeAnnotation:"coerce"}:void 0);return f?Rt(new ca(f,s)):la(u.errors)}class zc{constructor(s,u){this.kind=s,this._styleExpression=u,this.isStateDependent="constant"!==s&&!Ha(u.expression)}evaluateWithoutErrorHandling(s,u,f,_,x,C){return this._styleExpression.evaluateWithoutErrorHandling(s,u,f,_,x,C)}evaluate(s,u,f,_,x,C){return this._styleExpression.evaluate(s,u,f,_,x,C)}}class Bc{constructor(s,u,f,_){this.kind=s,this.zoomStops=f,this._styleExpression=u,this.isStateDependent="camera"!==s&&!Ha(u.expression),this.interpolationType=_}evaluateWithoutErrorHandling(s,u,f,_,x,C){return this._styleExpression.evaluateWithoutErrorHandling(s,u,f,_,x,C)}evaluate(s,u,f,_,x,C){return this._styleExpression.evaluate(s,u,f,_,x,C)}interpolationFactor(s,u,f){return this.interpolationType?Io.interpolationFactor(this.interpolationType,s,u,f):0}}function id(l,s){const u=Za(l,s);if("error"===u.result)return u;const f=u.value.expression,_=Fu(f);if(!_&&!$l(s))return la([new Bi("","data expressions not supported")]);const x=aa(f,["zoom"]);if(!x&&!lo(s))return la([new Bi("","zoom expressions not supported")]);const C=ua(f);return C||x?C instanceof Bi?la([C]):C instanceof Io&&!Hu(s)?la([new Bi("",'"interpolate" expressions cannot be used with this property')]):Rt(C?new Bc(_?"camera":"composite",u.value,C.labels,C instanceof Io?C.interpolation:void 0):new zc(_?"constant":"source",u.value)):la([new Bi("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.')])}class To{constructor(s,u){this._parameters=s,this._specification=u,zi(this,Um(this._parameters,this._specification))}static deserialize(s){return new To(s._parameters,s._specification)}static serialize(s){return{_parameters:s._parameters,_specification:s._specification}}}function ua(l){let s=null;if(l instanceof zu)s=ua(l.result);else if(l instanceof Kh){for(const u of l.args)if(s=ua(u),s)break}else(l instanceof Bn||l instanceof Io)&&l.input instanceof Me&&"zoom"===l.input.name&&(s=l);return s instanceof Bi||l.eachChild(u=>{const f=ua(u);f instanceof Bi?s=f:!s&&f?s=new Bi("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.'):s&&f&&s!==f&&(s=new Bi("",'Only one zoom-based "step" or "interpolate" subexpression may be used in an expression.'))}),s}function Ao(l){const s=l.key,u=l.value,f=l.valueSpec||{},_=l.objectElementValidators||{},x=l.style,C=l.styleSpec,M=l.validateSpec;let A=[];const F=Un(u);if("object"!==F)return[new Pe(s,u,`object expected, ${F} found`)];for(const O in u){const B=O.split(".")[0],H=f[B]||f["*"];let q;if(_[B])q=_[B];else if(f[B])q=M;else if(_["*"])q=_["*"];else{if(!f["*"]){A.push(new Pe(s,u[O],`unknown property "${O}"`));continue}q=M}A=A.concat(q({key:(s&&`${s}.`)+O,value:u[O],valueSpec:H,style:x,styleSpec:C,object:u,objectKey:O,validateSpec:M},u))}for(const O in f)_[O]||f[O].required&&void 0===f[O].default&&void 0===u[O]&&A.push(new Pe(s,u,`missing required property "${O}"`));return A}function Vs(l){const s=l.value,u=l.valueSpec,f=l.style,_=l.styleSpec,x=l.key,C=l.arrayElementValidator||l.validateSpec;if("array"!==Un(s))return[new Pe(x,s,`array expected, ${Un(s)} found`)];if(u.length&&s.length!==u.length)return[new Pe(x,s,`array length ${u.length} expected, length ${s.length} found`)];if(u["min-length"]&&s.lengthf.maximum?[new Pe(s,u,`${u} is greater than the maximum value ${f.maximum}`)]:[]}function sd(l){const s=l.valueSpec,u=Vn(l.value.type);let f,_,x,C={};const M="categorical"!==u&&void 0===l.value.property,A=!M,F="array"===Un(l.value.stops)&&"array"===Un(l.value.stops[0])&&"object"===Un(l.value.stops[0][0]),O=Ao({key:l.key,value:l.value,valueSpec:l.styleSpec.function,validateSpec:l.validateSpec,style:l.style,styleSpec:l.styleSpec,objectElementValidators:{stops:function(q){if("identity"===u)return[new Pe(q.key,q.value,'identity function may not have a "stops" property')];let W=[];const se=q.value;return W=W.concat(Vs({key:q.key,value:se,valueSpec:q.valueSpec,validateSpec:q.validateSpec,style:q.style,styleSpec:q.styleSpec,arrayElementValidator:B})),"array"===Un(se)&&0===se.length&&W.push(new Pe(q.key,se,"array must have at least one stop")),W},default:function(q){return q.validateSpec({key:q.key,value:q.value,valueSpec:s,validateSpec:q.validateSpec,style:q.style,styleSpec:q.styleSpec})}}});return"identity"===u&&M&&O.push(new Pe(l.key,l.value,'missing required property "property"')),"identity"===u||l.value.stops||O.push(new Pe(l.key,l.value,'missing required property "stops"')),"exponential"===u&&l.valueSpec.expression&&!Hu(l.valueSpec)&&O.push(new Pe(l.key,l.value,"exponential functions not supported")),l.styleSpec.$version>=8&&(A&&!$l(l.valueSpec)?O.push(new Pe(l.key,l.value,"property functions not supported")):M&&!lo(l.valueSpec)&&O.push(new Pe(l.key,l.value,"zoom functions not supported"))),"categorical"!==u&&!F||void 0!==l.value.property||O.push(new Pe(l.key,l.value,'"property" property is required')),O;function B(q){let W=[];const se=q.value,oe=q.key;if("array"!==Un(se))return[new Pe(oe,se,`array expected, ${Un(se)} found`)];if(2!==se.length)return[new Pe(oe,se,`array length 2 expected, length ${se.length} found`)];if(F){if("object"!==Un(se[0]))return[new Pe(oe,se,`object expected, ${Un(se[0])} found`)];if(void 0===se[0].zoom)return[new Pe(oe,se,"object stop key must have zoom")];if(void 0===se[0].value)return[new Pe(oe,se,"object stop key must have value")];if(x&&x>Vn(se[0].zoom))return[new Pe(oe,se[0].zoom,"stop zoom values must appear in ascending order")];Vn(se[0].zoom)!==x&&(x=Vn(se[0].zoom),_=void 0,C={}),W=W.concat(Ao({key:`${oe}[0]`,value:se[0],valueSpec:{zoom:{}},validateSpec:q.validateSpec,style:q.style,styleSpec:q.styleSpec,objectElementValidators:{zoom:od,value:H}}))}else W=W.concat(H({key:`${oe}[0]`,value:se[0],valueSpec:{},validateSpec:q.validateSpec,style:q.style,styleSpec:q.styleSpec},se));return Cn(ds(se[1]))?W.concat([new Pe(`${oe}[1]`,se[1],"expressions are not allowed in function stops.")]):W.concat(q.validateSpec({key:`${oe}[1]`,value:se[1],valueSpec:s,validateSpec:q.validateSpec,style:q.style,styleSpec:q.styleSpec}))}function H(q,W){const se=Un(q.value),oe=Vn(q.value),be=null!==q.value?q.value:W;if(f){if(se!==f)return[new Pe(q.key,be,`${se} stop domain type must match previous stop domain type ${f}`)]}else f=se;if("number"!==se&&"string"!==se&&"boolean"!==se)return[new Pe(q.key,be,"stop domain value must be a number, string, or boolean")];if("number"!==se&&"categorical"!==u){let Ce=`number expected, ${se} found`;return $l(s)&&void 0===u&&(Ce+='\nIf you intended to use a categorical function, specify `"type": "categorical"`.'),[new Pe(q.key,be,Ce)]}return"categorical"!==u||"number"!==se||isFinite(oe)&&Math.floor(oe)===oe?"categorical"!==u&&"number"===se&&void 0!==_&&oe<_?[new Pe(q.key,be,"stop domain values must appear in ascending order")]:(_=oe,"categorical"===u&&oe in C?[new Pe(q.key,be,"stop domain values must be unique")]:(C[oe]=!0,[])):[new Pe(q.key,be,`integer expected, found ${oe}`)]}}function Wa(l){const s=("property"===l.expressionContext?id:Za)(ds(l.value),l.valueSpec);if("error"===s.result)return s.value.map(f=>new Pe(`${l.key}${f.key}`,l.value,f.message));const u=s.value.expression||s.value._styleExpression.expression;if("property"===l.expressionContext&&"text-font"===l.propertyKey&&!u.outputDefined())return[new Pe(l.key,l.value,`Invalid data expression for "${l.propertyKey}". Output values must be contained as literals within the expression.`)];if("property"===l.expressionContext&&"layout"===l.propertyType&&!Ha(u))return[new Pe(l.key,l.value,'"feature-state" data expressions are not supported with layout properties.')];if("filter"===l.expressionContext&&!Ha(u))return[new Pe(l.key,l.value,'"feature-state" data expressions are not supported with filters.')];if(l.expressionContext&&0===l.expressionContext.indexOf("cluster")){if(!aa(u,["zoom","feature-state"]))return[new Pe(l.key,l.value,'"zoom" and "feature-state" expressions are not supported with cluster properties.')];if("cluster-initial"===l.expressionContext&&!Fu(u))return[new Pe(l.key,l.value,"Feature data expressions are not supported with initial expression part of cluster properties.")]}return[]}function ai(l){const s=l.key,u=l.value,f=l.valueSpec,_=[];return Array.isArray(f.values)?-1===f.values.indexOf(Vn(u))&&_.push(new Pe(s,u,`expected one of [${f.values.join(", ")}], ${JSON.stringify(u)} found`)):-1===Object.keys(f.values).indexOf(Vn(u))&&_.push(new Pe(s,u,`expected one of [${Object.keys(f.values).join(", ")}], ${JSON.stringify(u)} found`)),_}function qu(l){if(!0===l||!1===l)return!0;if(!Array.isArray(l)||0===l.length)return!1;switch(l[0]){case"has":return l.length>=2&&"$id"!==l[1]&&"$type"!==l[1];case"in":return l.length>=3&&("string"!=typeof l[1]||Array.isArray(l[2]));case"!in":case"!has":case"none":return!1;case"==":case"!=":case">":case">=":case"<":case"<=":return 3!==l.length||Array.isArray(l[1])||Array.isArray(l[2]);case"any":case"all":for(const s of l.slice(1))if(!qu(s)&&"boolean"!=typeof s)return!1;return!0;default:return!0}}const Nf={type:"boolean",default:!1,transition:!1,"property-type":"data-driven",expression:{interpolated:!1,parameters:["zoom","feature"]}};function Lt(l){if(null==l)return{filter:()=>!0,needGeometry:!1};qu(l)||(l=Xr(l));const s=Za(l,Nf);if("error"===s.result)throw new Error(s.value.map(u=>`${u.key}: ${u.message}`).join(", "));return{filter:(u,f,_)=>s.value.evaluate(u,f,{},_),needGeometry:Nt(l)}}function $i(l,s){return ls?1:0}function Nt(l){if(!Array.isArray(l))return!1;if("within"===l[0])return!0;for(let s=1;s"===s||"<="===s||">="===s?kt(l[1],l[2],s):"any"===s?(u=l.slice(1),["any"].concat(u.map(Xr))):"all"===s?["all"].concat(l.slice(1).map(Xr)):"none"===s?["all"].concat(l.slice(1).map(Xr).map(rn)):"in"===s?Us(l[1],l.slice(2)):"!in"===s?rn(Us(l[1],l.slice(2))):"has"===s?cn(l[1]):"!has"===s?rn(cn(l[1])):"within"!==s||l;var u}function kt(l,s,u){switch(l){case"$type":return[`filter-type-${u}`,s];case"$id":return[`filter-id-${u}`,s];default:return[`filter-${u}`,l,s]}}function Us(l,s){if(0===s.length)return!1;switch(l){case"$type":return["filter-type-in",["literal",s]];case"$id":return["filter-id-in",["literal",s]];default:return s.length>200&&!s.some(u=>typeof u!=typeof s[0])?["filter-in-large",l,["literal",s.sort($i)]]:["filter-in-small",l,["literal",s]]}}function cn(l){switch(l){case"$type":return!0;case"$id":return["filter-has-id"];default:return["filter-has",l]}}function rn(l){return["!",l]}function ut(l){return qu(ds(l.value))?Wa(zi({},l,{expressionContext:"filter",valueSpec:{value:"boolean"}})):Wt(l)}function Wt(l){const s=l.value,u=l.key;if("array"!==Un(s))return[new Pe(u,s,`array expected, ${Un(s)} found`)];const f=l.styleSpec;let _,x=[];if(s.length<1)return[new Pe(u,s,"filter array must have at least 1 element")];switch(x=x.concat(ai({key:`${u}[0]`,value:s[0],valueSpec:f.filter_operator,style:l.style,styleSpec:l.styleSpec})),Vn(s[0])){case"<":case"<=":case">":case">=":s.length>=2&&"$type"===Vn(s[1])&&x.push(new Pe(u,s,`"$type" cannot be use with operator "${s[0]}"`));case"==":case"!=":3!==s.length&&x.push(new Pe(u,s,`filter array for operator "${s[0]}" must have 3 elements`));case"in":case"!in":s.length>=2&&(_=Un(s[1]),"string"!==_&&x.push(new Pe(`${u}[1]`,s[1],`string expected, ${_} found`)));for(let C=2;C{F in u&&s.push(new Pe(f,u[F],`"${F}" is prohibited for ref layers`))}),_.layers.forEach(F=>{Vn(F.id)===M&&(A=F)}),A?A.ref?s.push(new Pe(f,u.ref,"ref cannot reference another ref layer")):C=Vn(A.type):s.push(new Pe(f,u.ref,`ref layer "${M}" not found`))}else if("background"!==C)if(u.source){const A=_.sources&&_.sources[u.source],F=A&&Vn(A.type);A?"vector"===F&&"raster"===C?s.push(new Pe(f,u.source,`layer "${u.id}" requires a raster source`)):"raster"===F&&"raster"!==C?s.push(new Pe(f,u.source,`layer "${u.id}" requires a vector source`)):"vector"!==F||u["source-layer"]?"raster-dem"===F&&"hillshade"!==C?s.push(new Pe(f,u.source,"raster-dem source can only be used with layer type 'hillshade'.")):"line"!==C||!u.paint||!u.paint["line-gradient"]||"geojson"===F&&A.lineMetrics||s.push(new Pe(f,u,`layer "${u.id}" specifies a line-gradient, which requires a GeoJSON source with \`lineMetrics\` enabled.`)):s.push(new Pe(f,u,`layer "${u.id}" must specify a "source-layer"`)):s.push(new Pe(f,u.source,`source "${u.source}" not found`))}else s.push(new Pe(f,u,'missing required property "source"'));return s=s.concat(Ao({key:f,value:u,valueSpec:x.layer,style:l.style,styleSpec:l.styleSpec,validateSpec:l.validateSpec,objectElementValidators:{"*":()=>[],type:()=>l.validateSpec({key:`${f}.type`,value:u.type,valueSpec:x.layer.type,style:l.style,styleSpec:l.styleSpec,validateSpec:l.validateSpec,object:u,objectKey:"type"}),filter:ut,layout:A=>Ao({layer:u,key:A.key,value:A.value,style:A.style,styleSpec:A.styleSpec,validateSpec:A.validateSpec,objectElementValidators:{"*":F=>ha(zi({layerType:C},F))}}),paint:A=>Ao({layer:u,key:A.key,value:A.value,style:A.style,styleSpec:A.styleSpec,validateSpec:A.validateSpec,objectElementValidators:{"*":F=>ji(zi({layerType:C},F))}})}})),s}function Hi(l){const s=l.value,u=l.key,f=Un(s);return"string"!==f?[new Pe(u,s,`string expected, ${f} found`)]:[]}const gr={promoteId:function({key:l,value:s}){if("string"===Un(s))return Hi({key:l,value:s});{const u=[];for(const f in s)u.push(...Hi({key:`${l}.${f}`,value:s[f]}));return u}}};function Xa(l){const s=l.value,u=l.key,f=l.styleSpec,_=l.style,x=l.validateSpec;if(!s.type)return[new Pe(u,s,'"type" is required')];const C=Vn(s.type);let M;switch(C){case"vector":case"raster":case"raster-dem":return M=Ao({key:u,value:s,valueSpec:f[`source_${C.replace("-","_")}`],style:l.style,styleSpec:f,objectElementValidators:gr,validateSpec:x}),M;case"geojson":if(M=Ao({key:u,value:s,valueSpec:f.source_geojson,style:_,styleSpec:f,validateSpec:x,objectElementValidators:gr}),s.cluster)for(const A in s.clusterProperties){const[F,O]=s.clusterProperties[A],B="string"==typeof F?[F,["accumulated"],["get",A]]:F;M.push(...Wa({key:`${u}.${A}.map`,value:O,validateSpec:x,expressionContext:"cluster-map"})),M.push(...Wa({key:`${u}.${A}.reduce`,value:B,validateSpec:x,expressionContext:"cluster-reduce"}))}return M;case"video":return Ao({key:u,value:s,valueSpec:f.source_video,style:_,validateSpec:x,styleSpec:f});case"image":return Ao({key:u,value:s,valueSpec:f.source_image,style:_,validateSpec:x,styleSpec:f});case"canvas":return[new Pe(u,null,"Please use runtime APIs to add canvas sources, rather than including them in stylesheets.","source.canvas")];default:return ai({key:`${u}.type`,value:s.type,valueSpec:{values:["vector","raster","raster-dem","geojson","video","image"]},style:_,validateSpec:x,styleSpec:f})}}function Ya(l){const s=l.value,u=l.styleSpec,f=u.light,_=l.style;let x=[];const C=Un(s);if(void 0===s)return x;if("object"!==C)return x=x.concat([new Pe("light",s,`object expected, ${C} found`)]),x;for(const M in s){const A=M.match(/^(.*)-transition$/);x=x.concat(A&&f[A[1]]&&f[A[1]].transition?l.validateSpec({key:M,value:s[M],valueSpec:u.transition,validateSpec:l.validateSpec,style:_,styleSpec:u}):f[M]?l.validateSpec({key:M,value:s[M],valueSpec:f[M],validateSpec:l.validateSpec,style:_,styleSpec:u}):[new Pe(M,s[M],`unknown property "${M}"`)])}return x}function Xt(l){const s=l.value,u=l.styleSpec,f=u.terrain,_=l.style;let x=[];const C=Un(s);if(void 0===s)return x;if("object"!==C)return x=x.concat([new Pe("terrain",s,`object expected, ${C} found`)]),x;for(const M in s)x=x.concat(f[M]?l.validateSpec({key:M,value:s[M],valueSpec:f[M],validateSpec:l.validateSpec,style:_,styleSpec:u}):[new Pe(M,s[M],`unknown property "${M}"`)]);return x}function Vc(l){let s=[];const u=l.value,f=l.key;if(Array.isArray(u)){const _=[],x=[];for(const C in u)u[C].id&&_.includes(u[C].id)&&s.push(new Pe(f,u,`all the sprites' ids must be unique, but ${u[C].id} is duplicated`)),_.push(u[C].id),u[C].url&&x.includes(u[C].url)&&s.push(new Pe(f,u,`all the sprites' URLs must be unique, but ${u[C].url} is duplicated`)),x.push(u[C].url),s=s.concat(Ao({key:`${f}[${C}]`,value:u[C],valueSpec:{id:{type:"string",required:!0},url:{type:"string",required:!0}},validateSpec:l.validateSpec}));return s}return Hi({key:f,value:u})}const Ka={"*":()=>[],array:Vs,boolean:function(l){const s=l.value,u=l.key,f=Un(s);return"boolean"!==f?[new Pe(u,s,`boolean expected, ${f} found`)]:[]},number:od,color:function(l){const s=l.key,u=l.value,f=Un(u);return"string"!==f?[new Pe(s,u,`color expected, ${f} found`)]:null===oa(u)?[new Pe(s,u,`color expected, "${u}" found`)]:[]},constants:Ba,enum:ai,filter:ut,function:sd,layer:Ur,object:Ao,source:Xa,light:Ya,terrain:Xt,string:Hi,formatted:function(l){return 0===Hi(l).length?[]:Wa(l)},resolvedImage:function(l){return 0===Hi(l).length?[]:Wa(l)},padding:function(l){const s=l.key,u=l.value;if("array"===Un(u)){if(u.length<1||u.length>4)return[new Pe(s,u,`padding requires 1 to 4 values; ${u.length} values found`)];const f={type:"number"};let _=[];for(let x=0;x[]}})),l.constants&&(u=u.concat(Ba({key:"constants",value:l.constants,style:l,styleSpec:s,validateSpec:Ja}))),Qa(u)}function co(l){return function(s){return l({...s,validateSpec:Ja})}}function Qa(l){return[].concat(l).sort((s,u)=>s.line-u.line)}function $r(l){return function(...s){return Qa(l.apply(this,s))}}lr.source=$r(co(Xa)),lr.sprite=$r(co(Vc)),lr.glyphs=$r(co(da)),lr.light=$r(co(Ya)),lr.terrain=$r(co(Xt)),lr.layer=$r(co(Ur)),lr.filter=$r(co(ut)),lr.paintProperty=$r(co(ji)),lr.layoutProperty=$r(co(ha));const Yo=lr,ad=Yo.light,$n=Yo.paintProperty,jm=Yo.layoutProperty;function ld(l,s){let u=!1;if(s&&s.length)for(const f of s)l.fire(new mr(new Error(f.message))),u=!0;return u}class $s{constructor(s,u,f){const _=this.cells=[];if(s instanceof ArrayBuffer){this.arrayBuffer=s;const C=new Int32Array(this.arrayBuffer);s=C[0],this.d=(u=C[1])+2*(f=C[2]);for(let A=0;A=B[W+0]&&_>=B[W+1])?(M[q]=!0,C.push(O[q])):M[q]=!1}}}}_forEachCell(s,u,f,_,x,C,M,A){const F=this._convertToCellCoord(s),O=this._convertToCellCoord(u),B=this._convertToCellCoord(f),H=this._convertToCellCoord(_);for(let q=F;q<=B;q++)for(let W=O;W<=H;W++){const se=this.d*W+q;if((!A||A(this._convertFromCellCoord(q),this._convertFromCellCoord(W),this._convertFromCellCoord(q+1),this._convertFromCellCoord(W+1)))&&x.call(this,s,u,f,_,se,C,M,A))return}}_convertFromCellCoord(s){return(s-this.padding)/this.scale}_convertToCellCoord(s){return Math.max(0,Math.min(this.d-1,Math.floor(s*this.scale)+this.padding))}toArrayBuffer(){if(this.arrayBuffer)return this.arrayBuffer;const s=this.cells,u=3+this.cells.length+1+1;let f=0;for(let C=0;C=0)continue;const C=l[x];_[x]=gs[f].shallow.indexOf(x)>=0?C:uo(C,s)}l instanceof Error&&(_.message=l.message)}if(_.$name)throw new Error("$name property is reserved for worker serialization logic.");return"Object"!==f&&(_.$name=f),_}throw new Error("can't serialize object of type "+typeof l)}function Er(l){if(null==l||"boolean"==typeof l||"number"==typeof l||"string"==typeof l||l instanceof Boolean||l instanceof Number||l instanceof String||l instanceof Date||l instanceof RegExp||l instanceof Blob||fa(l)||ro(l)||ArrayBuffer.isView(l)||l instanceof ImageData)return l;if(Array.isArray(l))return l.map(Er);if("object"==typeof l){const s=l.$name||"Object";if(!gs[s])throw new Error(`can't deserialize unregistered class ${s}`);const{klass:u}=gs[s];if(!u)throw new Error(`can't deserialize unregistered class ${s}`);if(u.deserialize)return u.deserialize(l);const f=Object.create(u.prototype);for(const _ of Object.keys(l)){if("$name"===_)continue;const x=l[_];f[_]=gs[s].shallow.indexOf(_)>=0?x:Er(x)}return f}throw new Error("can't deserialize object of type "+typeof l)}class zf{constructor(){this.first=!0}update(s,u){const f=Math.floor(s);return this.first?(this.first=!1,this.lastIntegerZoom=f,this.lastIntegerZoomTime=0,this.lastZoom=s,this.lastFloorZoom=f,!0):(this.lastFloorZoom>f?(this.lastIntegerZoom=f+1,this.lastIntegerZoomTime=u):this.lastFloorZooml>=128&&l<=255,Arabic:l=>l>=1536&&l<=1791,"Arabic Supplement":l=>l>=1872&&l<=1919,"Arabic Extended-A":l=>l>=2208&&l<=2303,"Hangul Jamo":l=>l>=4352&&l<=4607,"Unified Canadian Aboriginal Syllabics":l=>l>=5120&&l<=5759,Khmer:l=>l>=6016&&l<=6143,"Unified Canadian Aboriginal Syllabics Extended":l=>l>=6320&&l<=6399,"General Punctuation":l=>l>=8192&&l<=8303,"Letterlike Symbols":l=>l>=8448&&l<=8527,"Number Forms":l=>l>=8528&&l<=8591,"Miscellaneous Technical":l=>l>=8960&&l<=9215,"Control Pictures":l=>l>=9216&&l<=9279,"Optical Character Recognition":l=>l>=9280&&l<=9311,"Enclosed Alphanumerics":l=>l>=9312&&l<=9471,"Geometric Shapes":l=>l>=9632&&l<=9727,"Miscellaneous Symbols":l=>l>=9728&&l<=9983,"Miscellaneous Symbols and Arrows":l=>l>=11008&&l<=11263,"CJK Radicals Supplement":l=>l>=11904&&l<=12031,"Kangxi Radicals":l=>l>=12032&&l<=12255,"Ideographic Description Characters":l=>l>=12272&&l<=12287,"CJK Symbols and Punctuation":l=>l>=12288&&l<=12351,Hiragana:l=>l>=12352&&l<=12447,Katakana:l=>l>=12448&&l<=12543,Bopomofo:l=>l>=12544&&l<=12591,"Hangul Compatibility Jamo":l=>l>=12592&&l<=12687,Kanbun:l=>l>=12688&&l<=12703,"Bopomofo Extended":l=>l>=12704&&l<=12735,"CJK Strokes":l=>l>=12736&&l<=12783,"Katakana Phonetic Extensions":l=>l>=12784&&l<=12799,"Enclosed CJK Letters and Months":l=>l>=12800&&l<=13055,"CJK Compatibility":l=>l>=13056&&l<=13311,"CJK Unified Ideographs Extension A":l=>l>=13312&&l<=19903,"Yijing Hexagram Symbols":l=>l>=19904&&l<=19967,"CJK Unified Ideographs":l=>l>=19968&&l<=40959,"Yi Syllables":l=>l>=40960&&l<=42127,"Yi Radicals":l=>l>=42128&&l<=42191,"Hangul Jamo Extended-A":l=>l>=43360&&l<=43391,"Hangul Syllables":l=>l>=44032&&l<=55215,"Hangul Jamo Extended-B":l=>l>=55216&&l<=55295,"Private Use Area":l=>l>=57344&&l<=63743,"CJK Compatibility Ideographs":l=>l>=63744&&l<=64255,"Arabic Presentation Forms-A":l=>l>=64336&&l<=65023,"Vertical Forms":l=>l>=65040&&l<=65055,"CJK Compatibility Forms":l=>l>=65072&&l<=65103,"Small Form Variants":l=>l>=65104&&l<=65135,"Arabic Presentation Forms-B":l=>l>=65136&&l<=65279,"Halfwidth and Fullwidth Forms":l=>l>=65280&&l<=65519};function ho(l){for(const s of l)if(jl(s.charCodeAt(0)))return!0;return!1}function cd(l){for(const s of l)if(!Zu(s.charCodeAt(0)))return!1;return!0}function Zu(l){return!(Xe.Arabic(l)||Xe["Arabic Supplement"](l)||Xe["Arabic Extended-A"](l)||Xe["Arabic Presentation Forms-A"](l)||Xe["Arabic Presentation Forms-B"](l))}function jl(l){return!(746!==l&&747!==l&&(l<4352||!(Xe["Bopomofo Extended"](l)||Xe.Bopomofo(l)||Xe["CJK Compatibility Forms"](l)&&!(l>=65097&&l<=65103)||Xe["CJK Compatibility Ideographs"](l)||Xe["CJK Compatibility"](l)||Xe["CJK Radicals Supplement"](l)||Xe["CJK Strokes"](l)||!(!Xe["CJK Symbols and Punctuation"](l)||l>=12296&&l<=12305||l>=12308&&l<=12319||12336===l)||Xe["CJK Unified Ideographs Extension A"](l)||Xe["CJK Unified Ideographs"](l)||Xe["Enclosed CJK Letters and Months"](l)||Xe["Hangul Compatibility Jamo"](l)||Xe["Hangul Jamo Extended-A"](l)||Xe["Hangul Jamo Extended-B"](l)||Xe["Hangul Jamo"](l)||Xe["Hangul Syllables"](l)||Xe.Hiragana(l)||Xe["Ideographic Description Characters"](l)||Xe.Kanbun(l)||Xe["Kangxi Radicals"](l)||Xe["Katakana Phonetic Extensions"](l)||Xe.Katakana(l)&&12540!==l||!(!Xe["Halfwidth and Fullwidth Forms"](l)||65288===l||65289===l||65293===l||l>=65306&&l<=65310||65339===l||65341===l||65343===l||l>=65371&&l<=65503||65507===l||l>=65512&&l<=65519)||!(!Xe["Small Form Variants"](l)||l>=65112&&l<=65118||l>=65123&&l<=65126)||Xe["Unified Canadian Aboriginal Syllabics"](l)||Xe["Unified Canadian Aboriginal Syllabics Extended"](l)||Xe["Vertical Forms"](l)||Xe["Yijing Hexagram Symbols"](l)||Xe["Yi Syllables"](l)||Xe["Yi Radicals"](l))))}function ko(l){return!(jl(l)||(s=l,Xe["Latin-1 Supplement"](s)&&(167===s||169===s||174===s||177===s||188===s||189===s||190===s||215===s||247===s)||Xe["General Punctuation"](s)&&(8214===s||8224===s||8225===s||8240===s||8241===s||8251===s||8252===s||8258===s||8263===s||8264===s||8265===s||8273===s)||Xe["Letterlike Symbols"](s)||Xe["Number Forms"](s)||Xe["Miscellaneous Technical"](s)&&(s>=8960&&s<=8967||s>=8972&&s<=8991||s>=8996&&s<=9e3||9003===s||s>=9085&&s<=9114||s>=9150&&s<=9165||9167===s||s>=9169&&s<=9179||s>=9186&&s<=9215)||Xe["Control Pictures"](s)&&9251!==s||Xe["Optical Character Recognition"](s)||Xe["Enclosed Alphanumerics"](s)||Xe["Geometric Shapes"](s)||Xe["Miscellaneous Symbols"](s)&&!(s>=9754&&s<=9759)||Xe["Miscellaneous Symbols and Arrows"](s)&&(s>=11026&&s<=11055||s>=11088&&s<=11097||s>=11192&&s<=11243)||Xe["CJK Symbols and Punctuation"](s)||Xe.Katakana(s)||Xe["Private Use Area"](s)||Xe["CJK Compatibility Forms"](s)||Xe["Small Form Variants"](s)||Xe["Halfwidth and Fullwidth Forms"](s)||8734===s||8756===s||8757===s||s>=9984&&s<=10087||s>=10102&&s<=10131||65532===s||65533===s));var s}function Uc(l){return l>=1424&&l<=2303||Xe["Arabic Presentation Forms-A"](l)||Xe["Arabic Presentation Forms-B"](l)}function ud(l,s){return!(!s&&Uc(l)||l>=2304&&l<=3583||l>=3840&&l<=4255||Xe.Khmer(l))}function Po(l){for(const s of l)if(Uc(s.charCodeAt(0)))return!0;return!1}const Hl="deferred",Bf="loading",Vf="loaded";let Uf=null,fo="unavailable",js=null;const Hm=function(l){l&&"string"==typeof l&&l.indexOf("NetworkError")>-1&&(fo="error"),Uf&&Uf(l)};function Wu(){$f.fire(new ra("pluginStateChange",{pluginStatus:fo,pluginURL:js}))}const $f=new Qn,Gl=function(){return fo},Gm=function(){if(fo!==Hl||!js)throw new Error("rtl-text-plugin cannot be downloaded unless a pluginURL is specified");fo=Bf,Wu(),js&&Na({url:js},l=>{l?Hm(l):(fo=Vf,Wu())})},po={applyArabicShaping:null,processBidirectionalText:null,processStyledBidirectionalText:null,isLoaded:()=>fo===Vf||null!=po.applyArabicShaping,isLoading:()=>fo===Bf,setState(l){if(!Mo())throw new Error("Cannot set the state of the rtl-text-plugin when not in the web-worker context");fo=l.pluginStatus,js=l.pluginURL},isParsed(){if(!Mo())throw new Error("rtl-text-plugin is only parsed on the worker-threads");return null!=po.applyArabicShaping&&null!=po.processBidirectionalText&&null!=po.processStyledBidirectionalText},getPluginURL(){if(!Mo())throw new Error("rtl-text-plugin url can only be queried from the worker threads");return js}};class cr{constructor(s,u){this.zoom=s,u?(this.now=u.now,this.fadeDuration=u.fadeDuration,this.zoomHistory=u.zoomHistory,this.transition=u.transition):(this.now=0,this.fadeDuration=0,this.zoomHistory=new zf,this.transition={})}isSupportedScript(s){return function(u,f){for(const _ of u)if(!ud(_.charCodeAt(0),f))return!1;return!0}(s,po.isLoaded())}crossFadingFactor(){return 0===this.fadeDuration?1:Math.min((this.now-this.zoomHistory.lastIntegerZoomTime)/this.fadeDuration,1)}getCrossfadeParameters(){const s=this.zoom,u=s-Math.floor(s),f=this.crossFadingFactor();return s>this.zoomHistory.lastIntegerZoom?{fromScale:2,toScale:1,t:u+(1-u)*f}:{fromScale:.5,toScale:1,t:1-(1-f)*u}}}class $c{constructor(s,u){this.property=s,this.value=u,this.expression=function(f,_){if(Wo(f))return new To(f,_);if(Cn(f)){const x=id(f,_);if("error"===x.result)throw new Error(x.value.map(C=>`${C.key}: ${C.message}`).join(", "));return x.value}{let x=f;return"color"===_.type&&"string"==typeof f?x=Sn.parse(f):"padding"!==_.type||"number"!=typeof f&&!Array.isArray(f)||(x=Vr.parse(f)),{kind:"constant",evaluate:()=>x}}}(void 0===u?s.specification.default:u,s.specification)}isDataDriven(){return"source"===this.expression.kind||"composite"===this.expression.kind}possiblyEvaluate(s,u,f){return this.property.possiblyEvaluate(this,s,u,f)}}class hd{constructor(s){this.property=s,this.value=new $c(s,void 0)}transitioned(s,u){return new Yu(this.property,this.value,u,Ni({},s.transition,this.transition),s.now)}untransitioned(){return new Yu(this.property,this.value,null,{},0)}}class Xu{constructor(s){this._properties=s,this._values=Object.create(s.defaultTransitionablePropertyValues)}getValue(s){return wi(this._values[s].value.value)}setValue(s,u){Object.prototype.hasOwnProperty.call(this._values,s)||(this._values[s]=new hd(this._values[s].property)),this._values[s].value=new $c(this._values[s].property,null===u?void 0:wi(u))}getTransition(s){return wi(this._values[s].transition)}setTransition(s,u){Object.prototype.hasOwnProperty.call(this._values,s)||(this._values[s]=new hd(this._values[s].property)),this._values[s].transition=wi(u)||void 0}serialize(){const s={};for(const u of Object.keys(this._values)){const f=this.getValue(u);void 0!==f&&(s[u]=f);const _=this.getTransition(u);void 0!==_&&(s[`${u}-transition`]=_)}return s}transitioned(s,u){const f=new dd(this._properties);for(const _ of Object.keys(this._values))f._values[_]=this._values[_].transitioned(s,u._values[_]);return f}untransitioned(){const s=new dd(this._properties);for(const u of Object.keys(this._values))s._values[u]=this._values[u].untransitioned();return s}}class Yu{constructor(s,u,f,_,x){this.property=s,this.value=u,this.begin=x+_.delay||0,this.end=this.begin+_.duration||0,s.specification.transition&&(_.delay||_.duration)&&(this.prior=f)}possiblyEvaluate(s,u,f){const _=s.now||0,x=this.value.possiblyEvaluate(s,u,f),C=this.prior;if(C){if(_>this.end)return this.prior=null,x;if(this.value.isDataDriven())return this.prior=null,x;if(_=1)return 1;const F=A*A,O=F*A;return 4*(A<.5?O:3*(A-F)+O-.75)}(M))}}return x}}class dd{constructor(s){this._properties=s,this._values=Object.create(s.defaultTransitioningPropertyValues)}possiblyEvaluate(s,u,f){const _=new _s(this._properties);for(const x of Object.keys(this._values))_._values[x]=this._values[x].possiblyEvaluate(s,u,f);return _}hasTransition(){for(const s of Object.keys(this._values))if(this._values[s].prior)return!0;return!1}}class fd{constructor(s){this._properties=s,this._values=Object.create(s.defaultPropertyValues)}getValue(s){return wi(this._values[s].value)}setValue(s,u){this._values[s]=new $c(this._values[s].property,null===u?void 0:wi(u))}serialize(){const s={};for(const u of Object.keys(this._values)){const f=this.getValue(u);void 0!==f&&(s[u]=f)}return s}possiblyEvaluate(s,u,f){const _=new _s(this._properties);for(const x of Object.keys(this._values))_._values[x]=this._values[x].possiblyEvaluate(s,u,f);return _}}class ys{constructor(s,u,f){this.property=s,this.value=u,this.parameters=f}isConstant(){return"constant"===this.value.kind}constantOr(s){return"constant"===this.value.kind?this.value.value:s}evaluate(s,u,f,_){return this.property.evaluate(this.value,this.parameters,s,u,f,_)}}class _s{constructor(s){this._properties=s,this._values=Object.create(s.defaultPossiblyEvaluatedValues)}get(s){return this._values[s]}}class wt{constructor(s){this.specification=s}possiblyEvaluate(s,u){if(s.isDataDriven())throw new Error("Value should not be data driven");return s.expression.evaluate(u)}interpolate(s,u,f){const _=Mn[this.specification.type];return _?_(s,u,f):s}}class yt{constructor(s,u){this.specification=s,this.overrides=u}possiblyEvaluate(s,u,f,_){return new ys(this,"constant"===s.expression.kind||"camera"===s.expression.kind?{kind:"constant",value:s.expression.evaluate(u,null,{},f,_)}:s.expression,u)}interpolate(s,u,f){if("constant"!==s.value.kind||"constant"!==u.value.kind)return s;if(void 0===s.value.value||void 0===u.value.value)return new ys(this,{kind:"constant",value:void 0},s.parameters);const _=Mn[this.specification.type];return _?new ys(this,{kind:"constant",value:_(s.value.value,u.value.value,f)},s.parameters):s}evaluate(s,u,f,_,x,C){return"constant"===s.kind?s.value:s.evaluate(u,f,_,x,C)}}class el extends yt{possiblyEvaluate(s,u,f,_){if(void 0===s.value)return new ys(this,{kind:"constant",value:void 0},u);if("constant"===s.expression.kind){const x=s.expression.evaluate(u,null,{},f,_),C="resolvedImage"===s.property.specification.type&&"string"!=typeof x?x.name:x,M=this._calculate(C,C,C,u);return new ys(this,{kind:"constant",value:M},u)}if("camera"===s.expression.kind){const x=this._calculate(s.expression.evaluate({zoom:u.zoom-1}),s.expression.evaluate({zoom:u.zoom}),s.expression.evaluate({zoom:u.zoom+1}),u);return new ys(this,{kind:"constant",value:x},u)}return new ys(this,s.expression,u)}evaluate(s,u,f,_,x,C){if("source"===s.kind){const M=s.evaluate(u,f,_,x,C);return this._calculate(M,M,M,u)}return"composite"===s.kind?this._calculate(s.evaluate({zoom:Math.floor(u.zoom)-1},f,_),s.evaluate({zoom:Math.floor(u.zoom)},f,_),s.evaluate({zoom:Math.floor(u.zoom)+1},f,_),u):s.value}_calculate(s,u,f,_){return _.zoom>_.zoomHistory.lastIntegerZoom?{from:s,to:u}:{from:f,to:u}}interpolate(s){return s}}class pd{constructor(s){this.specification=s}possiblyEvaluate(s,u,f,_){if(void 0!==s.value){if("constant"===s.expression.kind){const x=s.expression.evaluate(u,null,{},f,_);return this._calculate(x,x,x,u)}return this._calculate(s.expression.evaluate(new cr(Math.floor(u.zoom-1),u)),s.expression.evaluate(new cr(Math.floor(u.zoom),u)),s.expression.evaluate(new cr(Math.floor(u.zoom+1),u)),u)}}_calculate(s,u,f,_){return _.zoom>_.zoomHistory.lastIntegerZoom?{from:s,to:u}:{from:f,to:u}}interpolate(s){return s}}class md{constructor(s){this.specification=s}possiblyEvaluate(s,u,f,_){return!!s.expression.evaluate(u,null,{},f,_)}interpolate(){return!1}}class Di{constructor(s){this.properties=s,this.defaultPropertyValues={},this.defaultTransitionablePropertyValues={},this.defaultTransitioningPropertyValues={},this.defaultPossiblyEvaluatedValues={},this.overridableProperties=[];for(const u in s){const f=s[u];f.specification.overridable&&this.overridableProperties.push(u);const _=this.defaultPropertyValues[u]=new $c(f,void 0),x=this.defaultTransitionablePropertyValues[u]=new hd(f);this.defaultTransitioningPropertyValues[u]=x.untransitioned(),this.defaultPossiblyEvaluatedValues[u]=_.possiblyEvaluate({})}}}ct("DataDrivenProperty",yt),ct("DataConstantProperty",wt),ct("CrossFadedDataDrivenProperty",el),ct("CrossFadedProperty",pd),ct("ColorRampProperty",md);const jc="-transition";class Ko extends Qn{constructor(s,u){if(super(),this.id=s.id,this.type=s.type,this._featureFilter={filter:()=>!0,needGeometry:!1},"custom"!==s.type&&(this.metadata=s.metadata,this.minzoom=s.minzoom,this.maxzoom=s.maxzoom,"background"!==s.type&&(this.source=s.source,this.sourceLayer=s["source-layer"],this.filter=s.filter),u.layout&&(this._unevaluatedLayout=new fd(u.layout)),u.paint)){this._transitionablePaint=new Xu(u.paint);for(const f in s.paint)this.setPaintProperty(f,s.paint[f],{validate:!1});for(const f in s.layout)this.setLayoutProperty(f,s.layout[f],{validate:!1});this._transitioningPaint=this._transitionablePaint.untransitioned(),this.paint=new _s(u.paint)}}getCrossfadeParameters(){return this._crossfadeParameters}getLayoutProperty(s){return"visibility"===s?this.visibility:this._unevaluatedLayout.getValue(s)}setLayoutProperty(s,u,f={}){null!=u&&this._validate(jm,`layers.${this.id}.layout.${s}`,s,u,f)||("visibility"!==s?this._unevaluatedLayout.setValue(s,u):this.visibility=u)}getPaintProperty(s){return s.endsWith(jc)?this._transitionablePaint.getTransition(s.slice(0,-jc.length)):this._transitionablePaint.getValue(s)}setPaintProperty(s,u,f={}){if(null!=u&&this._validate($n,`layers.${this.id}.paint.${s}`,s,u,f))return!1;if(s.endsWith(jc))return this._transitionablePaint.setTransition(s.slice(0,-jc.length),u||void 0),!1;{const _=this._transitionablePaint._values[s],x="cross-faded-data-driven"===_.property.specification["property-type"],C=_.value.isDataDriven(),M=_.value;this._transitionablePaint.setValue(s,u),this._handleSpecialPaintPropertyUpdate(s);const A=this._transitionablePaint._values[s].value;return A.isDataDriven()||C||x||this._handleOverridablePaintPropertyUpdate(s,M,A)}}_handleSpecialPaintPropertyUpdate(s){}_handleOverridablePaintPropertyUpdate(s,u,f){return!1}isHidden(s){return!!(this.minzoom&&s=this.maxzoom)||"none"===this.visibility}updateTransitions(s){this._transitioningPaint=this._transitionablePaint.transitioned(s,this._transitioningPaint)}hasTransition(){return this._transitioningPaint.hasTransition()}recalculate(s,u){s.getCrossfadeParameters&&(this._crossfadeParameters=s.getCrossfadeParameters()),this._unevaluatedLayout&&(this.layout=this._unevaluatedLayout.possiblyEvaluate(s,void 0,u)),this.paint=this._transitioningPaint.possiblyEvaluate(s,void 0,u)}serialize(){const s={id:this.id,type:this.type,source:this.source,"source-layer":this.sourceLayer,metadata:this.metadata,minzoom:this.minzoom,maxzoom:this.maxzoom,filter:this.filter,layout:this._unevaluatedLayout&&this._unevaluatedLayout.serialize(),paint:this._transitionablePaint&&this._transitionablePaint.serialize()};return this.visibility&&(s.layout=s.layout||{},s.layout.visibility=this.visibility),Rl(s,(u,f)=>!(void 0===u||"layout"===f&&!Object.keys(u).length||"paint"===f&&!Object.keys(u).length))}_validate(s,u,f,_,x={}){return(!x||!1!==x.validate)&&ld(this,s.call(Yo,{key:u,layerType:this.type,objectKey:f,value:_,styleSpec:Ae,style:{glyphs:!0,sprite:!0}}))}is3D(){return!1}isTileClipped(){return!1}hasOffscreenPass(){return!1}resize(){}isStateDependent(){for(const s in this.paint._values){const u=this.paint.get(s);if(u instanceof ys&&$l(u.property.specification)&&("source"===u.value.kind||"composite"===u.value.kind)&&u.value.isStateDependent)return!0}return!1}}const gd={Int8:Int8Array,Uint8:Uint8Array,Int16:Int16Array,Uint16:Uint16Array,Int32:Int32Array,Uint32:Uint32Array,Float32:Float32Array};class Ku{constructor(s,u){this._structArray=s,this._pos1=u*this.size,this._pos2=this._pos1/2,this._pos4=this._pos1/4,this._pos8=this._pos1/8}}class In{constructor(){this.isTransferred=!1,this.capacity=-1,this.resize(0)}static serialize(s,u){return s._trim(),u&&(s.isTransferred=!0,u.push(s.arrayBuffer)),{length:s.length,arrayBuffer:s.arrayBuffer}}static deserialize(s){const u=Object.create(this.prototype);return u.arrayBuffer=s.arrayBuffer,u.length=s.length,u.capacity=s.arrayBuffer.byteLength/u.bytesPerElement,u._refreshViews(),u}_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(s){this.reserve(s),this.length=s}reserve(s){if(s>this.capacity){this.capacity=Math.max(s,Math.floor(5*this.capacity),128),this.arrayBuffer=new ArrayBuffer(this.capacity*this.bytesPerElement);const u=this.uint8;this._refreshViews(),u&&this.uint8.set(u)}}_refreshViews(){throw new Error("_refreshViews() must be implemented by each concrete StructArray layout")}}function Dr(l,s=1){let u=0,f=0;return{members:l.map(_=>{const x=gd[_.type].BYTES_PER_ELEMENT,C=u=jf(u,Math.max(s,x)),M=_.components||1;return f=Math.max(f,x),u+=x*M,{name:_.name,type:_.type,components:M,offset:C}}),size:jf(u,Math.max(f,s)),alignment:s}}function jf(l,s){return Math.ceil(l/s)*s}class tl extends In{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(s,u){const f=this.length;return this.resize(f+1),this.emplace(f,s,u)}emplace(s,u,f){const _=2*s;return this.int16[_+0]=u,this.int16[_+1]=f,s}}tl.prototype.bytesPerElement=4,ct("StructArrayLayout2i4",tl);class Ju extends In{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(s,u,f){const _=this.length;return this.resize(_+1),this.emplace(_,s,u,f)}emplace(s,u,f,_){const x=3*s;return this.int16[x+0]=u,this.int16[x+1]=f,this.int16[x+2]=_,s}}Ju.prototype.bytesPerElement=6,ct("StructArrayLayout3i6",Ju);class Hc extends In{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(s,u,f,_){const x=this.length;return this.resize(x+1),this.emplace(x,s,u,f,_)}emplace(s,u,f,_,x){const C=4*s;return this.int16[C+0]=u,this.int16[C+1]=f,this.int16[C+2]=_,this.int16[C+3]=x,s}}Hc.prototype.bytesPerElement=8,ct("StructArrayLayout4i8",Hc);class Sr extends In{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(s,u,f,_,x,C){const M=this.length;return this.resize(M+1),this.emplace(M,s,u,f,_,x,C)}emplace(s,u,f,_,x,C,M){const A=6*s;return this.int16[A+0]=u,this.int16[A+1]=f,this.int16[A+2]=_,this.int16[A+3]=x,this.int16[A+4]=C,this.int16[A+5]=M,s}}Sr.prototype.bytesPerElement=12,ct("StructArrayLayout2i4i12",Sr);class Gc extends In{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(s,u,f,_,x,C){const M=this.length;return this.resize(M+1),this.emplace(M,s,u,f,_,x,C)}emplace(s,u,f,_,x,C,M){const A=4*s,F=8*s;return this.int16[A+0]=u,this.int16[A+1]=f,this.uint8[F+4]=_,this.uint8[F+5]=x,this.uint8[F+6]=C,this.uint8[F+7]=M,s}}Gc.prototype.bytesPerElement=8,ct("StructArrayLayout2i4ub8",Gc);class Qu extends In{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(s,u){const f=this.length;return this.resize(f+1),this.emplace(f,s,u)}emplace(s,u,f){const _=2*s;return this.float32[_+0]=u,this.float32[_+1]=f,s}}Qu.prototype.bytesPerElement=8,ct("StructArrayLayout2f8",Qu);class ql extends In{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(s,u,f,_,x,C,M,A,F,O){const B=this.length;return this.resize(B+1),this.emplace(B,s,u,f,_,x,C,M,A,F,O)}emplace(s,u,f,_,x,C,M,A,F,O,B){const H=10*s;return this.uint16[H+0]=u,this.uint16[H+1]=f,this.uint16[H+2]=_,this.uint16[H+3]=x,this.uint16[H+4]=C,this.uint16[H+5]=M,this.uint16[H+6]=A,this.uint16[H+7]=F,this.uint16[H+8]=O,this.uint16[H+9]=B,s}}ql.prototype.bytesPerElement=20,ct("StructArrayLayout10ui20",ql);class Si extends In{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(s,u,f,_,x,C,M,A,F,O,B,H){const q=this.length;return this.resize(q+1),this.emplace(q,s,u,f,_,x,C,M,A,F,O,B,H)}emplace(s,u,f,_,x,C,M,A,F,O,B,H,q){const W=12*s;return this.int16[W+0]=u,this.int16[W+1]=f,this.int16[W+2]=_,this.int16[W+3]=x,this.uint16[W+4]=C,this.uint16[W+5]=M,this.uint16[W+6]=A,this.uint16[W+7]=F,this.int16[W+8]=O,this.int16[W+9]=B,this.int16[W+10]=H,this.int16[W+11]=q,s}}Si.prototype.bytesPerElement=24,ct("StructArrayLayout4i4ui4i24",Si);class eh extends In{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(s,u,f){const _=this.length;return this.resize(_+1),this.emplace(_,s,u,f)}emplace(s,u,f,_){const x=3*s;return this.float32[x+0]=u,this.float32[x+1]=f,this.float32[x+2]=_,s}}eh.prototype.bytesPerElement=12,ct("StructArrayLayout3f12",eh);class Zl extends In{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer)}emplaceBack(s){const u=this.length;return this.resize(u+1),this.emplace(u,s)}emplace(s,u){return this.uint32[1*s+0]=u,s}}Zl.prototype.bytesPerElement=4,ct("StructArrayLayout1ul4",Zl);class pa extends In{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(s,u,f,_,x,C,M,A,F){const O=this.length;return this.resize(O+1),this.emplace(O,s,u,f,_,x,C,M,A,F)}emplace(s,u,f,_,x,C,M,A,F,O){const B=10*s,H=5*s;return this.int16[B+0]=u,this.int16[B+1]=f,this.int16[B+2]=_,this.int16[B+3]=x,this.int16[B+4]=C,this.int16[B+5]=M,this.uint32[H+3]=A,this.uint16[B+8]=F,this.uint16[B+9]=O,s}}pa.prototype.bytesPerElement=20,ct("StructArrayLayout6i1ul2ui20",pa);class Mi extends In{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(s,u,f,_,x,C){const M=this.length;return this.resize(M+1),this.emplace(M,s,u,f,_,x,C)}emplace(s,u,f,_,x,C,M){const A=6*s;return this.int16[A+0]=u,this.int16[A+1]=f,this.int16[A+2]=_,this.int16[A+3]=x,this.int16[A+4]=C,this.int16[A+5]=M,s}}Mi.prototype.bytesPerElement=12,ct("StructArrayLayout2i2i2i12",Mi);class yd extends In{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(s,u,f,_,x){const C=this.length;return this.resize(C+1),this.emplace(C,s,u,f,_,x)}emplace(s,u,f,_,x,C){const M=4*s,A=8*s;return this.float32[M+0]=u,this.float32[M+1]=f,this.float32[M+2]=_,this.int16[A+6]=x,this.int16[A+7]=C,s}}yd.prototype.bytesPerElement=16,ct("StructArrayLayout2f1f2i16",yd);class Wl extends In{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(s,u,f,_){const x=this.length;return this.resize(x+1),this.emplace(x,s,u,f,_)}emplace(s,u,f,_,x){const C=12*s,M=3*s;return this.uint8[C+0]=u,this.uint8[C+1]=f,this.float32[M+1]=_,this.float32[M+2]=x,s}}Wl.prototype.bytesPerElement=12,ct("StructArrayLayout2ub2f12",Wl);class th extends In{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(s,u,f){const _=this.length;return this.resize(_+1),this.emplace(_,s,u,f)}emplace(s,u,f,_){const x=3*s;return this.uint16[x+0]=u,this.uint16[x+1]=f,this.uint16[x+2]=_,s}}th.prototype.bytesPerElement=6,ct("StructArrayLayout3ui6",th);class vs extends In{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(s,u,f,_,x,C,M,A,F,O,B,H,q,W,se,oe,be){const Ce=this.length;return this.resize(Ce+1),this.emplace(Ce,s,u,f,_,x,C,M,A,F,O,B,H,q,W,se,oe,be)}emplace(s,u,f,_,x,C,M,A,F,O,B,H,q,W,se,oe,be,Ce){const me=24*s,Ee=12*s,$e=48*s;return this.int16[me+0]=u,this.int16[me+1]=f,this.uint16[me+2]=_,this.uint16[me+3]=x,this.uint32[Ee+2]=C,this.uint32[Ee+3]=M,this.uint32[Ee+4]=A,this.uint16[me+10]=F,this.uint16[me+11]=O,this.uint16[me+12]=B,this.float32[Ee+7]=H,this.float32[Ee+8]=q,this.uint8[$e+36]=W,this.uint8[$e+37]=se,this.uint8[$e+38]=oe,this.uint32[Ee+10]=be,this.int16[me+22]=Ce,s}}vs.prototype.bytesPerElement=48,ct("StructArrayLayout2i2ui3ul3ui2f3ub1ul1i48",vs);class Hs extends In{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(s,u,f,_,x,C,M,A,F,O,B,H,q,W,se,oe,be,Ce,me,Ee,$e,Ve,gt,Ct,at,tt,Qe,ot){const it=this.length;return this.resize(it+1),this.emplace(it,s,u,f,_,x,C,M,A,F,O,B,H,q,W,se,oe,be,Ce,me,Ee,$e,Ve,gt,Ct,at,tt,Qe,ot)}emplace(s,u,f,_,x,C,M,A,F,O,B,H,q,W,se,oe,be,Ce,me,Ee,$e,Ve,gt,Ct,at,tt,Qe,ot,it){const Ge=34*s,Et=17*s;return this.int16[Ge+0]=u,this.int16[Ge+1]=f,this.int16[Ge+2]=_,this.int16[Ge+3]=x,this.int16[Ge+4]=C,this.int16[Ge+5]=M,this.int16[Ge+6]=A,this.int16[Ge+7]=F,this.uint16[Ge+8]=O,this.uint16[Ge+9]=B,this.uint16[Ge+10]=H,this.uint16[Ge+11]=q,this.uint16[Ge+12]=W,this.uint16[Ge+13]=se,this.uint16[Ge+14]=oe,this.uint16[Ge+15]=be,this.uint16[Ge+16]=Ce,this.uint16[Ge+17]=me,this.uint16[Ge+18]=Ee,this.uint16[Ge+19]=$e,this.uint16[Ge+20]=Ve,this.uint16[Ge+21]=gt,this.uint16[Ge+22]=Ct,this.uint32[Et+12]=at,this.float32[Et+13]=tt,this.float32[Et+14]=Qe,this.float32[Et+15]=ot,this.float32[Et+16]=it,s}}Hs.prototype.bytesPerElement=68,ct("StructArrayLayout8i15ui1ul4f68",Hs);class Xl extends In{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(s){const u=this.length;return this.resize(u+1),this.emplace(u,s)}emplace(s,u){return this.float32[1*s+0]=u,s}}Xl.prototype.bytesPerElement=4,ct("StructArrayLayout1f4",Xl);class Vt extends In{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(s,u,f){const _=this.length;return this.resize(_+1),this.emplace(_,s,u,f)}emplace(s,u,f,_){const x=4*s;return this.uint32[2*s+0]=u,this.uint16[x+2]=f,this.uint16[x+3]=_,s}}Vt.prototype.bytesPerElement=8,ct("StructArrayLayout1ul2ui8",Vt);class nh extends In{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(s,u){const f=this.length;return this.resize(f+1),this.emplace(f,s,u)}emplace(s,u,f){const _=2*s;return this.uint16[_+0]=u,this.uint16[_+1]=f,s}}nh.prototype.bytesPerElement=4,ct("StructArrayLayout2ui4",nh);class _d extends In{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(s){const u=this.length;return this.resize(u+1),this.emplace(u,s)}emplace(s,u){return this.uint16[1*s+0]=u,s}}_d.prototype.bytesPerElement=2,ct("StructArrayLayout1ui2",_d);class vd extends In{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(s,u,f,_){const x=this.length;return this.resize(x+1),this.emplace(x,s,u,f,_)}emplace(s,u,f,_,x){const C=4*s;return this.float32[C+0]=u,this.float32[C+1]=f,this.float32[C+2]=_,this.float32[C+3]=x,s}}vd.prototype.bytesPerElement=16,ct("StructArrayLayout4f16",vd);class Hf extends Ku{get anchorPointX(){return this._structArray.int16[this._pos2+0]}get anchorPointY(){return this._structArray.int16[this._pos2+1]}get x1(){return this._structArray.int16[this._pos2+2]}get y1(){return this._structArray.int16[this._pos2+3]}get x2(){return this._structArray.int16[this._pos2+4]}get y2(){return this._structArray.int16[this._pos2+5]}get featureIndex(){return this._structArray.uint32[this._pos4+3]}get sourceLayerIndex(){return this._structArray.uint16[this._pos2+8]}get bucketIndex(){return this._structArray.uint16[this._pos2+9]}get anchorPoint(){return new Tt(this.anchorPointX,this.anchorPointY)}}Hf.prototype.size=20;class bd extends pa{get(s){return new Hf(this,s)}}ct("CollisionBoxArray",bd);class qc extends Ku{get anchorX(){return this._structArray.int16[this._pos2+0]}get anchorY(){return this._structArray.int16[this._pos2+1]}get glyphStartIndex(){return this._structArray.uint16[this._pos2+2]}get numGlyphs(){return this._structArray.uint16[this._pos2+3]}get vertexStartIndex(){return this._structArray.uint32[this._pos4+2]}get lineStartIndex(){return this._structArray.uint32[this._pos4+3]}get lineLength(){return this._structArray.uint32[this._pos4+4]}get segment(){return this._structArray.uint16[this._pos2+10]}get lowerSize(){return this._structArray.uint16[this._pos2+11]}get upperSize(){return this._structArray.uint16[this._pos2+12]}get lineOffsetX(){return this._structArray.float32[this._pos4+7]}get lineOffsetY(){return this._structArray.float32[this._pos4+8]}get writingMode(){return this._structArray.uint8[this._pos1+36]}get placedOrientation(){return this._structArray.uint8[this._pos1+37]}set placedOrientation(s){this._structArray.uint8[this._pos1+37]=s}get hidden(){return this._structArray.uint8[this._pos1+38]}set hidden(s){this._structArray.uint8[this._pos1+38]=s}get crossTileID(){return this._structArray.uint32[this._pos4+10]}set crossTileID(s){this._structArray.uint32[this._pos4+10]=s}get associatedIconIndex(){return this._structArray.int16[this._pos2+22]}}qc.prototype.size=48;class xd extends vs{get(s){return new qc(this,s)}}ct("PlacedSymbolArray",xd);class rh extends Ku{get anchorX(){return this._structArray.int16[this._pos2+0]}get anchorY(){return this._structArray.int16[this._pos2+1]}get rightJustifiedTextSymbolIndex(){return this._structArray.int16[this._pos2+2]}get centerJustifiedTextSymbolIndex(){return this._structArray.int16[this._pos2+3]}get leftJustifiedTextSymbolIndex(){return this._structArray.int16[this._pos2+4]}get verticalPlacedTextSymbolIndex(){return this._structArray.int16[this._pos2+5]}get placedIconSymbolIndex(){return this._structArray.int16[this._pos2+6]}get verticalPlacedIconSymbolIndex(){return this._structArray.int16[this._pos2+7]}get key(){return this._structArray.uint16[this._pos2+8]}get textBoxStartIndex(){return this._structArray.uint16[this._pos2+9]}get textBoxEndIndex(){return this._structArray.uint16[this._pos2+10]}get verticalTextBoxStartIndex(){return this._structArray.uint16[this._pos2+11]}get verticalTextBoxEndIndex(){return this._structArray.uint16[this._pos2+12]}get iconBoxStartIndex(){return this._structArray.uint16[this._pos2+13]}get iconBoxEndIndex(){return this._structArray.uint16[this._pos2+14]}get verticalIconBoxStartIndex(){return this._structArray.uint16[this._pos2+15]}get verticalIconBoxEndIndex(){return this._structArray.uint16[this._pos2+16]}get featureIndex(){return this._structArray.uint16[this._pos2+17]}get numHorizontalGlyphVertices(){return this._structArray.uint16[this._pos2+18]}get numVerticalGlyphVertices(){return this._structArray.uint16[this._pos2+19]}get numIconVertices(){return this._structArray.uint16[this._pos2+20]}get numVerticalIconVertices(){return this._structArray.uint16[this._pos2+21]}get useRuntimeCollisionCircles(){return this._structArray.uint16[this._pos2+22]}get crossTileID(){return this._structArray.uint32[this._pos4+12]}set crossTileID(s){this._structArray.uint32[this._pos4+12]=s}get textBoxScale(){return this._structArray.float32[this._pos4+13]}get textOffset0(){return this._structArray.float32[this._pos4+14]}get textOffset1(){return this._structArray.float32[this._pos4+15]}get collisionCircleDiameter(){return this._structArray.float32[this._pos4+16]}}rh.prototype.size=68;class He extends Hs{get(s){return new rh(this,s)}}ct("SymbolInstanceArray",He);class en extends Xl{getoffsetX(s){return this.float32[1*s+0]}}ct("GlyphOffsetArray",en);class ma extends Ju{getx(s){return this.int16[3*s+0]}gety(s){return this.int16[3*s+1]}gettileUnitDistanceFromAnchor(s){return this.int16[3*s+2]}}ct("SymbolLineVertexArray",ma);class Gs extends Ku{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]}}Gs.prototype.size=8;class Pr extends Vt{get(s){return new Gs(this,s)}}ct("FeatureIndexArray",Pr);class ih extends tl{}class qs extends tl{}class bs extends tl{}class wd extends Sr{}class oh extends Gc{}class k_ extends Qu{}class ga extends ql{}class g extends Si{}class a extends eh{}class h extends Zl{}class m extends Mi{}class y extends Wl{}class w extends th{}class S extends nh{}const T=Dr([{name:"a_pos",components:2,type:"Int16"}],4),{members:k}=T;class R{constructor(s=[]){this.segments=s}prepareSegment(s,u,f,_){let x=this.segments[this.segments.length-1];return s>R.MAX_VERTEX_ARRAY_LENGTH&&pn(`Max vertices per segment is ${R.MAX_VERTEX_ARRAY_LENGTH}: bucket requested ${s}`),(!x||x.vertexLength+s>R.MAX_VERTEX_ARRAY_LENGTH||x.sortKey!==_)&&(x={vertexOffset:u.length,primitiveOffset:f.length,vertexLength:0,primitiveLength:0},void 0!==_&&(x.sortKey=_),this.segments.push(x)),x}get(){return this.segments}destroy(){for(const s of this.segments)for(const u in s.vaos)s.vaos[u].destroy()}static simpleSegment(s,u,f,_){return new R([{vertexOffset:s,primitiveOffset:u,vertexLength:f,primitiveLength:_,vaos:{},sortKey:0}])}}function z(l,s){return 256*(l=Zt(Math.floor(l),0,255))+Zt(Math.floor(s),0,255)}R.MAX_VERTEX_ARRAY_LENGTH=Math.pow(2,16)-1,ct("SegmentVector",R);const L=Dr([{name:"a_pattern_from",components:4,type:"Uint16"},{name:"a_pattern_to",components:4,type:"Uint16"},{name:"a_pixel_ratio_from",components:1,type:"Uint16"},{name:"a_pixel_ratio_to",components:1,type:"Uint16"}]);var j={},Q={get exports(){return j},set exports(l){j=l}},ee={};({get exports(){return ee},set exports(l){ee=l}}).exports=function(l,s){var u,f,_,x,C,M,A,F;for(f=l.length-(u=3&l.length),_=s,C=3432918353,M=461845907,F=0;F>>16)*C&65535)<<16)&4294967295)<<15|A>>>17))*M+(((A>>>16)*M&65535)<<16)&4294967295)<<13|_>>>19))+((5*(_>>>16)&65535)<<16)&4294967295))+((58964+(x>>>16)&65535)<<16);switch(A=0,u){case 3:A^=(255&l.charCodeAt(F+2))<<16;case 2:A^=(255&l.charCodeAt(F+1))<<8;case 1:_^=A=(65535&(A=(A=(65535&(A^=255&l.charCodeAt(F)))*C+(((A>>>16)*C&65535)<<16)&4294967295)<<15|A>>>17))*M+(((A>>>16)*M&65535)<<16)&4294967295}return _^=l.length,_=2246822507*(65535&(_^=_>>>16))+((2246822507*(_>>>16)&65535)<<16)&4294967295,_=3266489909*(65535&(_^=_>>>13))+((3266489909*(_>>>16)&65535)<<16)&4294967295,(_^=_>>>16)>>>0};var Y={};({get exports(){return Y},set exports(l){Y=l}}).exports=function(l,s){for(var u,f=l.length,_=s^f,x=0;f>=4;)u=1540483477*(65535&(u=255&l.charCodeAt(x)|(255&l.charCodeAt(++x))<<8|(255&l.charCodeAt(++x))<<16|(255&l.charCodeAt(++x))<<24))+((1540483477*(u>>>16)&65535)<<16),_=1540483477*(65535&_)+((1540483477*(_>>>16)&65535)<<16)^(u=1540483477*(65535&(u^=u>>>24))+((1540483477*(u>>>16)&65535)<<16)),f-=4,++x;switch(f){case 3:_^=(255&l.charCodeAt(x+2))<<16;case 2:_^=(255&l.charCodeAt(x+1))<<8;case 1:_=1540483477*(65535&(_^=255&l.charCodeAt(x)))+((1540483477*(_>>>16)&65535)<<16)}return _=1540483477*(65535&(_^=_>>>13))+((1540483477*(_>>>16)&65535)<<16),(_^=_>>>15)>>>0};var ae=ee,_e=Y;Q.exports=ae,j.murmur3=ae,j.murmur2=_e;class ye{constructor(){this.ids=[],this.positions=[],this.indexed=!1}add(s,u,f,_){this.ids.push(ie(s)),this.positions.push(u,f,_)}getPositions(s){if(!this.indexed)throw new Error("Trying to get index, but feature positions are not indexed");const u=ie(s);let f=0,_=this.ids.length-1;for(;f<_;){const C=f+_>>1;this.ids[C]>=u?_=C:f=C+1}const x=[];for(;this.ids[f]===u;)x.push({index:this.positions[3*f],start:this.positions[3*f+1],end:this.positions[3*f+2]}),f++;return x}static serialize(s,u){const f=new Float64Array(s.ids),_=new Uint32Array(s.positions);return we(f,_,0,f.length-1),u&&u.push(f.buffer,_.buffer),{ids:f,positions:_}}static deserialize(s){const u=new ye;return u.ids=s.ids,u.positions=s.positions,u.indexed=!0,u}}function ie(l){const s=+l;return!isNaN(s)&&s<=Number.MAX_SAFE_INTEGER?s:j(String(l))}function we(l,s,u,f){for(;u>1];let x=u-1,C=f+1;for(;;){do{x++}while(l[x]<_);do{C--}while(l[C]>_);if(x>=C)break;De(l,x,C),De(s,3*x,3*C),De(s,3*x+1,3*C+1),De(s,3*x+2,3*C+2)}C-u`u_${_}`),this.type=f}setUniform(s,u,f){s.set(f.constantOr(this.value))}getBinding(s,u,f){return"color"===this.type?new Le(s,u):new ke(s,u)}}class Pt{constructor(s,u){this.uniformNames=u.map(f=>`u_${f}`),this.patternFrom=null,this.patternTo=null,this.pixelRatioFrom=1,this.pixelRatioTo=1}setConstantPatternPositions(s,u){this.pixelRatioFrom=u.pixelRatio,this.pixelRatioTo=s.pixelRatio,this.patternFrom=u.tlbr,this.patternTo=s.tlbr}setUniform(s,u,f,_){const x="u_pattern_to"===_?this.patternTo:"u_pattern_from"===_?this.patternFrom:"u_pixel_ratio_to"===_?this.pixelRatioTo:"u_pixel_ratio_from"===_?this.pixelRatioFrom:null;x&&s.set(x)}getBinding(s,u,f){return"u_pattern"===f.substr(0,9)?new Be(s,u):new ke(s,u)}}class zt{constructor(s,u,f,_){this.expression=s,this.type=f,this.maxValue=0,this.paintVertexAttributes=u.map(x=>({name:`a_${x}`,type:"Float32",components:"color"===f?2:1,offset:0})),this.paintVertexArray=new _}populatePaintArray(s,u,f,_,x){const C=this.paintVertexArray.length,M=this.expression.evaluate(new cr(0),u,{},_,[],x);this.paintVertexArray.resize(s),this._setPaintValue(C,s,M)}updatePaintArray(s,u,f,_){const x=this.expression.evaluate({zoom:0},f,_);this._setPaintValue(s,u,x)}_setPaintValue(s,u,f){if("color"===this.type){const _=ze(f);for(let x=s;x`u_${M}_t`),this.type=f,this.useIntegerZoom=_,this.zoom=x,this.maxValue=0,this.paintVertexAttributes=u.map(M=>({name:`a_${M}`,type:"Float32",components:"color"===f?4:2,offset:0})),this.paintVertexArray=new C}populatePaintArray(s,u,f,_,x){const C=this.expression.evaluate(new cr(this.zoom),u,{},_,[],x),M=this.expression.evaluate(new cr(this.zoom+1),u,{},_,[],x),A=this.paintVertexArray.length;this.paintVertexArray.resize(s),this._setPaintValue(A,s,C,M)}updatePaintArray(s,u,f,_){const x=this.expression.evaluate({zoom:this.zoom},f,_),C=this.expression.evaluate({zoom:this.zoom+1},f,_);this._setPaintValue(s,u,x,C)}_setPaintValue(s,u,f,_){if("color"===this.type){const x=ze(f),C=ze(_);for(let M=s;M`#define HAS_UNIFORM_${_}`))}return s}getBinderAttributes(){const s=[];for(const u in this.binders){const f=this.binders[u];if(f instanceof zt||f instanceof mt)for(let _=0;_!0)){this.programConfigurations={};for(const _ of s)this.programConfigurations[_.id]=new An(_,u,f);this.needsUpload=!1,this._featureMap=new ye,this._bufferOffset=0}populatePaintArrays(s,u,f,_,x,C){for(const M in this.programConfigurations)this.programConfigurations[M].populatePaintArrays(s,u,_,x,C);void 0!==u.id&&this._featureMap.add(u.id,f,this._bufferOffset,s),this._bufferOffset=s,this.needsUpload=!0}updatePaintArrays(s,u,f,_){for(const x of f)this.needsUpload=this.programConfigurations[x.id].updatePaintArrays(s,this._featureMap,u,x,_)||this.needsUpload}get(s){return this.programConfigurations[s]}upload(s){if(this.needsUpload){for(const u in this.programConfigurations)this.programConfigurations[u].upload(s);this.needsUpload=!1}}destroy(){for(const s in this.programConfigurations)this.programConfigurations[s].destroy()}}function on(l,s){return{"text-opacity":["opacity"],"icon-opacity":["opacity"],"text-color":["fill_color"],"icon-color":["fill_color"],"text-halo-color":["halo_color"],"icon-halo-color":["halo_color"],"text-halo-blur":["halo_blur"],"icon-halo-blur":["halo_blur"],"text-halo-width":["halo_width"],"icon-halo-width":["halo_width"],"line-gap-width":["gapwidth"],"line-pattern":["pattern_to","pattern_from","pixel_ratio_to","pixel_ratio_from"],"fill-pattern":["pattern_to","pattern_from","pixel_ratio_to","pixel_ratio_from"],"fill-extrusion-pattern":["pattern_to","pattern_from","pixel_ratio_to","pixel_ratio_from"]}[l]||[l.replace(`${s}-`,"").replace(/-/g,"_")]}function Fn(l,s,u){const _={"line-pattern":{source:ga,composite:ga},"fill-pattern":{source:ga,composite:ga},"fill-extrusion-pattern":{source:ga,composite:ga}}[l];return _&&_[u]||{color:{source:Qu,composite:vd},number:{source:Xl,composite:Qu}}[s][u]}ct("ConstantBinder",ht),ct("CrossFadedConstantBinder",Pt),ct("SourceExpressionBinder",zt),ct("CrossFadedCompositeBinder",Tn),ct("CompositeExpressionBinder",mt),ct("ProgramConfiguration",An,{omit:["_buffers"]}),ct("ProgramConfigurationSet",Ht);var _n=8192;const mo=Math.pow(2,14)-1,Ro=-mo-1;function vr(l){const s=_n/l.extent,u=l.loadGeometry();for(let f=0;fC.x+1||AC.y+1)&&pn("Geometry exceeds allowed extent, reduce your vector tile buffer size")}}return u}function li(l,s){return{type:l.type,id:l.id,properties:l.properties,geometry:s?vr(l):[]}}function Ii(l,s,u,f,_){l.emplaceBack(2*s+(f+1)/2,2*u+(_+1)/2)}class Jo{constructor(s){this.zoom=s.zoom,this.overscaling=s.overscaling,this.layers=s.layers,this.layerIds=this.layers.map(u=>u.id),this.index=s.index,this.hasPattern=!1,this.layoutVertexArray=new qs,this.indexArray=new w,this.segments=new R,this.programConfigurations=new Ht(s.layers,s.zoom),this.stateDependentLayerIds=this.layers.filter(u=>u.isStateDependent()).map(u=>u.id)}populate(s,u,f){const _=this.layers[0],x=[];let C=null,M=!1;"circle"===_.type&&(C=_.layout.get("circle-sort-key"),M=!C.isConstant());for(const{feature:A,id:F,index:O,sourceLayerIndex:B}of s){const H=this.layers[0]._featureFilter.needGeometry,q=li(A,H);if(!this.layers[0]._featureFilter.filter(new cr(this.zoom),q,f))continue;const W=M?C.evaluate(q,{},f):void 0,se={id:F,properties:A.properties,type:A.type,sourceLayerIndex:B,index:O,geometry:H?q.geometry:vr(A),patterns:{},sortKey:W};x.push(se)}M&&x.sort((A,F)=>A.sortKey-F.sortKey);for(const A of x){const{geometry:F,index:O,sourceLayerIndex:B}=A,H=s[O].feature;this.addFeature(A,F,O,f),u.featureIndex.insert(H,F,O,B,this.index)}}update(s,u,f){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(s,u,this.stateDependentLayers,f)}isEmpty(){return 0===this.layoutVertexArray.length}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(s){this.uploaded||(this.layoutVertexBuffer=s.createVertexBuffer(this.layoutVertexArray,k),this.indexBuffer=s.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(s),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())}addFeature(s,u,f,_){for(const x of u)for(const C of x){const M=C.x,A=C.y;if(M<0||M>=_n||A<0||A>=_n)continue;const F=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray,s.sortKey),O=F.vertexLength;Ii(this.layoutVertexArray,M,A,-1,-1),Ii(this.layoutVertexArray,M,A,1,-1),Ii(this.layoutVertexArray,M,A,1,1),Ii(this.layoutVertexArray,M,A,-1,1),this.indexArray.emplaceBack(O,O+1,O+2),this.indexArray.emplaceBack(O,O+3,O+2),F.vertexLength+=4,F.primitiveLength+=2}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,s,f,{},_)}}function Fo(l,s){for(let u=0;u1){if(On(l,s))return!0;for(let f=0;f1?u:u.sub(s)._mult(_)._add(s))}function Qo(l,s){let u,f,_,x=!1;for(let C=0;Cs.y!=_.y>s.y&&s.x<(_.x-f.x)*(s.y-f.y)/(_.y-f.y)+f.x&&(x=!x)}return x}function qi(l,s){let u=!1;for(let f=0,_=l.length-1;fs.y!=C.y>s.y&&s.x<(C.x-x.x)*(s.y-x.y)/(C.y-x.y)+x.x&&(u=!u)}return u}function sh(l,s,u){const f=u[0],_=u[2];if(l.x_.x&&s.x>_.x||l.y_.y&&s.y>_.y)return!1;const x=ii(l,s,u[0]);return x!==ii(l,s,u[1])||x!==ii(l,s,u[2])||x!==ii(l,s,u[3])}function ya(l,s,u){const f=s.paint.get(l).value;return"constant"===f.kind?f.value:u.programConfigurations.get(s.id).getMaxValue(l)}function Zs(l){return Math.sqrt(l[0]*l[0]+l[1]*l[1])}function ah(l,s,u,f,_){if(!s[0]&&!s[1])return l;const x=Tt.convert(s)._mult(_);"viewport"===u&&x._rotate(-f);const C=[];for(let M=0;Ml.width||_.height>l.height||u.x>l.width-_.width||u.y>l.height-_.height)throw new RangeError("out of range source coordinates for image copy");if(_.width>s.width||_.height>s.height||f.x>s.width-_.width||f.y>s.height-_.height)throw new RangeError("out of range destination coordinates for image copy");const C=l.data,M=s.data;if(C===M)throw new Error("srcData equals dstData, so image is already copied");for(let A=0;A<_.height;A++){const F=((u.y+A)*l.width+u.x)*x,O=((f.y+A)*s.width+f.x)*x;for(let B=0;B<_.width*x;B++)M[O+B]=C[F+B]}return s}class uh{constructor(s,u){ch(this,s,1,u)}resize(s){Dd(this,s,1)}clone(){return new uh({width:this.width,height:this.height},new Uint8Array(this.data))}static copy(s,u,f,_,x){Wm(s,u,f,_,x,1)}}class Oo{constructor(s,u){ch(this,s,4,u)}resize(s){Dd(this,s,4)}replace(s,u){u?this.data.set(s):this.data=s instanceof Uint8ClampedArray?new Uint8Array(s.buffer):s}clone(){return new Oo({width:this.width,height:this.height},new Uint8Array(this.data))}static copy(s,u,f,_,x){Wm(s,u,f,_,x,4)}}function Xm(l){const s={},u=l.resolution||256,f=l.clips?l.clips.length:1,_=l.image||new Oo({width:u,height:f});if(Math.log(u)/Math.LN2%1!=0)throw new Error(`width is not a power of 2 - ${u}`);const x=(C,M,A)=>{s[l.evaluationKey]=A;const F=l.expression.evaluate(s);_.data[C+M+0]=Math.floor(255*F.r/F.a),_.data[C+M+1]=Math.floor(255*F.g/F.a),_.data[C+M+2]=Math.floor(255*F.b/F.a),_.data[C+M+3]=Math.floor(255*F.a)};if(l.clips)for(let C=0,M=0;C80*u){f=x=l[0],_=C=l[1];for(var W=u;Wx&&(x=M),A>C&&(C=A);F=0!==(F=Math.max(x-f,C-_))?32767/F:0}return va(H,q,u,f,_,F,0),q}function Ym(l,s,u,f,_){var x,C;if(_===L_(l,s,u,f)>0)for(x=s;x=s;x-=f)C=Kx(x,l[x],l[x+1],C);return C&&Qm(C,C.next)&&(Kf(C),C=C.next),C}function Kl(l,s){if(!l)return l;s||(s=l);var u,f=l;do{if(u=!1,f.steiner||!Qm(f,f.next)&&0!==nr(f.prev,f,f.next))f=f.next;else{if(Kf(f),(f=s=f.prev)===f.next)break;u=!0}}while(u||f!==s);return s}function va(l,s,u,f,_,x,C){if(l){!C&&x&&function(O,B,H,q){var W=O;do{0===W.z&&(W.z=Jl(W.x,W.y,B,H,q)),W.prevZ=W.prev,W.nextZ=W.next,W=W.next}while(W!==O);W.prevZ.nextZ=null,W.prevZ=null,function(se){var oe,be,Ce,me,Ee,$e,Ve,gt,Ct=1;do{for(be=se,se=null,Ee=null,$e=0;be;){for($e++,Ce=be,Ve=0,oe=0;oe0||gt>0&&Ce;)0!==Ve&&(0===gt||!Ce||be.z<=Ce.z)?(me=be,be=be.nextZ,Ve--):(me=Ce,Ce=Ce.nextZ,gt--),Ee?Ee.nextZ=me:se=me,me.prevZ=Ee,Ee=me;be=Ce}Ee.nextZ=null,Ct*=2}while($e>1)}(W)}(l,f,_,x);for(var M,A,F=l;l.prev!==l.next;)if(M=l.prev,A=l.next,x?Zi(l,f,_,x):Wx(l))s.push(M.i/u|0),s.push(l.i/u|0),s.push(A.i/u|0),Kf(l),l=A.next,F=A.next;else if((l=A)===F){C?1===C?va(l=Km(Kl(l),s,u),s,u,f,_,x,2):2===C&&Xx(l,s,u,f,_,x):va(Kl(l),s,u,f,_,x,1);break}}}function Wx(l){var s=l.prev,u=l,f=l.next;if(nr(s,u,f)>=0)return!1;for(var _=s.x,x=u.x,C=f.x,M=s.y,A=u.y,F=f.y,O=_x?_>C?_:C:x>C?x:C,q=M>A?M>F?M:F:A>F?A:F,W=f.next;W!==s;){if(W.x>=O&&W.x<=H&&W.y>=B&&W.y<=q&&Zc(_,M,x,A,C,F,W.x,W.y)&&nr(W.prev,W,W.next)>=0)return!1;W=W.next}return!0}function Zi(l,s,u,f){var _=l.prev,x=l,C=l.next;if(nr(_,x,C)>=0)return!1;for(var M=_.x,A=x.x,F=C.x,O=_.y,B=x.y,H=C.y,q=MA?M>F?M:F:A>F?A:F,oe=O>B?O>H?O:H:B>H?B:H,be=Jl(q,W,s,u,f),Ce=Jl(se,oe,s,u,f),me=l.prevZ,Ee=l.nextZ;me&&me.z>=be&&Ee&&Ee.z<=Ce;){if(me.x>=q&&me.x<=se&&me.y>=W&&me.y<=oe&&me!==_&&me!==C&&Zc(M,O,A,B,F,H,me.x,me.y)&&nr(me.prev,me,me.next)>=0||(me=me.prevZ,Ee.x>=q&&Ee.x<=se&&Ee.y>=W&&Ee.y<=oe&&Ee!==_&&Ee!==C&&Zc(M,O,A,B,F,H,Ee.x,Ee.y)&&nr(Ee.prev,Ee,Ee.next)>=0))return!1;Ee=Ee.nextZ}for(;me&&me.z>=be;){if(me.x>=q&&me.x<=se&&me.y>=W&&me.y<=oe&&me!==_&&me!==C&&Zc(M,O,A,B,F,H,me.x,me.y)&&nr(me.prev,me,me.next)>=0)return!1;me=me.prevZ}for(;Ee&&Ee.z<=Ce;){if(Ee.x>=q&&Ee.x<=se&&Ee.y>=W&&Ee.y<=oe&&Ee!==_&&Ee!==C&&Zc(M,O,A,B,F,H,Ee.x,Ee.y)&&nr(Ee.prev,Ee,Ee.next)>=0)return!1;Ee=Ee.nextZ}return!0}function Km(l,s,u){var f=l;do{var _=f.prev,x=f.next.next;!Qm(_,x)&&F_(_,f,f.next,x)&&Yf(_,x)&&Yf(x,_)&&(s.push(_.i/u|0),s.push(f.i/u|0),s.push(x.i/u|0),Kf(f),Kf(f.next),f=l=x),f=f.next}while(f!==l);return Kl(f)}function Xx(l,s,u,f,_,x){var C=l;do{for(var M=C.next.next;M!==C.prev;){if(C.i!==M.i&&Jm(C,M)){var A=Yx(C,M);return C=Kl(C,C.next),A=Kl(A,A.next),va(C,s,u,f,_,x,0),void va(A,s,u,f,_,x,0)}M=M.next}C=C.next}while(C!==l)}function R_(l,s){return l.x-s.x}function Sd(l,s){var u=function(_,x){var C,M=x,A=_.x,F=_.y,O=-1/0;do{if(F<=M.y&&F>=M.next.y&&M.next.y!==M.y){var B=M.x+(F-M.y)*(M.next.x-M.x)/(M.next.y-M.y);if(B<=A&&B>O&&(O=B,C=M.x=M.x&&M.x>=W&&A!==M.x&&Zc(FC.x||M.x===C.x&&hh(C,M)))&&(C=M,oe=H)),M=M.next}while(M!==q);return C}(l,s);if(!u)return s;var f=Yx(u,l);return Kl(f,f.next),Kl(u,u.next)}function hh(l,s){return nr(l.prev,l,s.prev)<0&&nr(s.next,l,l.next)<0}function Jl(l,s,u,f,_){return(l=1431655765&((l=858993459&((l=252645135&((l=16711935&((l=(l-u)*_|0)|l<<8))|l<<4))|l<<2))|l<<1))|(s=1431655765&((s=858993459&((s=252645135&((s=16711935&((s=(s-f)*_|0)|s<<8))|s<<4))|s<<2))|s<<1))<<1}function dh(l){var s=l,u=l;do{(s.x=(l-C)*(x-M)&&(l-C)*(f-M)>=(u-C)*(s-M)&&(u-C)*(x-M)>=(_-C)*(f-M)}function Jm(l,s){return l.next.i!==s.i&&l.prev.i!==s.i&&!function(u,f){var _=u;do{if(_.i!==u.i&&_.next.i!==u.i&&_.i!==f.i&&_.next.i!==f.i&&F_(_,_.next,u,f))return!0;_=_.next}while(_!==u);return!1}(l,s)&&(Yf(l,s)&&Yf(s,l)&&function(u,f){var _=u,x=!1,C=(u.x+f.x)/2,M=(u.y+f.y)/2;do{_.y>M!=_.next.y>M&&_.next.y!==_.y&&C<(_.next.x-_.x)*(M-_.y)/(_.next.y-_.y)+_.x&&(x=!x),_=_.next}while(_!==u);return x}(l,s)&&(nr(l.prev,l,s.prev)||nr(l,s.prev,s))||Qm(l,s)&&nr(l.prev,l,l.next)>0&&nr(s.prev,s,s.next)>0)}function nr(l,s,u){return(s.y-l.y)*(u.x-s.x)-(s.x-l.x)*(u.y-s.y)}function Qm(l,s){return l.x===s.x&&l.y===s.y}function F_(l,s,u,f){var _=eg(nr(l,s,u)),x=eg(nr(l,s,f)),C=eg(nr(u,f,l)),M=eg(nr(u,f,s));return _!==x&&C!==M||!(0!==_||!It(l,u,s))||!(0!==x||!It(l,f,s))||!(0!==C||!It(u,l,f))||!(0!==M||!It(u,s,f))}function It(l,s,u){return s.x<=Math.max(l.x,u.x)&&s.x>=Math.min(l.x,u.x)&&s.y<=Math.max(l.y,u.y)&&s.y>=Math.min(l.y,u.y)}function eg(l){return l>0?1:l<0?-1:0}function Yf(l,s){return nr(l.prev,l,l.next)<0?nr(l,s,l.next)>=0&&nr(l,l.prev,s)>=0:nr(l,s,l.prev)<0||nr(l,l.next,s)<0}function Yx(l,s){var u=new O_(l.i,l.x,l.y),f=new O_(s.i,s.x,s.y),_=l.next,x=s.prev;return l.next=s,s.prev=l,u.next=_,_.prev=u,f.next=u,u.prev=f,x.next=f,f.prev=x,f}function Kx(l,s,u,f){var _=new O_(l,s,u);return f?(_.next=f.next,_.prev=f,f.next.prev=_,f.next=_):(_.prev=_,_.next=_),_}function Kf(l){l.next.prev=l.prev,l.prev.next=l.next,l.prevZ&&(l.prevZ.nextZ=l.nextZ),l.nextZ&&(l.nextZ.prevZ=l.prevZ)}function O_(l,s,u){this.i=l,this.x=s,this.y=u,this.prev=null,this.next=null,this.z=0,this.prevZ=null,this.nextZ=null,this.steiner=!1}function L_(l,s,u,f){for(var _=0,x=s,C=u-f;xu;){if(f-u>600){var x=f-u+1,C=s-u+1,M=Math.log(x),A=.5*Math.exp(2*M/3),F=.5*Math.sqrt(M*A*(x-A)/x)*(C-x/2<0?-1:1);Jx(l,s,Math.max(u,Math.floor(s-C*A/x+F)),Math.min(f,Math.floor(s+(x-C)*A/x+F)),_)}var O=l[s],B=u,H=f;for(Jf(l,u,s),_(l[f],O)>0&&Jf(l,u,f);B0;)H--}0===_(l[u],O)?Jf(l,u,H):Jf(l,++H,f),H<=s&&(u=H+1),s<=H&&(f=H-1)}}function Jf(l,s,u){var f=l[s];l[s]=l[u],l[u]=f}function ci(l,s){return ls?1:0}function Id(l,s){const u=l.length;if(u<=1)return[l];const f=[];let _,x;for(let C=0;C1)for(let C=0;C0&&u.holes.push(f+=l[_-1].length)}return u};class go{constructor(s){this.zoom=s.zoom,this.overscaling=s.overscaling,this.layers=s.layers,this.layerIds=this.layers.map(u=>u.id),this.index=s.index,this.hasPattern=!1,this.patternFeatures=[],this.layoutVertexArray=new bs,this.indexArray=new w,this.indexArray2=new S,this.programConfigurations=new Ht(s.layers,s.zoom),this.segments=new R,this.segments2=new R,this.stateDependentLayerIds=this.layers.filter(u=>u.isStateDependent()).map(u=>u.id)}populate(s,u,f){this.hasPattern=N_("fill",this.layers,u);const _=this.layers[0].layout.get("fill-sort-key"),x=!_.isConstant(),C=[];for(const{feature:M,id:A,index:F,sourceLayerIndex:O}of s){const B=this.layers[0]._featureFilter.needGeometry,H=li(M,B);if(!this.layers[0]._featureFilter.filter(new cr(this.zoom),H,f))continue;const q=x?_.evaluate(H,{},f,u.availableImages):void 0,W={id:A,properties:M.properties,type:M.type,sourceLayerIndex:O,index:F,geometry:B?H.geometry:vr(M),patterns:{},sortKey:q};C.push(W)}x&&C.sort((M,A)=>M.sortKey-A.sortKey);for(const M of C){const{geometry:A,index:F,sourceLayerIndex:O}=M;if(this.hasPattern){const B=tg("fill",this.layers,M,this.zoom,u);this.patternFeatures.push(B)}else this.addFeature(M,A,F,f,{});u.featureIndex.insert(s[F].feature,A,F,O,this.index)}}update(s,u,f){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(s,u,this.stateDependentLayers,f)}addFeatures(s,u,f){for(const _ of this.patternFeatures)this.addFeature(_,_.geometry,_.index,u,f)}isEmpty(){return 0===this.layoutVertexArray.length}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(s){this.uploaded||(this.layoutVertexBuffer=s.createVertexBuffer(this.layoutVertexArray,Wf),this.indexBuffer=s.createIndexBuffer(this.indexArray),this.indexBuffer2=s.createIndexBuffer(this.indexArray2)),this.programConfigurations.upload(s),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.indexBuffer2.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.segments2.destroy())}addFeature(s,u,f,_,x){for(const C of Id(u,500)){let M=0;for(const q of C)M+=q.length;const A=this.segments.prepareSegment(M,this.layoutVertexArray,this.indexArray),F=A.vertexLength,O=[],B=[];for(const q of C){if(0===q.length)continue;q!==C[0]&&B.push(O.length/2);const W=this.segments2.prepareSegment(q.length,this.layoutVertexArray,this.indexArray2),se=W.vertexLength;this.layoutVertexArray.emplaceBack(q[0].x,q[0].y),this.indexArray2.emplaceBack(se+q.length-1,se),O.push(q[0].x),O.push(q[0].y);for(let oe=1;oe>3}if(_--,1===f||2===f)x+=l.readSVarint(),C+=l.readSVarint(),1===f&&(s&&M.push(s),s=[]),s.push(new Qx(x,C));else{if(7!==f)throw new Error("unknown command "+f);s&&s.push(s[0].clone())}}return s&&M.push(s),M},kd.prototype.bbox=function(){var l=this._pbf;l.pos=this._geometry;for(var s=l.readVarint()+l.pos,u=1,f=0,_=0,x=0,C=1/0,M=-1/0,A=1/0,F=-1/0;l.pos>3}if(f--,1===u||2===u)(_+=l.readSVarint())M&&(M=_),(x+=l.readSVarint())F&&(F=x);else if(7!==u)throw new Error("unknown command "+u)}return[C,A,M,F]},kd.prototype.toGeoJSON=function(l,s,u){var f,_,x=this.extent*Math.pow(2,u),C=this.extent*l,M=this.extent*s,A=this.loadGeometry(),F=kd.types[this.type];function O(q){for(var W=0;W>3;_=1===C?f.readString():2===C?f.readFloat():3===C?f.readDouble():4===C?f.readVarint64():5===C?f.readVarint():6===C?f.readSVarint():7===C?f.readBoolean():null}return _}(u))}t1.prototype.feature=function(l){if(l<0||l>=this._features.length)throw new Error("feature index out of bounds");this._pbf.pos=this._features[l];var s=this._pbf.readVarint()+this._pbf.pos;return new ng(this._pbf,s,this.extent,this._keys,this._values)};var n1=Wc;function r1(l,s,u){if(3===l){var f=new n1(u,u.readVarint()+u.pos);f.length&&(s[f.name]=f)}}Ql.VectorTile=function(l,s){this.layers=l.readFields(r1,{},s)},Ql.VectorTileFeature=e1,Ql.VectorTileLayer=Wc;const i1=Ql.VectorTileFeature.types,rg=Math.pow(2,13);function Pd(l,s,u,f,_,x,C,M){l.emplaceBack(s,u,2*Math.floor(f*rg)+C,_*rg*2,x*rg*2,Math.round(M))}class ig{constructor(s){this.zoom=s.zoom,this.overscaling=s.overscaling,this.layers=s.layers,this.layerIds=this.layers.map(u=>u.id),this.index=s.index,this.hasPattern=!1,this.layoutVertexArray=new wd,this.centroidVertexArray=new ih,this.indexArray=new w,this.programConfigurations=new Ht(s.layers,s.zoom),this.segments=new R,this.stateDependentLayerIds=this.layers.filter(u=>u.isStateDependent()).map(u=>u.id)}populate(s,u,f){this.features=[],this.hasPattern=N_("fill-extrusion",this.layers,u);for(const{feature:_,id:x,index:C,sourceLayerIndex:M}of s){const A=this.layers[0]._featureFilter.needGeometry,F=li(_,A);if(!this.layers[0]._featureFilter.filter(new cr(this.zoom),F,f))continue;const O={id:x,sourceLayerIndex:M,index:C,geometry:A?F.geometry:vr(_),properties:_.properties,type:_.type,patterns:{}};this.hasPattern?this.features.push(tg("fill-extrusion",this.layers,O,this.zoom,u)):this.addFeature(O,O.geometry,C,f,{}),u.featureIndex.insert(_,O.geometry,C,M,this.index,!0)}}addFeatures(s,u,f){for(const _ of this.features){const{geometry:x}=_;this.addFeature(_,x,_.index,u,f)}}update(s,u,f){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(s,u,this.stateDependentLayers,f)}isEmpty(){return 0===this.layoutVertexArray.length&&0===this.centroidVertexArray.length}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(s){this.uploaded||(this.layoutVertexBuffer=s.createVertexBuffer(this.layoutVertexArray,B_),this.centroidVertexBuffer=s.createVertexBuffer(this.centroidVertexArray,Ad.members,!0),this.indexBuffer=s.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(s),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.centroidVertexBuffer.destroy())}addFeature(s,u,f,_,x){const C={x:0,y:0,vertexCount:0};for(const M of Id(u,500)){let A=0;for(const W of M)A+=W.length;let F=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray);for(const W of M){if(0===W.length||((l=W).every(s=>s.x<0)||l.every(s=>s.x>_n)||l.every(s=>s.y<0)||l.every(s=>s.y>_n)))continue;let se=0;for(let oe=0;oe=1){const Ce=W[oe-1];if(!og(be,Ce)){F.vertexLength+4>R.MAX_VERTEX_ARRAY_LENGTH&&(F=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray));const me=be.sub(Ce)._perp()._unit(),Ee=Ce.dist(be);se+Ee>32768&&(se=0),Pd(this.layoutVertexArray,be.x,be.y,me.x,me.y,0,0,se),Pd(this.layoutVertexArray,be.x,be.y,me.x,me.y,0,1,se),C.x+=2*be.x,C.y+=2*be.y,C.vertexCount+=2,se+=Ee,Pd(this.layoutVertexArray,Ce.x,Ce.y,me.x,me.y,0,0,se),Pd(this.layoutVertexArray,Ce.x,Ce.y,me.x,me.y,0,1,se),C.x+=2*Ce.x,C.y+=2*Ce.y,C.vertexCount+=2;const $e=F.vertexLength;this.indexArray.emplaceBack($e,$e+2,$e+1),this.indexArray.emplaceBack($e+1,$e+2,$e+3),F.vertexLength+=4,F.primitiveLength+=2}}}}if(F.vertexLength+A>R.MAX_VERTEX_ARRAY_LENGTH&&(F=this.segments.prepareSegment(A,this.layoutVertexArray,this.indexArray)),"Polygon"!==i1[s.type])continue;const O=[],B=[],H=F.vertexLength;for(const W of M)if(0!==W.length){W!==M[0]&&B.push(O.length/2);for(let se=0;se_n)||l.y===s.y&&(l.y<0||l.y>_n)}ct("FillExtrusionBucket",ig,{omit:["layers","features"]});var A2={paint:new Di({"fill-extrusion-opacity":new wt(Ae["paint_fill-extrusion"]["fill-extrusion-opacity"]),"fill-extrusion-color":new yt(Ae["paint_fill-extrusion"]["fill-extrusion-color"]),"fill-extrusion-translate":new wt(Ae["paint_fill-extrusion"]["fill-extrusion-translate"]),"fill-extrusion-translate-anchor":new wt(Ae["paint_fill-extrusion"]["fill-extrusion-translate-anchor"]),"fill-extrusion-pattern":new el(Ae["paint_fill-extrusion"]["fill-extrusion-pattern"]),"fill-extrusion-height":new yt(Ae["paint_fill-extrusion"]["fill-extrusion-height"]),"fill-extrusion-base":new yt(Ae["paint_fill-extrusion"]["fill-extrusion-base"]),"fill-extrusion-vertical-gradient":new wt(Ae["paint_fill-extrusion"]["fill-extrusion-vertical-gradient"])})};function ol(l,s){return l.x*s.x+l.y*s.y}function tp(l,s){if(1===l.length){let u=0;const f=s[u++];let _;for(;!_||f.equals(_);)if(_=s[u++],!_)return 1/0;for(;uu.id),this.index=s.index,this.hasPattern=!1,this.patternFeatures=[],this.lineClipsArray=[],this.gradients={},this.layers.forEach(u=>{this.gradients[u.id]={}}),this.layoutVertexArray=new oh,this.layoutVertexArray2=new k_,this.indexArray=new w,this.programConfigurations=new Ht(s.layers,s.zoom),this.segments=new R,this.maxLineLength=0,this.stateDependentLayerIds=this.layers.filter(u=>u.isStateDependent()).map(u=>u.id)}populate(s,u,f){this.hasPattern=N_("line",this.layers,u);const _=this.layers[0].layout.get("line-sort-key"),x=!_.isConstant(),C=[];for(const{feature:M,id:A,index:F,sourceLayerIndex:O}of s){const B=this.layers[0]._featureFilter.needGeometry,H=li(M,B);if(!this.layers[0]._featureFilter.filter(new cr(this.zoom),H,f))continue;const q=x?_.evaluate(H,{},f):void 0,W={id:A,properties:M.properties,type:M.type,sourceLayerIndex:O,index:F,geometry:B?H.geometry:vr(M),patterns:{},sortKey:q};C.push(W)}x&&C.sort((M,A)=>M.sortKey-A.sortKey);for(const M of C){const{geometry:A,index:F,sourceLayerIndex:O}=M;if(this.hasPattern){const B=tg("line",this.layers,M,this.zoom,u);this.patternFeatures.push(B)}else this.addFeature(M,A,F,f,{});u.featureIndex.insert(s[F].feature,A,F,O,this.index)}}update(s,u,f){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(s,u,this.stateDependentLayers,f)}addFeatures(s,u,f){for(const _ of this.patternFeatures)this.addFeature(_,_.geometry,_.index,u,f)}isEmpty(){return 0===this.layoutVertexArray.length}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(s){this.uploaded||(0!==this.layoutVertexArray2.length&&(this.layoutVertexBuffer2=s.createVertexBuffer(this.layoutVertexArray2,a1)),this.layoutVertexBuffer=s.createVertexBuffer(this.layoutVertexArray,o1),this.indexBuffer=s.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(s),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())}lineFeatureClips(s){if(s.properties&&Object.prototype.hasOwnProperty.call(s.properties,"mapbox_clip_start")&&Object.prototype.hasOwnProperty.call(s.properties,"mapbox_clip_end"))return{start:+s.properties.mapbox_clip_start,end:+s.properties.mapbox_clip_end}}addFeature(s,u,f,_,x){const C=this.layers[0].layout,M=C.get("line-join").evaluate(s,{}),A=C.get("line-cap"),F=C.get("line-miter-limit"),O=C.get("line-round-limit");this.lineClips=this.lineFeatureClips(s);for(const B of u)this.addLine(B,s,M,A,F,O);this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,s,f,x,_)}addLine(s,u,f,_,x,C){if(this.distance=0,this.scaledDistance=0,this.totalDistance=0,this.lineClips){this.lineClipsArray.push(this.lineClips);for(let be=0;be=2&&s[A-1].equals(s[A-2]);)A--;let F=0;for(;F0;if(gt&&be>F){const Qe=H.dist(q);if(Qe>2*O){const ot=H.sub(H.sub(q)._mult(O/Qe)._round());this.updateDistance(q,ot),this.addCurrentVertex(ot,se,0,0,B),q=ot}}const at=q&&W;let tt=at?f:M?"butt":_;if(at&&"round"===tt&&($ex&&(tt="bevel"),"bevel"===tt&&($e>2&&(tt="flipbevel"),$e100)Ce=oe.mult(-1);else{const Qe=$e*se.add(oe).mag()/se.sub(oe).mag();Ce._perp()._mult(Qe*(Ct?-1:1))}this.addCurrentVertex(H,Ce,0,0,B),this.addCurrentVertex(H,Ce.mult(-1),0,0,B)}else if("bevel"===tt||"fakeround"===tt){const Qe=-Math.sqrt($e*$e-1),ot=Ct?Qe:0,it=Ct?0:Qe;if(q&&this.addCurrentVertex(H,se,ot,it,B),"fakeround"===tt){const Ge=Math.round(180*Ve/Math.PI/20);for(let Et=1;Et2*O){const ot=H.add(W.sub(H)._mult(O/Qe)._round());this.updateDistance(H,ot),this.addCurrentVertex(ot,oe,0,0,B),H=ot}}}}addCurrentVertex(s,u,f,_,x,C=!1){const M=u.y*_-u.x,A=-u.y-u.x*_;this.addHalfVertex(s,u.x+u.y*f,u.y-u.x*f,C,!1,f,x),this.addHalfVertex(s,M,A,C,!0,-_,x),this.distance>Xc/2&&0===this.totalDistance&&(this.distance=0,this.addCurrentVertex(s,u,f,_,x,C))}addHalfVertex({x:s,y:u},f,_,x,C,M,A){const F=.5*(this.lineClips?this.scaledDistance*(Xc-1):this.scaledDistance);this.layoutVertexArray.emplaceBack((s<<1)+(x?1:0),(u<<1)+(C?1:0),Math.round(63*f)+128,Math.round(63*_)+128,1+(0===M?0:M<0?-1:1)|(63&F)<<2,F>>6),this.lineClips&&this.layoutVertexArray2.emplaceBack((this.scaledDistance-this.lineClips.start)/(this.lineClips.end-this.lineClips.start),this.lineClipsArray.length);const O=A.vertexLength++;this.e1>=0&&this.e2>=0&&(this.indexArray.emplaceBack(this.e1,this.e2,O),A.primitiveLength++),C?this.e2=O:this.e1=O}updateScaledDistance(){this.scaledDistance=this.lineClips?this.lineClips.start+(this.lineClips.end-this.lineClips.start)*this.distance/this.totalDistance:this.distance}updateDistance(s,u){this.distance+=s.dist(u),this.updateScaledDistance()}}ct("LineBucket",sg,{omit:["layers","patternFeatures"]});const St=new Di({"line-cap":new wt(Ae.layout_line["line-cap"]),"line-join":new yt(Ae.layout_line["line-join"]),"line-miter-limit":new wt(Ae.layout_line["line-miter-limit"]),"line-round-limit":new wt(Ae.layout_line["line-round-limit"]),"line-sort-key":new yt(Ae.layout_line["line-sort-key"])});var ag={paint:new Di({"line-opacity":new yt(Ae.paint_line["line-opacity"]),"line-color":new yt(Ae.paint_line["line-color"]),"line-translate":new wt(Ae.paint_line["line-translate"]),"line-translate-anchor":new wt(Ae.paint_line["line-translate-anchor"]),"line-width":new yt(Ae.paint_line["line-width"]),"line-gap-width":new yt(Ae.paint_line["line-gap-width"]),"line-offset":new yt(Ae.paint_line["line-offset"]),"line-blur":new yt(Ae.paint_line["line-blur"]),"line-dasharray":new pd(Ae.paint_line["line-dasharray"]),"line-pattern":new el(Ae.paint_line["line-pattern"]),"line-gradient":new md(Ae.paint_line["line-gradient"])}),layout:St};const Fr=new class extends yt{possiblyEvaluate(l,s){return s=new cr(Math.floor(s.zoom),{now:s.now,fadeDuration:s.fadeDuration,zoomHistory:s.zoomHistory,transition:s.transition}),super.possiblyEvaluate(l,s)}evaluate(l,s,u,f){return s=Ni({},s,{zoom:Math.floor(s.zoom)}),super.evaluate(l,s,u,f)}}(ag.paint.properties["line-width"].specification);function rp(l,s){return s>0?s+2*l:l}Fr.useIntegerZoom=!0;const Fd=Dr([{name:"a_pos_offset",components:4,type:"Int16"},{name:"a_data",components:4,type:"Uint16"},{name:"a_pixeloffset",components:4,type:"Int16"}],4),l1=Dr([{name:"a_projected_pos",components:3,type:"Float32"}],4);Dr([{name:"a_fade_opacity",components:1,type:"Uint32"}],4);const c1=Dr([{name:"a_placed",components:2,type:"Uint8"},{name:"a_shift",components:2,type:"Float32"}]);Dr([{type:"Int16",name:"anchorPointX"},{type:"Int16",name:"anchorPointY"},{type:"Int16",name:"x1"},{type:"Int16",name:"y1"},{type:"Int16",name:"x2"},{type:"Int16",name:"y2"},{type:"Uint32",name:"featureIndex"},{type:"Uint16",name:"sourceLayerIndex"},{type:"Uint16",name:"bucketIndex"}]);const j_=Dr([{name:"a_pos",components:2,type:"Int16"},{name:"a_anchor_pos",components:2,type:"Int16"},{name:"a_extrude",components:2,type:"Int16"}],4),lg=Dr([{name:"a_pos",components:2,type:"Float32"},{name:"a_radius",components:1,type:"Float32"},{name:"a_flags",components:2,type:"Int16"}],4);function Od(l,s,u){return l.sections.forEach(f=>{f.text=function(_,x,C){const M=x.layout.get("text-transform").evaluate(C,{});return"uppercase"===M?_=_.toLocaleUpperCase():"lowercase"===M&&(_=_.toLocaleLowerCase()),po.applyArabicShaping&&(_=po.applyArabicShaping(_)),_}(f.text,s,u)}),l}Dr([{name:"triangle",components:3,type:"Uint16"}]),Dr([{type:"Int16",name:"anchorX"},{type:"Int16",name:"anchorY"},{type:"Uint16",name:"glyphStartIndex"},{type:"Uint16",name:"numGlyphs"},{type:"Uint32",name:"vertexStartIndex"},{type:"Uint32",name:"lineStartIndex"},{type:"Uint32",name:"lineLength"},{type:"Uint16",name:"segment"},{type:"Uint16",name:"lowerSize"},{type:"Uint16",name:"upperSize"},{type:"Float32",name:"lineOffsetX"},{type:"Float32",name:"lineOffsetY"},{type:"Uint8",name:"writingMode"},{type:"Uint8",name:"placedOrientation"},{type:"Uint8",name:"hidden"},{type:"Uint32",name:"crossTileID"},{type:"Int16",name:"associatedIconIndex"}]),Dr([{type:"Int16",name:"anchorX"},{type:"Int16",name:"anchorY"},{type:"Int16",name:"rightJustifiedTextSymbolIndex"},{type:"Int16",name:"centerJustifiedTextSymbolIndex"},{type:"Int16",name:"leftJustifiedTextSymbolIndex"},{type:"Int16",name:"verticalPlacedTextSymbolIndex"},{type:"Int16",name:"placedIconSymbolIndex"},{type:"Int16",name:"verticalPlacedIconSymbolIndex"},{type:"Uint16",name:"key"},{type:"Uint16",name:"textBoxStartIndex"},{type:"Uint16",name:"textBoxEndIndex"},{type:"Uint16",name:"verticalTextBoxStartIndex"},{type:"Uint16",name:"verticalTextBoxEndIndex"},{type:"Uint16",name:"iconBoxStartIndex"},{type:"Uint16",name:"iconBoxEndIndex"},{type:"Uint16",name:"verticalIconBoxStartIndex"},{type:"Uint16",name:"verticalIconBoxEndIndex"},{type:"Uint16",name:"featureIndex"},{type:"Uint16",name:"numHorizontalGlyphVertices"},{type:"Uint16",name:"numVerticalGlyphVertices"},{type:"Uint16",name:"numIconVertices"},{type:"Uint16",name:"numVerticalIconVertices"},{type:"Uint16",name:"useRuntimeCollisionCircles"},{type:"Uint32",name:"crossTileID"},{type:"Float32",name:"textBoxScale"},{type:"Float32",components:2,name:"textOffset"},{type:"Float32",name:"collisionCircleDiameter"}]),Dr([{type:"Float32",name:"offsetX"}]),Dr([{type:"Int16",name:"x"},{type:"Int16",name:"y"},{type:"Int16",name:"tileUnitDistanceFromAnchor"}]);const fh={"!":"\ufe15","#":"\uff03",$:"\uff04","%":"\uff05","&":"\uff06","(":"\ufe35",")":"\ufe36","*":"\uff0a","+":"\uff0b",",":"\ufe10","-":"\ufe32",".":"\u30fb","/":"\uff0f",":":"\ufe13",";":"\ufe14","<":"\ufe3f","=":"\uff1d",">":"\ufe40","?":"\ufe16","@":"\uff20","[":"\ufe47","\\":"\uff3c","]":"\ufe48","^":"\uff3e",_:"\ufe33","`":"\uff40","{":"\ufe37","|":"\u2015","}":"\ufe38","~":"\uff5e","\xa2":"\uffe0","\xa3":"\uffe1","\xa5":"\uffe5","\xa6":"\uffe4","\xac":"\uffe2","\xaf":"\uffe3","\u2013":"\ufe32","\u2014":"\ufe31","\u2018":"\ufe43","\u2019":"\ufe44","\u201c":"\ufe41","\u201d":"\ufe42","\u2026":"\ufe19","\u2027":"\u30fb","\u20a9":"\uffe6","\u3001":"\ufe11","\u3002":"\ufe12","\u3008":"\ufe3f","\u3009":"\ufe40","\u300a":"\ufe3d","\u300b":"\ufe3e","\u300c":"\ufe41","\u300d":"\ufe42","\u300e":"\ufe43","\u300f":"\ufe44","\u3010":"\ufe3b","\u3011":"\ufe3c","\u3014":"\ufe39","\u3015":"\ufe3a","\u3016":"\ufe17","\u3017":"\ufe18","\uff01":"\ufe15","\uff08":"\ufe35","\uff09":"\ufe36","\uff0c":"\ufe10","\uff0d":"\ufe32","\uff0e":"\u30fb","\uff1a":"\ufe13","\uff1b":"\ufe14","\uff1c":"\ufe3f","\uff1e":"\ufe40","\uff1f":"\ufe16","\uff3b":"\ufe47","\uff3d":"\ufe48","\uff3f":"\ufe33","\uff5b":"\ufe37","\uff5c":"\u2015","\uff5d":"\ufe38","\uff5f":"\ufe35","\uff60":"\ufe36","\uff61":"\ufe12","\uff62":"\ufe41","\uff63":"\ufe42"};var cg=Ln,ug=function(l,s,u,f,_){var x,C,M=8*_-f-1,A=(1<>1,O=-7,B=u?_-1:0,H=u?-1:1,q=l[s+B];for(B+=H,x=q&(1<<-O)-1,q>>=-O,O+=M;O>0;x=256*x+l[s+B],B+=H,O-=8);for(C=x&(1<<-O)-1,x>>=-O,O+=f;O>0;C=256*C+l[s+B],B+=H,O-=8);if(0===x)x=1-F;else{if(x===A)return C?NaN:1/0*(q?-1:1);C+=Math.pow(2,f),x-=F}return(q?-1:1)*C*Math.pow(2,x-f)},ph=function(l,s,u,f,_,x){var C,M,A,F=8*x-_-1,O=(1<>1,H=23===_?Math.pow(2,-24)-Math.pow(2,-77):0,q=f?0:x-1,W=f?1:-1,se=s<0||0===s&&1/s<0?1:0;for(s=Math.abs(s),isNaN(s)||s===1/0?(M=isNaN(s)?1:0,C=O):(C=Math.floor(Math.log(s)/Math.LN2),s*(A=Math.pow(2,-C))<1&&(C--,A*=2),(s+=C+B>=1?H/A:H*Math.pow(2,1-B))*A>=2&&(C++,A/=2),C+B>=O?(M=0,C=O):C+B>=1?(M=(s*A-1)*Math.pow(2,_),C+=B):(M=s*Math.pow(2,B-1)*Math.pow(2,_),C=0));_>=8;l[u+q]=255&M,q+=W,M/=256,_-=8);for(C=C<<_|M,F+=_;F>0;l[u+q]=255&C,q+=W,C/=256,F-=8);l[u+q-W]|=128*se};function Ln(l){this.buf=ArrayBuffer.isView&&ArrayBuffer.isView(l)?l:new Uint8Array(l||0),this.pos=0,this.type=0,this.length=this.buf.length}Ln.Varint=0,Ln.Fixed64=1,Ln.Bytes=2,Ln.Fixed32=5;var sl,hg=4294967296,H_=1/hg,Yc=typeof TextDecoder>"u"?null:new TextDecoder("utf8");function ts(l){return l.type===Ln.Bytes?l.readVarint()+l.pos:l.pos+1}function u1(l,s,u){var f=s<=16383?1:s<=2097151?2:s<=268435455?3:Math.floor(Math.log(s)/(7*Math.LN2));u.realloc(f);for(var _=u.pos-1;_>=l;_--)u.buf[_+f]=u.buf[_]}function G_(l,s){for(var u=0;u>>8,l[u+2]=s>>>16,l[u+3]=s>>>24}function dg(l,s){return(l[s]|l[s+1]<<8|l[s+2]<<16)+(l[s+3]<<24)}function P2(l,s,u){1===l&&u.readMessage(g1,s)}function g1(l,s,u){if(3===l){const{id:f,bitmap:_,width:x,height:C,left:M,top:A,advance:F}=u.readMessage(y1,{});s.push({id:f,bitmap:new uh({width:x+6,height:C+6},_),metrics:{width:x,height:C,left:M,top:A,advance:F}})}}function y1(l,s,u){1===l?s.id=u.readVarint():2===l?s.bitmap=u.readBytes():3===l?s.width=u.readVarint():4===l?s.height=u.readVarint():5===l?s.left=u.readSVarint():6===l?s.top=u.readSVarint():7===l&&(s.advance=u.readVarint())}function op(l){let s=0,u=0;for(const C of l)s+=C.w*C.h,u=Math.max(u,C.w);l.sort((C,M)=>M.h-C.h);const f=[{x:0,y:0,w:Math.max(Math.ceil(Math.sqrt(s/.95)),u),h:1/0}];let _=0,x=0;for(const C of l)for(let M=f.length-1;M>=0;M--){const A=f[M];if(!(C.w>A.w||C.h>A.h)){if(C.x=A.x,C.y=A.y,x=Math.max(x,C.y+C.h),_=Math.max(_,C.x+C.w),C.w===A.w&&C.h===A.h){const F=f.pop();M>3,x=this.pos;this.type=7&f,l(_,s,this),this.pos===x&&this.skip(f)}return s},readMessage:function(l,s){return this.readFields(l,s,this.readVarint()+this.pos)},readFixed32:function(){var l=Ld(this.buf,this.pos);return this.pos+=4,l},readSFixed32:function(){var l=dg(this.buf,this.pos);return this.pos+=4,l},readFixed64:function(){var l=Ld(this.buf,this.pos)+Ld(this.buf,this.pos+4)*hg;return this.pos+=8,l},readSFixed64:function(){var l=Ld(this.buf,this.pos)+dg(this.buf,this.pos+4)*hg;return this.pos+=8,l},readFloat:function(){var l=ug(this.buf,this.pos,!0,23,4);return this.pos+=4,l},readDouble:function(){var l=ug(this.buf,this.pos,!0,52,8);return this.pos+=8,l},readVarint:function(l){var s,u,f=this.buf;return s=127&(u=f[this.pos++]),u<128?s:(s|=(127&(u=f[this.pos++]))<<7,u<128?s:(s|=(127&(u=f[this.pos++]))<<14,u<128?s:(s|=(127&(u=f[this.pos++]))<<21,u<128?s:function(_,x,C){var M,A,F=C.buf;if(M=(112&(A=F[C.pos++]))>>4,A<128||(M|=(127&(A=F[C.pos++]))<<3,A<128)||(M|=(127&(A=F[C.pos++]))<<10,A<128)||(M|=(127&(A=F[C.pos++]))<<17,A<128)||(M|=(127&(A=F[C.pos++]))<<24,A<128)||(M|=(1&(A=F[C.pos++]))<<31,A<128))return function mh(l,s,u){return u?4294967296*s+(l>>>0):4294967296*(s>>>0)+(l>>>0)}(_,M,x);throw new Error("Expected varint not more than 10 bytes")}(s|=(15&(u=f[this.pos]))<<28,l,this))))},readVarint64:function(){return this.readVarint(!0)},readSVarint:function(){var l=this.readVarint();return l%2==1?(l+1)/-2:l/2},readBoolean:function(){return Boolean(this.readVarint())},readString:function(){var l=this.readVarint()+this.pos,s=this.pos;return this.pos=l,l-s>=12&&Yc?Yc.decode(this.buf.subarray(s,l)):function(u,f,_){for(var x="",C=f;C<_;){var M,A,F,O=u[C],B=null,H=O>239?4:O>223?3:O>191?2:1;if(C+H>_)break;1===H?O<128&&(B=O):2===H?128==(192&(M=u[C+1]))&&(B=(31&O)<<6|63&M)<=127&&(B=null):3===H?(A=u[C+2],128==(192&(M=u[C+1]))&&128==(192&A)&&((B=(15&O)<<12|(63&M)<<6|63&A)<=2047||B>=55296&&B<=57343)&&(B=null)):4===H&&(A=u[C+2],F=u[C+3],128==(192&(M=u[C+1]))&&128==(192&A)&&128==(192&F)&&((B=(15&O)<<18|(63&M)<<12|(63&A)<<6|63&F)<=65535||B>=1114112)&&(B=null)),null===B?(B=65533,H=1):B>65535&&(B-=65536,x+=String.fromCharCode(B>>>10&1023|55296),B=56320|1023&B),x+=String.fromCharCode(B),C+=H}return x}(this.buf,s,l)},readBytes:function(){var l=this.readVarint()+this.pos,s=this.buf.subarray(this.pos,l);return this.pos=l,s},readPackedVarint:function(l,s){if(this.type!==Ln.Bytes)return l.push(this.readVarint(s));var u=ts(this);for(l=l||[];this.pos127;);else if(s===Ln.Bytes)this.pos=this.readVarint()+this.pos;else if(s===Ln.Fixed32)this.pos+=4;else{if(s!==Ln.Fixed64)throw new Error("Unimplemented type: "+s);this.pos+=8}},writeTag:function(l,s){this.writeVarint(l<<3|s)},realloc:function(l){for(var s=this.length||16;s268435455||l<0?function(s,u){var f,_,x,M;if(s>=0?(f=s%4294967296|0,_=s/4294967296|0):(_=~(-s/4294967296),4294967295^(f=~(-s%4294967296))?f=f+1|0:(f=0,_=_+1|0)),s>=0x10000000000000000||s<-0x10000000000000000)throw new Error("Given varint doesn't fit into 10 bytes");u.realloc(10),x=f,(M=u).buf[M.pos++]=127&x|128,x>>>=7,M.buf[M.pos++]=127&x|128,x>>>=7,M.buf[M.pos++]=127&x|128,x>>>=7,M.buf[M.pos++]=127&x|128,M.buf[M.pos]=127&(x>>>=7),function(x,C){var M=(7&x)<<4;C.buf[C.pos++]|=M|((x>>>=3)?128:0),x&&(C.buf[C.pos++]=127&x|((x>>>=7)?128:0),x&&(C.buf[C.pos++]=127&x|((x>>>=7)?128:0),x&&(C.buf[C.pos++]=127&x|((x>>>=7)?128:0),x&&(C.buf[C.pos++]=127&x|((x>>>=7)?128:0),x&&(C.buf[C.pos++]=127&x)))))}(_,u)}(l,this):(this.realloc(4),this.buf[this.pos++]=127&l|(l>127?128:0),l<=127||(this.buf[this.pos++]=127&(l>>>=7)|(l>127?128:0),l<=127||(this.buf[this.pos++]=127&(l>>>=7)|(l>127?128:0),l<=127||(this.buf[this.pos++]=l>>>7&127))))},writeSVarint:function(l){this.writeVarint(l<0?2*-l-1:2*l)},writeBoolean:function(l){this.writeVarint(Boolean(l))},writeString:function(l){l=String(l),this.realloc(4*l.length),this.pos++;var s=this.pos;this.pos=function(f,_,x){for(var C,M,A=0;A<_.length;A++){if((C=_.charCodeAt(A))>55295&&C<57344){if(!M){C>56319||A+1===_.length?(f[x++]=239,f[x++]=191,f[x++]=189):M=C;continue}if(C<56320){f[x++]=239,f[x++]=191,f[x++]=189,M=C;continue}C=M-55296<<10|C-56320|65536,M=null}else M&&(f[x++]=239,f[x++]=191,f[x++]=189,M=null);C<128?f[x++]=C:(C<2048?f[x++]=C>>6|192:(C<65536?f[x++]=C>>12|224:(f[x++]=C>>18|240,f[x++]=C>>12&63|128),f[x++]=C>>6&63|128),f[x++]=63&C|128)}return x}(this.buf,l,this.pos);var u=this.pos-s;u>=128&&u1(s,u,this),this.pos=s-1,this.writeVarint(u),this.pos+=u},writeFloat:function(l){this.realloc(4),ph(this.buf,l,this.pos,!0,23,4),this.pos+=4},writeDouble:function(l){this.realloc(8),ph(this.buf,l,this.pos,!0,52,8),this.pos+=8},writeBytes:function(l){var s=l.length;this.writeVarint(s),this.realloc(s);for(var u=0;u=128&&u1(u,f,this),this.pos=u-1,this.writeVarint(f),this.pos+=f},writeMessage:function(l,s,u){this.writeTag(l,Ln.Bytes),this.writeRawMessage(s,u)},writePackedVarint:function(l,s){s.length&&this.writeMessage(l,G_,s)},writePackedSVarint:function(l,s){s.length&&this.writeMessage(l,h1,s)},writePackedBoolean:function(l,s){s.length&&this.writeMessage(l,f1,s)},writePackedFloat:function(l,s){s.length&&this.writeMessage(l,k2,s)},writePackedDouble:function(l,s){s.length&&this.writeMessage(l,d1,s)},writePackedFixed32:function(l,s){s.length&&this.writeMessage(l,p1,s)},writePackedSFixed32:function(l,s){s.length&&this.writeMessage(l,ip,s)},writePackedFixed64:function(l,s){s.length&&this.writeMessage(l,q_,s)},writePackedSFixed64:function(l,s){s.length&&this.writeMessage(l,m1,s)},writeBytesField:function(l,s){this.writeTag(l,Ln.Bytes),this.writeBytes(s)},writeFixed32Field:function(l,s){this.writeTag(l,Ln.Fixed32),this.writeFixed32(s)},writeSFixed32Field:function(l,s){this.writeTag(l,Ln.Fixed32),this.writeSFixed32(s)},writeFixed64Field:function(l,s){this.writeTag(l,Ln.Fixed64),this.writeFixed64(s)},writeSFixed64Field:function(l,s){this.writeTag(l,Ln.Fixed64),this.writeSFixed64(s)},writeVarintField:function(l,s){this.writeTag(l,Ln.Varint),this.writeVarint(s)},writeSVarintField:function(l,s){this.writeTag(l,Ln.Varint),this.writeSVarint(s)},writeStringField:function(l,s){this.writeTag(l,Ln.Bytes),this.writeString(s)},writeFloatField:function(l,s){this.writeTag(l,Ln.Fixed32),this.writeFloat(s)},writeDoubleField:function(l,s){this.writeTag(l,Ln.Fixed64),this.writeDouble(s)},writeBooleanField:function(l,s){this.writeVarintField(l,Boolean(s))}};class Z_{constructor(s,{pixelRatio:u,version:f,stretchX:_,stretchY:x,content:C}){this.paddedRect=s,this.pixelRatio=u,this.stretchX=_,this.stretchY=x,this.content=C,this.version=f}get tl(){return[this.paddedRect.x+1,this.paddedRect.y+1]}get br(){return[this.paddedRect.x+this.paddedRect.w-1,this.paddedRect.y+this.paddedRect.h-1]}get tlbr(){return this.tl.concat(this.br)}get displaySize(){return[(this.paddedRect.w-2)/this.pixelRatio,(this.paddedRect.h-2)/this.pixelRatio]}}class _1{constructor(s,u){const f={},_={};this.haveRenderCallbacks=[];const x=[];this.addImages(s,f,x),this.addImages(u,_,x);const{w:C,h:M}=op(x),A=new Oo({width:C||1,height:M||1});for(const F in s){const O=s[F],B=f[F].paddedRect;Oo.copy(O.data,A,{x:0,y:0},{x:B.x+1,y:B.y+1},O.data)}for(const F in u){const O=u[F],B=_[F].paddedRect,H=B.x+1,q=B.y+1,W=O.data.width,se=O.data.height;Oo.copy(O.data,A,{x:0,y:0},{x:H,y:q},O.data),Oo.copy(O.data,A,{x:0,y:se-1},{x:H,y:q-1},{width:W,height:1}),Oo.copy(O.data,A,{x:0,y:0},{x:H,y:q+se},{width:W,height:1}),Oo.copy(O.data,A,{x:W-1,y:0},{x:H-1,y:q},{width:1,height:se}),Oo.copy(O.data,A,{x:0,y:0},{x:H+W,y:q},{width:1,height:se})}this.image=A,this.iconPositions=f,this.patternPositions=_}addImages(s,u,f){for(const _ in s){const x=s[_],C={x:0,y:0,w:x.data.width+2,h:x.data.height+2};f.push(C),u[_]=new Z_(C,x),x.hasRenderCallback&&this.haveRenderCallbacks.push(_)}}patchUpdatedImages(s,u){s.dispatchRenderCallbacks(this.haveRenderCallbacks);for(const f in s.updatedImages)this.patchUpdatedImage(this.iconPositions[f],s.getImage(f),u),this.patchUpdatedImage(this.patternPositions[f],s.getImage(f),u)}patchUpdatedImage(s,u,f){if(!s||!u||s.version===u.version)return;s.version=u.version;const[_,x]=s.tl;f.update(u.data,void 0,{x:_,y:x})}}ct("ImagePosition",Z_),ct("ImageAtlas",_1),b.WritingMode=void 0,(sl=b.WritingMode||(b.WritingMode={}))[sl.none=0]="none",sl[sl.horizontal=1]="horizontal",sl[sl.vertical=2]="vertical",sl[sl.horizontalOnly=3]="horizontalOnly";class sp{constructor(){this.scale=1,this.fontStack="",this.imageName=null}static forText(s,u){const f=new sp;return f.scale=s||1,f.fontStack=u,f}static forImage(s){const u=new sp;return u.imageName=s,u}}class zd{constructor(){this.text="",this.sectionIndex=[],this.sections=[],this.imageSectionID=null}static fromFeature(s,u){const f=new zd;for(let _=0;_=0&&f>=s&&pg[this.text.charCodeAt(f)];f--)u--;this.text=this.text.substring(s,u),this.sectionIndex=this.sectionIndex.slice(s,u)}substring(s,u){const f=new zd;return f.text=this.text.substring(s,u),f.sectionIndex=this.sectionIndex.slice(s,u),f.sections=this.sections,f}toString(){return this.text}getMaxScale(){return this.sectionIndex.reduce((s,u)=>Math.max(s,this.sections[u].scale),0)}addTextSection(s,u){this.text+=s.text,this.sections.push(sp.forText(s.scale,s.fontStack||u));const f=this.sections.length-1;for(let _=0;_=63743?null:++this.imageSectionID:(this.imageSectionID=57344,this.imageSectionID)}}function fg(l,s,u,f,_,x,C,M,A,F,O,B,H,q,W,se){const oe=zd.fromFeature(l,_);let be;B===b.WritingMode.vertical&&oe.verticalizePunctuation();const{processBidirectionalText:Ce,processStyledBidirectionalText:me}=po;if(Ce&&1===oe.sections.length){be=[];const Ve=Ce(oe.toString(),ap(oe,F,x,s,f,q,W));for(const gt of Ve){const Ct=new zd;Ct.text=gt,Ct.sections=oe.sections;for(let at=0;at0&&cl>Ki&&(Ki=cl)}else{const rs=Ct[Qt.fontStack],vo=rs&&rs[vn];if(vo&&vo.rect)ns=vo.rect,Cs=vo.metrics;else{const cl=gt[Qt.fontStack],bp=cl&&cl[vn];if(!bp)continue;Cs=bp.metrics}ki=24*(gi-Qt.scale)}Ds?(Ve.verticalizable=!0,_o.push({glyph:vn,imageName:Es,x:Kn,y:rr+ki,vertical:Ds,scale:Qt.scale,fontStack:Qt.fontStack,sectionIndex:zo,metrics:Cs,rect:ns}),Kn+=ll*Qt.scale+Et):(_o.push({glyph:vn,imageName:Es,x:Kn,y:rr+ki,vertical:Ds,scale:Qt.scale,fontStack:Qt.fontStack,sectionIndex:zo,metrics:Cs,rect:ns}),Kn+=Cs.advance*Qt.scale+Et)}0!==_o.length&&(Or=Math.max(Kn-Et,Or),v1(_o,0,_o.length-1,Ti,Ki)),Kn=0;const hr=Qe*gi+Ki;Yi.lineOffset=Math.max(Ki,Ai),rr+=hr,ws=Math.max(hr,ws),++jr}var Lr;const Kr=rr- -17,{horizontalAlign:Xi,verticalAlign:No}=Wi(ot);(function(Ar,gi,Ai,Yi,_o,Ki,hr,yi,Qt){const zo=(gi-Ai)*_o;let vn=0;vn=Ki!==hr?-yi*Yi- -17:(-Yi*Qt+.5)*hr;for(const ki of Ar)for(const Cs of ki.positionedGlyphs)Cs.x+=zo,Cs.y+=vn})(Ve.positionedLines,Ti,Xi,No,Or,ws,Qe,Kr,tt.length),Ve.top+=-No*Kr,Ve.bottom=Ve.top+Kr,Ve.left+=-Xi*Or,Ve.right=Ve.left+Or}($e,s,u,f,be,C,M,A,B,F,H,se),!function(Ve){for(const gt of Ve)if(0!==gt.positionedGlyphs.length)return!1;return!0}(Ee)&&$e}const pg={9:!0,10:!0,11:!0,12:!0,13:!0,32:!0},R2={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 W_(l,s,u,f,_,x){if(s.imageName){const C=f[s.imageName];return C?C.displaySize[0]*s.scale*24/x+_:0}{const C=u[s.fontStack],M=C&&C[l];return M?M.metrics.advance*s.scale+_:0}}function mg(l,s,u,f){const _=Math.pow(l-s,2);return f?l=0;let O=0;for(let H=0;H-u/2;){if(C--,C<0)return!1;M-=l[C].dist(x),x=l[C]}M+=l[C].dist(l[C+1]),C++;const A=[];let F=0;for(;Mf;)F-=A.shift().angleDelta;if(F>_)return!1;C++,M+=O.dist(B)}return!0}function K_(l){let s=0;for(let u=0;uF){const W=(F-A)/q,se=Xn(B.x,H.x,W),oe=Xn(B.y,H.y,W),be=new ec(se,oe,H.angleTo(B),O);return be._round(),!C||Y_(l,be,M,C,s)?be:void 0}A+=q}}function yo(l,s,u,f,_,x,C,M,A){const F=vg(f,x,C),O=J_(f,_),B=O*C,H=0===l[0].x||l[0].x===A||0===l[0].y||l[0].y===A;return s-B=0&&Ee=0&&$e=0&&H+F<=O){const Ve=new ec(Ee,$e,Ce,W);Ve._round(),f&&!Y_(l,Ve,x,f,_)||q.push(Ve)}}B+=be}return M||q.length||C||(q=cp(l,B/2,u,f,_,x,C,!0,A)),q}function bg(l,s,u,f,_){const x=[];for(let C=0;C=f&&B.x>=f||(O.x>=f?O=new Tt(f,O.y+(f-O.x)/(B.x-O.x)*(B.y-O.y))._round():B.x>=f&&(B=new Tt(f,O.y+(f-O.x)/(B.x-O.x)*(B.y-O.y))._round()),O.y>=_&&B.y>=_||(O.y>=_?O=new Tt(O.x+(_-O.y)/(B.y-O.y)*(B.x-O.x),_)._round():B.y>=_&&(B=new Tt(O.x+(_-O.y)/(B.y-O.y)*(B.x-O.x),_)._round()),A&&O.equals(A[A.length-1])||(A=[O],x.push(A)),A.push(B)))))}}return x}function up(l,s,u,f){const _=[],x=l.image,C=x.pixelRatio,M=x.paddedRect.w-2,A=x.paddedRect.h-2,F=l.right-l.left,O=l.bottom-l.top,B=x.stretchX||[[0,M]],H=x.stretchY||[[0,A]],q=(Qe,ot)=>Qe+ot[1]-ot[0],W=B.reduce(q,0),se=H.reduce(q,0),oe=M-W,be=A-se;let Ce=0,me=W,Ee=0,$e=se,Ve=0,gt=oe,Ct=0,at=be;if(x.content&&f){const Qe=x.content;Ce=ui(B,0,Qe[0]),Ee=ui(H,0,Qe[1]),me=ui(B,Qe[0],Qe[2]),$e=ui(H,Qe[1],Qe[3]),Ve=Qe[0]-Ce,Ct=Qe[1]-Ee,gt=Qe[2]-Qe[0]-me,at=Qe[3]-Qe[1]-$e}const tt=(Qe,ot,it,Ge)=>{const Et=Bd(Qe.stretch-Ce,me,F,l.left),pt=hp(Qe.fixed-Ve,gt,Qe.stretch,W),Yt=Bd(ot.stretch-Ee,$e,O,l.top),Kn=hp(ot.fixed-Ct,at,ot.stretch,se),rr=Bd(it.stretch-Ce,me,F,l.left),Or=hp(it.fixed-Ve,gt,it.stretch,W),ws=Bd(Ge.stretch-Ee,$e,O,l.top),Ti=hp(Ge.fixed-Ct,at,Ge.stretch,se),jr=new Tt(Et,Yt),Lr=new Tt(rr,Yt),Kr=new Tt(rr,ws),Xi=new Tt(Et,ws),No=new Tt(pt/C,Kn/C),Ar=new Tt(Or/C,Ti/C),gi=s*Math.PI/180;if(gi){const _o=Math.sin(gi),Ki=Math.cos(gi),hr=[Ki,-_o,_o,Ki];jr._matMult(hr),Lr._matMult(hr),Xi._matMult(hr),Kr._matMult(hr)}const Ai=Qe.stretch+Qe.fixed,Yi=ot.stretch+ot.fixed;return{tl:jr,tr:Lr,bl:Xi,br:Kr,tex:{x:x.paddedRect.x+1+Ai,y:x.paddedRect.y+1+Yi,w:it.stretch+it.fixed-Ai,h:Ge.stretch+Ge.fixed-Yi},writingMode:void 0,glyphOffset:[0,0],sectionIndex:0,pixelOffsetTL:No,pixelOffsetBR:Ar,minFontScaleX:gt/C/F,minFontScaleY:at/C/O,isSDF:u}};if(f&&(x.stretchX||x.stretchY)){const Qe=yh(B,oe,W),ot=yh(H,be,se);for(let it=0;it0&&(W=Math.max(10,W),this.circleDiameter=W)}else{let B=C.top*M-A[0],H=C.bottom*M+A[2],q=C.left*M-A[3],W=C.right*M+A[1];const se=C.collisionPadding;if(se&&(q-=se[0]*M,B-=se[1]*M,W+=se[2]*M,H+=se[3]*M),O){const oe=new Tt(q,B),be=new Tt(W,B),Ce=new Tt(q,H),me=new Tt(W,H),Ee=O*Math.PI/180;oe._rotate(Ee),be._rotate(Ee),Ce._rotate(Ee),me._rotate(Ee),q=Math.min(oe.x,be.x,Ce.x,me.x),W=Math.max(oe.x,be.x,Ce.x,me.x),B=Math.min(oe.y,be.y,Ce.y,me.y),H=Math.max(oe.y,be.y,Ce.y,me.y)}s.emplaceBack(u.x,u.y,q,B,W,H,f,_,x)}this.boxEndIndex=s.length}}class Q_{constructor(s=[],u=w1){if(this.data=s,this.length=this.data.length,this.compare=u,this.length>0)for(let f=(this.length>>1)-1;f>=0;f--)this._down(f)}push(s){this.data.push(s),this.length++,this._up(this.length-1)}pop(){if(0===this.length)return;const s=this.data[0],u=this.data.pop();return this.length--,this.length>0&&(this.data[0]=u,this._down(0)),s}peek(){return this.data[0]}_up(s){const{data:u,compare:f}=this,_=u[s];for(;s>0;){const x=s-1>>1,C=u[x];if(f(_,C)>=0)break;u[s]=C,s=x}u[s]=_}_down(s){const{data:u,compare:f}=this,_=this.length>>1,x=u[s];for(;s<_;){let C=1+(s<<1),M=u[C];const A=C+1;if(A=0)break;u[s]=M,s=C}u[s]=x}}function w1(l,s){return ls?1:0}function ev(l,s=1,u=!1){let f=1/0,_=1/0,x=-1/0,C=-1/0;const M=l[0];for(let q=0;qx)&&(x=W.x),(!q||W.y>C)&&(C=W.y)}const A=Math.min(x-f,C-_);let F=A/2;const O=new Q_([],C1);if(0===A)return new Tt(f,_);for(let q=f;qB.d||!B.d)&&(B=q,u&&console.log("found best %d after %d probes",Math.round(1e4*q.d)/1e4,H)),q.max-B.d<=s||(F=q.h/2,O.push(new Kc(q.p.x-F,q.p.y-F,F,l)),O.push(new Kc(q.p.x+F,q.p.y-F,F,l)),O.push(new Kc(q.p.x-F,q.p.y+F,F,l)),O.push(new Kc(q.p.x+F,q.p.y+F,F,l)),H+=4)}return u&&(console.log(`num probes: ${H}`),console.log(`best distance: ${B.d}`)),B.p}function C1(l,s){return s.max-l.max}function Kc(l,s,u,f){this.p=new Tt(l,s),this.h=u,this.d=function(_,x){let C=!1,M=1/0;for(let A=0;A_.y!=W.y>_.y&&_.x<(W.x-q.x)*(_.y-q.y)/(W.y-q.y)+q.x&&(C=!C),M=Math.min(M,tr(_,q,W))}}return(C?1:-1)*Math.sqrt(M)}(this.p,f),this.max=this.d+this.h*Math.SQRT2}const xg=Number.POSITIVE_INFINITY;function tv(l,s){return s[1]!==xg?function(u,f,_){let x=0,C=0;switch(f=Math.abs(f),_=Math.abs(_),u){case"top-right":case"top-left":case"top":C=_-7;break;case"bottom-right":case"bottom-left":case"bottom":C=7-_}switch(u){case"top-right":case"bottom-right":case"right":x=-f;break;case"top-left":case"bottom-left":case"left":x=f}return[x,C]}(l,s[0],s[1]):function(u,f){let _=0,x=0;f<0&&(f=0);const C=f/Math.sqrt(2);switch(u){case"top-right":case"top-left":x=C-7;break;case"bottom-right":case"bottom-left":x=7-C;break;case"bottom":x=7-f;break;case"top":x=f-7}switch(u){case"top-right":case"bottom-right":_=-C;break;case"top-left":case"bottom-left":_=C;break;case"left":_=f;break;case"right":_=-f}return[_,x]}(l,s[0])}function Vd(l){switch(l){case"right":case"top-right":case"bottom-right":return"right";case"left":case"top-left":case"bottom-left":return"left"}return"center"}function wg(l,s,u,f,_,x,C,M,A,F,O){let B=x.textMaxSize.evaluate(s,{});void 0===B&&(B=C);const H=l.layers[0].layout,q=H.get("icon-offset").evaluate(s,{},O),W=nv(u.horizontal),se=C/24,oe=l.tilePixelRatio*se,be=l.tilePixelRatio*B/24,Ce=l.tilePixelRatio*M,me=l.tilePixelRatio*H.get("symbol-spacing"),Ee=H.get("text-padding")*l.tilePixelRatio,$e=function(Ge,Et,pt,Yt=1){const Kn=Ge.get("icon-padding").evaluate(Et,{},pt),rr=Kn&&Kn.values;return[rr[0]*Yt,rr[1]*Yt,rr[2]*Yt,rr[3]*Yt]}(H,s,O,l.tilePixelRatio),Ve=H.get("text-max-angle")/180*Math.PI,gt="viewport"!==H.get("text-rotation-alignment")&&"point"!==H.get("symbol-placement"),Ct="map"===H.get("icon-rotation-alignment")&&"point"!==H.get("symbol-placement"),at=H.get("symbol-placement"),tt=me/2,Qe=H.get("icon-text-fit");let ot;f&&"none"!==Qe&&(l.allowVerticalPlacement&&u.vertical&&(ot=X_(f,u.vertical,Qe,H.get("icon-text-fit-padding"),q,se)),W&&(f=X_(f,W,Qe,H.get("icon-text-fit-padding"),q,se)));const it=(Ge,Et)=>{Et.x<0||Et.x>=_n||Et.y<0||Et.y>=_n||function(pt,Yt,Kn,rr,Or,ws,Ti,jr,Lr,Kr,Xi,No,Ar,gi,Ai,Yi,_o,Ki,hr,yi,Qt,zo,vn,ki,Cs){const ns=pt.addToLineVertexArray(Yt,Kn);let Es,ll,Ds,rs,vo=0,cl=0,bp=0,R1=0,Qc=-1,Wd=-1;const xa={};let Og=j(""),xp=0,Lg=0;if(void 0===jr._unevaluatedLayout.getValue("text-radial-offset")?[xp,Lg]=jr.layout.get("text-offset").evaluate(Qt,{},ki).map(bo=>24*bo):(xp=24*jr.layout.get("text-radial-offset").evaluate(Qt,{},ki),Lg=xg),pt.allowVerticalPlacement&&rr.vertical){const bo=jr.layout.get("text-rotate").evaluate(Qt,{},ki)+90;Ds=new dp(Lr,Yt,Kr,Xi,No,rr.vertical,Ar,gi,Ai,bo),Ti&&(rs=new dp(Lr,Yt,Kr,Xi,No,Ti,_o,Ki,Ai,bo))}if(Or){const bo=jr.layout.get("icon-rotate").evaluate(Qt,{}),Ss="none"!==jr.layout.get("icon-text-fit"),ac=up(Or,bo,vn,Ss),Ms=Ti?up(Ti,bo,vn,Ss):void 0;ll=new dp(Lr,Yt,Kr,Xi,No,Or,_o,Ki,!1,bo),vo=4*ac.length;const Vg=pt.iconSizeData;let ul=null;"source"===Vg.kind?(ul=[ba*jr.layout.get("icon-size").evaluate(Qt,{})],ul[0]>tc&&pn(`${pt.layerIds[0]}: Value for "icon-size" is >= 255. Reduce your "icon-size".`)):"composite"===Vg.kind&&(ul=[ba*zo.compositeIconSizes[0].evaluate(Qt,{},ki),ba*zo.compositeIconSizes[1].evaluate(Qt,{},ki)],(ul[0]>tc||ul[1]>tc)&&pn(`${pt.layerIds[0]}: Value for "icon-size" is >= 255. Reduce your "icon-size".`)),pt.addSymbols(pt.icon,ac,ul,yi,hr,Qt,b.WritingMode.none,Yt,ns.lineStartIndex,ns.lineLength,-1,ki),Qc=pt.icon.placedSymbolArray.length-1,Ms&&(cl=4*Ms.length,pt.addSymbols(pt.icon,Ms,ul,yi,hr,Qt,b.WritingMode.vertical,Yt,ns.lineStartIndex,ns.lineLength,-1,ki),Wd=pt.icon.placedSymbolArray.length-1)}const Ng=Object.keys(rr.horizontal);for(const bo of Ng){const Ss=rr.horizontal[bo];if(!Es){Og=j(Ss.text);const Ms=jr.layout.get("text-rotate").evaluate(Qt,{},ki);Es=new dp(Lr,Yt,Kr,Xi,No,Ss,Ar,gi,Ai,Ms)}const ac=1===Ss.positionedLines.length;if(bp+=Cg(pt,Yt,Ss,ws,jr,Ai,Qt,Yi,ns,rr.vertical?b.WritingMode.horizontal:b.WritingMode.horizontalOnly,ac?Ng:[bo],xa,Qc,zo,ki),ac)break}rr.vertical&&(R1+=Cg(pt,Yt,rr.vertical,ws,jr,Ai,Qt,Yi,ns,b.WritingMode.vertical,["vertical"],xa,Wd,zo,ki));const uv=Es?Es.boxStartIndex:pt.collisionBoxArray.length,zg=Es?Es.boxEndIndex:pt.collisionBoxArray.length,F2=Ds?Ds.boxStartIndex:pt.collisionBoxArray.length,F1=Ds?Ds.boxEndIndex:pt.collisionBoxArray.length,Bg=ll?ll.boxStartIndex:pt.collisionBoxArray.length,hv=ll?ll.boxEndIndex:pt.collisionBoxArray.length,dv=rs?rs.boxStartIndex:pt.collisionBoxArray.length,eu=rs?rs.boxEndIndex:pt.collisionBoxArray.length;let Ws=-1;const wh=(bo,Ss)=>bo&&bo.circleDiameter?Math.max(bo.circleDiameter,Ss):Ss;Ws=wh(Es,Ws),Ws=wh(Ds,Ws),Ws=wh(ll,Ws),Ws=wh(rs,Ws);const Xd=Ws>-1?1:0;Xd&&(Ws*=Cs/24),pt.glyphOffsetArray.length>=rc.MAX_GLYPHS&&pn("Too many glyphs being rendered in a tile. See https://github.com/mapbox/mapbox-gl-js/issues/2907"),void 0!==Qt.sortKey&&pt.addToSortKeyRanges(pt.symbolInstances.length,Qt.sortKey),pt.symbolInstances.emplaceBack(Yt.x,Yt.y,xa.right>=0?xa.right:-1,xa.center>=0?xa.center:-1,xa.left>=0?xa.left:-1,xa.vertical||-1,Qc,Wd,Og,uv,zg,F2,F1,Bg,hv,dv,eu,Kr,bp,R1,vo,cl,Xd,0,Ar,xp,Lg,Ws)}(l,Et,Ge,u,f,_,ot,l.layers[0],l.collisionBoxArray,s.index,s.sourceLayerIndex,l.index,oe,[Ee,Ee,Ee,Ee],gt,A,Ce,$e,Ct,q,s,x,F,O,C)};if("line"===at)for(const Ge of bg(s.geometry,0,0,_n,_n)){const Et=yo(Ge,me,Ve,u.vertical||W,f,24,be,l.overscaling,_n);for(const pt of Et)W&&Ud(l,W.text,tt,pt)||it(Ge,pt)}else if("line-center"===at){for(const Ge of s.geometry)if(Ge.length>1){const Et=x1(Ge,Ve,u.vertical||W,f,24,be);Et&&it(Ge,Et)}}else if("Polygon"===s.type)for(const Ge of Id(s.geometry,0)){const Et=ev(Ge,16);it(Ge[0],new ec(Et.x,Et.y,0))}else if("LineString"===s.type)for(const Ge of s.geometry)it(Ge,new ec(Ge[0].x,Ge[0].y,0));else if("Point"===s.type)for(const Ge of s.geometry)for(const Et of Ge)it([Et],new ec(Et.x,Et.y,0))}const tc=32640;function Cg(l,s,u,f,_,x,C,M,A,F,O,B,H,q,W){const se=function(Ce,me,Ee,$e,Ve,gt,Ct,at){const tt=$e.layout.get("text-rotate").evaluate(gt,{})*Math.PI/180,Qe=[];for(const ot of me.positionedLines)for(const it of ot.positionedGlyphs){if(!it.rect)continue;const Ge=it.rect||{};let Et=4,pt=!0,Yt=1,Kn=0;const rr=(Ve||at)&&it.vertical,Or=it.metrics.advance*it.scale/2;if(at&&me.verticalizable&&(Kn=ot.lineOffset/2-(it.imageName?-(24-it.metrics.width*it.scale)/2:24*(it.scale-1))),it.imageName){const hr=Ct[it.imageName];pt=hr.sdf,Yt=hr.pixelRatio,Et=1/Yt}const ws=Ve?[it.x+Or,it.y]:[0,0];let Ti=Ve?[0,0]:[it.x+Or+Ee[0],it.y+Ee[1]-Kn],jr=[0,0];rr&&(jr=Ti,Ti=[0,0]);const Lr=(it.metrics.left-Et)*it.scale-Or+Ti[0],Kr=(-it.metrics.top-Et)*it.scale+Ti[1],Xi=Lr+Ge.w*it.scale/Yt,No=Kr+Ge.h*it.scale/Yt,Ar=new Tt(Lr,Kr),gi=new Tt(Xi,Kr),Ai=new Tt(Lr,No),Yi=new Tt(Xi,No);if(rr){const hr=new Tt(-Or,Or- -17),yi=-Math.PI/2,Qt=12-Or,zo=new Tt(22-Qt,-(it.imageName?Qt:0)),vn=new Tt(...jr);Ar._rotateAround(yi,hr)._add(zo)._add(vn),gi._rotateAround(yi,hr)._add(zo)._add(vn),Ai._rotateAround(yi,hr)._add(zo)._add(vn),Yi._rotateAround(yi,hr)._add(zo)._add(vn)}if(tt){const hr=Math.sin(tt),yi=Math.cos(tt),Qt=[yi,-hr,hr,yi];Ar._matMult(Qt),gi._matMult(Qt),Ai._matMult(Qt),Yi._matMult(Qt)}const _o=new Tt(0,0),Ki=new Tt(0,0);Qe.push({tl:Ar,tr:gi,bl:Ai,br:Yi,tex:Ge,writingMode:me.writingMode,glyphOffset:ws,sectionIndex:it.sectionIndex,isSDF:pt,pixelOffsetTL:_o,pixelOffsetBR:Ki,minFontScaleX:0,minFontScaleY:0})}return Qe}(0,u,M,_,x,C,f,l.allowVerticalPlacement),oe=l.textSizeData;let be=null;"source"===oe.kind?(be=[ba*_.layout.get("text-size").evaluate(C,{})],be[0]>tc&&pn(`${l.layerIds[0]}: Value for "text-size" is >= 255. Reduce your "text-size".`)):"composite"===oe.kind&&(be=[ba*q.compositeTextSizes[0].evaluate(C,{},W),ba*q.compositeTextSizes[1].evaluate(C,{},W)],(be[0]>tc||be[1]>tc)&&pn(`${l.layerIds[0]}: Value for "text-size" is >= 255. Reduce your "text-size".`)),l.addSymbols(l.text,se,be,M,x,C,F,s,A.lineStartIndex,A.lineLength,H,W);for(const Ce of O)B[Ce]=l.text.placedSymbolArray.length-1;return 4*se.length}function nv(l){for(const s in l)return l[s];return null}function Ud(l,s,u,f){const _=l.compareText;if(s in _){const x=_[s];for(let C=x.length-1;C>=0;C--)if(f.dist(x[C])C.id),this.index=s.index,this.pixelRatio=s.pixelRatio,this.sourceLayerIndex=s.sourceLayerIndex,this.hasPattern=!1,this.hasRTLText=!1,this.sortKeyRanges=[],this.collisionCircleArray=[],this.placementInvProjMatrix=Gf([]),this.placementViewportMatrix=Gf([]);const u=this.layers[0]._unevaluatedLayout._values;this.textSizeData=lp(this.zoom,u["text-size"]),this.iconSizeData=lp(this.zoom,u["icon-size"]);const f=this.layers[0].layout,_=f.get("symbol-sort-key"),x=f.get("symbol-z-order");this.canOverlap="never"!==Dg(f,"text-overlap","text-allow-overlap")||"never"!==Dg(f,"icon-overlap","icon-allow-overlap")||f.get("text-ignore-placement")||f.get("icon-ignore-placement"),this.sortFeaturesByKey="viewport-y"!==x&&!_.isConstant(),this.sortFeaturesByY=("viewport-y"===x||"auto"===x&&!this.sortFeaturesByKey)&&this.canOverlap,"point"===f.get("symbol-placement")&&(this.writingModes=f.get("text-writing-mode").map(C=>b.WritingMode[C])),this.stateDependentLayerIds=this.layers.filter(C=>C.isStateDependent()).map(C=>C.id),this.sourceID=s.sourceID}createArrays(){this.text=new iv(new Ht(this.layers,this.zoom,s=>/^text/.test(s))),this.icon=new iv(new Ht(this.layers,this.zoom,s=>/^icon/.test(s))),this.glyphOffsetArray=new en,this.lineVertexArray=new ma,this.symbolInstances=new He}calculateGlyphDependencies(s,u,f,_,x){for(let C=0;C0)&&("constant"!==C.value.kind||C.value.value.length>0),O="constant"!==A.value.kind||!!A.value.value||Object.keys(A.parameters).length>0,B=x.get("symbol-sort-key");if(this.features=[],!F&&!O)return;const H=u.iconDependencies,q=u.glyphDependencies,W=u.availableImages,se=new cr(this.zoom);for(const{feature:oe,id:be,index:Ce,sourceLayerIndex:me}of s){const Ee=_._featureFilter.needGeometry,$e=li(oe,Ee);if(!_._featureFilter.filter(se,$e,f))continue;let Ve,gt;if(Ee||($e.geometry=vr(oe)),F){const at=_.getValueAndResolveTokens("text-field",$e,f,W),tt=Zr.factory(at);rv(tt)&&(this.hasRTLText=!0),(!this.hasRTLText||"unavailable"===Gl()||this.hasRTLText&&po.isParsed())&&(Ve=Od(tt,_,$e))}if(O){const at=_.getValueAndResolveTokens("icon-image",$e,f,W);gt=at instanceof pi?at:pi.fromString(at)}if(!Ve&&!gt)continue;const Ct=this.sortFeaturesByKey?B.evaluate($e,{},f):void 0;if(this.features.push({id:be,text:Ve,icon:gt,index:Ce,sourceLayerIndex:me,geometry:$e.geometry,properties:oe.properties,type:E1[oe.type],sortKey:Ct}),gt&&(H[gt.name]=!0),Ve){const at=C.evaluate($e,{},f).join(","),tt="viewport"!==x.get("text-rotation-alignment")&&"point"!==x.get("symbol-placement");this.allowVerticalPlacement=this.writingModes&&this.writingModes.indexOf(b.WritingMode.vertical)>=0;for(const Qe of Ve.sections)if(Qe.image)H[Qe.image.name]=!0;else{const ot=ho(Ve.toString()),it=Qe.fontStack||at,Ge=q[it]=q[it]||{};this.calculateGlyphDependencies(Qe.text,Ge,tt,this.allowVerticalPlacement,ot)}}}"line"===x.get("symbol-placement")&&(this.features=function(oe){const be={},Ce={},me=[];let Ee=0;function $e(at){me.push(oe[at]),Ee++}function Ve(at,tt,Qe){const ot=Ce[at];return delete Ce[at],Ce[tt]=ot,me[ot].geometry[0].pop(),me[ot].geometry[0]=me[ot].geometry[0].concat(Qe[0]),ot}function gt(at,tt,Qe){const ot=be[tt];return delete be[tt],be[at]=ot,me[ot].geometry[0].shift(),me[ot].geometry[0]=Qe[0].concat(me[ot].geometry[0]),ot}function Ct(at,tt,Qe){const ot=Qe?tt[0][tt[0].length-1]:tt[0][0];return`${at}:${ot.x}:${ot.y}`}for(let at=0;atat.geometry)}(this.features)),this.sortFeaturesByKey&&this.features.sort((oe,be)=>oe.sortKey-be.sortKey)}update(s,u,f){this.stateDependentLayers.length&&(this.text.programConfigurations.updatePaintArrays(s,u,this.layers,f),this.icon.programConfigurations.updatePaintArrays(s,u,this.layers,f))}isEmpty(){return 0===this.symbolInstances.length&&!this.hasRTLText}uploadPending(){return!this.uploaded||this.text.programConfigurations.needsUpload||this.icon.programConfigurations.needsUpload}upload(s){!this.uploaded&&this.hasDebugData()&&(this.textCollisionBox.upload(s),this.iconCollisionBox.upload(s)),this.text.upload(s,this.sortFeaturesByY,!this.uploaded,this.text.programConfigurations.needsUpload),this.icon.upload(s,this.sortFeaturesByY,!this.uploaded,this.icon.programConfigurations.needsUpload),this.uploaded=!0}destroyDebugData(){this.textCollisionBox.destroy(),this.iconCollisionBox.destroy()}destroy(){this.text.destroy(),this.icon.destroy(),this.hasDebugData()&&this.destroyDebugData()}addToLineVertexArray(s,u){const f=this.lineVertexArray.length;if(void 0!==s.segment){let _=s.dist(u[s.segment+1]),x=s.dist(u[s.segment]);const C={};for(let M=s.segment+1;M=0;M--)C[M]={x:u[M].x,y:u[M].y,tileUnitDistanceFromAnchor:x},M>0&&(x+=u[M-1].dist(u[M]));for(let M=0;M0}hasIconData(){return this.icon.segments.get().length>0}hasDebugData(){return this.textCollisionBox&&this.iconCollisionBox}hasTextCollisionBoxData(){return this.hasDebugData()&&this.textCollisionBox.segments.get().length>0}hasIconCollisionBoxData(){return this.hasDebugData()&&this.iconCollisionBox.segments.get().length>0}addIndicesForPlacedSymbol(s,u){const f=s.placedSymbolArray.get(u),_=f.vertexStartIndex+4*f.numGlyphs;for(let x=f.vertexStartIndex;x<_;x+=4)s.indexArray.emplaceBack(x,x+1,x+2),s.indexArray.emplaceBack(x+1,x+2,x+3)}getSortedSymbolIndexes(s){if(this.sortedAngle===s&&void 0!==this.symbolInstanceIndexes)return this.symbolInstanceIndexes;const u=Math.sin(s),f=Math.cos(s),_=[],x=[],C=[];for(let M=0;M_[M]-_[A]||x[A]-x[M]),C}addToSortKeyRanges(s,u){const f=this.sortKeyRanges[this.sortKeyRanges.length-1];f&&f.sortKey===u?f.symbolInstanceEnd=s+1:this.sortKeyRanges.push({sortKey:u,symbolInstanceStart:s,symbolInstanceEnd:s+1})}sortFeatures(s){if(this.sortFeaturesByY&&this.sortedAngle!==s&&!(this.text.segments.get().length>1||this.icon.segments.get().length>1)){this.symbolInstanceIndexes=this.getSortedSymbolIndexes(s),this.sortedAngle=s,this.text.indexArray.clear(),this.icon.indexArray.clear(),this.featureSortOrder=[];for(const u of this.symbolInstanceIndexes){const f=this.symbolInstances.get(u);this.featureSortOrder.push(f.featureIndex),[f.rightJustifiedTextSymbolIndex,f.centerJustifiedTextSymbolIndex,f.leftJustifiedTextSymbolIndex].forEach((_,x,C)=>{_>=0&&C.indexOf(_)===x&&this.addIndicesForPlacedSymbol(this.text,_)}),f.verticalPlacedTextSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.text,f.verticalPlacedTextSymbolIndex),f.placedIconSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.icon,f.placedIconSymbolIndex),f.verticalPlacedIconSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.icon,f.verticalPlacedIconSymbolIndex)}this.text.indexBuffer&&this.text.indexBuffer.updateData(this.text.indexArray),this.icon.indexBuffer&&this.icon.indexBuffer.updateData(this.icon.indexArray)}}}ct("SymbolBucket",rc,{omit:["layers","collisionBoxArray","features","compareText"]}),rc.MAX_GLYPHS=65535,rc.addDynamicAttributes=$d;const ov=new Di({"symbol-placement":new wt(Ae.layout_symbol["symbol-placement"]),"symbol-spacing":new wt(Ae.layout_symbol["symbol-spacing"]),"symbol-avoid-edges":new wt(Ae.layout_symbol["symbol-avoid-edges"]),"symbol-sort-key":new yt(Ae.layout_symbol["symbol-sort-key"]),"symbol-z-order":new wt(Ae.layout_symbol["symbol-z-order"]),"icon-allow-overlap":new wt(Ae.layout_symbol["icon-allow-overlap"]),"icon-overlap":new wt(Ae.layout_symbol["icon-overlap"]),"icon-ignore-placement":new wt(Ae.layout_symbol["icon-ignore-placement"]),"icon-optional":new wt(Ae.layout_symbol["icon-optional"]),"icon-rotation-alignment":new wt(Ae.layout_symbol["icon-rotation-alignment"]),"icon-size":new yt(Ae.layout_symbol["icon-size"]),"icon-text-fit":new wt(Ae.layout_symbol["icon-text-fit"]),"icon-text-fit-padding":new wt(Ae.layout_symbol["icon-text-fit-padding"]),"icon-image":new yt(Ae.layout_symbol["icon-image"]),"icon-rotate":new yt(Ae.layout_symbol["icon-rotate"]),"icon-padding":new yt(Ae.layout_symbol["icon-padding"]),"icon-keep-upright":new wt(Ae.layout_symbol["icon-keep-upright"]),"icon-offset":new yt(Ae.layout_symbol["icon-offset"]),"icon-anchor":new yt(Ae.layout_symbol["icon-anchor"]),"icon-pitch-alignment":new wt(Ae.layout_symbol["icon-pitch-alignment"]),"text-pitch-alignment":new wt(Ae.layout_symbol["text-pitch-alignment"]),"text-rotation-alignment":new wt(Ae.layout_symbol["text-rotation-alignment"]),"text-field":new yt(Ae.layout_symbol["text-field"]),"text-font":new yt(Ae.layout_symbol["text-font"]),"text-size":new yt(Ae.layout_symbol["text-size"]),"text-max-width":new yt(Ae.layout_symbol["text-max-width"]),"text-line-height":new wt(Ae.layout_symbol["text-line-height"]),"text-letter-spacing":new yt(Ae.layout_symbol["text-letter-spacing"]),"text-justify":new yt(Ae.layout_symbol["text-justify"]),"text-radial-offset":new yt(Ae.layout_symbol["text-radial-offset"]),"text-variable-anchor":new wt(Ae.layout_symbol["text-variable-anchor"]),"text-anchor":new yt(Ae.layout_symbol["text-anchor"]),"text-max-angle":new wt(Ae.layout_symbol["text-max-angle"]),"text-writing-mode":new wt(Ae.layout_symbol["text-writing-mode"]),"text-rotate":new yt(Ae.layout_symbol["text-rotate"]),"text-padding":new wt(Ae.layout_symbol["text-padding"]),"text-keep-upright":new wt(Ae.layout_symbol["text-keep-upright"]),"text-transform":new yt(Ae.layout_symbol["text-transform"]),"text-offset":new yt(Ae.layout_symbol["text-offset"]),"text-allow-overlap":new wt(Ae.layout_symbol["text-allow-overlap"]),"text-overlap":new wt(Ae.layout_symbol["text-overlap"]),"text-ignore-placement":new wt(Ae.layout_symbol["text-ignore-placement"]),"text-optional":new wt(Ae.layout_symbol["text-optional"])});var Eg={paint:new Di({"icon-opacity":new yt(Ae.paint_symbol["icon-opacity"]),"icon-color":new yt(Ae.paint_symbol["icon-color"]),"icon-halo-color":new yt(Ae.paint_symbol["icon-halo-color"]),"icon-halo-width":new yt(Ae.paint_symbol["icon-halo-width"]),"icon-halo-blur":new yt(Ae.paint_symbol["icon-halo-blur"]),"icon-translate":new wt(Ae.paint_symbol["icon-translate"]),"icon-translate-anchor":new wt(Ae.paint_symbol["icon-translate-anchor"]),"text-opacity":new yt(Ae.paint_symbol["text-opacity"]),"text-color":new yt(Ae.paint_symbol["text-color"],{runtimeType:io,getOverride:l=>l.textColor,hasOverride:l=>!!l.textColor}),"text-halo-color":new yt(Ae.paint_symbol["text-halo-color"]),"text-halo-width":new yt(Ae.paint_symbol["text-halo-width"]),"text-halo-blur":new yt(Ae.paint_symbol["text-halo-blur"]),"text-translate":new wt(Ae.paint_symbol["text-translate"]),"text-translate-anchor":new wt(Ae.paint_symbol["text-translate-anchor"])}),layout:ov};class fp{constructor(s){if(void 0===s.property.overrides)throw new Error("overrides must be provided to instantiate FormatSectionOverride class");this.type=s.property.overrides?s.property.overrides.runtimeType:fs,this.defaultValue=s}evaluate(s){if(s.formattedSection){const u=this.defaultValue.property.overrides;if(u&&u.hasOverride(s.formattedSection))return u.getOverride(s.formattedSection)}return s.feature&&s.featureState?this.defaultValue.evaluate(s.feature,s.featureState):this.defaultValue.property.specification.default}eachChild(s){this.defaultValue.isConstant()||s(this.defaultValue.value._styleExpression.expression)}outputDefined(){return!1}serialize(){return null}}ct("FormatSectionOverride",fp,{omit:["defaultValue"]});class pp extends Ko{constructor(s){super(s,Eg)}recalculate(s,u){if(super.recalculate(s,u),"auto"===this.layout.get("icon-rotation-alignment")&&(this.layout._values["icon-rotation-alignment"]="point"!==this.layout.get("symbol-placement")?"map":"viewport"),"auto"===this.layout.get("text-rotation-alignment")&&(this.layout._values["text-rotation-alignment"]="point"!==this.layout.get("symbol-placement")?"map":"viewport"),"auto"===this.layout.get("text-pitch-alignment")&&(this.layout._values["text-pitch-alignment"]="map"===this.layout.get("text-rotation-alignment")?"map":"viewport"),"auto"===this.layout.get("icon-pitch-alignment")&&(this.layout._values["icon-pitch-alignment"]=this.layout.get("icon-rotation-alignment")),"point"===this.layout.get("symbol-placement")){const f=this.layout.get("text-writing-mode");if(f){const _=[];for(const x of f)_.indexOf(x)<0&&_.push(x);this.layout._values["text-writing-mode"]=_}else this.layout._values["text-writing-mode"]=["horizontal"]}this._setPaintOverrides()}getValueAndResolveTokens(s,u,f,_){const x=this.layout.get(s).evaluate(u,{},f,_),C=this._unevaluatedLayout._values[s];return C.isDataDriven()||Cn(C.value)||!x?x:(M=u.properties,x.replace(/{([^{}]+)}/g,(F,O)=>O in M?String(M[O]):""));var M}createBucket(s){return new rc(s)}queryRadius(){return 0}queryIntersectsFeature(){throw new Error("Should take a different path in FeatureIndex")}_setPaintOverrides(){for(const s of Eg.paint.overridableProperties){if(!pp.hasPaintOverride(this.layout,s))continue;const u=this.paint.get(s),f=new fp(u),_=new ca(f,u.property.specification);let x=null;x="constant"===u.value.kind||"source"===u.value.kind?new zc("source",_):new Bc("composite",_,u.value.zoomStops),this.paint._values[s]=new ys(u.property,x,u.parameters)}}_handleOverridablePaintPropertyUpdate(s,u,f){return!(!this.layout||u.isDataDriven()||f.isDataDriven())&&pp.hasPaintOverride(this.layout,s)}static hasPaintOverride(s,u){const f=s.get("text-field"),_=Eg.paint.properties[u];let x=!1;const C=M=>{for(const A of M)if(_.overrides&&_.overrides.hasOverride(A))return void(x=!0)};if("constant"===f.value.kind&&f.value.value instanceof Zr)C(f.value.value.sections);else if("source"===f.value.kind){const M=F=>{x||(F instanceof $&&J(F.value)===Ci?C(F.value.sections):F instanceof Nc?C(F.sections):F.eachChild(M))},A=f.value;A._styleExpression&&M(A._styleExpression.expression)}return x}}function Dg(l,s,u){let f="never";const _=l.get(s);return _?f=_:l.get(u)&&(f="always"),f}var S1={paint:new Di({"background-color":new wt(Ae.paint_background["background-color"]),"background-pattern":new pd(Ae.paint_background["background-pattern"]),"background-opacity":new wt(Ae.paint_background["background-opacity"])})},M1={paint:new Di({"raster-opacity":new wt(Ae.paint_raster["raster-opacity"]),"raster-hue-rotate":new wt(Ae.paint_raster["raster-hue-rotate"]),"raster-brightness-min":new wt(Ae.paint_raster["raster-brightness-min"]),"raster-brightness-max":new wt(Ae.paint_raster["raster-brightness-max"]),"raster-saturation":new wt(Ae.paint_raster["raster-saturation"]),"raster-contrast":new wt(Ae.paint_raster["raster-contrast"]),"raster-resampling":new wt(Ae.paint_raster["raster-resampling"]),"raster-fade-duration":new wt(Ae.paint_raster["raster-fade-duration"])})};class I1 extends Ko{constructor(s){super(s,{}),this.onAdd=u=>{this.implementation.onAdd&&this.implementation.onAdd(u,u.painter.context.gl)},this.onRemove=u=>{this.implementation.onRemove&&this.implementation.onRemove(u,u.painter.context.gl)},this.implementation=s}is3D(){return"3d"===this.implementation.renderingMode}hasOffscreenPass(){return void 0!==this.implementation.prerender}recalculate(){}updateTransitions(){}hasTransition(){return!1}serialize(){throw new Error("Custom layers cannot be serialized")}}const T1={circle:class extends Ko{constructor(l){super(l,Cd)}createBucket(l){return new Jo(l)}queryRadius(l){const s=l;return ya("circle-radius",this,s)+ya("circle-stroke-width",this,s)+Zs(this.paint.get("circle-translate"))}queryIntersectsFeature(l,s,u,f,_,x,C,M){const A=ah(l,this.paint.get("circle-translate"),this.paint.get("circle-translate-anchor"),x.angle,C),F=this.paint.get("circle-radius").evaluate(s,u)+this.paint.get("circle-stroke-width").evaluate(s,u),O="map"===this.paint.get("circle-pitch-alignment"),B=O?A:(W=M,A.map(se=>lh(se,W))),H=O?F*C:F;var W;for(const q of f)for(const W of q){const se=O?W:lh(W,M);let oe=H;const be=qf([],[W.x,W.y,0,1],M);if("viewport"===this.paint.get("circle-pitch-scale")&&"map"===this.paint.get("circle-pitch-alignment")?oe*=be[3]/x.cameraToCenterDistance:"map"===this.paint.get("circle-pitch-scale")&&"viewport"===this.paint.get("circle-pitch-alignment")&&(oe*=x.cameraToCenterDistance/be[3]),Yl(B,se,oe))return!0}return!1}},heatmap:class extends Ko{createBucket(l){return new Zf(l)}constructor(l){super(l,Zm),this._updateColorRamp()}_handleSpecialPaintPropertyUpdate(l){"heatmap-color"===l&&this._updateColorRamp()}_updateColorRamp(){this.colorRamp=Xm({expression:this._transitionablePaint._values["heatmap-color"].value.expression,evaluationKey:"heatmapDensity",image:this.colorRamp}),this.colorRampTexture=null}resize(){this.heatmapFbo&&(this.heatmapFbo.destroy(),this.heatmapFbo=null)}queryRadius(){return 0}queryIntersectsFeature(){return!1}hasOffscreenPass(){return 0!==this.paint.get("heatmap-opacity")&&"none"!==this.visibility}},hillshade:class extends Ko{constructor(l){super(l,P_)}hasOffscreenPass(){return 0!==this.paint.get("hillshade-exaggeration")&&"none"!==this.visibility}},fill:class extends Ko{constructor(l){super(l,z_)}recalculate(l,s){super.recalculate(l,s);const u=this.paint._values["fill-outline-color"];"constant"===u.value.kind&&void 0===u.value.value&&(this.paint._values["fill-outline-color"]=this.paint._values["fill-color"])}createBucket(l){return new go(l)}queryRadius(){return Zs(this.paint.get("fill-translate"))}queryIntersectsFeature(l,s,u,f,_,x,C){return Rr(ah(l,this.paint.get("fill-translate"),this.paint.get("fill-translate-anchor"),x.angle,C),f)}isTileClipped(){return!0}},"fill-extrusion":class extends Ko{constructor(l){super(l,A2)}createBucket(l){return new ig(l)}queryRadius(){return Zs(this.paint.get("fill-extrusion-translate"))}is3D(){return!0}queryIntersectsFeature(l,s,u,f,_,x,C,M){const A=ah(l,this.paint.get("fill-extrusion-translate"),this.paint.get("fill-extrusion-translate-anchor"),x.angle,C),F=this.paint.get("fill-extrusion-height").evaluate(s,u),O=this.paint.get("fill-extrusion-base").evaluate(s,u),B=function(q,W,se,oe){const be=[];for(const Ce of q){const me=[Ce.x,Ce.y,0,1];qf(me,me,W),be.push(new Tt(me[0]/me[3],me[1]/me[3]))}return be}(A,M),H=function(q,W,se,oe){const be=[],Ce=[],me=oe[8]*W,Ee=oe[9]*W,$e=oe[10]*W,Ve=oe[11]*W,gt=oe[8]*se,Ct=oe[9]*se,at=oe[10]*se,tt=oe[11]*se;for(const Qe of q){const ot=[],it=[];for(const Ge of Qe){const Et=Ge.x,pt=Ge.y,Yt=oe[0]*Et+oe[4]*pt+oe[12],Kn=oe[1]*Et+oe[5]*pt+oe[13],rr=oe[2]*Et+oe[6]*pt+oe[14],Or=oe[3]*Et+oe[7]*pt+oe[15],ws=rr+$e,Ti=Or+Ve,jr=Yt+gt,Lr=Kn+Ct,Kr=rr+at,Xi=Or+tt,No=new Tt((Yt+me)/Ti,(Kn+Ee)/Ti);No.z=ws/Ti,ot.push(No);const Ar=new Tt(jr/Xi,Lr/Xi);Ar.z=Kr/Xi,it.push(Ar)}be.push(ot),Ce.push(it)}return[be,Ce]}(f,O,F,M);return function(q,W,se){let oe=1/0;Rr(se,W)&&(oe=tp(se,W[0]));for(let be=0;be=3)for(let se=0;se{this._triggered=!1,this._callback()})}trigger(){this._triggered||(this._triggered=!0,this._channel?this._channel.port1.postMessage(!0):setTimeout(()=>{this._triggered=!1,this._callback()},0))}remove(){delete this._channel,this._callback=()=>{}}}const jd=6371008.8;class br{constructor(s,u){if(isNaN(s)||isNaN(u))throw new Error(`Invalid LngLat object: (${s}, ${u})`);if(this.lng=+s,this.lat=+u,this.lat>90||this.lat<-90)throw new Error("Invalid LngLat latitude value: must be between -90 and 90")}wrap(){return new br(Te(this.lng,-180,180),this.lat)}toArray(){return[this.lng,this.lat]}toString(){return`LngLat(${this.lng}, ${this.lat})`}distanceTo(s){const u=Math.PI/180,f=this.lat*u,_=s.lat*u,x=Math.sin(f)*Math.sin(_)+Math.cos(f)*Math.cos(_)*Math.cos((s.lng-this.lng)*u);return jd*Math.acos(Math.min(x,1))}toBounds(s=0){const u=360*s/40075017,f=u/Math.cos(Math.PI/180*this.lat);return new av(new br(this.lng-f,this.lat-u),new br(this.lng+f,this.lat+u))}static convert(s){if(s instanceof br)return s;if(Array.isArray(s)&&(2===s.length||3===s.length))return new br(Number(s[0]),Number(s[1]));if(!Array.isArray(s)&&"object"==typeof s&&null!==s)return new br(Number("lng"in s?s.lng:s.lon),Number(s.lat));throw new Error("`LngLatLike` argument must be specified as a LngLat instance, an object {lng: , lat: }, an object {lon: , lat: }, or an array of [, ]")}}class ic{constructor(s,u){s&&(u?this.setSouthWest(s).setNorthEast(u):4===s.length?this.setSouthWest([s[0],s[1]]).setNorthEast([s[2],s[3]]):this.setSouthWest(s[0]).setNorthEast(s[1]))}setNorthEast(s){return this._ne=s instanceof br?new br(s.lng,s.lat):br.convert(s),this}setSouthWest(s){return this._sw=s instanceof br?new br(s.lng,s.lat):br.convert(s),this}extend(s){const u=this._sw,f=this._ne;let _,x;if(s instanceof br)_=s,x=s;else{if(!(s instanceof ic))return Array.isArray(s)?4===s.length||s.every(Array.isArray)?this.extend(ic.convert(s)):this.extend(br.convert(s)):this;if(_=s._sw,x=s._ne,!_||!x)return this}return u||f?(u.lng=Math.min(_.lng,u.lng),u.lat=Math.min(_.lat,u.lat),f.lng=Math.max(x.lng,f.lng),f.lat=Math.max(x.lat,f.lat)):(this._sw=new br(_.lng,_.lat),this._ne=new br(x.lng,x.lat)),this}getCenter(){return new br((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 br(this.getWest(),this.getNorth())}getSouthEast(){return new br(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(s){const{lng:u,lat:f}=br.convert(s);let _=this._sw.lng<=u&&u<=this._ne.lng;return this._sw.lng>this._ne.lng&&(_=this._sw.lng>=u&&u>=this._ne.lng),this._sw.lat<=f&&f<=this._ne.lat&&_}static convert(s){return s instanceof ic?s:s&&new ic(s)}}var av=ic;const lv=2*Math.PI*jd;function Sg(l){return lv*Math.cos(l*Math.PI/180)}function Mg(l){return(180+l)/360}function oc(l){return(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+l*Math.PI/360)))/360}function Ig(l,s){return l/Sg(s)}function mp(l){return 360/Math.PI*Math.atan(Math.exp((180-360*l)*Math.PI/180))-90}class gp{constructor(s,u,f=0){this.x=+s,this.y=+u,this.z=+f}static fromLngLat(s,u=0){const f=br.convert(s);return new gp(Mg(f.lng),oc(f.lat),Ig(u,f.lat))}toLngLat(){return new br(360*this.x-180,mp(this.y))}toAltitude(){return this.z*Sg(mp(this.y))}meterInMercatorCoordinateUnits(){return 1/lv*(s=mp(this.y),1/Math.cos(s*Math.PI/180));var s}}function A1(l,s,u){var f=2*Math.PI*6378137/256/Math.pow(2,u);return[l*f-2*Math.PI*6378137/2,s*f-2*Math.PI*6378137/2]}class vh{constructor(s,u,f){if(s<0||s>25||f<0||f>=Math.pow(2,s)||u<0||u>=Math.pow(2,s))throw new Error(`x=${u}, y=${f}, z=${s} outside of bounds. 0<=x<${Math.pow(2,s)}, 0<=y<${Math.pow(2,s)} 0<=z<=25 `);this.z=s,this.x=u,this.y=f,this.key=bh(0,s,s,u,f)}equals(s){return this.z===s.z&&this.x===s.x&&this.y===s.y}url(s,u,f){const _=(C=this.y,M=this.z,A=A1(256*(x=this.x),256*(C=Math.pow(2,M)-C-1),M),F=A1(256*(x+1),256*(C+1),M),A[0]+","+A[1]+","+F[0]+","+F[1]);var x,C,M,A,F;const O=function(B,H,q){let W,se="";for(let oe=B;oe>0;oe--)W=1<1?"@2x":"").replace(/{quadkey}/g,O).replace(/{bbox-epsg-3857}/g,_)}isChildOf(s){const u=this.z-s.z;return u>0&&s.x===this.x>>u&&s.y===this.y>>u}getTilePoint(s){const u=Math.pow(2,this.z);return new Tt((s.x*u-this.x)*_n,(s.y*u-this.y)*_n)}toString(){return`${this.z}/${this.x}/${this.y}`}}class cv{constructor(s,u){this.wrap=s,this.canonical=u,this.key=bh(s,u.z,u.z,u.x,u.y)}}class Lo{constructor(s,u,f,_,x){if(s= z; overscaledZ = ${s}; z = ${f}`);this.overscaledZ=s,this.wrap=u,this.canonical=new vh(f,+_,+x),this.key=bh(u,s,f,_,x)}clone(){return new Lo(this.overscaledZ,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y)}equals(s){return this.overscaledZ===s.overscaledZ&&this.wrap===s.wrap&&this.canonical.equals(s.canonical)}scaledTo(s){if(s>this.overscaledZ)throw new Error(`targetZ > this.overscaledZ; targetZ = ${s}; overscaledZ = ${this.overscaledZ}`);const u=this.canonical.z-s;return s>this.canonical.z?new Lo(s,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y):new Lo(s,this.wrap,s,this.canonical.x>>u,this.canonical.y>>u)}calculateScaledKey(s,u){if(s>this.overscaledZ)throw new Error(`targetZ > this.overscaledZ; targetZ = ${s}; overscaledZ = ${this.overscaledZ}`);const f=this.canonical.z-s;return s>this.canonical.z?bh(this.wrap*+u,s,this.canonical.z,this.canonical.x,this.canonical.y):bh(this.wrap*+u,s,s,this.canonical.x>>f,this.canonical.y>>f)}isChildOf(s){if(s.wrap!==this.wrap)return!1;const u=this.canonical.z-s.canonical.z;return 0===s.overscaledZ||s.overscaledZ>u&&s.canonical.y===this.canonical.y>>u}children(s){if(this.overscaledZ>=s)return[new Lo(this.overscaledZ+1,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y)];const u=this.canonical.z+1,f=2*this.canonical.x,_=2*this.canonical.y;return[new Lo(u,this.wrap,u,f,_),new Lo(u,this.wrap,u,f+1,_),new Lo(u,this.wrap,u,f,_+1),new Lo(u,this.wrap,u,f+1,_+1)]}isLessThan(s){return this.wraps.wrap)&&(this.overscaledZs.overscaledZ)&&(this.canonical.xs.canonical.x)&&this.canonical.ythis.max&&(this.max=M),M=this.dim+1||u<-1||u>=this.dim+1)throw new RangeError("out of range source coordinates for DEM data");return(u+1)*this.stride+(s+1)}_unpackMapbox(s,u,f){return(256*s*256+256*u+f)/10-1e4}_unpackTerrarium(s,u,f){return 256*s+u+f/256-32768}getPixels(){return new Oo({width:this.stride,height:this.stride},new Uint8Array(this.data.buffer))}backfillBorder(s,u,f){if(this.dim!==s.dim)throw new Error("dem dimension mismatch");let _=u*this.dim,x=u*this.dim+this.dim,C=f*this.dim,M=f*this.dim+this.dim;switch(u){case-1:_=x-1;break;case 1:x=_+1}switch(f){case-1:C=M-1;break;case 1:M=C+1}const A=-u*this.dim,F=-f*this.dim;for(let O=C;O=this._numberToString.length)throw new Error(`Out of bounds. Index requested n=${s} can't be >= this._numberToString.length ${this._numberToString.length}`);return this._numberToString[s]}}class Ag{constructor(s,u,f,_,x){this.type="Feature",this._vectorTileFeature=s,s._z=u,s._x=f,s._y=_,this.properties=s.properties,this.id=x}get geometry(){return void 0===this._geometry&&(this._geometry=this._vectorTileFeature.toGeoJSON(this._vectorTileFeature._x,this._vectorTileFeature._y,this._vectorTileFeature._z).geometry),this._geometry}set geometry(s){this._geometry=s}toJSON(){const s={geometry:this.geometry};for(const u in this)"_geometry"!==u&&"_vectorTileFeature"!==u&&(s[u]=this[u]);return s}}class Hd{constructor(s,u){this.tileID=s,this.x=s.canonical.x,this.y=s.canonical.y,this.z=s.canonical.z,this.grid=new $s(_n,16,0),this.grid3D=new $s(_n,16,0),this.featureIndexArray=new Pr,this.promoteId=u}insert(s,u,f,_,x,C){const M=this.featureIndexArray.length;this.featureIndexArray.emplaceBack(f,_,x);const A=C?this.grid3D:this.grid;for(let F=0;F=0&&B[3]>=0&&A.insert(M,B[0],B[1],B[2],B[3])}}loadVTLayers(){return this.vtLayers||(this.vtLayers=new Ql.VectorTile(new cg(this.rawTileData)).layers,this.sourceLayerCoder=new yp(this.vtLayers?Object.keys(this.vtLayers).sort():["_geojsonTileLayer"])),this.vtLayers}query(s,u,f,_){this.loadVTLayers();const x=s.params||{},C=_n/s.tileSize/s.scale,M=Lt(x.filter),A=s.queryGeometry,F=s.queryPadding*C,O=kg(A),B=this.grid.query(O.minX-F,O.minY-F,O.maxX+F,O.maxY+F),H=kg(s.cameraQueryGeometry),q=this.grid3D.query(H.minX-F,H.minY-F,H.maxX+F,H.maxY+F,(oe,be,Ce,me)=>function(Ee,$e,Ve,gt,Ct){for(const tt of Ee)if($e<=tt.x&&Ve<=tt.y&>>=tt.x&&Ct>=tt.y)return!0;const at=[new Tt($e,Ve),new Tt($e,Ct),new Tt(gt,Ct),new Tt(gt,Ve)];if(Ee.length>2)for(const tt of at)if(qi(Ee,tt))return!0;for(let tt=0;tt(me||(me=vr(Ee)),$e.queryIntersectsFeature(A,Ee,Ve,me,this.z,s.transform,C,s.pixelPosMatrix)))}return W}loadMatchingFeature(s,u,f,_,x,C,M,A,F,O,B){const H=this.bucketLayerIDs[u];if(C&&!function(oe,be){for(let Ce=0;Ce=0)return!0;return!1}(C,H))return;const q=this.sourceLayerCoder.decode(f),W=this.vtLayers[q].feature(_);if(x.needGeometry){const oe=li(W,!0);if(!x.filter(new cr(this.tileID.overscaledZ),oe,this.tileID.canonical))return}else if(!x.filter(new cr(this.tileID.overscaledZ),W))return;const se=this.getId(W,q);for(let oe=0;oe{const M=s instanceof _s?s.get(C):null;return M&&M.evaluate?M.evaluate(u,f,_):M})}function kg(l){let s=1/0,u=1/0,f=-1/0,_=-1/0;for(const x of l)s=Math.min(s,x.x),u=Math.min(u,x.y),f=Math.max(f,x.x),_=Math.max(_,x.y);return{minX:s,minY:u,maxX:f,maxY:_}}function Pg(l,s){return s-l}function qd(l,s,u,f,_,x){if(_-f<=u)return;const C=f+_>>1;_p(l,s,C,f,_,x%2),qd(l,s,u,f,C-1,x+1),qd(l,s,u,C+1,_,x+1)}function _p(l,s,u,f,_,x){for(;_>f;){if(_-f>600){const F=_-f+1,O=u-f+1,B=Math.log(F),H=.5*Math.exp(2*B/3),q=.5*Math.sqrt(B*H*(F-H)/F)*(O-F/2<0?-1:1);_p(l,s,u,Math.max(f,Math.floor(u-O*H/F+q)),Math.min(_,Math.floor(u+(F-O)*H/F+q)),x)}const C=s[2*u+x];let M=f,A=_;for(al(l,s,f,u),s[2*_+x]>C&&al(l,s,f,_);MC;)A--}s[2*f+x]===C?al(l,s,f,A):(A++,al(l,s,A,_)),A<=u&&(f=A+1),u<=A&&(_=A-1)}}function al(l,s,u,f){Rg(l,u,f),Rg(s,2*u,2*f),Rg(s,2*u+1,2*f+1)}function Rg(l,s,u){const f=l[s];l[s]=l[u],l[u]=f}function Fg(l,s,u,f){const _=l-u,x=s-f;return _*_+x*x}ct("FeatureIndex",Hd,{omit:["rawTileData","sourceLayerCoder"]});const k1=l=>l[0],P1=l=>l[1];var vp;b.PerformanceMarkers=void 0,(vp=b.PerformanceMarkers||(b.PerformanceMarkers={})).create="create",vp.load="load",vp.fullLoad="fullLoad";let xh=null,sc=[];const Zd=1e3/30,Jc={mark(l){performance.mark(l)},frame(l){const s=l;null!=xh&&sc.push(s-xh),xh=s},clearMetrics(){xh=null,sc=[],performance.clearMeasures("loadTime"),performance.clearMeasures("fullLoadTime");for(const l in b.PerformanceMarkers)performance.clearMarks(b.PerformanceMarkers[l])},getPerformanceMetrics(){performance.measure("loadTime",b.PerformanceMarkers.create,b.PerformanceMarkers.load),performance.measure("fullLoadTime",b.PerformanceMarkers.create,b.PerformanceMarkers.fullLoad);const l=performance.getEntriesByName("loadTime")[0].duration,s=performance.getEntriesByName("fullLoadTime")[0].duration,u=sc.length,f=1/(sc.reduce((x,C)=>x+C,0)/u/1e3),_=sc.filter(x=>x>Zd).reduce((x,C)=>x+(C-Zd)/Zd,0);return{loadTime:l,fullLoadTime:s,fps:f,percentDroppedFrames:_/(u+_)*100}}};b.AJAXError=Ns,b.ARRAY_TYPE=nl,b.Actor=class{constructor(l,s,u){this.target=l,this.parent=s,this.mapId=u,this.callbacks={},this.tasks={},this.taskQueue=[],this.cancelCallbacks={},Os(["receive","process"],this),this.invoker=new sv(this.process),this.target.addEventListener("message",this.receive,!1),this.globalScope=Mo()?l:window}send(l,s,u,f,_=!1){const x=Math.round(1e18*Math.random()).toString(36).substring(0,10);u&&(this.callbacks[x]=u);const C=Ls(this.globalScope)?void 0:[];return this.target.postMessage({id:x,type:l,hasCallback:!!u,targetMapId:f,mustQueue:_,sourceMapId:this.mapId,data:uo(s,C)},C),{cancel:()=>{u&&delete this.callbacks[x],this.target.postMessage({id:x,type:"",targetMapId:f,sourceMapId:this.mapId})}}}receive(l){const s=l.data,u=s.id;if(u&&(!s.targetMapId||this.mapId===s.targetMapId))if(""===s.type){delete this.tasks[u];const f=this.cancelCallbacks[u];delete this.cancelCallbacks[u],f&&f()}else Mo()||s.mustQueue?(this.tasks[u]=s,this.taskQueue.push(u),this.invoker.trigger()):this.processTask(u,s)}process(){if(!this.taskQueue.length)return;const l=this.taskQueue.shift(),s=this.tasks[l];delete this.tasks[l],this.taskQueue.length&&this.invoker.trigger(),s&&this.processTask(l,s)}processTask(l,s){if(""===s.type){const u=this.callbacks[l];delete this.callbacks[l],u&&(s.error?u(Er(s.error)):u(null,Er(s.data)))}else{let u=!1;const f=Ls(this.globalScope)?void 0:[],_=s.hasCallback?(M,A)=>{u=!0,delete this.cancelCallbacks[l],this.target.postMessage({id:l,type:"",sourceMapId:this.mapId,error:M?uo(M):null,data:uo(A,f)},f)}:M=>{u=!0};let x=null;const C=Er(s.data);if(this.parent[s.type])x=this.parent[s.type](s.sourceMapId,C,_);else if(this.parent.getWorkerSource){const M=s.type.split(".");x=this.parent.getWorkerSource(s.sourceMapId,M[0],C.source)[M[1]](C,_)}else _(new Error(`Could not find function ${s.type}`));!u&&x&&x.cancel&&(this.cancelCallbacks[l]=x.cancel)}}remove(){this.invoker.remove(),this.target.removeEventListener("message",this.receive,!1)}},b.AlphaImage=uh,b.CanonicalTileID=vh,b.CollisionBoxArray=bd,b.CollisionCircleLayoutArray=class extends yd{},b.Color=Sn,b.DEMData=Tg,b.DataConstantProperty=wt,b.DictionaryCoder=yp,b.EXTENT=_n,b.ErrorEvent=mr,b.EvaluationParameters=cr,b.Event=ra,b.Evented=Qn,b.FeatureIndex=Hd,b.FillBucket=go,b.FillExtrusionBucket=ig,b.GeoJSONFeature=Ag,b.ImageAtlas=_1,b.ImagePosition=Z_,b.KDBush=class{constructor(l,s=k1,u=P1,f=64,_=Float64Array){this.nodeSize=f,this.points=l;const x=l.length<65536?Uint16Array:Uint32Array,C=this.ids=new x(l.length),M=this.coords=new _(2*l.length);for(let A=0;A=C&&q<=A&&W>=M&&W<=F&&H.push(_[Ee]);continue}const Ce=Math.floor((be+oe)/2);q=x[2*Ce],W=x[2*Ce+1],q>=C&&q<=A&&W>=M&&W<=F&&H.push(_[Ce]);const me=(se+1)%2;(0===se?C<=q:M<=W)&&(B.push(be),B.push(Ce-1),B.push(me)),(0===se?A>=q:F>=W)&&(B.push(Ce+1),B.push(oe),B.push(me))}return H}(this.ids,this.coords,l,s,u,f,this.nodeSize)}within(l,s,u){return function(f,_,x,C,M,A){const F=[0,f.length-1,0],O=[],B=M*M;for(;F.length;){const H=F.pop(),q=F.pop(),W=F.pop();if(q-W<=A){for(let me=W;me<=q;me++)Fg(_[2*me],_[2*me+1],x,C)<=B&&O.push(f[me]);continue}const se=Math.floor((W+q)/2),oe=_[2*se],be=_[2*se+1];Fg(oe,be,x,C)<=B&&O.push(f[se]);const Ce=(H+1)%2;(0===H?x-M<=oe:C-M<=be)&&(F.push(W),F.push(se-1),F.push(Ce)),(0===H?x+M>=oe:C+M>=be)&&(F.push(se+1),F.push(q),F.push(Ce))}return O}(this.ids,this.coords,l,s,u,this.nodeSize)}},b.LineBucket=sg,b.LineStripIndexArray=class extends _d{},b.LngLat=br,b.LngLatBounds=av,b.MercatorCoordinate=gp,b.ONE_EM=24,b.OverscaledTileID=Lo,b.PerformanceUtils=Jc,b.Pos3dArray=class extends Ju{},b.PosArray=ih,b.Properties=Di,b.QuadTriangleArray=class extends th{},b.RGBAImage=Oo,b.RasterBoundsArray=class extends Hc{},b.RequestPerformance=class{constructor(l){this._marks={start:[l.url,"start"].join("#"),end:[l.url,"end"].join("#"),measure:l.url.toString()},performance.mark(this._marks.start)}finish(){performance.mark(this._marks.end);let l=performance.getEntriesByName(this._marks.measure);return 0===l.length&&(performance.measure(this._marks.measure,this._marks.start,this._marks.end),l=performance.getEntriesByName(this._marks.measure),performance.clearMarks(this._marks.start),performance.clearMarks(this._marks.end),performance.clearMeasures(this._marks.measure)),l}},b.SegmentVector=R,b.SymbolBucket=rc,b.Transitionable=Xu,b.TriangleIndexArray=w,b.Uniform1f=ke,b.Uniform1i=class extends Se{constructor(l,s){super(l,s),this.current=0}set(l){this.current!==l&&(this.current=l,this.gl.uniform1i(this.location,l))}},b.Uniform2f=class extends Se{constructor(l,s){super(l,s),this.current=[0,0]}set(l){l[0]===this.current[0]&&l[1]===this.current[1]||(this.current=l,this.gl.uniform2f(this.location,l[0],l[1]))}},b.Uniform3f=class extends Se{constructor(l,s){super(l,s),this.current=[0,0,0]}set(l){l[0]===this.current[0]&&l[1]===this.current[1]&&l[2]===this.current[2]||(this.current=l,this.gl.uniform3f(this.location,l[0],l[1],l[2]))}},b.Uniform4f=Be,b.UniformColor=Le,b.UniformMatrix4f=class extends Se{constructor(l,s){super(l,s),this.current=Ne}set(l){if(l[12]!==this.current[12]||l[0]!==this.current[0])return this.current=l,void this.gl.uniformMatrix4fv(this.location,!1,l);for(let s=1;s<16;s++)if(l[s]!==this.current[s]){this.current=l,this.gl.uniformMatrix4fv(this.location,!1,l);break}}},b.UnwrappedTileID=cv,b.ValidationError=Pe,b.ZoomHistory=zf,b.addDynamicAttributes=$d,b.arrayBufferToImage=function(l,s){const u=new Image;u.onload=()=>{s(null,u),URL.revokeObjectURL(u.src),u.onload=null,window.requestAnimationFrame(()=>{u.src=Oa})},u.onerror=()=>s(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 f=new Blob([new Uint8Array(l)],{type:"image/png"});u.src=l.byteLength?URL.createObjectURL(f):Oa},b.arrayBufferToImageBitmap=function(l,s){const u=new Blob([new Uint8Array(l)],{type:"image/png"});createImageBitmap(u).then(f=>{s(null,f)}).catch(f=>{s(new Error(`Could not load image because of ${f.message}. Please make sure to use a supported image type such as PNG or JPEG. Note that SVGs are not supported.`))})},b.asyncAll=function(l,s,u){if(!l.length)return u(null,[]);let f=l.length;const _=new Array(l.length);let x=null;l.forEach((C,M)=>{s(C,(A,F)=>{A&&(x=A),_[M]=F,0==--f&&u(x,_)})})},b.bezier=us,b.bindAll=Os,b.clamp=Zt,b.clipLine=bg,b.clone=function(l){var s=new nl(16);return s[0]=l[0],s[1]=l[1],s[2]=l[2],s[3]=l[3],s[4]=l[4],s[5]=l[5],s[6]=l[6],s[7]=l[7],s[8]=l[8],s[9]=l[9],s[10]=l[10],s[11]=l[11],s[12]=l[12],s[13]=l[13],s[14]=l[14],s[15]=l[15],s},b.clone$1=wi,b.collisionCircleLayout=lg,b.config=La,b.copy=function(l,s){return l[0]=s[0],l[1]=s[1],l[2]=s[2],l[3]=s[3],l[4]=s[4],l[5]=s[5],l[6]=s[6],l[7]=s[7],l[8]=s[8],l[9]=s[9],l[10]=s[10],l[11]=s[11],l[12]=s[12],l[13]=s[13],l[14]=s[14],l[15]=s[15],l},b.create=function(){var l=new nl(16);return nl!=Float32Array&&(l[1]=0,l[2]=0,l[3]=0,l[4]=0,l[6]=0,l[7]=0,l[8]=0,l[9]=0,l[11]=0,l[12]=0,l[13]=0,l[14]=0),l[0]=1,l[5]=1,l[10]=1,l[15]=1,l},b.createExpression=Za,b.createFilter=Lt,b.createLayout=Dr,b.createStyleLayer=function(l){return"custom"===l.type?new I1(l):new T1[l.type](l)},b.dot=function(l,s){return l[0]*s[0]+l[1]*s[1]+l[2]*s[2]+l[3]*s[3]},b.earthRadius=jd,b.ease=Pl,b.emitValidationErrors=ld,b.equals=function(l,s){var u=l[0],f=l[1],_=l[2],x=l[3],C=l[4],M=l[5],A=l[6],F=l[7],O=l[8],B=l[9],H=l[10],q=l[11],W=l[12],se=l[13],oe=l[14],be=l[15],Ce=s[0],me=s[1],Ee=s[2],$e=s[3],Ve=s[4],gt=s[5],Ct=s[6],at=s[7],tt=s[8],Qe=s[9],ot=s[10],it=s[11],Ge=s[12],Et=s[13],pt=s[14],Yt=s[15];return Math.abs(u-Ce)<=Mr*Math.max(1,Math.abs(u),Math.abs(Ce))&&Math.abs(f-me)<=Mr*Math.max(1,Math.abs(f),Math.abs(me))&&Math.abs(_-Ee)<=Mr*Math.max(1,Math.abs(_),Math.abs(Ee))&&Math.abs(x-$e)<=Mr*Math.max(1,Math.abs(x),Math.abs($e))&&Math.abs(C-Ve)<=Mr*Math.max(1,Math.abs(C),Math.abs(Ve))&&Math.abs(M-gt)<=Mr*Math.max(1,Math.abs(M),Math.abs(gt))&&Math.abs(A-Ct)<=Mr*Math.max(1,Math.abs(A),Math.abs(Ct))&&Math.abs(F-at)<=Mr*Math.max(1,Math.abs(F),Math.abs(at))&&Math.abs(O-tt)<=Mr*Math.max(1,Math.abs(O),Math.abs(tt))&&Math.abs(B-Qe)<=Mr*Math.max(1,Math.abs(B),Math.abs(Qe))&&Math.abs(H-ot)<=Mr*Math.max(1,Math.abs(H),Math.abs(ot))&&Math.abs(q-it)<=Mr*Math.max(1,Math.abs(q),Math.abs(it))&&Math.abs(W-Ge)<=Mr*Math.max(1,Math.abs(W),Math.abs(Ge))&&Math.abs(se-Et)<=Mr*Math.max(1,Math.abs(se),Math.abs(Et))&&Math.abs(oe-pt)<=Mr*Math.max(1,Math.abs(oe),Math.abs(pt))&&Math.abs(be-Yt)<=Mr*Math.max(1,Math.abs(be),Math.abs(Yt))},b.evaluateSizeForFeature=function(l,{uSize:s,uSizeT:u},{lowerSize:f,upperSize:_}){return"source"===l.kind?f/ba:"composite"===l.kind?Xn(f/ba,_/ba,u):s},b.evaluateSizeForZoom=function(l,s){let u=0,f=0;if("constant"===l.kind)f=l.layoutSize;else if("source"!==l.kind){const{interpolationType:_,minZoom:x,maxZoom:C}=l,M=_?Zt(Io.interpolationFactor(_,s,x,C),0,1):0;"camera"===l.kind?f=Xn(l.minSize,l.maxSize,M):u=M}return{uSizeT:u,uSize:f}},b.evaluateVariableOffset=tv,b.evented=$f,b.exported=Pu,b.extend=Ni,b.filterObject=Rl,b.fromScaling=function(l,s){return l[0]=s[0],l[1]=0,l[2]=0,l[3]=0,l[4]=0,l[5]=s[1],l[6]=0,l[7]=0,l[8]=0,l[9]=0,l[10]=s[2],l[11]=0,l[12]=0,l[13]=0,l[14]=0,l[15]=1,l},b.getAnchorAlignment=Wi,b.getAnchorJustification=Vd,b.getArrayBuffer=Na,b.getJSON=function(l,s){return Fl(Ni(l,{type:"json"}),s)},b.getOverlapMode=Dg,b.getRTLTextPluginStatus=Gl,b.getReferrer=Nn,b.getVideo=function(l,s){const u=window.document.createElement("video");u.muted=!0,u.onloadstart=function(){s(null,u)};for(let f=0;f{}}},b.identity=Gf,b.invert=function(l,s){var u=s[0],f=s[1],_=s[2],x=s[3],C=s[4],M=s[5],A=s[6],F=s[7],O=s[8],B=s[9],H=s[10],q=s[11],W=s[12],se=s[13],oe=s[14],be=s[15],Ce=u*M-f*C,me=u*A-_*C,Ee=u*F-x*C,$e=f*A-_*M,Ve=f*F-x*M,gt=_*F-x*A,Ct=O*se-B*W,at=O*oe-H*W,tt=O*be-q*W,Qe=B*oe-H*se,ot=B*be-q*se,it=H*be-q*oe,Ge=Ce*it-me*ot+Ee*Qe+$e*tt-Ve*at+gt*Ct;return Ge?(l[0]=(M*it-A*ot+F*Qe)*(Ge=1/Ge),l[1]=(_*ot-f*it-x*Qe)*Ge,l[2]=(se*gt-oe*Ve+be*$e)*Ge,l[3]=(H*Ve-B*gt-q*$e)*Ge,l[4]=(A*tt-C*it-F*at)*Ge,l[5]=(u*it-_*tt+x*at)*Ge,l[6]=(oe*Ee-W*gt-be*me)*Ge,l[7]=(O*gt-H*Ee+q*me)*Ge,l[8]=(C*ot-M*tt+F*Ct)*Ge,l[9]=(f*tt-u*ot-x*Ct)*Ge,l[10]=(W*Ve-se*Ee+be*Ce)*Ge,l[11]=(B*Ee-O*Ve-q*Ce)*Ge,l[12]=(M*at-C*Qe-A*Ct)*Ge,l[13]=(u*Qe-f*at+_*Ct)*Ge,l[14]=(se*me-W*$e-oe*Ce)*Ge,l[15]=(O*$e-B*me+H*Ce)*Ge,l):null},b.isImageBitmap=ro,b.isSafari=Ls,b.isWorker=Mo,b.keysDifference=function(l,s){const u=[];for(const f in l)f in s||u.push(f);return u},b.lazyLoadRTLTextPlugin=function(){po.isLoading()||po.isLoaded()||"deferred"!==Gl()||Gm()},b.makeRequest=Fl,b.mapObject=Fa,b.mercatorXfromLng=Mg,b.mercatorYfromLat=oc,b.mercatorZfromAltitude=Ig,b.mul=_a,b.mul$1=function(l,s,u){return l[0]=s[0]*u[0],l[1]=s[1]*u[1],l[2]=s[2]*u[2],l[3]=s[3]*u[3],l},b.multiply=qm,b.nextPowerOfTwo=function(l){return l<=1?1:Math.pow(2,Math.ceil(Math.log(l)/Math.LN2))},b.number=Xn,b.ortho=function(l,s,u,f,_,x,C){var M=1/(s-u),A=1/(f-_),F=1/(x-C);return l[0]=-2*M,l[1]=0,l[2]=0,l[3]=0,l[4]=0,l[5]=-2*A,l[6]=0,l[7]=0,l[8]=0,l[9]=0,l[10]=2*F,l[11]=0,l[12]=(s+u)*M,l[13]=(_+f)*A,l[14]=(C+x)*F,l[15]=1,l},b.parseCacheControl=function(l){const s={};if(l.replace(/(?:^|(?:\s*\,\s*))([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)(?:\=(?:([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)|(?:\"((?:[^"\\]|\\.)*)\")))?/g,(u,f,_,x)=>{const C=_||x;return s[f]=!C||C.toLowerCase(),""}),s["max-age"]){const u=parseInt(s["max-age"],10);isNaN(u)?delete s["max-age"]:s["max-age"]=u}return s},b.parseGlyphPbf=function(l){return new cg(l).readFields(P2,[])},b.pbf=cg,b.performSymbolLayout=function(l){l.bucket.createArrays(),l.bucket.tilePixelRatio=_n/(512*l.bucket.overscaling),l.bucket.compareText={},l.bucket.iconsNeedLinear=!1;const s=l.bucket.layers[0].layout,u=l.bucket.layers[0]._unevaluatedLayout._values,f={layoutIconSize:u["icon-size"].possiblyEvaluate(new cr(l.bucket.zoom+1),l.canonical),layoutTextSize:u["text-size"].possiblyEvaluate(new cr(l.bucket.zoom+1),l.canonical),textMaxSize:u["text-size"].possiblyEvaluate(new cr(18))};if("composite"===l.bucket.textSizeData.kind){const{minZoom:A,maxZoom:F}=l.bucket.textSizeData;f.compositeTextSizes=[u["text-size"].possiblyEvaluate(new cr(A),l.canonical),u["text-size"].possiblyEvaluate(new cr(F),l.canonical)]}if("composite"===l.bucket.iconSizeData.kind){const{minZoom:A,maxZoom:F}=l.bucket.iconSizeData;f.compositeIconSizes=[u["icon-size"].possiblyEvaluate(new cr(A),l.canonical),u["icon-size"].possiblyEvaluate(new cr(F),l.canonical)]}const _=24*s.get("text-line-height"),x="viewport"!==s.get("text-rotation-alignment")&&"point"!==s.get("symbol-placement"),C=s.get("text-keep-upright"),M=s.get("text-size");for(const A of l.bucket.features){const F=s.get("text-font").evaluate(A,{},l.canonical).join(","),O=M.evaluate(A,{},l.canonical),B=f.layoutTextSize.evaluate(A,{},l.canonical),H=f.layoutIconSize.evaluate(A,{},l.canonical),q={horizontal:{},vertical:void 0},W=A.text;let se,oe=[0,0];if(W){const me=W.toString(),Ee=24*s.get("text-letter-spacing").evaluate(A,{},l.canonical),$e=cd(me)?Ee:0,Ve=s.get("text-anchor").evaluate(A,{},l.canonical),gt=s.get("text-variable-anchor");if(!gt){const ot=s.get("text-radial-offset").evaluate(A,{},l.canonical);oe=ot?tv(Ve,[24*ot,xg]):s.get("text-offset").evaluate(A,{},l.canonical).map(it=>24*it)}let Ct=x?"center":s.get("text-justify").evaluate(A,{},l.canonical);const at=s.get("symbol-placement"),tt="point"===at?24*s.get("text-max-width").evaluate(A,{},l.canonical):0,Qe=()=>{l.bucket.allowVerticalPlacement&&ho(me)&&(q.vertical=fg(W,l.glyphMap,l.glyphPositions,l.imagePositions,F,tt,_,Ve,"left",$e,oe,b.WritingMode.vertical,!0,at,B,O))};if(!x&>){const ot="auto"===Ct?gt.map(Ge=>Vd(Ge)):[Ct];let it=!1;for(let Ge=0;Gethis._layers[je.id]),ge=ce[0];if("none"===ge.visibility)continue;const he=ge.source||"";let ue=this.familiesBySource[he];ue||(ue=this.familiesBySource[he]={});const xe=ge.sourceLayer||"_geojsonTileLayer";let Me=ue[xe];Me||(Me=ue[xe]=[]),Me.push(ce)}}}class Pl{constructor(V){const $={},K=[];for(const he in V){const ue=V[he],xe=$[he]={};for(const Me in ue){const je=ue[+Me];if(!je||0===je.bitmap.width||0===je.bitmap.height)continue;const Ie={x:0,y:0,w:je.bitmap.width+2,h:je.bitmap.height+2};K.push(Ie),xe[Me]={rect:Ie,metrics:je.metrics}}}const{w:te,h:ce}=b.potpack(K),ge=new b.AlphaImage({width:te||1,height:ce||1});for(const he in V){const ue=V[he];for(const xe in ue){const Me=ue[+xe];if(!Me||0===Me.bitmap.width||0===Me.bitmap.height)continue;const je=$[he][xe].rect;b.AlphaImage.copy(Me.bitmap,ge,{x:0,y:0},{x:je.x+1,y:je.y+1},Me.bitmap)}}this.image=ge,this.positions=$}}b.register("GlyphAtlas",Pl);class Zt{constructor(V){this.tileID=new b.OverscaledTileID(V.tileID.overscaledZ,V.tileID.wrap,V.tileID.canonical.z,V.tileID.canonical.x,V.tileID.canonical.y),this.uid=V.uid,this.zoom=V.zoom,this.pixelRatio=V.pixelRatio,this.tileSize=V.tileSize,this.source=V.source,this.overscaling=this.tileID.overscaleFactor(),this.showCollisionBoxes=V.showCollisionBoxes,this.collectResourceTiming=!!V.collectResourceTiming,this.returnDependencies=!!V.returnDependencies,this.promoteId=V.promoteId}parse(V,$,K,te,ce){this.status="parsing",this.data=V,this.collisionBoxArray=new b.CollisionBoxArray;const ge=new b.DictionaryCoder(Object.keys(V.layers).sort()),he=new b.FeatureIndex(this.tileID,this.promoteId);he.bucketLayerIDs=[];const ue={},xe={featureIndex:he,iconDependencies:{},patternDependencies:{},glyphDependencies:{},availableImages:K},Me=$.familiesBySource[this.source];for(const nn in Me){const an=V.layers[nn];if(!an)continue;1===an.version&&b.warnOnce(`Vector tile source "${this.source}" layer "${nn}" does not use vector tile spec v2 and therefore may have some rendering errors.`);const qn=ge.encode(nn),sr=[];for(let si=0;si=kr.maxzoom||"none"!==kr.visibility&&(Te(si,this.zoom,K),(ue[kr.id]=kr.createBucket({index:he.bucketLayerIDs.length,layers:si,zoom:this.zoom,pixelRatio:this.pixelRatio,overscaling:this.overscaling,collisionBoxArray:this.collisionBoxArray,sourceLayerIndex:qn,sourceID:this.source})).populate(sr,xe,this.tileID.canonical),he.bucketLayerIDs.push(si.map($a=>$a.id)))}}let je,Ie,Dt,dt;const ft=b.mapObject(xe.glyphDependencies,nn=>Object.keys(nn).map(Number));Object.keys(ft).length?te.send("getGlyphs",{uid:this.uid,stacks:ft,source:this.source,tileID:this.tileID,type:"glyphs"},(nn,an)=>{je||(je=nn,Ie=an,Gn.call(this))}):Ie={};const xt=Object.keys(xe.iconDependencies);xt.length?te.send("getImages",{icons:xt,source:this.source,tileID:this.tileID,type:"icons"},(nn,an)=>{je||(je=nn,Dt=an,Gn.call(this))}):Dt={};const ln=Object.keys(xe.patternDependencies);function Gn(){if(je)return ce(je);if(Ie&&Dt&&dt){const nn=new Pl(Ie),an=new b.ImageAtlas(Dt,dt);for(const qn in ue){const sr=ue[qn];sr instanceof b.SymbolBucket?(Te(sr.layers,this.zoom,K),b.performSymbolLayout({bucket:sr,glyphMap:Ie,glyphPositions:nn.positions,imageMap:Dt,imagePositions:an.iconPositions,showCollisionBoxes:this.showCollisionBoxes,canonical:this.tileID.canonical})):sr.hasPattern&&(sr instanceof b.LineBucket||sr instanceof b.FillBucket||sr instanceof b.FillExtrusionBucket)&&(Te(sr.layers,this.zoom,K),sr.addFeatures(xe,this.tileID.canonical,an.patternPositions))}this.status="done",ce(null,{buckets:Object.values(ue).filter(qn=>!qn.isEmpty()),featureIndex:he,collisionBoxArray:this.collisionBoxArray,glyphAtlasImage:nn.image,imageAtlas:an,glyphMap:this.returnDependencies?Ie:null,iconMap:this.returnDependencies?Dt:null,glyphPositions:this.returnDependencies?nn.positions:null})}}ln.length?te.send("getImages",{icons:ln,source:this.source,tileID:this.tileID,type:"patterns"},(nn,an)=>{je||(je=nn,dt=an,Gn.call(this))}):dt={},Gn.call(this)}}function Te(J,V,$){const K=new b.EvaluationParameters(V);for(const te of J)te.recalculate(K,$)}function Ni(J,V){const $=b.getArrayBuffer(J.request,(K,te,ce,ge)=>{K?V(K):te&&V(null,{vectorTile:new b.vectorTile.VectorTile(new b.pbf(te)),rawData:te,cacheControl:ce,expires:ge})});return()=>{$.cancel(),V()}}class Fs{constructor(V,$,K,te){this.actor=V,this.layerIndex=$,this.availableImages=K,this.loadVectorData=te||Ni,this.loading={},this.loaded={}}loadTile(V,$){const K=V.uid;this.loading||(this.loading={});const te=!!(V&&V.request&&V.request.collectResourceTiming)&&new b.RequestPerformance(V.request),ce=this.loading[K]=new Zt(V);ce.abort=this.loadVectorData(V,(ge,he)=>{if(delete this.loading[K],ge||!he)return ce.status="done",this.loaded[K]=ce,$(ge);const ue=he.rawData,xe={};he.expires&&(xe.expires=he.expires),he.cacheControl&&(xe.cacheControl=he.cacheControl);const Me={};if(te){const je=te.finish();je&&(Me.resourceTiming=JSON.parse(JSON.stringify(je)))}ce.vectorTile=he.vectorTile,ce.parse(he.vectorTile,this.layerIndex,this.availableImages,this.actor,(je,Ie)=>{if(je||!Ie)return $(je);$(null,b.extend({rawTileData:ue.slice(0)},Ie,xe,Me))}),this.loaded=this.loaded||{},this.loaded[K]=ce})}reloadTile(V,$){const K=this.loaded,te=V.uid,ce=this;if(K&&K[te]){const ge=K[te];ge.showCollisionBoxes=V.showCollisionBoxes;const he=(ue,xe)=>{const Me=ge.reloadCallback;Me&&(delete ge.reloadCallback,ge.parse(ge.vectorTile,ce.layerIndex,this.availableImages,ce.actor,Me)),$(ue,xe)};"parsing"===ge.status?ge.reloadCallback=he:"done"===ge.status&&(ge.vectorTile?ge.parse(ge.vectorTile,this.layerIndex,this.availableImages,this.actor,he):he())}}abortTile(V,$){const K=this.loading,te=V.uid;K&&K[te]&&K[te].abort&&(K[te].abort(),delete K[te]),$()}removeTile(V,$){const K=this.loaded,te=V.uid;K&&K[te]&&delete K[te],$()}}class Os{constructor(){this.loaded={}}loadTile(V,$){const{uid:K,encoding:te,rawImageData:ce}=V,ge=b.isImageBitmap(ce)?this.getImageData(ce):ce,he=new b.DEMData(K,ge,te);this.loaded=this.loaded||{},this.loaded[K]=he,$(null,he)}getImageData(V){this.offscreenCanvas&&this.offscreenCanvasContext||(this.offscreenCanvas=new OffscreenCanvas(V.width,V.height),this.offscreenCanvasContext=this.offscreenCanvas.getContext("2d",{willReadFrequently:!0})),this.offscreenCanvas.width=V.width,this.offscreenCanvas.height=V.height,this.offscreenCanvasContext.drawImage(V,0,0,V.width,V.height);const $=this.offscreenCanvasContext.getImageData(-1,-1,V.width+2,V.height+2);return this.offscreenCanvasContext.clearRect(0,0,this.offscreenCanvas.width,this.offscreenCanvas.height),new b.RGBAImage({width:$.width,height:$.height},$.data)}removeTile(V){const $=this.loaded,K=V.uid;$&&$[K]&&delete $[K]}}var Fa=function J(V,$){var K,te=V&&V.type;if("FeatureCollection"===te)for(K=0;K=Math.abs(he)?$-ue+he:he-ue+$,$=ue}$+K>=0!=!!V&&J.reverse()}const no=b.vectorTile.VectorTileFeature.prototype.toGeoJSON;var pn={},ii={get exports(){return pn},set exports(J){pn=J}},kc=b.pointGeometry,Mo=b.vectorTile.VectorTileFeature,na=Ls;function Ls(J,V){this.options=V||{},this.features=J,this.length=J.length}function ro(J,V){this.id="number"==typeof J.id?J.id:void 0,this.type=J.type,this.rawGeometry=1===J.type?[J.geometry]:J.geometry,this.properties=J.tags,this.extent=V||4096}Ls.prototype.feature=function(J){return new ro(this.features[J],this.options.extent)},ro.prototype.loadGeometry=function(){var J=this.rawGeometry;this.geometry=[];for(var V=0;V>31}function Nn(J,V){for(var $=J.loadGeometry(),K=J.type,te=0,ce=0,ge=$.length,he=0;heJ},Na=Math.fround||(Rc=new Float32Array(1),J=>(Rc[0]=+J,Rc[0]));var Rc;class oi{constructor(V){this.options=zi(Object.create(Fl),V),this.trees=new Array(this.options.maxZoom+1)}load(V){const{log:$,minZoom:K,maxZoom:te,nodeSize:ce}=this.options;$&&console.time("total time");const ge=`prepare ${V.length} points`;$&&console.time(ge),this.points=V;let he=[];for(let ue=0;ue=K;ue--){const xe=+Date.now();he=this._cluster(he,ue),this.trees[ue]=new b.KDBush(he,Vn,ds,ce,Float32Array),$&&console.log("z%d: %d clusters in %dms",ue,he.length,+Date.now()-xe)}return $&&console.timeEnd("total time"),this}getClusters(V,$){let K=((V[0]+180)%360+360)%360-180;const te=Math.max(-90,Math.min(90,V[1]));let ce=180===V[2]?180:((V[2]+180)%360+360)%360-180;const ge=Math.max(-90,Math.min(90,V[3]));if(V[2]-V[0]>=360)K=-180,ce=180;else if(K>ce){const Me=this.getClusters([K,te,180,ge],$),je=this.getClusters([-180,te,ce,ge],$);return Me.concat(je)}const he=this.trees[this._limitZoom($)],ue=he.range(Ae(K),Pe(ge),Ae(ce),Pe(te)),xe=[];for(const Me of ue){const je=he.points[Me];xe.push(je.numPoints?mr(je):this.points[je.index])}return xe}getChildren(V){const $=this._getOriginId(V),K=this._getOriginZoom(V),te="No cluster with the specified id.",ce=this.trees[K];if(!ce)throw new Error(te);const ge=ce.points[$];if(!ge)throw new Error(te);const he=this.options.radius/(this.options.extent*Math.pow(2,K-1)),ue=ce.within(ge.x,ge.y,he),xe=[];for(const Me of ue){const je=ce.points[Me];je.parentId===V&&xe.push(je.numPoints?mr(je):this.points[je.index])}if(0===xe.length)throw new Error(te);return xe}getLeaves(V,$,K){const te=[];return this._appendLeaves(te,V,$=$||10,K=K||0,0),te}getTile(V,$,K){const te=this.trees[this._limitZoom(V)],ce=Math.pow(2,V),{extent:ge,radius:he}=this.options,ue=he/ge,xe=(K-ue)/ce,Me=(K+1+ue)/ce,je={features:[]};return this._addTileFeatures(te.range(($-ue)/ce,xe,($+1+ue)/ce,Me),te.points,$,K,ce,je),0===$&&this._addTileFeatures(te.range(1-ue/ce,xe,1,Me),te.points,ce,K,ce,je),$===ce-1&&this._addTileFeatures(te.range(0,xe,ue/ce,Me),te.points,-1,K,ce,je),je.features.length?je:null}getClusterExpansionZoom(V){let $=this._getOriginZoom(V)-1;for(;$<=this.options.maxZoom;){const K=this.getChildren(V);if($++,1!==K.length)break;V=K[0].properties.cluster_id}return $}_appendLeaves(V,$,K,te,ce){const ge=this.getChildren($);for(const he of ge){const ue=he.properties;if(ue&&ue.cluster?ce+ue.point_count<=te?ce+=ue.point_count:ce=this._appendLeaves(V,ue.cluster_id,K,te,ce):ce$&&(dt+=xt.numPoints||1)}if(dt>Dt&&dt>=he){let ft=Me.x*Dt,xt=Me.y*Dt,ln=ge&&Dt>1?this._map(Me,!0):null;const Gn=(xe<<5)+($+1)+this.points.length;for(const nn of Ie){const an=je.points[nn];if(an.zoom<=$)continue;an.zoom=$;const qn=an.numPoints||1;ft+=an.x*qn,xt+=an.y*qn,an.parentId=Gn,ge&&(ln||(ln=this._map(Me,!0)),ge(ln,this._map(an)))}Me.parentId=Gn,K.push(za(ft/dt,xt/dt,Gn,dt,ln))}else if(K.push(Me),dt>1)for(const ft of Ie){const xt=je.points[ft];xt.zoom<=$||(xt.zoom=$,K.push(xt))}}return K}_getOriginId(V){return V-this.points.length>>5}_getOriginZoom(V){return(V-this.points.length)%32}_map(V,$){if(V.numPoints)return $?zi({},V.properties):V.properties;const K=this.points[V.index].properties,te=this.options.map(K);return $&&te===K?zi({},te):te}}function za(J,V,$,K,te){return{x:Na(J),y:Na(V),zoom:1/0,id:$,parentId:-1,numPoints:K,properties:te}}function ra(J,V){const[$,K]=J.geometry.coordinates;return{x:Na(Ae($)),y:Na(Pe(K)),zoom:1/0,index:V,parentId:-1}}function mr(J){return{type:"Feature",id:J.id,properties:Qn(J),geometry:{type:"Point",coordinates:[(V=J.x,360*(V-.5)),Ba(J.y)]}};var V}function Qn(J){const V=J.numPoints,$=V>=1e4?`${Math.round(V/1e3)}k`:V>=1e3?Math.round(V/100)/10+"k":V;return zi(zi({},J.properties),{cluster:!0,cluster_id:J.id,point_count:V,point_count_abbreviated:$})}function Ae(J){return J/360+.5}function Pe(J){const V=Math.sin(J*Math.PI/180),$=.5-.25*Math.log((1+V)/(1-V))/Math.PI;return $<0?0:$>1?1:$}function Ba(J){const V=(180-360*J)*Math.PI/180;return 360*Math.atan(Math.exp(V))/Math.PI-90}function zi(J,V){for(const $ in V)J[$]=V[$];return J}function Vn(J){return J.x}function ds(J){return J.y}function Bi(J,V,$,K){for(var te,ce=K,ge=$-V>>1,he=$-V,ue=J[V],xe=J[V+1],Me=J[$],je=J[$+1],Ie=V+3;Ie<$;Ie+=3){var Dt=Ol(J[Ie],J[Ie+1],ue,xe,Me,je);if(Dt>ce)te=Ie,ce=Dt;else if(Dt===ce){var dt=Math.abs(Ie-ge);dtK&&(te-V>3&&Bi(J,V,te,K),J[te+2]=ce,$-te>3&&Bi(J,te,$,K))}function Ol(J,V,$,K,te,ce){var ge=te-$,he=ce-K;if(0!==ge||0!==he){var ue=((J-$)*ge+(V-K)*he)/(ge*ge+he*he);ue>1?($=te,K=ce):ue>0&&($+=ge*ue,K+=he*ue)}return(ge=J-$)*ge+(he=V-K)*he}function fs(J,V,$,K){var te={id:void 0===J?null:J,type:V,geometry:$,tags:K,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0};return function(ce){var ge=ce.geometry,he=ce.type;if("Point"===he||"MultiPoint"===he||"LineString"===he)rt(ce,ge);else if("Polygon"===he||"MultiLineString"===he)for(var ue=0;ue0&&(ge+=K?(te*xe-ue*ce)/2:Math.sqrt(Math.pow(ue-te,2)+Math.pow(xe-ce,2))),te=ue,ce=xe}var Me=V.length-3;V[2]=1,Bi(V,0,Me,$),V[Me+2]=1,V.size=Math.abs(ge),V.start=0,V.end=V.size}function ps(J,V,$,K){for(var te=0;te1?1:$}function Ci(J,V,$,K,te,ce,ge,he){if(K/=V,ce>=($/=V)&&ge=K)return null;for(var ue=[],xe=0;xe=$&&dt=K)){var ft=[];if("Point"===Ie||"MultiPoint"===Ie)ia(je,ft,$,K,te);else if("LineString"===Ie)oo(je,ft,$,K,te,!1,he.lineMetrics);else if("MultiLineString"===Ie)zn(je,ft,$,K,te,!1);else if("Polygon"===Ie)zn(je,ft,$,K,te,!0);else if("MultiPolygon"===Ie)for(var xt=0;xt=$&&ge<=K&&(V.push(J[ce]),V.push(J[ce+1]),V.push(J[ce+2]))}}function oo(J,V,$,K,te,ce,ge){for(var he,ue,xe=Vi(J),Me=0===te?so:Ll,je=J.start,Ie=0;Ie$&&(ue=Me(xe,Dt,dt,xt,ln,$),ge&&(xe.start=je+he*ue)):Gn>K?nn=$&&(ue=Me(xe,Dt,dt,xt,ln,$),an=!0),nn>K&&Gn<=K&&(ue=Me(xe,Dt,dt,xt,ln,K),an=!0),!ce&&an&&(ge&&(xe.end=je+he*ue),V.push(xe),xe=Vi(J)),ge&&(je+=he)}var qn=J.length-3;Dt=J[qn],dt=J[qn+1],ft=J[qn+2],(Gn=0===te?Dt:dt)>=$&&Gn<=K&&Fc(xe,Dt,dt,ft),qn=xe.length-3,ce&&qn>=3&&(xe[qn]!==xe[0]||xe[qn+1]!==xe[1])&&Fc(xe,xe[0],xe[1],xe[2]),xe.length&&V.push(xe)}function Vi(J){var V=[];return V.size=J.size,V.start=J.start,V.end=J.end,V}function zn(J,V,$,K,te,ce){for(var ge=0;gege.maxX&&(ge.maxX=Me),je>ge.maxY&&(ge.maxY=je)}return ge}function sa(J,V,$,K){var te=V.geometry,ce=V.type,ge=[];if("Point"===ce||"MultiPoint"===ce)for(var he=0;he0&&V.size<(te?ge:K))$.numPoints+=V.length/3;else{for(var he=[],ue=0;uege)&&($.numSimplified++,he.push(V[ue]),he.push(V[ue+1])),$.numPoints++;te&&function(xe,Me){for(var je=0,Ie=0,Dt=xe.length,dt=Dt-2;Ie0===Me)for(Ie=0,Dt=xe.length;Ie
24)throw new Error("maxZoom should be in the 0-24 range");if(V.promoteId&&V.generateId)throw new Error("promoteId and generateId cannot be used together.");var te,ce,ge,he,ue,xe,K=function(te,ce){var ge=[];if("FeatureCollection"===te.type)for(var he=0;he1&&console.time("creation"),Ie=this.tiles[je]=Ru(J,V,$,K,ue),this.tileCoords.push({z:V,x:$,y:K}),xe)){xe>1&&(console.log("tile z%d-%d-%d (features: %d, points: %d, simplified: %d)",V,$,K,Ie.numFeatures,Ie.numPoints,Ie.numSimplified),console.timeEnd("creation"));var Dt="z"+V;this.stats[Dt]=(this.stats[Dt]||0)+1,this.total++}if(Ie.source=J,te){if(V===ue.maxZoom||V===te)continue;var dt=1<1&&console.time("clipping");var ft,xt,ln,Gn,nn,an,qn=.5*ue.buffer/ue.extent,sr=.5-qn,si=.5+qn,kr=1+qn;ft=xt=ln=Gn=null,nn=Ci(J,Me,$-qn,$+si,0,Ie.minX,Ie.maxX,ue),an=Ci(J,Me,$+sr,$+kr,0,Ie.minX,Ie.maxX,ue),J=null,nn&&(ft=Ci(nn,Me,K-qn,K+si,1,Ie.minY,Ie.maxY,ue),xt=Ci(nn,Me,K+sr,K+kr,1,Ie.minY,Ie.maxY,ue),nn=null),an&&(ln=Ci(an,Me,K-qn,K+si,1,Ie.minY,Ie.maxY,ue),Gn=Ci(an,Me,K+sr,K+kr,1,Ie.minY,Ie.maxY,ue),an=null),xe>1&&console.timeEnd("clipping"),he.push(ft||[],V+1,2*$,2*K),he.push(xt||[],V+1,2*$,2*K+1),he.push(ln||[],V+1,2*$+1,2*K),he.push(Gn||[],V+1,2*$+1,2*K+1)}}},Sn.prototype.getTile=function(J,V,$){var K=this.options,te=K.extent,ce=K.debug;if(J<0||J>24)return null;var ge=1<1&&console.log("drilling down to z%d-%d-%d",J,V,$);for(var ue,xe=J,Me=V,je=$;!ue&&xe>0;)xe--,Me=Math.floor(Me/2),je=Math.floor(je/2),ue=this.tiles[Nl(xe,Me,je)];return ue&&ue.source?(ce>1&&console.log("found parent tile z%d-%d-%d",xe,Me,je),ce>1&&console.time("drilling down"),this.splitTile(ue.source,xe,Me,je,J,V,$),ce>1&&console.timeEnd("drilling down"),this.tiles[he]?Oc(this.tiles[he],te):null):null};class mi extends Fs{constructor(V,$,K,te){super(V,$,K,pi),this._dataUpdateable=new Map,this.loadGeoJSON=(ce,ge)=>{const{promoteId:he}=ce;if(ce.request)return b.getJSON(ce.request,(ue,xe,Me,je)=>{this._dataUpdateable=Zr(xe,he)?Vr(xe,he):void 0,ge(ue,xe,Me,je)});if("string"==typeof ce.data)try{const ue=JSON.parse(ce.data);this._dataUpdateable=Zr(ue,he)?Vr(ue,he):void 0,ge(null,ue)}catch{ge(new Error(`Input data given to '${ce.source}' is not a valid GeoJSON object.`))}else ce.dataDiff?this._dataUpdateable?(function(ue,xe,Me){var je,Ie,Dt,dt;if(xe.removeAll&&ue.clear(),xe.remove)for(const ft of xe.remove)ue.delete(ft);if(xe.add)for(const ft of xe.add){const xt=ao(ft,Me);null!=xt&&ue.set(xt,ft)}if(xe.update)for(const ft of xe.update){let xt=ue.get(ft.id);if(null==xt)continue;const ln=!ft.removeAllProperties&&((null===(je=ft.removeProperties)||void 0===je?void 0:je.length)>0||(null===(Ie=ft.addOrUpdateProperties)||void 0===Ie?void 0:Ie.length)>0);if((ft.newGeometry||ft.removeAllProperties||ln)&&(xt={...xt},ue.set(ft.id,xt),ln&&(xt.properties={...xt.properties})),ft.newGeometry&&(xt.geometry=ft.newGeometry),ft.removeAllProperties)xt.properties={};else if((null===(Dt=ft.removeProperties)||void 0===Dt?void 0:Dt.length)>0)for(const Gn of ft.removeProperties)Object.prototype.hasOwnProperty.call(xt.properties,Gn)&&delete xt.properties[Gn];if((null===(dt=ft.addOrUpdateProperties)||void 0===dt?void 0:dt.length)>0)for(const{key:Gn,value:nn}of ft.addOrUpdateProperties)xt.properties[Gn]=nn}}(this._dataUpdateable,ce.dataDiff,he),ge(null,{type:"FeatureCollection",features:Array.from(this._dataUpdateable.values())})):ge(new Error(`Cannot update existing geojson data in ${ce.source}`)):ge(new Error(`Input data given to '${ce.source}' is not a valid GeoJSON object.`));return{cancel:()=>{}}},te&&(this.loadGeoJSON=te)}loadData(V,$){var K;null===(K=this._pendingRequest)||void 0===K||K.cancel(),this._pendingCallback&&this._pendingCallback(null,{abandoned:!0});const te=!!(V&&V.request&&V.request.collectResourceTiming)&&new b.RequestPerformance(V.request);this._pendingCallback=$,this._pendingRequest=this.loadGeoJSON(V,(ce,ge)=>{if(delete this._pendingCallback,delete this._pendingRequest,ce||!ge)return $(ce);if("object"!=typeof ge)return $(new Error(`Input data given to '${V.source}' is not a valid GeoJSON object.`));{Fa(ge,!0);try{if(V.filter){const ue=b.createExpression(V.filter,{type:"boolean","property-type":"data-driven",overridable:!1,transition:!1});if("error"===ue.result)throw new Error(ue.value.map(Me=>`${Me.key}: ${Me.message}`).join(", "));const xe=ge.features.filter(Me=>ue.value.evaluate({zoom:0},Me));ge={type:"FeatureCollection",features:xe}}this._geoJSONIndex=V.cluster?new oi(function({superclusterOptions:ue,clusterProperties:xe}){if(!xe||!ue)return ue;const Me={},je={},Ie={accumulated:null,zoom:0},Dt={properties:null},dt=Object.keys(xe);for(const ft of dt){const[xt,ln]=xe[ft],Gn=b.createExpression(ln),nn=b.createExpression("string"==typeof xt?[xt,["accumulated"],["get",ft]]:xt);Me[ft]=Gn.value,je[ft]=nn.value}return ue.map=ft=>{Dt.properties=ft;const xt={};for(const ln of dt)xt[ln]=Me[ln].evaluate(Ie,Dt);return xt},ue.reduce=(ft,xt)=>{Dt.properties=xt;for(const ln of dt)Ie.accumulated=ft[ln],ft[ln]=je[ln].evaluate(Ie,Dt)},ue}(V)).load(ge.features):new Sn(ue=ge,V.geojsonVtOptions)}catch(ue){return $(ue)}this.loaded={};const he={};if(te){const ue=te.finish();ue&&(he.resourceTiming={},he.resourceTiming[V.source]=JSON.parse(JSON.stringify(ue)))}$(null,he)}var ue})}reloadTile(V,$){const K=this.loaded;return K&&K[V.uid]?super.reloadTile(V,$):this.loadTile(V,$)}removeSource(V,$){this._pendingCallback&&this._pendingCallback(null,{abandoned:!0}),$()}getClusterExpansionZoom(V,$){try{$(null,this._geoJSONIndex.getClusterExpansionZoom(V.clusterId))}catch(K){$(K)}}getClusterChildren(V,$){try{$(null,this._geoJSONIndex.getChildren(V.clusterId))}catch(K){$(K)}}getClusterLeaves(V,$){try{$(null,this._geoJSONIndex.getLeaves(V.clusterId,V.limit,V.offset))}catch(K){$(K)}}}class Bs{constructor(V){this.self=V,this.actor=new b.Actor(V,this),this.layerIndexes={},this.availableImages={},this.workerSourceTypes={vector:Fs,geojson:mi},this.workerSources={},this.demWorkerSources={},this.self.registerWorkerSource=($,K)=>{if(this.workerSourceTypes[$])throw new Error(`Worker source with name "${$}" already registered.`);this.workerSourceTypes[$]=K},this.self.registerRTLTextPlugin=$=>{if(b.plugin.isParsed())throw new Error("RTL text plugin already registered.");b.plugin.applyArabicShaping=$.applyArabicShaping,b.plugin.processBidirectionalText=$.processBidirectionalText,b.plugin.processStyledBidirectionalText=$.processStyledBidirectionalText}}setReferrer(V,$){this.referrer=$}setImages(V,$,K){this.availableImages[V]=$;for(const te in this.workerSources[V]){const ce=this.workerSources[V][te];for(const ge in ce)ce[ge].availableImages=$}K()}setLayers(V,$,K){this.getLayerIndex(V).replace($),K()}updateLayers(V,$,K){this.getLayerIndex(V).update($.layers,$.removedIds),K()}loadTile(V,$,K){this.getWorkerSource(V,$.type,$.source).loadTile($,K)}loadDEMTile(V,$,K){this.getDEMWorkerSource(V,$.source).loadTile($,K)}reloadTile(V,$,K){this.getWorkerSource(V,$.type,$.source).reloadTile($,K)}abortTile(V,$,K){this.getWorkerSource(V,$.type,$.source).abortTile($,K)}removeTile(V,$,K){this.getWorkerSource(V,$.type,$.source).removeTile($,K)}removeDEMTile(V,$){this.getDEMWorkerSource(V,$.source).removeTile($)}removeSource(V,$,K){if(!this.workerSources[V]||!this.workerSources[V][$.type]||!this.workerSources[V][$.type][$.source])return;const te=this.workerSources[V][$.type][$.source];delete this.workerSources[V][$.type][$.source],void 0!==te.removeSource?te.removeSource($,K):K()}loadWorkerSource(V,$,K){try{this.self.importScripts($.url),K()}catch(te){K(te.toString())}}syncRTLPluginState(V,$,K){try{b.plugin.setState($);const te=b.plugin.getPluginURL();if(b.plugin.isLoaded()&&!b.plugin.isParsed()&&null!=te){this.self.importScripts(te);const ce=b.plugin.isParsed();K(ce?void 0:new Error(`RTL Text Plugin failed to import scripts from ${te}`),ce)}}catch(te){K(te.toString())}}getAvailableImages(V){let $=this.availableImages[V];return $||($=[]),$}getLayerIndex(V){let $=this.layerIndexes[V];return $||($=this.layerIndexes[V]=new us),$}getWorkerSource(V,$,K){return this.workerSources[V]||(this.workerSources[V]={}),this.workerSources[V][$]||(this.workerSources[V][$]={}),this.workerSources[V][$][K]||(this.workerSources[V][$][K]=new this.workerSourceTypes[$]({send:(ce,ge,he)=>{this.actor.send(ce,ge,he,V)}},this.getLayerIndex(V),this.getAvailableImages(V))),this.workerSources[V][$][K]}getDEMWorkerSource(V,$){return this.demWorkerSources[V]||(this.demWorkerSources[V]={}),this.demWorkerSources[V][$]||(this.demWorkerSources[V][$]=new Os),this.demWorkerSources[V][$]}}return b.isWorker()&&(self.worker=new Bs(self)),Bs}),Zh(0,function(b){var _r=Rs;function Rs(g){return a=g,!(typeof window>"u"||typeof document>"u"||!(Array.prototype&&Array.prototype.every&&Array.prototype.filter&&Array.prototype.forEach&&Array.prototype.indexOf&&Array.prototype.lastIndexOf&&Array.prototype.map&&Array.prototype.some&&Array.prototype.reduce&&Array.prototype.reduceRight&&Array.isArray)||!Function.prototype||!Function.prototype.bind||!(Object.keys&&Object.create&&Object.getPrototypeOf&&Object.getOwnPropertyNames&&Object.isSealed&&Object.isFrozen&&Object.isExtensible&&Object.getOwnPropertyDescriptor&&Object.defineProperty&&Object.defineProperties&&Object.seal&&Object.freeze&&Object.preventExtensions)||!("JSON"in window&&"parse"in JSON&&"stringify"in JSON)||!function(){if(!("Worker"in window&&"Blob"in window&&"URL"in window))return!1;var m,y,w=new Blob([""],{type:"text/javascript"}),S=URL.createObjectURL(w);try{y=new Worker(S),m=!0}catch{m=!1}return y&&y.terminate(),URL.revokeObjectURL(S),m}()||!("Uint8ClampedArray"in window)||!ArrayBuffer.isView||!function(){var m=document.createElement("canvas");m.width=m.height=1;var y=m.getContext("2d");if(!y)return!1;var w=y.getImageData(0,0,1,1);return w&&w.width===m.width}()||(void 0===us[h=a&&a.failIfMajorPerformanceCaveat]&&(us[h]=function(m){var y,S,T,k,w=(S=m,T=document.createElement("canvas"),(k=Object.create(Rs.webGLContextAttributes)).failIfMajorPerformanceCaveat=S,T.getContext("webgl",k)||T.getContext("experimental-webgl",k));if(!w)return!1;try{y=w.createShader(w.VERTEX_SHADER)}catch{return!1}return!(!y||w.isContextLost())&&(w.shaderSource(y,"void main() {}"),w.compileShader(y),!0===w.getShaderParameter(y,w.COMPILE_STATUS))}(h)),!us[h]||document.documentMode));var a,h}var us={};Rs.webGLContextAttributes={antialias:!1,alpha:!0,stencil:!0,depth:!0};function Zt(g,a){if(Array.isArray(g)){if(!Array.isArray(a)||g.length!==a.length)return!1;for(let h=0;h{window.removeEventListener("click",Te.suppressClickInternal,!0)},0)}static mousePos(a,h){const m=a.getBoundingClientRect();return new b.pointGeometry(h.clientX-m.left-a.clientLeft,h.clientY-m.top-a.clientTop)}static touchPos(a,h){const m=a.getBoundingClientRect(),y=[];for(let w=0;w{a=[],h=0,m=0,y={}},g.addThrottleControl=T=>{const k=m++;return y[k]=T,k},g.removeThrottleControl=T=>{delete y[T]};const w=()=>{const T=Object.keys(y);let k=!1;if(T.length>0)for(const R of T)if(k=y[R](),k)break;return k};g.getImage=(T,k)=>{Ni.supported&&(T.headers||(T.headers={}),T.headers.accept="image/webp,*/*");const R={requestParameters:T,callback:k,cancelled:!1,completed:!1,cancel:()=>{}};return a.push(R),w()||g.processQueue(),R};const S=T=>{const{requestParameters:k,callback:R}=T;return b.getArrayBuffer(k,(z,L,j,Q)=>{var ee,Y;z?R(z):L&&(ee=L,Y=(ee,Y)=>{null!=ee?R(ee):null!=Y&&R(null,Y,{cacheControl:j,expires:Q})},"function"==typeof createImageBitmap?b.arrayBufferToImageBitmap(ee,Y):b.arrayBufferToImage(ee,Y)),T.cancelled||(T.completed=!0,h--,w()||g.processQueue())})};g.processQueue=(T=0)=>{T<=0&&(T=w()?b.config.MAX_PARALLEL_IMAGE_REQUESTS_PER_FRAME:b.config.MAX_PARALLEL_IMAGE_REQUESTS);for(let k=h;k0;k++){const R=a.shift();if(R.cancelled)continue;const z=S(R);h++,R.innerRequest=z,R.cancel=()=>{var L;(L=R).completed||L.cancelled||(h--,L.cancelled=!0,L.innerRequest.cancel(),g.processQueue())}}return a.length}}(no||(no={})),no.resetRequestQueue();var pn,g,ii=no;(g=pn||(pn={})).Glyphs="Glyphs",g.Image="Image",g.Source="Source",g.SpriteImage="SpriteImage",g.SpriteJSON="SpriteJSON",g.Style="Style",g.Tile="Tile",g.Unknown="Unknown";class kc{constructor(a){this._transformRequestFn=a}transformRequest(a,h){return this._transformRequestFn&&this._transformRequestFn(a,h)||{url:a}}normalizeSpriteURL(a,h,m){const y=function(w){const S=w.match(Mo);if(!S)throw new Error(`Unable to parse URL "${w}"`);return{protocol:S[1],authority:S[2],path:S[3]||"/",params:S[4]?S[4].split("&"):[]}}(a);return y.path+=`${h}${m}`,function(w){const S=w.params.length?`?${w.params.join("&")}`:"";return`${w.protocol}://${w.authority}${w.path}${S}`}(y)}setTransformRequest(a){this._transformRequestFn=a}}const Mo=/^(\w+):\/\/([^/?]*)(\/[^?]+)?\??(.+)?/;function na(g){var a=new b.ARRAY_TYPE(3);return a[0]=g[0],a[1]=g[1],a[2]=g[2],a}var Ls,ro=function(g,a,h){return g[0]=a[0]-h[0],g[1]=a[1]-h[1],g[2]=a[2]-h[2],g};Ls=new b.ARRAY_TYPE(3),b.ARRAY_TYPE!=Float32Array&&(Ls[0]=0,Ls[1]=0,Ls[2]=0);var Oa=function(g){var a=g[0],h=g[1];return a*a+h*h};function hs(g){return"string"==typeof g?[{id:"default",url:g}]:g??[]}!function(){var g=new b.ARRAY_TYPE(2);b.ARRAY_TYPE!=Float32Array&&(g[0]=0,g[1]=0)}();class Hn{constructor(a,h,m,y){this.context=a,this.format=m,this.texture=a.gl.createTexture(),this.update(h,y)}update(a,h,m){const{width:y,height:w}=a,S=!(this.size&&this.size[0]===y&&this.size[1]===w||m),{context:T}=this,{gl:k}=T;if(this.useMipmap=Boolean(h&&h.useMipmap),k.bindTexture(k.TEXTURE_2D,this.texture),T.pixelStoreUnpackFlipY.set(!1),T.pixelStoreUnpack.set(1),T.pixelStoreUnpackPremultiplyAlpha.set(this.format===k.RGBA&&(!h||!1!==h.premultiply)),S)this.size=[y,w],a instanceof HTMLImageElement||a instanceof HTMLCanvasElement||a instanceof HTMLVideoElement||a instanceof ImageData||b.isImageBitmap(a)?k.texImage2D(k.TEXTURE_2D,0,this.format,this.format,k.UNSIGNED_BYTE,a):k.texImage2D(k.TEXTURE_2D,0,this.format,y,w,0,this.format,k.UNSIGNED_BYTE,a.data);else{const{x:R,y:z}=m||{x:0,y:0};a instanceof HTMLImageElement||a instanceof HTMLCanvasElement||a instanceof HTMLVideoElement||a instanceof ImageData||b.isImageBitmap(a)?k.texSubImage2D(k.TEXTURE_2D,0,R,z,k.RGBA,k.UNSIGNED_BYTE,a):k.texSubImage2D(k.TEXTURE_2D,0,R,z,y,w,k.RGBA,k.UNSIGNED_BYTE,a.data)}this.useMipmap&&this.isSizePowerOfTwo()&&k.generateMipmap(k.TEXTURE_2D)}bind(a,h,m){const{context:y}=this,{gl:w}=y;w.bindTexture(w.TEXTURE_2D,this.texture),m!==w.LINEAR_MIPMAP_NEAREST||this.isSizePowerOfTwo()||(m=w.LINEAR),a!==this.filter&&(w.texParameteri(w.TEXTURE_2D,w.TEXTURE_MAG_FILTER,a),w.texParameteri(w.TEXTURE_2D,w.TEXTURE_MIN_FILTER,m||a),this.filter=a),h!==this.wrap&&(w.texParameteri(w.TEXTURE_2D,w.TEXTURE_WRAP_S,h),w.texParameteri(w.TEXTURE_2D,w.TEXTURE_WRAP_T,h),this.wrap=h)}isSizePowerOfTwo(){return this.size[0]===this.size[1]&&Math.log(this.size[0])/Math.LN2%1==0}destroy(){const{gl:a}=this.context;a.deleteTexture(this.texture),this.texture=null}}function Pu(g){const{userImage:a}=g;return!!(a&&a.render&&a.render())&&(g.data.replace(new Uint8Array(a.data.buffer)),!0)}class Tt extends b.Evented{constructor(){super(),this.images={},this.updatedImages={},this.callbackDispatchedThisFrame={},this.loaded=!1,this.requestors=[],this.patterns={},this.atlasImage=new b.RGBAImage({width:1,height:1}),this.dirty=!0}isLoaded(){return this.loaded}setLoaded(a){if(this.loaded!==a&&(this.loaded=a,a)){for(const{ids:h,callback:m}of this.requestors)this._notify(h,m);this.requestors=[]}}getImage(a){const h=this.images[a];if(h&&!h.data&&h.spriteData){const m=h.spriteData;h.data=new b.RGBAImage({width:m.width,height:m.height},m.context.getImageData(m.x,m.y,m.width,m.height).data),h.spriteData=null}return h}addImage(a,h){if(this.images[a])throw new Error(`Image id ${a} already exist, use updateImage instead`);this._validate(a,h)&&(this.images[a]=h)}_validate(a,h){let m=!0;const y=h.data||h.spriteData;return this._validateStretch(h.stretchX,y&&y.width)||(this.fire(new b.ErrorEvent(new Error(`Image "${a}" has invalid "stretchX" value`))),m=!1),this._validateStretch(h.stretchY,y&&y.height)||(this.fire(new b.ErrorEvent(new Error(`Image "${a}" has invalid "stretchY" value`))),m=!1),this._validateContent(h.content,h)||(this.fire(new b.ErrorEvent(new Error(`Image "${a}" has invalid "content" value`))),m=!1),m}_validateStretch(a,h){if(!a)return!0;let m=0;for(const y of a){if(y[0]-1);k++,w[k]=T,S[k]=R,S[k+1]=qr}for(let T=0,k=0;T{let T=this.entries[y];T||(T=this.entries[y]={glyphs:{},requests:{},ranges:{}});let k=T.glyphs[w];if(void 0!==k)return void S(null,{stack:y,id:w,glyph:k});if(k=this._tinySDF(T,y,w),k)return T.glyphs[w]=k,void S(null,{stack:y,id:w,glyph:k});const R=Math.floor(w/256);if(256*R>65535)return void S(new Error("glyphs > 65535 not supported"));if(T.ranges[R])return void S(null,{stack:y,id:w,glyph:k});if(!this.url)return void S(new Error("glyphsUrl is not set"));let z=T.requests[R];z||(z=T.requests[R]=[],Nn.loadGlyphRange(y,R,this.url,this.requestManager,(L,j)=>{if(j){for(const Q in j)this._doesCharSupportLocalGlyph(+Q)||(T.glyphs[+Q]=j[+Q]);T.ranges[R]=!0}for(const Q of z)Q(L,j);delete T.requests[R]})),z.push((L,j)=>{L?S(L):j&&S(null,{stack:y,id:w,glyph:j[w]||null})})},(y,w)=>{if(y)h(y);else if(w){const S={};for(const{stack:T,id:k,glyph:R}of w)(S[T]||(S[T]={}))[k]=R&&{id:R.id,bitmap:R.bitmap.clone(),metrics:R.metrics};h(null,S)}})}_doesCharSupportLocalGlyph(a){return!!this.localIdeographFontFamily&&(b.unicodeBlockLookup["CJK Unified Ideographs"](a)||b.unicodeBlockLookup["Hangul Syllables"](a)||b.unicodeBlockLookup.Hiragana(a)||b.unicodeBlockLookup.Katakana(a))}_tinySDF(a,h,m){const y=this.localIdeographFontFamily;if(!y||!this._doesCharSupportLocalGlyph(m))return;let w=a.tinySDF;if(!w){let T="400";/bold/i.test(h)?T="900":/medium/i.test(h)?T="500":/light/i.test(h)&&(T="200"),w=a.tinySDF=new Nn.TinySDF({fontSize:24,buffer:3,radius:8,cutoff:.25,fontFamily:y,fontWeight:T})}const S=w.draw(String.fromCharCode(m));return{id:m,bitmap:new b.AlphaImage({width:S.width||30,height:S.height||30},S.data),metrics:{width:S.glyphWidth||24,height:S.glyphHeight||24,left:S.glyphLeft||0,top:S.glyphTop-27||-8,advance:S.glyphAdvance||24}}}}Nn.loadGlyphRange=function(g,a,h,m,y){const w=256*a,S=w+255,T=m.transformRequest(h.replace("{fontstack}",g).replace("{range}",`${w}-${S}`),pn.Glyphs);b.getArrayBuffer(T,(k,R)=>{if(k)y(k);else if(R){const z={};for(const L of b.parseGlyphPbf(R))z[L.id]=L;y(null,z)}})},Nn.TinySDF=class{constructor({fontSize:g=24,buffer:a=3,radius:h=8,cutoff:m=.25,fontFamily:y="sans-serif",fontWeight:w="normal",fontStyle:S="normal"}={}){this.buffer=a,this.cutoff=m,this.radius=h;const T=this.size=g+4*a,k=this._createCanvas(T),R=this.ctx=k.getContext("2d",{willReadFrequently:!0});R.font=`${S} ${w} ${g}px ${y}`,R.textBaseline="alphabetic",R.textAlign="left",R.fillStyle="black",this.gridOuter=new Float64Array(T*T),this.gridInner=new Float64Array(T*T),this.f=new Float64Array(T),this.z=new Float64Array(T+1),this.v=new Uint16Array(T)}_createCanvas(g){const a=document.createElement("canvas");return a.width=a.height=g,a}draw(g){const{width:a,actualBoundingBoxAscent:h,actualBoundingBoxDescent:m,actualBoundingBoxLeft:y,actualBoundingBoxRight:w}=this.ctx.measureText(g),S=Math.ceil(h),T=Math.max(0,Math.min(this.size-this.buffer,Math.ceil(w-y))),k=Math.min(this.size-this.buffer,S+Math.ceil(m)),R=T+2*this.buffer,z=k+2*this.buffer,L=Math.max(R*z,0),j=new Uint8ClampedArray(L),Q={data:j,width:R,height:z,glyphWidth:T,glyphHeight:k,glyphTop:S,glyphLeft:0,glyphAdvance:a};if(0===T||0===k)return Q;const{ctx:ee,buffer:Y,gridInner:ae,gridOuter:_e}=this;ee.clearRect(Y,Y,T,k),ee.fillText(g,Y,Y+S);const ye=ee.getImageData(Y,Y,T,k);_e.fill(qr,0,L),ae.fill(0,0,L);for(let ie=0;ie0?ke*ke:0,ae[Se]=ke<0?ke*ke:0}}La(_e,0,0,R,z,R,this.f,this.v,this.z),La(ae,Y,Y,T,k,R,this.f,this.v,this.z);for(let ie=0;ie1&&(k=a[++T]);const z=Math.abs(R-k.left),L=Math.abs(R-k.right),j=Math.min(z,L);let Q;const ee=w/m*(y+1);if(k.isDash){const Y=y-Math.abs(ee);Q=Math.sqrt(j*j+Y*Y)}else Q=y-Math.sqrt(j*j+ee*ee);this.data[S+R]=Math.max(0,Math.min(255,Q+128))}}}addRegularDash(a){for(let T=a.length-1;T>=0;--T){const k=a[T],R=a[T+1];k.zeroLength?a.splice(T,1):R&&R.isDash===k.isDash&&(R.left=k.left,a.splice(T,1))}const h=a[0],m=a[a.length-1];h.isDash===m.isDash&&(h.left=m.left-this.width,m.right=h.right+this.width);const y=this.width*this.nextRow;let w=0,S=a[w];for(let T=0;T1&&(S=a[++w]);const k=Math.abs(T-S.left),R=Math.abs(T-S.right),z=Math.min(k,R);this.data[y+T]=Math.max(0,Math.min(255,(S.isDash?z:-z)+128))}}addDash(a,h){const m=h?7:0,y=2*m+1;if(this.nextRow+y>this.height)return b.warnOnce("LineAtlas out of space"),null;let w=0;for(let T=0;T{y.send(a,h,w)},m=m||function(){})}getActor(){return this.currentActor=(this.currentActor+1)%this.actors.length,this.actors[this.currentActor]}remove(a=!0){this.actors.forEach(h=>{h.remove()}),this.actors=[],a&&this.workerPool.release(this.id)}}function za(g,a,h){const m=function(y,w){if(y)return h(y);if(w){const S=b.pick(b.extend(w,g),["tiles","minzoom","maxzoom","attribution","bounds","scheme","tileSize","encoding"]);w.vector_layers&&(S.vectorLayers=w.vector_layers,S.vectorLayerIds=S.vectorLayers.map(T=>T.id)),h(null,S)}};return g.url?b.getJSON(a.transformRequest(g.url,pn.Source),m):b.exported.frame(()=>m(null,g))}oi.Actor=b.Actor;class ra{constructor(a,h,m){this.bounds=b.LngLatBounds.convert(this.validateBounds(a)),this.minzoom=h||0,this.maxzoom=m||24}validateBounds(a){return Array.isArray(a)&&4===a.length?[Math.max(-180,a[0]),Math.max(-90,a[1]),Math.min(180,a[2]),Math.min(90,a[3])]:[-180,-90,180,90]}contains(a){const h=Math.pow(2,a.z),m=Math.floor(b.mercatorXfromLng(this.bounds.getWest())*h),y=Math.floor(b.mercatorYfromLat(this.bounds.getNorth())*h),w=Math.ceil(b.mercatorXfromLng(this.bounds.getEast())*h),S=Math.ceil(b.mercatorYfromLat(this.bounds.getSouth())*h);return a.x>=m&&a.x=y&&a.y{this._tileJSONRequest=null,this._loaded=!0,this.map.style.sourceCaches[this.id].clearTiles(),a?this.fire(new b.ErrorEvent(a)):h&&(b.extend(this,h),h.bounds&&(this.tileBounds=new ra(h.bounds,this.minzoom,this.maxzoom)),this.fire(new b.Event("data",{dataType:"source",sourceDataType:"metadata"})),this.fire(new b.Event("data",{dataType:"source",sourceDataType:"content"})))})}loaded(){return this._loaded}hasTile(a){return!this.tileBounds||this.tileBounds.contains(a.canonical)}onAdd(a){this.map=a,this.load()}setSourceProperty(a){this._tileJSONRequest&&this._tileJSONRequest.cancel(),a(),this.load()}setTiles(a){return this.setSourceProperty(()=>{this._options.tiles=a}),this}setUrl(a){return this.setSourceProperty(()=>{this.url=a,this._options.url=a}),this}onRemove(){this._tileJSONRequest&&(this._tileJSONRequest.cancel(),this._tileJSONRequest=null)}serialize(){return b.extend({},this._options)}loadTile(a,h){const m=a.tileID.canonical.url(this.tiles,this.map.getPixelRatio(),this.scheme),y={request:this.map._requestManager.transformRequest(m,pn.Tile),uid:a.uid,tileID:a.tileID,zoom:a.tileID.overscaledZ,tileSize:this.tileSize*a.tileID.overscaleFactor(),type:this.type,source:this.id,pixelRatio:this.map.getPixelRatio(),showCollisionBoxes:this.map.showCollisionBoxes,promoteId:this.promoteId};function w(S,T){return delete a.request,a.aborted?h(null):S&&404!==S.status?h(S):(T&&T.resourceTiming&&(a.resourceTiming=T.resourceTiming),this.map._refreshExpiredTiles&&T&&a.setExpiryData(T),a.loadVectorData(T,this.map.painter),h(null),void(a.reloadCallback&&(this.loadTile(a,a.reloadCallback),a.reloadCallback=null)))}y.request.collectResourceTiming=this._collectResourceTiming,a.actor&&"expired"!==a.state?"loading"===a.state?a.reloadCallback=h:a.request=a.actor.send("reloadTile",y,w.bind(this)):(a.actor=this.dispatcher.getActor(),a.request=a.actor.send("loadTile",y,w.bind(this)))}abortTile(a){a.request&&(a.request.cancel(),delete a.request),a.actor&&a.actor.send("abortTile",{uid:a.uid,type:this.type,source:this.id},void 0)}unloadTile(a){a.unloadVectorData(),a.actor&&a.actor.send("removeTile",{uid:a.uid,type:this.type,source:this.id},void 0)}hasTransition(){return!1}}class Qn extends b.Evented{constructor(a,h,m,y){super(),this.id=a,this.dispatcher=m,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=b.extend({type:"raster"},h),b.extend(this,b.pick(h,["url","scheme","tileSize"]))}load(){this._loaded=!1,this.fire(new b.Event("dataloading",{dataType:"source"})),this._tileJSONRequest=za(this._options,this.map._requestManager,(a,h)=>{this._tileJSONRequest=null,this._loaded=!0,a?this.fire(new b.ErrorEvent(a)):h&&(b.extend(this,h),h.bounds&&(this.tileBounds=new ra(h.bounds,this.minzoom,this.maxzoom)),this.fire(new b.Event("data",{dataType:"source",sourceDataType:"metadata"})),this.fire(new b.Event("data",{dataType:"source",sourceDataType:"content"})))})}loaded(){return this._loaded}onAdd(a){this.map=a,this.load()}onRemove(){this._tileJSONRequest&&(this._tileJSONRequest.cancel(),this._tileJSONRequest=null)}serialize(){return b.extend({},this._options)}hasTile(a){return!this.tileBounds||this.tileBounds.contains(a.canonical)}loadTile(a,h){const m=a.tileID.canonical.url(this.tiles,this.map.getPixelRatio(),this.scheme);a.request=ii.getImage(this.map._requestManager.transformRequest(m,pn.Tile),(y,w,S)=>{if(delete a.request,a.aborted)a.state="unloaded",h(null);else if(y)a.state="errored",h(y);else if(w){this.map._refreshExpiredTiles&&a.setExpiryData(S);const T=this.map.painter.context,k=T.gl;a.texture=this.map.painter.getTileTexture(w.width),a.texture?a.texture.update(w,{useMipmap:!0}):(a.texture=new Hn(T,w,k.RGBA,{useMipmap:!0}),a.texture.bind(k.LINEAR,k.CLAMP_TO_EDGE,k.LINEAR_MIPMAP_NEAREST),T.extTextureFilterAnisotropic&&k.texParameterf(k.TEXTURE_2D,T.extTextureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,T.extTextureFilterAnisotropicMax)),a.state="loaded",h(null)}})}abortTile(a,h){a.request&&(a.request.cancel(),delete a.request),h()}unloadTile(a,h){a.texture&&this.map.painter.saveTileTexture(a.texture),h()}hasTransition(){return!1}}let Ae;class Pe extends Qn{constructor(a,h,m,y){super(a,h,m,y),this.type="raster-dem",this.maxzoom=22,this._options=b.extend({type:"raster-dem"},h),this.encoding=h.encoding||"mapbox"}serialize(){return{type:"raster-dem",url:this.url,tileSize:this.tileSize,tiles:this.tiles,bounds:this.bounds,encoding:this.encoding}}loadTile(a,h){const m=a.tileID.canonical.url(this.tiles,this.map.getPixelRatio(),this.scheme);function y(w,S){w&&(a.state="errored",h(w)),S&&(a.dem=S,a.needsHillshadePrepare=!0,a.needsTerrainPrepare=!0,a.state="loaded",h(null))}a.request=ii.getImage(this.map._requestManager.transformRequest(m,pn.Tile),function(w,S){if(delete a.request,a.aborted)a.state="unloaded",h(null);else if(w)a.state="errored",h(w);else if(S){this.map._refreshExpiredTiles&&a.setExpiryData(S),delete S.cacheControl,delete S.expires;const T=b.isImageBitmap(S)&&(null==Ae&&(Ae=typeof OffscreenCanvas<"u"&&new OffscreenCanvas(1,1).getContext("2d")&&"function"==typeof createImageBitmap),Ae)?S:b.exported.getImageData(S,1),k={uid:a.uid,coord:a.tileID,source:this.id,rawImageData:T,encoding:this.encoding};a.actor&&"expired"!==a.state||(a.actor=this.dispatcher.getActor(),a.actor.send("loadDEMTile",k,y.bind(this)))}}.bind(this)),a.neighboringTiles=this._getNeighboringTiles(a.tileID)}_getNeighboringTiles(a){const h=a.canonical,m=Math.pow(2,h.z),y=(h.x-1+m)%m,w=0===h.x?a.wrap-1:a.wrap,S=(h.x+1+m)%m,T=h.x+1===m?a.wrap+1:a.wrap,k={};return k[new b.OverscaledTileID(a.overscaledZ,w,h.z,y,h.y).key]={backfilled:!1},k[new b.OverscaledTileID(a.overscaledZ,T,h.z,S,h.y).key]={backfilled:!1},h.y>0&&(k[new b.OverscaledTileID(a.overscaledZ,w,h.z,y,h.y-1).key]={backfilled:!1},k[new b.OverscaledTileID(a.overscaledZ,a.wrap,h.z,h.x,h.y-1).key]={backfilled:!1},k[new b.OverscaledTileID(a.overscaledZ,T,h.z,S,h.y-1).key]={backfilled:!1}),h.y+1{if(this._pendingLoads--,this._removed||y&&y.abandoned)return void this.fire(new b.Event("dataabort",{dataType:"source"}));let w=null;if(y&&y.resourceTiming&&y.resourceTiming[this.id]&&(w=y.resourceTiming[this.id].slice(0)),m)return void this.fire(new b.ErrorEvent(m));const S={dataType:"source"};this._collectResourceTiming&&w&&w.length>0&&b.extend(S,{resourceTiming:w}),this.fire(new b.Event("data",{...S,sourceDataType:"metadata"})),this.fire(new b.Event("data",{...S,sourceDataType:"content"}))})}loaded(){return 0===this._pendingLoads}loadTile(a,h){const m=a.actor?"reloadTile":"loadTile";a.actor=this.actor;const y={type:this.type,uid:a.uid,tileID:a.tileID,zoom:a.tileID.overscaledZ,maxZoom:this.maxzoom,tileSize:this.tileSize,source:this.id,pixelRatio:this.map.getPixelRatio(),showCollisionBoxes:this.map.showCollisionBoxes,promoteId:this.promoteId};a.request=this.actor.send(m,y,(w,S)=>(delete a.request,a.unloadVectorData(),a.aborted?h(null):w?h(w):(a.loadVectorData(S,this.map.painter,"reloadTile"===m),h(null))))}abortTile(a){a.request&&(a.request.cancel(),delete a.request),a.aborted=!0}unloadTile(a){a.unloadVectorData(),this.actor.send("removeTile",{uid:a.uid,type:this.type,source:this.id})}onRemove(){this._removed=!0,this.actor.send("removeSource",{type:this.type,source:this.id})}serialize(){return b.extend({},this._options,{type:this.type,data:this._data})}hasTransition(){return!1}}var zi=b.createLayout([{name:"a_pos",type:"Int16",components:2},{name:"a_texture_pos",type:"Int16",components:2}]);class Vn extends b.Evented{constructor(a,h,m,y){super(),this.id=a,this.dispatcher=m,this.coordinates=h.coordinates,this.type="image",this.minzoom=0,this.maxzoom=22,this.tileSize=512,this.tiles={},this._loaded=!1,this.setEventedParent(y),this.options=h}load(a,h){this._loaded=!1,this.fire(new b.Event("dataloading",{dataType:"source"})),this.url=this.options.url,this._request=ii.getImage(this.map._requestManager.transformRequest(this.url,pn.Image),(m,y)=>{this._request=null,this._loaded=!0,m?this.fire(new b.ErrorEvent(m)):y&&(this.image=y,a&&(this.coordinates=a),h&&h(),this._finishLoading())})}loaded(){return this._loaded}updateImage(a){return a.url?(this._request&&(this._request.cancel(),this._request=null),this.options.url=a.url,this.load(a.coordinates,()=>{this.texture=null}),this):this}_finishLoading(){this.map&&(this.setCoordinates(this.coordinates),this.fire(new b.Event("data",{dataType:"source",sourceDataType:"metadata"})))}onAdd(a){this.map=a,this.load()}onRemove(){this._request&&(this._request.cancel(),this._request=null)}setCoordinates(a){this.coordinates=a;const h=a.map(b.MercatorCoordinate.fromLngLat);this.tileID=function(y){let w=1/0,S=1/0,T=-1/0,k=-1/0;for(const j of y)w=Math.min(w,j.x),S=Math.min(S,j.y),T=Math.max(T,j.x),k=Math.max(k,j.y);const R=Math.max(T-w,k-S),z=Math.max(0,Math.floor(-Math.log(R)/Math.LN2)),L=Math.pow(2,z);return new b.CanonicalTileID(z,Math.floor((w+T)/2*L),Math.floor((S+k)/2*L))}(h),this.minzoom=this.maxzoom=this.tileID.z;const m=h.map(y=>this.tileID.getTilePoint(y)._round());return this._boundsArray=new b.RasterBoundsArray,this._boundsArray.emplaceBack(m[0].x,m[0].y,0,0),this._boundsArray.emplaceBack(m[1].x,m[1].y,b.EXTENT,0),this._boundsArray.emplaceBack(m[3].x,m[3].y,0,b.EXTENT),this._boundsArray.emplaceBack(m[2].x,m[2].y,b.EXTENT,b.EXTENT),this.boundsBuffer&&(this.boundsBuffer.destroy(),delete this.boundsBuffer),this.fire(new b.Event("data",{dataType:"source",sourceDataType:"content"})),this}prepare(){if(0===Object.keys(this.tiles).length||!this.image)return;const a=this.map.painter.context,h=a.gl;this.boundsBuffer||(this.boundsBuffer=a.createVertexBuffer(this._boundsArray,zi.members)),this.boundsSegments||(this.boundsSegments=b.SegmentVector.simpleSegment(0,0,4,2)),this.texture||(this.texture=new Hn(a,this.image,h.RGBA),this.texture.bind(h.LINEAR,h.CLAMP_TO_EDGE));for(const m in this.tiles){const y=this.tiles[m];"loaded"!==y.state&&(y.state="loaded",y.texture=this.texture)}}loadTile(a,h){this.tileID&&this.tileID.equals(a.tileID.canonical)?(this.tiles[String(a.tileID.wrap)]=a,a.buckets={},h(null)):(a.state="errored",h(null))}serialize(){return{type:"image",url:this.options.url,coordinates:this.coordinates}}hasTransition(){return!1}}class ds extends Vn{constructor(a,h,m,y){super(a,h,m,y),this.roundZoom=!0,this.type="video",this.options=h}load(){this._loaded=!1;const a=this.options;this.urls=[];for(const h of a.urls)this.urls.push(this.map._requestManager.transformRequest(h,pn.Source).url);b.getVideo(this.urls,(h,m)=>{this._loaded=!0,h?this.fire(new b.ErrorEvent(h)):m&&(this.video=m,this.video.loop=!0,this.video.addEventListener("playing",()=>{this.map.triggerRepaint()}),this.map&&this.video.play(),this._finishLoading())})}pause(){this.video&&this.video.pause()}play(){this.video&&this.video.play()}seek(a){if(this.video){const h=this.video.seekable;ah.end(0)?this.fire(new b.ErrorEvent(new b.ValidationError(`sources.${this.id}`,null,`Playback for this video can be set only between the ${h.start(0)} and ${h.end(0)}-second mark.`))):this.video.currentTime=a}}getVideo(){return this.video}onAdd(a){this.map||(this.map=a,this.load(),this.video&&(this.video.play(),this.setCoordinates(this.coordinates)))}prepare(){if(0===Object.keys(this.tiles).length||this.video.readyState<2)return;const a=this.map.painter.context,h=a.gl;this.boundsBuffer||(this.boundsBuffer=a.createVertexBuffer(this._boundsArray,zi.members)),this.boundsSegments||(this.boundsSegments=b.SegmentVector.simpleSegment(0,0,4,2)),this.texture?this.video.paused||(this.texture.bind(h.LINEAR,h.CLAMP_TO_EDGE),h.texSubImage2D(h.TEXTURE_2D,0,0,0,h.RGBA,h.UNSIGNED_BYTE,this.video)):(this.texture=new Hn(a,this.video,h.RGBA),this.texture.bind(h.LINEAR,h.CLAMP_TO_EDGE));for(const m in this.tiles){const y=this.tiles[m];"loaded"!==y.state&&(y.state="loaded",y.texture=this.texture)}}serialize(){return{type:"video",urls:this.urls,coordinates:this.coordinates}}hasTransition(){return this.video&&!this.video.paused}}class Bi extends Vn{constructor(a,h,m,y){super(a,h,m,y),h.coordinates?Array.isArray(h.coordinates)&&4===h.coordinates.length&&!h.coordinates.some(w=>!Array.isArray(w)||2!==w.length||w.some(S=>"number"!=typeof S))||this.fire(new b.ErrorEvent(new b.ValidationError(`sources.${a}`,null,'"coordinates" property must be an array of 4 longitude/latitude array pairs'))):this.fire(new b.ErrorEvent(new b.ValidationError(`sources.${a}`,null,'missing required property "coordinates"'))),h.animate&&"boolean"!=typeof h.animate&&this.fire(new b.ErrorEvent(new b.ValidationError(`sources.${a}`,null,'optional "animate" property must be a boolean value'))),h.canvas?"string"==typeof h.canvas||h.canvas instanceof HTMLCanvasElement||this.fire(new b.ErrorEvent(new b.ValidationError(`sources.${a}`,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 b.ErrorEvent(new b.ValidationError(`sources.${a}`,null,'missing required property "canvas"'))),this.options=h,this.animate=void 0===h.animate||h.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 b.ErrorEvent(new Error("Canvas dimensions cannot be less than or equal to zero."))):(this.play=function(){this._playing=!0,this.map.triggerRepaint()},this.pause=function(){this._playing&&(this.prepare(),this._playing=!1)},this._finishLoading())}getCanvas(){return this.canvas}onAdd(a){this.map=a,this.load(),this.canvas&&this.animate&&this.play()}onRemove(){this.pause()}prepare(){let a=!1;if(this.canvas.width!==this.width&&(this.width=this.canvas.width,a=!0),this.canvas.height!==this.height&&(this.height=this.canvas.height,a=!0),this._hasInvalidDimensions()||0===Object.keys(this.tiles).length)return;const h=this.map.painter.context,m=h.gl;this.boundsBuffer||(this.boundsBuffer=h.createVertexBuffer(this._boundsArray,zi.members)),this.boundsSegments||(this.boundsSegments=b.SegmentVector.simpleSegment(0,0,4,2)),this.texture?(a||this._playing)&&this.texture.update(this.canvas,{premultiply:!0}):this.texture=new Hn(h,this.canvas,m.RGBA,{premultiply:!0});for(const y in this.tiles){const w=this.tiles[y];"loaded"!==w.state&&(w.state="loaded",w.texture=this.texture)}}serialize(){return{type:"canvas",coordinates:this.coordinates}}hasTransition(){return this._playing}_hasInvalidDimensions(){for(const a of[this.canvas.width,this.canvas.height])if(isNaN(a)||a<=0)return!0;return!1}}const Ol={vector:mr,raster:Qn,"raster-dem":Pe,geojson:Ba,video:ds,image:Vn,canvas:Bi};function fs(g,a){const h=b.create();return b.translate(h,h,[1,1,0]),b.scale(h,h,[.5*g.width,.5*g.height,1]),b.multiply(h,h,g.calculatePosMatrix(a.toUnwrapped()))}function rt(g,a,h,m,y,w){const S=function(L,j,Q){if(L)for(const ee of L){const Y=j[ee];if(Y&&Y.source===Q&&"fill-extrusion"===Y.type)return!0}else for(const ee in j){const Y=j[ee];if(Y.source===Q&&"fill-extrusion"===Y.type)return!0}return!1}(y&&y.layers,a,g.id),T=w.maxPitchScaleFactor(),k=g.tilesIn(m,T,S);k.sort(Jt);const R=[];for(const L of k)R.push({wrappedTileID:L.tileID.wrapped().key,queryResults:L.tile.queryRenderedFeatures(a,h,g._state,L.queryGeometry,L.cameraQueryGeometry,L.scale,y,w,T,fs(g.transform,L.tileID))});const z=function(L){const j={},Q={};for(const ee of L){const Y=ee.queryResults,ae=ee.wrappedTileID,_e=Q[ae]=Q[ae]||{};for(const ye in Y){const ie=Y[ye],we=_e[ye]=_e[ye]||{},De=j[ye]=j[ye]||[];for(const Se of ie)we[Se.featureIndex]||(we[Se.featureIndex]=!0,De.push(Se))}}return j}(R);for(const L in z)z[L].forEach(j=>{const Q=j.feature,ee=g.getFeatureState(Q.layer["source-layer"],Q.id);Q.source=Q.layer.source,Q.layer["source-layer"]&&(Q.sourceLayer=Q.layer["source-layer"]),Q.state=ee});return z}function Jt(g,a){const h=g.tileID,m=a.tileID;return h.overscaledZ-m.overscaledZ||h.canonical.y-m.canonical.y||h.wrap-m.wrap||h.canonical.x-m.canonical.x}class jt{constructor(a,h){this.tileID=a,this.uid=b.uniqueId(),this.uses=0,this.tileSize=h,this.buckets={},this.expirationTime=null,this.queryPadding=0,this.hasSymbolBuckets=!1,this.hasRTLText=!1,this.dependencies={},this.rtt=[],this.rttCoords={},this.expiredRequestCount=0,this.state="loading"}registerFadeDuration(a){const h=a+this.timeAdded;hw.getLayer(R)).filter(Boolean);if(0!==k.length){T.layers=k,T.stateDependentLayerIds&&(T.stateDependentLayers=T.stateDependentLayerIds.map(R=>k.filter(z=>z.id===R)[0]));for(const R of k)S[R.id]=T}}return S}(a.buckets,h.style),this.hasSymbolBuckets=!1;for(const y in this.buckets){const w=this.buckets[y];if(w instanceof b.SymbolBucket){if(this.hasSymbolBuckets=!0,!m)break;w.justReloaded=!0}}if(this.hasRTLText=!1,this.hasSymbolBuckets)for(const y in this.buckets){const w=this.buckets[y];if(w instanceof b.SymbolBucket&&w.hasRTLText){this.hasRTLText=!0,b.lazyLoadRTLTextPlugin();break}}this.queryPadding=0;for(const y in this.buckets){const w=this.buckets[y];this.queryPadding=Math.max(this.queryPadding,h.style.getLayer(y).queryRadius(w))}a.imageAtlas&&(this.imageAtlas=a.imageAtlas),a.glyphAtlasImage&&(this.glyphAtlasImage=a.glyphAtlasImage)}else this.collisionBoxArray=new b.CollisionBoxArray}unloadVectorData(){for(const a in this.buckets)this.buckets[a].destroy();this.buckets={},this.imageAtlasTexture&&this.imageAtlasTexture.destroy(),this.imageAtlas&&(this.imageAtlas=null),this.glyphAtlasTexture&&this.glyphAtlasTexture.destroy(),this.latestFeatureIndex=null,this.state="unloaded"}getBucket(a){return this.buckets[a.id]}upload(a){for(const m in this.buckets){const y=this.buckets[m];y.uploadPending()&&y.upload(a)}const h=a.gl;this.imageAtlas&&!this.imageAtlas.uploaded&&(this.imageAtlasTexture=new Hn(a,this.imageAtlas.image,h.RGBA),this.imageAtlas.uploaded=!0),this.glyphAtlasImage&&(this.glyphAtlasTexture=new Hn(a,this.glyphAtlasImage,h.ALPHA),this.glyphAtlasImage=null)}prepare(a){this.imageAtlas&&this.imageAtlas.patchUpdatedImages(a,this.imageAtlasTexture)}queryRenderedFeatures(a,h,m,y,w,S,T,k,R,z){return this.latestFeatureIndex&&this.latestFeatureIndex.rawTileData?this.latestFeatureIndex.query({queryGeometry:y,cameraQueryGeometry:w,scale:S,tileSize:this.tileSize,pixelPosMatrix:z,transform:k,params:T,queryPadding:this.queryPadding*R},a,h,m):{}}querySourceFeatures(a,h){const m=this.latestFeatureIndex;if(!m||!m.rawTileData)return;const y=m.loadVTLayers(),w=h&&h.sourceLayer?h.sourceLayer:"",S=y._geojsonTileLayer||y[w];if(!S)return;const T=b.createFilter(h&&h.filter),{z:k,x:R,y:z}=this.tileID.canonical,L={z:k,x:R,y:z};for(let j=0;jm)y=!1;else if(h)if(this.expirationTime{this.remove(a,w)},m)),this.data[y].push(w),this.order.push(y),this.order.length>this.max){const S=this._getAndRemoveByKey(this.order[0]);S&&this.onRemove(S)}return this}has(a){return a.wrapped().key in this.data}getAndRemove(a){return this.has(a)?this._getAndRemoveByKey(a.wrapped().key):null}_getAndRemoveByKey(a){const h=this.data[a].shift();return h.timeout&&clearTimeout(h.timeout),0===this.data[a].length&&delete this.data[a],this.order.splice(this.order.indexOf(a),1),h.value}getByKey(a){const h=this.data[a];return h?h[0].value:null}get(a){return this.has(a)?this.data[a.wrapped().key][0].value:null}remove(a,h){if(!this.has(a))return this;const m=a.wrapped().key,y=void 0===h?0:this.data[m].indexOf(h),w=this.data[m][y];return this.data[m].splice(y,1),w.timeout&&clearTimeout(w.timeout),0===this.data[m].length&&delete this.data[m],this.onRemove(w.value),this.order.splice(this.order.indexOf(m),1),this}setMaxSize(a){for(this.max=a;this.order.length>this.max;){const h=this._getAndRemoveByKey(this.order[0]);h&&this.onRemove(h)}return this}filter(a){const h=[];for(const m in this.data)for(const y of this.data[m])a(y.value)||h.push(y);for(const m of h)this.remove(m.value.tileID,m)}}class ps{constructor(){this.state={},this.stateChanges={},this.deletedStates={}}updateState(a,h,m){const y=String(h);if(this.stateChanges[a]=this.stateChanges[a]||{},this.stateChanges[a][y]=this.stateChanges[a][y]||{},b.extend(this.stateChanges[a][y],m),null===this.deletedStates[a]){this.deletedStates[a]={};for(const w in this.state[a])w!==y&&(this.deletedStates[a][w]=null)}else if(this.deletedStates[a]&&null===this.deletedStates[a][y]){this.deletedStates[a][y]={};for(const w in this.state[a][y])m[w]||(this.deletedStates[a][y][w]=null)}else for(const w in m)this.deletedStates[a]&&this.deletedStates[a][y]&&null===this.deletedStates[a][y][w]&&delete this.deletedStates[a][y][w]}removeFeatureState(a,h,m){if(null===this.deletedStates[a])return;const y=String(h);if(this.deletedStates[a]=this.deletedStates[a]||{},m&&void 0!==h)null!==this.deletedStates[a][y]&&(this.deletedStates[a][y]=this.deletedStates[a][y]||{},this.deletedStates[a][y][m]=null);else if(void 0!==h)if(this.stateChanges[a]&&this.stateChanges[a][y])for(m in this.deletedStates[a][y]={},this.stateChanges[a][y])this.deletedStates[a][y][m]=null;else this.deletedStates[a][y]=null;else this.deletedStates[a]=null}getState(a,h){const m=String(h),y=b.extend({},(this.state[a]||{})[m],(this.stateChanges[a]||{})[m]);if(null===this.deletedStates[a])return{};if(this.deletedStates[a]){const w=this.deletedStates[a][h];if(null===w)return{};for(const S in w)delete y[S]}return y}initializeTileState(a,h){a.setFeatureState(this.state,h)}coalesceChanges(a,h){const m={};for(const y in this.stateChanges){this.state[y]=this.state[y]||{};const w={};for(const S in this.stateChanges[y])this.state[y][S]||(this.state[y][S]={}),b.extend(this.state[y][S],this.stateChanges[y][S]),w[S]=this.state[y][S];m[y]=w}for(const y in this.deletedStates){this.state[y]=this.state[y]||{};const w={};if(null===this.deletedStates[y])for(const S in this.state[y])w[S]={},this.state[y][S]={};else for(const S in this.deletedStates[y]){if(null===this.deletedStates[y][S])this.state[y][S]={};else for(const T of Object.keys(this.deletedStates[y][S]))delete this.state[y][S][T];w[S]=this.state[y][S]}m[y]=m[y]||{},b.extend(m[y],w)}if(this.stateChanges={},this.deletedStates={},0!==Object.keys(m).length)for(const y in a)a[y].setFeatureState(m,h)}}class At extends b.Evented{constructor(a,h,m){super(),this.id=a,this.dispatcher=m,this.on("data",y=>{"source"===y.dataType&&"metadata"===y.sourceDataType&&(this._sourceLoaded=!0),this._sourceLoaded&&!this._paused&&"source"===y.dataType&&"content"===y.sourceDataType&&(this.reload(),this.transform&&this.update(this.transform,this.terrain))}),this.on("dataloading",()=>{this._sourceErrored=!1}),this.on("error",()=>{this._sourceErrored=this._source.loaded()}),this._source=function(y,w,S,T){const k=new Ol[w.type](y,w,S,T);if(k.id!==y)throw new Error(`Expected Source id to be ${y} instead of ${k.id}`);return b.bindAll(["load","abort","unload","serialize","prepare"],k),k}(a,h,m,this),this._tiles={},this._cache=new io(0,this._unloadTile.bind(this)),this._timers={},this._cacheTimers={},this._maxTileCacheSize=null,this._loadedParentTiles={},this._coveredTiles={},this._state=new ps}onAdd(a){this.map=a,this._maxTileCacheSize=a?a._maxTileCacheSize:null,this._source&&this._source.onAdd&&this._source.onAdd(a)}onRemove(a){this.clearTiles(),this._source&&this._source.onRemove&&this._source.onRemove(a)}loaded(){if(this._sourceErrored)return!0;if(!this._sourceLoaded||!this._source.loaded())return!1;for(const a in this._tiles){const h=this._tiles[a];if("loaded"!==h.state&&"errored"!==h.state)return!1}return!0}getSource(){return this._source}pause(){this._paused=!0}resume(){if(!this._paused)return;const a=this._shouldReloadOnResume;this._paused=!1,this._shouldReloadOnResume=!1,a&&this.reload(),this.transform&&this.update(this.transform,this.terrain)}_loadTile(a,h){return this._source.loadTile(a,h)}_unloadTile(a){if(this._source.unloadTile)return this._source.unloadTile(a,()=>{})}_abortTile(a){this._source.abortTile&&this._source.abortTile(a,()=>{}),this._source.fire(new b.Event("dataabort",{tile:a,coord:a.tileID,dataType:"source"}))}serialize(){return this._source.serialize()}prepare(a){this._source.prepare&&this._source.prepare(),this._state.coalesceChanges(this._tiles,this.map?this.map.painter:null);for(const h in this._tiles){const m=this._tiles[h];m.upload(a),m.prepare(this.map.style.imageManager)}}getIds(){return Object.values(this._tiles).map(a=>a.tileID).sort(zs).map(a=>a.key)}getRenderableIds(a){const h=[];for(const m in this._tiles)this._isIdRenderable(m,a)&&h.push(this._tiles[m]);return a?h.sort((m,y)=>{const w=m.tileID,S=y.tileID,T=new b.pointGeometry(w.canonical.x,w.canonical.y)._rotate(this.transform.angle),k=new b.pointGeometry(S.canonical.x,S.canonical.y)._rotate(this.transform.angle);return w.overscaledZ-S.overscaledZ||k.y-T.y||k.x-T.x}).map(m=>m.tileID.key):h.map(m=>m.tileID).sort(zs).map(m=>m.key)}hasRenderableParent(a){const h=this.findLoadedParent(a,0);return!!h&&this._isIdRenderable(h.tileID.key)}_isIdRenderable(a,h){return this._tiles[a]&&this._tiles[a].hasData()&&!this._coveredTiles[a]&&(h||!this._tiles[a].holdingForFade())}reload(){if(this._paused)this._shouldReloadOnResume=!0;else{this._cache.reset();for(const a in this._tiles)"errored"!==this._tiles[a].state&&this._reloadTile(a,"reloading")}}_reloadTile(a,h){const m=this._tiles[a];m&&("loading"!==m.state&&(m.state=h),this._loadTile(m,this._tileLoaded.bind(this,m,a,h)))}_tileLoaded(a,h,m,y){if(y)return a.state="errored",void(404!==y.status?this._source.fire(new b.ErrorEvent(y,{tile:a})):this.update(this.transform,this.terrain));a.timeAdded=b.exported.now(),"expired"===m&&(a.refreshedUponExpiration=!0),this._setTileReloadTimer(h,a),"raster-dem"===this.getSource().type&&a.dem&&this._backfillDEM(a),this._state.initializeTileState(a,this.map?this.map.painter:null),a.aborted||this._source.fire(new b.Event("data",{dataType:"source",tile:a,coord:a.tileID}))}_backfillDEM(a){const h=this.getRenderableIds();for(let y=0;y1||(Math.abs(S)>1&&(1===Math.abs(S+k)?S+=k:1===Math.abs(S-k)&&(S-=k)),w.dem&&y.dem&&(y.dem.backfillBorder(w.dem,S,T),y.neighboringTiles&&y.neighboringTiles[R]&&(y.neighboringTiles[R].backfilled=!0)))}}getTile(a){return this.getTileByID(a.key)}getTileByID(a){return this._tiles[a]}_retainLoadedChildren(a,h,m,y){for(const w in this._tiles){let S=this._tiles[w];if(y[w]||!S.hasData()||S.tileID.overscaledZ<=h||S.tileID.overscaledZ>m)continue;let T=S.tileID;for(;S&&S.tileID.overscaledZ>h+1;){const R=S.tileID.scaledTo(S.tileID.overscaledZ-1);S=this._tiles[R.key],S&&S.hasData()&&(T=R)}let k=T;for(;k.overscaledZ>h;)if(k=k.scaledTo(k.overscaledZ-1),a[k.key]){y[T.key]=T;break}}}findLoadedParent(a,h){if(a.key in this._loadedParentTiles){const m=this._loadedParentTiles[a.key];return m&&m.tileID.overscaledZ>=h?m:null}for(let m=a.overscaledZ-1;m>=h;m--){const y=a.scaledTo(m),w=this._getLoadedTile(y);if(w)return w}}_getLoadedTile(a){const h=this._tiles[a.key];return h&&h.hasData()?h:this._cache.getByKey(a.wrapped().key)}updateCacheSize(a){const h=Math.ceil(a.width/this._source.tileSize)+1,m=Math.ceil(a.height/this._source.tileSize)+1,y=Math.floor(h*m*5),w="number"==typeof this._maxTileCacheSize?Math.min(this._maxTileCacheSize,y):y;this._cache.setMaxSize(w)}handleWrapJump(a){const h=Math.round((a-(void 0===this._prevLng?a:this._prevLng))/360);if(this._prevLng=a,h){const m={};for(const y in this._tiles){const w=this._tiles[y];w.tileID=w.tileID.unwrapTo(w.tileID.wrap+h),m[w.tileID.key]=w}this._tiles=m;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(a,h){if(this.transform=a,this.terrain=h,!this._sourceLoaded||this._paused)return;let m;this.updateCacheSize(a),this.handleWrapJump(this.transform.center.lng),this._coveredTiles={},this.used||this.usedForTerrain?this._source.tileID?m=a.getVisibleUnwrappedCoordinates(this._source.tileID).map(R=>new b.OverscaledTileID(R.canonical.z,R.wrap,R.canonical.z,R.canonical.x,R.canonical.y)):(m=a.coveringTiles({tileSize:this.usedForTerrain?this.tileSize:this._source.tileSize,minzoom:this._source.minzoom,maxzoom:this._source.maxzoom,roundZoom:!this.usedForTerrain&&this._source.roundZoom,reparseOverscaled:this._source.reparseOverscaled,terrain:h}),this._source.hasTile&&(m=m.filter(R=>this._source.hasTile(R)))):m=[];const y=a.coveringZoomLevel(this._source),w=Math.max(y-At.maxOverzooming,this._source.minzoom),S=Math.max(y+At.maxUnderzooming,this._source.minzoom);if(this.usedForTerrain){const R={};for(const z of m)if(z.canonical.z>this._source.minzoom){const L=z.scaledTo(z.canonical.z-1);R[L.key]=L;const j=z.scaledTo(Math.max(this._source.minzoom,Math.min(z.canonical.z,5)));R[j.key]=j}m=m.concat(Object.values(R))}const T=this._updateRetainedTiles(m,y);if(Ci(this._source.type)){const R={},z={},L=Object.keys(T);for(const j of L){const Q=T[j],ee=this._tiles[j];if(!ee||ee.fadeEndTime&&ee.fadeEndTime<=b.exported.now())continue;const Y=this.findLoadedParent(Q,w);Y&&(this._addTile(Y.tileID),R[Y.tileID.key]=Y.tileID),z[j]=Q}this._retainLoadedChildren(z,y,S,T);for(const j in R)T[j]||(this._coveredTiles[j]=!0,T[j]=R[j]);if(h){const j={},Q={};for(const ee of m)this._tiles[ee.key].hasData()?j[ee.key]=ee:Q[ee.key]=ee;for(const ee in Q){const Y=Q[ee].children(this._source.maxzoom);this._tiles[Y[0].key]&&this._tiles[Y[1].key]&&this._tiles[Y[2].key]&&this._tiles[Y[3].key]&&(j[Y[0].key]=T[Y[0].key]=Y[0],j[Y[1].key]=T[Y[1].key]=Y[1],j[Y[2].key]=T[Y[2].key]=Y[2],j[Y[3].key]=T[Y[3].key]=Y[3],delete Q[ee])}for(const ee in Q){const Y=this.findLoadedParent(Q[ee],this._source.minzoom);if(Y){j[Y.tileID.key]=T[Y.tileID.key]=Y.tileID;for(const ae in j)j[ae].isChildOf(Y.tileID)&&delete j[ae]}}for(const ee in this._tiles)j[ee]||(this._coveredTiles[ee]=!0)}}for(const R in T)this._tiles[R].clearFadeHold();const k=b.keysDifference(this._tiles,T);for(const R of k){const z=this._tiles[R];z.hasSymbolBuckets&&!z.holdingForFade()?z.setHoldDuration(this.map._fadeDuration):z.hasSymbolBuckets&&!z.symbolFadeFinished()||this._removeTile(R)}this._updateLoadedParentTileCache()}releaseSymbolFadeTiles(){for(const a in this._tiles)this._tiles[a].holdingForFade()&&this._removeTile(a)}_updateRetainedTiles(a,h){const m={},y={},w=Math.max(h-At.maxOverzooming,this._source.minzoom),S=Math.max(h+At.maxUnderzooming,this._source.minzoom),T={};for(const k of a){const R=this._addTile(k);m[k.key]=k,R.hasData()||hthis._source.maxzoom){const L=k.children(this._source.maxzoom)[0],j=this.getTile(L);if(j&&j.hasData()){m[L.key]=L;continue}}else{const L=k.children(this._source.maxzoom);if(m[L[0].key]&&m[L[1].key]&&m[L[2].key]&&m[L[3].key])continue}let z=R.wasRequested();for(let L=k.overscaledZ-1;L>=w;--L){const j=k.scaledTo(L);if(y[j.key]||(y[j.key]=!0,R=this.getTile(j),!R&&z&&(R=this._addTile(j)),R&&(m[j.key]=j,z=R.wasRequested(),R.hasData())))break}}return m}_updateLoadedParentTileCache(){this._loadedParentTiles={};for(const a in this._tiles){const h=[];let m,y=this._tiles[a].tileID;for(;y.overscaledZ>0;){if(y.key in this._loadedParentTiles){m=this._loadedParentTiles[y.key];break}h.push(y.key);const w=y.scaledTo(y.overscaledZ-1);if(m=this._getLoadedTile(w),m)break;y=w}for(const w of h)this._loadedParentTiles[w]=m}}_addTile(a){let h=this._tiles[a.key];if(h)return h;h=this._cache.getAndRemove(a),h&&(this._setTileReloadTimer(a.key,h),h.tileID=a,this._state.initializeTileState(h,this.map?this.map.painter:null),this._cacheTimers[a.key]&&(clearTimeout(this._cacheTimers[a.key]),delete this._cacheTimers[a.key],this._setTileReloadTimer(a.key,h)));const m=h;return h||(h=new jt(a,this._source.tileSize*a.overscaleFactor()),this._loadTile(h,this._tileLoaded.bind(this,h,a.key,h.state))),h.uses++,this._tiles[a.key]=h,m||this._source.fire(new b.Event("dataloading",{tile:h,coord:h.tileID,dataType:"source"})),h}_setTileReloadTimer(a,h){a in this._timers&&(clearTimeout(this._timers[a]),delete this._timers[a]);const m=h.getExpiryTimeout();m&&(this._timers[a]=setTimeout(()=>{this._reloadTile(a,"expired"),delete this._timers[a]},m))}_removeTile(a){const h=this._tiles[a];h&&(h.uses--,delete this._tiles[a],this._timers[a]&&(clearTimeout(this._timers[a]),delete this._timers[a]),h.uses>0||(h.hasData()&&"reloading"!==h.state?this._cache.add(h.tileID,h,h.getExpiryTimeout()):(h.aborted=!0,this._abortTile(h),this._unloadTile(h))))}clearTiles(){this._shouldReloadOnResume=!1,this._paused=!1;for(const a in this._tiles)this._removeTile(a);this._cache.reset()}tilesIn(a,h,m){const y=[],w=this.transform;if(!w)return y;const S=m?w.getCameraQueryGeometry(a):a,T=a.map(ee=>w.pointCoordinate(ee,this.terrain)),k=S.map(ee=>w.pointCoordinate(ee,this.terrain)),R=this.getIds();let z=1/0,L=1/0,j=-1/0,Q=-1/0;for(const ee of k)z=Math.min(z,ee.x),L=Math.min(L,ee.y),j=Math.max(j,ee.x),Q=Math.max(Q,ee.y);for(let ee=0;ee=0&&ie[1].y+ye>=0){const we=T.map(Se=>ae.getTilePoint(Se)),De=k.map(Se=>ae.getTilePoint(Se));y.push({tile:Y,tileID:ae,queryGeometry:we,cameraQueryGeometry:De,scale:_e})}}return y}getVisibleCoordinates(a){const h=this.getRenderableIds(a).map(m=>this._tiles[m].tileID);for(const m of h)m.posMatrix=this.transform.calculatePosMatrix(m.toUnwrapped());return h}hasTransition(){if(this._source.hasTransition())return!0;if(Ci(this._source.type))for(const a in this._tiles){const h=this._tiles[a];if(void 0!==h.fadeEndTime&&h.fadeEndTime>=b.exported.now())return!0}return!1}setFeatureState(a,h,m){this._state.updateState(a=a||"_geojsonTileLayer",h,m)}removeFeatureState(a,h,m){this._state.removeFeatureState(a=a||"_geojsonTileLayer",h,m)}getFeatureState(a,h){return this._state.getState(a=a||"_geojsonTileLayer",h)}setDependencies(a,h,m){const y=this._tiles[a];y&&y.setDependencies(h,m)}reloadTilesForDependencies(a,h){for(const m in this._tiles)this._tiles[m].hasDependency(a,h)&&this._reloadTile(m,"reloading");this._cache.filter(m=>!m.hasDependency(a,h))}}function zs(g,a){const h=Math.abs(2*g.wrap)-+(g.wrap<0),m=Math.abs(2*a.wrap)-+(a.wrap<0);return g.overscaledZ-a.overscaledZ||m-h||a.canonical.y-g.canonical.y||a.canonical.x-g.canonical.x}function Ci(g){return"raster"===g||"image"===g||"video"===g}At.maxOverzooming=10,At.maxUnderzooming=3;const ia="mapboxgl_preloaded_worker_pool";class oo{constructor(){this.active={}}acquire(a){if(!this.workers)for(this.workers=[];this.workers.length{h.terminate()}),this.workers=null)}isPreloaded(){return!!this.active[ia]}numActive(){return Object.keys(this.active).length}}const Vi=Math.floor(b.exported.hardwareConcurrency/2);let zn;function Fc(){return zn||(zn=new oo),zn}function so(g,a){const h={};for(const m in g)"ref"!==m&&(h[m]=g[m]);return b.refProperties.forEach(m=>{m in a&&(h[m]=a[m])}),h}function Ll(g){g=g.slice();const a=Object.create(null);for(let h=0;h0?(y-S)/T:0;return this.points[w].mult(1-k).add(this.points[h].mult(k))}}function ao(g,a){let h=!0;return"always"===g||"never"!==g&&"never"!==a||(h=!1),h}class Zr{constructor(a,h,m){const y=this.boxCells=[],w=this.circleCells=[];this.xCellCount=Math.ceil(a/m),this.yCellCount=Math.ceil(h/m);for(let S=0;Sthis.width||y<0||h>this.height)return[];const k=[];if(a<=0&&h<=0&&this.width<=m&&this.height<=y){if(w)return[{key:null,x1:a,y1:h,x2:m,y2:y}];for(let R=0;R0}hitTestCircle(a,h,m,y,w){const S=a-m,T=a+m,k=h-m,R=h+m;if(T<0||S>this.width||R<0||k>this.height)return!1;const z=[];return this._forEachCell(S,k,T,R,this._queryCellCircle,z,{hitTest:!0,overlapMode:y,circle:{x:a,y:h,radius:m},seenUids:{box:{},circle:{}}},w),z.length>0}_queryCell(a,h,m,y,w,S,T,k){const{seenUids:R,hitTest:z,overlapMode:L}=T,j=this.boxCells[w];if(null!==j){const ee=this.bboxes;for(const Y of j)if(!R.box[Y]){R.box[Y]=!0;const ae=4*Y,_e=this.boxKeys[Y];if(a<=ee[ae+2]&&h<=ee[ae+3]&&m>=ee[ae+0]&&y>=ee[ae+1]&&(!k||k(_e))&&(!z||!ao(L,_e.overlapMode))&&(S.push({key:_e,x1:ee[ae],y1:ee[ae+1],x2:ee[ae+2],y2:ee[ae+3]}),z))return!0}}const Q=this.circleCells[w];if(null!==Q){const ee=this.circles;for(const Y of Q)if(!R.circle[Y]){R.circle[Y]=!0;const ae=3*Y,_e=this.circleKeys[Y];if(this._circleAndRectCollide(ee[ae],ee[ae+1],ee[ae+2],a,h,m,y)&&(!k||k(_e))&&(!z||!ao(L,_e.overlapMode))){const ye=ee[ae],ie=ee[ae+1],we=ee[ae+2];if(S.push({key:_e,x1:ye-we,y1:ie-we,x2:ye+we,y2:ie+we}),z)return!0}}}return!1}_queryCellCircle(a,h,m,y,w,S,T,k){const{circle:R,seenUids:z,overlapMode:L}=T,j=this.boxCells[w];if(null!==j){const ee=this.bboxes;for(const Y of j)if(!z.box[Y]){z.box[Y]=!0;const ae=4*Y,_e=this.boxKeys[Y];if(this._circleAndRectCollide(R.x,R.y,R.radius,ee[ae+0],ee[ae+1],ee[ae+2],ee[ae+3])&&(!k||k(_e))&&!ao(L,_e.overlapMode))return S.push(!0),!0}}const Q=this.circleCells[w];if(null!==Q){const ee=this.circles;for(const Y of Q)if(!z.circle[Y]){z.circle[Y]=!0;const ae=3*Y,_e=this.circleKeys[Y];if(this._circlesCollide(ee[ae],ee[ae+1],ee[ae+2],R.x,R.y,R.radius)&&(!k||k(_e))&&!ao(L,_e.overlapMode))return S.push(!0),!0}}}_forEachCell(a,h,m,y,w,S,T,k){const R=this._convertToXCellCoord(a),z=this._convertToYCellCoord(h),L=this._convertToXCellCoord(m),j=this._convertToYCellCoord(y);for(let Q=R;Q<=L;Q++)for(let ee=z;ee<=j;ee++)if(w.call(this,a,h,m,y,this.xCellCount*ee+Q,S,T,k))return}_convertToXCellCoord(a){return Math.max(0,Math.min(this.xCellCount-1,Math.floor(a*this.xScale)))}_convertToYCellCoord(a){return Math.max(0,Math.min(this.yCellCount-1,Math.floor(a*this.yScale)))}_circlesCollide(a,h,m,y,w,S){const T=y-a,k=w-h,R=m+S;return R*R>T*T+k*k}_circleAndRectCollide(a,h,m,y,w,S,T){const k=(S-y)/2,R=Math.abs(a-(y+k));if(R>k+m)return!1;const z=(T-w)/2,L=Math.abs(h-(w+z));if(L>z+m)return!1;if(R<=k||L<=z)return!0;const j=R-k,Q=L-z;return j*j+Q*Q<=m*m}}function Vr(g,a,h,m,y){const w=b.create();return a?(b.scale(w,w,[1/y,1/y,1]),h||b.rotateZ(w,w,m.angle)):b.multiply(w,m.labelPlaneMatrix,g),w}function pi(g,a,h,m,y){if(a){const w=b.clone(g);return b.scale(w,w,[y,y,1]),h||b.rotateZ(w,w,-m.angle),w}return m.glCoordMatrix}function mi(g,a,h){let m;h?(m=[g.x,g.y,h(g.x,g.y),1],b.transformMat4(m,m,a)):(m=[g.x,g.y,0,1],xe(m,m,a));const y=m[3];return{point:new b.pointGeometry(m[0]/y,m[1]/y),signedDistanceFromCamera:y}}function Bs(g,a){return.5+g/a*.5}function J(g,a){const h=g[0]/g[3],m=g[1]/g[3];return h>=-a[0]&&h<=a[0]&&m>=-a[1]&&m<=a[1]}function V(g,a,h,m,y,w,S,T,k,R){const z=m?g.textSizeData:g.iconSizeData,L=b.evaluateSizeForZoom(z,h.transform.zoom),j=[256/h.width*2+1,256/h.height*2+1],Q=m?g.text.dynamicLayoutVertexArray:g.icon.dynamicLayoutVertexArray;Q.clear();const ee=g.lineVertexArray,Y=m?g.text.placedSymbolArray:g.icon.placedSymbolArray,ae=h.transform.width/h.transform.height;let _e=!1;for(let ye=0;yeMath.abs(h.x-a.x)*m?{useVertical:!0}:(g===b.WritingMode.vertical?a.yh.x)?{needsFlipping:!0}:null}function te(g,a,h,m,y,w,S,T,k,R,z,L,j,Q,ee,Y){const ae=a/24,_e=g.lineOffsetX*ae,ye=g.lineOffsetY*ae;let ie;if(g.numGlyphs>1){const we=g.glyphStartIndex+g.numGlyphs,De=g.lineStartIndex,Se=g.lineStartIndex+g.lineLength,ke=$(ae,T,_e,ye,h,z,L,g,k,w,j,ee,Y);if(!ke)return{notEnoughRoom:!0};const Be=mi(ke.first.point,S,Y).point,Le=mi(ke.last.point,S,Y).point;if(m&&!h){const Ne=K(g.writingMode,Be,Le,Q);if(Ne)return Ne}ie=[ke.first];for(let Ne=g.glyphStartIndex+1;Ne0?Be.point:ce(L,ke,De,1,y,Y),Ne=K(g.writingMode,De,Le,Q);if(Ne)return Ne}const we=ge(ae*T.getoffsetX(g.glyphStartIndex),_e,ye,h,z,L,g.segment,g.lineStartIndex,g.lineStartIndex+g.lineLength,k,w,j,ee,Y);if(!we)return{notEnoughRoom:!0};ie=[we]}for(const we of ie)b.addDynamicAttributes(R,we.point,we.angle);return{}}function ce(g,a,h,m,y,w){const S=mi(g.add(g.sub(a)._unit()),y,w).point,T=h.sub(S);return h.add(T._mult(m/T.mag()))}function ge(g,a,h,m,y,w,S,T,k,R,z,L,j,Q){const ee=m?g-a:g+a;let Y=ee>0?1:-1,ae=0;m&&(Y*=-1,ae=Math.PI),Y<0&&(ae+=Math.PI);let _e=Y>0?T+S:T+S+1,ye=y,ie=y,we=0,De=0;const Se=Math.abs(ee),ke=[];for(;we+De<=Se;){if(_e+=Y,_e=k)return null;if(ie=ye,ke.push(ye),ye=L[_e],void 0===ye){const ht=new b.pointGeometry(R.getx(_e),R.gety(_e)),Pt=mi(ht,z,Q);if(Pt.signedDistanceFromCamera>0)ye=L[_e]=Pt.point;else{const zt=_e-Y;ye=ce(0===we?w:new b.pointGeometry(R.getx(zt),R.gety(zt)),ht,ie,Se-we+1,z,Q)}}we+=De,De=ie.dist(ye)}const Be=(Se-we)/De,Le=ye.sub(ie),Ne=Le.mult(Be)._add(ie);Ne._add(Le._unit()._perp()._mult(h*Y));const ze=ae+Math.atan2(ye.y-ie.y,ye.x-ie.x);return ke.push(Ne),{point:Ne,angle:j?ze:0,path:ke}}const he=new Float32Array([-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0]);function ue(g,a){for(let h=0;h=1;Ht--)mt.push(Pt.path[Ht]);for(let Ht=1;Htmi(on,k,ee));mt=Ht.some(on=>on.signedDistanceFromCamera<=0)?[]:Ht.map(on=>on.point)}let An=[];if(mt.length>0){const Ht=mt[0].clone(),on=mt[0].clone();for(let Fn=1;Fn=Ne.x&&on.x<=ze.x&&Ht.y>=Ne.y&&on.y<=ze.y?[mt]:on.xze.x||on.yze.y?[]:b.clipLine([mt],Ne.x,Ne.y,ze.x,ze.y)}for(const Ht of An){ht.reset(Ht,.25*Le);let on=0;on=ht.length<=.5*Le?1:Math.ceil(ht.paddedLength/Tn)+1;for(let Fn=0;Fn=this.screenRightBoundary||ythis.screenBottomBoundary}isInsideGrid(a,h,m,y){return m>=0&&a=0&&hm.collisionGroupID===h}}return this.collisionGroups[a]}}function nn(g,a,h,m,y){const{horizontalAlign:w,verticalAlign:S}=b.getAnchorAlignment(g),T=-(w-.5)*a,k=-(S-.5)*h,R=b.evaluateVariableOffset(g,m);return new b.pointGeometry(T+R[0]*y,k+R[1]*y)}function an(g,a,h,m,y,w){const{x1:S,x2:T,y1:k,y2:R,anchorPointX:z,anchorPointY:L}=g,j=new b.pointGeometry(a,h);return m&&j._rotate(y?w:-w),{x1:S+j.x,y1:k+j.y,x2:T+j.x,y2:R+j.y,anchorPointX:z,anchorPointY:L}}class qn{constructor(a,h,m,y,w){this.transform=a.clone(),this.terrain=h,this.collisionIndex=new je(this.transform),this.placements={},this.opacities={},this.variableOffsets={},this.stale=!1,this.commitTime=0,this.fadeDuration=m,this.retainedQueryData={},this.collisionGroups=new Gn(y),this.collisionCircleArrays={},this.prevPlacement=w,w&&(w.prevPlacement=void 0),this.placedOrientations={}}getBucketParts(a,h,m,y){const w=m.getBucket(h),S=m.latestFeatureIndex;if(!w||!S||h.id!==w.layerIds[0])return;const T=m.collisionBoxArray,k=w.layers[0].layout,R=Math.pow(2,this.transform.zoom-m.tileID.overscaledZ),z=m.tileSize/b.EXTENT,L=this.transform.calculatePosMatrix(m.tileID.toUnwrapped()),j="map"===k.get("text-pitch-alignment"),Q="map"===k.get("text-rotation-alignment"),ee=Ie(m,1,this.transform.zoom),Y=Vr(L,j,Q,this.transform,ee);let ae=null;if(j){const ye=pi(L,j,Q,this.transform,ee);ae=b.multiply([],this.transform.labelPlaneMatrix,ye)}this.retainedQueryData[w.bucketInstanceId]=new ln(w.bucketInstanceId,S,w.sourceLayerIndex,w.index,m.tileID);const _e={bucket:w,layout:k,posMatrix:L,textLabelPlaneMatrix:Y,labelToScreenMatrix:ae,scale:R,textPixelRatio:z,holdingForFade:m.holdingForFade(),collisionBoxArray:T,partiallyEvaluatedTextSize:b.evaluateSizeForZoom(w.textSizeData,this.transform.zoom),collisionGroup:this.collisionGroups.get(w.sourceID)};if(y)for(const ye of w.sortKeyRanges){const{sortKey:ie,symbolInstanceStart:we,symbolInstanceEnd:De}=ye;a.push({sortKey:ie,symbolInstanceStart:we,symbolInstanceEnd:De,parameters:_e})}else a.push({symbolInstanceStart:0,symbolInstanceEnd:w.symbolInstances.length,parameters:_e})}attemptAnchorPlacement(a,h,m,y,w,S,T,k,R,z,L,j,Q,ee,Y,ae){const _e=[j.textOffset0,j.textOffset1],ye=nn(a,m,y,_e,w),ie=this.collisionIndex.placeCollisionBox(an(h,ye.x,ye.y,S,T,this.transform.angle),L,k,R,z.predicate,ae);if((!Y||0!==this.collisionIndex.placeCollisionBox(an(Y,ye.x,ye.y,S,T,this.transform.angle),L,k,R,z.predicate,ae).box.length)&&ie.box.length>0){let we;if(this.prevPlacement&&this.prevPlacement.variableOffsets[j.crossTileID]&&this.prevPlacement.placements[j.crossTileID]&&this.prevPlacement.placements[j.crossTileID].text&&(we=this.prevPlacement.variableOffsets[j.crossTileID].anchor),0===j.crossTileID)throw new Error("symbolInstance.crossTileID can't be 0");return this.variableOffsets[j.crossTileID]={textOffset:_e,width:m,height:y,anchor:a,textBoxScale:w,prevAnchor:we},this.markUsedJustification(Q,a,j,ee),Q.allowVerticalPlacement&&(this.markUsedOrientation(Q,ee,j),this.placedOrientations[j.crossTileID]=ee),{shift:ye,placedGlyphBoxes:ie}}}placeLayerBucketPart(a,h,m){const{bucket:y,layout:w,posMatrix:S,textLabelPlaneMatrix:T,labelToScreenMatrix:k,textPixelRatio:R,holdingForFade:z,collisionBoxArray:L,partiallyEvaluatedTextSize:j,collisionGroup:Q}=a.parameters,ee=w.get("text-optional"),Y=w.get("icon-optional"),ae=b.getOverlapMode(w,"text-overlap","text-allow-overlap"),_e="always"===ae,ye=b.getOverlapMode(w,"icon-overlap","icon-allow-overlap"),ie="always"===ye,we="map"===w.get("text-rotation-alignment"),De="map"===w.get("text-pitch-alignment"),Se="none"!==w.get("icon-text-fit"),ke="viewport-y"===w.get("symbol-z-order"),Be=_e&&(ie||!y.hasIconData()||Y),Le=ie&&(_e||!y.hasTextData()||ee);!y.collisionArrays&&L&&y.deserializeCollisionBoxes(L);const Ne=(ze,ht)=>{if(h[ze.crossTileID])return;if(z)return void(this.placements[ze.crossTileID]=new ft(!1,!1,!1));let Pt=!1,zt=!1,mt=!0,Tn=null,An={box:null,offscreen:null},Ht={box:null,offscreen:null},on=null,Fn=null,_n=null,mo=0,Ro=0,vr=0;ht.textFeatureIndex?mo=ht.textFeatureIndex:ze.useRuntimeCollisionCircles&&(mo=ze.featureIndex),ht.verticalTextFeatureIndex&&(Ro=ht.verticalTextFeatureIndex);const li=this.retainedQueryData[y.bucketInstanceId].tileID,Ii=this.terrain?(Rr,ur)=>this.terrain.getElevation(li,Rr,ur):null;for(const Rr of["textBox","verticalTextBox","iconBox","verticalIconBox"]){const ur=ht[Rr];ur&&(ur.elevation=Ii?Ii(ur.anchorPointX,ur.anchorPointY):0)}const Jo=ht.textBox;if(Jo){const Rr=On=>{let Gi=b.WritingMode.horizontal;if(y.allowVerticalPlacement&&!On&&this.prevPlacement){const Yr=this.prevPlacement.placedOrientations[ze.crossTileID];Yr&&(this.placedOrientations[ze.crossTileID]=Yr,Gi=Yr,this.markUsedOrientation(y,Gi,ze))}return Gi},ur=(On,Gi)=>{if(y.allowVerticalPlacement&&ze.numVerticalGlyphVertices>0&&ht.verticalTextBox){for(const Yr of y.writingModes)if(Yr===b.WritingMode.vertical?(An=Gi(),Ht=An):An=On(),An&&An.box&&An.box.length)break}else An=On()};if(w.get("text-variable-anchor")){let On=w.get("text-variable-anchor");if(this.prevPlacement&&this.prevPlacement.variableOffsets[ze.crossTileID]){const tr=this.prevPlacement.variableOffsets[ze.crossTileID];On.indexOf(tr.anchor)>0&&(On=On.filter(Qo=>Qo!==tr.anchor),On.unshift(tr.anchor))}const Gi=(tr,Qo,qi)=>{const sh=tr.x2-tr.x1,ya=tr.y2-tr.y1,Zs=ze.textBoxScale,ah=Se&&"never"===ye?Qo:null;let xs={box:[],offscreen:!1};const Cd="never"!==ae?2*On.length:On.length;for(let Mr=0;Mr=On.length?ae:"never",ze,y,qi,ah,Ii);if(nl&&(xs=nl.placedGlyphBoxes,xs&&xs.box&&xs.box.length)){Pt=!0,Tn=nl.shift;break}}return xs};ur(()=>Gi(Jo,ht.iconBox,b.WritingMode.horizontal),()=>{const tr=ht.verticalTextBox;return y.allowVerticalPlacement&&!(An&&An.box&&An.box.length)&&ze.numVerticalGlyphVertices>0&&tr?Gi(tr,ht.verticalIconBox,b.WritingMode.vertical):{box:null,offscreen:null}}),An&&(Pt=An.box,mt=An.offscreen);const Yr=Rr(An&&An.box);if(!Pt&&this.prevPlacement){const tr=this.prevPlacement.variableOffsets[ze.crossTileID];tr&&(this.variableOffsets[ze.crossTileID]=tr,this.markUsedJustification(y,tr.anchor,ze,Yr))}}else{const On=(Gi,Yr)=>{const tr=this.collisionIndex.placeCollisionBox(Gi,ae,R,S,Q.predicate,Ii);return tr&&tr.box&&tr.box.length&&(this.markUsedOrientation(y,Yr,ze),this.placedOrientations[ze.crossTileID]=Yr),tr};ur(()=>On(Jo,b.WritingMode.horizontal),()=>{const Gi=ht.verticalTextBox;return y.allowVerticalPlacement&&ze.numVerticalGlyphVertices>0&&Gi?On(Gi,b.WritingMode.vertical):{box:null,offscreen:null}}),Rr(An&&An.box&&An.box.length)}}if(on=An,Pt=on&&on.box&&on.box.length>0,mt=on&&on.offscreen,ze.useRuntimeCollisionCircles){const Rr=y.text.placedSymbolArray.get(ze.centerJustifiedTextSymbolIndex),ur=b.evaluateSizeForFeature(y.textSizeData,j,Rr),On=w.get("text-padding");Fn=this.collisionIndex.placeCollisionCircles(ae,Rr,y.lineVertexArray,y.glyphOffsetArray,ur,S,T,k,m,De,Q.predicate,ze.collisionCircleDiameter,On,Ii),Fn.circles.length&&Fn.collisionDetected&&!m&&b.warnOnce("Collisions detected, but collision boxes are not shown"),Pt=_e||Fn.circles.length>0&&!Fn.collisionDetected,mt=mt&&Fn.offscreen}if(ht.iconFeatureIndex&&(vr=ht.iconFeatureIndex),ht.iconBox){const Rr=ur=>{const On=Se&&Tn?an(ur,Tn.x,Tn.y,we,De,this.transform.angle):ur;return this.collisionIndex.placeCollisionBox(On,ye,R,S,Q.predicate,Ii)};Ht&&Ht.box&&Ht.box.length&&ht.verticalIconBox?(_n=Rr(ht.verticalIconBox),zt=_n.box.length>0):(_n=Rr(ht.iconBox),zt=_n.box.length>0),mt=mt&&_n.offscreen}const Fo=ee||0===ze.numHorizontalGlyphVertices&&0===ze.numVerticalGlyphVertices,Yl=Y||0===ze.numIconVertices;if(Fo||Yl?Yl?Fo||(zt=zt&&Pt):Pt=zt&&Pt:zt=Pt=zt&&Pt,Pt&&on&&on.box&&this.collisionIndex.insertCollisionBox(on.box,ae,w.get("text-ignore-placement"),y.bucketInstanceId,Ht&&Ht.box&&Ro?Ro:mo,Q.ID),zt&&_n&&this.collisionIndex.insertCollisionBox(_n.box,ye,w.get("icon-ignore-placement"),y.bucketInstanceId,vr,Q.ID),Fn&&(Pt&&this.collisionIndex.insertCollisionCircles(Fn.circles,ae,w.get("text-ignore-placement"),y.bucketInstanceId,mo,Q.ID),m)){const Rr=y.bucketInstanceId;let ur=this.collisionCircleArrays[Rr];void 0===ur&&(ur=this.collisionCircleArrays[Rr]=new xt);for(let On=0;On=0;--ht){const Pt=ze[ht];Ne(y.symbolInstances.get(Pt),y.collisionArrays[Pt])}}else for(let ze=a.symbolInstanceStart;ze=0&&(a.text.placedSymbolArray.get(T).crossTileID=w>=0&&T!==w?0:m.crossTileID)}markUsedOrientation(a,h,m){const y=h===b.WritingMode.horizontal||h===b.WritingMode.horizontalOnly?h:0,w=h===b.WritingMode.vertical?h:0,S=[m.leftJustifiedTextSymbolIndex,m.centerJustifiedTextSymbolIndex,m.rightJustifiedTextSymbolIndex];for(const T of S)a.text.placedSymbolArray.get(T).placedOrientation=y;m.verticalPlacedTextSymbolIndex&&(a.text.placedSymbolArray.get(m.verticalPlacedTextSymbolIndex).placedOrientation=w)}commit(a){this.commitTime=a,this.zoomAtLastRecencyCheck=this.transform.zoom;const h=this.prevPlacement;let m=!1;this.prevZoomAdjustment=h?h.zoomAdjustment(this.transform.zoom):0;const y=h?h.symbolFadeChange(a):1,w=h?h.opacities:{},S=h?h.variableOffsets:{},T=h?h.placedOrientations:{};for(const k in this.placements){const R=this.placements[k],z=w[k];z?(this.opacities[k]=new dt(z,y,R.text,R.icon),m=m||R.text!==z.text.placed||R.icon!==z.icon.placed):(this.opacities[k]=new dt(null,y,R.text,R.icon,R.skipFade),m=m||R.text||R.icon)}for(const k in w){const R=w[k];if(!this.opacities[k]){const z=new dt(R,y,!1,!1);z.isHidden()||(this.opacities[k]=z,m=m||R.text.placed||R.icon.placed)}}for(const k in S)this.variableOffsets[k]||!this.opacities[k]||this.opacities[k].isHidden()||(this.variableOffsets[k]=S[k]);for(const k in T)this.placedOrientations[k]||!this.opacities[k]||this.opacities[k].isHidden()||(this.placedOrientations[k]=T[k]);if(h&&void 0===h.lastPlacementChangeTime)throw new Error("Last placement time for previous placement is not defined");m?this.lastPlacementChangeTime=a:"number"!=typeof this.lastPlacementChangeTime&&(this.lastPlacementChangeTime=h?h.lastPlacementChangeTime:a)}updateLayerOpacities(a,h){const m={};for(const y of h){const w=y.getBucket(a);w&&y.latestFeatureIndex&&a.id===w.layerIds[0]&&this.updateBucketOpacities(w,m,y.collisionBoxArray)}}updateBucketOpacities(a,h,m){a.hasTextData()&&(a.text.opacityVertexArray.clear(),a.text.hasVisibleVertices=!1),a.hasIconData()&&(a.icon.opacityVertexArray.clear(),a.icon.hasVisibleVertices=!1),a.hasIconCollisionBoxData()&&a.iconCollisionBox.collisionVertexArray.clear(),a.hasTextCollisionBoxData()&&a.textCollisionBox.collisionVertexArray.clear();const y=a.layers[0].layout,w=new dt(null,0,!1,!1,!0),S=y.get("text-allow-overlap"),T=y.get("icon-allow-overlap"),k=y.get("text-variable-anchor"),R="map"===y.get("text-rotation-alignment"),z="map"===y.get("text-pitch-alignment"),L="none"!==y.get("icon-text-fit"),j=new dt(null,0,S&&(T||!a.hasIconData()||y.get("icon-optional")),T&&(S||!a.hasTextData()||y.get("text-optional")),!0);!a.collisionArrays&&m&&(a.hasIconCollisionBoxData()||a.hasTextCollisionBoxData())&&a.deserializeCollisionBoxes(m);const Q=(ee,Y,ae)=>{for(let _e=0;_e0,De=this.placedOrientations[Y.crossTileID],Se=De===b.WritingMode.vertical,ke=De===b.WritingMode.horizontal||De===b.WritingMode.horizontalOnly;if(ae>0||_e>0){const Be=Ha(ie.text);Q(a.text,ae,Se?aa:Be),Q(a.text,_e,ke?aa:Be);const Le=ie.text.isHidden();[Y.rightJustifiedTextSymbolIndex,Y.centerJustifiedTextSymbolIndex,Y.leftJustifiedTextSymbolIndex].forEach(ht=>{ht>=0&&(a.text.placedSymbolArray.get(ht).hidden=Le||Se?1:0)}),Y.verticalPlacedTextSymbolIndex>=0&&(a.text.placedSymbolArray.get(Y.verticalPlacedTextSymbolIndex).hidden=Le||ke?1:0);const Ne=this.variableOffsets[Y.crossTileID];Ne&&this.markUsedJustification(a,Ne.anchor,Y,De);const ze=this.placedOrientations[Y.crossTileID];ze&&(this.markUsedJustification(a,"left",Y,ze),this.markUsedOrientation(a,ze,Y))}if(we){const Be=Ha(ie.icon),Le=!(L&&Y.verticalPlacedIconSymbolIndex&&Se);Y.placedIconSymbolIndex>=0&&(Q(a.icon,Y.numIconVertices,Le?Be:aa),a.icon.placedSymbolArray.get(Y.placedIconSymbolIndex).hidden=ie.icon.isHidden()),Y.verticalPlacedIconSymbolIndex>=0&&(Q(a.icon,Y.numVerticalIconVertices,Le?aa:Be),a.icon.placedSymbolArray.get(Y.verticalPlacedIconSymbolIndex).hidden=ie.icon.isHidden())}if(a.hasIconCollisionBoxData()||a.hasTextCollisionBoxData()){const Be=a.collisionArrays[ee];if(Be){let Le=new b.pointGeometry(0,0);if(Be.textBox||Be.verticalTextBox){let ze=!0;if(k){const ht=this.variableOffsets[ye];ht?(Le=nn(ht.anchor,ht.width,ht.height,ht.textOffset,ht.textBoxScale),R&&Le._rotate(z?this.transform.angle:-this.transform.angle)):ze=!1}Be.textBox&&sr(a.textCollisionBox.collisionVertexArray,ie.text.placed,!ze||Se,Le.x,Le.y),Be.verticalTextBox&&sr(a.textCollisionBox.collisionVertexArray,ie.text.placed,!ze||ke,Le.x,Le.y)}const Ne=Boolean(!ke&&Be.verticalIconBox);Be.iconBox&&sr(a.iconCollisionBox.collisionVertexArray,ie.icon.placed,Ne,L?Le.x:0,L?Le.y:0),Be.verticalIconBox&&sr(a.iconCollisionBox.collisionVertexArray,ie.icon.placed,!Ne,L?Le.x:0,L?Le.y:0)}}}if(a.sortFeatures(this.transform.angle),this.retainedQueryData[a.bucketInstanceId]&&(this.retainedQueryData[a.bucketInstanceId].featureSortOrder=a.featureSortOrder),a.hasTextData()&&a.text.opacityVertexBuffer&&a.text.opacityVertexBuffer.updateData(a.text.opacityVertexArray),a.hasIconData()&&a.icon.opacityVertexBuffer&&a.icon.opacityVertexBuffer.updateData(a.icon.opacityVertexArray),a.hasIconCollisionBoxData()&&a.iconCollisionBox.collisionVertexBuffer&&a.iconCollisionBox.collisionVertexBuffer.updateData(a.iconCollisionBox.collisionVertexArray),a.hasTextCollisionBoxData()&&a.textCollisionBox.collisionVertexBuffer&&a.textCollisionBox.collisionVertexBuffer.updateData(a.textCollisionBox.collisionVertexArray),a.text.opacityVertexArray.length!==a.text.layoutVertexArray.length/4)throw new Error(`bucket.text.opacityVertexArray.length (= ${a.text.opacityVertexArray.length}) !== bucket.text.layoutVertexArray.length (= ${a.text.layoutVertexArray.length}) / 4`);if(a.icon.opacityVertexArray.length!==a.icon.layoutVertexArray.length/4)throw new Error(`bucket.icon.opacityVertexArray.length (= ${a.icon.opacityVertexArray.length}) !== bucket.icon.layoutVertexArray.length (= ${a.icon.layoutVertexArray.length}) / 4`);if(a.bucketInstanceId in this.collisionCircleArrays){const ee=this.collisionCircleArrays[a.bucketInstanceId];a.placementInvProjMatrix=ee.invProjMatrix,a.placementViewportMatrix=ee.viewportMatrix,a.collisionCircleArray=ee.circles,delete this.collisionCircleArrays[a.bucketInstanceId]}}symbolFadeChange(a){return 0===this.fadeDuration?1:(a-this.commitTime)/this.fadeDuration+this.prevZoomAdjustment}zoomAdjustment(a){return Math.max(0,(this.transform.zoom-a)/1.5)}hasTransitions(a){return this.stale||a-this.lastPlacementChangeTimea}setStale(){this.stale=!0}}function sr(g,a,h,m,y){g.emplaceBack(a?1:0,h?1:0,m||0,y||0),g.emplaceBack(a?1:0,h?1:0,m||0,y||0),g.emplaceBack(a?1:0,h?1:0,m||0,y||0),g.emplaceBack(a?1:0,h?1:0,m||0,y||0)}const si=Math.pow(2,25),kr=Math.pow(2,24),$a=Math.pow(2,17),Af=Math.pow(2,16),kf=Math.pow(2,9),ja=Math.pow(2,8),Fu=Math.pow(2,1);function Ha(g){if(0===g.opacity&&!g.placed)return 0;if(1===g.opacity&&g.placed)return 4294967295;const a=g.placed?1:0,h=Math.floor(127*g.opacity);return h*si+a*kr+h*$a+a*Af+h*kf+a*ja+h*Fu+a}const aa=0;class Ou{constructor(a){this._sortAcrossTiles="viewport-y"!==a.layout.get("symbol-z-order")&&!a.layout.get("symbol-sort-key").isConstant(),this._currentTileIndex=0,this._currentPartIndex=0,this._seenCrossTileIDs={},this._bucketParts=[]}continuePlacement(a,h,m,y,w){const S=this._bucketParts;for(;this._currentTileIndexT.sortKey-k.sortKey));this._currentPartIndex{const S=b.exported.now()-y;return!this._forceFullPlacement&&S>2};for(;this._currentPlacementIndex>=0;){const S=h[a[this._currentPlacementIndex]],T=this.placement.collisionIndex.transform.zoom;if("symbol"===S.type&&(!S.minzoom||S.minzoom<=T)&&(!S.maxzoom||S.maxzoom>T)){if(this._inProgressLayer||(this._inProgressLayer=new Ou(S)),this._inProgressLayer.continuePlacement(m[S.source],this.placement,this._showCollisionBoxes,S,w))return;delete this._inProgressLayer}this._currentPlacementIndex--}this._done=!0}commit(a){return this.placement.commit(a),this.placement}}const zl=512/b.EXTENT/2;class Wh{constructor(a,h,m){this.tileID=a,this.bucketInstanceId=m,this._symbolsByKey={};const y=new Map;for(let w=0;w({x:Math.floor(k.anchorX*zl),y:Math.floor(k.anchorY*zl)})),crossTileIDs:S.map(k=>k.crossTileID)};if(T.positions.length>128){const k=new b.KDBush(T.positions,R=>R.x,R=>R.y,16,Uint16Array);delete k.points,delete T.positions,T.index=k}this._symbolsByKey[w]=T}}getScaledCoordinates(a,h){const{x:m,y,z:w}=this.tileID.canonical,{x:S,y:T,z:k}=h.canonical,R=zl/Math.pow(2,k-w),z=(T*b.EXTENT+a.anchorY)*R,L=y*b.EXTENT*zl;return{x:Math.floor((S*b.EXTENT+a.anchorX)*R-m*b.EXTENT*zl),y:Math.floor(z-L)}}findMatches(a,h,m){const y=this.tileID.canonical.za)}}class Bl{constructor(){this.maxCrossTileID=0}generate(){return++this.maxCrossTileID}}class Bn{constructor(){this.indexes={},this.usedCrossTileIDs={},this.lng=0}handleWrapJump(a){const h=Math.round((a-this.lng)/360);if(0!==h)for(const m in this.indexes){const y=this.indexes[m],w={};for(const S in y){const T=y[S];T.tileID=T.tileID.unwrapTo(T.tileID.wrap+h),w[T.tileID.key]=T}this.indexes[m]=w}this.lng=a}addBucket(a,h,m){if(this.indexes[a.overscaledZ]&&this.indexes[a.overscaledZ][a.key]){if(this.indexes[a.overscaledZ][a.key].bucketInstanceId===h.bucketInstanceId)return!1;this.removeBucketCrossTileIDs(a.overscaledZ,this.indexes[a.overscaledZ][a.key])}for(let w=0;wa.overscaledZ)for(const T in S){const k=S[T];k.tileID.isChildOf(a)&&k.findMatches(h.symbolInstances,a,y)}else{const T=S[a.scaledTo(Number(w)).key];T&&T.findMatches(h.symbolInstances,a,y)}}for(let w=0;w{h[m]=!0});for(const m in this.layerIndexes)h[m]||delete this.layerIndexes[m]}}const Mn=(g,a)=>b.emitValidationErrors(g,a&&a.filter(h=>"source.canvas"!==h.identifier)),Lu=b.pick(mn,["addLayer","removeLayer","setPaintProperty","setLayoutProperty","setFilter","addSource","removeSource","setLayerZoomRange","setLight","setTransition","setGeoJSONSourceData","setGlyphs","setSprite"]),Pf=b.pick(mn,["setCenter","setZoom","setBearing","setPitch"]),Yn=function(){const g={},a=b.spec.$version;for(const h in b.spec.$root){const m=b.spec.$root[h];if(m.required){let y=null;y="version"===h?a:"array"===m.type?[]:{},null!=y&&(g[h]=y)}}return g}();class Mt extends b.Evented{constructor(a,h={}){super(),this.map=a,this.dispatcher=new oi(Fc(),this,a._getMapId()),this.imageManager=new Tt,this.imageManager.setEventedParent(this),this.glyphManager=new Nn(a._requestManager,h.localIdeographFontFamily),this.lineAtlas=new Rc(256,512),this.crossTileSymbolIndex=new Xn,this._spritesImagesIds={},this._layers={},this._serializedLayers={},this._order=[],this.sourceCaches={},this.zoomHistory=new b.ZoomHistory,this._loaded=!1,this._availableImages=[],this._resetUpdates(),this.dispatcher.broadcast("setReferrer",b.getReferrer());const m=this;this._rtlTextPluginCallback=Mt.registerForPluginStateChange(y=>{m.dispatcher.broadcast("syncRTLPluginState",{pluginStatus:y.pluginStatus,pluginURL:y.pluginURL},(w,S)=>{if(b.triggerPluginCompletionEvent(w),S&&S.every(T=>T))for(const T in m.sourceCaches)m.sourceCaches[T].reload()})}),this.on("data",y=>{if("source"!==y.dataType||"metadata"!==y.sourceDataType)return;const w=this.sourceCaches[y.sourceId];if(!w)return;const S=w.getSource();if(S&&S.vectorLayerIds)for(const T in this._layers){const k=this._layers[T];k.source===S.id&&this._validateLayer(k)}})}loadURL(a,h={},m){this.fire(new b.Event("dataloading",{dataType:"style"})),h.validate="boolean"!=typeof h.validate||h.validate;const y=this.map._requestManager.transformRequest(a,pn.Style);this._request=b.getJSON(y,(w,S)=>{this._request=null,w?this.fire(new b.ErrorEvent(w)):S&&this._load(S,h,m)})}loadJSON(a,h={},m){this.fire(new b.Event("dataloading",{dataType:"style"})),this._request=b.exported.frame(()=>{this._request=null,h.validate=!1!==h.validate,this._load(a,h,m)})}loadEmpty(){this.fire(new b.Event("dataloading",{dataType:"style"})),this._load(Yn,{validate:!1})}_load(a,h,m){const y=h.transformStyle?h.transformStyle(m,a):a;if(h.validate&&Mn(this,b.validateStyle(y)))return;this._loaded=!0,this.stylesheet=y;for(const S in y.sources)this.addSource(S,y.sources[S],{validate:!1});y.sprite?this._loadSprite(y.sprite):this.imageManager.setLoaded(!0),this.glyphManager.setURL(y.glyphs);const w=Ll(this.stylesheet.layers);this._order=w.map(S=>S.id),this._layers={},this._serializedLayers={};for(let S of w)S=b.createStyleLayer(S),S.setEventedParent(this,{layer:{id:S.id}}),this._layers[S.id]=S,this._serializedLayers[S.id]=S.serialize();this.dispatcher.broadcast("setLayers",this._serializeLayers(this._order)),this.light=new Na(this.stylesheet.light),this.map.setTerrain(this.stylesheet.terrain),this.fire(new b.Event("data",{dataType:"style"})),this.fire(new b.Event("style.load"))}_loadSprite(a,h=!1,m){this.imageManager.setLoaded(!1),this._spriteRequest=function(y,w,S,T){const k=hs(y),R=S>1?"@2x":"";let z;const L=[],j=[],Q={},ee={};for(const{id:ae,url:_e}of k){const ye=L.push(b.getJSON(w.transformRequest(w.normalizeSpriteURL(_e,R,".json"),pn.SpriteJSON),(we,De)=>{L.splice(ye,1),z||(z=we,Q[ae]=De,Y())})),ie=j.push(ii.getImage(w.transformRequest(w.normalizeSpriteURL(_e,R,".png"),pn.SpriteImage),(we,De)=>{j.splice(ie,1),z||(z=we,ee[ae]=De,Y())}))}function Y(){const ae=Object.values(Q).length,_e=Object.values(ee).length;if(z)T(z);else if(k.length===ae&&ae===_e){const ye={};for(const ie in Q){ye[ie]={};const we=b.exported.getImageCanvasContext(ee[ie]),De=Q[ie];for(const Se in De){const{width:ke,height:Be,x:Le,y:Ne,sdf:ze,pixelRatio:ht,stretchX:Pt,stretchY:zt,content:mt}=De[Se];ye[ie][Se]={data:null,pixelRatio:ht,sdf:ze,stretchX:Pt,stretchY:zt,content:mt,spriteData:{width:ke,height:Be,x:Le,y:Ne,context:we}}}}T(null,ye)}}return{cancel(){if(L.length)for(const ae of L)ae.cancel(),L.splice(L.indexOf(ae),1);if(j.length)for(const ae of j)ae.cancel(),j.splice(j.indexOf(ae),1)}}}(a,this.map._requestManager,this.map.getPixelRatio(),(y,w)=>{if(this._spriteRequest=null,y)this.fire(new b.ErrorEvent(y));else if(w)for(const S in w){this._spritesImagesIds[S]=[];const T=this._spritesImagesIds[S]?this._spritesImagesIds[S].filter(k=>!(k in w)):[];for(const k of T)this.imageManager.removeImage(k),this._changedImages[k]=!0;for(const k in w[S]){const R="default"===S?k:`${S}:${k}`;this._spritesImagesIds[S].push(R),R in this.imageManager.images?this.imageManager.updateImage(R,w[S][k],!1):this.imageManager.addImage(R,w[S][k]),h&&(this._changedImages[R]=!0)}}this.imageManager.setLoaded(!0),this._availableImages=this.imageManager.listImages(),h&&(this._changed=!0),this.dispatcher.broadcast("setImages",this._availableImages),this.fire(new b.Event("data",{dataType:"style"})),m&&m(y)})}_unloadSprite(){for(const a of Object.values(this._spritesImagesIds).flat())this.imageManager.removeImage(a),this._changedImages[a]=!0;this._spritesImagesIds={},this._availableImages=this.imageManager.listImages(),this._changed=!0,this.dispatcher.broadcast("setImages",this._availableImages),this.fire(new b.Event("data",{dataType:"style"}))}_validateLayer(a){const h=this.sourceCaches[a.source];if(!h)return;const m=a.sourceLayer;if(!m)return;const y=h.getSource();("geojson"===y.type||y.vectorLayerIds&&-1===y.vectorLayerIds.indexOf(m))&&this.fire(new b.ErrorEvent(new Error(`Source layer "${m}" does not exist on source "${y.id}" as specified by style layer "${a.id}".`)))}loaded(){if(!this._loaded||Object.keys(this._updatedSources).length)return!1;for(const a in this.sourceCaches)if(!this.sourceCaches[a].loaded())return!1;return!!this.imageManager.isLoaded()}_serializeLayers(a){const h=[];for(const m of a){const y=this._layers[m];"custom"!==y.type&&h.push(y.serialize())}return h}hasTransitions(){if(this.light&&this.light.hasTransition())return!0;for(const a in this.sourceCaches)if(this.sourceCaches[a].hasTransition())return!0;for(const a in this._layers)if(this._layers[a].hasTransition())return!0;return!1}_checkLoaded(){if(!this._loaded)throw new Error("Style is not done loading.")}update(a){if(!this._loaded)return;const h=this._changed;if(this._changed){const y=Object.keys(this._updatedLayers),w=Object.keys(this._removedLayers);(y.length||w.length)&&this._updateWorkerLayers(y,w);for(const S in this._updatedSources){const T=this._updatedSources[S];if("reload"===T)this._reloadSource(S);else{if("clear"!==T)throw new Error(`Invalid action ${T}`);this._clearSource(S)}}this._updateTilesForChangedImages(),this._updateTilesForChangedGlyphs();for(const S in this._updatedPaintProps)this._layers[S].updateTransitions(a);this.light.updateTransitions(a),this._resetUpdates()}const m={};for(const y in this.sourceCaches){const w=this.sourceCaches[y];m[y]=w.used,w.used=!1}for(const y of this._order){const w=this._layers[y];w.recalculate(a,this._availableImages),!w.isHidden(a.zoom)&&w.source&&(this.sourceCaches[w.source].used=!0)}for(const y in m){const w=this.sourceCaches[y];m[y]!==w.used&&w.fire(new b.Event("data",{sourceDataType:"visibility",dataType:"source",sourceId:y}))}this.light.recalculate(a),this.z=a.zoom,h&&this.fire(new b.Event("data",{dataType:"style"}))}_updateTilesForChangedImages(){const a=Object.keys(this._changedImages);if(a.length){for(const h in this.sourceCaches)this.sourceCaches[h].reloadTilesForDependencies(["icons","patterns"],a);this._changedImages={}}}_updateTilesForChangedGlyphs(){if(this._glyphsDidChange){for(const a in this.sourceCaches)this.sourceCaches[a].reloadTilesForDependencies(["glyphs"],[""]);this._glyphsDidChange=!1}}_updateWorkerLayers(a,h){this.dispatcher.broadcast("updateLayers",{layers:this._serializeLayers(a),removedIds:h})}_resetUpdates(){this._changed=!1,this._updatedLayers={},this._removedLayers={},this._updatedSources={},this._updatedPaintProps={},this._changedImages={},this._glyphsDidChange=!1}setState(a,h={}){if(this._checkLoaded(),a=h.transformStyle?h.transformStyle(this.serialize(),a):a,Mn(this,b.validateStyle(a)))return!1;(a=b.clone$1(a)).layers=Ll(a.layers);const m=function(w,S){if(!w)return[{command:mn.setStyle,args:[S]}];let T=[];try{if(!Zt(w.version,S.version))return[{command:mn.setStyle,args:[S]}];Zt(w.center,S.center)||T.push({command:mn.setCenter,args:[S.center]}),Zt(w.zoom,S.zoom)||T.push({command:mn.setZoom,args:[S.zoom]}),Zt(w.bearing,S.bearing)||T.push({command:mn.setBearing,args:[S.bearing]}),Zt(w.pitch,S.pitch)||T.push({command:mn.setPitch,args:[S.pitch]}),Zt(w.sprite,S.sprite)||T.push({command:mn.setSprite,args:[S.sprite]}),Zt(w.glyphs,S.glyphs)||T.push({command:mn.setGlyphs,args:[S.glyphs]}),Zt(w.transition,S.transition)||T.push({command:mn.setTransition,args:[S.transition]}),Zt(w.light,S.light)||T.push({command:mn.setLight,args:[S.light]});const k={},R=[];!function(L,j,Q,ee){let Y;for(Y in j=j||{},L=L||{})Object.prototype.hasOwnProperty.call(L,Y)&&(Object.prototype.hasOwnProperty.call(j,Y)||Oc(Y,Q,ee));for(Y in j)Object.prototype.hasOwnProperty.call(j,Y)&&(Object.prototype.hasOwnProperty.call(L,Y)?Zt(L[Y],j[Y])||("geojson"===L[Y].type&&"geojson"===j[Y].type&&Ru(L,j,Y)?Q.push({command:mn.setGeoJSONSourceData,args:[Y,j[Y].data]}):Va(Y,j,Q,ee)):oa(Y,j,Q))}(w.sources,S.sources,R,k);const z=[];w.layers&&w.layers.forEach(L=>{k[L.source]?T.push({command:mn.removeLayer,args:[L.id]}):z.push(L)}),T=T.concat(R),function(L,j,Q){j=j||[];const ee=(L=L||[]).map(Ua),Y=j.map(Ua),ae=L.reduce(Sn,{}),_e=j.reduce(Sn,{}),ye=ee.slice(),ie=Object.create(null);let we,De,Se,ke,Be,Le,Ne;for(we=0,De=0;we!(w.command in Pf));if(0===m.length)return!1;const y=m.filter(w=>!(w.command in Lu));if(y.length>0)throw new Error(`Unimplemented: ${y.map(w=>w.command).join(", ")}.`);return m.forEach(w=>{"setTransition"!==w.command&&this[w.command].apply(this,w.args)}),this.stylesheet=a,!0}addImage(a,h){if(this.getImage(a))return this.fire(new b.ErrorEvent(new Error(`An image named "${a}" already exists.`)));this.imageManager.addImage(a,h),this._afterImageUpdated(a)}updateImage(a,h){this.imageManager.updateImage(a,h)}getImage(a){return this.imageManager.getImage(a)}removeImage(a){if(!this.getImage(a))return this.fire(new b.ErrorEvent(new Error(`An image named "${a}" does not exist.`)));this.imageManager.removeImage(a),this._afterImageUpdated(a)}_afterImageUpdated(a){this._availableImages=this.imageManager.listImages(),this._changedImages[a]=!0,this._changed=!0,this.dispatcher.broadcast("setImages",this._availableImages),this.fire(new b.Event("data",{dataType:"style"}))}listImages(){return this._checkLoaded(),this.imageManager.listImages()}addSource(a,h,m={}){if(this._checkLoaded(),void 0!==this.sourceCaches[a])throw new Error(`Source "${a}" already exists.`);if(!h.type)throw new Error(`The type property must be defined, but only the following properties were given: ${Object.keys(h).join(", ")}.`);if(["vector","raster","geojson","video","image"].indexOf(h.type)>=0&&this._validate(b.validateStyle.source,`sources.${a}`,h,null,m))return;this.map&&this.map._collectResourceTiming&&(h.collectResourceTiming=!0);const y=this.sourceCaches[a]=new At(a,h,this.dispatcher);y.style=this,y.setEventedParent(this,()=>({isSourceLoaded:this.loaded(),source:y.serialize(),sourceId:a})),y.onAdd(this.map),this._changed=!0}removeSource(a){if(this._checkLoaded(),void 0===this.sourceCaches[a])throw new Error("There is no source with this ID");for(const m in this._layers)if(this._layers[m].source===a)return this.fire(new b.ErrorEvent(new Error(`Source "${a}" cannot be removed while layer "${m}" is using it.`)));const h=this.sourceCaches[a];delete this.sourceCaches[a],delete this._updatedSources[a],h.fire(new b.Event("data",{sourceDataType:"metadata",dataType:"source",sourceId:a})),h.setEventedParent(null),h.onRemove(this.map),this._changed=!0}setGeoJSONSourceData(a,h){if(this._checkLoaded(),void 0===this.sourceCaches[a])throw new Error(`There is no source with this ID=${a}`);const m=this.sourceCaches[a].getSource();if("geojson"!==m.type)throw new Error(`geojsonSource.type is ${m.type}, which is !== 'geojson`);m.setData(h),this._changed=!0}getSource(a){return this.sourceCaches[a]&&this.sourceCaches[a].getSource()}addLayer(a,h,m={}){this._checkLoaded();const y=a.id;if(this.getLayer(y))return void this.fire(new b.ErrorEvent(new Error(`Layer "${y}" already exists on this map.`)));let w;if("custom"===a.type){if(Mn(this,b.validateCustomStyleLayer(a)))return;w=b.createStyleLayer(a)}else{if("object"==typeof a.source&&(this.addSource(y,a.source),a=b.clone$1(a),a=b.extend(a,{source:y})),this._validate(b.validateStyle.layer,`layers.${y}`,a,{arrayIndex:-1},m))return;w=b.createStyleLayer(a),this._validateLayer(w),w.setEventedParent(this,{layer:{id:y}}),this._serializedLayers[w.id]=w.serialize()}const S=h?this._order.indexOf(h):this._order.length;if(h&&-1===S)this.fire(new b.ErrorEvent(new Error(`Cannot add layer "${y}" before non-existing layer "${h}".`)));else{if(this._order.splice(S,0,y),this._layerOrderChanged=!0,this._layers[y]=w,this._removedLayers[y]&&w.source&&"custom"!==w.type){const T=this._removedLayers[y];delete this._removedLayers[y],T.type!==w.type?this._updatedSources[w.source]="clear":(this._updatedSources[w.source]="reload",this.sourceCaches[w.source].pause())}this._updateLayer(w),w.onAdd&&w.onAdd(this.map)}}moveLayer(a,h){if(this._checkLoaded(),this._changed=!0,!this._layers[a])return void this.fire(new b.ErrorEvent(new Error(`The layer '${a}' does not exist in the map's style and cannot be moved.`)));if(a===h)return;const m=this._order.indexOf(a);this._order.splice(m,1);const y=h?this._order.indexOf(h):this._order.length;h&&-1===y?this.fire(new b.ErrorEvent(new Error(`Cannot move layer "${a}" before non-existing layer "${h}".`))):(this._order.splice(y,0,a),this._layerOrderChanged=!0)}removeLayer(a){this._checkLoaded();const h=this._layers[a];if(!h)return void this.fire(new b.ErrorEvent(new Error(`Cannot remove non-existing layer "${a}".`)));h.setEventedParent(null);const m=this._order.indexOf(a);this._order.splice(m,1),this._layerOrderChanged=!0,this._changed=!0,this._removedLayers[a]=h,delete this._layers[a],delete this._serializedLayers[a],delete this._updatedLayers[a],delete this._updatedPaintProps[a],h.onRemove&&h.onRemove(this.map)}getLayer(a){return this._layers[a]}hasLayer(a){return a in this._layers}setLayerZoomRange(a,h,m){this._checkLoaded();const y=this.getLayer(a);y?y.minzoom===h&&y.maxzoom===m||(null!=h&&(y.minzoom=h),null!=m&&(y.maxzoom=m),this._updateLayer(y)):this.fire(new b.ErrorEvent(new Error(`Cannot set the zoom range of non-existing layer "${a}".`)))}setFilter(a,h,m={}){this._checkLoaded();const y=this.getLayer(a);if(y){if(!Zt(y.filter,h))return null==h?(y.filter=void 0,void this._updateLayer(y)):void(this._validate(b.validateStyle.filter,`layers.${y.id}.filter`,h,null,m)||(y.filter=b.clone$1(h),this._updateLayer(y)))}else this.fire(new b.ErrorEvent(new Error(`Cannot filter non-existing layer "${a}".`)))}getFilter(a){return b.clone$1(this.getLayer(a).filter)}setLayoutProperty(a,h,m,y={}){this._checkLoaded();const w=this.getLayer(a);w?Zt(w.getLayoutProperty(h),m)||(w.setLayoutProperty(h,m,y),this._updateLayer(w)):this.fire(new b.ErrorEvent(new Error(`Cannot style non-existing layer "${a}".`)))}getLayoutProperty(a,h){const m=this.getLayer(a);if(m)return m.getLayoutProperty(h);this.fire(new b.ErrorEvent(new Error(`Cannot get style of non-existing layer "${a}".`)))}setPaintProperty(a,h,m,y={}){this._checkLoaded();const w=this.getLayer(a);w?Zt(w.getPaintProperty(h),m)||(w.setPaintProperty(h,m,y)&&this._updateLayer(w),this._changed=!0,this._updatedPaintProps[a]=!0):this.fire(new b.ErrorEvent(new Error(`Cannot style non-existing layer "${a}".`)))}getPaintProperty(a,h){return this.getLayer(a).getPaintProperty(h)}setFeatureState(a,h){this._checkLoaded();const m=a.source,y=a.sourceLayer,w=this.sourceCaches[m];if(void 0===w)return void this.fire(new b.ErrorEvent(new Error(`The source '${m}' does not exist in the map's style.`)));const S=w.getSource().type;"geojson"===S&&y?this.fire(new b.ErrorEvent(new Error("GeoJSON sources cannot have a sourceLayer parameter."))):"vector"!==S||y?(void 0===a.id&&this.fire(new b.ErrorEvent(new Error("The feature id parameter must be provided."))),w.setFeatureState(y,a.id,h)):this.fire(new b.ErrorEvent(new Error("The sourceLayer parameter must be provided for vector source types.")))}removeFeatureState(a,h){this._checkLoaded();const m=a.source,y=this.sourceCaches[m];if(void 0===y)return void this.fire(new b.ErrorEvent(new Error(`The source '${m}' does not exist in the map's style.`)));const w=y.getSource().type,S="vector"===w?a.sourceLayer:void 0;"vector"!==w||S?h&&"string"!=typeof a.id&&"number"!=typeof a.id?this.fire(new b.ErrorEvent(new Error("A feature id is required to remove its specific state property."))):y.removeFeatureState(S,a.id,h):this.fire(new b.ErrorEvent(new Error("The sourceLayer parameter must be provided for vector source types.")))}getFeatureState(a){this._checkLoaded();const h=a.source,m=a.sourceLayer,y=this.sourceCaches[h];if(void 0!==y)return"vector"!==y.getSource().type||m?(void 0===a.id&&this.fire(new b.ErrorEvent(new Error("The feature id parameter must be provided."))),y.getFeatureState(m,a.id)):void this.fire(new b.ErrorEvent(new Error("The sourceLayer parameter must be provided for vector source types.")));this.fire(new b.ErrorEvent(new Error(`The source '${h}' does not exist in the map's style.`)))}getTransition(){return b.extend({duration:300,delay:0},this.stylesheet&&this.stylesheet.transition)}serialize(){return b.filterObject({version:this.stylesheet.version,name:this.stylesheet.name,metadata:this.stylesheet.metadata,light:this.stylesheet.light,center:this.stylesheet.center,zoom:this.stylesheet.zoom,bearing:this.stylesheet.bearing,pitch:this.stylesheet.pitch,sprite:this.stylesheet.sprite,glyphs:this.stylesheet.glyphs,transition:this.stylesheet.transition,sources:b.mapObject(this.sourceCaches,a=>a.serialize()),layers:this._serializeLayers(this._order)},a=>void 0!==a)}_updateLayer(a){this._updatedLayers[a.id]=!0,a.source&&!this._updatedSources[a.source]&&"raster"!==this.sourceCaches[a.source].getSource().type&&(this._updatedSources[a.source]="reload",this.sourceCaches[a.source].pause()),this._changed=!0}_flattenAndSortRenderedFeatures(a){const h=S=>"fill-extrusion"===this._layers[S].type,m={},y=[];for(let S=this._order.length-1;S>=0;S--){const T=this._order[S];if(h(T)){m[T]=S;for(const k of a){const R=k[T];if(R)for(const z of R)y.push(z)}}}y.sort((S,T)=>T.intersectionZ-S.intersectionZ);const w=[];for(let S=this._order.length-1;S>=0;S--){const T=this._order[S];if(h(T))for(let k=y.length-1;k>=0;k--){const R=y[k].feature;if(m[R.layer.id]{const ke=ae.featureSortOrder;if(ke){const Be=ke.indexOf(De.featureIndex);return ke.indexOf(Se.featureIndex)-Be}return Se.featureIndex-De.featureIndex});for(const De of we)ie.push(De)}}for(const ae in Q)Q[ae].forEach(_e=>{const ye=_e.feature,ie=k[S[ae].source].getFeatureState(ye.layer["source-layer"],ye.id);ye.source=ye.layer.source,ye.layer["source-layer"]&&(ye.sourceLayer=ye.layer["source-layer"]),ye.state=ie});return Q}(this._layers,this._serializedLayers,this.sourceCaches,a,h,this.placement.collisionIndex,this.placement.retainedQueryData)),this._flattenAndSortRenderedFeatures(w)}querySourceFeatures(a,h){h&&h.filter&&this._validate(b.validateStyle.filter,"querySourceFeatures.filter",h.filter,null,h);const m=this.sourceCaches[a];return m?function(y,w){const S=y.getRenderableIds().map(R=>y.getTileByID(R)),T=[],k={};for(let R=0;Rj.getTileByID(Q)).sort((Q,ee)=>ee.tileID.overscaledZ-Q.tileID.overscaledZ||(Q.tileID.isLessThan(ee.tileID)?-1:1))}const L=this.crossTileSymbolIndex.addLayer(z,k[z.source],a.center.lng);S=S||L}if(this.crossTileSymbolIndex.pruneUnusedLayers(this._order),((w=w||this._layerOrderChanged||0===m)||!this.pauseablePlacement||this.pauseablePlacement.isDone()&&!this.placement.stillRecent(b.exported.now(),a.zoom))&&(this.pauseablePlacement=new Cr(a,this.map.terrain,this._order,w,h,m,y,this.placement),this._layerOrderChanged=!1),this.pauseablePlacement.isDone()?this.placement.setStale():(this.pauseablePlacement.continuePlacement(this._order,this._layers,k),this.pauseablePlacement.isDone()&&(this.placement=this.pauseablePlacement.commit(b.exported.now()),T=!0),S&&this.pauseablePlacement.placement.setStale()),T||S)for(const R of this._order){const z=this._layers[R];"symbol"===z.type&&this.placement.updateLayerOpacities(z,k[z.source])}return!this.pauseablePlacement.isDone()||this.placement.hasTransitions(b.exported.now())}_releaseSymbolFadeTiles(){for(const a in this.sourceCaches)this.sourceCaches[a].releaseSymbolFadeTiles()}getImages(a,h,m){this.imageManager.getImages(h.icons,m),this._updateTilesForChangedImages();const y=this.sourceCaches[h.source];y&&y.setDependencies(h.tileID.key,h.type,h.icons)}getGlyphs(a,h,m){this.glyphManager.getGlyphs(h.stacks,m);const y=this.sourceCaches[h.source];y&&y.setDependencies(h.tileID.key,h.type,[""])}getResource(a,h,m){return b.makeRequest(h,m)}getGlyphsUrl(){return this.stylesheet.glyphs||null}setGlyphs(a,h={}){this._checkLoaded(),a&&this._validate(b.validateStyle.glyphs,"glyphs",a,null,h)||(this._glyphsDidChange=!0,this.stylesheet.glyphs=a,this.glyphManager.entries={},this.glyphManager.setURL(a))}addSprite(a,h,m={},y){this._checkLoaded();const w=[{id:a,url:h}],S=[...hs(this.stylesheet.sprite),...w];this._validate(b.validateStyle.sprite,"sprite",S,null,m)||(this.stylesheet.sprite=S,this._loadSprite(w,!0,y))}removeSprite(a){this._checkLoaded();const h=hs(this.stylesheet.sprite);if(h.find(m=>m.id===a)){if(this._spritesImagesIds[a])for(const m of this._spritesImagesIds[a])this.imageManager.removeImage(m),this._changedImages[m]=!0;h.splice(h.findIndex(m=>m.id===a),1),this.stylesheet.sprite=h.length>0?h:void 0,delete this._spritesImagesIds[a],this._availableImages=this.imageManager.listImages(),this._changed=!0,this.dispatcher.broadcast("setImages",this._availableImages),this.fire(new b.Event("data",{dataType:"style"}))}else this.fire(new b.ErrorEvent(new Error(`Sprite "${a}" doesn't exists on this map.`)))}getSprite(){return hs(this.stylesheet.sprite)}setSprite(a,h={},m){this._checkLoaded(),a&&this._validate(b.validateStyle.sprite,"sprite",a,null,h)||(this.stylesheet.sprite=a,a?this._loadSprite(a,!0,m):(this._unloadSprite(),m(null)))}}Mt.getSourceType=function(g){return Ol[g]},Mt.setSourceType=function(g,a){Ol[g]=a},Mt.registerForPluginStateChange=b.registerForPluginStateChange;var Vl=b.createLayout([{name:"a_pos",type:"Int16",components:2}]),Rf="attribute vec3 a_pos3d;uniform mat4 u_matrix;uniform float u_ele_delta;varying vec2 v_texture_pos;varying float v_depth;void main() {float extent=8192.0;float ele_delta=a_pos3d.z==1.0 ? u_ele_delta : 0.0;v_texture_pos=a_pos3d.xy/extent;gl_Position=u_matrix*vec4(a_pos3d.xy,get_elevation(a_pos3d.xy)-ele_delta,1.0);v_depth=gl_Position.z/gl_Position.w;}";const nt={prelude:wn("#ifdef GL_ES\nprecision mediump float;\n#else\n#if !defined(lowp)\n#define lowp\n#endif\n#if !defined(mediump)\n#define mediump\n#endif\n#if !defined(highp)\n#define highp\n#endif\n#endif","#ifdef GL_ES\nprecision highp float;\n#else\n#if !defined(lowp)\n#define lowp\n#endif\n#if !defined(mediump)\n#define mediump\n#endif\n#if !defined(highp)\n#define highp\n#endif\n#endif\nvec2 unpack_float(const float packedValue) {int packedIntValue=int(packedValue);int v0=packedIntValue/256;return vec2(v0,packedIntValue-v0*256);}vec2 unpack_opacity(const float packedOpacity) {int intOpacity=int(packedOpacity)/2;return vec2(float(intOpacity)/127.0,mod(packedOpacity,2.0));}vec4 decode_color(const vec2 encodedColor) {return vec4(unpack_float(encodedColor[0])/255.0,unpack_float(encodedColor[1])/255.0\n);}float unpack_mix_vec2(const vec2 packedValue,const float t) {return mix(packedValue[0],packedValue[1],t);}vec4 unpack_mix_color(const vec4 packedColors,const float t) {vec4 minColor=decode_color(vec2(packedColors[0],packedColors[1]));vec4 maxColor=decode_color(vec2(packedColors[2],packedColors[3]));return mix(minColor,maxColor,t);}vec2 get_pattern_pos(const vec2 pixel_coord_upper,const vec2 pixel_coord_lower,const vec2 pattern_size,const float tile_units_to_pixels,const vec2 pos) {vec2 offset=mod(mod(mod(pixel_coord_upper,pattern_size)*256.0,pattern_size)*256.0+pixel_coord_lower,pattern_size);return (tile_units_to_pixels*pos+offset)/pattern_size;}\n#ifdef TERRAIN3D\nuniform sampler2D u_terrain;uniform float u_terrain_dim;uniform mat4 u_terrain_matrix;uniform vec4 u_terrain_unpack;uniform float u_terrain_exaggeration;uniform highp sampler2D u_depth;\n#endif\nconst highp vec4 bitSh=vec4(256.*256.*256.,256.*256.,256.,1.);const highp vec4 bitShifts=vec4(1.)/bitSh;highp float unpack(highp vec4 color) {return dot(color,bitShifts);}highp float depthOpacity(vec3 frag) {\n#ifdef TERRAIN3D\nhighp float d=unpack(texture2D(u_depth,frag.xy*0.5+0.5))+0.0001-frag.z;return 1.0-max(0.0,min(1.0,-d*500.0));\n#else\nreturn 1.0;\n#endif\n}float calculate_visibility(vec4 pos) {\n#ifdef TERRAIN3D\nvec3 frag=pos.xyz/pos.w;highp float d=depthOpacity(frag);if (d > 0.95) return 1.0;return (d+depthOpacity(frag+vec3(0.0,0.01,0.0)))/2.0;\n#else\nreturn 1.0;\n#endif\n}float ele(vec2 pos) {\n#ifdef TERRAIN3D\nvec4 rgb=(texture2D(u_terrain,pos)*255.0)*u_terrain_unpack;return rgb.r+rgb.g+rgb.b-u_terrain_unpack.a;\n#else\nreturn 0.0;\n#endif\n}float get_elevation(vec2 pos) {\n#ifdef TERRAIN3D\nvec2 coord=(u_terrain_matrix*vec4(pos,0.0,1.0)).xy*u_terrain_dim+1.0;vec2 f=fract(coord);vec2 c=(floor(coord)+0.5)/(u_terrain_dim+2.0);float d=1.0/(u_terrain_dim+2.0);float tl=ele(c);float tr=ele(c+vec2(d,0.0));float bl=ele(c+vec2(0.0,d));float br=ele(c+vec2(d,d));float elevation=mix(mix(tl,tr,f.x),mix(bl,br,f.x),f.y);return elevation*u_terrain_exaggeration;\n#else\nreturn 0.0;\n#endif\n}"),background:wn("uniform vec4 u_color;uniform float u_opacity;void main() {gl_FragColor=u_color*u_opacity;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","attribute vec2 a_pos;uniform mat4 u_matrix;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);}"),backgroundPattern:wn("uniform vec2 u_pattern_tl_a;uniform vec2 u_pattern_br_a;uniform vec2 u_pattern_tl_b;uniform vec2 u_pattern_br_b;uniform vec2 u_texsize;uniform float u_mix;uniform float u_opacity;uniform sampler2D u_image;varying vec2 v_pos_a;varying vec2 v_pos_b;void main() {vec2 imagecoord=mod(v_pos_a,1.0);vec2 pos=mix(u_pattern_tl_a/u_texsize,u_pattern_br_a/u_texsize,imagecoord);vec4 color1=texture2D(u_image,pos);vec2 imagecoord_b=mod(v_pos_b,1.0);vec2 pos2=mix(u_pattern_tl_b/u_texsize,u_pattern_br_b/u_texsize,imagecoord_b);vec4 color2=texture2D(u_image,pos2);gl_FragColor=mix(color1,color2,u_mix)*u_opacity;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform vec2 u_pattern_size_a;uniform vec2 u_pattern_size_b;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform float u_scale_a;uniform float u_scale_b;uniform float u_tile_units_to_pixels;attribute vec2 a_pos;varying vec2 v_pos_a;varying vec2 v_pos_b;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);v_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,u_scale_a*u_pattern_size_a,u_tile_units_to_pixels,a_pos);v_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,u_scale_b*u_pattern_size_b,u_tile_units_to_pixels,a_pos);}"),circle:wn("varying vec3 v_data;varying float v_visibility;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define mediump float radius\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define highp vec4 stroke_color\n#pragma mapbox: define mediump float stroke_width\n#pragma mapbox: define lowp float stroke_opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize mediump float radius\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize highp vec4 stroke_color\n#pragma mapbox: initialize mediump float stroke_width\n#pragma mapbox: initialize lowp float stroke_opacity\nvec2 extrude=v_data.xy;float extrude_length=length(extrude);lowp float antialiasblur=v_data.z;float antialiased_blur=-max(blur,antialiasblur);float opacity_t=smoothstep(0.0,antialiased_blur,extrude_length-1.0);float color_t=stroke_width < 0.01 ? 0.0 : smoothstep(antialiased_blur,0.0,extrude_length-radius/(radius+stroke_width));gl_FragColor=v_visibility*opacity_t*mix(color*opacity,stroke_color*stroke_opacity,color_t);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform bool u_scale_with_map;uniform bool u_pitch_with_map;uniform vec2 u_extrude_scale;uniform lowp float u_device_pixel_ratio;uniform highp float u_camera_to_center_distance;attribute vec2 a_pos;varying vec3 v_data;varying float v_visibility;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define mediump float radius\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define highp vec4 stroke_color\n#pragma mapbox: define mediump float stroke_width\n#pragma mapbox: define lowp float stroke_opacity\nvoid main(void) {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize mediump float radius\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize highp vec4 stroke_color\n#pragma mapbox: initialize mediump float stroke_width\n#pragma mapbox: initialize lowp float stroke_opacity\nvec2 extrude=vec2(mod(a_pos,2.0)*2.0-1.0);vec2 circle_center=floor(a_pos*0.5);float ele=get_elevation(circle_center);v_visibility=calculate_visibility(u_matrix*vec4(circle_center,ele,1.0));if (u_pitch_with_map) {vec2 corner_position=circle_center;if (u_scale_with_map) {corner_position+=extrude*(radius+stroke_width)*u_extrude_scale;} else {vec4 projected_center=u_matrix*vec4(circle_center,0,1);corner_position+=extrude*(radius+stroke_width)*u_extrude_scale*(projected_center.w/u_camera_to_center_distance);}gl_Position=u_matrix*vec4(corner_position,ele,1);} else {gl_Position=u_matrix*vec4(circle_center,ele,1);if (u_scale_with_map) {gl_Position.xy+=extrude*(radius+stroke_width)*u_extrude_scale*u_camera_to_center_distance;} else {gl_Position.xy+=extrude*(radius+stroke_width)*u_extrude_scale*gl_Position.w;}}lowp float antialiasblur=1.0/u_device_pixel_ratio/(radius+stroke_width);v_data=vec3(extrude.x,extrude.y,antialiasblur);}"),clippingMask:wn("void main() {gl_FragColor=vec4(1.0);}","attribute vec2 a_pos;uniform mat4 u_matrix;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);}"),heatmap:wn("uniform highp float u_intensity;varying vec2 v_extrude;\n#pragma mapbox: define highp float weight\n#define GAUSS_COEF 0.3989422804014327\nvoid main() {\n#pragma mapbox: initialize highp float weight\nfloat d=-0.5*3.0*3.0*dot(v_extrude,v_extrude);float val=weight*u_intensity*GAUSS_COEF*exp(d);gl_FragColor=vec4(val,1.0,1.0,1.0);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform float u_extrude_scale;uniform float u_opacity;uniform float u_intensity;attribute vec2 a_pos;varying vec2 v_extrude;\n#pragma mapbox: define highp float weight\n#pragma mapbox: define mediump float radius\nconst highp float ZERO=1.0/255.0/16.0;\n#define GAUSS_COEF 0.3989422804014327\nvoid main(void) {\n#pragma mapbox: initialize highp float weight\n#pragma mapbox: initialize mediump float radius\nvec2 unscaled_extrude=vec2(mod(a_pos,2.0)*2.0-1.0);float S=sqrt(-2.0*log(ZERO/weight/u_intensity/GAUSS_COEF))/3.0;v_extrude=S*unscaled_extrude;vec2 extrude=v_extrude*radius*u_extrude_scale;vec4 pos=vec4(floor(a_pos*0.5)+extrude,0,1);gl_Position=u_matrix*pos;}"),heatmapTexture:wn("uniform sampler2D u_image;uniform sampler2D u_color_ramp;uniform float u_opacity;varying vec2 v_pos;void main() {float t=texture2D(u_image,v_pos).r;vec4 color=texture2D(u_color_ramp,vec2(t,0.5));gl_FragColor=color*u_opacity;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(0.0);\n#endif\n}","uniform mat4 u_matrix;uniform vec2 u_world;attribute vec2 a_pos;varying vec2 v_pos;void main() {gl_Position=u_matrix*vec4(a_pos*u_world,0,1);v_pos.x=a_pos.x;v_pos.y=1.0-a_pos.y;}"),collisionBox:wn("varying float v_placed;varying float v_notUsed;void main() {float alpha=0.5;gl_FragColor=vec4(1.0,0.0,0.0,1.0)*alpha;if (v_placed > 0.5) {gl_FragColor=vec4(0.0,0.0,1.0,0.5)*alpha;}if (v_notUsed > 0.5) {gl_FragColor*=.1;}}","attribute vec2 a_pos;attribute vec2 a_anchor_pos;attribute vec2 a_extrude;attribute vec2 a_placed;attribute vec2 a_shift;uniform mat4 u_matrix;uniform vec2 u_extrude_scale;uniform float u_camera_to_center_distance;varying float v_placed;varying float v_notUsed;void main() {vec4 projectedPoint=u_matrix*vec4(a_anchor_pos,0,1);highp float camera_to_anchor_distance=projectedPoint.w;highp float collision_perspective_ratio=clamp(0.5+0.5*(u_camera_to_center_distance/camera_to_anchor_distance),0.0,4.0);gl_Position=u_matrix*vec4(a_pos,get_elevation(a_pos),1.0);gl_Position.xy+=(a_extrude+a_shift)*u_extrude_scale*gl_Position.w*collision_perspective_ratio;v_placed=a_placed.x;v_notUsed=a_placed.y;}"),collisionCircle:wn("varying float v_radius;varying vec2 v_extrude;varying float v_perspective_ratio;varying float v_collision;void main() {float alpha=0.5*min(v_perspective_ratio,1.0);float stroke_radius=0.9*max(v_perspective_ratio,1.0);float distance_to_center=length(v_extrude);float distance_to_edge=abs(distance_to_center-v_radius);float opacity_t=smoothstep(-stroke_radius,0.0,-distance_to_edge);vec4 color=mix(vec4(0.0,0.0,1.0,0.5),vec4(1.0,0.0,0.0,1.0),v_collision);gl_FragColor=color*alpha*opacity_t;}","attribute vec2 a_pos;attribute float a_radius;attribute vec2 a_flags;uniform mat4 u_matrix;uniform mat4 u_inv_matrix;uniform vec2 u_viewport_size;uniform float u_camera_to_center_distance;varying float v_radius;varying vec2 v_extrude;varying float v_perspective_ratio;varying float v_collision;vec3 toTilePosition(vec2 screenPos) {vec4 rayStart=u_inv_matrix*vec4(screenPos,-1.0,1.0);vec4 rayEnd =u_inv_matrix*vec4(screenPos, 1.0,1.0);rayStart.xyz/=rayStart.w;rayEnd.xyz /=rayEnd.w;highp float t=(0.0-rayStart.z)/(rayEnd.z-rayStart.z);return mix(rayStart.xyz,rayEnd.xyz,t);}void main() {vec2 quadCenterPos=a_pos;float radius=a_radius;float collision=a_flags.x;float vertexIdx=a_flags.y;vec2 quadVertexOffset=vec2(mix(-1.0,1.0,float(vertexIdx >=2.0)),mix(-1.0,1.0,float(vertexIdx >=1.0 && vertexIdx <=2.0)));vec2 quadVertexExtent=quadVertexOffset*radius;vec3 tilePos=toTilePosition(quadCenterPos);vec4 clipPos=u_matrix*vec4(tilePos,1.0);highp float camera_to_anchor_distance=clipPos.w;highp float collision_perspective_ratio=clamp(0.5+0.5*(u_camera_to_center_distance/camera_to_anchor_distance),0.0,4.0);float padding_factor=1.2;v_radius=radius;v_extrude=quadVertexExtent*padding_factor;v_perspective_ratio=collision_perspective_ratio;v_collision=collision;gl_Position=vec4(clipPos.xyz/clipPos.w,1.0)+vec4(quadVertexExtent*padding_factor/u_viewport_size*2.0,0.0,0.0);}"),debug:wn("uniform highp vec4 u_color;uniform sampler2D u_overlay;varying vec2 v_uv;void main() {vec4 overlay_color=texture2D(u_overlay,v_uv);gl_FragColor=mix(u_color,overlay_color,overlay_color.a);}","attribute vec2 a_pos;varying vec2 v_uv;uniform mat4 u_matrix;uniform float u_overlay_scale;void main() {v_uv=a_pos/8192.0;gl_Position=u_matrix*vec4(a_pos*u_overlay_scale,get_elevation(a_pos),1);}"),fill:wn("#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float opacity\ngl_FragColor=color*opacity;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","attribute vec2 a_pos;uniform mat4 u_matrix;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float opacity\ngl_Position=u_matrix*vec4(a_pos,0,1);}"),fillOutline:wn("varying vec2 v_pos;\n#pragma mapbox: define highp vec4 outline_color\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 outline_color\n#pragma mapbox: initialize lowp float opacity\nfloat dist=length(v_pos-gl_FragCoord.xy);float alpha=1.0-smoothstep(0.0,1.0,dist);gl_FragColor=outline_color*(alpha*opacity);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","attribute vec2 a_pos;uniform mat4 u_matrix;uniform vec2 u_world;varying vec2 v_pos;\n#pragma mapbox: define highp vec4 outline_color\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 outline_color\n#pragma mapbox: initialize lowp float opacity\ngl_Position=u_matrix*vec4(a_pos,0,1);v_pos=(gl_Position.xy/gl_Position.w+1.0)/2.0*u_world;}"),fillOutlinePattern:wn("uniform vec2 u_texsize;uniform sampler2D u_image;uniform float u_fade;varying vec2 v_pos_a;varying vec2 v_pos_b;varying vec2 v_pos;\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;vec2 imagecoord=mod(v_pos_a,1.0);vec2 pos=mix(pattern_tl_a/u_texsize,pattern_br_a/u_texsize,imagecoord);vec4 color1=texture2D(u_image,pos);vec2 imagecoord_b=mod(v_pos_b,1.0);vec2 pos2=mix(pattern_tl_b/u_texsize,pattern_br_b/u_texsize,imagecoord_b);vec4 color2=texture2D(u_image,pos2);float dist=length(v_pos-gl_FragCoord.xy);float alpha=1.0-smoothstep(0.0,1.0,dist);gl_FragColor=mix(color1,color2,u_fade)*alpha*opacity;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform vec2 u_world;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform vec3 u_scale;attribute vec2 a_pos;varying vec2 v_pos_a;varying vec2 v_pos_b;varying vec2 v_pos;\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\n#pragma mapbox: define lowp float pixel_ratio_from\n#pragma mapbox: define lowp float pixel_ratio_to\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\n#pragma mapbox: initialize lowp float pixel_ratio_from\n#pragma mapbox: initialize lowp float pixel_ratio_to\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float tileRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;gl_Position=u_matrix*vec4(a_pos,0,1);vec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;vec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to;v_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,fromScale*display_size_a,tileRatio,a_pos);v_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,toScale*display_size_b,tileRatio,a_pos);v_pos=(gl_Position.xy/gl_Position.w+1.0)/2.0*u_world;}"),fillPattern:wn("#ifdef GL_ES\nprecision highp float;\n#endif\nuniform vec2 u_texsize;uniform float u_fade;uniform sampler2D u_image;varying vec2 v_pos_a;varying vec2 v_pos_b;\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;vec2 imagecoord=mod(v_pos_a,1.0);vec2 pos=mix(pattern_tl_a/u_texsize,pattern_br_a/u_texsize,imagecoord);vec4 color1=texture2D(u_image,pos);vec2 imagecoord_b=mod(v_pos_b,1.0);vec2 pos2=mix(pattern_tl_b/u_texsize,pattern_br_b/u_texsize,imagecoord_b);vec4 color2=texture2D(u_image,pos2);gl_FragColor=mix(color1,color2,u_fade)*opacity;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform vec3 u_scale;attribute vec2 a_pos;varying vec2 v_pos_a;varying vec2 v_pos_b;\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\n#pragma mapbox: define lowp float pixel_ratio_from\n#pragma mapbox: define lowp float pixel_ratio_to\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\n#pragma mapbox: initialize lowp float pixel_ratio_from\n#pragma mapbox: initialize lowp float pixel_ratio_to\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float tileZoomRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;vec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;vec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to;gl_Position=u_matrix*vec4(a_pos,0,1);v_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,fromScale*display_size_a,tileZoomRatio,a_pos);v_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,toScale*display_size_b,tileZoomRatio,a_pos);}"),fillExtrusion:wn("varying vec4 v_color;void main() {gl_FragColor=v_color;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform vec3 u_lightcolor;uniform lowp vec3 u_lightpos;uniform lowp float u_lightintensity;uniform float u_vertical_gradient;uniform lowp float u_opacity;attribute vec2 a_pos;attribute vec4 a_normal_ed;\n#ifdef TERRAIN3D\nattribute vec2 a_centroid;\n#endif\nvarying vec4 v_color;\n#pragma mapbox: define highp float base\n#pragma mapbox: define highp float height\n#pragma mapbox: define highp vec4 color\nvoid main() {\n#pragma mapbox: initialize highp float base\n#pragma mapbox: initialize highp float height\n#pragma mapbox: initialize highp vec4 color\nvec3 normal=a_normal_ed.xyz;\n#ifdef TERRAIN3D\nfloat baseDelta=10.0;float ele=get_elevation(a_centroid);\n#else\nfloat baseDelta=0.0;float ele=0.0;\n#endif\nbase=max(0.0,ele+base-baseDelta);height=max(0.0,ele+height);float t=mod(normal.x,2.0);gl_Position=u_matrix*vec4(a_pos,t > 0.0 ? height : base,1);float colorvalue=color.r*0.2126+color.g*0.7152+color.b*0.0722;v_color=vec4(0.0,0.0,0.0,1.0);vec4 ambientlight=vec4(0.03,0.03,0.03,1.0);color+=ambientlight;float directional=clamp(dot(normal/16384.0,u_lightpos),0.0,1.0);directional=mix((1.0-u_lightintensity),max((1.0-colorvalue+u_lightintensity),1.0),directional);if (normal.y !=0.0) {directional*=((1.0-u_vertical_gradient)+(u_vertical_gradient*clamp((t+base)*pow(height/150.0,0.5),mix(0.7,0.98,1.0-u_lightintensity),1.0)));}v_color.r+=clamp(color.r*directional*u_lightcolor.r,mix(0.0,0.3,1.0-u_lightcolor.r),1.0);v_color.g+=clamp(color.g*directional*u_lightcolor.g,mix(0.0,0.3,1.0-u_lightcolor.g),1.0);v_color.b+=clamp(color.b*directional*u_lightcolor.b,mix(0.0,0.3,1.0-u_lightcolor.b),1.0);v_color*=u_opacity;}"),fillExtrusionPattern:wn("uniform vec2 u_texsize;uniform float u_fade;uniform sampler2D u_image;varying vec2 v_pos_a;varying vec2 v_pos_b;varying vec4 v_lighting;\n#pragma mapbox: define lowp float base\n#pragma mapbox: define lowp float height\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\n#pragma mapbox: define lowp float pixel_ratio_from\n#pragma mapbox: define lowp float pixel_ratio_to\nvoid main() {\n#pragma mapbox: initialize lowp float base\n#pragma mapbox: initialize lowp float height\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\n#pragma mapbox: initialize lowp float pixel_ratio_from\n#pragma mapbox: initialize lowp float pixel_ratio_to\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;vec2 imagecoord=mod(v_pos_a,1.0);vec2 pos=mix(pattern_tl_a/u_texsize,pattern_br_a/u_texsize,imagecoord);vec4 color1=texture2D(u_image,pos);vec2 imagecoord_b=mod(v_pos_b,1.0);vec2 pos2=mix(pattern_tl_b/u_texsize,pattern_br_b/u_texsize,imagecoord_b);vec4 color2=texture2D(u_image,pos2);vec4 mixedColor=mix(color1,color2,u_fade);gl_FragColor=mixedColor*v_lighting;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform float u_height_factor;uniform vec3 u_scale;uniform float u_vertical_gradient;uniform lowp float u_opacity;uniform vec3 u_lightcolor;uniform lowp vec3 u_lightpos;uniform lowp float u_lightintensity;attribute vec2 a_pos;attribute vec4 a_normal_ed;\n#ifdef TERRAIN3D\nattribute vec2 a_centroid;\n#endif\nvarying vec2 v_pos_a;varying vec2 v_pos_b;varying vec4 v_lighting;\n#pragma mapbox: define lowp float base\n#pragma mapbox: define lowp float height\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\n#pragma mapbox: define lowp float pixel_ratio_from\n#pragma mapbox: define lowp float pixel_ratio_to\nvoid main() {\n#pragma mapbox: initialize lowp float base\n#pragma mapbox: initialize lowp float height\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\n#pragma mapbox: initialize lowp float pixel_ratio_from\n#pragma mapbox: initialize lowp float pixel_ratio_to\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float tileRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;vec3 normal=a_normal_ed.xyz;float edgedistance=a_normal_ed.w;vec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;vec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to;\n#ifdef TERRAIN3D\nfloat baseDelta=10.0;float ele=get_elevation(a_centroid);\n#else\nfloat baseDelta=0.0;float ele=0.0;\n#endif\nbase=max(0.0,ele+base-baseDelta);height=max(0.0,ele+height);float t=mod(normal.x,2.0);float z=t > 0.0 ? height : base;gl_Position=u_matrix*vec4(a_pos,z,1);vec2 pos=normal.x==1.0 && normal.y==0.0 && normal.z==16384.0\n? a_pos\n: vec2(edgedistance,z*u_height_factor);v_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,fromScale*display_size_a,tileRatio,pos);v_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,toScale*display_size_b,tileRatio,pos);v_lighting=vec4(0.0,0.0,0.0,1.0);float directional=clamp(dot(normal/16383.0,u_lightpos),0.0,1.0);directional=mix((1.0-u_lightintensity),max((0.5+u_lightintensity),1.0),directional);if (normal.y !=0.0) {directional*=((1.0-u_vertical_gradient)+(u_vertical_gradient*clamp((t+base)*pow(height/150.0,0.5),mix(0.7,0.98,1.0-u_lightintensity),1.0)));}v_lighting.rgb+=clamp(directional*u_lightcolor,mix(vec3(0.0),vec3(0.3),1.0-u_lightcolor),vec3(1.0));v_lighting*=u_opacity;}"),hillshadePrepare:wn("#ifdef GL_ES\nprecision highp float;\n#endif\nuniform sampler2D u_image;varying vec2 v_pos;uniform vec2 u_dimension;uniform float u_zoom;uniform vec4 u_unpack;float getElevation(vec2 coord,float bias) {vec4 data=texture2D(u_image,coord)*255.0;data.a=-1.0;return dot(data,u_unpack)/4.0;}void main() {vec2 epsilon=1.0/u_dimension;float a=getElevation(v_pos+vec2(-epsilon.x,-epsilon.y),0.0);float b=getElevation(v_pos+vec2(0,-epsilon.y),0.0);float c=getElevation(v_pos+vec2(epsilon.x,-epsilon.y),0.0);float d=getElevation(v_pos+vec2(-epsilon.x,0),0.0);float e=getElevation(v_pos,0.0);float f=getElevation(v_pos+vec2(epsilon.x,0),0.0);float g=getElevation(v_pos+vec2(-epsilon.x,epsilon.y),0.0);float h=getElevation(v_pos+vec2(0,epsilon.y),0.0);float i=getElevation(v_pos+vec2(epsilon.x,epsilon.y),0.0);float exaggerationFactor=u_zoom < 2.0 ? 0.4 : u_zoom < 4.5 ? 0.35 : 0.3;float exaggeration=u_zoom < 15.0 ? (u_zoom-15.0)*exaggerationFactor : 0.0;vec2 deriv=vec2((c+f+f+i)-(a+d+d+g),(g+h+h+i)-(a+b+b+c))/pow(2.0,exaggeration+(19.2562-u_zoom));gl_FragColor=clamp(vec4(deriv.x/2.0+0.5,deriv.y/2.0+0.5,1.0,1.0),0.0,1.0);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform vec2 u_dimension;attribute vec2 a_pos;attribute vec2 a_texture_pos;varying vec2 v_pos;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);highp vec2 epsilon=1.0/u_dimension;float scale=(u_dimension.x-2.0)/u_dimension.x;v_pos=(a_texture_pos/8192.0)*scale+epsilon;}"),hillshade:wn("uniform sampler2D u_image;varying vec2 v_pos;uniform vec2 u_latrange;uniform vec2 u_light;uniform vec4 u_shadow;uniform vec4 u_highlight;uniform vec4 u_accent;\n#define PI 3.141592653589793\nvoid main() {vec4 pixel=texture2D(u_image,v_pos);vec2 deriv=((pixel.rg*2.0)-1.0);float scaleFactor=cos(radians((u_latrange[0]-u_latrange[1])*(1.0-v_pos.y)+u_latrange[1]));float slope=atan(1.25*length(deriv)/scaleFactor);float aspect=deriv.x !=0.0 ? atan(deriv.y,-deriv.x) : PI/2.0*(deriv.y > 0.0 ? 1.0 :-1.0);float intensity=u_light.x;float azimuth=u_light.y+PI;float base=1.875-intensity*1.75;float maxValue=0.5*PI;float scaledSlope=intensity !=0.5 ? ((pow(base,slope)-1.0)/(pow(base,maxValue)-1.0))*maxValue : slope;float accent=cos(scaledSlope);vec4 accent_color=(1.0-accent)*u_accent*clamp(intensity*2.0,0.0,1.0);float shade=abs(mod((aspect+azimuth)/PI+0.5,2.0)-1.0);vec4 shade_color=mix(u_shadow,u_highlight,shade)*sin(scaledSlope)*clamp(intensity*2.0,0.0,1.0);gl_FragColor=accent_color*(1.0-shade_color.a)+shade_color;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;attribute vec2 a_pos;attribute vec2 a_texture_pos;varying vec2 v_pos;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);v_pos=a_texture_pos/8192.0;}"),line:wn("uniform lowp float u_device_pixel_ratio;varying vec2 v_width2;varying vec2 v_normal;varying float v_gamma_scale;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\nfloat dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);gl_FragColor=color*(alpha*opacity);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","\n#define scale 0.015873016\nattribute vec2 a_pos_normal;attribute vec4 a_data;uniform mat4 u_matrix;uniform mediump float u_ratio;uniform vec2 u_units_to_pixels;uniform lowp float u_device_pixel_ratio;varying vec2 v_normal;varying vec2 v_width2;varying float v_gamma_scale;varying highp float v_linesofar;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define mediump float gapwidth\n#pragma mapbox: define lowp float offset\n#pragma mapbox: define mediump float width\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump float gapwidth\n#pragma mapbox: initialize lowp float offset\n#pragma mapbox: initialize mediump float width\nfloat ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;v_linesofar=(floor(a_data.z/4.0)+a_data.w*64.0)*2.0;vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);vec4 projected_extrude=u_matrix*vec4(dist/u_ratio,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude;\n#ifdef TERRAIN3D\nv_gamma_scale=1.0;\n#else\nfloat extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length(projected_extrude.xy/gl_Position.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective;\n#endif\nv_width2=vec2(outset,inset);}"),lineGradient:wn("uniform lowp float u_device_pixel_ratio;uniform sampler2D u_image;varying vec2 v_width2;varying vec2 v_normal;varying float v_gamma_scale;varying highp vec2 v_uv;\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\nfloat dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);vec4 color=texture2D(u_image,v_uv);gl_FragColor=color*(alpha*opacity);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","\n#define scale 0.015873016\nattribute vec2 a_pos_normal;attribute vec4 a_data;attribute float a_uv_x;attribute float a_split_index;uniform mat4 u_matrix;uniform mediump float u_ratio;uniform lowp float u_device_pixel_ratio;uniform vec2 u_units_to_pixels;uniform float u_image_height;varying vec2 v_normal;varying vec2 v_width2;varying float v_gamma_scale;varying highp vec2 v_uv;\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define mediump float gapwidth\n#pragma mapbox: define lowp float offset\n#pragma mapbox: define mediump float width\nvoid main() {\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump float gapwidth\n#pragma mapbox: initialize lowp float offset\n#pragma mapbox: initialize mediump float width\nfloat ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;highp float texel_height=1.0/u_image_height;highp float half_texel_height=0.5*texel_height;v_uv=vec2(a_uv_x,a_split_index*texel_height-half_texel_height);vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);vec4 projected_extrude=u_matrix*vec4(dist/u_ratio,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude;\n#ifdef TERRAIN3D\nv_gamma_scale=1.0;\n#else\nfloat extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length(projected_extrude.xy/gl_Position.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective;\n#endif\nv_width2=vec2(outset,inset);}"),linePattern:wn("#ifdef GL_ES\nprecision highp float;\n#endif\nuniform lowp float u_device_pixel_ratio;uniform vec2 u_texsize;uniform float u_fade;uniform mediump vec3 u_scale;uniform sampler2D u_image;varying vec2 v_normal;varying vec2 v_width2;varying float v_linesofar;varying float v_gamma_scale;varying float v_width;\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\n#pragma mapbox: define lowp float pixel_ratio_from\n#pragma mapbox: define lowp float pixel_ratio_to\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\n#pragma mapbox: initialize lowp float pixel_ratio_from\n#pragma mapbox: initialize lowp float pixel_ratio_to\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float tileZoomRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;vec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;vec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to;vec2 pattern_size_a=vec2(display_size_a.x*fromScale/tileZoomRatio,display_size_a.y);vec2 pattern_size_b=vec2(display_size_b.x*toScale/tileZoomRatio,display_size_b.y);float aspect_a=display_size_a.y/v_width;float aspect_b=display_size_b.y/v_width;float dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);float x_a=mod(v_linesofar/pattern_size_a.x*aspect_a,1.0);float x_b=mod(v_linesofar/pattern_size_b.x*aspect_b,1.0);float y=0.5*v_normal.y+0.5;vec2 texel_size=1.0/u_texsize;vec2 pos_a=mix(pattern_tl_a*texel_size-texel_size,pattern_br_a*texel_size+texel_size,vec2(x_a,y));vec2 pos_b=mix(pattern_tl_b*texel_size-texel_size,pattern_br_b*texel_size+texel_size,vec2(x_b,y));vec4 color=mix(texture2D(u_image,pos_a),texture2D(u_image,pos_b),u_fade);gl_FragColor=color*alpha*opacity;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","\n#define scale 0.015873016\n#define LINE_DISTANCE_SCALE 2.0\nattribute vec2 a_pos_normal;attribute vec4 a_data;uniform mat4 u_matrix;uniform vec2 u_units_to_pixels;uniform mediump float u_ratio;uniform lowp float u_device_pixel_ratio;varying vec2 v_normal;varying vec2 v_width2;varying float v_linesofar;varying float v_gamma_scale;varying float v_width;\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp float offset\n#pragma mapbox: define mediump float gapwidth\n#pragma mapbox: define mediump float width\n#pragma mapbox: define lowp float floorwidth\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\n#pragma mapbox: define lowp float pixel_ratio_from\n#pragma mapbox: define lowp float pixel_ratio_to\nvoid main() {\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize lowp float offset\n#pragma mapbox: initialize mediump float gapwidth\n#pragma mapbox: initialize mediump float width\n#pragma mapbox: initialize lowp float floorwidth\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\n#pragma mapbox: initialize lowp float pixel_ratio_from\n#pragma mapbox: initialize lowp float pixel_ratio_to\nfloat ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;float a_linesofar=(floor(a_data.z/4.0)+a_data.w*64.0)*LINE_DISTANCE_SCALE;vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);vec4 projected_extrude=u_matrix*vec4(dist/u_ratio,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude;\n#ifdef TERRAIN3D\nv_gamma_scale=1.0;\n#else\nfloat extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length(projected_extrude.xy/gl_Position.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective;\n#endif\nv_linesofar=a_linesofar;v_width2=vec2(outset,inset);v_width=floorwidth;}"),lineSDF:wn("uniform lowp float u_device_pixel_ratio;uniform sampler2D u_image;uniform float u_sdfgamma;uniform float u_mix;varying vec2 v_normal;varying vec2 v_width2;varying vec2 v_tex_a;varying vec2 v_tex_b;varying float v_gamma_scale;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define mediump float width\n#pragma mapbox: define lowp float floorwidth\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump float width\n#pragma mapbox: initialize lowp float floorwidth\nfloat dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);float sdfdist_a=texture2D(u_image,v_tex_a).a;float sdfdist_b=texture2D(u_image,v_tex_b).a;float sdfdist=mix(sdfdist_a,sdfdist_b,u_mix);alpha*=smoothstep(0.5-u_sdfgamma/floorwidth,0.5+u_sdfgamma/floorwidth,sdfdist);gl_FragColor=color*(alpha*opacity);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","\n#define scale 0.015873016\n#define LINE_DISTANCE_SCALE 2.0\nattribute vec2 a_pos_normal;attribute vec4 a_data;uniform mat4 u_matrix;uniform mediump float u_ratio;uniform lowp float u_device_pixel_ratio;uniform vec2 u_patternscale_a;uniform float u_tex_y_a;uniform vec2 u_patternscale_b;uniform float u_tex_y_b;uniform vec2 u_units_to_pixels;varying vec2 v_normal;varying vec2 v_width2;varying vec2 v_tex_a;varying vec2 v_tex_b;varying float v_gamma_scale;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define mediump float gapwidth\n#pragma mapbox: define lowp float offset\n#pragma mapbox: define mediump float width\n#pragma mapbox: define lowp float floorwidth\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump float gapwidth\n#pragma mapbox: initialize lowp float offset\n#pragma mapbox: initialize mediump float width\n#pragma mapbox: initialize lowp float floorwidth\nfloat ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;float a_linesofar=(floor(a_data.z/4.0)+a_data.w*64.0)*LINE_DISTANCE_SCALE;vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);vec4 projected_extrude=u_matrix*vec4(dist/u_ratio,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude;\n#ifdef TERRAIN3D\nv_gamma_scale=1.0;\n#else\nfloat extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length(projected_extrude.xy/gl_Position.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective;\n#endif\nv_tex_a=vec2(a_linesofar*u_patternscale_a.x/floorwidth,normal.y*u_patternscale_a.y+u_tex_y_a);v_tex_b=vec2(a_linesofar*u_patternscale_b.x/floorwidth,normal.y*u_patternscale_b.y+u_tex_y_b);v_width2=vec2(outset,inset);}"),raster:wn("uniform float u_fade_t;uniform float u_opacity;uniform sampler2D u_image0;uniform sampler2D u_image1;varying vec2 v_pos0;varying vec2 v_pos1;uniform float u_brightness_low;uniform float u_brightness_high;uniform float u_saturation_factor;uniform float u_contrast_factor;uniform vec3 u_spin_weights;void main() {vec4 color0=texture2D(u_image0,v_pos0);vec4 color1=texture2D(u_image1,v_pos1);if (color0.a > 0.0) {color0.rgb=color0.rgb/color0.a;}if (color1.a > 0.0) {color1.rgb=color1.rgb/color1.a;}vec4 color=mix(color0,color1,u_fade_t);color.a*=u_opacity;vec3 rgb=color.rgb;rgb=vec3(dot(rgb,u_spin_weights.xyz),dot(rgb,u_spin_weights.zxy),dot(rgb,u_spin_weights.yzx));float average=(color.r+color.g+color.b)/3.0;rgb+=(average-rgb)*u_saturation_factor;rgb=(rgb-0.5)*u_contrast_factor+0.5;vec3 u_high_vec=vec3(u_brightness_low,u_brightness_low,u_brightness_low);vec3 u_low_vec=vec3(u_brightness_high,u_brightness_high,u_brightness_high);gl_FragColor=vec4(mix(u_high_vec,u_low_vec,rgb)*color.a,color.a);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform vec2 u_tl_parent;uniform float u_scale_parent;uniform float u_buffer_scale;attribute vec2 a_pos;attribute vec2 a_texture_pos;varying vec2 v_pos0;varying vec2 v_pos1;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);v_pos0=(((a_texture_pos/8192.0)-0.5)/u_buffer_scale )+0.5;v_pos1=(v_pos0*u_scale_parent)+u_tl_parent;}"),symbolIcon:wn("uniform sampler2D u_texture;varying vec2 v_tex;varying float v_fade_opacity;\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\nlowp float alpha=opacity*v_fade_opacity;gl_FragColor=texture2D(u_texture,v_tex)*alpha;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","const float PI=3.141592653589793;attribute vec4 a_pos_offset;attribute vec4 a_data;attribute vec4 a_pixeloffset;attribute vec3 a_projected_pos;attribute float a_fade_opacity;uniform bool u_is_size_zoom_constant;uniform bool u_is_size_feature_constant;uniform highp float u_size_t;uniform highp float u_size;uniform highp float u_camera_to_center_distance;uniform highp float u_pitch;uniform bool u_rotate_symbol;uniform highp float u_aspect_ratio;uniform float u_fade_change;uniform mat4 u_matrix;uniform mat4 u_label_plane_matrix;uniform mat4 u_coord_matrix;uniform bool u_is_text;uniform bool u_pitch_with_map;uniform vec2 u_texsize;varying vec2 v_tex;varying float v_fade_opacity;\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\nvec2 a_pos=a_pos_offset.xy;vec2 a_offset=a_pos_offset.zw;vec2 a_tex=a_data.xy;vec2 a_size=a_data.zw;float a_size_min=floor(a_size[0]*0.5);vec2 a_pxoffset=a_pixeloffset.xy;vec2 a_minFontScale=a_pixeloffset.zw/256.0;float ele=get_elevation(a_pos);highp float segment_angle=-a_projected_pos[2];float size;if (!u_is_size_zoom_constant && !u_is_size_feature_constant) {size=mix(a_size_min,a_size[1],u_size_t)/128.0;} else if (u_is_size_zoom_constant && !u_is_size_feature_constant) {size=a_size_min/128.0;} else {size=u_size;}vec4 projectedPoint=u_matrix*vec4(a_pos,ele,1);highp float camera_to_anchor_distance=projectedPoint.w;highp float distance_ratio=u_pitch_with_map ?\ncamera_to_anchor_distance/u_camera_to_center_distance :\nu_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp(0.5+0.5*distance_ratio,0.0,4.0);size*=perspective_ratio;float fontScale=u_is_text ? size/24.0 : size;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offsetProjectedPoint=u_matrix*vec4(a_pos+vec2(1,0),ele,1);vec2 a=projectedPoint.xy/projectedPoint.w;vec2 b=offsetProjectedPoint.xy/offsetProjectedPoint.w;symbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);}highp float angle_sin=sin(segment_angle+symbol_rotation);highp float angle_cos=cos(segment_angle+symbol_rotation);mat2 rotation_matrix=mat2(angle_cos,-1.0*angle_sin,angle_sin,angle_cos);vec4 projected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy,ele,1.0);float z=float(u_pitch_with_map)*projected_pos.z/projected_pos.w;gl_Position=u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+rotation_matrix*(a_offset/32.0*max(a_minFontScale,fontScale)+a_pxoffset/16.0),z,1.0);v_tex=a_tex/u_texsize;vec2 fade_opacity=unpack_opacity(a_fade_opacity);float fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;float visibility=calculate_visibility(projectedPoint);v_fade_opacity=max(0.0,min(visibility,fade_opacity[0]+fade_change));}"),symbolSDF:wn("#define SDF_PX 8.0\nuniform bool u_is_halo;uniform sampler2D u_texture;uniform highp float u_gamma_scale;uniform lowp float u_device_pixel_ratio;uniform bool u_is_text;varying vec2 v_data0;varying vec3 v_data1;\n#pragma mapbox: define highp vec4 fill_color\n#pragma mapbox: define highp vec4 halo_color\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp float halo_width\n#pragma mapbox: define lowp float halo_blur\nvoid main() {\n#pragma mapbox: initialize highp vec4 fill_color\n#pragma mapbox: initialize highp vec4 halo_color\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize lowp float halo_width\n#pragma mapbox: initialize lowp float halo_blur\nfloat EDGE_GAMMA=0.105/u_device_pixel_ratio;vec2 tex=v_data0.xy;float gamma_scale=v_data1.x;float size=v_data1.y;float fade_opacity=v_data1[2];float fontScale=u_is_text ? size/24.0 : size;lowp vec4 color=fill_color;highp float gamma=EDGE_GAMMA/(fontScale*u_gamma_scale);lowp float buff=(256.0-64.0)/256.0;if (u_is_halo) {color=halo_color;gamma=(halo_blur*1.19/SDF_PX+EDGE_GAMMA)/(fontScale*u_gamma_scale);buff=(6.0-halo_width/fontScale)/SDF_PX;}lowp float dist=texture2D(u_texture,tex).a;highp float gamma_scaled=gamma*gamma_scale;highp float alpha=smoothstep(buff-gamma_scaled,buff+gamma_scaled,dist);gl_FragColor=color*(alpha*opacity*fade_opacity);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","const float PI=3.141592653589793;attribute vec4 a_pos_offset;attribute vec4 a_data;attribute vec4 a_pixeloffset;attribute vec3 a_projected_pos;attribute float a_fade_opacity;uniform bool u_is_size_zoom_constant;uniform bool u_is_size_feature_constant;uniform highp float u_size_t;uniform highp float u_size;uniform mat4 u_matrix;uniform mat4 u_label_plane_matrix;uniform mat4 u_coord_matrix;uniform bool u_is_text;uniform bool u_pitch_with_map;uniform highp float u_pitch;uniform bool u_rotate_symbol;uniform highp float u_aspect_ratio;uniform highp float u_camera_to_center_distance;uniform float u_fade_change;uniform vec2 u_texsize;varying vec2 v_data0;varying vec3 v_data1;\n#pragma mapbox: define highp vec4 fill_color\n#pragma mapbox: define highp vec4 halo_color\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp float halo_width\n#pragma mapbox: define lowp float halo_blur\nvoid main() {\n#pragma mapbox: initialize highp vec4 fill_color\n#pragma mapbox: initialize highp vec4 halo_color\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize lowp float halo_width\n#pragma mapbox: initialize lowp float halo_blur\nvec2 a_pos=a_pos_offset.xy;vec2 a_offset=a_pos_offset.zw;vec2 a_tex=a_data.xy;vec2 a_size=a_data.zw;float a_size_min=floor(a_size[0]*0.5);vec2 a_pxoffset=a_pixeloffset.xy;float ele=get_elevation(a_pos);highp float segment_angle=-a_projected_pos[2];float size;if (!u_is_size_zoom_constant && !u_is_size_feature_constant) {size=mix(a_size_min,a_size[1],u_size_t)/128.0;} else if (u_is_size_zoom_constant && !u_is_size_feature_constant) {size=a_size_min/128.0;} else {size=u_size;}vec4 projectedPoint=u_matrix*vec4(a_pos,ele,1);highp float camera_to_anchor_distance=projectedPoint.w;highp float distance_ratio=u_pitch_with_map ?\ncamera_to_anchor_distance/u_camera_to_center_distance :\nu_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp(0.5+0.5*distance_ratio,0.0,4.0);size*=perspective_ratio;float fontScale=u_is_text ? size/24.0 : size;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offsetProjectedPoint=u_matrix*vec4(a_pos+vec2(1,0),ele,1);vec2 a=projectedPoint.xy/projectedPoint.w;vec2 b=offsetProjectedPoint.xy/offsetProjectedPoint.w;symbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);}highp float angle_sin=sin(segment_angle+symbol_rotation);highp float angle_cos=cos(segment_angle+symbol_rotation);mat2 rotation_matrix=mat2(angle_cos,-1.0*angle_sin,angle_sin,angle_cos);vec4 projected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy,ele,1.0);float z=float(u_pitch_with_map)*projected_pos.z/projected_pos.w;gl_Position=u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+rotation_matrix*(a_offset/32.0*fontScale+a_pxoffset),z,1.0);float gamma_scale=gl_Position.w;vec2 fade_opacity=unpack_opacity(a_fade_opacity);float visibility=calculate_visibility(projectedPoint);float fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;float interpolated_fade_opacity=max(0.0,min(visibility,fade_opacity[0]+fade_change));v_data0=a_tex/u_texsize;v_data1=vec3(gamma_scale,size,interpolated_fade_opacity);}"),symbolTextAndIcon:wn("#define SDF_PX 8.0\n#define SDF 1.0\n#define ICON 0.0\nuniform bool u_is_halo;uniform sampler2D u_texture;uniform sampler2D u_texture_icon;uniform highp float u_gamma_scale;uniform lowp float u_device_pixel_ratio;varying vec4 v_data0;varying vec4 v_data1;\n#pragma mapbox: define highp vec4 fill_color\n#pragma mapbox: define highp vec4 halo_color\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp float halo_width\n#pragma mapbox: define lowp float halo_blur\nvoid main() {\n#pragma mapbox: initialize highp vec4 fill_color\n#pragma mapbox: initialize highp vec4 halo_color\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize lowp float halo_width\n#pragma mapbox: initialize lowp float halo_blur\nfloat fade_opacity=v_data1[2];if (v_data1.w==ICON) {vec2 tex_icon=v_data0.zw;lowp float alpha=opacity*fade_opacity;gl_FragColor=texture2D(u_texture_icon,tex_icon)*alpha;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\nreturn;}vec2 tex=v_data0.xy;float EDGE_GAMMA=0.105/u_device_pixel_ratio;float gamma_scale=v_data1.x;float size=v_data1.y;float fontScale=size/24.0;lowp vec4 color=fill_color;highp float gamma=EDGE_GAMMA/(fontScale*u_gamma_scale);lowp float buff=(256.0-64.0)/256.0;if (u_is_halo) {color=halo_color;gamma=(halo_blur*1.19/SDF_PX+EDGE_GAMMA)/(fontScale*u_gamma_scale);buff=(6.0-halo_width/fontScale)/SDF_PX;}lowp float dist=texture2D(u_texture,tex).a;highp float gamma_scaled=gamma*gamma_scale;highp float alpha=smoothstep(buff-gamma_scaled,buff+gamma_scaled,dist);gl_FragColor=color*(alpha*opacity*fade_opacity);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","const float PI=3.141592653589793;attribute vec4 a_pos_offset;attribute vec4 a_data;attribute vec3 a_projected_pos;attribute float a_fade_opacity;uniform bool u_is_size_zoom_constant;uniform bool u_is_size_feature_constant;uniform highp float u_size_t;uniform highp float u_size;uniform mat4 u_matrix;uniform mat4 u_label_plane_matrix;uniform mat4 u_coord_matrix;uniform bool u_is_text;uniform bool u_pitch_with_map;uniform highp float u_pitch;uniform bool u_rotate_symbol;uniform highp float u_aspect_ratio;uniform highp float u_camera_to_center_distance;uniform float u_fade_change;uniform vec2 u_texsize;uniform vec2 u_texsize_icon;varying vec4 v_data0;varying vec4 v_data1;\n#pragma mapbox: define highp vec4 fill_color\n#pragma mapbox: define highp vec4 halo_color\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp float halo_width\n#pragma mapbox: define lowp float halo_blur\nvoid main() {\n#pragma mapbox: initialize highp vec4 fill_color\n#pragma mapbox: initialize highp vec4 halo_color\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize lowp float halo_width\n#pragma mapbox: initialize lowp float halo_blur\nvec2 a_pos=a_pos_offset.xy;vec2 a_offset=a_pos_offset.zw;vec2 a_tex=a_data.xy;vec2 a_size=a_data.zw;float a_size_min=floor(a_size[0]*0.5);float is_sdf=a_size[0]-2.0*a_size_min;float ele=get_elevation(a_pos);highp float segment_angle=-a_projected_pos[2];float size;if (!u_is_size_zoom_constant && !u_is_size_feature_constant) {size=mix(a_size_min,a_size[1],u_size_t)/128.0;} else if (u_is_size_zoom_constant && !u_is_size_feature_constant) {size=a_size_min/128.0;} else {size=u_size;}vec4 projectedPoint=u_matrix*vec4(a_pos,ele,1);highp float camera_to_anchor_distance=projectedPoint.w;highp float distance_ratio=u_pitch_with_map ?\ncamera_to_anchor_distance/u_camera_to_center_distance :\nu_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp(0.5+0.5*distance_ratio,0.0,4.0);size*=perspective_ratio;float fontScale=size/24.0;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offsetProjectedPoint=u_matrix*vec4(a_pos+vec2(1,0),ele,1);vec2 a=projectedPoint.xy/projectedPoint.w;vec2 b=offsetProjectedPoint.xy/offsetProjectedPoint.w;symbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);}highp float angle_sin=sin(segment_angle+symbol_rotation);highp float angle_cos=cos(segment_angle+symbol_rotation);mat2 rotation_matrix=mat2(angle_cos,-1.0*angle_sin,angle_sin,angle_cos);vec4 projected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy,ele,1.0);float z=float(u_pitch_with_map)*projected_pos.z/projected_pos.w;gl_Position=u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+rotation_matrix*(a_offset/32.0*fontScale),z,1.0);float gamma_scale=gl_Position.w;vec2 fade_opacity=unpack_opacity(a_fade_opacity);float visibility=calculate_visibility(projectedPoint);float fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;float interpolated_fade_opacity=max(0.0,min(visibility,fade_opacity[0]+fade_change));v_data0.xy=a_tex/u_texsize;v_data0.zw=a_tex/u_texsize_icon;v_data1=vec4(gamma_scale,size,interpolated_fade_opacity,is_sdf);}"),terrain:wn("uniform sampler2D u_texture;varying vec2 v_texture_pos;void main() {gl_FragColor=texture2D(u_texture,v_texture_pos);}",Rf),terrainDepth:wn("varying float v_depth;const highp vec4 bitSh=vec4(256.*256.*256.,256.*256.,256.,1.);const highp vec4 bitMsk=vec4(0.,vec3(1./256.0));highp vec4 pack(highp float value) {highp vec4 comp=fract(value*bitSh);comp-=comp.xxyz*bitMsk;return comp;}void main() {gl_FragColor=pack(v_depth);}",Rf),terrainCoords:wn("precision mediump float;uniform sampler2D u_texture;uniform float u_terrain_coords_id;varying vec2 v_texture_pos;void main() {vec4 rgba=texture2D(u_texture,v_texture_pos);gl_FragColor=vec4(rgba.r,rgba.g,rgba.b,u_terrain_coords_id);}",Rf)};function wn(g,a){const h=/#pragma mapbox: ([\w]+) ([\w]+) ([\w]+) ([\w]+)/g,m=a.match(/attribute ([\w]+) ([\w]+)/g),y=g.match(/uniform ([\w]+) ([\w]+)([\s]*)([\w]*)/g),w=a.match(/uniform ([\w]+) ([\w]+)([\s]*)([\w]*)/g),S=w?w.concat(y):y,T={};return{fragmentSource:g=g.replace(h,(k,R,z,L,j)=>(T[j]=!0,"define"===R?`\n#ifndef HAS_UNIFORM_u_${j}\nvarying ${z} ${L} ${j};\n#else\nuniform ${z} ${L} u_${j};\n#endif\n`:`\n#ifdef HAS_UNIFORM_u_${j}\n ${z} ${L} ${j} = u_${j};\n#endif\n`)),vertexSource:a=a.replace(h,(k,R,z,L,j)=>{const Q="float"===L?"vec2":"vec4",ee=j.match(/color/)?"color":Q;return T[j]?"define"===R?`\n#ifndef HAS_UNIFORM_u_${j}\nuniform lowp float u_${j}_t;\nattribute ${z} ${Q} a_${j};\nvarying ${z} ${L} ${j};\n#else\nuniform ${z} ${L} u_${j};\n#endif\n`:"vec4"===ee?`\n#ifndef HAS_UNIFORM_u_${j}\n ${j} = a_${j};\n#else\n ${z} ${L} ${j} = u_${j};\n#endif\n`:`\n#ifndef HAS_UNIFORM_u_${j}\n ${j} = unpack_mix_${ee}(a_${j}, u_${j}_t);\n#else\n ${z} ${L} ${j} = u_${j};\n#endif\n`:"define"===R?`\n#ifndef HAS_UNIFORM_u_${j}\nuniform lowp float u_${j}_t;\nattribute ${z} ${Q} a_${j};\n#else\nuniform ${z} ${L} u_${j};\n#endif\n`:"vec4"===ee?`\n#ifndef HAS_UNIFORM_u_${j}\n ${z} ${L} ${j} = a_${j};\n#else\n ${z} ${L} ${j} = u_${j};\n#endif\n`:`\n#ifndef HAS_UNIFORM_u_${j}\n ${z} ${L} ${j} = unpack_mix_${ee}(a_${j}, u_${j}_t);\n#else\n ${z} ${L} ${j} = u_${j};\n#endif\n`}),staticAttributes:m,staticUniforms:S}}class $t{constructor(){this.boundProgram=null,this.boundLayoutVertexBuffer=null,this.boundPaintVertexBuffers=[],this.boundIndexBuffer=null,this.boundVertexOffset=null,this.boundDynamicVertexBuffer=null,this.vao=null}bind(a,h,m,y,w,S,T,k,R){this.context=a;let z=this.boundPaintVertexBuffers.length!==y.length;for(let L=0;!z&&L>16,T>>16],u_pixel_coord_lower:[65535&S,65535&T]}}const Yh=(g,a,h,m)=>{const y=a.style.light,w=y.properties.get("position"),S=[w.x,w.y,w.z],T=(R=new b.ARRAY_TYPE(9),b.ARRAY_TYPE!=Float32Array&&(R[1]=0,R[2]=0,R[3]=0,R[5]=0,R[6]=0,R[7]=0),R[0]=1,R[4]=1,R[8]=1,R);var R;"viewport"===y.properties.get("anchor")&&function(R,z){var L=Math.sin(z),j=Math.cos(z);R[0]=j,R[1]=L,R[2]=0,R[3]=-L,R[4]=j,R[5]=0,R[6]=0,R[7]=0,R[8]=1}(T,-a.transform.angle),function(R,z,L){var j=z[0],Q=z[1],ee=z[2];R[0]=j*L[0]+Q*L[3]+ee*L[6],R[1]=j*L[1]+Q*L[4]+ee*L[7],R[2]=j*L[2]+Q*L[5]+ee*L[8]}(S,S,T);const k=y.properties.get("color");return{u_matrix:g,u_lightpos:S,u_lightintensity:y.properties.get("intensity"),u_lightcolor:[k.r,k.g,k.b],u_vertical_gradient:+h,u_opacity:m}},Nu=(g,a,h,m,y,w,S)=>b.extend(Yh(g,a,h,m),Ff(w,a,S),{u_height_factor:-Math.pow(2,y.overscaledZ)/S.tileSize/8}),Wr=g=>({u_matrix:g}),Lc=(g,a,h,m)=>b.extend(Wr(g),Ff(h,a,m)),Of=(g,a)=>({u_matrix:g,u_world:a}),Io=(g,a,h,m,y)=>b.extend(Lc(g,a,h,m),{u_world:y}),Zo=(g,a,h,m)=>{const y=g.transform;let w,S;if("map"===m.paint.get("circle-pitch-alignment")){const T=Ie(h,1,y.zoom);w=!0,S=[T,T]}else w=!1,S=y.pixelsToGLUnits;return{u_camera_to_center_distance:y.cameraToCenterDistance,u_scale_with_map:+("map"===m.paint.get("circle-pitch-scale")),u_matrix:g.translatePosMatrix(a.posMatrix,h,m.paint.get("circle-translate"),m.paint.get("circle-translate-anchor")),u_pitch_with_map:+w,u_device_pixel_ratio:g.pixelRatio,u_extrude_scale:S}},Kh=(g,a,h)=>{const m=Ie(h,1,a.zoom),y=Math.pow(2,a.zoom-h.tileID.overscaledZ),w=h.tileID.overscaleFactor();return{u_matrix:g,u_camera_to_center_distance:a.cameraToCenterDistance,u_pixels_to_tile_units:m,u_extrude_scale:[a.pixelsToGLUnits[0]/(m*y),a.pixelsToGLUnits[1]/(m*y)],u_overscale_factor:w}},zu=(g,a,h=1)=>({u_matrix:g,u_color:a,u_overlay:0,u_overlay_scale:h}),Jh=g=>({u_matrix:g}),Lf=(g,a,h,m)=>({u_matrix:g,u_extrude_scale:Ie(a,1,h),u_intensity:m});function Bu(g,a){const h=Math.pow(2,a.canonical.z),m=a.canonical.y;return[new b.MercatorCoordinate(0,m/h).toLngLat().lat,new b.MercatorCoordinate(0,(m+1)/h).toLngLat().lat]}const Vu=(g,a,h,m)=>{const y=g.transform;return{u_matrix:Ul(g,a,h,m),u_ratio:1/Ie(a,1,y.zoom),u_device_pixel_ratio:g.pixelRatio,u_units_to_pixels:[1/y.pixelsToGLUnits[0],1/y.pixelsToGLUnits[1]]}},Qh=(g,a,h,m,y)=>b.extend(Vu(g,a,h,y),{u_image:0,u_image_height:m}),ed=(g,a,h,m,y)=>{const w=g.transform,S=Rn(a,w);return{u_matrix:Ul(g,a,h,y),u_texsize:a.imageAtlasTexture.size,u_ratio:1/Ie(a,1,w.zoom),u_device_pixel_ratio:g.pixelRatio,u_image:0,u_scale:[S,m.fromScale,m.toScale],u_fade:m.t,u_units_to_pixels:[1/w.pixelsToGLUnits[0],1/w.pixelsToGLUnits[1]]}},Ui=(g,a,h,m,y,w)=>{const S=g.lineAtlas,T=Rn(a,g.transform),k="round"===h.layout.get("line-cap"),R=S.getDash(m.from,k),z=S.getDash(m.to,k),L=R.width*y.fromScale,j=z.width*y.toScale;return b.extend(Vu(g,a,h,w),{u_patternscale_a:[T/L,-R.height/2],u_patternscale_b:[T/j,-z.height/2],u_sdfgamma:S.width/(256*Math.min(L,j)*g.pixelRatio)/2,u_image:0,u_tex_y_a:R.y,u_tex_y_b:z.y,u_mix:y.t})};function Rn(g,a){return 1/Ie(g,1,a.tileZoom)}function Ul(g,a,h,m){return g.translatePosMatrix(m?m.posMatrix:a.tileID.posMatrix,a,h.paint.get("line-translate"),h.paint.get("line-translate-anchor"))}const I_=(g,a,h,m,y)=>{return{u_matrix:g,u_tl_parent:a,u_scale_parent:h,u_buffer_scale:1,u_fade_t:m.mix,u_opacity:m.opacity*y.paint.get("raster-opacity"),u_image0:0,u_image1:1,u_brightness_low:y.paint.get("raster-brightness-min"),u_brightness_high:y.paint.get("raster-brightness-max"),u_saturation_factor:(S=y.paint.get("raster-saturation"),S>0?1-1/(1.001-S):-S),u_contrast_factor:(w=y.paint.get("raster-contrast"),w>0?1/(1-w):1+w),u_spin_weights:T_(y.paint.get("raster-hue-rotate"))};var w,S};function T_(g){g*=Math.PI/180;const a=Math.sin(g),h=Math.cos(g);return[(2*h+1)/3,(-Math.sqrt(3)*a-h+1)/3,(Math.sqrt(3)*a-h+1)/3]}const Ot=(g,a,h,m,y,w,S,T,k,R)=>{const z=y.transform;return{u_is_size_zoom_constant:+("constant"===g||"source"===g),u_is_size_feature_constant:+("constant"===g||"camera"===g),u_size_t:a?a.uSizeT:0,u_size:a?a.uSize:0,u_camera_to_center_distance:z.cameraToCenterDistance,u_pitch:z.pitch/360*2*Math.PI,u_rotate_symbol:+h,u_aspect_ratio:z.width/z.height,u_fade_change:y.options.fadeDuration?y.symbolFadeChange:1,u_matrix:w,u_label_plane_matrix:S,u_coord_matrix:T,u_is_text:+k,u_pitch_with_map:+m,u_texsize:R,u_texture:0}},Vm=(g,a,h,m,y,w,S,T,k,R,z)=>{const L=y.transform;return b.extend(Ot(g,a,h,m,y,w,S,T,k,R),{u_gamma_scale:m?Math.cos(L._pitch)*L.cameraToCenterDistance:1,u_device_pixel_ratio:y.pixelRatio,u_is_halo:+z})},Ei=(g,a,h,m,y,w,S,T,k,R)=>b.extend(Vm(g,a,h,m,y,w,S,T,!0,k,!0),{u_texsize_icon:R,u_texture_icon:1}),Uu=(g,a,h)=>({u_matrix:g,u_opacity:a,u_color:h}),td=(g,a,h,m,y,w)=>b.extend(function(S,T,k,R){const z=k.imageManager.getPattern(S.from.toString()),L=k.imageManager.getPattern(S.to.toString()),{width:j,height:Q}=k.imageManager.getPixelSize(),ee=Math.pow(2,R.tileID.overscaledZ),Y=R.tileSize*Math.pow(2,k.transform.tileZoom)/ee,ae=Y*(R.tileID.canonical.x+R.tileID.wrap*ee),_e=Y*R.tileID.canonical.y;return{u_image:0,u_pattern_tl_a:z.tl,u_pattern_br_a:z.br,u_pattern_tl_b:L.tl,u_pattern_br_b:L.br,u_texsize:[j,Q],u_mix:T.t,u_pattern_size_a:z.displaySize,u_pattern_size_b:L.displaySize,u_scale_a:T.fromScale,u_scale_b:T.toScale,u_tile_units_to_pixels:1/Ie(R,1,k.transform.tileZoom),u_pixel_coord_upper:[ae>>16,_e>>16],u_pixel_coord_lower:[65535&ae,65535&_e]}}(m,w,h,y),{u_matrix:g,u_opacity:a}),Nc={fillExtrusion:(g,a)=>({u_matrix:new b.UniformMatrix4f(g,a.u_matrix),u_lightpos:new b.Uniform3f(g,a.u_lightpos),u_lightintensity:new b.Uniform1f(g,a.u_lightintensity),u_lightcolor:new b.Uniform3f(g,a.u_lightcolor),u_vertical_gradient:new b.Uniform1f(g,a.u_vertical_gradient),u_opacity:new b.Uniform1f(g,a.u_opacity)}),fillExtrusionPattern:(g,a)=>({u_matrix:new b.UniformMatrix4f(g,a.u_matrix),u_lightpos:new b.Uniform3f(g,a.u_lightpos),u_lightintensity:new b.Uniform1f(g,a.u_lightintensity),u_lightcolor:new b.Uniform3f(g,a.u_lightcolor),u_vertical_gradient:new b.Uniform1f(g,a.u_vertical_gradient),u_height_factor:new b.Uniform1f(g,a.u_height_factor),u_image:new b.Uniform1i(g,a.u_image),u_texsize:new b.Uniform2f(g,a.u_texsize),u_pixel_coord_upper:new b.Uniform2f(g,a.u_pixel_coord_upper),u_pixel_coord_lower:new b.Uniform2f(g,a.u_pixel_coord_lower),u_scale:new b.Uniform3f(g,a.u_scale),u_fade:new b.Uniform1f(g,a.u_fade),u_opacity:new b.Uniform1f(g,a.u_opacity)}),fill:(g,a)=>({u_matrix:new b.UniformMatrix4f(g,a.u_matrix)}),fillPattern:(g,a)=>({u_matrix:new b.UniformMatrix4f(g,a.u_matrix),u_image:new b.Uniform1i(g,a.u_image),u_texsize:new b.Uniform2f(g,a.u_texsize),u_pixel_coord_upper:new b.Uniform2f(g,a.u_pixel_coord_upper),u_pixel_coord_lower:new b.Uniform2f(g,a.u_pixel_coord_lower),u_scale:new b.Uniform3f(g,a.u_scale),u_fade:new b.Uniform1f(g,a.u_fade)}),fillOutline:(g,a)=>({u_matrix:new b.UniformMatrix4f(g,a.u_matrix),u_world:new b.Uniform2f(g,a.u_world)}),fillOutlinePattern:(g,a)=>({u_matrix:new b.UniformMatrix4f(g,a.u_matrix),u_world:new b.Uniform2f(g,a.u_world),u_image:new b.Uniform1i(g,a.u_image),u_texsize:new b.Uniform2f(g,a.u_texsize),u_pixel_coord_upper:new b.Uniform2f(g,a.u_pixel_coord_upper),u_pixel_coord_lower:new b.Uniform2f(g,a.u_pixel_coord_lower),u_scale:new b.Uniform3f(g,a.u_scale),u_fade:new b.Uniform1f(g,a.u_fade)}),circle:(g,a)=>({u_camera_to_center_distance:new b.Uniform1f(g,a.u_camera_to_center_distance),u_scale_with_map:new b.Uniform1i(g,a.u_scale_with_map),u_pitch_with_map:new b.Uniform1i(g,a.u_pitch_with_map),u_extrude_scale:new b.Uniform2f(g,a.u_extrude_scale),u_device_pixel_ratio:new b.Uniform1f(g,a.u_device_pixel_ratio),u_matrix:new b.UniformMatrix4f(g,a.u_matrix)}),collisionBox:(g,a)=>({u_matrix:new b.UniformMatrix4f(g,a.u_matrix),u_camera_to_center_distance:new b.Uniform1f(g,a.u_camera_to_center_distance),u_pixels_to_tile_units:new b.Uniform1f(g,a.u_pixels_to_tile_units),u_extrude_scale:new b.Uniform2f(g,a.u_extrude_scale),u_overscale_factor:new b.Uniform1f(g,a.u_overscale_factor)}),collisionCircle:(g,a)=>({u_matrix:new b.UniformMatrix4f(g,a.u_matrix),u_inv_matrix:new b.UniformMatrix4f(g,a.u_inv_matrix),u_camera_to_center_distance:new b.Uniform1f(g,a.u_camera_to_center_distance),u_viewport_size:new b.Uniform2f(g,a.u_viewport_size)}),debug:(g,a)=>({u_color:new b.UniformColor(g,a.u_color),u_matrix:new b.UniformMatrix4f(g,a.u_matrix),u_overlay:new b.Uniform1i(g,a.u_overlay),u_overlay_scale:new b.Uniform1f(g,a.u_overlay_scale)}),clippingMask:(g,a)=>({u_matrix:new b.UniformMatrix4f(g,a.u_matrix)}),heatmap:(g,a)=>({u_extrude_scale:new b.Uniform1f(g,a.u_extrude_scale),u_intensity:new b.Uniform1f(g,a.u_intensity),u_matrix:new b.UniformMatrix4f(g,a.u_matrix)}),heatmapTexture:(g,a)=>({u_matrix:new b.UniformMatrix4f(g,a.u_matrix),u_world:new b.Uniform2f(g,a.u_world),u_image:new b.Uniform1i(g,a.u_image),u_color_ramp:new b.Uniform1i(g,a.u_color_ramp),u_opacity:new b.Uniform1f(g,a.u_opacity)}),hillshade:(g,a)=>({u_matrix:new b.UniformMatrix4f(g,a.u_matrix),u_image:new b.Uniform1i(g,a.u_image),u_latrange:new b.Uniform2f(g,a.u_latrange),u_light:new b.Uniform2f(g,a.u_light),u_shadow:new b.UniformColor(g,a.u_shadow),u_highlight:new b.UniformColor(g,a.u_highlight),u_accent:new b.UniformColor(g,a.u_accent)}),hillshadePrepare:(g,a)=>({u_matrix:new b.UniformMatrix4f(g,a.u_matrix),u_image:new b.Uniform1i(g,a.u_image),u_dimension:new b.Uniform2f(g,a.u_dimension),u_zoom:new b.Uniform1f(g,a.u_zoom),u_unpack:new b.Uniform4f(g,a.u_unpack)}),line:(g,a)=>({u_matrix:new b.UniformMatrix4f(g,a.u_matrix),u_ratio:new b.Uniform1f(g,a.u_ratio),u_device_pixel_ratio:new b.Uniform1f(g,a.u_device_pixel_ratio),u_units_to_pixels:new b.Uniform2f(g,a.u_units_to_pixels)}),lineGradient:(g,a)=>({u_matrix:new b.UniformMatrix4f(g,a.u_matrix),u_ratio:new b.Uniform1f(g,a.u_ratio),u_device_pixel_ratio:new b.Uniform1f(g,a.u_device_pixel_ratio),u_units_to_pixels:new b.Uniform2f(g,a.u_units_to_pixels),u_image:new b.Uniform1i(g,a.u_image),u_image_height:new b.Uniform1f(g,a.u_image_height)}),linePattern:(g,a)=>({u_matrix:new b.UniformMatrix4f(g,a.u_matrix),u_texsize:new b.Uniform2f(g,a.u_texsize),u_ratio:new b.Uniform1f(g,a.u_ratio),u_device_pixel_ratio:new b.Uniform1f(g,a.u_device_pixel_ratio),u_image:new b.Uniform1i(g,a.u_image),u_units_to_pixels:new b.Uniform2f(g,a.u_units_to_pixels),u_scale:new b.Uniform3f(g,a.u_scale),u_fade:new b.Uniform1f(g,a.u_fade)}),lineSDF:(g,a)=>({u_matrix:new b.UniformMatrix4f(g,a.u_matrix),u_ratio:new b.Uniform1f(g,a.u_ratio),u_device_pixel_ratio:new b.Uniform1f(g,a.u_device_pixel_ratio),u_units_to_pixels:new b.Uniform2f(g,a.u_units_to_pixels),u_patternscale_a:new b.Uniform2f(g,a.u_patternscale_a),u_patternscale_b:new b.Uniform2f(g,a.u_patternscale_b),u_sdfgamma:new b.Uniform1f(g,a.u_sdfgamma),u_image:new b.Uniform1i(g,a.u_image),u_tex_y_a:new b.Uniform1f(g,a.u_tex_y_a),u_tex_y_b:new b.Uniform1f(g,a.u_tex_y_b),u_mix:new b.Uniform1f(g,a.u_mix)}),raster:(g,a)=>({u_matrix:new b.UniformMatrix4f(g,a.u_matrix),u_tl_parent:new b.Uniform2f(g,a.u_tl_parent),u_scale_parent:new b.Uniform1f(g,a.u_scale_parent),u_buffer_scale:new b.Uniform1f(g,a.u_buffer_scale),u_fade_t:new b.Uniform1f(g,a.u_fade_t),u_opacity:new b.Uniform1f(g,a.u_opacity),u_image0:new b.Uniform1i(g,a.u_image0),u_image1:new b.Uniform1i(g,a.u_image1),u_brightness_low:new b.Uniform1f(g,a.u_brightness_low),u_brightness_high:new b.Uniform1f(g,a.u_brightness_high),u_saturation_factor:new b.Uniform1f(g,a.u_saturation_factor),u_contrast_factor:new b.Uniform1f(g,a.u_contrast_factor),u_spin_weights:new b.Uniform3f(g,a.u_spin_weights)}),symbolIcon:(g,a)=>({u_is_size_zoom_constant:new b.Uniform1i(g,a.u_is_size_zoom_constant),u_is_size_feature_constant:new b.Uniform1i(g,a.u_is_size_feature_constant),u_size_t:new b.Uniform1f(g,a.u_size_t),u_size:new b.Uniform1f(g,a.u_size),u_camera_to_center_distance:new b.Uniform1f(g,a.u_camera_to_center_distance),u_pitch:new b.Uniform1f(g,a.u_pitch),u_rotate_symbol:new b.Uniform1i(g,a.u_rotate_symbol),u_aspect_ratio:new b.Uniform1f(g,a.u_aspect_ratio),u_fade_change:new b.Uniform1f(g,a.u_fade_change),u_matrix:new b.UniformMatrix4f(g,a.u_matrix),u_label_plane_matrix:new b.UniformMatrix4f(g,a.u_label_plane_matrix),u_coord_matrix:new b.UniformMatrix4f(g,a.u_coord_matrix),u_is_text:new b.Uniform1i(g,a.u_is_text),u_pitch_with_map:new b.Uniform1i(g,a.u_pitch_with_map),u_texsize:new b.Uniform2f(g,a.u_texsize),u_texture:new b.Uniform1i(g,a.u_texture)}),symbolSDF:(g,a)=>({u_is_size_zoom_constant:new b.Uniform1i(g,a.u_is_size_zoom_constant),u_is_size_feature_constant:new b.Uniform1i(g,a.u_is_size_feature_constant),u_size_t:new b.Uniform1f(g,a.u_size_t),u_size:new b.Uniform1f(g,a.u_size),u_camera_to_center_distance:new b.Uniform1f(g,a.u_camera_to_center_distance),u_pitch:new b.Uniform1f(g,a.u_pitch),u_rotate_symbol:new b.Uniform1i(g,a.u_rotate_symbol),u_aspect_ratio:new b.Uniform1f(g,a.u_aspect_ratio),u_fade_change:new b.Uniform1f(g,a.u_fade_change),u_matrix:new b.UniformMatrix4f(g,a.u_matrix),u_label_plane_matrix:new b.UniformMatrix4f(g,a.u_label_plane_matrix),u_coord_matrix:new b.UniformMatrix4f(g,a.u_coord_matrix),u_is_text:new b.Uniform1i(g,a.u_is_text),u_pitch_with_map:new b.Uniform1i(g,a.u_pitch_with_map),u_texsize:new b.Uniform2f(g,a.u_texsize),u_texture:new b.Uniform1i(g,a.u_texture),u_gamma_scale:new b.Uniform1f(g,a.u_gamma_scale),u_device_pixel_ratio:new b.Uniform1f(g,a.u_device_pixel_ratio),u_is_halo:new b.Uniform1i(g,a.u_is_halo)}),symbolTextAndIcon:(g,a)=>({u_is_size_zoom_constant:new b.Uniform1i(g,a.u_is_size_zoom_constant),u_is_size_feature_constant:new b.Uniform1i(g,a.u_is_size_feature_constant),u_size_t:new b.Uniform1f(g,a.u_size_t),u_size:new b.Uniform1f(g,a.u_size),u_camera_to_center_distance:new b.Uniform1f(g,a.u_camera_to_center_distance),u_pitch:new b.Uniform1f(g,a.u_pitch),u_rotate_symbol:new b.Uniform1i(g,a.u_rotate_symbol),u_aspect_ratio:new b.Uniform1f(g,a.u_aspect_ratio),u_fade_change:new b.Uniform1f(g,a.u_fade_change),u_matrix:new b.UniformMatrix4f(g,a.u_matrix),u_label_plane_matrix:new b.UniformMatrix4f(g,a.u_label_plane_matrix),u_coord_matrix:new b.UniformMatrix4f(g,a.u_coord_matrix),u_is_text:new b.Uniform1i(g,a.u_is_text),u_pitch_with_map:new b.Uniform1i(g,a.u_pitch_with_map),u_texsize:new b.Uniform2f(g,a.u_texsize),u_texsize_icon:new b.Uniform2f(g,a.u_texsize_icon),u_texture:new b.Uniform1i(g,a.u_texture),u_texture_icon:new b.Uniform1i(g,a.u_texture_icon),u_gamma_scale:new b.Uniform1f(g,a.u_gamma_scale),u_device_pixel_ratio:new b.Uniform1f(g,a.u_device_pixel_ratio),u_is_halo:new b.Uniform1i(g,a.u_is_halo)}),background:(g,a)=>({u_matrix:new b.UniformMatrix4f(g,a.u_matrix),u_opacity:new b.Uniform1f(g,a.u_opacity),u_color:new b.UniformColor(g,a.u_color)}),backgroundPattern:(g,a)=>({u_matrix:new b.UniformMatrix4f(g,a.u_matrix),u_opacity:new b.Uniform1f(g,a.u_opacity),u_image:new b.Uniform1i(g,a.u_image),u_pattern_tl_a:new b.Uniform2f(g,a.u_pattern_tl_a),u_pattern_br_a:new b.Uniform2f(g,a.u_pattern_br_a),u_pattern_tl_b:new b.Uniform2f(g,a.u_pattern_tl_b),u_pattern_br_b:new b.Uniform2f(g,a.u_pattern_br_b),u_texsize:new b.Uniform2f(g,a.u_texsize),u_mix:new b.Uniform1f(g,a.u_mix),u_pattern_size_a:new b.Uniform2f(g,a.u_pattern_size_a),u_pattern_size_b:new b.Uniform2f(g,a.u_pattern_size_b),u_scale_a:new b.Uniform1f(g,a.u_scale_a),u_scale_b:new b.Uniform1f(g,a.u_scale_b),u_pixel_coord_upper:new b.Uniform2f(g,a.u_pixel_coord_upper),u_pixel_coord_lower:new b.Uniform2f(g,a.u_pixel_coord_lower),u_tile_units_to_pixels:new b.Uniform1f(g,a.u_tile_units_to_pixels)}),terrain:(g,a)=>({u_matrix:new b.UniformMatrix4f(g,a.u_matrix),u_texture:new b.Uniform1i(g,a.u_texture),u_ele_delta:new b.Uniform1f(g,a.u_ele_delta)}),terrainDepth:(g,a)=>({u_matrix:new b.UniformMatrix4f(g,a.u_matrix),u_ele_delta:new b.Uniform1f(g,a.u_ele_delta)}),terrainCoords:(g,a)=>({u_matrix:new b.UniformMatrix4f(g,a.u_matrix),u_texture:new b.Uniform1i(g,a.u_texture),u_terrain_coords_id:new b.Uniform1f(g,a.u_terrain_coords_id),u_ele_delta:new b.Uniform1f(g,a.u_ele_delta)})};class nd{constructor(a,h,m){this.context=a;const y=a.gl;this.buffer=y.createBuffer(),this.dynamicDraw=Boolean(m),this.context.unbindVAO(),a.bindElementBuffer.set(this.buffer),y.bufferData(y.ELEMENT_ARRAY_BUFFER,h.arrayBuffer,this.dynamicDraw?y.DYNAMIC_DRAW:y.STATIC_DRAW),this.dynamicDraw||delete h.arrayBuffer}bind(){this.context.bindElementBuffer.set(this.buffer)}updateData(a){const h=this.context.gl;if(!this.dynamicDraw)throw new Error("Attempted to update data while not in dynamic mode.");this.context.unbindVAO(),this.bind(),h.bufferSubData(h.ELEMENT_ARRAY_BUFFER,0,a.arrayBuffer)}destroy(){this.buffer&&(this.context.gl.deleteBuffer(this.buffer),delete this.buffer)}}const rd={Int8:"BYTE",Uint8:"UNSIGNED_BYTE",Int16:"SHORT",Uint16:"UNSIGNED_SHORT",Int32:"INT",Uint32:"UNSIGNED_INT",Float32:"FLOAT"};class Ga{constructor(a,h,m,y){this.length=h.length,this.attributes=m,this.itemSize=h.bytesPerElement,this.dynamicDraw=y,this.context=a;const w=a.gl;this.buffer=w.createBuffer(),a.bindVertexBuffer.set(this.buffer),w.bufferData(w.ARRAY_BUFFER,h.arrayBuffer,this.dynamicDraw?w.DYNAMIC_DRAW:w.STATIC_DRAW),this.dynamicDraw||delete h.arrayBuffer}bind(){this.context.bindVertexBuffer.set(this.buffer)}updateData(a){if(a.length!==this.length)throw new Error(`Length of new data is ${a.length}, which doesn't match current length of ${this.length}`);const h=this.context.gl;this.bind(),h.bufferSubData(h.ARRAY_BUFFER,0,a.arrayBuffer)}enableAttributes(a,h){for(let m=0;m0){const Ne=b.create(),ze=ke;b.mul(Ne,Se.placementInvProjMatrix,g.transform.glCoordMatrix),b.mul(Ne,Ne,Se.placementViewportMatrix),z.push({circleArray:Le,circleOffset:j,transform:ze,invTransform:Ne,coord:we}),L+=Le.length/4,j=L}Be&&R.draw(T,k.LINES,kt.disabled,cn.disabled,g.colorModeForRenderPass(),rn.disabled,Kh(ke,g.transform,De),g.style.map.terrain&&g.style.map.terrain.getTerrainData(we),h.id,Be.layoutVertexBuffer,Be.indexBuffer,Be.segments,null,g.transform.zoom,null,null,Be.collisionVertexBuffer)}if(!S||!z.length)return;const Q=g.useProgram("collisionCircle"),ee=new b.CollisionCircleLayoutArray;ee.resize(4*L),ee._trim();let Y=0;for(const ie of z)for(let we=0;we=0&&(ee[ae.associatedIconIndex]={shiftedAnchor:ht,angle:Pt})}else ue(ae.numGlyphs,j)}if(R){Q.clear();const Y=g.icon.placedSymbolArray;for(let ae=0;aeg.style.map.terrain.getElevation(Be,sh,ya):null,qi="map"===h.layout.get("text-rotation-alignment");V(Ne,Be.posMatrix,g,y,Ii,Jo,ae,R,qi,Qo)}const Rr=g.translatePosMatrix(Be.posMatrix,Le,w,S),ur=_e||y&&Se||Yl?ar:Ii,On=g.translatePosMatrix(Jo,Le,w,S,!0),Gi=Pt&&0!==h.paint.get(y?"text-halo-width":"icon-halo-width").constantOr(1);let Yr;Yr=Pt?Ne.iconsInText?Ei(zt.kind,An,ye,ae,g,Rr,ur,On,on,Ro):Vm(zt.kind,An,ye,ae,g,Rr,ur,On,y,on,!0):Ot(zt.kind,An,ye,ae,g,Rr,ur,On,y,on);const tr={program:Tn,buffers:ze,uniformValues:Yr,atlasTexture:Fn,atlasTextureIcon:vr,atlasInterpolation:_n,atlasInterpolationIcon:mo,isSDF:Pt,hasHalo:Gi};if(ie&&Ne.canOverlap){we=!0;const Qo=ze.segments.get();for(const qi of Qo)ke.push({segments:new b.SegmentVector([qi]),sortKey:qi.sortKey,state:tr,terrainData:Ht})}else ke.push({segments:ze.segments,sortKey:0,state:tr,terrainData:Ht})}we&&ke.sort((Be,Le)=>Be.sortKey-Le.sortKey);for(const Be of ke){const Le=Be.state;if(j.activeTexture.set(Q.TEXTURE0),Le.atlasTexture.bind(Le.atlasInterpolation,Q.CLAMP_TO_EDGE),Le.atlasTextureIcon&&(j.activeTexture.set(Q.TEXTURE1),Le.atlasTextureIcon&&Le.atlasTextureIcon.bind(Le.atlasInterpolationIcon,Q.CLAMP_TO_EDGE)),Le.isSDF){const Ne=Le.uniformValues;Le.hasHalo&&(Ne.u_is_halo=1,gr(Le.buffers,Be.segments,h,g,Le.program,De,z,L,Ne,Be.terrainData)),Ne.u_is_halo=0}gr(Le.buffers,Be.segments,h,g,Le.program,De,z,L,Le.uniformValues,Be.terrainData)}}function gr(g,a,h,m,y,w,S,T,k,R){const z=m.context;y.draw(z,z.gl.TRIANGLES,w,S,T,rn.disabled,k,R,h.id,g.layoutVertexBuffer,g.indexBuffer,a,h.paint,m.transform.zoom,g.programConfigurations.get(h.id),g.dynamicLayoutVertexBuffer,g.opacityVertexBuffer)}function Xa(g,a,h,m,y){if(!h||!m||!m.imageAtlas)return;const w=m.imageAtlas.patternPositions;let S=w[h.to.toString()],T=w[h.from.toString()];if(!S||!T){const k=y.getPaintProperty(a);S=w[k],T=w[k]}S&&T&&g.setConstantPatternPositions(S,T)}function Ya(g,a,h,m,y,w,S){const T=g.context.gl,k="fill-pattern",R=h.paint.get(k),z=R&&R.constantOr(1),L=h.getCrossfadeParameters();let j,Q,ee,Y,ae;S?(Q=z&&!h.getPaintProperty("fill-outline-color")?"fillOutlinePattern":"fillOutline",j=T.LINES):(Q=z?"fillPattern":"fill",j=T.TRIANGLES);const _e=R.constantOr(null);for(const ye of m){const ie=a.getTile(ye);if(z&&!ie.patternsLoaded())continue;const we=ie.getBucket(h);if(!we)continue;const De=we.programConfigurations.get(h.id),Se=g.useProgram(Q,De),ke=g.style.map.terrain&&g.style.map.terrain.getTerrainData(ye);z&&(g.context.activeTexture.set(T.TEXTURE0),ie.imageAtlasTexture.bind(T.LINEAR,T.CLAMP_TO_EDGE),De.updatePaintBuffers(L)),Xa(De,k,_e,ie,h);const Be=ke?ye:null,Le=g.translatePosMatrix(Be?Be.posMatrix:ye.posMatrix,ie,h.paint.get("fill-translate"),h.paint.get("fill-translate-anchor"));if(S){Y=we.indexBuffer2,ae=we.segments2;const Ne=[T.drawingBufferWidth,T.drawingBufferHeight];ee="fillOutlinePattern"===Q&&z?Io(Le,g,L,ie,Ne):Of(Le,Ne)}else Y=we.indexBuffer,ae=we.segments,ee=z?Lc(Le,g,L,ie):Wr(Le);Se.draw(g.context,j,y,g.stencilModeForClipping(ye),w,rn.disabled,ee,ke,h.id,we.layoutVertexBuffer,Y,ae,h.paint,g.transform.zoom,De)}}function Xt(g,a,h,m,y,w,S){const T=g.context,k=T.gl,R="fill-extrusion-pattern",z=h.paint.get(R),L=z.constantOr(1),j=h.getCrossfadeParameters(),Q=h.paint.get("fill-extrusion-opacity"),ee=z.constantOr(null);for(const Y of m){const ae=a.getTile(Y),_e=ae.getBucket(h);if(!_e)continue;const ye=g.style.map.terrain&&g.style.map.terrain.getTerrainData(Y),ie=_e.programConfigurations.get(h.id),we=g.useProgram(L?"fillExtrusionPattern":"fillExtrusion",ie);L&&(g.context.activeTexture.set(k.TEXTURE0),ae.imageAtlasTexture.bind(k.LINEAR,k.CLAMP_TO_EDGE),ie.updatePaintBuffers(j)),Xa(ie,R,ee,ae,h);const De=g.translatePosMatrix(Y.posMatrix,ae,h.paint.get("fill-extrusion-translate"),h.paint.get("fill-extrusion-translate-anchor")),Se=h.paint.get("fill-extrusion-vertical-gradient"),ke=L?Nu(De,g,Se,Q,Y,j,ae):Yh(De,g,Se,Q);we.draw(T,T.gl.TRIANGLES,y,w,S,rn.backCCW,ke,ye,h.id,_e.layoutVertexBuffer,_e.indexBuffer,_e.segments,h.paint,g.transform.zoom,ie,g.style.map.terrain&&_e.centroidVertexBuffer)}}function Vc(g,a,h,m,y,w,S){const T=g.context,k=T.gl,R=h.fbo;if(!R)return;const z=g.useProgram("hillshade"),L=g.style.map.terrain&&g.style.map.terrain.getTerrainData(a);T.activeTexture.set(k.TEXTURE0),k.bindTexture(k.TEXTURE_2D,R.colorAttachment.get()),z.draw(T,k.TRIANGLES,y,w,S,rn.disabled,((j,Q,ee,Y)=>{const ae=ee.paint.get("hillshade-shadow-color"),_e=ee.paint.get("hillshade-highlight-color"),ye=ee.paint.get("hillshade-accent-color");let ie=ee.paint.get("hillshade-illumination-direction")*(Math.PI/180);"viewport"===ee.paint.get("hillshade-illumination-anchor")&&(ie-=j.transform.angle);const we=!j.options.moving;return{u_matrix:Y?Y.posMatrix:j.transform.calculatePosMatrix(Q.tileID.toUnwrapped(),we),u_image:0,u_latrange:Bu(0,Q.tileID),u_light:[ee.paint.get("hillshade-exaggeration"),ie],u_shadow:ae,u_highlight:_e,u_accent:ye}})(g,h,m,L?a:null),L,m.id,g.rasterBoundsBuffer,g.quadTriangleIndexBuffer,g.rasterBoundsSegments)}function Ka(g,a,h,m,y,w){const S=g.context,T=S.gl,k=a.dem;if(k&&k.data){const R=k.dim,z=k.stride,L=k.getPixels();if(S.activeTexture.set(T.TEXTURE1),S.pixelStoreUnpackPremultiplyAlpha.set(!1),a.demTexture=a.demTexture||g.getTileTexture(z),a.demTexture){const Q=a.demTexture;Q.update(L,{premultiply:!1}),Q.bind(T.NEAREST,T.CLAMP_TO_EDGE)}else a.demTexture=new Hn(S,L,T.RGBA,{premultiply:!1}),a.demTexture.bind(T.NEAREST,T.CLAMP_TO_EDGE);S.activeTexture.set(T.TEXTURE0);let j=a.fbo;if(!j){const Q=new Hn(S,{width:R,height:R,data:null},T.RGBA);Q.bind(T.LINEAR,T.CLAMP_TO_EDGE),j=a.fbo=S.createFramebuffer(R,R,!0),j.colorAttachment.set(Q.texture)}S.bindFramebuffer.set(j.framebuffer),S.viewport.set([0,0,R,R]),g.useProgram("hillshadePrepare").draw(S,T.TRIANGLES,m,y,w,rn.disabled,((Q,ee)=>{const Y=ee.stride,ae=b.create();return b.ortho(ae,0,b.EXTENT,-b.EXTENT,0,0,1),b.translate(ae,ae,[0,-b.EXTENT,0]),{u_matrix:ae,u_image:1,u_dimension:[Y,Y],u_zoom:Q.overscaledZ,u_unpack:ee.getUnpackVector()}})(a.tileID,k),null,h.id,g.rasterBoundsBuffer,g.quadTriangleIndexBuffer,g.rasterBoundsSegments),a.needsHillshadePrepare=!1}}function Ja(g,a,h,m,y,w){const S=m.paint.get("raster-fade-duration");if(!w&&S>0){const T=b.exported.now(),k=(T-g.timeAdded)/S,R=a?(T-a.timeAdded)/S:-1,z=h.getSource(),L=y.coveringZoomLevel({tileSize:z.tileSize,roundZoom:z.roundZoom}),j=!a||Math.abs(a.tileID.overscaledZ-L)>Math.abs(g.tileID.overscaledZ-L),Q=j&&g.refreshedUponExpiration?1:b.clamp(j?k:1-R,0,1);return g.refreshedUponExpiration&&k>=1&&(g.refreshedUponExpiration=!1),a?{opacity:1,mix:1-Q}:{opacity:Q,mix:0}}return{opacity:1,mix:0}}const da=new b.Color(1,0,0,1),lr=new b.Color(0,1,0,1),co=new b.Color(0,0,1,1),Qa=new b.Color(1,0,1,1),$r=new b.Color(0,1,1,1);function Yo(g,a,h,m){$n(g,0,a+h/2,g.transform.width,h,m)}function ad(g,a,h,m){$n(g,a-h/2,0,h,g.transform.height,m)}function $n(g,a,h,m,y,w){const S=g.context,T=S.gl;T.enable(T.SCISSOR_TEST),T.scissor(a*g.pixelRatio,h*g.pixelRatio,m*g.pixelRatio,y*g.pixelRatio),S.clear({color:w}),T.disable(T.SCISSOR_TEST)}function jm(g,a,h){const m=g.context,y=m.gl,w=h.posMatrix,S=g.useProgram("debug"),T=kt.disabled,k=cn.disabled,R=g.colorModeForRenderPass(),z="$debug",L=g.style.map.terrain&&g.style.map.terrain.getTerrainData(h);m.activeTexture.set(y.TEXTURE0),g.emptyTexture.bind(y.LINEAR,y.CLAMP_TO_EDGE);const j=a.getTileByID(h.key).latestRawTileData,Q=Math.floor((j&&j.byteLength||0)/1024),ee=a.getTile(h).tileSize,Y=512/Math.min(ee,512)*(h.overscaledZ/g.transform.zoom)*.5;let ae=h.canonical.toString();h.overscaledZ!==h.canonical.z&&(ae+=` => ${h.overscaledZ}`),function(_e,ye){_e.initDebugOverlayCanvas();const ie=_e.debugOverlayCanvas,we=_e.context.gl,De=_e.debugOverlayCanvas.getContext("2d");De.clearRect(0,0,ie.width,ie.height),De.shadowColor="white",De.shadowBlur=2,De.lineWidth=1.5,De.strokeStyle="white",De.textBaseline="top",De.font="bold 36px Open Sans, sans-serif",De.fillText(ye,5,5),De.strokeText(ye,5,5),_e.debugOverlayTexture.update(ie),_e.debugOverlayTexture.bind(we.LINEAR,we.CLAMP_TO_EDGE)}(g,`${ae} ${Q}kB`),S.draw(m,y.TRIANGLES,T,k,Nt.alphaBlended,rn.disabled,zu(w,b.Color.transparent,Y),null,z,g.debugBuffer,g.quadTriangleIndexBuffer,g.debugSegments),S.draw(m,y.LINE_STRIP,T,k,R,rn.disabled,zu(w,b.Color.red),L,z,g.debugBuffer,g.tileBorderIndexBuffer,g.debugSegments)}function ld(g,a,h){const m=g.context,y=m.gl,w=g.colorModeForRenderPass(),S=new kt(y.LEQUAL,kt.ReadWrite,g.depthRangeFor3D),T=g.useProgram("terrain"),k=a.getTerrainMesh();m.bindFramebuffer.set(null),m.viewport.set([0,0,g.width,g.height]);for(const R of h){const z=g.renderToTexture.getTexture(R),L=a.getTerrainData(R.tileID);m.activeTexture.set(y.TEXTURE0),y.bindTexture(y.TEXTURE_2D,z.texture);const j={u_matrix:g.transform.calculatePosMatrix(R.tileID.toUnwrapped()),u_texture:0,u_ele_delta:a.getMeshFrameDelta(g.transform.zoom)};T.draw(m,y.TRIANGLES,S,cn.disabled,w,rn.backCCW,j,L,"terrain",k.vertexBuffer,k.indexBuffer,k.segments)}}const $s={symbol:function(g,a,h,m,y){if("translucent"!==g.renderPass)return;const w=cn.disabled,S=g.colorModeForRenderPass();h.layout.get("text-variable-anchor")&&function(T,k,R,z,L,j,Q){const ee=k.transform,Y="map"===L,ae="map"===j;for(const _e of T){const ye=z.getTile(_e),ie=ye.getBucket(R);if(!ie||!ie.text||!ie.text.segments.get().length)continue;const we=b.evaluateSizeForZoom(ie.textSizeData,ee.zoom),De=Ie(ye,1,k.transform.zoom),Se=Vr(_e.posMatrix,ae,Y,k.transform,De),ke="none"!==R.layout.get("icon-text-fit")&&ie.hasIconData();if(we){const Be=Math.pow(2,ee.zoom-ye.tileID.overscaledZ);ha(ie,Y,ae,Q,ee,Se,_e.posMatrix,Be,we,ke,k.style.map.terrain?(Le,Ne)=>k.style.map.terrain.getElevation(_e,Le,Ne):null)}}}(m,g,h,a,h.layout.get("text-rotation-alignment"),h.layout.get("text-pitch-alignment"),y),0!==h.paint.get("icon-opacity").constantOr(1)&&Hi(g,a,h,m,!1,h.paint.get("icon-translate"),h.paint.get("icon-translate-anchor"),h.layout.get("icon-rotation-alignment"),h.layout.get("icon-pitch-alignment"),h.layout.get("icon-keep-upright"),w,S),0!==h.paint.get("text-opacity").constantOr(1)&&Hi(g,a,h,m,!0,h.paint.get("text-translate"),h.paint.get("text-translate-anchor"),h.layout.get("text-rotation-alignment"),h.layout.get("text-pitch-alignment"),h.layout.get("text-keep-upright"),w,S),a.map.showCollisionBoxes&&(Wt(g,a,h,m,h.paint.get("text-translate"),h.paint.get("text-translate-anchor"),!0),Wt(g,a,h,m,h.paint.get("icon-translate"),h.paint.get("icon-translate-anchor"),!1))},circle:function(g,a,h,m){if("translucent"!==g.renderPass)return;const y=h.paint.get("circle-opacity"),w=h.paint.get("circle-stroke-width"),S=h.paint.get("circle-stroke-opacity"),T=!h.layout.get("circle-sort-key").isConstant();if(0===y.constantOr(1)&&(0===w.constantOr(1)||0===S.constantOr(1)))return;const k=g.context,R=k.gl,z=g.depthModeForSublayer(0,kt.ReadOnly),L=cn.disabled,j=g.colorModeForRenderPass(),Q=[];for(let ee=0;eeee.sortKey-Y.sortKey);for(const ee of Q){const{programConfiguration:Y,program:ae,layoutVertexBuffer:_e,indexBuffer:ye,uniformValues:ie,terrainData:we}=ee.state;ae.draw(k,R.TRIANGLES,z,L,j,rn.disabled,ie,we,h.id,_e,ye,ee.segments,h.paint,g.transform.zoom,Y)}},heatmap:function(g,a,h,m){if(0!==h.paint.get("heatmap-opacity"))if("offscreen"===g.renderPass){const y=g.context,w=y.gl,S=cn.disabled,T=new Nt([w.ONE,w.ONE],b.Color.transparent,[!0,!0,!0,!0]);(function(k,R,z){const L=k.gl;k.activeTexture.set(L.TEXTURE1),k.viewport.set([0,0,R.width/4,R.height/4]);let j=z.heatmapFbo;if(j)L.bindTexture(L.TEXTURE_2D,j.colorAttachment.get()),k.bindFramebuffer.set(j.framebuffer);else{const Q=L.createTexture();L.bindTexture(L.TEXTURE_2D,Q),L.texParameteri(L.TEXTURE_2D,L.TEXTURE_WRAP_S,L.CLAMP_TO_EDGE),L.texParameteri(L.TEXTURE_2D,L.TEXTURE_WRAP_T,L.CLAMP_TO_EDGE),L.texParameteri(L.TEXTURE_2D,L.TEXTURE_MIN_FILTER,L.LINEAR),L.texParameteri(L.TEXTURE_2D,L.TEXTURE_MAG_FILTER,L.LINEAR),j=z.heatmapFbo=k.createFramebuffer(R.width/4,R.height/4,!1),function(ee,Y,ae,_e){const ye=ee.gl;ye.texImage2D(ye.TEXTURE_2D,0,ye.RGBA,Y.width/4,Y.height/4,0,ye.RGBA,ee.extRenderToTextureHalfFloat?ee.extTextureHalfFloat.HALF_FLOAT_OES:ye.UNSIGNED_BYTE,null),_e.colorAttachment.set(ae)}(k,R,Q,j)}})(y,g,h),y.clear({color:b.Color.transparent});for(let k=0;k{const ee=b.create();b.ortho(ee,0,z.width,z.height,0,0,1);const Y=z.context.gl;return{u_matrix:ee,u_world:[Y.drawingBufferWidth,Y.drawingBufferHeight],u_image:0,u_color_ramp:1,u_opacity:L.paint.get("heatmap-opacity")}})(y,w),null,w.id,y.viewportBuffer,y.quadTriangleIndexBuffer,y.viewportSegments,w.paint,y.transform.zoom)}(g,h))},line:function(g,a,h,m){if("translucent"!==g.renderPass)return;const y=h.paint.get("line-opacity"),w=h.paint.get("line-width");if(0===y.constantOr(1)||0===w.constantOr(1))return;const S=g.depthModeForSublayer(0,kt.ReadOnly),T=g.colorModeForRenderPass(),k=h.paint.get("line-dasharray"),R=h.paint.get("line-pattern"),z=R.constantOr(1),L=h.paint.get("line-gradient"),j=h.getCrossfadeParameters(),Q=z?"linePattern":k?"lineSDF":L?"lineGradient":"line",ee=g.context,Y=ee.gl;let ae=!0;for(const _e of m){const ye=a.getTile(_e);if(z&&!ye.patternsLoaded())continue;const ie=ye.getBucket(h);if(!ie)continue;const we=ie.programConfigurations.get(h.id),De=g.context.program.get(),Se=g.useProgram(Q,we),ke=ae||Se.program!==De,Be=g.style.map.terrain&&g.style.map.terrain.getTerrainData(_e),Le=R.constantOr(null);if(Le&&ye.imageAtlas){const ht=ye.imageAtlas,Pt=ht.patternPositions[Le.to.toString()],zt=ht.patternPositions[Le.from.toString()];Pt&&zt&&we.setConstantPatternPositions(Pt,zt)}const Ne=Be?_e:null,ze=z?ed(g,ye,h,j,Ne):k?Ui(g,ye,h,k,j,Ne):L?Qh(g,ye,h,ie.lineClipsArray.length,Ne):Vu(g,ye,h,Ne);if(z)ee.activeTexture.set(Y.TEXTURE0),ye.imageAtlasTexture.bind(Y.LINEAR,Y.CLAMP_TO_EDGE),we.updatePaintBuffers(j);else if(k&&(ke||g.lineAtlas.dirty))ee.activeTexture.set(Y.TEXTURE0),g.lineAtlas.bind(ee);else if(L){const ht=ie.gradients[h.id];let Pt=ht.texture;if(h.gradientVersion!==ht.version){let zt=256;if(h.stepInterpolant){const mt=a.getSource().maxzoom,Tn=_e.canonical.z===mt?Math.ceil(1<256&&this.clearStencil(),m.setColorMode(Nt.disabled),m.setDepthMode(kt.disabled);const w=this.useProgram("clippingMask");this._tileClippingMaskIDs={};for(const S of h){const T=this._tileClippingMaskIDs[S.key]=this.nextStencilID++,k=this.style.map.terrain&&this.style.map.terrain.getTerrainData(S);w.draw(m,y.TRIANGLES,kt.disabled,new cn({func:y.ALWAYS,mask:0},T,255,y.KEEP,y.KEEP,y.REPLACE),Nt.disabled,rn.disabled,Jh(S.posMatrix),k,"$clipping",this.tileExtentBuffer,this.quadTriangleIndexBuffer,this.tileExtentSegments)}}stencilModeFor3D(){this.currentStencilSource=void 0,this.nextStencilID+1>256&&this.clearStencil();const a=this.nextStencilID++,h=this.context.gl;return new cn({func:h.NOTEQUAL,mask:255},a,255,h.KEEP,h.KEEP,h.REPLACE)}stencilModeForClipping(a){const h=this.context.gl;return new cn({func:h.EQUAL,mask:255},this._tileClippingMaskIDs[a.key],0,h.KEEP,h.KEEP,h.REPLACE)}stencilConfigForOverlap(a){const h=this.context.gl,m=a.sort((S,T)=>T.overscaledZ-S.overscaledZ),y=m[m.length-1].overscaledZ,w=m[0].overscaledZ-y+1;if(w>1){this.currentStencilSource=void 0,this.nextStencilID+w>256&&this.clearStencil();const S={};for(let T=0;T=0;this.currentLayer--){const k=this.style._layers[m[this.currentLayer]],R=y[k.source],z=w[k.source];this._renderTileClippingMasks(k,z),this.renderLayer(this,R,k,z)}for(this.renderPass="translucent",this.currentLayer=0;this.currentLayerae.source&&!ae.isHidden(z)?[R.sourceCaches[ae.source]]:[]),Q=j.filter(ae=>"vector"===ae.getSource().type),ee=j.filter(ae=>"vector"!==ae.getSource().type),Y=ae=>{(!L||L.getSource().maxzoomY(ae)),L||ee.forEach(ae=>Y(ae)),L}(this.style,this.transform.zoom);k&&$s.debug(this,k,k.getVisibleCoordinates())}this.options.showPadding&&function(k){const R=k.transform.padding;Yo(k,k.transform.height-(R.top||0),3,da),Yo(k,R.bottom||0,3,lr),ad(k,R.left||0,3,co),ad(k,k.transform.width-(R.right||0),3,Qa);const z=k.transform.centerPoint;var L,j,Q,ee;$n(L=k,(j=z.x)-1,(Q=k.transform.height-z.y)-10,2,20,ee=$r),$n(L,j-10,Q-1,20,2,ee)}(this),this.context.setDefault()}renderLayer(a,h,m,y){m.isHidden(this.transform.zoom)||("background"===m.type||"custom"===m.type||(y||[]).length)&&(this.id=m.id,this.gpuTimingStart(m),$s[m.type](a,h,m,y,this.style.placement.variableOffsets),this.gpuTimingEnd())}gpuTimingStart(a){if(!this.options.gpuTiming)return;const h=this.context.extTimerQuery;let m=this.gpuTimers[a.id];m||(m=this.gpuTimers[a.id]={calls:0,cpuTime:0,query:h.createQueryEXT()}),m.calls++,h.beginQueryEXT(h.TIME_ELAPSED_EXT,m.query)}gpuTimingEnd(){if(!this.options.gpuTiming)return;const a=this.context.extTimerQuery;a.endQueryEXT(a.TIME_ELAPSED_EXT)}collectGpuTimers(){const a=this.gpuTimers;return this.gpuTimers={},a}queryGpuTimers(a){const h={};for(const m in a){const y=a[m],w=this.context.extTimerQuery,S=w.getQueryObjectEXT(y.query,w.QUERY_RESULT_EXT)/1e6;w.deleteQueryEXT(y.query),h[m]=S}return h}translatePosMatrix(a,h,m,y,w){if(!m[0]&&!m[1])return a;const S=w?"map"===y?this.transform.angle:0:"viewport"===y?-this.transform.angle:0;if(S){const R=Math.sin(S),z=Math.cos(S);m=[m[0]*z-m[1]*R,m[0]*R+m[1]*z]}const T=[w?m[0]:Ie(h,m[0],this.transform.zoom),w?m[1]:Ie(h,m[1],this.transform.zoom),0],k=new Float32Array(16);return b.translate(k,a,T),k}saveTileTexture(a){const h=this._tileTextures[a.size[0]];h?h.push(a):this._tileTextures[a.size[0]]=[a]}getTileTexture(a){const h=this._tileTextures[a];return h&&h.length>0?h.pop():null}isPatternMissing(a){if(!a)return!1;if(!a.from||!a.to)return!0;const h=this.imageManager.getPattern(a.from.toString()),m=this.imageManager.getPattern(a.to.toString());return!h||!m}useProgram(a,h){this.cache=this.cache||{};const m=a+(h?h.cacheKey:"")+(this._showOverdrawInspector?"/overdraw":"")+(this.style.map.terrain?"/terrain":"");return this.cache[m]||(this.cache[m]=new Xh(this.context,a,nt[a],h,Nc[a],this._showOverdrawInspector,this.style.map.terrain)),this.cache[m]}setCustomLayerDefaults(){this.context.unbindVAO(),this.context.cullFace.setDefault(),this.context.activeTexture.setDefault(),this.context.pixelStoreUnpack.setDefault(),this.context.pixelStoreUnpackPremultiplyAlpha.setDefault(),this.context.pixelStoreUnpackFlipY.setDefault()}setBaseState(){const a=this.context.gl;this.context.cullFace.set(!1),this.context.viewport.set([0,0,this.width,this.height]),this.context.blendEquation.set(a.FUNC_ADD)}initDebugOverlayCanvas(){null==this.debugOverlayCanvas&&(this.debugOverlayCanvas=document.createElement("canvas"),this.debugOverlayCanvas.width=512,this.debugOverlayCanvas.height=512,this.debugOverlayTexture=new Hn(this.context,this.debugOverlayCanvas,this.context.gl.RGBA))}destroy(){this.emptyTexture.destroy(),this.debugOverlayTexture&&this.debugOverlayTexture.destroy()}}class ct{constructor(a,h){this.points=a,this.planes=h}static fromInvProjectionMatrix(a,h,m){const y=Math.pow(2,m),w=[[-1,1,-1,1],[1,1,-1,1],[1,-1,-1,1],[-1,-1,-1,1],[-1,1,1,1],[1,1,1,1],[1,-1,1,1],[-1,-1,1,1]].map(T=>{const k=1/(T=b.transformMat4([],T,a))[3]/h*y;return b.mul$1(T,T,[k,k,1/T[3],k])}),S=[[0,1,2],[6,5,4],[0,3,7],[2,1,5],[3,2,6],[0,4,5]].map(T=>{const k=function(j,Q){var ee=Q[0],Y=Q[1],ae=Q[2],_e=ee*ee+Y*Y+ae*ae;return _e>0&&(_e=1/Math.sqrt(_e)),j[0]=Q[0]*_e,j[1]=Q[1]*_e,j[2]=Q[2]*_e,j}([],(j=[],Q=ro([],w[T[0]],w[T[1]]),ee=ro([],w[T[2]],w[T[1]]),Y=Q[0],ye=ee[0],j[0]=(ae=Q[1])*(we=ee[2])-(_e=Q[2])*(ie=ee[1]),j[1]=_e*ye-Y*we,j[2]=Y*ie-ae*ye,j)),R=-((z=k)[0]*(L=w[T[1]])[0]+z[1]*L[1]+z[2]*L[2]);var j,Q,ee,Y,ae,_e,ye,ie,we,z,L;return k.concat(R)});return new ct(w,S)}}class fa{constructor(a,h){var m,y,w;this.min=a,this.max=h,this.center=function(m,y,w){return m[0]=.5*y[0],m[1]=.5*y[1],m[2]=.5*y[2],m}([],((m=[])[0]=(y=this.min)[0]+(w=this.max)[0],m[1]=y[1]+w[1],m[2]=y[2]+w[2],m))}quadrant(a){const h=[a%2==0,a<2],m=na(this.min),y=na(this.max);for(let w=0;w=0&&S++;if(0===S)return 0;S!==h.length&&(m=!1)}if(m)return 2;for(let y=0;y<3;y++){let w=Number.MAX_VALUE,S=-Number.MAX_VALUE;for(let T=0;Tthis.max[y]-this.min[y])return 0}return 1}}class uo{constructor(a=0,h=0,m=0,y=0){if(isNaN(a)||a<0||isNaN(h)||h<0||isNaN(m)||m<0||isNaN(y)||y<0)throw new Error("Invalid value for edge-insets, top, bottom, left and right must all be numbers");this.top=a,this.bottom=h,this.left=m,this.right=y}interpolate(a,h,m){return null!=h.top&&null!=a.top&&(this.top=b.number(a.top,h.top,m)),null!=h.bottom&&null!=a.bottom&&(this.bottom=b.number(a.bottom,h.bottom,m)),null!=h.left&&null!=a.left&&(this.left=b.number(a.left,h.left,m)),null!=h.right&&null!=a.right&&(this.right=b.number(a.right,h.right,m)),this}getCenter(a,h){const m=b.clamp((this.left+a-this.right)/2,0,a),y=b.clamp((this.top+h-this.bottom)/2,0,h);return new b.pointGeometry(m,y)}equals(a){return this.top===a.top&&this.bottom===a.bottom&&this.left===a.left&&this.right===a.right}clone(){return new uo(this.top,this.bottom,this.left,this.right)}toJSON(){return{top:this.top,bottom:this.bottom,left:this.left,right:this.right}}}class Er{constructor(a,h,m,y,w){this.tileSize=512,this.maxValidLatitude=85.051129,this.freezeElevation=!1,this._renderWorldCopies=void 0===w||!!w,this._minZoom=a||0,this._maxZoom=h||22,this._minPitch=m??0,this._maxPitch=y??60,this.setMaxBounds(),this.width=0,this.height=0,this._center=new b.LngLat(0,0),this._elevation=0,this.zoom=0,this.angle=0,this._fov=.6435011087932844,this._pitch=0,this._unmodified=!0,this._edgeInsets=new uo,this._posMatrixCache={},this._alignedPosMatrixCache={}}clone(){const a=new Er(this._minZoom,this._maxZoom,this._minPitch,this.maxPitch,this._renderWorldCopies);return a.tileSize=this.tileSize,a.latRange=this.latRange,a.width=this.width,a.height=this.height,a._center=this._center,a._elevation=this._elevation,a.zoom=this.zoom,a.angle=this.angle,a._fov=this._fov,a._pitch=this._pitch,a._unmodified=this._unmodified,a._edgeInsets=this._edgeInsets.clone(),a._calcMatrices(),a}get minZoom(){return this._minZoom}set minZoom(a){this._minZoom!==a&&(this._minZoom=a,this.zoom=Math.max(this.zoom,a))}get maxZoom(){return this._maxZoom}set maxZoom(a){this._maxZoom!==a&&(this._maxZoom=a,this.zoom=Math.min(this.zoom,a))}get minPitch(){return this._minPitch}set minPitch(a){this._minPitch!==a&&(this._minPitch=a,this.pitch=Math.max(this.pitch,a))}get maxPitch(){return this._maxPitch}set maxPitch(a){this._maxPitch!==a&&(this._maxPitch=a,this.pitch=Math.min(this.pitch,a))}get renderWorldCopies(){return this._renderWorldCopies}set renderWorldCopies(a){void 0===a?a=!0:null===a&&(a=!1),this._renderWorldCopies=a}get worldSize(){return this.tileSize*this.scale}get centerOffset(){return this.centerPoint._sub(this.size._div(2))}get size(){return new b.pointGeometry(this.width,this.height)}get bearing(){return-this.angle/Math.PI*180}set bearing(a){const h=-b.wrap(a,-180,180)*Math.PI/180;var m;this.angle!==h&&(this._unmodified=!1,this.angle=h,this._calcMatrices(),this.rotationMatrix=(m=new b.ARRAY_TYPE(4),b.ARRAY_TYPE!=Float32Array&&(m[1]=0,m[2]=0),m[0]=1,m[3]=1,m),function(m,y,w){var S=y[0],T=y[1],k=y[2],R=y[3],z=Math.sin(w),L=Math.cos(w);m[0]=S*L+k*z,m[1]=T*L+R*z,m[2]=S*-z+k*L,m[3]=T*-z+R*L}(this.rotationMatrix,this.rotationMatrix,this.angle))}get pitch(){return this._pitch/Math.PI*180}set pitch(a){const h=b.clamp(a,this.minPitch,this.maxPitch)/180*Math.PI;this._pitch!==h&&(this._unmodified=!1,this._pitch=h,this._calcMatrices())}get fov(){return this._fov/Math.PI*180}set fov(a){a=Math.max(.01,Math.min(60,a)),this._fov!==a&&(this._unmodified=!1,this._fov=a/180*Math.PI,this._calcMatrices())}get zoom(){return this._zoom}set zoom(a){const h=Math.min(Math.max(a,this.minZoom),this.maxZoom);this._zoom!==h&&(this._unmodified=!1,this._zoom=h,this.tileZoom=Math.max(0,Math.floor(h)),this.scale=this.zoomScale(h),this._constrain(),this._calcMatrices())}get center(){return this._center}set center(a){a.lat===this._center.lat&&a.lng===this._center.lng||(this._unmodified=!1,this._center=a,this._constrain(),this._calcMatrices())}get elevation(){return this._elevation}set elevation(a){a!==this._elevation&&(this._elevation=a,this._constrain(),this._calcMatrices())}get padding(){return this._edgeInsets.toJSON()}set padding(a){this._edgeInsets.equals(a)||(this._unmodified=!1,this._edgeInsets.interpolate(this._edgeInsets,a,1),this._calcMatrices())}get centerPoint(){return this._edgeInsets.getCenter(this.width,this.height)}isPaddingEqual(a){return this._edgeInsets.equals(a)}interpolatePadding(a,h,m){this._unmodified=!1,this._edgeInsets.interpolate(a,h,m),this._constrain(),this._calcMatrices()}coveringZoomLevel(a){const h=(a.roundZoom?Math.round:Math.floor)(this.zoom+this.scaleZoom(this.tileSize/a.tileSize));return Math.max(0,h)}getVisibleUnwrappedCoordinates(a){const h=[new b.UnwrappedTileID(0,a)];if(this._renderWorldCopies){const m=this.pointCoordinate(new b.pointGeometry(0,0)),y=this.pointCoordinate(new b.pointGeometry(this.width,0)),w=this.pointCoordinate(new b.pointGeometry(this.width,this.height)),S=this.pointCoordinate(new b.pointGeometry(0,this.height)),T=Math.floor(Math.min(m.x,y.x,w.x,S.x)),k=Math.floor(Math.max(m.x,y.x,w.x,S.x)),R=1;for(let z=T-R;z<=k+R;z++)0!==z&&h.push(new b.UnwrappedTileID(z,a))}return h}coveringTiles(a){var h,m;let y=this.coveringZoomLevel(a);const w=y;if(void 0!==a.minzoom&&ya.maxzoom&&(y=a.maxzoom);const S=this.pointCoordinate(this.getCameraPoint()),T=b.MercatorCoordinate.fromLngLat(this.center),k=Math.pow(2,y),R=[k*S.x,k*S.y,0],z=[k*T.x,k*T.y,0],L=ct.fromInvProjectionMatrix(this.invProjMatrix,this.worldSize,y);let j=a.minzoom||0;!a.terrain&&this.pitch<=60&&this._edgeInsets.top<.1&&(j=y);const Q=a.terrain?2/Math.min(this.tileSize,a.tileSize)*this.tileSize:3,ee=ie=>({aabb:new fa([ie*k,0,0],[(ie+1)*k,k,0]),zoom:0,x:0,y:0,wrap:ie,fullyVisible:!1}),Y=[],ae=[],_e=y,ye=a.reparseOverscaled?w:y;if(this._renderWorldCopies)for(let ie=1;ie<=3;ie++)Y.push(ee(-ie)),Y.push(ee(ie));for(Y.push(ee(0));Y.length>0;){const ie=Y.pop(),we=ie.x,De=ie.y;let Se=ie.fullyVisible;if(!Se){const ze=ie.aabb.intersects(L);if(0===ze)continue;Se=2===ze}const ke=a.terrain?R:z,Be=ie.aabb.distanceX(ke),Le=ie.aabb.distanceY(ke),Ne=Math.max(Math.abs(Be),Math.abs(Le));if(ie.zoom===_e||Ne>Q+(1<<_e-ie.zoom)-2&&ie.zoom>=j){const ze=_e-ie.zoom,ht=R[0]-.5-(we<>1),zt=ie.zoom+1;let mt=ie.aabb.quadrant(ze);if(a.terrain){const Tn=new b.OverscaledTileID(zt,ie.wrap,zt,ht,Pt),An=a.terrain.getMinMaxElevation(Tn),Ht=null!==(h=An.minElevation)&&void 0!==h?h:this.elevation,on=null!==(m=An.maxElevation)&&void 0!==m?m:this.elevation;mt=new fa([mt.min[0],mt.min[1],Ht],[mt.max[0],mt.max[1],on])}Y.push({aabb:mt,zoom:zt,x:ht,y:Pt,wrap:ie.wrap,fullyVisible:Se})}}return ae.sort((ie,we)=>ie.distanceSq-we.distanceSq).map(ie=>ie.tileID)}resize(a,h){this.width=a,this.height=h,this.pixelsToGLUnits=[2/a,-2/h],this._constrain(),this._calcMatrices()}get unmodified(){return this._unmodified}zoomScale(a){return Math.pow(2,a)}scaleZoom(a){return Math.log(a)/Math.LN2}project(a){const h=b.clamp(a.lat,-this.maxValidLatitude,this.maxValidLatitude);return new b.pointGeometry(b.mercatorXfromLng(a.lng)*this.worldSize,b.mercatorYfromLat(h)*this.worldSize)}unproject(a){return new b.MercatorCoordinate(a.x/this.worldSize,a.y/this.worldSize).toLngLat()}get point(){return this.project(this.center)}updateElevation(a){this.freezeElevation||(this.elevation=a?this.getElevation(this._center,a):0)}getElevation(a,h){const m=b.MercatorCoordinate.fromLngLat(a),y=(1<S&&(y=S-ee)}if(this.lngRange){const Q=(T+k)/2,ee=b.wrap(L.x,Q-this.worldSize/2,Q+this.worldSize/2),Y=R.x/2;ee-Yk&&(m=k-Y)}void 0===m&&void 0===y||(this.center=this.unproject(new b.pointGeometry(void 0!==m?m:L.x,void 0!==y?y:L.y)).wrap()),this._unmodified=z,this._constraining=!1}_calcMatrices(){if(!this.height)return;const a=this.centerOffset,h=this.point.x,m=this.point.y;this.cameraToCenterDistance=.5/Math.tan(this._fov/2)*this.height,this._pixelPerMeter=b.mercatorZfromAltitude(1,this.center.lat)*this.worldSize;let y=b.identity(new Float64Array(16));b.scale(y,y,[this.width/2,-this.height/2,1]),b.translate(y,y,[1,-1,0]),this.labelPlaneMatrix=y,y=b.identity(new Float64Array(16)),b.scale(y,y,[1,-1,1]),b.translate(y,y,[-1,-1,0]),b.scale(y,y,[2/this.width,2/this.height,1]),this.glCoordMatrix=y,this.cameraToSeaLevelDistance=this.cameraToCenterDistance+this._elevation*this._pixelPerMeter/Math.cos(this._pitch);const w=this._elevation<0?this.cameraToCenterDistance:this.cameraToSeaLevelDistance,S=Math.PI/2+this._pitch,T=this._fov*(.5+a.y/this.height),k=Math.sin(T)*w/Math.sin(b.clamp(Math.PI-S-T,.01,Math.PI-.01)),R=this.getHorizon(),z=2*Math.atan(R/this.cameraToCenterDistance)*(.5+a.y/(2*R)),L=Math.sin(z)*w/Math.sin(b.clamp(Math.PI-S-z,.01,Math.PI-.01)),j=Math.min(k,L),Q=1.01*(Math.cos(Math.PI/2-this._pitch)*j+w),ee=this.height/50;y=new Float64Array(16),b.perspective(y,this._fov,this.width/this.height,ee,Q),y[8]=2*-a.x/this.width,y[9]=2*a.y/this.height,b.scale(y,y,[1,-1,1]),b.translate(y,y,[0,0,-this.cameraToCenterDistance]),b.rotateX(y,y,this._pitch),b.rotateZ(y,y,this.angle),b.translate(y,y,[-h,-m,0]),this.mercatorMatrix=b.scale([],y,[this.worldSize,this.worldSize,this.worldSize]),b.scale(y,y,[1,1,this._pixelPerMeter]),this.pixelMatrix=b.multiply(new Float64Array(16),this.labelPlaneMatrix,y),b.translate(y,y,[0,0,-this.elevation]),this.projMatrix=y,this.invProjMatrix=b.invert([],y),this.pixelMatrix3D=b.multiply(new Float64Array(16),this.labelPlaneMatrix,y);const Y=this.width%2/2,ae=this.height%2/2,_e=Math.cos(this.angle),ye=Math.sin(this.angle),ie=h-Math.round(h)+_e*Y+ye*ae,we=m-Math.round(m)+_e*ae+ye*Y,De=new Float64Array(y);if(b.translate(De,De,[ie>.5?ie-1:ie,we>.5?we-1:we,0]),this.alignedProjMatrix=De,y=b.invert(new Float64Array(16),this.pixelMatrix),!y)throw new Error("failed to invert matrix");this.pixelMatrixInverse=y,this._posMatrixCache={},this._alignedPosMatrixCache={}}maxPitchScaleFactor(){if(!this.pixelMatrixInverse)return 1;const a=this.pointCoordinate(new b.pointGeometry(0,0)),h=[a.x*this.worldSize,a.y*this.worldSize,0,1];return b.transformMat4(h,h,this.pixelMatrix)[3]/this.cameraToCenterDistance}getCameraPoint(){const a=Math.tan(this._pitch)*(this.cameraToCenterDistance||1);return this.centerPoint.add(new b.pointGeometry(0,a))}getCameraQueryGeometry(a){const h=this.getCameraPoint();if(1===a.length)return[a[0],h];{let m=h.x,y=h.y,w=h.x,S=h.y;for(const T of a)m=Math.min(m,T.x),y=Math.min(y,T.y),w=Math.max(w,T.x),S=Math.max(S,T.y);return[new b.pointGeometry(m,y),new b.pointGeometry(w,y),new b.pointGeometry(w,S),new b.pointGeometry(m,S),new b.pointGeometry(m,y)]}}}class zf{constructor(a){this._hashName=a&&encodeURIComponent(a),b.bindAll(["_getCurrentHash","_onHashChange","_updateHash"],this),this._updateHash=function(h,m){let y=!1,w=null;const S=()=>{w=null,y&&(h(),w=setTimeout(S,300),y=!1)};return()=>(y=!0,w||S(),w)}(this._updateHashUnthrottled.bind(this))}addTo(a){return this._map=a,addEventListener("hashchange",this._onHashChange,!1),this._map.on("moveend",this._updateHash),this}remove(){return removeEventListener("hashchange",this._onHashChange,!1),this._map.off("moveend",this._updateHash),clearTimeout(this._updateHash()),delete this._map,this}getHashString(a){const h=this._map.getCenter(),m=Math.round(100*this._map.getZoom())/100,y=Math.ceil((m*Math.LN2+Math.log(512/360/.5))/Math.LN10),w=Math.pow(10,y),S=Math.round(h.lng*w)/w,T=Math.round(h.lat*w)/w,k=this._map.getBearing(),R=this._map.getPitch();let z="";if(z+=a?`/${S}/${T}/${m}`:`${m}/${T}/${S}`,(k||R)&&(z+="/"+Math.round(10*k)/10),R&&(z+=`/${Math.round(R)}`),this._hashName){const L=this._hashName;let j=!1;const Q=window.location.hash.slice(1).split("&").map(ee=>{const Y=ee.split("=")[0];return Y===L?(j=!0,`${Y}=${z}`):ee}).filter(ee=>ee);return j||Q.push(`${L}=${z}`),`#${Q.join("&")}`}return`#${z}`}_getCurrentHash(){const a=window.location.hash.replace("#","");if(this._hashName){let h;return a.split("&").map(m=>m.split("=")).forEach(m=>{m[0]===this._hashName&&(h=m)}),(h&&h[1]||"").split("/")}return a.split("/")}_onHashChange(){const a=this._getCurrentHash();if(a.length>=3&&!a.some(h=>isNaN(h))){const h=this._map.dragRotate.isEnabled()&&this._map.touchZoomRotate.isEnabled()?+(a[3]||0):this._map.getBearing();return this._map.jumpTo({center:[+a[2],+a[1]],zoom:+a[0],bearing:h,pitch:+(a[4]||0)}),!0}return!1}_updateHashUnthrottled(){const a=window.location.href.replace(/(#.+)?$/,this.getHashString());try{window.history.replaceState(window.history.state,null,a)}catch{}}}const Xe={linearity:.3,easing:b.bezier(0,0,.3,1)},ho=b.extend({deceleration:2500,maxSpeed:1400},Xe),cd=b.extend({deceleration:20,maxSpeed:1400},Xe),Zu=b.extend({deceleration:1e3,maxSpeed:360},Xe),jl=b.extend({deceleration:1e3,maxSpeed:90},Xe);class ko{constructor(a){this._map=a,this.clear()}clear(){this._inertiaBuffer=[]}record(a){this._drainInertiaBuffer(),this._inertiaBuffer.push({time:b.exported.now(),settings:a})}_drainInertiaBuffer(){const a=this._inertiaBuffer,h=b.exported.now();for(;a.length>0&&h-a[0].time>160;)a.shift()}_onMoveEnd(a){if(this._drainInertiaBuffer(),this._inertiaBuffer.length<2)return;const h={zoom:0,bearing:0,pitch:0,pan:new b.pointGeometry(0,0),pinchAround:void 0,around:void 0};for(const{settings:w}of this._inertiaBuffer)h.zoom+=w.zoomDelta||0,h.bearing+=w.bearingDelta||0,h.pitch+=w.pitchDelta||0,w.panDelta&&h.pan._add(w.panDelta),w.around&&(h.around=w.around),w.pinchAround&&(h.pinchAround=w.pinchAround);const m=this._inertiaBuffer[this._inertiaBuffer.length-1].time-this._inertiaBuffer[0].time,y={};if(h.pan.mag()){const w=ud(h.pan.mag(),m,b.extend({},ho,a||{}));y.offset=h.pan.mult(w.amount/h.pan.mag()),y.center=this._map.transform.center,Uc(y,w)}if(h.zoom){const w=ud(h.zoom,m,cd);y.zoom=this._map.transform.zoom+w.amount,Uc(y,w)}if(h.bearing){const w=ud(h.bearing,m,Zu);y.bearing=this._map.transform.bearing+b.clamp(w.amount,-179,179),Uc(y,w)}if(h.pitch){const w=ud(h.pitch,m,jl);y.pitch=this._map.transform.pitch+w.amount,Uc(y,w)}if(y.zoom||y.bearing){const w=void 0===h.pinchAround?h.around:h.pinchAround;y.around=w?this._map.unproject(w):this._map.getCenter()}return this.clear(),b.extend(y,{noMoveStart:!0})}}function Uc(g,a){(!g.duration||g.durationh.unproject(k)),T=w.reduce((k,R,z,L)=>k.add(R.div(L.length)),new b.pointGeometry(0,0));super(a,{points:w,point:T,lngLats:S,lngLat:h.unproject(T),originalEvent:m}),this._defaultPrevented=!1}}class Bf extends b.Event{preventDefault(){this._defaultPrevented=!0}get defaultPrevented(){return this._defaultPrevented}constructor(a,h,m){super(a,{originalEvent:m}),this._defaultPrevented=!1}}class Vf{constructor(a,h){this._map=a,this._clickTolerance=h.clickTolerance}reset(){delete this._mousedownPos}wheel(a){return this._firePreventable(new Bf(a.type,this._map,a))}mousedown(a,h){return this._mousedownPos=h,this._firePreventable(new Po(a.type,this._map,a))}mouseup(a){this._map.fire(new Po(a.type,this._map,a))}click(a,h){this._mousedownPos&&this._mousedownPos.dist(h)>=this._clickTolerance||this._map.fire(new Po(a.type,this._map,a))}dblclick(a){return this._firePreventable(new Po(a.type,this._map,a))}mouseover(a){this._map.fire(new Po(a.type,this._map,a))}mouseout(a){this._map.fire(new Po(a.type,this._map,a))}touchstart(a){return this._firePreventable(new Hl(a.type,this._map,a))}touchmove(a){this._map.fire(new Hl(a.type,this._map,a))}touchend(a){this._map.fire(new Hl(a.type,this._map,a))}touchcancel(a){this._map.fire(new Hl(a.type,this._map,a))}_firePreventable(a){if(this._map.fire(a),a.defaultPrevented)return{}}isEnabled(){return!0}isActive(){return!1}enable(){}disable(){}}class Uf{constructor(a){this._map=a}reset(){this._delayContextMenu=!1,this._ignoreContextMenu=!0,delete this._contextMenuEvent}mousemove(a){this._map.fire(new Po(a.type,this._map,a))}mousedown(){this._delayContextMenu=!0,this._ignoreContextMenu=!1}mouseup(){this._delayContextMenu=!1,this._contextMenuEvent&&(this._map.fire(new Po("contextmenu",this._map,this._contextMenuEvent)),delete this._contextMenuEvent)}contextmenu(a){this._delayContextMenu?this._contextMenuEvent=a:this._ignoreContextMenu||this._map.fire(new Po(a.type,this._map,a)),this._map.listens("contextmenu")&&a.preventDefault()}isEnabled(){return!0}isActive(){return!1}enable(){}disable(){}}class fo{constructor(a,h){this._map=a,this._el=a.getCanvasContainer(),this._container=a.getContainer(),this._clickTolerance=h.clickTolerance||1}isEnabled(){return!!this._enabled}isActive(){return!!this._active}enable(){this.isEnabled()||(this._enabled=!0)}disable(){this.isEnabled()&&(this._enabled=!1)}mousedown(a,h){this.isEnabled()&&a.shiftKey&&0===a.button&&(Te.disableDrag(),this._startPos=this._lastPos=h,this._active=!0)}mousemoveWindow(a,h){if(!this._active)return;const m=h;if(this._lastPos.equals(m)||!this._box&&m.dist(this._startPos)w.fitScreenCoordinates(m,y,this._map.getBearing(),{linear:!0})};this._fireEvent("boxzoomcancel",a)}keydown(a){this._active&&27===a.keyCode&&(this.reset(),this._fireEvent("boxzoomcancel",a))}reset(){this._active=!1,this._container.classList.remove("maplibregl-crosshair"),this._box&&(Te.remove(this._box),this._box=null),Te.enableDrag(),delete this._startPos,delete this._lastPos}_fireEvent(a,h){return this._map.fire(new b.Event(a,{originalEvent:h}))}}function js(g,a){if(g.length!==a.length)throw new Error(`The number of touches and points are not equal - touches ${g.length}, points ${a.length}`);const h={};for(let m=0;mthis.numTouches)&&(this.aborted=!0),this.aborted||(void 0===this.startTime&&(this.startTime=a.timeStamp),m.length===this.numTouches&&(this.centroid=function(y){const w=new b.pointGeometry(0,0);for(const S of y)w._add(S);return w.div(y.length)}(h),this.touches=js(m,h)))}touchmove(a,h,m){if(this.aborted||!this.centroid)return;const y=js(m,h);for(const w in this.touches){const S=y[w];(!S||S.dist(this.touches[w])>30)&&(this.aborted=!0)}}touchend(a,h,m){if((!this.centroid||a.timeStamp-this.startTime>500)&&(this.aborted=!0),0===m.length){const y=!this.aborted&&this.centroid;if(this.reset(),y)return y}}}class Wu{constructor(a){this.singleTap=new Hm(a),this.numTaps=a.numTaps,this.reset()}reset(){this.lastTime=1/0,delete this.lastTap,this.count=0,this.singleTap.reset()}touchstart(a,h,m){this.singleTap.touchstart(a,h,m)}touchmove(a,h,m){this.singleTap.touchmove(a,h,m)}touchend(a,h,m){const y=this.singleTap.touchend(a,h,m);if(y){const w=a.timeStamp-this.lastTime<500,S=!this.lastTap||this.lastTap.dist(y)<30;if(w&&S||this.reset(),this.count++,this.lastTime=a.timeStamp,this.lastTap=y,this.count===this.numTaps)return this.reset(),y}}}class $f{constructor(){this._zoomIn=new Wu({numTouches:1,numTaps:2}),this._zoomOut=new Wu({numTouches:2,numTaps:1}),this.reset()}reset(){this._active=!1,this._zoomIn.reset(),this._zoomOut.reset()}touchstart(a,h,m){this._zoomIn.touchstart(a,h,m),this._zoomOut.touchstart(a,h,m)}touchmove(a,h,m){this._zoomIn.touchmove(a,h,m),this._zoomOut.touchmove(a,h,m)}touchend(a,h,m){const y=this._zoomIn.touchend(a,h,m),w=this._zoomOut.touchend(a,h,m);return y?(this._active=!0,a.preventDefault(),setTimeout(()=>this.reset(),0),{cameraAnimation:S=>S.easeTo({duration:300,zoom:S.getZoom()+1,around:S.unproject(y)},{originalEvent:a})}):w?(this._active=!0,a.preventDefault(),setTimeout(()=>this.reset(),0),{cameraAnimation:S=>S.easeTo({duration:300,zoom:S.getZoom()-1,around:S.unproject(w)},{originalEvent:a})}):void 0}touchcancel(){this.reset()}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class Gl{constructor(a){this._enabled=!!a.enable,this._moveStateManager=a.moveStateManager,this._clickTolerance=a.clickTolerance||1,this._moveFunction=a.move,this._activateOnStart=!!a.activateOnStart,a.assignEvents(this),this.reset()}reset(a){this._active=!1,this._moved=!1,delete this._lastPoint,this._moveStateManager.endMove(a)}_move(...a){const h=this._moveFunction(...a);if(h.bearingDelta||h.pitchDelta||h.around||h.panDelta)return this._active=!0,h}dragStart(a,h){this.isEnabled()&&!this._lastPoint&&this._moveStateManager.isValidStartEvent(a)&&(this._moveStateManager.startMove(a),this._lastPoint=h.length?h[0]:h,this._activateOnStart&&this._lastPoint&&(this._active=!0))}dragMove(a,h){if(!this.isEnabled())return;const m=this._lastPoint;if(!m)return;if(a.preventDefault(),!this._moveStateManager.isValidMoveEvent(a))return void this.reset(a);const y=h.length?h[0]:h;return!this._moved&&y.dist(m){g.mousedown=g.dragStart,g.mousemoveWindow=g.dragMove,g.mouseup=g.dragEnd,g.contextmenu=function(a){a.preventDefault()}},hd=({enable:g,clickTolerance:a,bearingDegreesPerPixelMoved:h=.8})=>{const m=new po({checkCorrectEvent:y=>0===Te.mouseButton(y)&&y.ctrlKey||2===Te.mouseButton(y)});return new Gl({clickTolerance:a,move:(y,w)=>({bearingDelta:(w.x-y.x)*h}),moveStateManager:m,enable:g,assignEvents:$c})},Xu=({enable:g,clickTolerance:a,pitchDegreesPerPixelMoved:h=-.5})=>{const m=new po({checkCorrectEvent:y=>0===Te.mouseButton(y)&&y.ctrlKey||2===Te.mouseButton(y)});return new Gl({clickTolerance:a,move:(y,w)=>({pitchDelta:(w.y-y.y)*h}),moveStateManager:m,enable:g,assignEvents:$c})};class Yu{constructor(a,h){this._minTouches=a.cooperativeGestures?2:1,this._clickTolerance=a.clickTolerance||1,this._map=h,this.reset()}reset(){this._active=!1,this._touches={},this._sum=new b.pointGeometry(0,0),setTimeout(()=>{this._cancelCooperativeMessage=!1},200)}touchstart(a,h,m){return this._calculateTransform(a,h,m)}touchmove(a,h,m){if(this._map._cooperativeGestures&&(2===this._minTouches&&m.length<2&&!this._cancelCooperativeMessage?this._map._onCooperativeGesture(a,!1,m.length):this._cancelCooperativeMessage||(this._cancelCooperativeMessage=!0)),this._active&&!(m.length0&&(this._active=!0);const y=js(m,h),w=new b.pointGeometry(0,0),S=new b.pointGeometry(0,0);let T=0;for(const R in y){const z=y[R],L=this._touches[R];L&&(w._add(z),S._add(z.sub(L)),T++,y[R]=z)}if(this._touches=y,TMath.abs(g.x)}class pd extends dd{constructor(a){super(),this._map=a}reset(){super.reset(),this._valid=void 0,delete this._firstMove,delete this._lastPoints}touchstart(a,h,m){super.touchstart(a,h,m),this._currentTouchCount=m.length}_start(a){this._lastPoints=a,el(a[0].sub(a[1]))&&(this._valid=!1)}_move(a,h,m){if(this._map._cooperativeGestures&&this._currentTouchCount<3)return;const y=a[0].sub(this._lastPoints[0]),w=a[1].sub(this._lastPoints[1]);return this._valid=this.gestureBeginsVertically(y,w,m.timeStamp),this._valid?(this._lastPoints=a,this._active=!0,{pitchDelta:(y.y+w.y)/2*-.5}):void 0}gestureBeginsVertically(a,h,m){if(void 0!==this._valid)return this._valid;const y=a.mag()>=2,w=h.mag()>=2;if(!y&&!w)return;if(!y||!w)return void 0===this._firstMove&&(this._firstMove=m),m-this._firstMove<100&&void 0;const S=a.y>0==h.y>0;return el(a)&&el(h)&&S}}const md={panStep:100,bearingStep:15,pitchStep:10};class Di{constructor(){const a=md;this._panStep=a.panStep,this._bearingStep=a.bearingStep,this._pitchStep=a.pitchStep,this._rotationDisabled=!1}reset(){this._active=!1}keydown(a){if(a.altKey||a.ctrlKey||a.metaKey)return;let h=0,m=0,y=0,w=0,S=0;switch(a.keyCode){case 61:case 107:case 171:case 187:h=1;break;case 189:case 109:case 173:h=-1;break;case 37:a.shiftKey?m=-1:(a.preventDefault(),w=-1);break;case 39:a.shiftKey?m=1:(a.preventDefault(),w=1);break;case 38:a.shiftKey?y=1:(a.preventDefault(),S=-1);break;case 40:a.shiftKey?y=-1:(a.preventDefault(),S=1);break;default:return}return this._rotationDisabled&&(m=0,y=0),{cameraAnimation:T=>{const k=T.getZoom();T.easeTo({duration:300,easeId:"keyboardHandler",easing:jc,zoom:h?Math.round(k)+h*(a.shiftKey?2:1):k,bearing:T.getBearing()+m*this._bearingStep,pitch:T.getPitch()+y*this._pitchStep,offset:[-w*this._panStep,-S*this._panStep],center:T.getCenter()},{originalEvent:a})}}}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 jc(g){return g*(2-g)}const Ko=4.000244140625;class gd{constructor(a,h){this._map=a,this._el=a.getCanvasContainer(),this._handler=h,this._delta=0,this._defaultZoomRate=.01,this._wheelZoomRate=.0022222222222222222,b.bindAll(["_onTimeout"],this)}setZoomRate(a){this._defaultZoomRate=a}setWheelZoomRate(a){this._wheelZoomRate=a}isEnabled(){return!!this._enabled}isActive(){return!!this._active||void 0!==this._finishTimeout}isZooming(){return!!this._zooming}enable(a){this.isEnabled()||(this._enabled=!0,this._aroundCenter=a&&"center"===a.around)}disable(){this.isEnabled()&&(this._enabled=!1)}wheel(a){if(!this.isEnabled())return;if(this._map._cooperativeGestures){if(!this._map._metaPress)return;a.preventDefault()}let h=a.deltaMode===WheelEvent.DOM_DELTA_LINE?40*a.deltaY:a.deltaY;const m=b.exported.now(),y=m-(this._lastWheelEventTime||0);this._lastWheelEventTime=m,0!==h&&h%Ko==0?this._type="wheel":0!==h&&Math.abs(h)<4?this._type="trackpad":y>400?(this._type=null,this._lastValue=h,this._timeout=setTimeout(this._onTimeout,40,a)):this._type||(this._type=Math.abs(y*h)<200?"trackpad":"wheel",this._timeout&&(clearTimeout(this._timeout),this._timeout=null,h+=this._lastValue)),a.shiftKey&&h&&(h/=4),this._type&&(this._lastWheelEvent=a,this._delta-=h,this._active||this._start(a)),a.preventDefault()}_onTimeout(a){this._type="wheel",this._delta-=this._lastValue,this._active||this._start(a)}_start(a){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 h=Te.mousePos(this._el,a);this._around=b.LngLat.convert(this._aroundCenter?this._map.getCenter():this._map.unproject(h)),this._aroundPoint=this._map.transform.locationPoint(this._around),this._frameId||(this._frameId=!0,this._handler._triggerRenderFrame())}renderFrame(){if(!this._frameId||(this._frameId=null,!this.isActive()))return;const a=this._map.transform;if(0!==this._delta){const T="wheel"===this._type&&Math.abs(this._delta)>Ko?this._wheelZoomRate:this._defaultZoomRate;let k=2/(1+Math.exp(-Math.abs(this._delta*T)));this._delta<0&&0!==k&&(k=1/k);const R="number"==typeof this._targetZoom?a.zoomScale(this._targetZoom):a.scale;this._targetZoom=Math.min(a.maxZoom,Math.max(a.minZoom,a.scaleZoom(R*k))),"wheel"===this._type&&(this._startZoom=a.zoom,this._easing=this._smoothOutEasing(200)),this._delta=0}const h="number"==typeof this._targetZoom?this._targetZoom:a.zoom,m=this._startZoom,y=this._easing;let w,S=!1;if("wheel"===this._type&&m&&y){const T=Math.min((b.exported.now()-this._lastWheelEventTime)/200,1),k=y(T);w=b.number(m,h,k),T<1?this._frameId||(this._frameId=!0):S=!0}else w=h,S=!0;return this._active=!0,S&&(this._active=!1,this._finishTimeout=setTimeout(()=>{this._zooming=!1,this._handler._triggerRenderFrame(),delete this._targetZoom,delete this._finishTimeout},200)),{noInertia:!0,needsRenderFrame:!S,zoomDelta:w-a.zoom,around:this._aroundPoint,originalEvent:this._lastWheelEvent}}_smoothOutEasing(a){let h=b.ease;if(this._prevEase){const m=this._prevEase,y=(b.exported.now()-m.start)/m.duration,w=m.easing(y+.01)-m.easing(y),S=.27/Math.sqrt(w*w+1e-4)*.01,T=Math.sqrt(.0729-S*S);h=b.bezier(S,T,.25,1)}return this._prevEase={start:b.exported.now(),duration:a,easing:h},h}reset(){this._active=!1}}class Ku{constructor(a,h){this._clickZoom=a,this._tapZoom=h}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 In{constructor(){this.reset()}reset(){this._active=!1}dblclick(a,h){return a.preventDefault(),{cameraAnimation:m=>{m.easeTo({duration:300,zoom:m.getZoom()+(a.shiftKey?-1:1),around:m.unproject(h)},{originalEvent:a})}}}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class Dr{constructor(){this._tap=new Wu({numTouches:1,numTaps:1}),this.reset()}reset(){this._active=!1,delete this._swipePoint,delete this._swipeTouch,delete this._tapTime,this._tap.reset()}touchstart(a,h,m){this._swipePoint||(this._tapTime&&a.timeStamp-this._tapTime>500&&this.reset(),this._tapTime?m.length>0&&(this._swipePoint=h[0],this._swipeTouch=m[0].identifier):this._tap.touchstart(a,h,m))}touchmove(a,h,m){if(this._tapTime){if(this._swipePoint){if(m[0].identifier!==this._swipeTouch)return;const y=h[0],w=y.y-this._swipePoint.y;return this._swipePoint=y,a.preventDefault(),this._active=!0,{zoomDelta:w/128}}}else this._tap.touchmove(a,h,m)}touchend(a,h,m){this._tapTime?this._swipePoint&&0===m.length&&this.reset():this._tap.touchend(a,h,m)&&(this._tapTime=a.timeStamp)}touchcancel(){this.reset()}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class jf{constructor(a,h,m){this._el=a,this._mousePan=h,this._touchPan=m}enable(a){this._inertiaOptions=a||{},this._mousePan.enable(),this._touchPan.enable(),this._el.classList.add("maplibregl-touch-drag-pan")}disable(){this._mousePan.disable(),this._touchPan.disable(),this._el.classList.remove("maplibregl-touch-drag-pan")}isEnabled(){return this._mousePan.isEnabled()&&this._touchPan.isEnabled()}isActive(){return this._mousePan.isActive()||this._touchPan.isActive()}}class tl{constructor(a,h,m){this._pitchWithRotate=a.pitchWithRotate,this._mouseRotate=h,this._mousePitch=m}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 Ju{constructor(a,h,m,y){this._el=a,this._touchZoom=h,this._touchRotate=m,this._tapDragZoom=y,this._rotationDisabled=!1,this._enabled=!0}enable(a){this._touchZoom.enable(a),this._rotationDisabled||this._touchRotate.enable(a),this._tapDragZoom.enable(),this._el.classList.add("maplibregl-touch-zoom-rotate")}disable(){this._touchZoom.disable(),this._touchRotate.disable(),this._tapDragZoom.disable(),this._el.classList.remove("maplibregl-touch-zoom-rotate")}isEnabled(){return this._touchZoom.isEnabled()&&(this._rotationDisabled||this._touchRotate.isEnabled())&&this._tapDragZoom.isEnabled()}isActive(){return this._touchZoom.isActive()||this._touchRotate.isActive()||this._tapDragZoom.isActive()}disableRotation(){this._rotationDisabled=!0,this._touchRotate.disable()}enableRotation(){this._rotationDisabled=!1,this._touchZoom.isEnabled()&&this._touchRotate.enable()}}const Hc=g=>g.zoom||g.drag||g.pitch||g.rotate;class Sr extends b.Event{}function Gc(g){return g.panDelta&&g.panDelta.mag()||g.zoomDelta||g.bearingDelta||g.pitchDelta}class Qu{constructor(a,h){this._map=a,this._el=this._map.getCanvasContainer(),this._handlers=[],this._handlersById={},this._changes=[],this._inertia=new ko(a),this._bearingSnap=h.bearingSnap,this._previousActiveHandlers={},this._eventsInProgress={},this._addDefaultHandlers(h),b.bindAll(["handleEvent","handleWindowEvent"],this);const m=this._el;this._listeners=[[m,"touchstart",{passive:!0}],[m,"touchmove",{passive:!1}],[m,"touchend",void 0],[m,"touchcancel",void 0],[m,"mousedown",void 0],[m,"mousemove",void 0],[m,"mouseup",void 0],[document,"mousemove",{capture:!0}],[document,"mouseup",void 0],[m,"mouseover",void 0],[m,"mouseout",void 0],[m,"dblclick",void 0],[m,"click",void 0],[m,"keydown",{capture:!1}],[m,"keyup",void 0],[m,"wheel",{passive:!1}],[m,"contextmenu",void 0],[window,"blur",void 0]];for(const[y,w,S]of this._listeners)Te.addEventListener(y,w,y===document?this.handleWindowEvent:this.handleEvent,S)}destroy(){for(const[a,h,m]of this._listeners)Te.removeEventListener(a,h,a===document?this.handleWindowEvent:this.handleEvent,m)}_addDefaultHandlers(a){const h=this._map,m=h.getCanvasContainer();this._add("mapEvent",new Vf(h,a));const y=h.boxZoom=new fo(h,a);this._add("boxZoom",y);const w=new $f,S=new In;h.doubleClickZoom=new Ku(S,w),this._add("tapZoom",w),this._add("clickZoom",S);const T=new Dr;this._add("tapDragZoom",T);const k=h.touchPitch=new pd(h);this._add("touchPitch",k);const R=hd(a),z=Xu(a);h.dragRotate=new tl(a,R,z),this._add("mouseRotate",R,["mousePitch"]),this._add("mousePitch",z,["mouseRotate"]);const L=(({enable:_e,clickTolerance:ye})=>{const ie=new po({checkCorrectEvent:we=>0===Te.mouseButton(we)&&!we.ctrlKey});return new Gl({clickTolerance:ye,move:(we,De)=>({around:De,panDelta:De.sub(we)}),activateOnStart:!0,moveStateManager:ie,enable:_e,assignEvents:$c})})(a),j=new Yu(a,h);h.dragPan=new jf(m,L,j),this._add("mousePan",L),this._add("touchPan",j,["touchZoom","touchRotate"]);const Q=new yt,ee=new _s;h.touchZoomRotate=new Ju(m,ee,Q,T),this._add("touchRotate",Q,["touchPan","touchZoom"]),this._add("touchZoom",ee,["touchPan","touchRotate"]);const Y=h.scrollZoom=new gd(h,this);this._add("scrollZoom",Y,["mousePan"]);const ae=h.keyboard=new Di;this._add("keyboard",ae),this._add("blockableMapEvent",new Uf(h));for(const _e of["boxZoom","doubleClickZoom","tapDragZoom","touchPitch","dragRotate","dragPan","touchZoomRotate","scrollZoom","keyboard"])a.interactive&&a[_e]&&h[_e].enable(a[_e])}_add(a,h,m){this._handlers.push({handlerName:a,handler:h,allowed:m}),this._handlersById[a]=h}stop(a){if(!this._updatingCamera){for(const{handler:h}of this._handlers)h.reset();this._inertia.clear(),this._fireEvents({},{},a),this._changes=[]}}isActive(){for(const{handler:a}of this._handlers)if(a.isActive())return!0;return!1}isZooming(){return!!this._eventsInProgress.zoom||this._map.scrollZoom.isZooming()}isRotating(){return!!this._eventsInProgress.rotate}isMoving(){return Boolean(Hc(this._eventsInProgress))||this.isZooming()}_blockedByActive(a,h,m){for(const y in a)if(y!==m&&(!h||h.indexOf(y)<0))return!0;return!1}handleWindowEvent(a){this.handleEvent(a,`${a.type}Window`)}_getMapTouches(a){const h=[];for(const m of a)this._el.contains(m.target)&&h.push(m);return h}handleEvent(a,h){if("blur"===a.type)return void this.stop(!0);this._updatingCamera=!0;const m="renderFrame"===a.type?void 0:a,y={needsRenderFrame:!1},w={},S={},T=a.touches,k=T?this._getMapTouches(T):void 0,R=k?Te.touchPos(this._el,k):Te.mousePos(this._el,a);for(const{handlerName:j,handler:Q,allowed:ee}of this._handlers){if(!Q.isEnabled())continue;let Y;this._blockedByActive(S,ee,j)?Q.reset():Q[h||a.type]&&(Y=Q[h||a.type](a,R,k),this.mergeHandlerResult(y,w,Y,j,m),Y&&Y.needsRenderFrame&&this._triggerRenderFrame()),(Y||Q.isActive())&&(S[j]=Q)}const z={};for(const j in this._previousActiveHandlers)S[j]||(z[j]=m);this._previousActiveHandlers=S,(Object.keys(z).length||Gc(y))&&(this._changes.push([y,w,z]),this._triggerRenderFrame()),(Object.keys(S).length||Gc(y))&&this._map._stop(!0),this._updatingCamera=!1;const{cameraAnimation:L}=y;L&&(this._inertia.clear(),this._fireEvents({},{},!0),this._changes=[],L(this._map))}mergeHandlerResult(a,h,m,y,w){if(!m)return;b.extend(a,m);const S={handlerName:y,originalEvent:m.originalEvent||w};void 0!==m.zoomDelta&&(h.zoom=S),void 0!==m.panDelta&&(h.drag=S),void 0!==m.pitchDelta&&(h.pitch=S),void 0!==m.bearingDelta&&(h.rotate=S)}_applyChanges(){const a={},h={},m={};for(const[y,w,S]of this._changes)y.panDelta&&(a.panDelta=(a.panDelta||new b.pointGeometry(0,0))._add(y.panDelta)),y.zoomDelta&&(a.zoomDelta=(a.zoomDelta||0)+y.zoomDelta),y.bearingDelta&&(a.bearingDelta=(a.bearingDelta||0)+y.bearingDelta),y.pitchDelta&&(a.pitchDelta=(a.pitchDelta||0)+y.pitchDelta),void 0!==y.around&&(a.around=y.around),void 0!==y.pinchAround&&(a.pinchAround=y.pinchAround),y.noInertia&&(a.noInertia=y.noInertia),b.extend(h,w),b.extend(m,S);this._updateMapTransform(a,h,m),this._changes=[]}_updateMapTransform(a,h,m){const y=this._map,w=y.transform,S=y.terrain;if(!(Gc(a)||S&&this._terrainMovement))return this._fireEvents(h,m,!0);let{panDelta:T,zoomDelta:k,bearingDelta:R,pitchDelta:z,around:L,pinchAround:j}=a;void 0!==j&&(L=j),y._stop(!0),L=L||y.transform.centerPoint;const Q=w.pointLocation(T?L.sub(T):L);R&&(w.bearing+=R),z&&(w.pitch+=z),k&&(w.zoom+=k),S?this._terrainMovement||!h.drag&&!h.zoom?h.drag&&this._terrainMovement?w.center=w.pointLocation(w.centerPoint.sub(T)):w.setLocationAtPoint(Q,L):(this._terrainMovement=!0,w.freezeElevation=!0,w.setLocationAtPoint(Q,L),this._map.once("moveend",()=>{w.freezeElevation=!1,this._terrainMovement=!1,w.recalculateZoom(y.terrain)})):w.setLocationAtPoint(Q,L),this._map._update(),a.noInertia||this._inertia.record(a),this._fireEvents(h,m,!0)}_fireEvents(a,h,m){const y=Hc(this._eventsInProgress),w=Hc(a),S={};for(const z in a){const{originalEvent:L}=a[z];this._eventsInProgress[z]||(S[`${z}start`]=L),this._eventsInProgress[z]=a[z]}!y&&w&&this._fireEvent("movestart",w.originalEvent);for(const z in S)this._fireEvent(z,S[z]);w&&this._fireEvent("move",w.originalEvent);for(const z in a){const{originalEvent:L}=a[z];this._fireEvent(z,L)}const T={};let k;for(const z in this._eventsInProgress){const{handlerName:L,originalEvent:j}=this._eventsInProgress[z];this._handlersById[L].isActive()||(delete this._eventsInProgress[z],k=h[L]||j,T[`${z}end`]=k)}for(const z in T)this._fireEvent(z,T[z]);const R=Hc(this._eventsInProgress);if(m&&(y||w)&&!R){this._updatingCamera=!0;const z=this._inertia._onMoveEnd(this._map.dragPan._inertiaOptions),L=j=>0!==j&&-this._bearingSnap{delete this._frameId,this.handleEvent(new Sr("renderFrame",{timeStamp:a})),this._applyChanges()})}_triggerRenderFrame(){void 0===this._frameId&&(this._frameId=this._requestFrame())}}const ql={extend:(g,...a)=>b.extend(g,...a),run(g){g()},logToElement(g,a=!1,h="log"){const m=window.document.getElementById(h);m&&(a&&(m.innerHTML=""),m.innerHTML+=`
${g}`)}};class Si extends b.Evented{constructor(a,h){super(),this._moving=!1,this._zooming=!1,this.transform=a,this._bearingSnap=h.bearingSnap,b.bindAll(["_renderFrameCallback"],this)}getCenter(){return new b.LngLat(this.transform.center.lng,this.transform.center.lat)}setCenter(a,h){return this.jumpTo({center:a},h)}panBy(a,h,m){return a=b.pointGeometry.convert(a).mult(-1),this.panTo(this.transform.center,b.extend({offset:a},h),m)}panTo(a,h,m){return this.easeTo(b.extend({center:a},h),m)}getZoom(){return this.transform.zoom}setZoom(a,h){return this.jumpTo({zoom:a},h),this}zoomTo(a,h,m){return this.easeTo(b.extend({zoom:a},h),m)}zoomIn(a,h){return this.zoomTo(this.getZoom()+1,a,h),this}zoomOut(a,h){return this.zoomTo(this.getZoom()-1,a,h),this}getBearing(){return this.transform.bearing}setBearing(a,h){return this.jumpTo({bearing:a},h),this}getPadding(){return this.transform.padding}setPadding(a,h){return this.jumpTo({padding:a},h),this}rotateTo(a,h,m){return this.easeTo(b.extend({bearing:a},h),m)}resetNorth(a,h){return this.rotateTo(0,b.extend({duration:1e3},a),h),this}resetNorthPitch(a,h){return this.easeTo(b.extend({bearing:0,pitch:0,duration:1e3},a),h),this}snapToNorth(a,h){return Math.abs(this.getBearing()){if(this._zooming&&(m.zoom=b.number(y,k,Se)),this._rotating&&(m.bearing=b.number(w,R,Se)),this._pitching&&(m.pitch=b.number(S,z,Se)),this._padding&&(m.interpolatePadding(T,L,Se),Q=m.centerPoint.add(j)),this.terrain&&!a.freezeElevation&&this._updateElevation(Se),ie)m.setLocationAtPoint(ie,we);else{const ke=m.zoomScale(m.zoom-y),Be=k>y?Math.min(2,ye):Math.max(.5,ye),Le=Math.pow(Be,1-Se),Ne=m.unproject(ae.add(_e.mult(Se*Le)).mult(ke));m.setLocationAtPoint(m.renderWorldCopies?Ne.wrap():Ne,Q)}this._fireMoveEvents(h)},Se=>{this.terrain&&this._finalizeElevation(),this._afterEase(h,Se)},a),this}_prepareEase(a,h,m={}){this._moving=!0,h||m.moving||this.fire(new b.Event("movestart",a)),this._zooming&&!m.zooming&&this.fire(new b.Event("zoomstart",a)),this._rotating&&!m.rotating&&this.fire(new b.Event("rotatestart",a)),this._pitching&&!m.pitching&&this.fire(new b.Event("pitchstart",a))}_prepareElevation(a){this._elevationCenter=a,this._elevationStart=this.transform.elevation,this._elevationTarget=this.transform.getElevation(a,this.terrain),this.transform.freezeElevation=!0}_updateElevation(a){const h=this.transform.getElevation(this._elevationCenter,this.terrain);if(a<1&&h!==this._elevationTarget){const m=this._elevationTarget-this._elevationStart;this._elevationStart+=a*(m-(h-(m*a+this._elevationStart))/(1-a)),this._elevationTarget=h}this.transform.elevation=b.number(this._elevationStart,this._elevationTarget,a)}_finalizeElevation(){this.transform.freezeElevation=!1,this.transform.recalculateZoom(this.terrain)}_fireMoveEvents(a){this.fire(new b.Event("move",a)),this._zooming&&this.fire(new b.Event("zoom",a)),this._rotating&&this.fire(new b.Event("rotate",a)),this._pitching&&this.fire(new b.Event("pitch",a))}_afterEase(a,h){if(this._easeId&&h&&this._easeId===h)return;delete this._easeId;const m=this._zooming,y=this._rotating,w=this._pitching;this._moving=!1,this._zooming=!1,this._rotating=!1,this._pitching=!1,this._padding=!1,m&&this.fire(new b.Event("zoomend",a)),y&&this.fire(new b.Event("rotateend",a)),w&&this.fire(new b.Event("pitchend",a)),this.fire(new b.Event("moveend",a))}flyTo(a,h){if(!a.essential&&b.exported.prefersReducedMotion){const mt=b.pick(a,["center","zoom","bearing","pitch","around"]);return this.jumpTo(mt,h)}this.stop(),a=b.extend({offset:[0,0],speed:1.2,curve:1.42,easing:b.ease},a);const m=this.transform,y=this.getZoom(),w=this.getBearing(),S=this.getPitch(),T=this.getPadding(),k="zoom"in a?b.clamp(+a.zoom,m.minZoom,m.maxZoom):y,R="bearing"in a?this._normalizeBearing(a.bearing,w):w,z="pitch"in a?+a.pitch:S,L="padding"in a?a.padding:m.padding,j=m.zoomScale(k-y),Q=b.pointGeometry.convert(a.offset);let ee=m.centerPoint.add(Q);const Y=m.pointLocation(ee),ae=b.LngLat.convert(a.center||Y);this._normalizeCenter(ae);const _e=m.project(Y),ye=m.project(ae).sub(_e);let ie=a.curve;const we=Math.max(m.width,m.height),De=we/j,Se=ye.mag();if("minZoom"in a){const mt=b.clamp(Math.min(a.minZoom,y,k),m.minZoom,m.maxZoom),Tn=we/m.zoomScale(mt-y);ie=Math.sqrt(Tn/Se*2)}const ke=ie*ie;function Be(mt){const Tn=(De*De-we*we+(mt?-1:1)*ke*ke*Se*Se)/(2*(mt?De:we)*ke*Se);return Math.log(Math.sqrt(Tn*Tn+1)-Tn)}function Le(mt){return(Math.exp(mt)-Math.exp(-mt))/2}function Ne(mt){return(Math.exp(mt)+Math.exp(-mt))/2}const ze=Be(0);let ht=function(mt){return Ne(ze)/Ne(ze+ie*mt)},Pt=function(mt){return we*((Ne(ze)*(Le(Tn=ze+ie*mt)/Ne(Tn))-Le(ze))/ke)/Se;var Tn},zt=(Be(1)-ze)/ie;if(Math.abs(Se)<1e-6||!isFinite(zt)){if(Math.abs(we-De)<1e-6)return this.easeTo(a,h);const mt=Dea.maxDuration&&(a.duration=0),this._zooming=!0,this._rotating=w!==R,this._pitching=z!==S,this._padding=!m.isPaddingEqual(L),this._prepareEase(h,!1),this.terrain&&this._prepareElevation(ae),this._ease(mt=>{const Tn=mt*zt,An=1/ht(Tn);m.zoom=1===mt?k:y+m.scaleZoom(An),this._rotating&&(m.bearing=b.number(w,R,mt)),this._pitching&&(m.pitch=b.number(S,z,mt)),this._padding&&(m.interpolatePadding(T,L,mt),ee=m.centerPoint.add(Q)),this.terrain&&!a.freezeElevation&&this._updateElevation(mt);const Ht=1===mt?ae:m.unproject(_e.add(ye.mult(Pt(Tn))).mult(An));m.setLocationAtPoint(m.renderWorldCopies?Ht.wrap():Ht,ee),this._fireMoveEvents(h)},()=>{this.terrain&&this._finalizeElevation(),this._afterEase(h)},a),this}isEasing(){return!!this._easeFrameId}stop(){return this._stop()}_stop(a,h){if(this._easeFrameId&&(this._cancelRenderFrame(this._easeFrameId),delete this._easeFrameId,delete this._onEaseFrame),this._onEaseEnd){const m=this._onEaseEnd;delete this._onEaseEnd,m.call(this,h)}if(!a){const m=this.handlers;m&&m.stop(!1)}return this}_ease(a,h,m){!1===m.animate||0===m.duration?(a(1),h()):(this._easeStart=b.exported.now(),this._easeOptions=m,this._onEaseFrame=a,this._onEaseEnd=h,this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback))}_renderFrameCallback(){const a=Math.min((b.exported.now()-this._easeStart)/this._easeOptions.duration,1);this._onEaseFrame(this._easeOptions.easing(a)),a<1?this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback):this.stop()}_normalizeBearing(a,h){a=b.wrap(a,-180,180);const m=Math.abs(a-h);return Math.abs(a-360-h)180?-360:m<-180?360:0}}class eh{constructor(a={}){this.options=a,b.bindAll(["_toggleAttribution","_updateData","_updateCompact","_updateCompactMinimize"],this)}getDefaultPosition(){return"bottom-right"}onAdd(a){return this._map=a,this._compact=this.options&&this.options.compact,this._container=Te.create("details","maplibregl-ctrl maplibregl-ctrl-attrib"),this._compactButton=Te.create("summary","maplibregl-ctrl-attrib-button",this._container),this._compactButton.addEventListener("click",this._toggleAttribution),this._setElementTitle(this._compactButton,"ToggleAttribution"),this._innerContainer=Te.create("div","maplibregl-ctrl-attrib-inner",this._container),this._updateAttributions(),this._updateCompact(),this._map.on("styledata",this._updateData),this._map.on("sourcedata",this._updateData),this._map.on("terrain",this._updateData),this._map.on("resize",this._updateCompact),this._map.on("drag",this._updateCompactMinimize),this._container}onRemove(){Te.remove(this._container),this._map.off("styledata",this._updateData),this._map.off("sourcedata",this._updateData),this._map.off("terrain",this._updateData),this._map.off("resize",this._updateCompact),this._map.off("drag",this._updateCompactMinimize),this._map=void 0,this._compact=void 0,this._attribHTML=void 0}_setElementTitle(a,h){const m=this._map._getUIString(`AttributionControl.${h}`);a.title=m,a.setAttribute("aria-label",m)}_toggleAttribution(){this._container.classList.contains("maplibregl-compact")&&(this._container.classList.contains("maplibregl-compact-show")?(this._container.setAttribute("open",""),this._container.classList.remove("maplibregl-compact-show")):(this._container.classList.add("maplibregl-compact-show"),this._container.removeAttribute("open")))}_updateData(a){!a||"metadata"!==a.sourceDataType&&"visibility"!==a.sourceDataType&&"style"!==a.dataType&&"terrain"!==a.type||this._updateAttributions()}_updateAttributions(){if(!this._map.style)return;let a=[];if(this.options.customAttribution&&(Array.isArray(this.options.customAttribution)?a=a.concat(this.options.customAttribution.map(y=>"string"!=typeof y?"":y)):"string"==typeof this.options.customAttribution&&a.push(this.options.customAttribution)),this._map.style.stylesheet){const y=this._map.style.stylesheet;this.styleOwner=y.owner,this.styleId=y.id}const h=this._map.style.sourceCaches;for(const y in h){const w=h[y];if(w.used||w.usedForTerrain){const S=w.getSource();S.attribution&&a.indexOf(S.attribution)<0&&a.push(S.attribution)}}a=a.filter(y=>String(y).trim()),a.sort((y,w)=>y.length-w.length),a=a.filter((y,w)=>{for(let S=w+1;S=0)return!1;return!0});const m=a.join(" | ");m!==this._attribHTML&&(this._attribHTML=m,a.length?(this._innerContainer.innerHTML=m,this._container.classList.remove("maplibregl-attrib-empty")):this._container.classList.add("maplibregl-attrib-empty"),this._updateCompact(),this._editLink=null)}_updateCompact(){this._map.getCanvasContainer().offsetWidth<=640||this._compact?!1===this._compact?this._container.setAttribute("open",""):this._container.classList.contains("maplibregl-compact")||this._container.classList.contains("maplibregl-attrib-empty")||(this._container.setAttribute("open",""),this._container.classList.add("maplibregl-compact","maplibregl-compact-show")):(this._container.setAttribute("open",""),this._container.classList.contains("maplibregl-compact")&&this._container.classList.remove("maplibregl-compact","maplibregl-compact-show"))}_updateCompactMinimize(){this._container.classList.contains("maplibregl-compact")&&this._container.classList.contains("maplibregl-compact-show")&&this._container.classList.remove("maplibregl-compact-show")}}class Zl{constructor(a={}){this.options=a,b.bindAll(["_updateCompact"],this)}getDefaultPosition(){return"bottom-left"}onAdd(a){this._map=a,this._compact=this.options&&this.options.compact,this._container=Te.create("div","maplibregl-ctrl");const h=Te.create("a","maplibregl-ctrl-logo");return h.target="_blank",h.rel="noopener nofollow",h.href="https://maplibre.org/",h.setAttribute("aria-label",this._map._getUIString("LogoControl.Title")),h.setAttribute("rel","noopener nofollow"),this._container.appendChild(h),this._container.style.display="block",this._map.on("resize",this._updateCompact),this._updateCompact(),this._container}onRemove(){Te.remove(this._container),this._map.off("resize",this._updateCompact),this._map=void 0,this._compact=void 0}_updateCompact(){const a=this._container.children;if(a.length){const h=a[0];this._map.getCanvasContainer().offsetWidth<=640||this._compact?!1!==this._compact&&h.classList.add("maplibregl-compact"):h.classList.remove("maplibregl-compact")}}}class pa{constructor(){this._queue=[],this._id=0,this._cleared=!1,this._currentlyRunning=!1}add(a){const h=++this._id;return this._queue.push({callback:a,id:h,cancelled:!1}),h}remove(a){const h=this._currentlyRunning,m=h?this._queue.concat(h):this._queue;for(const y of m)if(y.id===a)return void(y.cancelled=!0)}run(a=0){if(this._currentlyRunning)throw new Error("Attempting to run(), but is already running.");const h=this._currentlyRunning=this._queue;this._queue=[];for(const m of h)if(!m.cancelled&&(m.callback(a),this._cleared))break;this._cleared=!1,this._currentlyRunning=!1}clear(){this._currentlyRunning&&(this._cleared=!0),this._queue=[]}}const Mi={"AttributionControl.ToggleAttribution":"Toggle attribution","AttributionControl.MapFeedback":"Map feedback","FullscreenControl.Enter":"Enter fullscreen","FullscreenControl.Exit":"Exit fullscreen","GeolocateControl.FindMyLocation":"Find my location","GeolocateControl.LocationNotAvailable":"Location not available","LogoControl.Title":"Mapbox logo","NavigationControl.ResetBearing":"Reset bearing to north","NavigationControl.ZoomIn":"Zoom in","NavigationControl.ZoomOut":"Zoom out","ScaleControl.Feet":"ft","ScaleControl.Meters":"m","ScaleControl.Kilometers":"km","ScaleControl.Miles":"mi","ScaleControl.NauticalMiles":"nm","TerrainControl.enableTerrain":"Enable terrain","TerrainControl.disableTerrain":"Disable terrain"};var yd=b.createLayout([{name:"a_pos3d",type:"Int16",components:3}]);class Wl extends b.Evented{constructor(a){super(),this.sourceCache=a,this._tiles={},this._renderableTilesKeys=[],this._sourceTileCache={},this.minzoom=0,this.maxzoom=22,this.tileSize=512,this.deltaZoom=1,a.usedForTerrain=!0,a.tileSize=this.tileSize*2**this.deltaZoom}destruct(){this.sourceCache.usedForTerrain=!1,this.sourceCache.tileSize=null}update(a,h){this.sourceCache.update(a,h),this._renderableTilesKeys=[];const m={};for(const y of a.coveringTiles({tileSize:this.tileSize,minzoom:this.minzoom,maxzoom:this.maxzoom,reparseOverscaled:!1,terrain:h}))m[y.key]=!0,this._renderableTilesKeys.push(y.key),this._tiles[y.key]||(y.posMatrix=new Float64Array(16),b.ortho(y.posMatrix,0,b.EXTENT,0,b.EXTENT,0,1),this._tiles[y.key]=new jt(y,this.tileSize));for(const y in this._tiles)m[y]||delete this._tiles[y]}freeRtt(a){for(const h in this._tiles){const m=this._tiles[h];(!a||m.tileID.equals(a)||m.tileID.isChildOf(a)||a.isChildOf(m.tileID))&&(m.rtt=[])}}getRenderableTiles(){return this._renderableTilesKeys.map(a=>this.getTileByID(a))}getTileByID(a){return this._tiles[a]}getTerrainCoords(a){const h={};for(const m of this._renderableTilesKeys){const y=this._tiles[m].tileID;if(y.canonical.equals(a.canonical)){const w=a.clone();w.posMatrix=new Float64Array(16),b.ortho(w.posMatrix,0,b.EXTENT,0,b.EXTENT,0,1),h[m]=w}else if(y.canonical.isChildOf(a.canonical)){const w=a.clone();w.posMatrix=new Float64Array(16);const S=y.canonical.z-a.canonical.z,T=y.canonical.x-(y.canonical.x>>S<>S<>S;b.ortho(w.posMatrix,0,R,0,R,0,1),b.translate(w.posMatrix,w.posMatrix,[-T*R,-k*R,0]),h[m]=w}else if(a.canonical.isChildOf(y.canonical)){const w=a.clone();w.posMatrix=new Float64Array(16);const S=a.canonical.z-y.canonical.z,T=a.canonical.x-(a.canonical.x>>S<>S<>S;b.ortho(w.posMatrix,0,b.EXTENT,0,b.EXTENT,0,1),b.translate(w.posMatrix,w.posMatrix,[T*R,k*R,0]),b.scale(w.posMatrix,w.posMatrix,[1/2**S,1/2**S,0]),h[m]=w}}return h}getSourceTile(a,h){const m=this.sourceCache._source;let y=a.overscaledZ-this.deltaZoom;if(y>m.maxzoom&&(y=m.maxzoom),y=m.minzoom&&(!w||!w.dem);)w=this.sourceCache.getTileByID(a.scaledTo(y--).key);return w}tilesAfterTime(a=Date.now()){return Object.values(this._tiles).filter(h=>h.timeAdded>=a)}}class th{constructor(a,h,m){this.painter=a,this.sourceCache=new Wl(h),this.options=m,this.exaggeration="number"==typeof m.exaggeration?m.exaggeration:1,this.qualityFactor=2,this.meshSize=128,this._demMatrixCache={},this.coordsIndex=[],this._coordsTextureSize=1024}getDEMElevation(a,h,m,y=b.EXTENT){if(!(h>=0&&h=0&&ma.canonical.z&&(a.canonical.z>=y?w=a.canonical.z-y:b.warnOnce("cannot calculate elevation if elevation maxzoom > source.maxzoom"));const S=a.canonical.x-(a.canonical.x>>w<>w<>8<<4|w>>8,h[S+3]=0;const m=new b.RGBAImage({width:this._coordsTextureSize,height:this._coordsTextureSize},new Uint8Array(h.buffer)),y=new Hn(a,m,a.gl.RGBA,{premultiply:!1});return y.bind(a.gl.NEAREST,a.gl.CLAMP_TO_EDGE),this._coordsTexture=y,y}pointCoordinate(a){const h=new Uint8Array(4),m=this.painter.context,y=m.gl;m.bindFramebuffer.set(this.getFramebuffer("coords").framebuffer),y.readPixels(a.x,this.painter.height/devicePixelRatio-a.y-1,1,1,y.RGBA,y.UNSIGNED_BYTE,h),m.bindFramebuffer.set(null);const w=h[0]+(h[2]>>4<<8),S=h[1]+((15&h[2])<<8),T=this.coordsIndex[255-h[3]],k=T&&this.sourceCache.getTileByID(T);if(!k)return null;const R=this._coordsTextureSize,z=(1<a.id!==h),this._recentlyUsed.push(a.id)}stampObject(a){a.stamp=++this._stamp}getOrCreateFreeObject(){for(const h of this._recentlyUsed)if(!this._objects[h].inUse)return this._objects[h];if(this._objects.length>=this._size)throw new Error("No free RenderPool available, call freeAllObjects() required!");const a=this._createObject(this._objects.length);return this._objects.push(a),a}freeObject(a){a.inUse=!1}freeAllObjects(){for(const a of this._objects)this.freeObject(a)}isFull(){return!(this._objects.length!a.inUse)}}const Hs={background:!0,fill:!0,line:!0,raster:!0,hillshade:!0};class Xl{constructor(a,h){this.painter=a,this.terrain=h,this.pool=new vs(a.context,30,h.sourceCache.tileSize*h.qualityFactor)}destruct(){this.pool.destruct()}getTexture(a){return this.pool.getObjectForId(a.rtt[this._stacks.length-1].id).texture}prepareForRender(a,h){this._stacks=[],this._prevType=null,this._rttTiles=[],this._renderableTiles=this.terrain.sourceCache.getRenderableTiles(),this._renderableLayerIds=a._order.filter(m=>!a._layers[m].isHidden(h)),this._coordsDescendingInv={};for(const m in a.sourceCaches){this._coordsDescendingInv[m]={};const y=a.sourceCaches[m].getVisibleCoordinates();for(const w of y){const S=this.terrain.sourceCache.getTerrainCoords(w);for(const T in S)this._coordsDescendingInv[m][T]||(this._coordsDescendingInv[m][T]=[]),this._coordsDescendingInv[m][T].push(S[T])}}this._coordsDescendingInvStr={};for(const m of a._order){const y=a._layers[m],w=y.source;if(Hs[y.type]&&!this._coordsDescendingInvStr[w]){this._coordsDescendingInvStr[w]={};for(const S in this._coordsDescendingInv[w])this._coordsDescendingInvStr[w][S]=this._coordsDescendingInv[w][S].map(T=>T.key).sort().join()}}for(const m of this._renderableTiles)for(const y in this._coordsDescendingInvStr){const w=this._coordsDescendingInvStr[y][m.tileID.key];w&&w!==m.rttCoords[y]&&(m.rtt=[])}}renderLayer(a){if(a.isHidden(this.painter.transform.zoom))return!1;const h=a.type,m=this.painter,y=this._renderableLayerIds[this._renderableLayerIds.length-1]===a.id;if(Hs[h]&&(this._prevType&&Hs[this._prevType]||this._stacks.push([]),this._prevType=h,this._stacks[this._stacks.length-1].push(a.id),!y))return!0;if(Hs[this._prevType]||Hs[h]&&y){this._prevType=h;const w=this._stacks.length-1,S=this._stacks[w]||[];for(const T of this._renderableTiles){if(this.pool.isFull()&&(ld(this.painter,this.terrain,this._rttTiles),this._rttTiles=[],this.pool.freeAllObjects()),this._rttTiles.push(T),T.rtt[w]){const R=this.pool.getObjectForId(T.rtt[w].id);if(R.stamp===T.rtt[w].stamp){this.pool.useObject(R);continue}}const k=this.pool.getOrCreateFreeObject();this.pool.useObject(k),this.pool.stampObject(k),T.rtt[w]={id:k.id,stamp:k.stamp},m.context.bindFramebuffer.set(k.fbo.framebuffer),m.context.clear({color:b.Color.transparent});for(let R=0;R{g.touchstart=g.dragStart,g.touchmoveWindow=g.dragMove,g.touchend=g.dragEnd},vd={showCompass:!0,showZoom:!0,visualizePitch:!1};class Hf{constructor(a,h,m=!1){this._clickTolerance=10;const y=a.dragRotate._mouseRotate.getClickTolerance(),w=a.dragRotate._mousePitch.getClickTolerance();this.element=h,this.mouseRotate=hd({clickTolerance:y,enable:!0}),this.touchRotate=(({enable:S,clickTolerance:T,bearingDegreesPerPixelMoved:k=.8})=>{const R=new cr;return new Gl({clickTolerance:T,move:(z,L)=>({bearingDelta:(L.x-z.x)*k}),moveStateManager:R,enable:S,assignEvents:_d})})({clickTolerance:y,enable:!0}),this.map=a,m&&(this.mousePitch=Xu({clickTolerance:w,enable:!0}),this.touchPitch=(({enable:S,clickTolerance:T,pitchDegreesPerPixelMoved:k=-.5})=>{const R=new cr;return new Gl({clickTolerance:T,move:(z,L)=>({pitchDelta:(L.y-z.y)*k}),moveStateManager:R,enable:S,assignEvents:_d})})({clickTolerance:w,enable:!0})),b.bindAll(["mousedown","mousemove","mouseup","touchstart","touchmove","touchend","reset"],this),Te.addEventListener(h,"mousedown",this.mousedown),Te.addEventListener(h,"touchstart",this.touchstart,{passive:!1}),Te.addEventListener(h,"touchcancel",this.reset)}startMouse(a,h){this.mouseRotate.dragStart(a,h),this.mousePitch&&this.mousePitch.dragStart(a,h),Te.disableDrag()}startTouch(a,h){this.touchRotate.dragStart(a,h),this.touchPitch&&this.touchPitch.dragStart(a,h),Te.disableDrag()}moveMouse(a,h){const m=this.map,{bearingDelta:y}=this.mouseRotate.dragMove(a,h)||{};if(y&&m.setBearing(m.getBearing()+y),this.mousePitch){const{pitchDelta:w}=this.mousePitch.dragMove(a,h)||{};w&&m.setPitch(m.getPitch()+w)}}moveTouch(a,h){const m=this.map,{bearingDelta:y}=this.touchRotate.dragMove(a,h)||{};if(y&&m.setBearing(m.getBearing()+y),this.touchPitch){const{pitchDelta:w}=this.touchPitch.dragMove(a,h)||{};w&&m.setPitch(m.getPitch()+w)}}off(){const a=this.element;Te.removeEventListener(a,"mousedown",this.mousedown),Te.removeEventListener(a,"touchstart",this.touchstart,{passive:!1}),Te.removeEventListener(window,"touchmove",this.touchmove,{passive:!1}),Te.removeEventListener(window,"touchend",this.touchend),Te.removeEventListener(a,"touchcancel",this.reset),this.offTemp()}offTemp(){Te.enableDrag(),Te.removeEventListener(window,"mousemove",this.mousemove),Te.removeEventListener(window,"mouseup",this.mouseup),Te.removeEventListener(window,"touchmove",this.touchmove,{passive:!1}),Te.removeEventListener(window,"touchend",this.touchend)}mousedown(a){this.startMouse(b.extend({},a,{ctrlKey:!0,preventDefault:()=>a.preventDefault()}),Te.mousePos(this.element,a)),Te.addEventListener(window,"mousemove",this.mousemove),Te.addEventListener(window,"mouseup",this.mouseup)}mousemove(a){this.moveMouse(a,Te.mousePos(this.element,a))}mouseup(a){this.mouseRotate.dragEnd(a),this.mousePitch&&this.mousePitch.dragEnd(a),this.offTemp()}touchstart(a){1!==a.targetTouches.length?this.reset():(this._startPos=this._lastPos=Te.touchPos(this.element,a.targetTouches)[0],this.startTouch(a,this._startPos),Te.addEventListener(window,"touchmove",this.touchmove,{passive:!1}),Te.addEventListener(window,"touchend",this.touchend))}touchmove(a){1!==a.targetTouches.length?this.reset():(this._lastPos=Te.touchPos(this.element,a.targetTouches)[0],this.moveTouch(a,this._lastPos))}touchend(a){0===a.targetTouches.length&&this._startPos&&this._lastPos&&this._startPos.dist(this._lastPos)180;){const m=h.locationPoint(g);if(m.x>=0&&m.y>=0&&m.x<=h.width&&m.y<=h.height)break;g.lng>h.center.lng?g.lng-=360:g.lng+=360}return g}const qc={center:"translate(-50%,-50%)",top:"translate(-50%,0)","top-left":"translate(0,0)","top-right":"translate(-100%,0)",bottom:"translate(-50%,-100%)","bottom-left":"translate(0,-100%)","bottom-right":"translate(-100%,-100%)",left:"translate(0,-50%)",right:"translate(-100%,-50%)"};function xd(g,a,h){const m=g.classList;for(const y in qc)m.remove(`maplibregl-${h}-anchor-${y}`);m.add(`maplibregl-${h}-anchor-${a}`)}class rh extends b.Evented{constructor(a,h){if(super(),(a instanceof HTMLElement||h)&&(a=b.extend({element:a},h)),b.bindAll(["_update","_onMove","_onUp","_addDragHandler","_onMapClick","_onKeyPress"],this),this._anchor=a&&a.anchor||"center",this._color=a&&a.color||"#3FB1CE",this._scale=a&&a.scale||1,this._draggable=a&&a.draggable||!1,this._clickTolerance=a&&a.clickTolerance||0,this._isDragging=!1,this._state="inactive",this._rotation=a&&a.rotation||0,this._rotationAlignment=a&&a.rotationAlignment||"auto",this._pitchAlignment=a&&a.pitchAlignment&&"auto"!==a.pitchAlignment?a.pitchAlignment:this._rotationAlignment,a&&a.element)this._element=a.element,this._offset=b.pointGeometry.convert(a&&a.offset||[0,0]);else{this._defaultMarker=!0,this._element=Te.create("div"),this._element.setAttribute("aria-label","Map marker");const m=Te.createNS("http://www.w3.org/2000/svg","svg"),y=41,w=27;m.setAttributeNS(null,"display","block"),m.setAttributeNS(null,"height",`${y}px`),m.setAttributeNS(null,"width",`${w}px`),m.setAttributeNS(null,"viewBox",`0 0 ${w} ${y}`);const S=Te.createNS("http://www.w3.org/2000/svg","g");S.setAttributeNS(null,"stroke","none"),S.setAttributeNS(null,"stroke-width","1"),S.setAttributeNS(null,"fill","none"),S.setAttributeNS(null,"fill-rule","evenodd");const T=Te.createNS("http://www.w3.org/2000/svg","g");T.setAttributeNS(null,"fill-rule","nonzero");const k=Te.createNS("http://www.w3.org/2000/svg","g");k.setAttributeNS(null,"transform","translate(3.0, 29.0)"),k.setAttributeNS(null,"fill","#000000");const R=[{rx:"10.5",ry:"5.25002273"},{rx:"10.5",ry:"5.25002273"},{rx:"9.5",ry:"4.77275007"},{rx:"8.5",ry:"4.29549936"},{rx:"7.5",ry:"3.81822308"},{rx:"6.5",ry:"3.34094679"},{rx:"5.5",ry:"2.86367051"},{rx:"4.5",ry:"2.38636864"}];for(const ye of R){const ie=Te.createNS("http://www.w3.org/2000/svg","ellipse");ie.setAttributeNS(null,"opacity","0.04"),ie.setAttributeNS(null,"cx","10.5"),ie.setAttributeNS(null,"cy","5.80029008"),ie.setAttributeNS(null,"rx",ye.rx),ie.setAttributeNS(null,"ry",ye.ry),k.appendChild(ie)}const z=Te.createNS("http://www.w3.org/2000/svg","g");z.setAttributeNS(null,"fill",this._color);const L=Te.createNS("http://www.w3.org/2000/svg","path");L.setAttributeNS(null,"d","M27,13.5 C27,19.074644 20.250001,27.000002 14.75,34.500002 C14.016665,35.500004 12.983335,35.500004 12.25,34.500002 C6.7499993,27.000002 0,19.222562 0,13.5 C0,6.0441559 6.0441559,0 13.5,0 C20.955844,0 27,6.0441559 27,13.5 Z"),z.appendChild(L);const j=Te.createNS("http://www.w3.org/2000/svg","g");j.setAttributeNS(null,"opacity","0.25"),j.setAttributeNS(null,"fill","#000000");const Q=Te.createNS("http://www.w3.org/2000/svg","path");Q.setAttributeNS(null,"d","M13.5,0 C6.0441559,0 0,6.0441559 0,13.5 C0,19.222562 6.7499993,27 12.25,34.5 C13,35.522727 14.016664,35.500004 14.75,34.5 C20.250001,27 27,19.074644 27,13.5 C27,6.0441559 20.955844,0 13.5,0 Z M13.5,1 C20.415404,1 26,6.584596 26,13.5 C26,15.898657 24.495584,19.181431 22.220703,22.738281 C19.945823,26.295132 16.705119,30.142167 13.943359,33.908203 C13.743445,34.180814 13.612715,34.322738 13.5,34.441406 C13.387285,34.322738 13.256555,34.180814 13.056641,33.908203 C10.284481,30.127985 7.4148684,26.314159 5.015625,22.773438 C2.6163816,19.232715 1,15.953538 1,13.5 C1,6.584596 6.584596,1 13.5,1 Z"),j.appendChild(Q);const ee=Te.createNS("http://www.w3.org/2000/svg","g");ee.setAttributeNS(null,"transform","translate(6.0, 7.0)"),ee.setAttributeNS(null,"fill","#FFFFFF");const Y=Te.createNS("http://www.w3.org/2000/svg","g");Y.setAttributeNS(null,"transform","translate(8.0, 8.0)");const ae=Te.createNS("http://www.w3.org/2000/svg","circle");ae.setAttributeNS(null,"fill","#000000"),ae.setAttributeNS(null,"opacity","0.25"),ae.setAttributeNS(null,"cx","5.5"),ae.setAttributeNS(null,"cy","5.5"),ae.setAttributeNS(null,"r","5.4999962");const _e=Te.createNS("http://www.w3.org/2000/svg","circle");_e.setAttributeNS(null,"fill","#FFFFFF"),_e.setAttributeNS(null,"cx","5.5"),_e.setAttributeNS(null,"cy","5.5"),_e.setAttributeNS(null,"r","5.4999962"),Y.appendChild(ae),Y.appendChild(_e),T.appendChild(k),T.appendChild(z),T.appendChild(j),T.appendChild(ee),T.appendChild(Y),m.appendChild(T),m.setAttributeNS(null,"height",y*this._scale+"px"),m.setAttributeNS(null,"width",w*this._scale+"px"),this._element.appendChild(m),this._offset=b.pointGeometry.convert(a&&a.offset||[0,-14])}this._element.classList.add("maplibregl-marker"),this._element.addEventListener("dragstart",m=>{m.preventDefault()}),this._element.addEventListener("mousedown",m=>{m.preventDefault()}),xd(this._element,this._anchor,"marker"),this._popup=null}addTo(a){return this.remove(),this._map=a,a.getCanvasContainer().appendChild(this._element),a.on("move",this._update),a.on("moveend",this._update),this.setDraggable(this._draggable),this._update(),this._map.on("click",this._onMapClick),this}remove(){return this._opacityTimeout&&(clearTimeout(this._opacityTimeout),delete this._opacityTimeout),this._map&&(this._map.off("click",this._onMapClick),this._map.off("move",this._update),this._map.off("moveend",this._update),this._map.off("mousedown",this._addDragHandler),this._map.off("touchstart",this._addDragHandler),this._map.off("mouseup",this._onUp),this._map.off("touchend",this._onUp),this._map.off("mousemove",this._onMove),this._map.off("touchmove",this._onMove),delete this._map),Te.remove(this._element),this._popup&&this._popup.remove(),this}getLngLat(){return this._lngLat}setLngLat(a){return this._lngLat=b.LngLat.convert(a),this._pos=null,this._popup&&this._popup.setLngLat(this._lngLat),this._update(),this}getElement(){return this._element}setPopup(a){if(this._popup&&(this._popup.remove(),this._popup=null,this._element.removeEventListener("keypress",this._onKeyPress),this._originalTabIndex||this._element.removeAttribute("tabindex")),a){if(!("offset"in a.options)){const y=Math.sqrt(Math.pow(13.5,2)/2);a.options.offset=this._defaultMarker?{top:[0,0],"top-left":[0,0],"top-right":[0,0],bottom:[0,-38.1],"bottom-left":[y,-1*(24.6+y)],"bottom-right":[-y,-1*(24.6+y)],left:[13.5,-24.6],right:[-13.5,-24.6]}:this._offset}this._popup=a,this._lngLat&&this._popup.setLngLat(this._lngLat),this._originalTabIndex=this._element.getAttribute("tabindex"),this._originalTabIndex||this._element.setAttribute("tabindex","0"),this._element.addEventListener("keypress",this._onKeyPress)}return this}_onKeyPress(a){const h=a.code,m=a.charCode||a.keyCode;"Space"!==h&&"Enter"!==h&&32!==m&&13!==m||this.togglePopup()}_onMapClick(a){const h=a.originalEvent.target,m=this._element;this._popup&&(h===m||m.contains(h))&&this.togglePopup()}getPopup(){return this._popup}togglePopup(){const a=this._popup;return a?(a.isOpen()?a.remove():a.addTo(this._map),this):this}_update(a){if(!this._map)return;this._map.transform.renderWorldCopies&&(this._lngLat=bd(this._lngLat,this._pos,this._map.transform)),this._pos=this._map.project(this._lngLat)._add(this._offset);let h="";"viewport"===this._rotationAlignment||"auto"===this._rotationAlignment?h=`rotateZ(${this._rotation}deg)`:"map"===this._rotationAlignment&&(h=`rotateZ(${this._rotation-this._map.getBearing()}deg)`);let m="";"viewport"===this._pitchAlignment||"auto"===this._pitchAlignment?m="rotateX(0deg)":"map"===this._pitchAlignment&&(m=`rotateX(${this._map.getPitch()}deg)`),a&&"moveend"!==a.type||(this._pos=this._pos.round()),Te.setTransform(this._element,`${qc[this._anchor]} translate(${this._pos.x}px, ${this._pos.y}px) ${m} ${h}`),this._map.terrain&&!this._opacityTimeout&&(this._opacityTimeout=setTimeout(()=>{const y=this._map.unproject(this._pos),w=40075016.686*Math.abs(Math.cos(this._lngLat.lat*Math.PI/180))/Math.pow(2,this._map.transform.tileZoom+8);this._element.style.opacity=y.distanceTo(this._lngLat)>20*w?"0.2":"1.0",this._opacityTimeout=null},100))}getOffset(){return this._offset}setOffset(a){return this._offset=b.pointGeometry.convert(a),this._update(),this}_onMove(a){if(!this._isDragging){const h=this._clickTolerance||this._map._clickTolerance;this._isDragging=a.point.dist(this._pointerdownPos)>=h}this._isDragging&&(this._pos=a.point.sub(this._positionDelta),this._lngLat=this._map.unproject(this._pos),this.setLngLat(this._lngLat),this._element.style.pointerEvents="none","pending"===this._state&&(this._state="active",this.fire(new b.Event("dragstart"))),this.fire(new b.Event("drag")))}_onUp(){this._element.style.pointerEvents="auto",this._positionDelta=null,this._pointerdownPos=null,this._isDragging=!1,this._map.off("mousemove",this._onMove),this._map.off("touchmove",this._onMove),"active"===this._state&&this.fire(new b.Event("dragend")),this._state="inactive"}_addDragHandler(a){this._element.contains(a.originalEvent.target)&&(a.preventDefault(),this._positionDelta=a.point.sub(this._pos).add(this._offset),this._pointerdownPos=a.point,this._state="pending",this._map.on("mousemove",this._onMove),this._map.on("touchmove",this._onMove),this._map.once("mouseup",this._onUp),this._map.once("touchend",this._onUp))}setDraggable(a){return this._draggable=!!a,this._map&&(a?(this._map.on("mousedown",this._addDragHandler),this._map.on("touchstart",this._addDragHandler)):(this._map.off("mousedown",this._addDragHandler),this._map.off("touchstart",this._addDragHandler))),this}isDraggable(){return this._draggable}setRotation(a){return this._rotation=a||0,this._update(),this}getRotation(){return this._rotation}setRotationAlignment(a){return this._rotationAlignment=a||"auto",this._update(),this}getRotationAlignment(){return this._rotationAlignment}setPitchAlignment(a){return this._pitchAlignment=a&&"auto"!==a?a:this._rotationAlignment,this._update(),this}getPitchAlignment(){return this._pitchAlignment}}const He={positionOptions:{enableHighAccuracy:!1,maximumAge:0,timeout:6e3},fitBoundsOptions:{maxZoom:15},trackUserLocation:!1,showAccuracyCircle:!0,showUserLocation:!0};let en,ma=0,Gs=!1;const Pr={maxWidth:100,unit:"metric"};function ih(g,a,h){const m=h&&h.maxWidth||100,y=g._container.clientHeight/2,w=g.unproject([0,y]),S=g.unproject([m,y]),T=w.distanceTo(S);if(h&&"imperial"===h.unit){const k=3.2808*T;k>5280?qs(a,m,k/5280,g._getUIString("ScaleControl.Miles")):qs(a,m,k,g._getUIString("ScaleControl.Feet"))}else h&&"nautical"===h.unit?qs(a,m,T/1852,g._getUIString("ScaleControl.NauticalMiles")):T>=1e3?qs(a,m,T/1e3,g._getUIString("ScaleControl.Kilometers")):qs(a,m,T,g._getUIString("ScaleControl.Meters"))}function qs(g,a,h,m){const y=function(w){const S=Math.pow(10,`${Math.floor(w)}`.length-1);let T=w/S;return T=T>=10?10:T>=5?5:T>=3?3:T>=2?2:T>=1?1:function(k){const R=Math.pow(10,Math.ceil(-Math.log(k)/Math.LN10));return Math.round(k*R)/R}(T),S*T}(h);g.style.width=a*(y/h)+"px",g.innerHTML=`${y} ${m}`}const bs={closeButton:!0,closeOnClick:!0,focusAfterOpen:!0,className:"",maxWidth:"240px"},wd=["a[href]","[tabindex]:not([tabindex='-1'])","[contenteditable]:not([contenteditable='false'])","button:not([disabled])","input:not([disabled])","select:not([disabled])","textarea:not([disabled])"].join(", ");function oh(g){if(g){if("number"==typeof g){const a=Math.round(Math.sqrt(.5*Math.pow(g,2)));return{center:new b.pointGeometry(0,0),top:new b.pointGeometry(0,g),"top-left":new b.pointGeometry(a,a),"top-right":new b.pointGeometry(-a,a),bottom:new b.pointGeometry(0,-g),"bottom-left":new b.pointGeometry(a,-a),"bottom-right":new b.pointGeometry(-a,-a),left:new b.pointGeometry(g,0),right:new b.pointGeometry(-g,0)}}if(g instanceof b.pointGeometry||Array.isArray(g)){const a=b.pointGeometry.convert(g);return{center:a,top:a,"top-left":a,"top-right":a,bottom:a,"bottom-left":a,"bottom-right":a,left:a,right:a}}return{center:b.pointGeometry.convert(g.center||[0,0]),top:b.pointGeometry.convert(g.top||[0,0]),"top-left":b.pointGeometry.convert(g["top-left"]||[0,0]),"top-right":b.pointGeometry.convert(g["top-right"]||[0,0]),bottom:b.pointGeometry.convert(g.bottom||[0,0]),"bottom-left":b.pointGeometry.convert(g["bottom-left"]||[0,0]),"bottom-right":b.pointGeometry.convert(g["bottom-right"]||[0,0]),left:b.pointGeometry.convert(g.left||[0,0]),right:b.pointGeometry.convert(g.right||[0,0])}}return oh(new b.pointGeometry(0,0))}const ga={supported:_r,setRTLTextPlugin:b.setRTLTextPlugin,getRTLTextPluginStatus:b.getRTLTextPluginStatus,Map:class extends Si{constructor(g){var a;if(b.PerformanceUtils.mark(b.PerformanceMarkers.create),null!=(g=b.extend({},nh,g)).minZoom&&null!=g.maxZoom&&g.minZoom>g.maxZoom)throw new Error("maxZoom must be greater than or equal to minZoom");if(null!=g.minPitch&&null!=g.maxPitch&&g.minPitch>g.maxPitch)throw new Error("maxPitch must be greater than or equal to minPitch");if(null!=g.minPitch&&g.minPitch<0)throw new Error("minPitch must be greater than or equal to 0");if(null!=g.maxPitch&&g.maxPitch>85)throw new Error("maxPitch must be less than or equal to 85");if(super(new Er(g.minZoom,g.maxZoom,g.minPitch,g.maxPitch,g.renderWorldCopies),{bearingSnap:g.bearingSnap}),this._interactive=g.interactive,this._cooperativeGestures=g.cooperativeGestures,this._maxTileCacheSize=g.maxTileCacheSize,this._failIfMajorPerformanceCaveat=g.failIfMajorPerformanceCaveat,this._preserveDrawingBuffer=g.preserveDrawingBuffer,this._antialias=g.antialias,this._trackResize=g.trackResize,this._bearingSnap=g.bearingSnap,this._refreshExpiredTiles=g.refreshExpiredTiles,this._fadeDuration=g.fadeDuration,this._crossSourceCollisions=g.crossSourceCollisions,this._crossFadingFactor=1,this._collectResourceTiming=g.collectResourceTiming,this._renderTaskQueue=new pa,this._controls=[],this._mapId=b.uniqueId(),this._locale=b.extend({},Mi,g.locale),this._clickTolerance=g.clickTolerance,this._pixelRatio=null!==(a=g.pixelRatio)&&void 0!==a?a:devicePixelRatio,this._imageQueueHandle=ii.addThrottleControl(()=>this.isMoving()),this._requestManager=new kc(g.transformRequest),"string"==typeof g.container){if(this._container=document.getElementById(g.container),!this._container)throw new Error(`Container '${g.container}' not found.`)}else{if(!(g.container instanceof HTMLElement))throw new Error("Invalid type: 'container' must be a String or HTMLElement.");this._container=g.container}g.maxBounds&&this.setMaxBounds(g.maxBounds),b.bindAll(["_onWindowOnline","_onWindowResize","_onMapScroll","_contextLost","_contextRestored"],this),this._setupContainer(),this._setupPainter(),this.on("move",()=>this._update(!1)),this.on("moveend",()=>this._update(!1)),this.on("zoom",()=>this._update(!0)),this.on("terrain",()=>{this.painter.terrainFacilitator.dirty=!0,this._update(!0)}),typeof window<"u"&&(addEventListener("online",this._onWindowOnline,!1),addEventListener("resize",this._onWindowResize,!1),addEventListener("orientationchange",this._onWindowResize,!1)),this.handlers=new Qu(this,g),this._cooperativeGestures&&this._setupCooperativeGestures(),this._hash=g.hash&&new zf("string"==typeof g.hash&&g.hash||void 0).addTo(this),this._hash&&this._hash._onHashChange()||(this.jumpTo({center:g.center,zoom:g.zoom,bearing:g.bearing,pitch:g.pitch}),g.bounds&&(this.resize(),this.fitBounds(g.bounds,b.extend({},g.fitBoundsOptions,{duration:0})))),this.resize(),this._localIdeographFontFamily=g.localIdeographFontFamily,g.style&&this.setStyle(g.style,{localIdeographFontFamily:g.localIdeographFontFamily}),g.attributionControl&&this.addControl(new eh({customAttribution:g.customAttribution})),g.maplibreLogo&&this.addControl(new Zl,g.logoPosition),this.on("style.load",()=>{this.transform.unmodified&&this.jumpTo(this.style.stylesheet)}),this.on("data",h=>{this._update("style"===h.dataType),this.fire(new b.Event(`${h.dataType}data`,h))}),this.on("dataloading",h=>{this.fire(new b.Event(`${h.dataType}dataloading`,h))}),this.on("dataabort",h=>{this.fire(new b.Event("sourcedataabort",h))})}_getMapId(){return this._mapId}addControl(g,a){if(void 0===a&&(a=g.getDefaultPosition?g.getDefaultPosition():"top-right"),!g||!g.onAdd)return this.fire(new b.ErrorEvent(new Error("Invalid argument to map.addControl(). Argument must be a control with onAdd and onRemove methods.")));const h=g.onAdd(this);this._controls.push(g);const m=this._controlPositions[a];return-1!==a.indexOf("bottom")?m.insertBefore(h,m.firstChild):m.appendChild(h),this}removeControl(g){if(!g||!g.onRemove)return this.fire(new b.ErrorEvent(new Error("Invalid argument to map.removeControl(). Argument must be a control with onAdd and onRemove methods.")));const a=this._controls.indexOf(g);return a>-1&&this._controls.splice(a,1),g.onRemove(this),this}hasControl(g){return this._controls.indexOf(g)>-1}calculateCameraOptionsFromTo(g,a,h,m){return null==m&&this.terrain&&(m=this.transform.getElevation(h,this.terrain)),super.calculateCameraOptionsFromTo(g,a,h,m)}resize(g){const a=this._containerDimensions(),h=a[0],m=a[1];this._resizeCanvas(h,m,this.getPixelRatio()),this.transform.resize(h,m),this.painter.resize(h,m,this.getPixelRatio());const y=!this._moving;return y&&(this.stop(),this.fire(new b.Event("movestart",g)).fire(new b.Event("move",g))),this.fire(new b.Event("resize",g)),y&&this.fire(new b.Event("moveend",g)),this}getPixelRatio(){return this._pixelRatio}setPixelRatio(g){const[a,h]=this._containerDimensions();this._pixelRatio=g,this._resizeCanvas(a,h,g),this.painter.resize(a,h,g)}getBounds(){return this.transform.getBounds()}getMaxBounds(){return this.transform.getMaxBounds()}setMaxBounds(g){return this.transform.setMaxBounds(b.LngLatBounds.convert(g)),this._update()}setMinZoom(g){if((g=g??-2)>=-2&&g<=this.transform.maxZoom)return this.transform.minZoom=g,this._update(),this.getZoom()=this.transform.minZoom)return this.transform.maxZoom=g,this._update(),this.getZoom()>g&&this.setZoom(g),this;throw new Error("maxZoom must be greater than the current minZoom")}getMaxZoom(){return this.transform.maxZoom}setMinPitch(g){if((g=g??0)<0)throw new Error("minPitch must be greater than or equal to 0");if(g>=0&&g<=this.transform.maxPitch)return this.transform.minPitch=g,this._update(),this.getPitch()85)throw new Error("maxPitch must be less than or equal to 85");if(g>=this.transform.minPitch)return this.transform.maxPitch=g,this._update(),this.getPitch()>g&&this.setPitch(g),this;throw new Error("maxPitch must be greater than the current minPitch")}getMaxPitch(){return this.transform.maxPitch}getRenderWorldCopies(){return this.transform.renderWorldCopies}setRenderWorldCopies(g){return this.transform.renderWorldCopies=g,this._update()}project(g){return this.transform.locationPoint(b.LngLat.convert(g),this.style&&this.terrain)}unproject(g){return this.transform.pointLocation(b.pointGeometry.convert(g),this.terrain)}isMoving(){var g;return this._moving||(null===(g=this.handlers)||void 0===g?void 0:g.isMoving())}isZooming(){var g;return this._zooming||(null===(g=this.handlers)||void 0===g?void 0:g.isZooming())}isRotating(){var g;return this._rotating||(null===(g=this.handlers)||void 0===g?void 0:g.isRotating())}_createDelegatedListener(g,a,h){if("mouseenter"===g||"mouseover"===g){let m=!1;return{layer:a,listener:h,delegates:{mousemove:w=>{const S=this.getLayer(a)?this.queryRenderedFeatures(w.point,{layers:[a]}):[];S.length?m||(m=!0,h.call(this,new Po(g,this,w.originalEvent,{features:S}))):m=!1},mouseout:()=>{m=!1}}}}if("mouseleave"===g||"mouseout"===g){let m=!1;return{layer:a,listener:h,delegates:{mousemove:S=>{(this.getLayer(a)?this.queryRenderedFeatures(S.point,{layers:[a]}):[]).length?m=!0:m&&(m=!1,h.call(this,new Po(g,this,S.originalEvent)))},mouseout:S=>{m&&(m=!1,h.call(this,new Po(g,this,S.originalEvent)))}}}}{const m=y=>{const w=this.getLayer(a)?this.queryRenderedFeatures(y.point,{layers:[a]}):[];w.length&&(y.features=w,h.call(this,y),delete y.features)};return{layer:a,listener:h,delegates:{[g]:m}}}}on(g,a,h){if(void 0===h)return super.on(g,a);const m=this._createDelegatedListener(g,a,h);this._delegatedListeners=this._delegatedListeners||{},this._delegatedListeners[g]=this._delegatedListeners[g]||[],this._delegatedListeners[g].push(m);for(const y in m.delegates)this.on(y,m.delegates[y]);return this}once(g,a,h){if(void 0===h)return super.once(g,a);const m=this._createDelegatedListener(g,a,h);for(const y in m.delegates)this.once(y,m.delegates[y]);return this}off(g,a,h){return void 0===h?super.off(g,a):(this._delegatedListeners&&this._delegatedListeners[g]&&(m=>{const y=this._delegatedListeners[g];for(let w=0;wthis._updateStyle(g,a));const h=this.style&&a.transformStyle?this.style.serialize():void 0;return this.style&&(this.style.setEventedParent(null),this.style._remove(!g)),g?(this.style=new Mt(this,a||{}),this.style.setEventedParent(this,{style:this.style}),"string"==typeof g?this.style.loadURL(g,a,h):this.style.loadJSON(g,a,h),this):(delete this.style,this)}_lazyInitEmptyStyle(){this.style||(this.style=new Mt(this,{}),this.style.setEventedParent(this,{style:this.style}),this.style.loadEmpty())}_diffStyle(g,a){if("string"==typeof g){const h=this._requestManager.transformRequest(g,pn.Style);b.getJSON(h,(m,y)=>{m?this.fire(new b.ErrorEvent(m)):y&&this._updateDiff(y,a)})}else"object"==typeof g&&this._updateDiff(g,a)}_updateDiff(g,a){try{this.style.setState(g,a)&&this._update(!0)}catch(h){b.warnOnce(`Unable to perform style diff: ${h.message||h.error||h}. Rebuilding the style from scratch.`),this._updateStyle(g,a)}}getStyle(){if(this.style)return this.style.serialize()}isStyleLoaded(){return this.style?this.style.loaded():b.warnOnce("There is no style added to the map.")}addSource(g,a){return this._lazyInitEmptyStyle(),this.style.addSource(g,a),this._update(!0)}isSourceLoaded(g){const a=this.style&&this.style.sourceCaches[g];if(void 0!==a)return a.loaded();this.fire(new b.ErrorEvent(new Error(`There is no source with ID '${g}'`)))}setTerrain(g){if(this.style._checkLoaded(),this._terrainDataCallback&&this.style.off("data",this._terrainDataCallback),g){const a=this.style.sourceCaches[g.source];if(!a)throw new Error(`cannot load terrain, because there exists no source with ID: ${g.source}`);this.terrain=new th(this.painter,a,g),this.painter.renderToTexture=new Xl(this.painter,this.terrain),this.transform.updateElevation(this.terrain),this._terrainDataCallback=h=>{"style"===h.dataType?this.terrain.sourceCache.freeRtt():"source"===h.dataType&&h.tile&&(h.sourceId===g.source&&this.transform.updateElevation(this.terrain),this.terrain.sourceCache.freeRtt(h.tile.tileID))},this.style.on("data",this._terrainDataCallback)}else this.terrain&&this.terrain.sourceCache.destruct(),this.terrain=null,this.painter.renderToTexture&&this.painter.renderToTexture.destruct(),this.painter.renderToTexture=null,this.transform.updateElevation(this.terrain);return this.fire(new b.Event("terrain",{terrain:g})),this}getTerrain(){return this.terrain&&this.terrain.options}areTilesLoaded(){const g=this.style&&this.style.sourceCaches;for(const a in g){const h=g[a]._tiles;for(const m in h){const y=h[m];if("loaded"!==y.state&&"errored"!==y.state)return!1}}return!0}addSourceType(g,a,h){return this._lazyInitEmptyStyle(),this.style.addSourceType(g,a,h)}removeSource(g){return this.style.removeSource(g),this._update(!0)}getSource(g){return this.style.getSource(g)}addImage(g,a,{pixelRatio:h=1,sdf:m=!1,stretchX:y,stretchY:w,content:S}={}){if(this._lazyInitEmptyStyle(),a instanceof HTMLImageElement||b.isImageBitmap(a)){const{width:T,height:k,data:R}=b.exported.getImageData(a);this.style.addImage(g,{data:new b.RGBAImage({width:T,height:k},R),pixelRatio:h,stretchX:y,stretchY:w,content:S,sdf:m,version:0})}else{if(void 0===a.width||void 0===a.height)return this.fire(new b.ErrorEvent(new Error("Invalid arguments to map.addImage(). The second argument must be an `HTMLImageElement`, `ImageData`, `ImageBitmap`, or object with `width`, `height`, and `data` properties with the same format as `ImageData`")));{const{width:T,height:k,data:R}=a,z=a;this.style.addImage(g,{data:new b.RGBAImage({width:T,height:k},new Uint8Array(R)),pixelRatio:h,stretchX:y,stretchY:w,content:S,sdf:m,version:0,userImage:z}),z.onAdd&&z.onAdd(this,g)}}}updateImage(g,a){const h=this.style.getImage(g);if(!h)return this.fire(new b.ErrorEvent(new Error("The map has no image with that id. If you are adding a new image use `map.addImage(...)` instead.")));const m=a instanceof HTMLImageElement||b.isImageBitmap(a)?b.exported.getImageData(a):a,{width:y,height:w,data:S}=m;if(void 0===y||void 0===w)return this.fire(new b.ErrorEvent(new Error("Invalid arguments to map.updateImage(). The second argument must be an `HTMLImageElement`, `ImageData`, `ImageBitmap`, or object with `width`, `height`, and `data` properties with the same format as `ImageData`")));if(y!==h.data.width||w!==h.data.height)return this.fire(new b.ErrorEvent(new Error("The width and height of the updated image must be that same as the previous version of the image")));const T=!(a instanceof HTMLImageElement||b.isImageBitmap(a));h.data.replace(S,T),this.style.updateImage(g,h)}hasImage(g){return g?!!this.style.getImage(g):(this.fire(new b.ErrorEvent(new Error("Missing required image id"))),!1)}removeImage(g){this.style.removeImage(g)}loadImage(g,a){ii.getImage(this._requestManager.transformRequest(g,pn.Image),a)}listImages(){return this.style.listImages()}addLayer(g,a){return this._lazyInitEmptyStyle(),this.style.addLayer(g,a),this._update(!0)}moveLayer(g,a){return this.style.moveLayer(g,a),this._update(!0)}removeLayer(g){return this.style.removeLayer(g),this._update(!0)}getLayer(g){return this.style.getLayer(g)}setLayerZoomRange(g,a,h){return this.style.setLayerZoomRange(g,a,h),this._update(!0)}setFilter(g,a,h={}){return this.style.setFilter(g,a,h),this._update(!0)}getFilter(g){return this.style.getFilter(g)}setPaintProperty(g,a,h,m={}){return this.style.setPaintProperty(g,a,h,m),this._update(!0)}getPaintProperty(g,a){return this.style.getPaintProperty(g,a)}setLayoutProperty(g,a,h,m={}){return this.style.setLayoutProperty(g,a,h,m),this._update(!0)}getLayoutProperty(g,a){return this.style.getLayoutProperty(g,a)}setGlyphs(g,a={}){return this._lazyInitEmptyStyle(),this.style.setGlyphs(g,a),this._update(!0)}getGlyphs(){return this.style.getGlyphsUrl()}addSprite(g,a,h={}){return this._lazyInitEmptyStyle(),this.style.addSprite(g,a,h,m=>{m||this._update(!0)}),this}removeSprite(g){return this._lazyInitEmptyStyle(),this.style.removeSprite(g),this._update(!0)}getSprite(){return this.style.getSprite()}setSprite(g,a={}){return this._lazyInitEmptyStyle(),this.style.setSprite(g,a,h=>{h||this._update(!0)}),this}setLight(g,a={}){return this._lazyInitEmptyStyle(),this.style.setLight(g,a),this._update(!0)}getLight(){return this.style.getLight()}setFeatureState(g,a){return this.style.setFeatureState(g,a),this._update()}removeFeatureState(g,a){return this.style.removeFeatureState(g,a),this._update()}getFeatureState(g){return this.style.getFeatureState(g)}getContainer(){return this._container}getCanvasContainer(){return this._canvasContainer}getCanvas(){return this._canvas}_containerDimensions(){let g=0,a=0;return this._container&&(g=this._container.clientWidth||400,a=this._container.clientHeight||300),[g,a]}_setupContainer(){const g=this._container;g.classList.add("maplibregl-map");const a=this._canvasContainer=Te.create("div","maplibregl-canvas-container",g);this._interactive&&a.classList.add("maplibregl-interactive"),this._canvas=Te.create("canvas","maplibregl-canvas",a),this._canvas.addEventListener("webglcontextlost",this._contextLost,!1),this._canvas.addEventListener("webglcontextrestored",this._contextRestored,!1),this._canvas.setAttribute("tabindex","0"),this._canvas.setAttribute("aria-label","Map"),this._canvas.setAttribute("role","region");const h=this._containerDimensions();this._resizeCanvas(h[0],h[1],this.getPixelRatio());const m=this._controlContainer=Te.create("div","maplibregl-control-container",g),y=this._controlPositions={};["top-left","top-right","bottom-left","bottom-right"].forEach(w=>{y[w]=Te.create("div",`maplibregl-ctrl-${w} `,m)}),this._container.addEventListener("scroll",this._onMapScroll,!1)}_setupCooperativeGestures(){const g=this._container;this._metaPress=!1,this._cooperativeGesturesScreen=Te.create("div","maplibregl-cooperative-gesture-screen",g);let a="Control",h="boolean"!=typeof this._cooperativeGestures&&this._cooperativeGestures.windowsHelpText?this._cooperativeGestures.windowsHelpText:"Use Ctrl + scroll to zoom the map";0===navigator.platform.indexOf("Mac")&&(h="boolean"!=typeof this._cooperativeGestures&&this._cooperativeGestures.macHelpText?this._cooperativeGestures.macHelpText:"Use \u2318 + scroll to zoom the map",a="Meta"),this._cooperativeGesturesScreen.innerHTML=`\n
${h}
\n
${"boolean"!=typeof this._cooperativeGestures&&this._cooperativeGestures.mobileHelpText?this._cooperativeGestures.mobileHelpText:"Use two fingers to move the map"}
\n `,document.addEventListener("keydown",m=>{m.key===a&&(this._metaPress=!0)}),document.addEventListener("keyup",m=>{m.key===a&&(this._metaPress=!1)}),this._canvasContainer.addEventListener("wheel",m=>{this._onCooperativeGesture(m,this._metaPress,1)},!1),this._canvasContainer.classList.remove("maplibregl-touch-drag-pan")}_resizeCanvas(g,a,h){this._canvas.width=h*g,this._canvas.height=h*a,this._canvas.style.width=`${g}px`,this._canvas.style.height=`${a}px`}_setupPainter(){const g=b.extend({},_r.webGLContextAttributes,{failIfMajorPerformanceCaveat:this._failIfMajorPerformanceCaveat,preserveDrawingBuffer:this._preserveDrawingBuffer,antialias:this._antialias||!1});let a=null;this._canvas.addEventListener("webglcontextcreationerror",m=>{a={requestedAttributes:g},m&&(a.statusMessage=m.statusMessage,a.type=m.type)},{once:!0});const h=this._canvas.getContext("webgl",g)||this._canvas.getContext("experimental-webgl",g);if(!h){const m="Failed to initialize WebGL";throw a?(a.message=m,new Error(JSON.stringify(a))):new Error(m)}this.painter=new gs(h,this.transform),Ni.testSupport(h)}_contextLost(g){g.preventDefault(),this._frame&&(this._frame.cancel(),this._frame=null),this.fire(new b.Event("webglcontextlost",{originalEvent:g}))}_contextRestored(g){this._setupPainter(),this.resize(),this._update(),this.fire(new b.Event("webglcontextrestored",{originalEvent:g}))}_onMapScroll(g){if(g.target===this._container)return this._container.scrollTop=0,this._container.scrollLeft=0,!1}_onCooperativeGesture(g,a,h){return!a&&h<2&&(this._cooperativeGesturesScreen.classList.add("maplibregl-show"),setTimeout(()=>{this._cooperativeGesturesScreen.classList.remove("maplibregl-show")},100)),!1}loaded(){return!this._styleDirty&&!this._sourcesDirty&&!!this.style&&this.style.loaded()}_update(g){return this.style?(this._styleDirty=this._styleDirty||g,this._sourcesDirty=!0,this.triggerRepaint(),this):this}_requestRenderFrame(g){return this._update(),this._renderTaskQueue.add(g)}_cancelRenderFrame(g){this._renderTaskQueue.remove(g)}_render(g){let a,h=0;const m=this.painter.context.extTimerQuery;if(this.listens("gpu-timing-frame")&&(a=m.createQueryEXT(),m.beginQueryEXT(m.TIME_ELAPSED_EXT,a),h=b.exported.now()),this.painter.context.setDirty(),this.painter.setBaseState(),this._renderTaskQueue.run(g),this._removed)return;let y=!1;if(this.style&&this._styleDirty){this._styleDirty=!1;const S=this.transform.zoom,T=b.exported.now();this.style.zoomHistory.update(S,T);const k=new b.EvaluationParameters(S,{now:T,fadeDuration:this._fadeDuration,zoomHistory:this.style.zoomHistory,transition:this.style.getTransition()}),R=k.crossFadingFactor();1===R&&R===this._crossFadingFactor||(y=!0,this._crossFadingFactor=R),this.style.update(k)}if(this.style&&this._sourcesDirty&&(this._sourcesDirty=!1,this.style._updateSources(this.transform)),this.terrain&&this.terrain.sourceCache.update(this.transform,this.terrain),this.transform.updateElevation(this.terrain),this._imageQueueDirty=ii.processQueue()>0,this._placementDirty=this.style&&this.style._updatePlacement(this.painter.transform,this.showCollisionBoxes,this._fadeDuration,this._crossSourceCollisions),this.painter.render(this.style,{showTileBoundaries:this.showTileBoundaries,showOverdrawInspector:this._showOverdrawInspector,rotating:this.isRotating(),zooming:this.isZooming(),moving:this.isMoving(),fadeDuration:this._fadeDuration,showPadding:this.showPadding,gpuTiming:!!this.listens("gpu-timing-layer")}),this.fire(new b.Event("render")),this.loaded()&&!this._loaded&&(this._loaded=!0,b.PerformanceUtils.mark(b.PerformanceMarkers.load),this.fire(new b.Event("load"))),this.style&&(this.style.hasTransitions()||y)&&(this._styleDirty=!0),this.style&&!this._placementDirty&&this.style._releaseSymbolFadeTiles(),this.listens("gpu-timing-frame")){const S=b.exported.now()-h;m.endQueryEXT(m.TIME_ELAPSED_EXT,a),setTimeout(()=>{const T=m.getQueryObjectEXT(a,m.QUERY_RESULT_EXT)/1e6;m.deleteQueryEXT(a),this.fire(new b.Event("gpu-timing-frame",{cpuTime:S,gpuTime:T}))},50)}if(this.listens("gpu-timing-layer")){const S=this.painter.collectGpuTimers();setTimeout(()=>{const T=this.painter.queryGpuTimers(S);this.fire(new b.Event("gpu-timing-layer",{layerTimes:T}))},50)}const w=this._sourcesDirty||this._styleDirty||this._placementDirty||this._imageQueueDirty;return w||this._repaint?this.triggerRepaint():!this.isMoving()&&this.loaded()&&this.fire(new b.Event("idle")),!this._loaded||this._fullyLoaded||w||(this._fullyLoaded=!0,b.PerformanceUtils.mark(b.PerformanceMarkers.fullLoad)),this}redraw(){return this.style&&(this._frame&&(this._frame.cancel(),this._frame=null),this._render(0)),this}remove(){this._hash&&this._hash.remove();for(const a of this._controls)a.onRemove(this);this._controls=[],this._frame&&(this._frame.cancel(),this._frame=null),this._renderTaskQueue.clear(),this.painter.destroy(),this.handlers.destroy(),delete this.handlers,this.setStyle(null),typeof window<"u"&&(removeEventListener("resize",this._onWindowResize,!1),removeEventListener("orientationchange",this._onWindowResize,!1),removeEventListener("online",this._onWindowOnline,!1)),ii.removeThrottleControl(this._imageQueueHandle);const g=this.painter.context.gl.getExtension("WEBGL_lose_context");g&&g.loseContext(),this._canvas.removeEventListener("webglcontextrestored",this._contextRestored,!1),this._canvas.removeEventListener("webglcontextlost",this._contextLost,!1),Te.remove(this._canvasContainer),Te.remove(this._controlContainer),this._cooperativeGestures&&Te.remove(this._cooperativeGesturesScreen),this._container.classList.remove("maplibregl-map"),b.PerformanceUtils.clearMetrics(),this._removed=!0,this.fire(new b.Event("remove"))}triggerRepaint(){this.style&&!this._frame&&(this._frame=b.exported.frame(g=>{b.PerformanceUtils.frame(g),this._frame=null,this._render(g)}))}_onWindowOnline(){this._update()}_onWindowResize(g){this._trackResize&&this.resize({originalEvent:g})._update()}get showTileBoundaries(){return!!this._showTileBoundaries}set showTileBoundaries(g){this._showTileBoundaries!==g&&(this._showTileBoundaries=g,this._update())}get showPadding(){return!!this._showPadding}set showPadding(g){this._showPadding!==g&&(this._showPadding=g,this._update())}get showCollisionBoxes(){return!!this._showCollisionBoxes}set showCollisionBoxes(g){this._showCollisionBoxes!==g&&(this._showCollisionBoxes=g,g?this.style._generateCollisionBoxes():this._update())}get showOverdrawInspector(){return!!this._showOverdrawInspector}set showOverdrawInspector(g){this._showOverdrawInspector!==g&&(this._showOverdrawInspector=g,this._update())}get repaint(){return!!this._repaint}set repaint(g){this._repaint!==g&&(this._repaint=g,this.triggerRepaint())}get vertices(){return!!this._vertices}set vertices(g){this._vertices=g,this._update()}get version(){return"3.0.0-pre.4"}getCameraTargetElevation(){return this.transform.elevation}},NavigationControl:class{constructor(g){this.options=b.extend({},vd,g),this._container=Te.create("div","maplibregl-ctrl maplibregl-ctrl-group"),this._container.addEventListener("contextmenu",a=>a.preventDefault()),this.options.showZoom&&(b.bindAll(["_setButtonTitle","_updateZoomButtons"],this),this._zoomInButton=this._createButton("maplibregl-ctrl-zoom-in",a=>this._map.zoomIn({},{originalEvent:a})),Te.create("span","maplibregl-ctrl-icon",this._zoomInButton).setAttribute("aria-hidden","true"),this._zoomOutButton=this._createButton("maplibregl-ctrl-zoom-out",a=>this._map.zoomOut({},{originalEvent:a})),Te.create("span","maplibregl-ctrl-icon",this._zoomOutButton).setAttribute("aria-hidden","true")),this.options.showCompass&&(b.bindAll(["_rotateCompassArrow"],this),this._compass=this._createButton("maplibregl-ctrl-compass",a=>{this.options.visualizePitch?this._map.resetNorthPitch({},{originalEvent:a}):this._map.resetNorth({},{originalEvent:a})}),this._compassIcon=Te.create("span","maplibregl-ctrl-icon",this._compass),this._compassIcon.setAttribute("aria-hidden","true"))}_updateZoomButtons(){const g=this._map.getZoom(),a=g===this._map.getMaxZoom(),h=g===this._map.getMinZoom();this._zoomInButton.disabled=a,this._zoomOutButton.disabled=h,this._zoomInButton.setAttribute("aria-disabled",a.toString()),this._zoomOutButton.setAttribute("aria-disabled",h.toString())}_rotateCompassArrow(){const g=this.options.visualizePitch?`scale(${1/Math.pow(Math.cos(this._map.transform.pitch*(Math.PI/180)),.5)}) rotateX(${this._map.transform.pitch}deg) rotateZ(${this._map.transform.angle*(180/Math.PI)}deg)`:`rotate(${this._map.transform.angle*(180/Math.PI)}deg)`;this._compassIcon.style.transform=g}onAdd(g){return this._map=g,this.options.showZoom&&(this._setButtonTitle(this._zoomInButton,"ZoomIn"),this._setButtonTitle(this._zoomOutButton,"ZoomOut"),this._map.on("zoom",this._updateZoomButtons),this._updateZoomButtons()),this.options.showCompass&&(this._setButtonTitle(this._compass,"ResetBearing"),this.options.visualizePitch&&this._map.on("pitch",this._rotateCompassArrow),this._map.on("rotate",this._rotateCompassArrow),this._rotateCompassArrow(),this._handler=new Hf(this._map,this._compass,this.options.visualizePitch)),this._container}onRemove(){Te.remove(this._container),this.options.showZoom&&this._map.off("zoom",this._updateZoomButtons),this.options.showCompass&&(this.options.visualizePitch&&this._map.off("pitch",this._rotateCompassArrow),this._map.off("rotate",this._rotateCompassArrow),this._handler.off(),delete this._handler),delete this._map}_createButton(g,a){const h=Te.create("button",g,this._container);return h.type="button",h.addEventListener("click",a),h}_setButtonTitle(g,a){const h=this._map._getUIString(`NavigationControl.${a}`);g.title=h,g.setAttribute("aria-label",h)}},GeolocateControl:class extends b.Evented{constructor(g){super(),this.options=b.extend({},He,g),b.bindAll(["_onSuccess","_onError","_onZoom","_finish","_setupUI","_updateCamera","_updateMarker"],this)}onAdd(g){var a;return this._map=g,this._container=Te.create("div","maplibregl-ctrl maplibregl-ctrl-group"),a=this._setupUI,void 0!==en?a(en):void 0!==window.navigator.permissions?window.navigator.permissions.query({name:"geolocation"}).then(h=>{en="denied"!==h.state,a(en)}):(en=!!window.navigator.geolocation,a(en)),this._container}onRemove(){void 0!==this._geolocationWatchID&&(window.navigator.geolocation.clearWatch(this._geolocationWatchID),this._geolocationWatchID=void 0),this.options.showUserLocation&&this._userLocationDotMarker&&this._userLocationDotMarker.remove(),this.options.showAccuracyCircle&&this._accuracyCircleMarker&&this._accuracyCircleMarker.remove(),Te.remove(this._container),this._map.off("zoom",this._onZoom),this._map=void 0,ma=0,Gs=!1}_isOutOfMapMaxBounds(g){const a=this._map.getMaxBounds(),h=g.coords;return a&&(h.longitudea.getEast()||h.latitudea.getNorth())}_setErrorState(){switch(this._watchState){case"WAITING_ACTIVE":this._watchState="ACTIVE_ERROR",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-active-error");break;case"ACTIVE_LOCK":this._watchState="ACTIVE_ERROR",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-active-error"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-waiting");break;case"BACKGROUND":this._watchState="BACKGROUND_ERROR",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-background-error"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-waiting");break;case"ACTIVE_ERROR":break;default:throw new Error(`Unexpected watchState ${this._watchState}`)}}_onSuccess(g){if(this._map){if(this._isOutOfMapMaxBounds(g))return this._setErrorState(),this.fire(new b.Event("outofmaxbounds",g)),this._updateMarker(),void this._finish();if(this.options.trackUserLocation)switch(this._lastKnownPosition=g,this._watchState){case"WAITING_ACTIVE":case"ACTIVE_LOCK":case"ACTIVE_ERROR":this._watchState="ACTIVE_LOCK",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active-error"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-active");break;case"BACKGROUND":case"BACKGROUND_ERROR":this._watchState="BACKGROUND",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background-error"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-background");break;default:throw new Error(`Unexpected watchState ${this._watchState}`)}this.options.showUserLocation&&"OFF"!==this._watchState&&this._updateMarker(g),this.options.trackUserLocation&&"ACTIVE_LOCK"!==this._watchState||this._updateCamera(g),this.options.showUserLocation&&this._dotElement.classList.remove("maplibregl-user-location-dot-stale"),this.fire(new b.Event("geolocate",g)),this._finish()}}_updateCamera(g){const a=new b.LngLat(g.coords.longitude,g.coords.latitude),h=g.coords.accuracy,m=this._map.getBearing(),y=b.extend({bearing:m},this.options.fitBoundsOptions);this._map.fitBounds(a.toBounds(h),y,{geolocateSource:!0})}_updateMarker(g){if(g){const a=new b.LngLat(g.coords.longitude,g.coords.latitude);this._accuracyCircleMarker.setLngLat(a).addTo(this._map),this._userLocationDotMarker.setLngLat(a).addTo(this._map),this._accuracy=g.coords.accuracy,this.options.showUserLocation&&this.options.showAccuracyCircle&&this._updateCircleRadius()}else this._userLocationDotMarker.remove(),this._accuracyCircleMarker.remove()}_updateCircleRadius(){const g=this._map._container.clientHeight/2,a=this._map.unproject([0,g]),h=this._map.unproject([1,g]),m=a.distanceTo(h),y=Math.ceil(2*this._accuracy/m);this._circleElement.style.width=`${y}px`,this._circleElement.style.height=`${y}px`}_onZoom(){this.options.showUserLocation&&this.options.showAccuracyCircle&&this._updateCircleRadius()}_onError(g){if(this._map){if(this.options.trackUserLocation)if(1===g.code){this._watchState="OFF",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active-error"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background-error"),this._geolocateButton.disabled=!0;const a=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.title=a,this._geolocateButton.setAttribute("aria-label",a),void 0!==this._geolocationWatchID&&this._clearWatch()}else{if(3===g.code&&Gs)return;this._setErrorState()}"OFF"!==this._watchState&&this.options.showUserLocation&&this._dotElement.classList.add("maplibregl-user-location-dot-stale"),this.fire(new b.Event("error",g)),this._finish()}}_finish(){this._timeoutId&&clearTimeout(this._timeoutId),this._timeoutId=void 0}_setupUI(g){if(this._container.addEventListener("contextmenu",a=>a.preventDefault()),this._geolocateButton=Te.create("button","maplibregl-ctrl-geolocate",this._container),Te.create("span","maplibregl-ctrl-icon",this._geolocateButton).setAttribute("aria-hidden","true"),this._geolocateButton.type="button",!1===g){b.warnOnce("Geolocation support is not available so the GeolocateControl will be disabled.");const a=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.disabled=!0,this._geolocateButton.title=a,this._geolocateButton.setAttribute("aria-label",a)}else{const a=this._map._getUIString("GeolocateControl.FindMyLocation");this._geolocateButton.title=a,this._geolocateButton.setAttribute("aria-label",a)}this.options.trackUserLocation&&(this._geolocateButton.setAttribute("aria-pressed","false"),this._watchState="OFF"),this.options.showUserLocation&&(this._dotElement=Te.create("div","maplibregl-user-location-dot"),this._userLocationDotMarker=new rh(this._dotElement),this._circleElement=Te.create("div","maplibregl-user-location-accuracy-circle"),this._accuracyCircleMarker=new rh({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",a=>{a.geolocateSource||"ACTIVE_LOCK"!==this._watchState||a.originalEvent&&"resize"===a.originalEvent.type||(this._watchState="BACKGROUND",this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active"),this.fire(new b.Event("trackuserlocationend")))})}trigger(){if(!this._setup)return b.warnOnce("Geolocate control triggered before added to a map"),!1;if(this.options.trackUserLocation){switch(this._watchState){case"OFF":this._watchState="WAITING_ACTIVE",this.fire(new b.Event("trackuserlocationstart"));break;case"WAITING_ACTIVE":case"ACTIVE_LOCK":case"ACTIVE_ERROR":case"BACKGROUND_ERROR":ma--,Gs=!1,this._watchState="OFF",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active-error"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background-error"),this.fire(new b.Event("trackuserlocationend"));break;case"BACKGROUND":this._watchState="ACTIVE_LOCK",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background"),this._lastKnownPosition&&this._updateCamera(this._lastKnownPosition),this.fire(new b.Event("trackuserlocationstart"));break;default:throw new Error(`Unexpected watchState ${this._watchState}`)}switch(this._watchState){case"WAITING_ACTIVE":this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-active");break;case"ACTIVE_LOCK":this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-active");break;case"OFF":break;default:throw new Error(`Unexpected watchState ${this._watchState}`)}if("OFF"===this._watchState&&void 0!==this._geolocationWatchID)this._clearWatch();else if(void 0===this._geolocationWatchID){let g;this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.setAttribute("aria-pressed","true"),ma++,ma>1?(g={maximumAge:6e5,timeout:0},Gs=!0):(g=this.options.positionOptions,Gs=!1),this._geolocationWatchID=window.navigator.geolocation.watchPosition(this._onSuccess,this._onError,g)}}else window.navigator.geolocation.getCurrentPosition(this._onSuccess,this._onError,this.options.positionOptions),this._timeoutId=setTimeout(this._finish,1e4);return!0}_clearWatch(){window.navigator.geolocation.clearWatch(this._geolocationWatchID),this._geolocationWatchID=void 0,this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.setAttribute("aria-pressed","false"),this.options.showUserLocation&&this._updateMarker(null)}},AttributionControl:eh,LogoControl:Zl,ScaleControl:class{constructor(g){this.options=b.extend({},Pr,g),b.bindAll(["_onMove","setUnit"],this)}getDefaultPosition(){return"bottom-left"}_onMove(){ih(this._map,this._container,this.options)}onAdd(g){return this._map=g,this._container=Te.create("div","maplibregl-ctrl maplibregl-ctrl-scale",g.getContainer()),this._map.on("move",this._onMove),this._onMove(),this._container}onRemove(){Te.remove(this._container),this._map.off("move",this._onMove),this._map=void 0}setUnit(g){this.options.unit=g,ih(this._map,this._container,this.options)}},FullscreenControl:class extends b.Evented{constructor(g={}){super(),this._onFullscreenChange=()=>{(window.document.fullscreenElement||window.document.mozFullScreenElement||window.document.webkitFullscreenElement||window.document.msFullscreenElement)===this._container!==this._fullscreen&&this._handleFullscreenChange()},this._onClickFullscreen=()=>{this._isFullscreen()?this._exitFullscreen():this._requestFullscreen()},this._fullscreen=!1,g&&g.container&&(g.container instanceof HTMLElement?this._container=g.container:b.warnOnce("Full screen control 'container' must be a DOM element.")),"onfullscreenchange"in document?this._fullscreenchange="fullscreenchange":"onmozfullscreenchange"in document?this._fullscreenchange="mozfullscreenchange":"onwebkitfullscreenchange"in document?this._fullscreenchange="webkitfullscreenchange":"onmsfullscreenchange"in document&&(this._fullscreenchange="MSFullscreenChange")}onAdd(g){return this._map=g,this._container||(this._container=this._map.getContainer()),this._controlContainer=Te.create("div","maplibregl-ctrl maplibregl-ctrl-group"),this._setupUI(),this._controlContainer}onRemove(){Te.remove(this._controlContainer),this._map=null,window.document.removeEventListener(this._fullscreenchange,this._onFullscreenChange)}_setupUI(){const g=this._fullscreenButton=Te.create("button","maplibregl-ctrl-fullscreen",this._controlContainer);Te.create("span","maplibregl-ctrl-icon",g).setAttribute("aria-hidden","true"),g.type="button",this._updateTitle(),this._fullscreenButton.addEventListener("click",this._onClickFullscreen),window.document.addEventListener(this._fullscreenchange,this._onFullscreenChange)}_updateTitle(){const g=this._getTitle();this._fullscreenButton.setAttribute("aria-label",g),this._fullscreenButton.title=g}_getTitle(){return this._map._getUIString(this._isFullscreen()?"FullscreenControl.Exit":"FullscreenControl.Enter")}_isFullscreen(){return this._fullscreen}_handleFullscreenChange(){this._fullscreen=!this._fullscreen,this._fullscreenButton.classList.toggle("maplibregl-ctrl-shrink"),this._fullscreenButton.classList.toggle("maplibregl-ctrl-fullscreen"),this._updateTitle(),this.fire(new b.Event(this._fullscreen?"fullscreenstart":"fullscreenend"))}_exitFullscreen(){window.document.exitFullscreen?window.document.exitFullscreen():window.document.mozCancelFullScreen?window.document.mozCancelFullScreen():window.document.msExitFullscreen?window.document.msExitFullscreen():window.document.webkitCancelFullScreen?window.document.webkitCancelFullScreen():this._togglePseudoFullScreen()}_requestFullscreen(){this._container.requestFullscreen?this._container.requestFullscreen():this._container.mozRequestFullScreen?this._container.mozRequestFullScreen():this._container.msRequestFullscreen?this._container.msRequestFullscreen():this._container.webkitRequestFullscreen?this._container.webkitRequestFullscreen():this._togglePseudoFullScreen()}_togglePseudoFullScreen(){this._container.classList.toggle("maplibregl-pseudo-fullscreen"),this._handleFullscreenChange(),this._map.resize()}},TerrainControl:class{constructor(g){this.options=g,b.bindAll(["_toggleTerrain","_updateTerrainIcon"],this)}onAdd(g){return this._map=g,this._container=Te.create("div","maplibregl-ctrl maplibregl-ctrl-group"),this._terrainButton=Te.create("button","maplibregl-ctrl-terrain",this._container),Te.create("span","maplibregl-ctrl-icon",this._terrainButton).setAttribute("aria-hidden","true"),this._terrainButton.type="button",this._terrainButton.addEventListener("click",this._toggleTerrain),this._updateTerrainIcon(),this._map.on("terrain",this._updateTerrainIcon),this._container}onRemove(){Te.remove(this._container),this._map.off("terrain",this._updateTerrainIcon),this._map=void 0}_toggleTerrain(){this._map.getTerrain()?this._map.setTerrain(null):this._map.setTerrain(this.options),this._updateTerrainIcon()}_updateTerrainIcon(){this._terrainButton.classList.remove("maplibregl-ctrl-terrain"),this._terrainButton.classList.remove("maplibregl-ctrl-terrain-enabled"),this._map.terrain?(this._terrainButton.classList.add("maplibregl-ctrl-terrain-enabled"),this._terrainButton.title=this._map._getUIString("TerrainControl.disableTerrain")):(this._terrainButton.classList.add("maplibregl-ctrl-terrain"),this._terrainButton.title=this._map._getUIString("TerrainControl.enableTerrain"))}},Popup:class extends b.Evented{constructor(g){super(),this.options=b.extend(Object.create(bs),g),b.bindAll(["_update","_onClose","remove","_onMouseMove","_onMouseUp","_onDrag"],this)}addTo(g){return this._map&&this.remove(),this._map=g,this.options.closeOnClick&&this._map.on("click",this._onClose),this.options.closeOnMove&&this._map.on("move",this._onClose),this._map.on("remove",this.remove),this._update(),this._focusFirstElement(),this._trackPointer?(this._map.on("mousemove",this._onMouseMove),this._map.on("mouseup",this._onMouseUp),this._container&&this._container.classList.add("maplibregl-popup-track-pointer"),this._map._canvasContainer.classList.add("maplibregl-track-pointer")):this._map.on("move",this._update),this.fire(new b.Event("open")),this}isOpen(){return!!this._map}remove(){return this._content&&Te.remove(this._content),this._container&&(Te.remove(this._container),delete this._container),this._map&&(this._map.off("move",this._update),this._map.off("move",this._onClose),this._map.off("click",this._onClose),this._map.off("remove",this.remove),this._map.off("mousemove",this._onMouseMove),this._map.off("mouseup",this._onMouseUp),this._map.off("drag",this._onDrag),delete this._map),this.fire(new b.Event("close")),this}getLngLat(){return this._lngLat}setLngLat(g){return this._lngLat=b.LngLat.convert(g),this._pos=null,this._trackPointer=!1,this._update(),this._map&&(this._map.on("move",this._update),this._map.off("mousemove",this._onMouseMove),this._container&&this._container.classList.remove("maplibregl-popup-track-pointer"),this._map._canvasContainer.classList.remove("maplibregl-track-pointer")),this}trackPointer(){return this._trackPointer=!0,this._pos=null,this._update(),this._map&&(this._map.off("move",this._update),this._map.on("mousemove",this._onMouseMove),this._map.on("drag",this._onDrag),this._container&&this._container.classList.add("maplibregl-popup-track-pointer"),this._map._canvasContainer.classList.add("maplibregl-track-pointer")),this}getElement(){return this._container}setText(g){return this.setDOMContent(document.createTextNode(g))}setHTML(g){const a=document.createDocumentFragment(),h=document.createElement("body");let m;for(h.innerHTML=g;m=h.firstChild,m;)a.appendChild(m);return this.setDOMContent(a)}getMaxWidth(){return this._container&&this._container.style.maxWidth}setMaxWidth(g){return this.options.maxWidth=g,this._update(),this}setDOMContent(g){if(this._content)for(;this._content.hasChildNodes();)this._content.firstChild&&this._content.removeChild(this._content.firstChild);else this._content=Te.create("div","maplibregl-popup-content",this._container);return this._content.appendChild(g),this._createCloseButton(),this._update(),this._focusFirstElement(),this}addClassName(g){this._container&&this._container.classList.add(g)}removeClassName(g){this._container&&this._container.classList.remove(g)}setOffset(g){return this.options.offset=g,this._update(),this}toggleClassName(g){if(this._container)return this._container.classList.toggle(g)}_createCloseButton(){this.options.closeButton&&(this._closeButton=Te.create("button","maplibregl-popup-close-button",this._content),this._closeButton.type="button",this._closeButton.setAttribute("aria-label","Close popup"),this._closeButton.innerHTML="×",this._closeButton.addEventListener("click",this._onClose))}_onMouseUp(g){this._update(g.point)}_onMouseMove(g){this._update(g.point)}_onDrag(g){this._update(g.point)}_update(g){if(!this._map||!this._lngLat&&!this._trackPointer||!this._content||(this._container||(this._container=Te.create("div","maplibregl-popup",this._map.getContainer()),this._tip=Te.create("div","maplibregl-popup-tip",this._container),this._container.appendChild(this._content),this.options.className&&this.options.className.split(" ").forEach(w=>this._container.classList.add(w)),this._trackPointer&&this._container.classList.add("maplibregl-popup-track-pointer")),this.options.maxWidth&&this._container.style.maxWidth!==this.options.maxWidth&&(this._container.style.maxWidth=this.options.maxWidth),this._map.transform.renderWorldCopies&&!this._trackPointer&&(this._lngLat=bd(this._lngLat,this._pos,this._map.transform)),this._trackPointer&&!g))return;const a=this._pos=this._trackPointer&&g?g:this._map.project(this._lngLat);let h=this.options.anchor;const m=oh(this.options.offset);if(!h){const w=this._container.offsetWidth,S=this._container.offsetHeight;let T;T=a.y+m.bottom.ythis._map.transform.height-S?["bottom"]:[],a.xthis._map.transform.width-w/2&&T.push("right"),h=0===T.length?"bottom":T.join("-")}const y=a.add(m[h]).round();Te.setTransform(this._container,`${qc[h]} translate(${y.x}px,${y.y}px)`),xd(this._container,h,"popup")}_focusFirstElement(){if(!this.options.focusAfterOpen||!this._container)return;const g=this._container.querySelector(wd);g&&g.focus()}_onClose(){this.remove()}},Marker:rh,Style:Mt,LngLat:b.LngLat,LngLatBounds:b.LngLatBounds,Point:b.pointGeometry,MercatorCoordinate:b.MercatorCoordinate,Evented:b.Evented,AJAXError:b.AJAXError,config:b.config,CanvasSource:Bi,GeoJSONSource:Ba,ImageSource:Vn,RasterDEMTileSource:Pe,RasterTileSource:Qn,VectorTileSource:mr,VideoSource:ds,prewarm:function(){Fc().acquire(ia)},clearPrewarmedResources:function(){const g=zn;g&&(g.isPreloaded()&&1===g.numActive()?(g.release(ia),zn=null):console.warn("Could not clear WebWorkers since there are active Map instances that still reference it. The pre-warmed WebWorker pool can only be cleared when all map instances have been removed with map.remove()"))},get version(){return"3.0.0-pre.4"},get workerCount(){return oo.workerCount},set workerCount(g){oo.workerCount=g},get maxParallelImageRequests(){return b.config.MAX_PARALLEL_IMAGE_REQUESTS},set maxParallelImageRequests(g){b.config.MAX_PARALLEL_IMAGE_REQUESTS=g},workerUrl:"",addProtocol(g,a){b.config.REGISTERED_PROTOCOLS[g]=a},removeProtocol(g){delete b.config.REGISTERED_PROTOCOLS[g]}};return ql.extend(ga,{isSafari:b.isSafari,getPerformanceMetrics:b.PerformanceUtils.getPerformanceMetrics}),ga}),or}()}},zm=>{zm(zm.s=418)}]); \ No newline at end of file diff --git a/frontend/dist/frontend/main.fca0d96fcab99092.js b/frontend/dist/frontend/main.fca0d96fcab99092.js deleted file mode 100644 index fce2b03..0000000 --- a/frontend/dist/frontend/main.fca0d96fcab99092.js +++ /dev/null @@ -1 +0,0 @@ -(self.webpackChunkfrontend=self.webpackChunkfrontend||[]).push([[179],{418:(zm,Au,ku)=>{"use strict";function or(e){return"function"==typeof e}function Zh(e){const n=e(r=>{Error.call(r),r.stack=(new Error).stack});return n.prototype=Object.create(Error.prototype),n.prototype.constructor=n,n}const Bm=Zh(e=>function(n){e(this),this.message=n?`${n.length} errors occurred during unsubscription:\n${n.map((r,i)=>`${i+1}) ${r.toString()}`).join("\n ")}`:"",this.name="UnsubscriptionError",this.errors=n});function b(e,t){if(e){const n=e.indexOf(t);0<=n&&e.splice(n,1)}}class _r{constructor(t){this.initialTeardown=t,this.closed=!1,this._parentage=null,this._finalizers=null}unsubscribe(){let t;if(!this.closed){this.closed=!0;const{_parentage:n}=this;if(n)if(this._parentage=null,Array.isArray(n))for(const o of n)o.remove(this);else n.remove(this);const{initialTeardown:r}=this;if(or(r))try{r()}catch(o){t=o instanceof Bm?o.errors:[o]}const{_finalizers:i}=this;if(i){this._finalizers=null;for(const o of i)try{Pl(o)}catch(c){t=t??[],c instanceof Bm?t=[...t,...c.errors]:t.push(c)}}if(t)throw new Bm(t)}}add(t){var n;if(t&&t!==this)if(this.closed)Pl(t);else{if(t instanceof _r){if(t.closed||t._hasParent(this))return;t._addParent(this)}(this._finalizers=null!==(n=this._finalizers)&&void 0!==n?n:[]).push(t)}}_hasParent(t){const{_parentage:n}=this;return n===t||Array.isArray(n)&&n.includes(t)}_addParent(t){const{_parentage:n}=this;this._parentage=Array.isArray(n)?(n.push(t),n):n?[n,t]:t}_removeParent(t){const{_parentage:n}=this;n===t?this._parentage=null:Array.isArray(n)&&b(n,t)}remove(t){const{_finalizers:n}=this;n&&b(n,t),t instanceof _r&&t._removeParent(this)}}_r.EMPTY=(()=>{const e=new _r;return e.closed=!0,e})();const Rs=_r.EMPTY;function us(e){return e instanceof _r||e&&"closed"in e&&or(e.remove)&&or(e.add)&&or(e.unsubscribe)}function Pl(e){or(e)?e():e.unsubscribe()}const Zt={onUnhandledError:null,onStoppedNotification:null,Promise:void 0,useDeprecatedSynchronousErrorHandling:!1,useDeprecatedNextContext:!1},Te={setTimeout(e,t,...n){const{delegate:r}=Te;return r?.setTimeout?r.setTimeout(e,t,...n):setTimeout(e,t,...n)},clearTimeout(e){const{delegate:t}=Te;return(t?.clearTimeout||clearTimeout)(e)},delegate:void 0};function Ni(e){Te.setTimeout(()=>{const{onUnhandledError:t}=Zt;if(!t)throw e;t(e)})}function Fs(){}const Os=wi("C",void 0,void 0);function wi(e,t,n){return{kind:e,value:t,error:n}}let no=null;function pn(e){if(Zt.useDeprecatedSynchronousErrorHandling){const t=!no;if(t&&(no={errorThrown:!1,error:null}),e(),t){const{errorThrown:n,error:r}=no;if(no=null,n)throw r}}else e()}class kc extends _r{constructor(t){super(),this.isStopped=!1,t?(this.destination=t,us(t)&&t.add(this)):this.destination=Pu}static create(t,n,r){return new ro(t,n,r)}next(t){this.isStopped?Hn(function Rl(e){return wi("N",e,void 0)}(t),this):this._next(t)}error(t){this.isStopped?Hn(function Ra(e){return wi("E",void 0,e)}(t),this):(this.isStopped=!0,this._error(t))}complete(){this.isStopped?Hn(Os,this):(this.isStopped=!0,this._complete())}unsubscribe(){this.closed||(this.isStopped=!0,super.unsubscribe(),this.destination=null)}_next(t){this.destination.next(t)}_error(t){try{this.destination.error(t)}finally{this.unsubscribe()}}_complete(){try{this.destination.complete()}finally{this.unsubscribe()}}}const Mo=Function.prototype.bind;function na(e,t){return Mo.call(e,t)}class Ls{constructor(t){this.partialObserver=t}next(t){const{partialObserver:n}=this;if(n.next)try{n.next(t)}catch(r){Fa(r)}}error(t){const{partialObserver:n}=this;if(n.error)try{n.error(t)}catch(r){Fa(r)}else Fa(t)}complete(){const{partialObserver:t}=this;if(t.complete)try{t.complete()}catch(n){Fa(n)}}}class ro extends kc{constructor(t,n,r){let i;if(super(),or(t)||!t)i={next:t??void 0,error:n??void 0,complete:r??void 0};else{let o;this&&Zt.useDeprecatedNextContext?(o=Object.create(t),o.unsubscribe=()=>this.unsubscribe(),i={next:t.next&&na(t.next,o),error:t.error&&na(t.error,o),complete:t.complete&&na(t.complete,o)}):i=t}this.destination=new Ls(i)}}function Fa(e){Zt.useDeprecatedSynchronousErrorHandling?function ii(e){Zt.useDeprecatedSynchronousErrorHandling&&no&&(no.errorThrown=!0,no.error=e)}(e):Ni(e)}function Hn(e,t){const{onStoppedNotification:n}=Zt;n&&Te.setTimeout(()=>n(e,t))}const Pu={closed:!0,next:Fs,error:function hs(e){throw e},complete:Fs},Tt="function"==typeof Symbol&&Symbol.observable||"@@observable";function qr(e){return e}function Ns(e){return 0===e.length?qr:1===e.length?e[0]:function(n){return e.reduce((r,i)=>i(r),n)}}let Nn=(()=>{class e{constructor(n){n&&(this._subscribe=n)}lift(n){const r=new e;return r.source=this,r.operator=n,r}subscribe(n,r,i){const o=function La(e){return e&&e instanceof kc||function Fl(e){return e&&or(e.next)&&or(e.error)&&or(e.complete)}(e)&&us(e)}(n)?n:new ro(n,r,i);return pn(()=>{const{operator:c,source:d}=this;o.add(c?c.call(o,d):d?this._subscribe(o):this._trySubscribe(o))}),o}_trySubscribe(n){try{return this._subscribe(n)}catch(r){n.error(r)}}forEach(n,r){return new(r=Pc(r))((i,o)=>{const c=new ro({next:d=>{try{n(d)}catch(p){o(p),c.unsubscribe()}},error:o,complete:i});this.subscribe(c)})}_subscribe(n){var r;return null===(r=this.source)||void 0===r?void 0:r.subscribe(n)}[Tt](){return this}pipe(...n){return Ns(n)(this)}toPromise(n){return new(n=Pc(n))((r,i)=>{let o;this.subscribe(c=>o=c,c=>i(c),()=>r(o))})}}return e.create=t=>new e(t),e})();function Pc(e){var t;return null!==(t=e??Zt.Promise)&&void 0!==t?t:Promise}const Rc=Zh(e=>function(){e(this),this.name="ObjectUnsubscribedError",this.message="object unsubscribed"});let oi=(()=>{class e extends Nn{constructor(){super(),this.closed=!1,this.currentObservers=null,this.observers=[],this.isStopped=!1,this.hasError=!1,this.thrownError=null}lift(n){const r=new Na(this,this);return r.operator=n,r}_throwIfClosed(){if(this.closed)throw new Rc}next(n){pn(()=>{if(this._throwIfClosed(),!this.isStopped){this.currentObservers||(this.currentObservers=Array.from(this.observers));for(const r of this.currentObservers)r.next(n)}})}error(n){pn(()=>{if(this._throwIfClosed(),!this.isStopped){this.hasError=this.isStopped=!0,this.thrownError=n;const{observers:r}=this;for(;r.length;)r.shift().error(n)}})}complete(){pn(()=>{if(this._throwIfClosed(),!this.isStopped){this.isStopped=!0;const{observers:n}=this;for(;n.length;)n.shift().complete()}})}unsubscribe(){this.isStopped=this.closed=!0,this.observers=this.currentObservers=null}get observed(){var n;return(null===(n=this.observers)||void 0===n?void 0:n.length)>0}_trySubscribe(n){return this._throwIfClosed(),super._trySubscribe(n)}_subscribe(n){return this._throwIfClosed(),this._checkFinalizedStatuses(n),this._innerSubscribe(n)}_innerSubscribe(n){const{hasError:r,isStopped:i,observers:o}=this;return r||i?Rs:(this.currentObservers=null,o.push(n),new _r(()=>{this.currentObservers=null,b(o,n)}))}_checkFinalizedStatuses(n){const{hasError:r,thrownError:i,isStopped:o}=this;r?n.error(i):o&&n.complete()}asObservable(){const n=new Nn;return n.source=this,n}}return e.create=(t,n)=>new Na(t,n),e})();class Na extends oi{constructor(t,n){super(),this.destination=t,this.source=n}next(t){var n,r;null===(r=null===(n=this.destination)||void 0===n?void 0:n.next)||void 0===r||r.call(n,t)}error(t){var n,r;null===(r=null===(n=this.destination)||void 0===n?void 0:n.error)||void 0===r||r.call(n,t)}complete(){var t,n;null===(n=null===(t=this.destination)||void 0===t?void 0:t.complete)||void 0===n||n.call(t)}_subscribe(t){var n,r;return null!==(r=null===(n=this.source)||void 0===n?void 0:n.subscribe(t))&&void 0!==r?r:Rs}}function ra(e){return or(e?.lift)}function mr(e){return t=>{if(ra(t))return t.lift(function(n){try{return e(n,this)}catch(r){this.error(r)}});throw new TypeError("Unable to lift unknown Observable type")}}function Qn(e,t,n,r,i){return new Ae(e,t,n,r,i)}class Ae extends kc{constructor(t,n,r,i,o,c){super(t),this.onFinalize=o,this.shouldUnsubscribe=c,this._next=n?function(d){try{n(d)}catch(p){t.error(p)}}:super._next,this._error=i?function(d){try{i(d)}catch(p){t.error(p)}finally{this.unsubscribe()}}:super._error,this._complete=r?function(){try{r()}catch(d){t.error(d)}finally{this.unsubscribe()}}:super._complete}unsubscribe(){var t;if(!this.shouldUnsubscribe||this.shouldUnsubscribe()){const{closed:n}=this;super.unsubscribe(),!n&&(null===(t=this.onFinalize)||void 0===t||t.call(this))}}}function Pe(e,t){return mr((n,r)=>{let i=0;n.subscribe(Qn(r,o=>{r.next(e.call(t,o,i++))}))})}function so(e){return this instanceof so?(this.v=e,this):new so(e)}function Ll(e,t,n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var i,r=n.apply(e,t||[]),o=[];return i={},c("next"),c("throw"),c("return"),i[Symbol.asyncIterator]=function(){return this},i;function c(I){r[I]&&(i[I]=function(P){return new Promise(function(N,G){o.push([I,P,N,G])>1||d(I,P)})})}function d(I,P){try{!function p(I){I.value instanceof so?Promise.resolve(I.value.v).then(v,E):D(o[0][2],I)}(r[I](P))}catch(N){D(o[0][3],N)}}function v(I){d("next",I)}function E(I){d("throw",I)}function D(I,P){I(P),o.shift(),o.length&&d(o[0][0],o[0][1])}}function oa(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var n,t=e[Symbol.asyncIterator];return t?t.call(e):(e=function ia(e){var t="function"==typeof Symbol&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}(e),n={},r("next"),r("throw"),r("return"),n[Symbol.asyncIterator]=function(){return this},n);function r(o){n[o]=e[o]&&function(c){return new Promise(function(d,p){!function i(o,c,d,p){Promise.resolve(p).then(function(v){o({value:v,done:d})},c)}(d,p,(c=e[o](c)).done,c.value)})}}}const ao=e=>e&&"number"==typeof e.length&&"function"!=typeof e;function Zr(e){return or(e?.then)}function Vr(e){return or(e[Tt])}function pi(e){return Symbol.asyncIterator&&or(e?.[Symbol.asyncIterator])}function mi(e){return new TypeError(`You provided ${null!==e&&"object"==typeof e?"an invalid object":`'${e}'`} where a stream was expected. You can provide an Observable, Promise, ReadableStream, Array, AsyncIterable, or Iterable.`)}const J=function Bs(){return"function"==typeof Symbol&&Symbol.iterator?Symbol.iterator:"@@iterator"}();function V(e){return or(e?.[J])}function $(e){return Ll(this,arguments,function*(){const n=e.getReader();try{for(;;){const{value:r,done:i}=yield so(n.read());if(i)return yield so(void 0);yield yield so(r)}}finally{n.releaseLock()}})}function K(e){return or(e?.getReader)}function te(e){if(e instanceof Nn)return e;if(null!=e){if(Vr(e))return function ce(e){return new Nn(t=>{const n=e[Tt]();if(or(n.subscribe))return n.subscribe(t);throw new TypeError("Provided object does not correctly implement Symbol.observable")})}(e);if(ao(e))return function ge(e){return new Nn(t=>{for(let n=0;n{e.then(n=>{t.closed||(t.next(n),t.complete())},n=>t.error(n)).then(null,Ni)})}(e);if(pi(e))return xe(e);if(V(e))return function ue(e){return new Nn(t=>{for(const n of e)if(t.next(n),t.closed)return;t.complete()})}(e);if(K(e))return function Me(e){return xe($(e))}(e)}throw mi(e)}function xe(e){return new Nn(t=>{(function je(e,t){var n,r,i,o;return function ps(e,t,n,r){return new(n||(n=Promise))(function(o,c){function d(E){try{v(r.next(E))}catch(D){c(D)}}function p(E){try{v(r.throw(E))}catch(D){c(D)}}function v(E){E.done?o(E.value):function i(o){return o instanceof n?o:new n(function(c){c(o)})}(E.value).then(d,p)}v((r=r.apply(e,t||[])).next())})}(this,void 0,void 0,function*(){try{for(n=oa(e);!(r=yield n.next()).done;)if(t.next(r.value),t.closed)return}catch(c){i={error:c}}finally{try{r&&!r.done&&(o=n.return)&&(yield o.call(n))}finally{if(i)throw i.error}}t.complete()})})(e,t).catch(n=>t.error(n))})}function Ie(e,t,n,r=0,i=!1){const o=t.schedule(function(){n(),i?e.add(this.schedule(null,r)):this.unsubscribe()},r);if(e.add(o),!i)return o}function dt(e,t,n=1/0){return or(t)?dt((r,i)=>Pe((o,c)=>t(r,o,i,c))(te(e(r,i))),n):("number"==typeof t&&(n=t),mr((r,i)=>function Dt(e,t,n,r,i,o,c,d){const p=[];let v=0,E=0,D=!1;const I=()=>{D&&!p.length&&!v&&t.complete()},P=G=>v{o&&t.next(G),v++;let U=!1;te(n(G,E++)).subscribe(Qn(t,Z=>{i?.(Z),o?P(Z):t.next(Z)},()=>{U=!0},void 0,()=>{if(U)try{for(v--;p.length&&vN(Z)):N(Z)}I()}catch(Z){t.error(Z)}}))};return e.subscribe(Qn(t,P,()=>{D=!0,I()})),()=>{d?.()}}(r,i,e,n)))}function ft(e=1/0){return dt(qr,e)}const xt=new Nn(e=>e.complete());function nn(e){return e&&or(e.schedule)}function an(e){return e[e.length-1]}function sr(e){return nn(an(e))?e.pop():void 0}function kr(e,t=0){return mr((n,r)=>{n.subscribe(Qn(r,i=>Ie(r,e,()=>r.next(i),t),()=>Ie(r,e,()=>r.complete(),t),i=>Ie(r,e,()=>r.error(i),t)))})}function Ua(e,t=0){return mr((n,r)=>{r.add(e.schedule(()=>n.subscribe(r),t))})}function ja(e,t){if(!e)throw new Error("Iterable cannot be null");return new Nn(n=>{Ie(n,t,()=>{const r=e[Symbol.asyncIterator]();Ie(n,t,()=>{r.next().then(i=>{i.done?n.complete():n.next(i.value)})},0,!0)})})}function Cr(e,t){return t?function Ou(e,t){if(null!=e){if(Vr(e))return function kf(e,t){return te(e).pipe(Ua(t),kr(t))}(e,t);if(ao(e))return function $a(e,t){return new Nn(n=>{let r=0;return t.schedule(function(){r===e.length?n.complete():(n.next(e[r++]),n.closed||this.schedule())})})}(e,t);if(Zr(e))return function Pf(e,t){return te(e).pipe(Ua(t),kr(t))}(e,t);if(pi(e))return ja(e,t);if(V(e))return function Fu(e,t){return new Nn(n=>{let r;return Ie(n,t,()=>{r=e[J](),Ie(n,t,()=>{let i,o;try{({value:i,done:o}=r.next())}catch(c){return void n.error(c)}o?n.complete():n.next(i)},0,!0)}),()=>or(r?.return)&&r.return()})}(e,t);if(K(e))return function aa(e,t){return ja($(e),t)}(e,t)}throw mi(e)}(e,t):te(e)}function Bl(e,t,...n){if(!0===t)return void e();if(!1===t)return;const r=new ro({next:()=>{r.unsubscribe(),e()}});return t(...n).subscribe(r)}function Bn(e){for(let t in e)if(e[t]===Bn)return t;throw Error("Could not find renamed property on target object.")}function Mn(e){if("string"==typeof e)return e;if(Array.isArray(e))return"["+e.map(Mn).join(", ")+"]";if(null==e)return""+e;if(e.overriddenName)return`${e.overriddenName}`;if(e.name)return`${e.name}`;const t=e.toString();if(null==t)return""+t;const n=t.indexOf("\n");return-1===n?t:t.substring(0,n)}function Lu(e,t){return null==e||""===e?null===t?"":t:null==t||""===t?e:e+" "+t}const Rf=Bn({__forward_ref__:Bn});function Yn(e){return e.__forward_ref__=Yn,e.toString=function(){return Mn(this())},e}function Mt(e){return function Vl(e){return"function"==typeof e&&e.hasOwnProperty(Rf)&&e.__forward_ref__===Yn}(e)?e():e}class nt extends Error{constructor(t,n){super(function wn(e,t){return`NG0${Math.abs(e)}${t?": "+t.trim():""}`}(t,n)),this.code=t}}function $t(e){return"string"==typeof e?e:null==e?"":String(e)}function Nu(e,t){throw new nt(-201,!1)}function Ui(e,t){null==e&&function Rn(e,t,n,r){throw new Error(`ASSERTION ERROR: ${e}`+(null==r?"":` [Expected=> ${n} ${r} ${t} <=Actual]`))}(t,e,null,"!=")}function Ot(e){return{token:e.token,providedIn:e.providedIn||null,factory:e.factory,value:void 0}}function Ei(e){return{providers:e.providers||[],imports:e.imports||[]}}function Uu(e){return Nc(e,gn)||Nc(e,ju)}function Nc(e,t){return e.hasOwnProperty(t)?e[t]:null}function Ha(e){return e&&(e.hasOwnProperty($u)||e.hasOwnProperty(Ga))?e[$u]:null}const gn=Bn({\u0275prov:Bn}),$u=Bn({\u0275inj:Bn}),ju=Bn({ngInjectableDef:Bn}),Ga=Bn({ngInjectorDef:Bn});var Rt=(()=>((Rt=Rt||{})[Rt.Default=0]="Default",Rt[Rt.Host=1]="Host",Rt[Rt.Self=2]="Self",Rt[Rt.SkipSelf=4]="SkipSelf",Rt[Rt.Optional=8]="Optional",Rt))();let la;function lo(e){const t=la;return la=e,t}function Hu(e,t,n){const r=Uu(e);return r&&"root"==r.providedIn?void 0===r.value?r.value=r.factory():r.value:n&Rt.Optional?null:void 0!==t?t:void Nu(Mn(e))}function Wo(e){return{toString:e}.toString()}var Xo=(()=>((Xo=Xo||{})[Xo.OnPush=0]="OnPush",Xo[Xo.Default=1]="Default",Xo))(),ms=(()=>{return(e=ms||(ms={}))[e.Emulated=0]="Emulated",e[e.None=2]="None",e[e.ShadowDom=3]="ShadowDom",ms;var e})();const er=(()=>typeof globalThis<"u"&&globalThis||typeof global<"u"&&global||typeof window<"u"&&window||typeof self<"u"&&typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&self)(),ca={},Cn=[],qa=Bn({\u0275cmp:Bn}),zc=Bn({\u0275dir:Bn}),Bc=Bn({\u0275pipe:Bn}),id=Bn({\u0275mod:Bn}),To=Bn({\u0275fac:Bn}),ua=Bn({__NG_ELEMENT_ID__:Bn});let Ao=0;function Vs(e){return Wo(()=>{const n=!0===e.standalone,r={},i={type:e.type,providersResolver:null,decls:e.decls,vars:e.vars,factory:null,template:e.template||null,consts:e.consts||null,ngContentSelectors:e.ngContentSelectors,hostBindings:e.hostBindings||null,hostVars:e.hostVars||0,hostAttrs:e.hostAttrs||null,contentQueries:e.contentQueries||null,declaredInputs:r,inputs:null,outputs:null,exportAs:e.exportAs||null,onPush:e.changeDetection===Xo.OnPush,directiveDefs:null,pipeDefs:null,standalone:n,dependencies:n&&e.dependencies||null,getStandaloneInjector:null,selectors:e.selectors||Cn,viewQuery:e.viewQuery||null,features:e.features||null,data:e.data||{},encapsulation:e.encapsulation||ms.Emulated,id:"c"+Ao++,styles:e.styles||Cn,_:null,setInput:null,schemas:e.schemas||null,tView:null},o=e.dependencies,c=e.features;return i.inputs=zf(e.inputs,r),i.outputs=zf(e.outputs),c&&c.forEach(d=>d(i)),i.directiveDefs=o?()=>("function"==typeof o?o():o).map(sd).filter(Za):null,i.pipeDefs=o?()=>("function"==typeof o?o():o).map(kt).filter(Za):null,i})}function sd(e){return Nt(e)||Xr(e)}function Za(e){return null!==e}function ai(e){return Wo(()=>({type:e.type,bootstrap:e.bootstrap||Cn,declarations:e.declarations||Cn,imports:e.imports||Cn,exports:e.exports||Cn,transitiveCompileScopes:null,schemas:e.schemas||null,id:e.id||null}))}function zf(e,t){if(null==e)return ca;const n={};for(const r in e)if(e.hasOwnProperty(r)){let i=e[r],o=i;Array.isArray(i)&&(o=i[1],i=i[0]),n[i]=r,t&&(t[i]=o)}return n}const Lt=Vs;function $i(e){return{type:e.type,name:e.name,factory:null,pure:!1!==e.pure,standalone:!0===e.standalone,onDestroy:e.type.prototype.ngOnDestroy||null}}function Nt(e){return e[qa]||null}function Xr(e){return e[zc]||null}function kt(e){return e[Bc]||null}function cn(e,t){const n=e[id]||null;if(!n&&!0===t)throw new Error(`Type ${Mn(e)} does not have '\u0275mod' property.`);return n}function Xe(e){return Array.isArray(e)&&"object"==typeof e[1]}function ho(e){return Array.isArray(e)&&!0===e[1]}function cd(e){return 0!=(8&e.flags)}function Zu(e){return 2==(2&e.flags)}function jl(e){return 1==(1&e.flags)}function ko(e){return null!==e.template}function Uc(e){return 0!=(256&e[2])}function _s(e,t){return e.hasOwnProperty(To)?e[To]:null}class wt{constructor(t,n,r){this.previousValue=t,this.currentValue=n,this.firstChange=r}isFirstChange(){return this.firstChange}}function yt(){return Qa}function Qa(e){return e.type.prototype.ngOnChanges&&(e.setInput=md),pd}function pd(){const e=jc(this),t=e?.current;if(t){const n=e.previous;if(n===ca)e.previous=t;else for(let r in t)n[r]=t[r];e.current=null,this.ngOnChanges(t)}}function md(e,t,n,r){const i=jc(e)||function Ko(e,t){return e[Di]=t}(e,{previous:ca,current:null}),o=i.current||(i.current={}),c=i.previous,d=this.declaredInputs[n],p=c[d];o[d]=new wt(p&&p.currentValue,t,c===ca),e[r]=t}yt.ngInherit=!0;const Di="__ngSimpleChanges__";function jc(e){return e[Di]||null}function Sr(e){for(;Array.isArray(e);)e=e[0];return e}function Si(e,t){return Sr(t[e.index])}function Zl(e,t){return e.data[t]}function Mi(e,t){const n=t[e];return Xe(n)?n:n[0]}function Wl(e){return 64==(64&e[2])}function vs(e,t){return null==t?null:e[t]}function Hs(e){e[18]=0}function Xl(e,t){e[5]+=t;let n=e,r=e[3];for(;null!==r&&(1===t&&1===n[5]||-1===t&&0===n[5]);)r[5]+=t,n=r,r=r[3]}const Vt={lFrame:ie(null),bindingsEnabled:!0};function qc(){return Vt.bindingsEnabled}function He(){return Vt.lFrame.lView}function en(){return Vt.lFrame.tView}function ma(e){return Vt.lFrame.contextLView=e,e[8]}function Gs(e){return Vt.lFrame.contextLView=null,e}function Pr(){let e=ih();for(;null!==e&&64===e.type;)e=e.parent;return e}function ih(){return Vt.lFrame.currentTNode}function bs(e,t){const n=Vt.lFrame;n.currentTNode=e,n.isParent=t}function wd(){return Vt.lFrame.isParent}function h(){const e=Vt.lFrame;let t=e.bindingRootIndex;return-1===t&&(t=e.bindingRootIndex=e.tView.bindingStartIndex),t}function w(){return Vt.lFrame.bindingIndex++}function R(e,t){const n=Vt.lFrame;n.bindingIndex=n.bindingRootIndex=e,L(t)}function L(e){Vt.lFrame.currentDirectiveIndex=e}function Q(){return Vt.lFrame.currentQueryIndex}function ee(e){Vt.lFrame.currentQueryIndex=e}function Y(e){const t=e[1];return 2===t.type?t.declTNode:1===t.type?e[6]:null}function ae(e,t,n){if(n&Rt.SkipSelf){let i=t,o=e;for(;!(i=i.parent,null!==i||n&Rt.Host||(i=Y(o),null===i||(o=o[15],10&i.type))););if(null===i)return!1;t=i,e=o}const r=Vt.lFrame=ye();return r.currentTNode=t,r.lView=e,!0}function _e(e){const t=ye(),n=e[1];Vt.lFrame=t,t.currentTNode=n.firstChild,t.lView=e,t.tView=n,t.contextLView=e,t.bindingIndex=n.bindingStartIndex,t.inI18n=!1}function ye(){const e=Vt.lFrame,t=null===e?null:e.child;return null===t?ie(e):t}function ie(e){const t={currentTNode:null,isParent:!0,lView:null,tView:null,selectedIndex:-1,contextLView:null,elementDepthCount:0,currentNamespace:null,currentDirectiveIndex:-1,bindingRootIndex:-1,bindingIndex:-1,currentQueryIndex:0,parent:e,child:null,inI18n:!1};return null!==e&&(e.child=t),t}function we(){const e=Vt.lFrame;return Vt.lFrame=e.parent,e.currentTNode=null,e.lView=null,e}const De=we;function Se(){const e=we();e.isParent=!0,e.tView=null,e.selectedIndex=-1,e.contextLView=null,e.elementDepthCount=0,e.currentDirectiveIndex=-1,e.currentNamespace=null,e.bindingRootIndex=-1,e.bindingIndex=-1,e.currentQueryIndex=0}function Le(){return Vt.lFrame.selectedIndex}function Ne(e){Vt.lFrame.selectedIndex=e}function ht(){Vt.lFrame.currentNamespace="svg"}function Ht(e,t){for(let n=t.directiveStart,r=t.directiveEnd;n=r)break}else t[p]<0&&(e[18]+=65536),(d>11>16&&(3&e[2])===t){e[2]+=2048;try{o.call(d)}finally{}}}else try{o.call(d)}finally{}}class li{constructor(t,n,r){this.factory=t,this.resolving=!1,this.canSeeViewProviders=n,this.injectImpl=r}}function Yr(e,t,n){let r=0;for(;rt){c=o-1;break}}}for(;o>16}(e),r=t;for(;n>0;)r=r[15],n--;return r}let Cd=!0;function Mr(e){const t=Cd;return Cd=e,t}let Ed=0;const _a={};function lh(e,t){const n=Zm(e,t);if(-1!==n)return n;const r=t[1];r.firstCreatePass&&(e.injectorIndex=t.length,Wf(r.data,e),Wf(t,null),Wf(r.blueprint,null));const i=ch(e,t),o=e.injectorIndex;if(ya(i)){const c=Zs(i),d=xs(i,t),p=d[1].data;for(let v=0;v<8;v++)t[o+v]=d[c+v]|p[c+v]}return t[o+8]=i,o}function Wf(e,t){e.push(0,0,0,0,0,0,0,0,t)}function Zm(e,t){return-1===e.injectorIndex||e.parent&&e.parent.injectorIndex===e.injectorIndex||null===t[e.injectorIndex+8]?-1:e.injectorIndex}function ch(e,t){if(e.parent&&-1!==e.parent.injectorIndex)return e.parent.injectorIndex;let n=0,r=null,i=t;for(;null!==i;){if(r=R_(i),null===r)return-1;if(n++,i=i[15],-1!==r.injectorIndex)return r.injectorIndex|n<<16}return-1}function Dd(e,t,n){!function Zf(e,t,n){let r;"string"==typeof n?r=n.charCodeAt(0)||0:n.hasOwnProperty(ua)&&(r=n[ua]),null==r&&(r=n[ua]=Ed++);const i=255&r;t.data[e+(i>>5)]|=1<=0?255&t:Wx:t}(n);if("function"==typeof o){if(!ae(t,e,r))return r&Rt.Host?uh(i,0,r):Oo(t,n,r,i);try{const c=o(r);if(null!=c||r&Rt.Optional)return c;Nu()}finally{De()}}else if("number"==typeof o){let c=null,d=Zm(e,t),p=-1,v=r&Rt.Host?t[16][6]:null;for((-1===d||r&Rt.SkipSelf)&&(p=-1===d?ch(e,t):t[d+8],-1!==p&&Kl(r,!1)?(c=t[1],d=Zs(p),t=xs(p,t)):d=-1);-1!==d;){const E=t[1];if(Ym(o,d,E.data)){const D=Zx(d,t,n,c,r,v);if(D!==_a)return D}p=t[d+8],-1!==p&&Kl(r,t[1].data[d+8]===v)&&Ym(o,d,t)?(c=E,d=Zs(p),t=xs(p,t)):d=-1}}return i}function Zx(e,t,n,r,i,o){const c=t[1],d=c.data[e+8],E=Xf(d,c,n,null==r?Zu(d)&&Cd:r!=c&&0!=(3&d.type),i&Rt.Host&&o===d);return null!==E?nl(t,c,E,d):_a}function Xf(e,t,n,r,i){const o=e.providerIndexes,c=t.data,d=1048575&o,p=e.directiveStart,E=o>>20,I=i?d+E:e.directiveEnd;for(let P=r?d:d+E;P=p&&N.type===n)return P}if(i){const P=c[p];if(P&&ko(P)&&P.type===n)return p}return null}function nl(e,t,n,r){let i=e[n];const o=t.data;if(function Ii(e){return e instanceof li}(i)){const c=i;c.resolving&&function Xh(e,t){const n=t?`. Dependency path: ${t.join(" > ")} > ${e}`:"";throw new nt(-200,`Circular dependency in DI detected for ${e}${n}`)}(function yn(e){return"function"==typeof e?e.name||e.toString():"object"==typeof e&&null!=e&&"function"==typeof e.type?e.type.name||e.type.toString():$t(e)}(o[n]));const d=Mr(c.canSeeViewProviders);c.resolving=!0;const p=c.injectImpl?lo(c.injectImpl):null;ae(e,r,Rt.Default);try{i=e[n]=c.factory(void 0,o,e,r),t.firstCreatePass&&n>=r.directiveStart&&function An(e,t,n){const{ngOnChanges:r,ngOnInit:i,ngDoCheck:o}=t.type.prototype;if(r){const c=Qa(t);(n.preOrderHooks||(n.preOrderHooks=[])).push(e,c),(n.preOrderCheckHooks||(n.preOrderCheckHooks=[])).push(e,c)}i&&(n.preOrderHooks||(n.preOrderHooks=[])).push(0-e,i),o&&((n.preOrderHooks||(n.preOrderHooks=[])).push(e,o),(n.preOrderCheckHooks||(n.preOrderCheckHooks=[])).push(e,o))}(n,o[n],t)}finally{null!==p&&lo(p),Mr(d),c.resolving=!1,De()}}return i}function Ym(e,t,n){return!!(n[t+(e>>5)]&1<{const r=function Jm(e){return function(...n){if(e){const r=e(...n);for(const i in r)this[i]=r[i]}}}(t);function i(...o){if(this instanceof i)return r.apply(this,o),this;const c=new i(...o);return d.annotation=c,d;function d(p,v,E){const D=p.hasOwnProperty(Jl)?p[Jl]:Object.defineProperty(p,Jl,{value:[]})[Jl];for(;D.length<=E;)D.push(null);return(D[E]=D[E]||[]).push(c),p}}return n&&(i.prototype=Object.create(n.prototype)),i.prototype.ngMetadataName=e,i.annotationCls=i,i})}class It{constructor(t,n){this._desc=t,this.ngMetadataName="InjectionToken",this.\u0275prov=void 0,"number"==typeof n?this.__NG_ELEMENT_ID__=n:void 0!==n&&(this.\u0275prov=Ot({token:this,providedIn:n.providedIn||"root",factory:n.factory}))}get multi(){return this}toString(){return`InjectionToken ${this._desc}`}}function go(e,t){void 0===t&&(t=e);for(let n=0;nArray.isArray(n)?rl(n,t):t(n))}function z_(e,t,n){t>=e.length?e.push(n):e.splice(t,0,n)}function ep(e,t){return t>=e.length-1?e.pop():e.splice(t,1)[0]}const il={},np="__NG_DI_FLAG__",rp="ngTempTokenPath",s1=/\n/gm,$_="__source";let Rd;function Xc(e){const t=Rd;return Rd=e,t}function sg(e,t=Rt.Default){if(void 0===Rd)throw new nt(-203,!1);return null===Rd?Hu(e,void 0,t):Rd.get(e,t&Rt.Optional?null:void 0,t)}function St(e,t=Rt.Default){return(function $l(){return la}()||sg)(Mt(e),t)}function Fr(e,t=Rt.Default){return"number"!=typeof t&&(t=0|(t.optional&&8)|(t.host&&1)|(t.self&&2)|(t.skipSelf&&4)),St(e,t)}function ip(e){const t=[];for(let n=0;n((Wi=Wi||{})[Wi.Important=1]="Important",Wi[Wi.DashCase=2]="DashCase",Wi))();const cp=new Map;let ec=0;const hp="__ngContext__";function ui(e,t){Xe(t)?(e[hp]=t[20],function K_(e){cp.set(e[20],e)}(t)):e[hp]=t}function wg(e,t){return undefined(e,t)}function Ud(e){const t=e[3];return ho(t)?t[3]:t}function _h(e){return rv(e[13])}function $d(e){return rv(e[4])}function rv(e){for(;null!==e&&!ho(e);)e=e[4];return e}function nc(e,t,n,r,i){if(null!=r){let o,c=!1;ho(r)?o=r:Xe(r)&&(c=!0,r=r[0]);const d=Sr(r);0===e&&null!==n?null==i?Ig(t,n,d):oc(t,n,d,i||null,!0):1===e&&null!==n?oc(t,n,d,i||null,!0):2===e?function qd(e,t,n){const r=vh(e,t);r&&function yp(e,t,n,r){e.removeChild(t,n,r)}(e,r,t,n)}(t,d,c):3===e&&t.destroyNode(d),null!=o&&function k1(e,t,n,r,i){const o=n[7];o!==Sr(n)&&nc(t,e,r,o,i);for(let d=10;d0&&(e[n-1][4]=r[4]);const o=ep(e,10+t);!function mp(e,t){sl(e,t,t[11],2,null,null),t[0]=null,t[6]=null}(r[1],r);const c=o[19];null!==c&&c.detachView(o[1]),r[3]=null,r[4]=null,r[2]&=-65}return r}function br(e,t){if(!(128&t[2])){const n=t[11];n.destroyNode&&sl(e,t,n,3,null,null),function M1(e){let t=e[13];if(!t)return ic(e[1],e);for(;t;){let n=null;if(Xe(t))n=t[13];else{const r=t[10];r&&(n=r)}if(!n){for(;t&&!t[4]&&t!==e;)Xe(t)&&ic(t[1],t),t=t[3];null===t&&(t=e),Xe(t)&&ic(t[1],t),n=t&&t[4]}t=n}}(t)}}function ic(e,t){if(!(128&t[2])){t[2]&=-65,t[2]|=128,function lv(e,t){let n;if(null!=e&&null!=(n=e.destroyHooks))for(let r=0;r=0?r[i=v]():r[i=-v].unsubscribe(),o+=2}else{const c=r[i=n[o+1]];n[o].call(c)}if(null!==r){for(let o=i+1;o{const c=o;zg(c,n,[],r)&&(i||(i=[]),i.push(c))}),void 0!==i&&uv(i,n),n}function uv(e,t){for(let n=0;n{t.push(o)})}}function zg(e,t,n,r){if(!(e=Mt(e)))return!1;let i=null,o=Ha(e);const c=!o&&Nt(e);if(o||c){if(c&&!c.standalone)return!1;i=e}else{const p=e.ngModule;if(o=Ha(p),!o)return!1;i=p}const d=r.has(i);if(c){if(d)return!1;if(r.add(i),c.dependencies){const p="function"==typeof c.dependencies?c.dependencies():c.dependencies;for(const v of p)zg(v,t,n,r)}}else{if(!o)return!1;{if(null!=o.imports&&!d){let v;r.add(i);try{rl(o.imports,E=>{zg(E,t,n,r)&&(v||(v=[]),v.push(E))})}finally{}void 0!==v&&uv(v,t)}if(!d){const v=_s(i)||(()=>new i);t.push({provide:i,useFactory:v,deps:Cn},{provide:Og,useValue:i,multi:!0},{provide:Wd,useValue:()=>St(i),multi:!0})}const p=o.providers;null==p||d||rl(p,E=>{t.push(E)})}}return i!==e&&void 0!==e.providers}const F1=Bn({provide:String,useValue:Bn});function Bg(e){return null!==e&&"object"==typeof e&&F1 in e}function eu(e){return"function"==typeof e}const wh=new It("Set Injector scope."),Xd={},bo={};let Ss;function ac(){return void 0===Ss&&(Ss=new wp),Ss}class Ms{}class Vg extends Ms{constructor(t,n,r,i){super(),this.parent=n,this.source=r,this.scopes=i,this.records=new Map,this._ngOnDestroyHooks=new Set,this._onDestroyHooks=[],this._destroyed=!1,O1(t,c=>this.processProvider(c)),this.records.set(xa,Cp(void 0,this)),i.has("environment")&&this.records.set(Ms,Cp(void 0,this));const o=this.records.get(wh);null!=o&&"string"==typeof o.value&&this.scopes.add(o.value),this.injectorDefTypes=new Set(this.get(Og.multi,Cn,Rt.Self))}get destroyed(){return this._destroyed}destroy(){this.assertNotDestroyed(),this._destroyed=!0;try{for(const t of this._ngOnDestroyHooks)t.ngOnDestroy();for(const t of this._onDestroyHooks)t()}finally{this.records.clear(),this._ngOnDestroyHooks.clear(),this.injectorDefTypes.clear(),this._onDestroyHooks.length=0}}onDestroy(t){this._onDestroyHooks.push(t)}runInContext(t){this.assertNotDestroyed();const n=Xc(this),r=lo(void 0);try{return t()}finally{Xc(n),lo(r)}}get(t,n=il,r=Rt.Default){this.assertNotDestroyed();const i=Xc(this),o=lo(void 0);try{if(!(r&Rt.SkipSelf)){let d=this.records.get(t);if(void 0===d){const p=function L6(e){return"function"==typeof e||"object"==typeof e&&e instanceof It}(t)&&Uu(t);d=p&&this.injectableDefInScope(p)?Cp(cl(t),Xd):null,this.records.set(t,d)}if(null!=d)return this.hydrate(t,d)}return(r&Rt.Self?ac():this.parent).get(t,n=r&Rt.Optional&&n===il?null:n)}catch(c){if("NullInjectorError"===c.name){if((c[rp]=c[rp]||[]).unshift(Mn(t)),i)throw c;return function c1(e,t,n,r){const i=e[rp];throw t[$_]&&i.unshift(t[$_]),e.message=function j_(e,t,n,r=null){e=e&&"\n"===e.charAt(0)&&"\u0275"==e.charAt(1)?e.slice(2):e;let i=Mn(t);if(Array.isArray(t))i=t.map(Mn).join(" -> ");else if("object"==typeof t){let o=[];for(let c in t)if(t.hasOwnProperty(c)){let d=t[c];o.push(c+":"+("string"==typeof d?JSON.stringify(d):Mn(d)))}i=`{${o.join(", ")}}`}return`${n}${r?"("+r+")":""}[${i}]: ${e.replace(s1,"\n ")}`}("\n"+e.message,i,n,r),e.ngTokenPath=i,e[rp]=null,e}(c,t,"R3InjectorError",this.source)}throw c}finally{lo(o),Xc(i)}}resolveInjectorInitializers(){const t=Xc(this),n=lo(void 0);try{const r=this.get(Wd.multi,Cn,Rt.Self);for(const i of r)i()}finally{Xc(t),lo(n)}}toString(){const t=[],n=this.records;for(const r of n.keys())t.push(Mn(r));return`R3Injector[${t.join(", ")}]`}assertNotDestroyed(){if(this._destroyed)throw new nt(205,!1)}processProvider(t){let n=eu(t=Mt(t))?t:Mt(t&&t.provide);const r=function R6(e){return Bg(e)?Cp(void 0,e.useValue):Cp(function F2(e,t,n){let r;if(eu(e)){const i=Mt(e);return _s(i)||cl(i)}if(Bg(e))r=()=>Mt(e.useValue);else if(function dv(e){return!(!e||!e.useFactory)}(e))r=()=>e.useFactory(...ip(e.deps||[]));else if(function hv(e){return!(!e||!e.useExisting)}(e))r=()=>St(Mt(e.useExisting));else{const i=Mt(e&&(e.useClass||e.provide));if(!function F6(e){return!!e.deps}(e))return _s(i)||cl(i);r=()=>new i(...ip(e.deps))}return r}(e),Xd)}(t);if(eu(t)||!0!==t.multi)this.records.get(n);else{let i=this.records.get(n);i||(i=Cp(void 0,Xd,!0),i.factory=()=>ip(i.multi),this.records.set(n,i)),n=t,i.multi.push(t)}this.records.set(n,r)}hydrate(t,n){return n.value===Xd&&(n.value=bo,n.value=n.factory()),"object"==typeof n.value&&n.value&&function O6(e){return null!==e&&"object"==typeof e&&"function"==typeof e.ngOnDestroy}(n.value)&&this._ngOnDestroyHooks.add(n.value),n.value}injectableDefInScope(t){if(!t.providedIn)return!1;const n=Mt(t.providedIn);return"string"==typeof n?"any"===n||this.scopes.has(n):this.injectorDefTypes.has(n)}}function cl(e){const t=Uu(e),n=null!==t?t.factory:_s(e);if(null!==n)return n;if(e instanceof It)throw new nt(204,!1);if(e instanceof Function)return function P6(e){const t=e.length;if(t>0)throw function Ad(e,t){const n=[];for(let r=0;rn.factory(e):()=>new e}(e);throw new nt(204,!1)}function Cp(e,t,n=!1){return{factory:e,value:t,multi:n?[]:void 0}}function N6(e){return!!e.\u0275providers}function O1(e,t){for(const n of e)Array.isArray(n)?O1(n,t):N6(n)?O1(n.\u0275providers,t):t(n)}class O2{}class V6{resolveComponentFactory(t){throw function B6(e){const t=Error(`No component factory found for ${Mn(e)}. Did you add it to @NgModule.entryComponents?`);return t.ngComponent=e,t}(t)}}let Ug=(()=>{class e{}return e.NULL=new V6,e})();function U6(){return Ep(Pr(),He())}function Ep(e,t){return new Xs(Si(e,t))}let Xs=(()=>{class e{constructor(n){this.nativeElement=n}}return e.__NG_ELEMENT_ID__=U6,e})();function $6(e){return e instanceof Xs?e.nativeElement:e}class N2{}let ul=(()=>{class e{}return e.__NG_ELEMENT_ID__=()=>function j6(){const e=He(),n=Mi(Pr().index,e);return(Xe(n)?n:e)[11]}(),e})(),H6=(()=>{class e{}return e.\u0275prov=Ot({token:e,providedIn:"root",factory:()=>null}),e})();class $g{constructor(t){this.full=t,this.major=t.split(".")[0],this.minor=t.split(".")[1],this.patch=t.split(".").slice(2).join(".")}}const G6=new $g("14.3.0"),L1={};function z1(e){return e.ngOriginalError}class Dp{constructor(){this._console=console}handleError(t){const n=this._findOriginalError(t);this._console.error("ERROR",t),n&&this._console.error("ORIGINAL ERROR",n)}_findOriginalError(t){let n=t&&z1(t);for(;n&&z1(n);)n=z1(n);return n||null}}function tu(e){return e instanceof Function?e():e}function B2(e,t,n){let r=e.length;for(;;){const i=e.indexOf(t,n);if(-1===i)return i;if(0===i||e.charCodeAt(i-1)<=32){const o=t.length;if(i+o===r||e.charCodeAt(i+o)<=32)return i}n=i+1}}const V2="ng-template";function nz(e,t,n){let r=0;for(;ro?"":i[D+1].toLowerCase();const P=8&r?I:null;if(P&&-1!==B2(P,v,0)||2&r&&v!==I){if(hl(r))return!1;c=!0}}}}else{if(!c&&!hl(r)&&!hl(p))return!1;if(c&&hl(p))continue;c=!1,r=p|1&r}}return hl(r)||c}function hl(e){return 0==(1&e)}function oz(e,t,n,r){if(null===t)return-1;let i=0;if(r||!n){let o=!1;for(;i-1)for(n++;n0?'="'+d+'"':"")+"]"}else 8&r?i+="."+c:4&r&&(i+=" "+c);else""!==i&&!hl(c)&&(t+=j2(o,i),i=""),r=c,o=o||!hl(r);n++}return""!==i&&(t+=j2(o,i)),t}const tn={};function xo(e){H2(en(),He(),Le()+e,!1)}function H2(e,t,n,r){if(!r)if(3==(3&t[2])){const o=e.preOrderCheckHooks;null!==o&&on(t,o,n)}else{const o=e.preOrderHooks;null!==o&&Fn(t,o,0,n)}Ne(n)}function W2(e,t=null,n=null,r){const i=X2(e,t,n,r);return i.resolveInjectorInitializers(),i}function X2(e,t=null,n=null,r,i=new Set){const o=[n||Cn,Lg(e)];return r=r||("object"==typeof e?void 0:Mn(e)),new Vg(o,t||ac(),r||null,i)}let Ys=(()=>{class e{static create(n,r){if(Array.isArray(n))return W2({name:""},r,n,"");{const i=n.name??"";return W2({name:i},n.parent,n.providers,i)}}}return e.THROW_IF_NOT_FOUND=il,e.NULL=new wp,e.\u0275prov=Ot({token:e,providedIn:"any",factory:()=>St(xa)}),e.__NG_ELEMENT_ID__=-1,e})();function qe(e,t=Rt.Default){const n=He();return null===n?St(e,t):Xm(Pr(),n,Mt(e),t)}function j1(){throw new Error("invalid")}function dM(e,t){const n=e.contentQueries;if(null!==n)for(let r=0;r22&&H2(e,t,22,!1),n(r,i)}finally{Ne(o)}}function nw(e,t,n){!qc()||(function Kz(e,t,n,r){const i=n.directiveStart,o=n.directiveEnd;e.firstCreatePass||lh(n,t),ui(r,t);const c=n.initialInputs;for(let d=i;d0;){const n=e[--t];if("number"==typeof n&&n<0)return n}return 0})(d)!=p&&d.push(p),d.push(r,i,c)}}function xM(e,t){null!==e.hostBindings&&e.hostBindings(1,t)}function wM(e,t){t.flags|=2,(e.components||(e.components=[])).push(t.index)}function t8(e,t,n){if(n){if(t.exportAs)for(let r=0;r0&&aw(n)}}function aw(e){for(let r=_h(e);null!==r;r=$d(r))for(let i=10;i0&&aw(o)}const n=e[1].components;if(null!==n)for(let r=0;r0&&aw(i)}}function l8(e,t){const n=Mi(t,e),r=n[1];(function c8(e,t){for(let n=t.length;n-1&&(jd(t,r),ep(n,r))}this._attachedToViewContainer=!1}br(this._lView[1],this._lView)}onDestroy(t){gM(this._lView[1],this._lView,null,t)}markForCheck(){lw(this._cdRefInjectingView||this._lView)}detach(){this._lView[2]&=-65}reattach(){this._lView[2]|=64}detectChanges(){bv(this._lView[1],this._lView,this.context)}checkNoChanges(){}attachToViewContainerRef(){if(this._appRef)throw new nt(902,!1);this._attachedToViewContainer=!0}detachFromAppRef(){this._appRef=null,function S1(e,t){sl(e,t,t[11],2,null,null)}(this._lView[1],this._lView)}attachToAppRef(t){if(this._attachedToViewContainer)throw new nt(902,!1);this._appRef=t}}class u8 extends jg{constructor(t){super(t),this._view=t}detectChanges(){const t=this._view;bv(t[1],t,t[8],!1)}checkNoChanges(){}get context(){return null}}class hw extends Ug{constructor(t){super(),this.ngModule=t}resolveComponentFactory(t){const n=Nt(t);return new Hg(n,this.ngModule)}}function AM(e){const t=[];for(let n in e)e.hasOwnProperty(n)&&t.push({propName:e[n],templateName:n});return t}class d8{constructor(t,n){this.injector=t,this.parentInjector=n}get(t,n,r){const i=this.injector.get(t,L1,r);return i!==L1||n===L1?i:this.parentInjector.get(t,n,r)}}class Hg extends O2{constructor(t,n){super(),this.componentDef=t,this.ngModule=n,this.componentType=t.type,this.selector=function hz(e){return e.map(uz).join(",")}(t.selectors),this.ngContentSelectors=t.ngContentSelectors?t.ngContentSelectors:[],this.isBoundToModule=!!n}get inputs(){return AM(this.componentDef.inputs)}get outputs(){return AM(this.componentDef.outputs)}create(t,n,r,i){let o=(i=i||this.ngModule)instanceof Ms?i:i?.injector;o&&null!==this.componentDef.getStandaloneInjector&&(o=this.componentDef.getStandaloneInjector(o)||o);const c=o?new d8(t,o):t,d=c.get(N2,null);if(null===d)throw new nt(407,!1);const p=c.get(H6,null),v=d.createRenderer(null,this.componentDef),E=this.componentDef.selectors[0][0]||"div",D=r?function Gz(e,t,n){return e.selectRootElement(t,n===ms.ShadowDom)}(v,r,this.componentDef.encapsulation):pp(v,E,function h8(e){const t=e.toLowerCase();return"svg"===t?"svg":"math"===t?"math":null}(E)),I=this.componentDef.onPush?288:272,P=iw(0,null,null,1,0,null,null,null,null,null),N=yv(null,P,null,I,null,null,d,v,p,c,null);let G,U;_e(N);try{const Z=function m8(e,t,n,r,i,o){const c=n[1];n[22]=e;const p=Ip(c,22,2,"#host",null),v=p.mergedAttrs=t.hostAttrs;null!==v&&(xv(p,v,!0),null!==e&&(Yr(i,e,v),null!==p.classes&&xh(i,e,p.classes),null!==p.styles&&bp(i,e,p.styles)));const E=r.createRenderer(e,t),D=yv(n,mM(t),null,t.onPush?32:16,n[22],p,r,E,o||null,null,null);return c.firstCreatePass&&(Dd(lh(p,n),c,t.type),wM(c,p),CM(p,n.length,1)),vv(n,D),n[22]=D}(D,this.componentDef,N,d,v);if(D)if(r)Yr(v,D,["ng-version",G6.full]);else{const{attrs:ne,classes:X}=function dz(e){const t=[],n=[];let r=1,i=2;for(;r0&&xh(v,D,X.join(" "))}if(U=Zl(P,22),void 0!==n){const ne=U.projection=[];for(let X=0;Xd(Sr(fe[r.index])):r.index;let re=null;if(!d&&p&&(re=function F8(e,t,n,r){const i=e.cleanup;if(null!=i)for(let o=0;op?d[p]:null}"string"==typeof c&&(o+=2)}return null}(e,t,i,r.index)),null!==re)(re.__ngLastListenerFn__||re).__ngNextListenerFn__=o,re.__ngLastListenerFn__=o,P=!1;else{o=qM(r,t,D,o,!1);const fe=n.listen(Z,i,o);I.push(o,fe),E&&E.push(i,X,ne,ne+1)}}else o=qM(r,t,D,o,!1);const N=r.outputs;let G;if(P&&null!==N&&(G=N[i])){const U=G.length;if(U)for(let Z=0;Z0;)t=t[15],e--;return t}(e,Vt.lFrame.contextLView))[8]}(e)}function Co(e,t=""){const n=He(),r=en(),i=e+22,o=r.firstCreatePass?Ip(r,i,1,t,null):r.data[i],c=n[i]=function rc(e,t){return e.createText(t)}(n[11],t);Hd(r,n,c,o),bs(o,!1)}function Jd(e){return Qd("",e,""),Jd}function Qd(e,t,n){const r=He(),i=function kp(e,t,n,r){return Bo(e,w(),n)?t+$t(n)+r:tn}(r,e,t,n);return i!==tn&&ru(r,Le(),i),Qd}const ef=void 0;var xB=["en",[["a","p"],["AM","PM"],ef],[["AM","PM"],ef,ef],[["S","M","T","W","T","F","S"],["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],["Su","Mo","Tu","We","Th","Fr","Sa"]],ef,[["J","F","M","A","M","J","J","A","S","O","N","D"],["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],["January","February","March","April","May","June","July","August","September","October","November","December"]],ef,[["B","A"],["BC","AD"],["Before Christ","Anno Domini"]],0,[6,0],["M/d/yy","MMM d, y","MMMM d, y","EEEE, MMMM d, y"],["h:mm a","h:mm:ss a","h:mm:ss a z","h:mm:ss a zzzz"],["{1}, {0}",ef,"{1} 'at' {0}",ef],[".",",",";","%","+","-","E","\xd7","\u2030","\u221e","NaN",":"],["#,##0.###","#,##0%","\xa4#,##0.00","#E0"],"USD","$","US Dollar",{},"ltr",function bB(e){const n=Math.floor(Math.abs(e)),r=e.toString().replace(/^[^.]*\.?/,"").length;return 1===n&&0===r?1:5}];let $p={};function is(e){const t=function wB(e){return e.toLowerCase().replace(/_/g,"-")}(e);let n=LI(t);if(n)return n;const r=t.split("-")[0];if(n=LI(r),n)return n;if("en"===r)return xB;throw new nt(701,!1)}function LI(e){return e in $p||($p[e]=er.ng&&er.ng.common&&er.ng.common.locales&&er.ng.common.locales[e]),$p[e]}var vt=(()=>((vt=vt||{})[vt.LocaleId=0]="LocaleId",vt[vt.DayPeriodsFormat=1]="DayPeriodsFormat",vt[vt.DayPeriodsStandalone=2]="DayPeriodsStandalone",vt[vt.DaysFormat=3]="DaysFormat",vt[vt.DaysStandalone=4]="DaysStandalone",vt[vt.MonthsFormat=5]="MonthsFormat",vt[vt.MonthsStandalone=6]="MonthsStandalone",vt[vt.Eras=7]="Eras",vt[vt.FirstDayOfWeek=8]="FirstDayOfWeek",vt[vt.WeekendRange=9]="WeekendRange",vt[vt.DateFormat=10]="DateFormat",vt[vt.TimeFormat=11]="TimeFormat",vt[vt.DateTimeFormat=12]="DateTimeFormat",vt[vt.NumberSymbols=13]="NumberSymbols",vt[vt.NumberFormats=14]="NumberFormats",vt[vt.CurrencyCode=15]="CurrencyCode",vt[vt.CurrencySymbol=16]="CurrencySymbol",vt[vt.CurrencyName=17]="CurrencyName",vt[vt.Currencies=18]="Currencies",vt[vt.Directionality=19]="Directionality",vt[vt.PluralCase=20]="PluralCase",vt[vt.ExtraData=21]="ExtraData",vt))();const jp="en-US";let NI=jp;class tf{}class cT{}class uT extends tf{constructor(t,n){super(),this._parent=n,this._bootstrapComponents=[],this.destroyCbs=[],this.componentFactoryResolver=new hw(this);const r=cn(t);this._bootstrapComponents=tu(r.bootstrap),this._r3Injector=X2(t,n,[{provide:tf,useValue:this},{provide:Ug,useValue:this.componentFactoryResolver}],Mn(t),new Set(["environment"])),this._r3Injector.resolveInjectorInitializers(),this.instance=this._r3Injector.get(t)}get injector(){return this._r3Injector}destroy(){const t=this._r3Injector;!t.destroyed&&t.destroy(),this.destroyCbs.forEach(n=>n()),this.destroyCbs=null}onDestroy(t){this.destroyCbs.push(t)}}class Sw extends cT{constructor(t){super(),this.moduleType=t}create(t){return new uT(this.moduleType,t)}}class xV extends tf{constructor(t,n,r){super(),this.componentFactoryResolver=new hw(this),this.instance=null;const i=new Vg([...t,{provide:tf,useValue:this},{provide:Ug,useValue:this.componentFactoryResolver}],n||ac(),r,new Set(["environment"]));this.injector=i,i.resolveInjectorInitializers()}destroy(){this.injector.destroy()}onDestroy(t){this.injector.onDestroy(t)}}function Pv(e,t,n=null){return new xV(e,t,n).injector}let wV=(()=>{class e{constructor(n){this._injector=n,this.cachedInjectors=new Map}getOrCreateStandaloneInjector(n){if(!n.standalone)return null;if(!this.cachedInjectors.has(n.id)){const r=Ng(0,n.type),i=r.length>0?Pv([r],this._injector,`Standalone[${n.type.name}]`):null;this.cachedInjectors.set(n.id,i)}return this.cachedInjectors.get(n.id)}ngOnDestroy(){try{for(const n of this.cachedInjectors.values())null!==n&&n.destroy()}finally{this.cachedInjectors.clear()}}}return e.\u0275prov=Ot({token:e,providedIn:"environment",factory:()=>new e(St(Ms))}),e})();function hT(e){e.getStandaloneInjector=t=>t.get(wV).getOrCreateStandaloneInjector(e)}function Iw(e,t,n,r){return function _T(e,t,n,r,i,o){const c=t+n;return Bo(e,c,i)?cc(e,c+1,o?r.call(o,i):r(i)):ey(e,c+1)}(He(),h(),e,t,n,r)}function ey(e,t){const n=e[t];return n===tn?void 0:n}function vT(e,t,n,r,i,o,c){const d=t+n;return function Kd(e,t,n,r){const i=Bo(e,t,n);return Bo(e,t+1,r)||i}(e,d,i,o)?cc(e,d+2,c?r.call(c,i,o):r(i,o)):ey(e,d+2)}function Tw(e){return t=>{setTimeout(e,void 0,t)}}const Qr=class GV extends oi{constructor(t=!1){super(),this.__isAsync=t}emit(t){super.next(t)}subscribe(t,n,r){let i=t,o=n||(()=>null),c=r;if(t&&"object"==typeof t){const p=t;i=p.next?.bind(p),o=p.error?.bind(p),c=p.complete?.bind(p)}this.__isAsync&&(o=Tw(o),i&&(i=Tw(i)),c&&(c=Tw(c)));const d=super.subscribe({next:i,error:o,complete:c});return t instanceof _r&&t.add(d),d}};function qV(){return this._results[Yd()]()}class Aw{constructor(t=!1){this._emitDistinctChangesOnly=t,this.dirty=!0,this._results=[],this._changesDetected=!1,this._changes=null,this.length=0,this.first=void 0,this.last=void 0;const n=Yd(),r=Aw.prototype;r[n]||(r[n]=qV)}get changes(){return this._changes||(this._changes=new Qr)}get(t){return this._results[t]}map(t){return this._results.map(t)}filter(t){return this._results.filter(t)}find(t){return this._results.find(t)}reduce(t,n){return this._results.reduce(t,n)}forEach(t){this._results.forEach(t)}some(t){return this._results.some(t)}toArray(){return this._results.slice()}toString(){return this._results.toString()}reset(t,n){const r=this;r.dirty=!1;const i=go(t);(this._changesDetected=!function tg(e,t,n){if(e.length!==t.length)return!1;for(let r=0;r{class e{}return e.__NG_ELEMENT_ID__=XV,e})();const ZV=iu,WV=class extends ZV{constructor(t,n,r){super(),this._declarationLView=t,this._declarationTContainer=n,this.elementRef=r}createEmbeddedView(t,n){const r=this._declarationTContainer.tViews,i=yv(this._declarationLView,r,t,16,null,r.declTNode,null,null,null,null,n||null);i[17]=this._declarationLView[this._declarationTContainer.index];const c=this._declarationLView[19];return null!==c&&(i[19]=c.createEmbeddedView(r)),tw(r,i,t),new jg(i)}};function XV(){return Rv(Pr(),He())}function Rv(e,t){return 4&e.type?new WV(t,e,Ep(e,t)):null}let gl=(()=>{class e{}return e.__NG_ELEMENT_ID__=YV,e})();function YV(){return MT(Pr(),He())}const KV=gl,DT=class extends KV{constructor(t,n,r){super(),this._lContainer=t,this._hostTNode=n,this._hostLView=r}get element(){return Ep(this._hostTNode,this._hostLView)}get injector(){return new va(this._hostTNode,this._hostLView)}get parentInjector(){const t=ch(this._hostTNode,this._hostLView);if(ya(t)){const n=xs(t,this._hostLView),r=Zs(t);return new va(n[1].data[r+8],n)}return new va(null,this._hostLView)}clear(){for(;this.length>0;)this.remove(this.length-1)}get(t){const n=ST(this._lContainer);return null!==n&&n[t]||null}get length(){return this._lContainer.length-10}createEmbeddedView(t,n,r){let i,o;"number"==typeof r?i=r:null!=r&&(i=r.index,o=r.injector);const c=t.createEmbeddedView(n||{},o);return this.insert(c,i),c}createComponent(t,n,r,i,o){const c=t&&!function Td(e){return"function"==typeof e}(t);let d;if(c)d=n;else{const D=n||{};d=D.index,r=D.injector,i=D.projectableNodes,o=D.environmentInjector||D.ngModuleRef}const p=c?t:new Hg(Nt(t)),v=r||this.parentInjector;if(!o&&null==p.ngModule){const I=(c?v:this.parentInjector).get(Ms,null);I&&(o=I)}const E=p.create(v,i,void 0,o);return this.insert(E.hostView,d),E}insert(t,n){const r=t._lView,i=r[1];if(function th(e){return ho(e[3])}(r)){const E=this.indexOf(t);if(-1!==E)this.detach(E);else{const D=r[3],I=new DT(D,D[6],D[3]);I.detach(I.indexOf(t))}}const o=this._adjustIndex(n),c=this._lContainer;!function I1(e,t,n,r){const i=10+r,o=n.length;r>0&&(n[i-1][4]=t),r0)r.push(c[d/2]);else{const v=o[d+1],E=t[-p];for(let D=10;D{class e{constructor(n){this.appInits=n,this.resolve=Ov,this.reject=Ov,this.initialized=!1,this.done=!1,this.donePromise=new Promise((r,i)=>{this.resolve=r,this.reject=i})}runInitializers(){if(this.initialized)return;const n=[],r=()=>{this.done=!0,this.resolve()};if(this.appInits)for(let i=0;i{o.subscribe({complete:d,error:p})});n.push(c)}}Promise.all(n).then(()=>{r()}).catch(i=>{this.reject(i)}),0===n.length&&r(),this.initialized=!0}}return e.\u0275fac=function(n){return new(n||e)(St(Lv,8))},e.\u0275prov=Ot({token:e,factory:e.\u0275fac,providedIn:"root"}),e})();const iy=new It("AppId",{providedIn:"root",factory:function KT(){return`${$w()}${$w()}${$w()}`}});function $w(){return String.fromCharCode(97+Math.floor(25*Math.random()))}const JT=new It("Platform Initializer"),jw=new It("Platform ID",{providedIn:"platform",factory:()=>"unknown"}),QT=new It("appBootstrapListener");let SU=(()=>{class e{log(n){console.log(n)}warn(n){console.warn(n)}}return e.\u0275fac=function(n){return new(n||e)},e.\u0275prov=Ot({token:e,factory:e.\u0275fac,providedIn:"platform"}),e})();const ou=new It("LocaleId",{providedIn:"root",factory:()=>Fr(ou,Rt.Optional|Rt.SkipSelf)||function MU(){return typeof $localize<"u"&&$localize.locale||jp}()});class TU{constructor(t,n){this.ngModuleFactory=t,this.componentFactories=n}}let Hw=(()=>{class e{compileModuleSync(n){return new Sw(n)}compileModuleAsync(n){return Promise.resolve(this.compileModuleSync(n))}compileModuleAndAllComponentsSync(n){const r=this.compileModuleSync(n),o=tu(cn(n).declarations).reduce((c,d)=>{const p=Nt(d);return p&&c.push(new Hg(p)),c},[]);return new TU(r,o)}compileModuleAndAllComponentsAsync(n){return Promise.resolve(this.compileModuleAndAllComponentsSync(n))}clearCache(){}clearCacheFor(n){}getModuleId(n){}}return e.\u0275fac=function(n){return new(n||e)},e.\u0275prov=Ot({token:e,factory:e.\u0275fac,providedIn:"root"}),e})();const PU=(()=>Promise.resolve(0))();function Gw(e){typeof Zone>"u"?PU.then(()=>{e&&e.apply(null,null)}):Zone.current.scheduleMicroTask("scheduleMicrotask",e)}class Ri{constructor({enableLongStackTrace:t=!1,shouldCoalesceEventChangeDetection:n=!1,shouldCoalesceRunChangeDetection:r=!1}){if(this.hasPendingMacrotasks=!1,this.hasPendingMicrotasks=!1,this.isStable=!0,this.onUnstable=new Qr(!1),this.onMicrotaskEmpty=new Qr(!1),this.onStable=new Qr(!1),this.onError=new Qr(!1),typeof Zone>"u")throw new nt(908,!1);Zone.assertZonePatched();const i=this;if(i._nesting=0,i._outer=i._inner=Zone.current,Zone.AsyncStackTaggingZoneSpec){const o=Zone.AsyncStackTaggingZoneSpec;i._inner=i._inner.fork(new o("Angular"))}Zone.TaskTrackingZoneSpec&&(i._inner=i._inner.fork(new Zone.TaskTrackingZoneSpec)),t&&Zone.longStackTraceZoneSpec&&(i._inner=i._inner.fork(Zone.longStackTraceZoneSpec)),i.shouldCoalesceEventChangeDetection=!r&&n,i.shouldCoalesceRunChangeDetection=r,i.lastRequestAnimationFrameId=-1,i.nativeRequestAnimationFrame=function RU(){let e=er.requestAnimationFrame,t=er.cancelAnimationFrame;if(typeof Zone<"u"&&e&&t){const n=e[Zone.__symbol__("OriginalDelegate")];n&&(e=n);const r=t[Zone.__symbol__("OriginalDelegate")];r&&(t=r)}return{nativeRequestAnimationFrame:e,nativeCancelAnimationFrame:t}}().nativeRequestAnimationFrame,function LU(e){const t=()=>{!function OU(e){e.isCheckStableRunning||-1!==e.lastRequestAnimationFrameId||(e.lastRequestAnimationFrameId=e.nativeRequestAnimationFrame.call(er,()=>{e.fakeTopEventTask||(e.fakeTopEventTask=Zone.root.scheduleEventTask("fakeTopEventTask",()=>{e.lastRequestAnimationFrameId=-1,Zw(e),e.isCheckStableRunning=!0,qw(e),e.isCheckStableRunning=!1},void 0,()=>{},()=>{})),e.fakeTopEventTask.invoke()}),Zw(e))}(e)};e._inner=e._inner.fork({name:"angular",properties:{isAngularZone:!0},onInvokeTask:(n,r,i,o,c,d)=>{try{return nA(e),n.invokeTask(i,o,c,d)}finally{(e.shouldCoalesceEventChangeDetection&&"eventTask"===o.type||e.shouldCoalesceRunChangeDetection)&&t(),rA(e)}},onInvoke:(n,r,i,o,c,d,p)=>{try{return nA(e),n.invoke(i,o,c,d,p)}finally{e.shouldCoalesceRunChangeDetection&&t(),rA(e)}},onHasTask:(n,r,i,o)=>{n.hasTask(i,o),r===i&&("microTask"==o.change?(e._hasPendingMicrotasks=o.microTask,Zw(e),qw(e)):"macroTask"==o.change&&(e.hasPendingMacrotasks=o.macroTask))},onHandleError:(n,r,i,o)=>(n.handleError(i,o),e.runOutsideAngular(()=>e.onError.emit(o)),!1)})}(i)}static isInAngularZone(){return typeof Zone<"u"&&!0===Zone.current.get("isAngularZone")}static assertInAngularZone(){if(!Ri.isInAngularZone())throw new nt(909,!1)}static assertNotInAngularZone(){if(Ri.isInAngularZone())throw new nt(909,!1)}run(t,n,r){return this._inner.run(t,n,r)}runTask(t,n,r,i){const o=this._inner,c=o.scheduleEventTask("NgZoneEvent: "+i,t,FU,Ov,Ov);try{return o.runTask(c,n,r)}finally{o.cancelTask(c)}}runGuarded(t,n,r){return this._inner.runGuarded(t,n,r)}runOutsideAngular(t){return this._outer.run(t)}}const FU={};function qw(e){if(0==e._nesting&&!e.hasPendingMicrotasks&&!e.isStable)try{e._nesting++,e.onMicrotaskEmpty.emit(null)}finally{if(e._nesting--,!e.hasPendingMicrotasks)try{e.runOutsideAngular(()=>e.onStable.emit(null))}finally{e.isStable=!0}}}function Zw(e){e.hasPendingMicrotasks=!!(e._hasPendingMicrotasks||(e.shouldCoalesceEventChangeDetection||e.shouldCoalesceRunChangeDetection)&&-1!==e.lastRequestAnimationFrameId)}function nA(e){e._nesting++,e.isStable&&(e.isStable=!1,e.onUnstable.emit(null))}function rA(e){e._nesting--,qw(e)}class NU{constructor(){this.hasPendingMicrotasks=!1,this.hasPendingMacrotasks=!1,this.isStable=!0,this.onUnstable=new Qr,this.onMicrotaskEmpty=new Qr,this.onStable=new Qr,this.onError=new Qr}run(t,n,r){return t.apply(n,r)}runGuarded(t,n,r){return t.apply(n,r)}runOutsideAngular(t){return t()}runTask(t,n,r,i){return t.apply(n,r)}}const iA=new It(""),zv=new It("");let Yw,Ww=(()=>{class e{constructor(n,r,i){this._ngZone=n,this.registry=r,this._pendingCount=0,this._isZoneStable=!0,this._didWork=!1,this._callbacks=[],this.taskTrackingZone=null,Yw||(function zU(e){Yw=e}(i),i.addToWindow(r)),this._watchAngularEvents(),n.run(()=>{this.taskTrackingZone=typeof Zone>"u"?null:Zone.current.get("TaskTrackingZone")})}_watchAngularEvents(){this._ngZone.onUnstable.subscribe({next:()=>{this._didWork=!0,this._isZoneStable=!1}}),this._ngZone.runOutsideAngular(()=>{this._ngZone.onStable.subscribe({next:()=>{Ri.assertNotInAngularZone(),Gw(()=>{this._isZoneStable=!0,this._runCallbacksIfReady()})}})})}increasePendingRequestCount(){return this._pendingCount+=1,this._didWork=!0,this._pendingCount}decreasePendingRequestCount(){if(this._pendingCount-=1,this._pendingCount<0)throw new Error("pending async requests below zero");return this._runCallbacksIfReady(),this._pendingCount}isStable(){return this._isZoneStable&&0===this._pendingCount&&!this._ngZone.hasPendingMacrotasks}_runCallbacksIfReady(){if(this.isStable())Gw(()=>{for(;0!==this._callbacks.length;){let n=this._callbacks.pop();clearTimeout(n.timeoutId),n.doneCb(this._didWork)}this._didWork=!1});else{let n=this.getPendingTasks();this._callbacks=this._callbacks.filter(r=>!r.updateCb||!r.updateCb(n)||(clearTimeout(r.timeoutId),!1)),this._didWork=!0}}getPendingTasks(){return this.taskTrackingZone?this.taskTrackingZone.macroTasks.map(n=>({source:n.source,creationLocation:n.creationLocation,data:n.data})):[]}addCallback(n,r,i){let o=-1;r&&r>0&&(o=setTimeout(()=>{this._callbacks=this._callbacks.filter(c=>c.timeoutId!==o),n(this._didWork,this.getPendingTasks())},r)),this._callbacks.push({doneCb:n,timeoutId:o,updateCb:i})}whenStable(n,r,i){if(i&&!this.taskTrackingZone)throw new Error('Task tracking zone is required when passing an update callback to whenStable(). Is "zone.js/plugins/task-tracking" loaded?');this.addCallback(n,r,i),this._runCallbacksIfReady()}getPendingRequestCount(){return this._pendingCount}registerApplication(n){this.registry.registerApplication(n,this)}unregisterApplication(n){this.registry.unregisterApplication(n)}findProviders(n,r,i){return[]}}return e.\u0275fac=function(n){return new(n||e)(St(Ri),St(Xw),St(zv))},e.\u0275prov=Ot({token:e,factory:e.\u0275fac}),e})(),Xw=(()=>{class e{constructor(){this._applications=new Map}registerApplication(n,r){this._applications.set(n,r)}unregisterApplication(n){this._applications.delete(n)}unregisterAllApplications(){this._applications.clear()}getTestability(n){return this._applications.get(n)||null}getAllTestabilities(){return Array.from(this._applications.values())}getAllRootElements(){return Array.from(this._applications.keys())}findTestabilityInTree(n,r=!0){return Yw?.findTestabilityInTree(this,n,r)??null}}return e.\u0275fac=function(n){return new(n||e)},e.\u0275prov=Ot({token:e,factory:e.\u0275fac,providedIn:"platform"}),e})(),Dh=null;const oA=new It("AllowMultipleToken"),Kw=new It("PlatformDestroyListeners");class sA{constructor(t,n){this.name=t,this.token=n}}function lA(e,t,n=[]){const r=`Platform: ${t}`,i=new It(r);return(o=[])=>{let c=Jw();if(!c||c.injector.get(oA,!1)){const d=[...n,...o,{provide:i,useValue:!0}];e?e(d):function UU(e){if(Dh&&!Dh.get(oA,!1))throw new nt(400,!1);Dh=e;const t=e.get(uA);(function aA(e){const t=e.get(JT,null);t&&t.forEach(n=>n())})(e)}(function cA(e=[],t){return Ys.create({name:t,providers:[{provide:wh,useValue:"platform"},{provide:Kw,useValue:new Set([()=>Dh=null])},...e]})}(d,r))}return function jU(e){const t=Jw();if(!t)throw new nt(401,!1);return t}()}}function Jw(){return Dh?.get(uA)??null}let uA=(()=>{class e{constructor(n){this._injector=n,this._modules=[],this._destroyListeners=[],this._destroyed=!1}bootstrapModuleFactory(n,r){const i=function dA(e,t){let n;return n="noop"===e?new NU:("zone.js"===e?void 0:e)||new Ri(t),n}(r?.ngZone,function hA(e){return{enableLongStackTrace:!1,shouldCoalesceEventChangeDetection:!(!e||!e.ngZoneEventCoalescing)||!1,shouldCoalesceRunChangeDetection:!(!e||!e.ngZoneRunCoalescing)||!1}}(r)),o=[{provide:Ri,useValue:i}];return i.run(()=>{const c=Ys.create({providers:o,parent:this.injector,name:n.moduleType.name}),d=n.create(c),p=d.injector.get(Dp,null);if(!p)throw new nt(402,!1);return i.runOutsideAngular(()=>{const v=i.onError.subscribe({next:E=>{p.handleError(E)}});d.onDestroy(()=>{Vv(this._modules,d),v.unsubscribe()})}),function fA(e,t,n){try{const r=n();return Zg(r)?r.catch(i=>{throw t.runOutsideAngular(()=>e.handleError(i)),i}):r}catch(r){throw t.runOutsideAngular(()=>e.handleError(r)),r}}(p,i,()=>{const v=d.injector.get(Nv);return v.runInitializers(),v.donePromise.then(()=>(function zI(e){Ui(e,"Expected localeId to be defined"),"string"==typeof e&&(NI=e.toLowerCase().replace(/_/g,"-"))}(d.injector.get(ou,jp)||jp),this._moduleDoBootstrap(d),d))})})}bootstrapModule(n,r=[]){const i=pA({},r);return function BU(e,t,n){const r=new Sw(n);return Promise.resolve(r)}(0,0,n).then(o=>this.bootstrapModuleFactory(o,i))}_moduleDoBootstrap(n){const r=n.injector.get(Bv);if(n._bootstrapComponents.length>0)n._bootstrapComponents.forEach(i=>r.bootstrap(i));else{if(!n.instance.ngDoBootstrap)throw new nt(403,!1);n.instance.ngDoBootstrap(r)}this._modules.push(n)}onDestroy(n){this._destroyListeners.push(n)}get injector(){return this._injector}destroy(){if(this._destroyed)throw new nt(404,!1);this._modules.slice().forEach(r=>r.destroy()),this._destroyListeners.forEach(r=>r());const n=this._injector.get(Kw,null);n&&(n.forEach(r=>r()),n.clear()),this._destroyed=!0}get destroyed(){return this._destroyed}}return e.\u0275fac=function(n){return new(n||e)(St(Ys))},e.\u0275prov=Ot({token:e,factory:e.\u0275fac,providedIn:"platform"}),e})();function pA(e,t){return Array.isArray(t)?t.reduce(pA,e):{...e,...t}}let Bv=(()=>{class e{constructor(n,r,i){this._zone=n,this._injector=r,this._exceptionHandler=i,this._bootstrapListeners=[],this._views=[],this._runningTick=!1,this._stable=!0,this._destroyed=!1,this._destroyListeners=[],this.componentTypes=[],this.components=[],this._onMicrotaskEmptySubscription=this._zone.onMicrotaskEmpty.subscribe({next:()=>{this._zone.run(()=>{this.tick()})}});const o=new Nn(d=>{this._stable=this._zone.isStable&&!this._zone.hasPendingMacrotasks&&!this._zone.hasPendingMicrotasks,this._zone.runOutsideAngular(()=>{d.next(this._stable),d.complete()})}),c=new Nn(d=>{let p;this._zone.runOutsideAngular(()=>{p=this._zone.onStable.subscribe(()=>{Ri.assertNotInAngularZone(),Gw(()=>{!this._stable&&!this._zone.hasPendingMacrotasks&&!this._zone.hasPendingMicrotasks&&(this._stable=!0,d.next(!0))})})});const v=this._zone.onUnstable.subscribe(()=>{Ri.assertInAngularZone(),this._stable&&(this._stable=!1,this._zone.runOutsideAngular(()=>{d.next(!1)}))});return()=>{p.unsubscribe(),v.unsubscribe()}});this.isStable=function zl(...e){const t=sr(e),n=function si(e,t){return"number"==typeof an(e)?e.pop():t}(e,1/0),r=e;return r.length?1===r.length?te(r[0]):ft(n)(Cr(r,t)):xt}(o,c.pipe(function Wh(e={}){const{connector:t=(()=>new oi),resetOnError:n=!0,resetOnComplete:r=!0,resetOnRefCountZero:i=!0}=e;return o=>{let c,d,p,v=0,E=!1,D=!1;const I=()=>{d?.unsubscribe(),d=void 0},P=()=>{I(),c=p=void 0,E=D=!1},N=()=>{const G=c;P(),G?.unsubscribe()};return mr((G,U)=>{v++,!D&&!E&&I();const Z=p=p??t();U.add(()=>{v--,0===v&&!D&&!E&&(d=Bl(N,i))}),Z.subscribe(U),!c&&v>0&&(c=new ro({next:ne=>Z.next(ne),error:ne=>{D=!0,I(),d=Bl(P,n,ne),Z.error(ne)},complete:()=>{E=!0,I(),d=Bl(P,r),Z.complete()}}),te(G).subscribe(c))})(o)}}()))}get destroyed(){return this._destroyed}get injector(){return this._injector}bootstrap(n,r){const i=n instanceof O2;if(!this._injector.get(Nv).done)throw!i&&function Us(e){const t=Nt(e)||Xr(e)||kt(e);return null!==t&&t.standalone}(n),new nt(405,false);let c;c=i?n:this._injector.get(Ug).resolveComponentFactory(n),this.componentTypes.push(c.componentType);const d=function VU(e){return e.isBoundToModule}(c)?void 0:this._injector.get(tf),v=c.create(Ys.NULL,[],r||c.selector,d),E=v.location.nativeElement,D=v.injector.get(iA,null);return D?.registerApplication(E),v.onDestroy(()=>{this.detachView(v.hostView),Vv(this.components,v),D?.unregisterApplication(E)}),this._loadComponent(v),v}tick(){if(this._runningTick)throw new nt(101,!1);try{this._runningTick=!0;for(let n of this._views)n.detectChanges()}catch(n){this._zone.runOutsideAngular(()=>this._exceptionHandler.handleError(n))}finally{this._runningTick=!1}}attachView(n){const r=n;this._views.push(r),r.attachToAppRef(this)}detachView(n){const r=n;Vv(this._views,r),r.detachFromAppRef()}_loadComponent(n){this.attachView(n.hostView),this.tick(),this.components.push(n),this._injector.get(QT,[]).concat(this._bootstrapListeners).forEach(i=>i(n))}ngOnDestroy(){if(!this._destroyed)try{this._destroyListeners.forEach(n=>n()),this._views.slice().forEach(n=>n.destroy()),this._onMicrotaskEmptySubscription.unsubscribe()}finally{this._destroyed=!0,this._views=[],this._bootstrapListeners=[],this._destroyListeners=[]}}onDestroy(n){return this._destroyListeners.push(n),()=>Vv(this._destroyListeners,n)}destroy(){if(this._destroyed)throw new nt(406,!1);const n=this._injector;n.destroy&&!n.destroyed&&n.destroy()}get viewCount(){return this._views.length}warnIfDestroyed(){}}return e.\u0275fac=function(n){return new(n||e)(St(Ri),St(Ms),St(Dp))},e.\u0275prov=Ot({token:e,factory:e.\u0275fac,providedIn:"root"}),e})();function Vv(e,t){const n=e.indexOf(t);n>-1&&e.splice(n,1)}let gA=!0,oy=(()=>{class e{}return e.__NG_ELEMENT_ID__=qU,e})();function qU(e){return function ZU(e,t,n){if(Zu(e)&&!n){const r=Mi(e.index,t);return new jg(r,r)}return 47&e.type?new jg(t[16],t):null}(Pr(),He(),16==(16&e))}class xA{constructor(){}supports(t){return Gg(t)}create(t){return new QU(t)}}const JU=(e,t)=>t;class QU{constructor(t){this.length=0,this._linkedRecords=null,this._unlinkedRecords=null,this._previousItHead=null,this._itHead=null,this._itTail=null,this._additionsHead=null,this._additionsTail=null,this._movesHead=null,this._movesTail=null,this._removalsHead=null,this._removalsTail=null,this._identityChangesHead=null,this._identityChangesTail=null,this._trackByFn=t||JU}forEachItem(t){let n;for(n=this._itHead;null!==n;n=n._next)t(n)}forEachOperation(t){let n=this._itHead,r=this._removalsHead,i=0,o=null;for(;n||r;){const c=!r||n&&n.currentIndex{c=this._trackByFn(i,d),null!==n&&Object.is(n.trackById,c)?(r&&(n=this._verifyReinsertion(n,d,c,i)),Object.is(n.item,d)||this._addIdentityChange(n,d)):(n=this._mismatch(n,d,c,i),r=!0),n=n._next,i++}),this.length=i;return this._truncate(n),this.collection=t,this.isDirty}get isDirty(){return null!==this._additionsHead||null!==this._movesHead||null!==this._removalsHead||null!==this._identityChangesHead}_reset(){if(this.isDirty){let t;for(t=this._previousItHead=this._itHead;null!==t;t=t._next)t._nextPrevious=t._next;for(t=this._additionsHead;null!==t;t=t._nextAdded)t.previousIndex=t.currentIndex;for(this._additionsHead=this._additionsTail=null,t=this._movesHead;null!==t;t=t._nextMoved)t.previousIndex=t.currentIndex;this._movesHead=this._movesTail=null,this._removalsHead=this._removalsTail=null,this._identityChangesHead=this._identityChangesTail=null}}_mismatch(t,n,r,i){let o;return null===t?o=this._itTail:(o=t._prev,this._remove(t)),null!==(t=null===this._unlinkedRecords?null:this._unlinkedRecords.get(r,null))?(Object.is(t.item,n)||this._addIdentityChange(t,n),this._reinsertAfter(t,o,i)):null!==(t=null===this._linkedRecords?null:this._linkedRecords.get(r,i))?(Object.is(t.item,n)||this._addIdentityChange(t,n),this._moveAfter(t,o,i)):t=this._addAfter(new e$(n,r),o,i),t}_verifyReinsertion(t,n,r,i){let o=null===this._unlinkedRecords?null:this._unlinkedRecords.get(r,null);return null!==o?t=this._reinsertAfter(o,t._prev,i):t.currentIndex!=i&&(t.currentIndex=i,this._addToMoves(t,i)),t}_truncate(t){for(;null!==t;){const n=t._next;this._addToRemovals(this._unlink(t)),t=n}null!==this._unlinkedRecords&&this._unlinkedRecords.clear(),null!==this._additionsTail&&(this._additionsTail._nextAdded=null),null!==this._movesTail&&(this._movesTail._nextMoved=null),null!==this._itTail&&(this._itTail._next=null),null!==this._removalsTail&&(this._removalsTail._nextRemoved=null),null!==this._identityChangesTail&&(this._identityChangesTail._nextIdentityChange=null)}_reinsertAfter(t,n,r){null!==this._unlinkedRecords&&this._unlinkedRecords.remove(t);const i=t._prevRemoved,o=t._nextRemoved;return null===i?this._removalsHead=o:i._nextRemoved=o,null===o?this._removalsTail=i:o._prevRemoved=i,this._insertAfter(t,n,r),this._addToMoves(t,r),t}_moveAfter(t,n,r){return this._unlink(t),this._insertAfter(t,n,r),this._addToMoves(t,r),t}_addAfter(t,n,r){return this._insertAfter(t,n,r),this._additionsTail=null===this._additionsTail?this._additionsHead=t:this._additionsTail._nextAdded=t,t}_insertAfter(t,n,r){const i=null===n?this._itHead:n._next;return t._next=i,t._prev=n,null===i?this._itTail=t:i._prev=t,null===n?this._itHead=t:n._next=t,null===this._linkedRecords&&(this._linkedRecords=new wA),this._linkedRecords.put(t),t.currentIndex=r,t}_remove(t){return this._addToRemovals(this._unlink(t))}_unlink(t){null!==this._linkedRecords&&this._linkedRecords.remove(t);const n=t._prev,r=t._next;return null===n?this._itHead=r:n._next=r,null===r?this._itTail=n:r._prev=n,t}_addToMoves(t,n){return t.previousIndex===n||(this._movesTail=null===this._movesTail?this._movesHead=t:this._movesTail._nextMoved=t),t}_addToRemovals(t){return null===this._unlinkedRecords&&(this._unlinkedRecords=new wA),this._unlinkedRecords.put(t),t.currentIndex=null,t._nextRemoved=null,null===this._removalsTail?(this._removalsTail=this._removalsHead=t,t._prevRemoved=null):(t._prevRemoved=this._removalsTail,this._removalsTail=this._removalsTail._nextRemoved=t),t}_addIdentityChange(t,n){return t.item=n,this._identityChangesTail=null===this._identityChangesTail?this._identityChangesHead=t:this._identityChangesTail._nextIdentityChange=t,t}}class e${constructor(t,n){this.item=t,this.trackById=n,this.currentIndex=null,this.previousIndex=null,this._nextPrevious=null,this._prev=null,this._next=null,this._prevDup=null,this._nextDup=null,this._prevRemoved=null,this._nextRemoved=null,this._nextAdded=null,this._nextMoved=null,this._nextIdentityChange=null}}class t${constructor(){this._head=null,this._tail=null}add(t){null===this._head?(this._head=this._tail=t,t._nextDup=null,t._prevDup=null):(this._tail._nextDup=t,t._prevDup=this._tail,t._nextDup=null,this._tail=t)}get(t,n){let r;for(r=this._head;null!==r;r=r._nextDup)if((null===n||n<=r.currentIndex)&&Object.is(r.trackById,t))return r;return null}remove(t){const n=t._prevDup,r=t._nextDup;return null===n?this._head=r:n._nextDup=r,null===r?this._tail=n:r._prevDup=n,null===this._head}}class wA{constructor(){this.map=new Map}put(t){const n=t.trackById;let r=this.map.get(n);r||(r=new t$,this.map.set(n,r)),r.add(t)}get(t,n){const i=this.map.get(t);return i?i.get(t,n):null}remove(t){const n=t.trackById;return this.map.get(n).remove(t)&&this.map.delete(n),t}get isEmpty(){return 0===this.map.size}clear(){this.map.clear()}}function CA(e,t,n){const r=e.previousIndex;if(null===r)return r;let i=0;return n&&r{if(n&&n.key===i)this._maybeAddToChanges(n,r),this._appendAfter=n,n=n._next;else{const o=this._getOrCreateRecordForKey(i,r);n=this._insertBeforeOrAppend(n,o)}}),n){n._prev&&(n._prev._next=null),this._removalsHead=n;for(let r=n;null!==r;r=r._nextRemoved)r===this._mapHead&&(this._mapHead=null),this._records.delete(r.key),r._nextRemoved=r._next,r.previousValue=r.currentValue,r.currentValue=null,r._prev=null,r._next=null}return this._changesTail&&(this._changesTail._nextChanged=null),this._additionsTail&&(this._additionsTail._nextAdded=null),this.isDirty}_insertBeforeOrAppend(t,n){if(t){const r=t._prev;return n._next=t,n._prev=r,t._prev=n,r&&(r._next=n),t===this._mapHead&&(this._mapHead=n),this._appendAfter=t,t}return this._appendAfter?(this._appendAfter._next=n,n._prev=this._appendAfter):this._mapHead=n,this._appendAfter=n,null}_getOrCreateRecordForKey(t,n){if(this._records.has(t)){const i=this._records.get(t);this._maybeAddToChanges(i,n);const o=i._prev,c=i._next;return o&&(o._next=c),c&&(c._prev=o),i._next=null,i._prev=null,i}const r=new r$(t);return this._records.set(t,r),r.currentValue=n,this._addToAdditions(r),r}_reset(){if(this.isDirty){let t;for(this._previousMapHead=this._mapHead,t=this._previousMapHead;null!==t;t=t._next)t._nextPrevious=t._next;for(t=this._changesHead;null!==t;t=t._nextChanged)t.previousValue=t.currentValue;for(t=this._additionsHead;null!=t;t=t._nextAdded)t.previousValue=t.currentValue;this._changesHead=this._changesTail=null,this._additionsHead=this._additionsTail=null,this._removalsHead=null}}_maybeAddToChanges(t,n){Object.is(n,t.currentValue)||(t.previousValue=t.currentValue,t.currentValue=n,this._addToChanges(t))}_addToAdditions(t){null===this._additionsHead?this._additionsHead=this._additionsTail=t:(this._additionsTail._nextAdded=t,this._additionsTail=t)}_addToChanges(t){null===this._changesHead?this._changesHead=this._changesTail=t:(this._changesTail._nextChanged=t,this._changesTail=t)}_forEach(t,n){t instanceof Map?t.forEach(n):Object.keys(t).forEach(r=>n(t[r],r))}}class r${constructor(t){this.key=t,this.previousValue=null,this.currentValue=null,this._nextPrevious=null,this._next=null,this._prev=null,this._nextAdded=null,this._nextRemoved=null,this._nextChanged=null}}function DA(){return new jv([new xA])}let jv=(()=>{class e{constructor(n){this.factories=n}static create(n,r){if(null!=r){const i=r.factories.slice();n=n.concat(i)}return new e(n)}static extend(n){return{provide:e,useFactory:r=>e.create(n,r||DA()),deps:[[e,new Tr,new Od]]}}find(n){const r=this.factories.find(i=>i.supports(n));if(null!=r)return r;throw new nt(901,!1)}}return e.\u0275prov=Ot({token:e,providedIn:"root",factory:DA}),e})();function SA(){return new sy([new EA])}let sy=(()=>{class e{constructor(n){this.factories=n}static create(n,r){if(r){const i=r.factories.slice();n=n.concat(i)}return new e(n)}static extend(n){return{provide:e,useFactory:r=>e.create(n,r||SA()),deps:[[e,new Tr,new Od]]}}find(n){const r=this.factories.find(i=>i.supports(n));if(r)return r;throw new nt(901,!1)}}return e.\u0275prov=Ot({token:e,providedIn:"root",factory:SA}),e})();const s$=lA(null,"core",[]);let a$=(()=>{class e{constructor(n){}}return e.\u0275fac=function(n){return new(n||e)(St(Bv))},e.\u0275mod=ai({type:e}),e.\u0275inj=Ei({}),e})(),Hv=null;function fc(){return Hv}const ss=new It("DocumentToken");let rC=(()=>{class e{historyGo(n){throw new Error("Not implemented")}}return e.\u0275fac=function(n){return new(n||e)},e.\u0275prov=Ot({token:e,factory:function(){return function h$(){return St(MA)}()},providedIn:"platform"}),e})();const d$=new It("Location Initialized");let MA=(()=>{class e extends rC{constructor(n){super(),this._doc=n,this._init()}_init(){this.location=window.location,this._history=window.history}getBaseHrefFromDOM(){return fc().getBaseHref(this._doc)}onPopState(n){const r=fc().getGlobalEventTarget(this._doc,"window");return r.addEventListener("popstate",n,!1),()=>r.removeEventListener("popstate",n)}onHashChange(n){const r=fc().getGlobalEventTarget(this._doc,"window");return r.addEventListener("hashchange",n,!1),()=>r.removeEventListener("hashchange",n)}get href(){return this.location.href}get protocol(){return this.location.protocol}get hostname(){return this.location.hostname}get port(){return this.location.port}get pathname(){return this.location.pathname}get search(){return this.location.search}get hash(){return this.location.hash}set pathname(n){this.location.pathname=n}pushState(n,r,i){IA()?this._history.pushState(n,r,i):this.location.hash=i}replaceState(n,r,i){IA()?this._history.replaceState(n,r,i):this.location.hash=i}forward(){this._history.forward()}back(){this._history.back()}historyGo(n=0){this._history.go(n)}getState(){return this._history.state}}return e.\u0275fac=function(n){return new(n||e)(St(ss))},e.\u0275prov=Ot({token:e,factory:function(){return function f$(){return new MA(St(ss))}()},providedIn:"platform"}),e})();function IA(){return!!window.history.pushState}function iC(e,t){if(0==e.length)return t;if(0==t.length)return e;let n=0;return e.endsWith("/")&&n++,t.startsWith("/")&&n++,2==n?e+t.substring(1):1==n?e+t:e+"/"+t}function TA(e){const t=e.match(/#|\?|$/),n=t&&t.index||e.length;return e.slice(0,n-("/"===e[n-1]?1:0))+e.slice(n)}function lu(e){return e&&"?"!==e[0]?"?"+e:e}let af=(()=>{class e{historyGo(n){throw new Error("Not implemented")}}return e.\u0275fac=function(n){return new(n||e)},e.\u0275prov=Ot({token:e,factory:function(){return Fr(kA)},providedIn:"root"}),e})();const AA=new It("appBaseHref");let kA=(()=>{class e extends af{constructor(n,r){super(),this._platformLocation=n,this._removeListenerFns=[],this._baseHref=r??this._platformLocation.getBaseHrefFromDOM()??Fr(ss).location?.origin??""}ngOnDestroy(){for(;this._removeListenerFns.length;)this._removeListenerFns.pop()()}onPopState(n){this._removeListenerFns.push(this._platformLocation.onPopState(n),this._platformLocation.onHashChange(n))}getBaseHref(){return this._baseHref}prepareExternalUrl(n){return iC(this._baseHref,n)}path(n=!1){const r=this._platformLocation.pathname+lu(this._platformLocation.search),i=this._platformLocation.hash;return i&&n?`${r}${i}`:r}pushState(n,r,i,o){const c=this.prepareExternalUrl(i+lu(o));this._platformLocation.pushState(n,r,c)}replaceState(n,r,i,o){const c=this.prepareExternalUrl(i+lu(o));this._platformLocation.replaceState(n,r,c)}forward(){this._platformLocation.forward()}back(){this._platformLocation.back()}getState(){return this._platformLocation.getState()}historyGo(n=0){this._platformLocation.historyGo?.(n)}}return e.\u0275fac=function(n){return new(n||e)(St(rC),St(AA,8))},e.\u0275prov=Ot({token:e,factory:e.\u0275fac,providedIn:"root"}),e})(),p$=(()=>{class e extends af{constructor(n,r){super(),this._platformLocation=n,this._baseHref="",this._removeListenerFns=[],null!=r&&(this._baseHref=r)}ngOnDestroy(){for(;this._removeListenerFns.length;)this._removeListenerFns.pop()()}onPopState(n){this._removeListenerFns.push(this._platformLocation.onPopState(n),this._platformLocation.onHashChange(n))}getBaseHref(){return this._baseHref}path(n=!1){let r=this._platformLocation.hash;return null==r&&(r="#"),r.length>0?r.substring(1):r}prepareExternalUrl(n){const r=iC(this._baseHref,n);return r.length>0?"#"+r:r}pushState(n,r,i,o){let c=this.prepareExternalUrl(i+lu(o));0==c.length&&(c=this._platformLocation.pathname),this._platformLocation.pushState(n,r,c)}replaceState(n,r,i,o){let c=this.prepareExternalUrl(i+lu(o));0==c.length&&(c=this._platformLocation.pathname),this._platformLocation.replaceState(n,r,c)}forward(){this._platformLocation.forward()}back(){this._platformLocation.back()}getState(){return this._platformLocation.getState()}historyGo(n=0){this._platformLocation.historyGo?.(n)}}return e.\u0275fac=function(n){return new(n||e)(St(rC),St(AA,8))},e.\u0275prov=Ot({token:e,factory:e.\u0275fac}),e})(),oC=(()=>{class e{constructor(n){this._subject=new Qr,this._urlChangeListeners=[],this._urlChangeSubscription=null,this._locationStrategy=n;const r=this._locationStrategy.getBaseHref();this._baseHref=TA(PA(r)),this._locationStrategy.onPopState(i=>{this._subject.emit({url:this.path(!0),pop:!0,state:i.state,type:i.type})})}ngOnDestroy(){this._urlChangeSubscription?.unsubscribe(),this._urlChangeListeners=[]}path(n=!1){return this.normalize(this._locationStrategy.path(n))}getState(){return this._locationStrategy.getState()}isCurrentPathEqualTo(n,r=""){return this.path()==this.normalize(n+lu(r))}normalize(n){return e.stripTrailingSlash(function g$(e,t){return e&&t.startsWith(e)?t.substring(e.length):t}(this._baseHref,PA(n)))}prepareExternalUrl(n){return n&&"/"!==n[0]&&(n="/"+n),this._locationStrategy.prepareExternalUrl(n)}go(n,r="",i=null){this._locationStrategy.pushState(i,"",n,r),this._notifyUrlChangeListeners(this.prepareExternalUrl(n+lu(r)),i)}replaceState(n,r="",i=null){this._locationStrategy.replaceState(i,"",n,r),this._notifyUrlChangeListeners(this.prepareExternalUrl(n+lu(r)),i)}forward(){this._locationStrategy.forward()}back(){this._locationStrategy.back()}historyGo(n=0){this._locationStrategy.historyGo?.(n)}onUrlChange(n){return this._urlChangeListeners.push(n),this._urlChangeSubscription||(this._urlChangeSubscription=this.subscribe(r=>{this._notifyUrlChangeListeners(r.url,r.state)})),()=>{const r=this._urlChangeListeners.indexOf(n);this._urlChangeListeners.splice(r,1),0===this._urlChangeListeners.length&&(this._urlChangeSubscription?.unsubscribe(),this._urlChangeSubscription=null)}}_notifyUrlChangeListeners(n="",r){this._urlChangeListeners.forEach(i=>i(n,r))}subscribe(n,r,i){return this._subject.subscribe({next:n,error:r,complete:i})}}return e.normalizeQueryParams=lu,e.joinWithSlash=iC,e.stripTrailingSlash=TA,e.\u0275fac=function(n){return new(n||e)(St(af))},e.\u0275prov=Ot({token:e,factory:function(){return function m$(){return new oC(St(af))}()},providedIn:"root"}),e})();function PA(e){return e.replace(/\/index.html$/,"")}var hi=(()=>((hi=hi||{})[hi.Format=0]="Format",hi[hi.Standalone=1]="Standalone",hi))(),kn=(()=>((kn=kn||{})[kn.Narrow=0]="Narrow",kn[kn.Abbreviated=1]="Abbreviated",kn[kn.Wide=2]="Wide",kn[kn.Short=3]="Short",kn))(),Hr=(()=>((Hr=Hr||{})[Hr.Short=0]="Short",Hr[Hr.Medium=1]="Medium",Hr[Hr.Long=2]="Long",Hr[Hr.Full=3]="Full",Hr))(),Ut=(()=>((Ut=Ut||{})[Ut.Decimal=0]="Decimal",Ut[Ut.Group=1]="Group",Ut[Ut.List=2]="List",Ut[Ut.PercentSign=3]="PercentSign",Ut[Ut.PlusSign=4]="PlusSign",Ut[Ut.MinusSign=5]="MinusSign",Ut[Ut.Exponential=6]="Exponential",Ut[Ut.SuperscriptingExponent=7]="SuperscriptingExponent",Ut[Ut.PerMille=8]="PerMille",Ut[Ut.Infinity=9]="Infinity",Ut[Ut.NaN=10]="NaN",Ut[Ut.TimeSeparator=11]="TimeSeparator",Ut[Ut.CurrencyDecimal=12]="CurrencyDecimal",Ut[Ut.CurrencyGroup=13]="CurrencyGroup",Ut))();function Gv(e,t){return Ea(is(e)[vt.DateFormat],t)}function qv(e,t){return Ea(is(e)[vt.TimeFormat],t)}function Zv(e,t){return Ea(is(e)[vt.DateTimeFormat],t)}function Ca(e,t){const n=is(e),r=n[vt.NumberSymbols][t];if(typeof r>"u"){if(t===Ut.CurrencyDecimal)return n[vt.NumberSymbols][Ut.Decimal];if(t===Ut.CurrencyGroup)return n[vt.NumberSymbols][Ut.Group]}return r}function FA(e){if(!e[vt.ExtraData])throw new Error(`Missing extra locale data for the locale "${e[vt.LocaleId]}". Use "registerLocaleData" to load new data. See the "I18n guide" on angular.io to know more.`)}function Ea(e,t){for(let n=t;n>-1;n--)if(typeof e[n]<"u")return e[n];throw new Error("Locale data API: locale data undefined")}function aC(e){const[t,n]=e.split(":");return{hours:+t,minutes:+n}}const T$=/^(\d{4,})-?(\d\d)-?(\d\d)(?:T(\d\d)(?::?(\d\d)(?::?(\d\d)(?:\.(\d+))?)?)?(Z|([+-])(\d\d):?(\d\d))?)?$/,ay={},A$=/((?:[^BEGHLMOSWYZabcdhmswyz']+)|(?:'(?:[^']|'')*')|(?:G{1,5}|y{1,4}|Y{1,4}|M{1,5}|L{1,5}|w{1,2}|W{1}|d{1,2}|E{1,6}|c{1,6}|a{1,5}|b{1,5}|B{1,5}|h{1,2}|H{1,2}|m{1,2}|s{1,2}|S{1,3}|z{1,4}|Z{1,5}|O{1,4}))([\s\S]*)/;var Fi=(()=>((Fi=Fi||{})[Fi.Short=0]="Short",Fi[Fi.ShortGMT=1]="ShortGMT",Fi[Fi.Long=2]="Long",Fi[Fi.Extended=3]="Extended",Fi))(),Gt=(()=>((Gt=Gt||{})[Gt.FullYear=0]="FullYear",Gt[Gt.Month=1]="Month",Gt[Gt.Date=2]="Date",Gt[Gt.Hours=3]="Hours",Gt[Gt.Minutes=4]="Minutes",Gt[Gt.Seconds=5]="Seconds",Gt[Gt.FractionalSeconds=6]="FractionalSeconds",Gt[Gt.Day=7]="Day",Gt))(),un=(()=>((un=un||{})[un.DayPeriods=0]="DayPeriods",un[un.Days=1]="Days",un[un.Months=2]="Months",un[un.Eras=3]="Eras",un))();function k$(e,t,n,r){let i=function V$(e){if(NA(e))return e;if("number"==typeof e&&!isNaN(e))return new Date(e);if("string"==typeof e){if(e=e.trim(),/^(\d{4}(-\d{1,2}(-\d{1,2})?)?)$/.test(e)){const[i,o=1,c=1]=e.split("-").map(d=>+d);return Wv(i,o-1,c)}const n=parseFloat(e);if(!isNaN(e-n))return new Date(n);let r;if(r=e.match(T$))return function U$(e){const t=new Date(0);let n=0,r=0;const i=e[8]?t.setUTCFullYear:t.setFullYear,o=e[8]?t.setUTCHours:t.setHours;e[9]&&(n=Number(e[9]+e[10]),r=Number(e[9]+e[11])),i.call(t,Number(e[1]),Number(e[2])-1,Number(e[3]));const c=Number(e[4]||0)-n,d=Number(e[5]||0)-r,p=Number(e[6]||0),v=Math.floor(1e3*parseFloat("0."+(e[7]||0)));return o.call(t,c,d,p,v),t}(r)}const t=new Date(e);if(!NA(t))throw new Error(`Unable to convert "${e}" into a date`);return t}(e);t=cu(n,t)||t;let d,c=[];for(;t;){if(d=A$.exec(t),!d){c.push(t);break}{c=c.concat(d.slice(1));const E=c.pop();if(!E)break;t=E}}let p=i.getTimezoneOffset();r&&(p=LA(r,p),i=function B$(e,t,n){const r=n?-1:1,i=e.getTimezoneOffset();return function z$(e,t){return(e=new Date(e.getTime())).setMinutes(e.getMinutes()+t),e}(e,r*(LA(t,i)-i))}(i,r,!0));let v="";return c.forEach(E=>{const D=function N$(e){if(cC[e])return cC[e];let t;switch(e){case"G":case"GG":case"GGG":t=Ir(un.Eras,kn.Abbreviated);break;case"GGGG":t=Ir(un.Eras,kn.Wide);break;case"GGGGG":t=Ir(un.Eras,kn.Narrow);break;case"y":t=vi(Gt.FullYear,1,0,!1,!0);break;case"yy":t=vi(Gt.FullYear,2,0,!0,!0);break;case"yyy":t=vi(Gt.FullYear,3,0,!1,!0);break;case"yyyy":t=vi(Gt.FullYear,4,0,!1,!0);break;case"Y":t=Jv(1);break;case"YY":t=Jv(2,!0);break;case"YYY":t=Jv(3);break;case"YYYY":t=Jv(4);break;case"M":case"L":t=vi(Gt.Month,1,1);break;case"MM":case"LL":t=vi(Gt.Month,2,1);break;case"MMM":t=Ir(un.Months,kn.Abbreviated);break;case"MMMM":t=Ir(un.Months,kn.Wide);break;case"MMMMM":t=Ir(un.Months,kn.Narrow);break;case"LLL":t=Ir(un.Months,kn.Abbreviated,hi.Standalone);break;case"LLLL":t=Ir(un.Months,kn.Wide,hi.Standalone);break;case"LLLLL":t=Ir(un.Months,kn.Narrow,hi.Standalone);break;case"w":t=lC(1);break;case"ww":t=lC(2);break;case"W":t=lC(1,!0);break;case"d":t=vi(Gt.Date,1);break;case"dd":t=vi(Gt.Date,2);break;case"c":case"cc":t=vi(Gt.Day,1);break;case"ccc":t=Ir(un.Days,kn.Abbreviated,hi.Standalone);break;case"cccc":t=Ir(un.Days,kn.Wide,hi.Standalone);break;case"ccccc":t=Ir(un.Days,kn.Narrow,hi.Standalone);break;case"cccccc":t=Ir(un.Days,kn.Short,hi.Standalone);break;case"E":case"EE":case"EEE":t=Ir(un.Days,kn.Abbreviated);break;case"EEEE":t=Ir(un.Days,kn.Wide);break;case"EEEEE":t=Ir(un.Days,kn.Narrow);break;case"EEEEEE":t=Ir(un.Days,kn.Short);break;case"a":case"aa":case"aaa":t=Ir(un.DayPeriods,kn.Abbreviated);break;case"aaaa":t=Ir(un.DayPeriods,kn.Wide);break;case"aaaaa":t=Ir(un.DayPeriods,kn.Narrow);break;case"b":case"bb":case"bbb":t=Ir(un.DayPeriods,kn.Abbreviated,hi.Standalone,!0);break;case"bbbb":t=Ir(un.DayPeriods,kn.Wide,hi.Standalone,!0);break;case"bbbbb":t=Ir(un.DayPeriods,kn.Narrow,hi.Standalone,!0);break;case"B":case"BB":case"BBB":t=Ir(un.DayPeriods,kn.Abbreviated,hi.Format,!0);break;case"BBBB":t=Ir(un.DayPeriods,kn.Wide,hi.Format,!0);break;case"BBBBB":t=Ir(un.DayPeriods,kn.Narrow,hi.Format,!0);break;case"h":t=vi(Gt.Hours,1,-12);break;case"hh":t=vi(Gt.Hours,2,-12);break;case"H":t=vi(Gt.Hours,1);break;case"HH":t=vi(Gt.Hours,2);break;case"m":t=vi(Gt.Minutes,1);break;case"mm":t=vi(Gt.Minutes,2);break;case"s":t=vi(Gt.Seconds,1);break;case"ss":t=vi(Gt.Seconds,2);break;case"S":t=vi(Gt.FractionalSeconds,1);break;case"SS":t=vi(Gt.FractionalSeconds,2);break;case"SSS":t=vi(Gt.FractionalSeconds,3);break;case"Z":case"ZZ":case"ZZZ":t=Yv(Fi.Short);break;case"ZZZZZ":t=Yv(Fi.Extended);break;case"O":case"OO":case"OOO":case"z":case"zz":case"zzz":t=Yv(Fi.ShortGMT);break;case"OOOO":case"ZZZZ":case"zzzz":t=Yv(Fi.Long);break;default:return null}return cC[e]=t,t}(E);v+=D?D(i,n,p):"''"===E?"'":E.replace(/(^'|'$)/g,"").replace(/''/g,"'")}),v}function Wv(e,t,n){const r=new Date(0);return r.setFullYear(e,t,n),r.setHours(0,0,0),r}function cu(e,t){const n=function y$(e){return is(e)[vt.LocaleId]}(e);if(ay[n]=ay[n]||{},ay[n][t])return ay[n][t];let r="";switch(t){case"shortDate":r=Gv(e,Hr.Short);break;case"mediumDate":r=Gv(e,Hr.Medium);break;case"longDate":r=Gv(e,Hr.Long);break;case"fullDate":r=Gv(e,Hr.Full);break;case"shortTime":r=qv(e,Hr.Short);break;case"mediumTime":r=qv(e,Hr.Medium);break;case"longTime":r=qv(e,Hr.Long);break;case"fullTime":r=qv(e,Hr.Full);break;case"short":const i=cu(e,"shortTime"),o=cu(e,"shortDate");r=Xv(Zv(e,Hr.Short),[i,o]);break;case"medium":const c=cu(e,"mediumTime"),d=cu(e,"mediumDate");r=Xv(Zv(e,Hr.Medium),[c,d]);break;case"long":const p=cu(e,"longTime"),v=cu(e,"longDate");r=Xv(Zv(e,Hr.Long),[p,v]);break;case"full":const E=cu(e,"fullTime"),D=cu(e,"fullDate");r=Xv(Zv(e,Hr.Full),[E,D])}return r&&(ay[n][t]=r),r}function Xv(e,t){return t&&(e=e.replace(/\{([^}]+)}/g,function(n,r){return null!=t&&r in t?t[r]:n})),e}function _l(e,t,n="-",r,i){let o="";(e<0||i&&e<=0)&&(i?e=1-e:(e=-e,o=n));let c=String(e);for(;c.length0||d>-n)&&(d+=n),e===Gt.Hours)0===d&&-12===n&&(d=12);else if(e===Gt.FractionalSeconds)return function P$(e,t){return _l(e,3).substring(0,t)}(d,t);const p=Ca(c,Ut.MinusSign);return _l(d,t,p,r,i)}}function Ir(e,t,n=hi.Format,r=!1){return function(i,o){return function F$(e,t,n,r,i,o){switch(n){case un.Months:return function b$(e,t,n){const r=is(e),o=Ea([r[vt.MonthsFormat],r[vt.MonthsStandalone]],t);return Ea(o,n)}(t,i,r)[e.getMonth()];case un.Days:return function v$(e,t,n){const r=is(e),o=Ea([r[vt.DaysFormat],r[vt.DaysStandalone]],t);return Ea(o,n)}(t,i,r)[e.getDay()];case un.DayPeriods:const c=e.getHours(),d=e.getMinutes();if(o){const v=function E$(e){const t=is(e);return FA(t),(t[vt.ExtraData][2]||[]).map(r=>"string"==typeof r?aC(r):[aC(r[0]),aC(r[1])])}(t),E=function D$(e,t,n){const r=is(e);FA(r);const o=Ea([r[vt.ExtraData][0],r[vt.ExtraData][1]],t)||[];return Ea(o,n)||[]}(t,i,r),D=v.findIndex(I=>{if(Array.isArray(I)){const[P,N]=I,G=c>=P.hours&&d>=P.minutes,U=c0?Math.floor(i/60):Math.ceil(i/60);switch(e){case Fi.Short:return(i>=0?"+":"")+_l(c,2,o)+_l(Math.abs(i%60),2,o);case Fi.ShortGMT:return"GMT"+(i>=0?"+":"")+_l(c,1,o);case Fi.Long:return"GMT"+(i>=0?"+":"")+_l(c,2,o)+":"+_l(Math.abs(i%60),2,o);case Fi.Extended:return 0===r?"Z":(i>=0?"+":"")+_l(c,2,o)+":"+_l(Math.abs(i%60),2,o);default:throw new Error(`Unknown zone width "${e}"`)}}}function OA(e){return Wv(e.getFullYear(),e.getMonth(),e.getDate()+(4-e.getDay()))}function lC(e,t=!1){return function(n,r){let i;if(t){const o=new Date(n.getFullYear(),n.getMonth(),1).getDay()-1,c=n.getDate();i=1+Math.floor((c+o)/7)}else{const o=OA(n),c=function L$(e){const t=Wv(e,0,1).getDay();return Wv(e,0,1+(t<=4?4:11)-t)}(o.getFullYear()),d=o.getTime()-c.getTime();i=1+Math.round(d/6048e5)}return _l(i,e,Ca(r,Ut.MinusSign))}}function Jv(e,t=!1){return function(n,r){return _l(OA(n).getFullYear(),e,Ca(r,Ut.MinusSign),t)}}const cC={};function LA(e,t){e=e.replace(/:/g,"");const n=Date.parse("Jan 01, 1970 00:00:00 "+e)/6e4;return isNaN(n)?t:n}function NA(e){return e instanceof Date&&!isNaN(e.valueOf())}function UA(e,t){t=encodeURIComponent(t);for(const n of e.split(";")){const r=n.indexOf("="),[i,o]=-1==r?[n,""]:[n.slice(0,r),n.slice(r+1)];if(i.trim()===t)return decodeURIComponent(o)}return null}let $A=(()=>{class e{constructor(n,r,i,o){this._iterableDiffers=n,this._keyValueDiffers=r,this._ngEl=i,this._renderer=o,this._iterableDiffer=null,this._keyValueDiffer=null,this._initialClasses=[],this._rawClass=null}set klass(n){this._removeClasses(this._initialClasses),this._initialClasses="string"==typeof n?n.split(/\s+/):[],this._applyClasses(this._initialClasses),this._applyClasses(this._rawClass)}set ngClass(n){this._removeClasses(this._rawClass),this._applyClasses(this._initialClasses),this._iterableDiffer=null,this._keyValueDiffer=null,this._rawClass="string"==typeof n?n.split(/\s+/):n,this._rawClass&&(Gg(this._rawClass)?this._iterableDiffer=this._iterableDiffers.find(this._rawClass).create():this._keyValueDiffer=this._keyValueDiffers.find(this._rawClass).create())}ngDoCheck(){if(this._iterableDiffer){const n=this._iterableDiffer.diff(this._rawClass);n&&this._applyIterableChanges(n)}else if(this._keyValueDiffer){const n=this._keyValueDiffer.diff(this._rawClass);n&&this._applyKeyValueChanges(n)}}_applyKeyValueChanges(n){n.forEachAddedItem(r=>this._toggleClass(r.key,r.currentValue)),n.forEachChangedItem(r=>this._toggleClass(r.key,r.currentValue)),n.forEachRemovedItem(r=>{r.previousValue&&this._toggleClass(r.key,!1)})}_applyIterableChanges(n){n.forEachAddedItem(r=>{if("string"!=typeof r.item)throw new Error(`NgClass can only toggle CSS classes expressed as strings, got ${Mn(r.item)}`);this._toggleClass(r.item,!0)}),n.forEachRemovedItem(r=>this._toggleClass(r.item,!1))}_applyClasses(n){n&&(Array.isArray(n)||n instanceof Set?n.forEach(r=>this._toggleClass(r,!0)):Object.keys(n).forEach(r=>this._toggleClass(r,!!n[r])))}_removeClasses(n){n&&(Array.isArray(n)||n instanceof Set?n.forEach(r=>this._toggleClass(r,!1)):Object.keys(n).forEach(r=>this._toggleClass(r,!1)))}_toggleClass(n,r){(n=n.trim())&&n.split(/\s+/g).forEach(i=>{r?this._renderer.addClass(this._ngEl.nativeElement,i):this._renderer.removeClass(this._ngEl.nativeElement,i)})}}return e.\u0275fac=function(n){return new(n||e)(qe(jv),qe(sy),qe(Xs),qe(ul))},e.\u0275dir=Lt({type:e,selectors:[["","ngClass",""]],inputs:{klass:["class","klass"],ngClass:"ngClass"},standalone:!0}),e})();class e7{constructor(t,n,r,i){this.$implicit=t,this.ngForOf=n,this.index=r,this.count=i}get first(){return 0===this.index}get last(){return this.index===this.count-1}get even(){return this.index%2==0}get odd(){return!this.even}}let GA=(()=>{class e{constructor(n,r,i){this._viewContainer=n,this._template=r,this._differs=i,this._ngForOf=null,this._ngForOfDirty=!0,this._differ=null}set ngForOf(n){this._ngForOf=n,this._ngForOfDirty=!0}set ngForTrackBy(n){this._trackByFn=n}get ngForTrackBy(){return this._trackByFn}set ngForTemplate(n){n&&(this._template=n)}ngDoCheck(){if(this._ngForOfDirty){this._ngForOfDirty=!1;const n=this._ngForOf;!this._differ&&n&&(this._differ=this._differs.find(n).create(this.ngForTrackBy))}if(this._differ){const n=this._differ.diff(this._ngForOf);n&&this._applyChanges(n)}}_applyChanges(n){const r=this._viewContainer;n.forEachOperation((i,o,c)=>{if(null==i.previousIndex)r.createEmbeddedView(this._template,new e7(i.item,this._ngForOf,-1,-1),null===c?void 0:c);else if(null==c)r.remove(null===o?void 0:o);else if(null!==o){const d=r.get(o);r.move(d,c),qA(d,i)}});for(let i=0,o=r.length;i{qA(r.get(i.currentIndex),i)})}static ngTemplateContextGuard(n,r){return!0}}return e.\u0275fac=function(n){return new(n||e)(qe(gl),qe(iu),qe(jv))},e.\u0275dir=Lt({type:e,selectors:[["","ngFor","","ngForOf",""]],inputs:{ngForOf:"ngForOf",ngForTrackBy:"ngForTrackBy",ngForTemplate:"ngForTemplate"},standalone:!0}),e})();function qA(e,t){e.context.$implicit=t.item}let ZA=(()=>{class e{constructor(n,r){this._viewContainer=n,this._context=new n7,this._thenTemplateRef=null,this._elseTemplateRef=null,this._thenViewRef=null,this._elseViewRef=null,this._thenTemplateRef=r}set ngIf(n){this._context.$implicit=this._context.ngIf=n,this._updateView()}set ngIfThen(n){WA("ngIfThen",n),this._thenTemplateRef=n,this._thenViewRef=null,this._updateView()}set ngIfElse(n){WA("ngIfElse",n),this._elseTemplateRef=n,this._elseViewRef=null,this._updateView()}_updateView(){this._context.$implicit?this._thenViewRef||(this._viewContainer.clear(),this._elseViewRef=null,this._thenTemplateRef&&(this._thenViewRef=this._viewContainer.createEmbeddedView(this._thenTemplateRef,this._context))):this._elseViewRef||(this._viewContainer.clear(),this._thenViewRef=null,this._elseTemplateRef&&(this._elseViewRef=this._viewContainer.createEmbeddedView(this._elseTemplateRef,this._context)))}static ngTemplateContextGuard(n,r){return!0}}return e.\u0275fac=function(n){return new(n||e)(qe(gl),qe(iu))},e.\u0275dir=Lt({type:e,selectors:[["","ngIf",""]],inputs:{ngIf:"ngIf",ngIfThen:"ngIfThen",ngIfElse:"ngIfElse"},standalone:!0}),e})();class n7{constructor(){this.$implicit=null,this.ngIf=null}}function WA(e,t){if(t&&!t.createEmbeddedView)throw new Error(`${e} must be a TemplateRef, but received '${Mn(t)}'.`)}const y7=new It("DATE_PIPE_DEFAULT_TIMEZONE");let YA=(()=>{class e{constructor(n,r){this.locale=n,this.defaultTimezone=r}transform(n,r="mediumDate",i,o){if(null==n||""===n||n!=n)return null;try{return k$(n,r,o||this.locale,i??this.defaultTimezone??void 0)}catch(c){throw function vl(e,t){return new nt(2100,!1)}()}}}return e.\u0275fac=function(n){return new(n||e)(qe(ou,16),qe(y7,24))},e.\u0275pipe=$i({name:"date",type:e,pure:!0,standalone:!0}),e})(),JA=(()=>{class e{}return e.\u0275fac=function(n){return new(n||e)},e.\u0275mod=ai({type:e}),e.\u0275inj=Ei({}),e})();let k7=(()=>{class e{}return e.\u0275prov=Ot({token:e,providedIn:"root",factory:()=>new P7(St(ss),window)}),e})();class P7{constructor(t,n){this.document=t,this.window=n,this.offset=()=>[0,0]}setOffset(t){this.offset=Array.isArray(t)?()=>t:t}getScrollPosition(){return this.supportsScrolling()?[this.window.pageXOffset,this.window.pageYOffset]:[0,0]}scrollToPosition(t){this.supportsScrolling()&&this.window.scrollTo(t[0],t[1])}scrollToAnchor(t){if(!this.supportsScrolling())return;const n=function R7(e,t){const n=e.getElementById(t)||e.getElementsByName(t)[0];if(n)return n;if("function"==typeof e.createTreeWalker&&e.body&&(e.body.createShadowRoot||e.body.attachShadow)){const r=e.createTreeWalker(e.body,NodeFilter.SHOW_ELEMENT);let i=r.currentNode;for(;i;){const o=i.shadowRoot;if(o){const c=o.getElementById(t)||o.querySelector(`[name="${t}"]`);if(c)return c}i=r.nextNode()}}return null}(this.document,t);n&&(this.scrollToElement(n),n.focus())}setHistoryScrollRestoration(t){if(this.supportScrollRestoration()){const n=this.window.history;n&&n.scrollRestoration&&(n.scrollRestoration=t)}}scrollToElement(t){const n=t.getBoundingClientRect(),r=n.left+this.window.pageXOffset,i=n.top+this.window.pageYOffset,o=this.offset();this.window.scrollTo(r-o[0],i-o[1])}supportScrollRestoration(){try{if(!this.supportsScrolling())return!1;const t=ek(this.window.history)||ek(Object.getPrototypeOf(this.window.history));return!(!t||!t.writable&&!t.set)}catch{return!1}}supportsScrolling(){try{return!!this.window&&!!this.window.scrollTo&&"pageXOffset"in this.window}catch{return!1}}}function ek(e){return Object.getOwnPropertyDescriptor(e,"scrollRestoration")}class tk{}class xC extends class s9 extends class u${}{constructor(){super(...arguments),this.supportsDOMEvents=!0}}{static makeCurrent(){!function c$(e){Hv||(Hv=e)}(new xC)}onAndCancel(t,n,r){return t.addEventListener(n,r,!1),()=>{t.removeEventListener(n,r,!1)}}dispatchEvent(t,n){t.dispatchEvent(n)}remove(t){t.parentNode&&t.parentNode.removeChild(t)}createElement(t,n){return(n=n||this.getDefaultDocument()).createElement(t)}createHtmlDocument(){return document.implementation.createHTMLDocument("fakeTitle")}getDefaultDocument(){return document}isElementNode(t){return t.nodeType===Node.ELEMENT_NODE}isShadowRoot(t){return t instanceof DocumentFragment}getGlobalEventTarget(t,n){return"window"===n?window:"document"===n?t:"body"===n?t.body:null}getBaseHref(t){const n=function a9(){return uy=uy||document.querySelector("base"),uy?uy.getAttribute("href"):null}();return null==n?null:function l9(e){n0=n0||document.createElement("a"),n0.setAttribute("href",e);const t=n0.pathname;return"/"===t.charAt(0)?t:`/${t}`}(n)}resetBaseElement(){uy=null}getUserAgent(){return window.navigator.userAgent}getCookie(t){return UA(document.cookie,t)}}let n0,uy=null;const sk=new It("TRANSITION_ID"),u9=[{provide:Lv,useFactory:function c9(e,t,n){return()=>{n.get(Nv).donePromise.then(()=>{const r=fc(),i=t.querySelectorAll(`style[ng-transition="${e}"]`);for(let o=0;o{class e{build(){return new XMLHttpRequest}}return e.\u0275fac=function(n){return new(n||e)},e.\u0275prov=Ot({token:e,factory:e.\u0275fac}),e})();const r0=new It("EventManagerPlugins");let o0=(()=>{class e{constructor(n,r){this._zone=r,this._eventNameToPlugin=new Map,n.forEach(i=>i.manager=this),this._plugins=n.slice().reverse()}addEventListener(n,r,i){return this._findPluginFor(r).addEventListener(n,r,i)}addGlobalEventListener(n,r,i){return this._findPluginFor(r).addGlobalEventListener(n,r,i)}getZone(){return this._zone}_findPluginFor(n){const r=this._eventNameToPlugin.get(n);if(r)return r;const i=this._plugins;for(let o=0;o{class e{constructor(){this._stylesSet=new Set}addStyles(n){const r=new Set;n.forEach(i=>{this._stylesSet.has(i)||(this._stylesSet.add(i),r.add(i))}),this.onStylesAdded(r)}onStylesAdded(n){}getAllStyles(){return Array.from(this._stylesSet)}}return e.\u0275fac=function(n){return new(n||e)},e.\u0275prov=Ot({token:e,factory:e.\u0275fac}),e})(),hy=(()=>{class e extends lk{constructor(n){super(),this._doc=n,this._hostNodes=new Map,this._hostNodes.set(n.head,[])}_addStylesToHost(n,r,i){n.forEach(o=>{const c=this._doc.createElement("style");c.textContent=o,i.push(r.appendChild(c))})}addHost(n){const r=[];this._addStylesToHost(this._stylesSet,n,r),this._hostNodes.set(n,r)}removeHost(n){const r=this._hostNodes.get(n);r&&r.forEach(ck),this._hostNodes.delete(n)}onStylesAdded(n){this._hostNodes.forEach((r,i)=>{this._addStylesToHost(n,i,r)})}ngOnDestroy(){this._hostNodes.forEach(n=>n.forEach(ck))}}return e.\u0275fac=function(n){return new(n||e)(St(ss))},e.\u0275prov=Ot({token:e,factory:e.\u0275fac}),e})();function ck(e){fc().remove(e)}const wC={svg:"http://www.w3.org/2000/svg",xhtml:"http://www.w3.org/1999/xhtml",xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/",math:"http://www.w3.org/1998/MathML/"},CC=/%COMP%/g;function s0(e,t,n){for(let r=0;r{if("__ngUnwrap__"===t)return e;!1===e(t)&&(t.preventDefault(),t.returnValue=!1)}}let EC=(()=>{class e{constructor(n,r,i){this.eventManager=n,this.sharedStylesHost=r,this.appId=i,this.rendererByCompId=new Map,this.defaultRenderer=new DC(n)}createRenderer(n,r){if(!n||!r)return this.defaultRenderer;switch(r.encapsulation){case ms.Emulated:{let i=this.rendererByCompId.get(r.id);return i||(i=new _9(this.eventManager,this.sharedStylesHost,r,this.appId),this.rendererByCompId.set(r.id,i)),i.applyToHost(n),i}case 1:case ms.ShadowDom:return new v9(this.eventManager,this.sharedStylesHost,n,r);default:if(!this.rendererByCompId.has(r.id)){const i=s0(r.id,r.styles,[]);this.sharedStylesHost.addStyles(i),this.rendererByCompId.set(r.id,this.defaultRenderer)}return this.defaultRenderer}}begin(){}end(){}}return e.\u0275fac=function(n){return new(n||e)(St(o0),St(hy),St(iy))},e.\u0275prov=Ot({token:e,factory:e.\u0275fac}),e})();class DC{constructor(t){this.eventManager=t,this.data=Object.create(null),this.destroyNode=null}destroy(){}createElement(t,n){return n?document.createElementNS(wC[n]||n,t):document.createElement(t)}createComment(t){return document.createComment(t)}createText(t){return document.createTextNode(t)}appendChild(t,n){(pk(t)?t.content:t).appendChild(n)}insertBefore(t,n,r){t&&(pk(t)?t.content:t).insertBefore(n,r)}removeChild(t,n){t&&t.removeChild(n)}selectRootElement(t,n){let r="string"==typeof t?document.querySelector(t):t;if(!r)throw new Error(`The selector "${t}" did not match any elements`);return n||(r.textContent=""),r}parentNode(t){return t.parentNode}nextSibling(t){return t.nextSibling}setAttribute(t,n,r,i){if(i){n=i+":"+n;const o=wC[i];o?t.setAttributeNS(o,n,r):t.setAttribute(n,r)}else t.setAttribute(n,r)}removeAttribute(t,n,r){if(r){const i=wC[r];i?t.removeAttributeNS(i,n):t.removeAttribute(`${r}:${n}`)}else t.removeAttribute(n)}addClass(t,n){t.classList.add(n)}removeClass(t,n){t.classList.remove(n)}setStyle(t,n,r,i){i&(Wi.DashCase|Wi.Important)?t.style.setProperty(n,r,i&Wi.Important?"important":""):t.style[n]=r}removeStyle(t,n,r){r&Wi.DashCase?t.style.removeProperty(n):t.style[n]=""}setProperty(t,n,r){t[n]=r}setValue(t,n){t.nodeValue=n}listen(t,n,r){return"string"==typeof t?this.eventManager.addGlobalEventListener(t,n,dk(r)):this.eventManager.addEventListener(t,n,dk(r))}}function pk(e){return"TEMPLATE"===e.tagName&&void 0!==e.content}class _9 extends DC{constructor(t,n,r,i){super(t),this.component=r;const o=s0(i+"-"+r.id,r.styles,[]);n.addStyles(o),this.contentAttr=function m9(e){return"_ngcontent-%COMP%".replace(CC,e)}(i+"-"+r.id),this.hostAttr=function g9(e){return"_nghost-%COMP%".replace(CC,e)}(i+"-"+r.id)}applyToHost(t){super.setAttribute(t,this.hostAttr,"")}createElement(t,n){const r=super.createElement(t,n);return super.setAttribute(r,this.contentAttr,""),r}}class v9 extends DC{constructor(t,n,r,i){super(t),this.sharedStylesHost=n,this.hostEl=r,this.shadowRoot=r.attachShadow({mode:"open"}),this.sharedStylesHost.addHost(this.shadowRoot);const o=s0(i.id,i.styles,[]);for(let c=0;c{class e extends ak{constructor(n){super(n)}supports(n){return!0}addEventListener(n,r,i){return n.addEventListener(r,i,!1),()=>this.removeEventListener(n,r,i)}removeEventListener(n,r,i){return n.removeEventListener(r,i)}}return e.\u0275fac=function(n){return new(n||e)(St(ss))},e.\u0275prov=Ot({token:e,factory:e.\u0275fac}),e})();const mk=["alt","control","meta","shift"],x9={"\b":"Backspace","\t":"Tab","\x7f":"Delete","\x1b":"Escape",Del:"Delete",Esc:"Escape",Left:"ArrowLeft",Right:"ArrowRight",Up:"ArrowUp",Down:"ArrowDown",Menu:"ContextMenu",Scroll:"ScrollLock",Win:"OS"},w9={alt:e=>e.altKey,control:e=>e.ctrlKey,meta:e=>e.metaKey,shift:e=>e.shiftKey};let C9=(()=>{class e extends ak{constructor(n){super(n)}supports(n){return null!=e.parseEventName(n)}addEventListener(n,r,i){const o=e.parseEventName(r),c=e.eventCallback(o.fullKey,i,this.manager.getZone());return this.manager.getZone().runOutsideAngular(()=>fc().onAndCancel(n,o.domEventName,c))}static parseEventName(n){const r=n.toLowerCase().split("."),i=r.shift();if(0===r.length||"keydown"!==i&&"keyup"!==i)return null;const o=e._normalizeKey(r.pop());let c="",d=r.indexOf("code");if(d>-1&&(r.splice(d,1),c="code."),mk.forEach(v=>{const E=r.indexOf(v);E>-1&&(r.splice(E,1),c+=v+".")}),c+=o,0!=r.length||0===o.length)return null;const p={};return p.domEventName=i,p.fullKey=c,p}static matchEventFullKeyCode(n,r){let i=x9[n.key]||n.key,o="";return r.indexOf("code.")>-1&&(i=n.code,o="code."),!(null==i||!i)&&(i=i.toLowerCase()," "===i?i="space":"."===i&&(i="dot"),mk.forEach(c=>{c!==i&&(0,w9[c])(n)&&(o+=c+".")}),o+=i,o===r)}static eventCallback(n,r,i){return o=>{e.matchEventFullKeyCode(o,n)&&i.runGuarded(()=>r(o))}}static _normalizeKey(n){return"esc"===n?"escape":n}}return e.\u0275fac=function(n){return new(n||e)(St(ss))},e.\u0275prov=Ot({token:e,factory:e.\u0275fac}),e})();const M9=lA(s$,"browser",[{provide:jw,useValue:"browser"},{provide:JT,useValue:function E9(){xC.makeCurrent()},multi:!0},{provide:ss,useFactory:function S9(){return function x(e){_=e}(document),document},deps:[]}]),_k=new It(""),vk=[{provide:zv,useClass:class h9{addToWindow(t){er.getAngularTestability=(r,i=!0)=>{const o=t.findTestabilityInTree(r,i);if(null==o)throw new Error("Could not find testability for element.");return o},er.getAllAngularTestabilities=()=>t.getAllTestabilities(),er.getAllAngularRootElements=()=>t.getAllRootElements(),er.frameworkStabilizers||(er.frameworkStabilizers=[]),er.frameworkStabilizers.push(r=>{const i=er.getAllAngularTestabilities();let o=i.length,c=!1;const d=function(p){c=c||p,o--,0==o&&r(c)};i.forEach(function(p){p.whenStable(d)})})}findTestabilityInTree(t,n,r){return null==n?null:t.getTestability(n)??(r?fc().isShadowRoot(n)?this.findTestabilityInTree(t,n.host,!0):this.findTestabilityInTree(t,n.parentElement,!0):null)}},deps:[]},{provide:iA,useClass:Ww,deps:[Ri,Xw,zv]},{provide:Ww,useClass:Ww,deps:[Ri,Xw,zv]}],bk=[{provide:wh,useValue:"root"},{provide:Dp,useFactory:function D9(){return new Dp},deps:[]},{provide:r0,useClass:b9,multi:!0,deps:[ss,Ri,jw]},{provide:r0,useClass:C9,multi:!0,deps:[ss]},{provide:EC,useClass:EC,deps:[o0,hy,iy]},{provide:N2,useExisting:EC},{provide:lk,useExisting:hy},{provide:hy,useClass:hy,deps:[ss]},{provide:o0,useClass:o0,deps:[r0,Ri]},{provide:tk,useClass:d9,deps:[]},[]];let I9=(()=>{class e{constructor(n){}static withServerTransition(n){return{ngModule:e,providers:[{provide:iy,useValue:n.appId},{provide:sk,useExisting:iy},u9]}}}return e.\u0275fac=function(n){return new(n||e)(St(_k,12))},e.\u0275mod=ai({type:e}),e.\u0275inj=Ei({providers:[...bk,...vk],imports:[JA,a$]}),e})(),xk=(()=>{class e{constructor(n){this._doc=n}getTitle(){return this._doc.title}setTitle(n){this._doc.title=n||""}}return e.\u0275fac=function(n){return new(n||e)(St(ss))},e.\u0275prov=Ot({token:e,factory:function(n){let r=null;return r=n?new n:function A9(){return new xk(St(ss))}(),r},providedIn:"root"}),e})();function Bt(...e){return Cr(e,sr(e))}typeof window<"u"&&window;class bl extends oi{constructor(t){super(),this._value=t}get value(){return this.getValue()}_subscribe(t){const n=super._subscribe(t);return!n.closed&&t.next(this._value),n}getValue(){const{hasError:t,thrownError:n,_value:r}=this;if(t)throw n;return this._throwIfClosed(),r}next(t){super.next(this._value=t)}}const a0=Zh(e=>function(){e(this),this.name="EmptyError",this.message="no elements in sequence"}),{isArray:z9}=Array,{getPrototypeOf:B9,prototype:V9,keys:U9}=Object;const{isArray:j9}=Array;function Mk(...e){const t=sr(e),n=function qn(e){return or(an(e))?e.pop():void 0}(e),{args:r,keys:i}=function Ek(e){if(1===e.length){const t=e[0];if(z9(t))return{args:t,keys:null};if(function $9(e){return e&&"object"==typeof e&&B9(e)===V9}(t)){const n=U9(t);return{args:n.map(r=>t[r]),keys:n}}}return{args:e,keys:null}}(e);if(0===r.length)return Cr([],t);const o=new Nn(function G9(e,t,n=qr){return r=>{Ik(t,()=>{const{length:i}=e,o=new Array(i);let c=i,d=i;for(let p=0;p{const v=Cr(e[p],t);let E=!1;v.subscribe(Qn(r,D=>{o[p]=D,E||(E=!0,d--),d||r.next(n(o.slice()))},()=>{--c||r.complete()}))},r)},r)}}(r,t,i?c=>function Sk(e,t){return e.reduce((n,r,i)=>(n[r]=t[i],n),{})}(i,c):qr));return n?o.pipe(function Dk(e){return Pe(t=>function H9(e,t){return j9(t)?e(...t):e(t)}(e,t))}(n)):o}function Ik(e,t,n){e?Ie(n,e,t):t()}function IC(...e){return function q9(){return ft(1)}()(Cr(e,sr(e)))}function Tk(e){return new Nn(t=>{te(e()).subscribe(t)})}function dy(e,t){const n=or(e)?e:()=>e,r=i=>i.error(n());return new Nn(t?i=>t.schedule(r,0,i):r)}function TC(){return mr((e,t)=>{let n=null;e._refCount++;const r=Qn(t,void 0,void 0,void 0,()=>{if(!e||e._refCount<=0||0<--e._refCount)return void(n=null);const i=e._connection,o=n;n=null,i&&(!o||i===o)&&i.unsubscribe(),t.unsubscribe()});e.subscribe(r),r.closed||(n=e.connect())})}class Ak extends Nn{constructor(t,n){super(),this.source=t,this.subjectFactory=n,this._subject=null,this._refCount=0,this._connection=null,ra(t)&&(this.lift=t.lift)}_subscribe(t){return this.getSubject().subscribe(t)}getSubject(){const t=this._subject;return(!t||t.isStopped)&&(this._subject=this.subjectFactory()),this._subject}_teardown(){this._refCount=0;const{_connection:t}=this;this._subject=this._connection=null,t?.unsubscribe()}connect(){let t=this._connection;if(!t){t=this._connection=new _r;const n=this.getSubject();t.add(this.source.subscribe(Qn(n,void 0,()=>{this._teardown(),n.complete()},r=>{this._teardown(),n.error(r)},()=>this._teardown()))),t.closed&&(this._connection=null,t=_r.EMPTY)}return t}refCount(){return TC()(this)}}function pc(e,t){return mr((n,r)=>{let i=null,o=0,c=!1;const d=()=>c&&!i&&r.complete();n.subscribe(Qn(r,p=>{i?.unsubscribe();let v=0;const E=o++;te(e(p,E)).subscribe(i=Qn(r,D=>r.next(t?t(p,D,E,v++):D),()=>{i=null,d()}))},()=>{c=!0,d()}))})}function fy(e){return e<=0?()=>xt:mr((t,n)=>{let r=0;t.subscribe(Qn(n,i=>{++r<=e&&(n.next(i),e<=r&&n.complete())}))})}function uu(e,t){return mr((n,r)=>{let i=0;n.subscribe(Qn(r,o=>e.call(t,o,i++)&&r.next(o)))})}function l0(e){return mr((t,n)=>{let r=!1;t.subscribe(Qn(n,i=>{r=!0,n.next(i)},()=>{r||n.next(e),n.complete()}))})}function kk(e=W9){return mr((t,n)=>{let r=!1;t.subscribe(Qn(n,i=>{r=!0,n.next(i)},()=>r?n.complete():n.error(e())))})}function W9(){return new a0}function Mh(e,t){const n=arguments.length>=2;return r=>r.pipe(e?uu((i,o)=>e(i,o,r)):qr,fy(1),n?l0(t):kk(()=>new a0))}function Ih(e,t){return or(t)?dt(e,t,1):dt(e,1)}function Vo(e,t,n){const r=or(e)||t||n?{next:e,error:t,complete:n}:e;return r?mr((i,o)=>{var c;null===(c=r.subscribe)||void 0===c||c.call(r);let d=!0;i.subscribe(Qn(o,p=>{var v;null===(v=r.next)||void 0===v||v.call(r,p),o.next(p)},()=>{var p;d=!1,null===(p=r.complete)||void 0===p||p.call(r),o.complete()},p=>{var v;d=!1,null===(v=r.error)||void 0===v||v.call(r,p),o.error(p)},()=>{var p,v;d&&(null===(p=r.unsubscribe)||void 0===p||p.call(r)),null===(v=r.finalize)||void 0===v||v.call(r)}))}):qr}function Th(e){return mr((t,n)=>{let o,r=null,i=!1;r=t.subscribe(Qn(n,void 0,void 0,c=>{o=te(e(c,Th(e)(t))),r?(r.unsubscribe(),r=null,o.subscribe(n)):i=!0})),i&&(r.unsubscribe(),r=null,o.subscribe(n))})}function X9(e,t,n,r,i){return(o,c)=>{let d=n,p=t,v=0;o.subscribe(Qn(c,E=>{const D=v++;p=d?e(p,E,D):(d=!0,E),r&&c.next(p)},i&&(()=>{d&&c.next(p),c.complete()})))}}function Pk(e,t){return mr(X9(e,t,arguments.length>=2,!0))}function AC(e){return e<=0?()=>xt:mr((t,n)=>{let r=[];t.subscribe(Qn(n,i=>{r.push(i),e{for(const i of r)n.next(i);n.complete()},void 0,()=>{r=null}))})}function Rk(e,t){const n=arguments.length>=2;return r=>r.pipe(e?uu((i,o)=>e(i,o,r)):qr,AC(1),n?l0(t):kk(()=>new a0))}function kC(e){return mr((t,n)=>{try{t.subscribe(n)}finally{n.add(e)}})}const bn="primary",py=Symbol("RouteTitle");class J9{constructor(t){this.params=t||{}}has(t){return Object.prototype.hasOwnProperty.call(this.params,t)}get(t){if(this.has(t)){const n=this.params[t];return Array.isArray(n)?n[0]:n}return null}getAll(t){if(this.has(t)){const n=this.params[t];return Array.isArray(n)?n:[n]}return[]}get keys(){return Object.keys(this.params)}}function qp(e){return new J9(e)}function Q9(e,t,n){const r=n.path.split("/");if(r.length>e.length||"full"===n.pathMatch&&(t.hasChildren()||r.lengthr[o]===i)}return e===t}function Ok(e){return Array.prototype.concat.apply([],e)}function Lk(e){return e.length>0?e[e.length-1]:null}function Eo(e,t){for(const n in e)e.hasOwnProperty(n)&&t(e[n],n)}function Ah(e){return yw(e)?e:Zg(e)?Cr(Promise.resolve(e)):Bt(e)}const nj={exact:function Bk(e,t,n){if(!cf(e.segments,t.segments)||!c0(e.segments,t.segments,n)||e.numberOfChildren!==t.numberOfChildren)return!1;for(const r in t.children)if(!e.children[r]||!Bk(e.children[r],t.children[r],n))return!1;return!0},subset:Vk},Nk={exact:function rj(e,t){return mc(e,t)},subset:function ij(e,t){return Object.keys(t).length<=Object.keys(e).length&&Object.keys(t).every(n=>Fk(e[n],t[n]))},ignored:()=>!0};function zk(e,t,n){return nj[n.paths](e.root,t.root,n.matrixParams)&&Nk[n.queryParams](e.queryParams,t.queryParams)&&!("exact"===n.fragment&&e.fragment!==t.fragment)}function Vk(e,t,n){return Uk(e,t,t.segments,n)}function Uk(e,t,n,r){if(e.segments.length>n.length){const i=e.segments.slice(0,n.length);return!(!cf(i,n)||t.hasChildren()||!c0(i,n,r))}if(e.segments.length===n.length){if(!cf(e.segments,n)||!c0(e.segments,n,r))return!1;for(const i in t.children)if(!e.children[i]||!Vk(e.children[i],t.children[i],r))return!1;return!0}{const i=n.slice(0,e.segments.length),o=n.slice(e.segments.length);return!!(cf(e.segments,i)&&c0(e.segments,i,r)&&e.children[bn])&&Uk(e.children[bn],t,o,r)}}function c0(e,t,n){return t.every((r,i)=>Nk[n](e[i].parameters,r.parameters))}class lf{constructor(t,n,r){this.root=t,this.queryParams=n,this.fragment=r}get queryParamMap(){return this._queryParamMap||(this._queryParamMap=qp(this.queryParams)),this._queryParamMap}toString(){return aj.serialize(this)}}class En{constructor(t,n){this.segments=t,this.children=n,this.parent=null,Eo(n,(r,i)=>r.parent=this)}hasChildren(){return this.numberOfChildren>0}get numberOfChildren(){return Object.keys(this.children).length}toString(){return u0(this)}}class my{constructor(t,n){this.path=t,this.parameters=n}get parameterMap(){return this._parameterMap||(this._parameterMap=qp(this.parameters)),this._parameterMap}toString(){return Gk(this)}}function cf(e,t){return e.length===t.length&&e.every((n,r)=>n.path===t[r].path)}let $k=(()=>{class e{}return e.\u0275fac=function(n){return new(n||e)},e.\u0275prov=Ot({token:e,factory:function(){return new RC},providedIn:"root"}),e})();class RC{parse(t){const n=new gj(t);return new lf(n.parseRootSegment(),n.parseQueryParams(),n.parseFragment())}serialize(t){const n=`/${gy(t.root,!0)}`,r=function uj(e){const t=Object.keys(e).map(n=>{const r=e[n];return Array.isArray(r)?r.map(i=>`${h0(n)}=${h0(i)}`).join("&"):`${h0(n)}=${h0(r)}`}).filter(n=>!!n);return t.length?`?${t.join("&")}`:""}(t.queryParams);return`${n}${r}${"string"==typeof t.fragment?`#${function lj(e){return encodeURI(e)}(t.fragment)}`:""}`}}const aj=new RC;function u0(e){return e.segments.map(t=>Gk(t)).join("/")}function gy(e,t){if(!e.hasChildren())return u0(e);if(t){const n=e.children[bn]?gy(e.children[bn],!1):"",r=[];return Eo(e.children,(i,o)=>{o!==bn&&r.push(`${o}:${gy(i,!1)}`)}),r.length>0?`${n}(${r.join("//")})`:n}{const n=function sj(e,t){let n=[];return Eo(e.children,(r,i)=>{i===bn&&(n=n.concat(t(r,i)))}),Eo(e.children,(r,i)=>{i!==bn&&(n=n.concat(t(r,i)))}),n}(e,(r,i)=>i===bn?[gy(e.children[bn],!1)]:[`${i}:${gy(r,!1)}`]);return 1===Object.keys(e.children).length&&null!=e.children[bn]?`${u0(e)}/${n[0]}`:`${u0(e)}/(${n.join("//")})`}}function jk(e){return encodeURIComponent(e).replace(/%40/g,"@").replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",")}function h0(e){return jk(e).replace(/%3B/gi,";")}function FC(e){return jk(e).replace(/\(/g,"%28").replace(/\)/g,"%29").replace(/%26/gi,"&")}function d0(e){return decodeURIComponent(e)}function Hk(e){return d0(e.replace(/\+/g,"%20"))}function Gk(e){return`${FC(e.path)}${function cj(e){return Object.keys(e).map(t=>`;${FC(t)}=${FC(e[t])}`).join("")}(e.parameters)}`}const hj=/^[^\/()?;=#]+/;function f0(e){const t=e.match(hj);return t?t[0]:""}const dj=/^[^=?&#]+/,pj=/^[^&#]+/;class gj{constructor(t){this.url=t,this.remaining=t}parseRootSegment(){return this.consumeOptional("/"),""===this.remaining||this.peekStartsWith("?")||this.peekStartsWith("#")?new En([],{}):new En([],this.parseChildren())}parseQueryParams(){const t={};if(this.consumeOptional("?"))do{this.parseQueryParam(t)}while(this.consumeOptional("&"));return t}parseFragment(){return this.consumeOptional("#")?decodeURIComponent(this.remaining):null}parseChildren(){if(""===this.remaining)return{};this.consumeOptional("/");const t=[];for(this.peekStartsWith("(")||t.push(this.parseSegment());this.peekStartsWith("/")&&!this.peekStartsWith("//")&&!this.peekStartsWith("/(");)this.capture("/"),t.push(this.parseSegment());let n={};this.peekStartsWith("/(")&&(this.capture("/"),n=this.parseParens(!0));let r={};return this.peekStartsWith("(")&&(r=this.parseParens(!1)),(t.length>0||Object.keys(n).length>0)&&(r[bn]=new En(t,n)),r}parseSegment(){const t=f0(this.remaining);if(""===t&&this.peekStartsWith(";"))throw new nt(4009,!1);return this.capture(t),new my(d0(t),this.parseMatrixParams())}parseMatrixParams(){const t={};for(;this.consumeOptional(";");)this.parseParam(t);return t}parseParam(t){const n=f0(this.remaining);if(!n)return;this.capture(n);let r="";if(this.consumeOptional("=")){const i=f0(this.remaining);i&&(r=i,this.capture(r))}t[d0(n)]=d0(r)}parseQueryParam(t){const n=function fj(e){const t=e.match(dj);return t?t[0]:""}(this.remaining);if(!n)return;this.capture(n);let r="";if(this.consumeOptional("=")){const c=function mj(e){const t=e.match(pj);return t?t[0]:""}(this.remaining);c&&(r=c,this.capture(r))}const i=Hk(n),o=Hk(r);if(t.hasOwnProperty(i)){let c=t[i];Array.isArray(c)||(c=[c],t[i]=c),c.push(o)}else t[i]=o}parseParens(t){const n={};for(this.capture("(");!this.consumeOptional(")")&&this.remaining.length>0;){const r=f0(this.remaining),i=this.remaining[r.length];if("/"!==i&&")"!==i&&";"!==i)throw new nt(4010,!1);let o;r.indexOf(":")>-1?(o=r.slice(0,r.indexOf(":")),this.capture(o),this.capture(":")):t&&(o=bn);const c=this.parseChildren();n[o]=1===Object.keys(c).length?c[bn]:new En([],c),this.consumeOptional("//")}return n}peekStartsWith(t){return this.remaining.startsWith(t)}consumeOptional(t){return!!this.peekStartsWith(t)&&(this.remaining=this.remaining.substring(t.length),!0)}capture(t){if(!this.consumeOptional(t))throw new nt(4011,!1)}}function OC(e){return e.segments.length>0?new En([],{[bn]:e}):e}function p0(e){const t={};for(const r of Object.keys(e.children)){const o=p0(e.children[r]);(o.segments.length>0||o.hasChildren())&&(t[r]=o)}return function yj(e){if(1===e.numberOfChildren&&e.children[bn]){const t=e.children[bn];return new En(e.segments.concat(t.segments),t.children)}return e}(new En(e.segments,t))}function uf(e){return e instanceof lf}function bj(e,t,n,r,i){if(0===n.length)return Zp(t.root,t.root,t.root,r,i);const o=function Wk(e){if("string"==typeof e[0]&&1===e.length&&"/"===e[0])return new Zk(!0,0,e);let t=0,n=!1;const r=e.reduce((i,o,c)=>{if("object"==typeof o&&null!=o){if(o.outlets){const d={};return Eo(o.outlets,(p,v)=>{d[v]="string"==typeof p?p.split("/"):p}),[...i,{outlets:d}]}if(o.segmentPath)return[...i,o.segmentPath]}return"string"!=typeof o?[...i,o]:0===c?(o.split("/").forEach((d,p)=>{0==p&&"."===d||(0==p&&""===d?n=!0:".."===d?t++:""!=d&&i.push(d))}),i):[...i,o]},[]);return new Zk(n,t,r)}(n);return o.toRoot()?Zp(t.root,t.root,new En([],{}),r,i):function c(p){const v=function wj(e,t,n,r){if(e.isAbsolute)return new Wp(t.root,!0,0);if(-1===r)return new Wp(n,n===t.root,0);return function Xk(e,t,n){let r=e,i=t,o=n;for(;o>i;){if(o-=i,r=r.parent,!r)throw new nt(4005,!1);i=r.segments.length}return new Wp(r,!1,i-o)}(n,r+(yy(e.commands[0])?0:1),e.numberOfDoubleDots)}(o,t,e.snapshot?._urlSegment,p),E=v.processChildren?vy(v.segmentGroup,v.index,o.commands):NC(v.segmentGroup,v.index,o.commands);return Zp(t.root,v.segmentGroup,E,r,i)}(e.snapshot?._lastPathIndex)}function yy(e){return"object"==typeof e&&null!=e&&!e.outlets&&!e.segmentPath}function _y(e){return"object"==typeof e&&null!=e&&e.outlets}function Zp(e,t,n,r,i){let c,o={};r&&Eo(r,(p,v)=>{o[v]=Array.isArray(p)?p.map(E=>`${E}`):`${p}`}),c=e===t?n:qk(e,t,n);const d=OC(p0(c));return new lf(d,o,i)}function qk(e,t,n){const r={};return Eo(e.children,(i,o)=>{r[o]=i===t?n:qk(i,t,n)}),new En(e.segments,r)}class Zk{constructor(t,n,r){if(this.isAbsolute=t,this.numberOfDoubleDots=n,this.commands=r,t&&r.length>0&&yy(r[0]))throw new nt(4003,!1);const i=r.find(_y);if(i&&i!==Lk(r))throw new nt(4004,!1)}toRoot(){return this.isAbsolute&&1===this.commands.length&&"/"==this.commands[0]}}class Wp{constructor(t,n,r){this.segmentGroup=t,this.processChildren=n,this.index=r}}function NC(e,t,n){if(e||(e=new En([],{})),0===e.segments.length&&e.hasChildren())return vy(e,t,n);const r=function Ej(e,t,n){let r=0,i=t;const o={match:!1,pathIndex:0,commandIndex:0};for(;i=n.length)return o;const c=e.segments[i],d=n[r];if(_y(d))break;const p=`${d}`,v=r0&&void 0===p)break;if(p&&v&&"object"==typeof v&&void 0===v.outlets){if(!Kk(p,v,c))return o;r+=2}else{if(!Kk(p,{},c))return o;r++}i++}return{match:!0,pathIndex:i,commandIndex:r}}(e,t,n),i=n.slice(r.commandIndex);if(r.match&&r.pathIndex{"string"==typeof o&&(o=[o]),null!==o&&(i[c]=NC(e.children[c],t,o))}),Eo(e.children,(o,c)=>{void 0===r[c]&&(i[c]=o)}),new En(e.segments,i)}}function zC(e,t,n){const r=e.segments.slice(0,t);let i=0;for(;i{"string"==typeof n&&(n=[n]),null!==n&&(t[r]=zC(new En([],{}),0,n))}),t}function Yk(e){const t={};return Eo(e,(n,r)=>t[r]=`${n}`),t}function Kk(e,t,n){return e==n.path&&mc(t,n.parameters)}class hu{constructor(t,n){this.id=t,this.url=n}}class BC extends hu{constructor(t,n,r="imperative",i=null){super(t,n),this.type=0,this.navigationTrigger=r,this.restoredState=i}toString(){return`NavigationStart(id: ${this.id}, url: '${this.url}')`}}class hf extends hu{constructor(t,n,r){super(t,n),this.urlAfterRedirects=r,this.type=1}toString(){return`NavigationEnd(id: ${this.id}, url: '${this.url}', urlAfterRedirects: '${this.urlAfterRedirects}')`}}class m0 extends hu{constructor(t,n,r,i){super(t,n),this.reason=r,this.code=i,this.type=2}toString(){return`NavigationCancel(id: ${this.id}, url: '${this.url}')`}}class Jk extends hu{constructor(t,n,r,i){super(t,n),this.error=r,this.target=i,this.type=3}toString(){return`NavigationError(id: ${this.id}, url: '${this.url}', error: ${this.error})`}}class Sj extends hu{constructor(t,n,r,i){super(t,n),this.urlAfterRedirects=r,this.state=i,this.type=4}toString(){return`RoutesRecognized(id: ${this.id}, url: '${this.url}', urlAfterRedirects: '${this.urlAfterRedirects}', state: ${this.state})`}}class Mj extends hu{constructor(t,n,r,i){super(t,n),this.urlAfterRedirects=r,this.state=i,this.type=7}toString(){return`GuardsCheckStart(id: ${this.id}, url: '${this.url}', urlAfterRedirects: '${this.urlAfterRedirects}', state: ${this.state})`}}class Ij extends hu{constructor(t,n,r,i,o){super(t,n),this.urlAfterRedirects=r,this.state=i,this.shouldActivate=o,this.type=8}toString(){return`GuardsCheckEnd(id: ${this.id}, url: '${this.url}', urlAfterRedirects: '${this.urlAfterRedirects}', state: ${this.state}, shouldActivate: ${this.shouldActivate})`}}class Tj extends hu{constructor(t,n,r,i){super(t,n),this.urlAfterRedirects=r,this.state=i,this.type=5}toString(){return`ResolveStart(id: ${this.id}, url: '${this.url}', urlAfterRedirects: '${this.urlAfterRedirects}', state: ${this.state})`}}class Aj extends hu{constructor(t,n,r,i){super(t,n),this.urlAfterRedirects=r,this.state=i,this.type=6}toString(){return`ResolveEnd(id: ${this.id}, url: '${this.url}', urlAfterRedirects: '${this.urlAfterRedirects}', state: ${this.state})`}}class kj{constructor(t){this.route=t,this.type=9}toString(){return`RouteConfigLoadStart(path: ${this.route.path})`}}class Pj{constructor(t){this.route=t,this.type=10}toString(){return`RouteConfigLoadEnd(path: ${this.route.path})`}}class Rj{constructor(t){this.snapshot=t,this.type=11}toString(){return`ChildActivationStart(path: '${this.snapshot.routeConfig&&this.snapshot.routeConfig.path||""}')`}}class Fj{constructor(t){this.snapshot=t,this.type=12}toString(){return`ChildActivationEnd(path: '${this.snapshot.routeConfig&&this.snapshot.routeConfig.path||""}')`}}class Oj{constructor(t){this.snapshot=t,this.type=13}toString(){return`ActivationStart(path: '${this.snapshot.routeConfig&&this.snapshot.routeConfig.path||""}')`}}class Lj{constructor(t){this.snapshot=t,this.type=14}toString(){return`ActivationEnd(path: '${this.snapshot.routeConfig&&this.snapshot.routeConfig.path||""}')`}}class Qk{constructor(t,n,r){this.routerEvent=t,this.position=n,this.anchor=r,this.type=15}toString(){return`Scroll(anchor: '${this.anchor}', position: '${this.position?`${this.position[0]}, ${this.position[1]}`:null}')`}}class eP{constructor(t){this._root=t}get root(){return this._root.value}parent(t){const n=this.pathFromRoot(t);return n.length>1?n[n.length-2]:null}children(t){const n=VC(t,this._root);return n?n.children.map(r=>r.value):[]}firstChild(t){const n=VC(t,this._root);return n&&n.children.length>0?n.children[0].value:null}siblings(t){const n=UC(t,this._root);return n.length<2?[]:n[n.length-2].children.map(i=>i.value).filter(i=>i!==t)}pathFromRoot(t){return UC(t,this._root).map(n=>n.value)}}function VC(e,t){if(e===t.value)return t;for(const n of t.children){const r=VC(e,n);if(r)return r}return null}function UC(e,t){if(e===t.value)return[t];for(const n of t.children){const r=UC(e,n);if(r.length)return r.unshift(t),r}return[]}class du{constructor(t,n){this.value=t,this.children=n}toString(){return`TreeNode(${this.value})`}}function Xp(e){const t={};return e&&e.children.forEach(n=>t[n.value.outlet]=n),t}class tP extends eP{constructor(t,n){super(t),this.snapshot=n,$C(this,t)}toString(){return this.snapshot.toString()}}function nP(e,t){const n=function zj(e,t){const c=new g0([],{},{},"",{},bn,t,null,e.root,-1,{});return new iP("",new du(c,[]))}(e,t),r=new bl([new my("",{})]),i=new bl({}),o=new bl({}),c=new bl({}),d=new bl(""),p=new df(r,i,c,d,o,bn,t,n.root);return p.snapshot=n.root,new tP(new du(p,[]),n)}class df{constructor(t,n,r,i,o,c,d,p){this.url=t,this.params=n,this.queryParams=r,this.fragment=i,this.data=o,this.outlet=c,this.component=d,this.title=this.data?.pipe(Pe(v=>v[py]))??Bt(void 0),this._futureSnapshot=p}get routeConfig(){return this._futureSnapshot.routeConfig}get root(){return this._routerState.root}get parent(){return this._routerState.parent(this)}get firstChild(){return this._routerState.firstChild(this)}get children(){return this._routerState.children(this)}get pathFromRoot(){return this._routerState.pathFromRoot(this)}get paramMap(){return this._paramMap||(this._paramMap=this.params.pipe(Pe(t=>qp(t)))),this._paramMap}get queryParamMap(){return this._queryParamMap||(this._queryParamMap=this.queryParams.pipe(Pe(t=>qp(t)))),this._queryParamMap}toString(){return this.snapshot?this.snapshot.toString():`Future(${this._futureSnapshot})`}}function rP(e,t="emptyOnly"){const n=e.pathFromRoot;let r=0;if("always"!==t)for(r=n.length-1;r>=1;){const i=n[r],o=n[r-1];if(i.routeConfig&&""===i.routeConfig.path)r--;else{if(o.component)break;r--}}return function Bj(e){return e.reduce((t,n)=>({params:{...t.params,...n.params},data:{...t.data,...n.data},resolve:{...n.data,...t.resolve,...n.routeConfig?.data,...n._resolvedData}}),{params:{},data:{},resolve:{}})}(n.slice(r))}class g0{constructor(t,n,r,i,o,c,d,p,v,E,D,I){this.url=t,this.params=n,this.queryParams=r,this.fragment=i,this.data=o,this.outlet=c,this.component=d,this.title=this.data?.[py],this.routeConfig=p,this._urlSegment=v,this._lastPathIndex=E,this._correctedLastPathIndex=I??E,this._resolve=D}get root(){return this._routerState.root}get parent(){return this._routerState.parent(this)}get firstChild(){return this._routerState.firstChild(this)}get children(){return this._routerState.children(this)}get pathFromRoot(){return this._routerState.pathFromRoot(this)}get paramMap(){return this._paramMap||(this._paramMap=qp(this.params)),this._paramMap}get queryParamMap(){return this._queryParamMap||(this._queryParamMap=qp(this.queryParams)),this._queryParamMap}toString(){return`Route(url:'${this.url.map(r=>r.toString()).join("/")}', path:'${this.routeConfig?this.routeConfig.path:""}')`}}class iP extends eP{constructor(t,n){super(n),this.url=t,$C(this,n)}toString(){return oP(this._root)}}function $C(e,t){t.value._routerState=e,t.children.forEach(n=>$C(e,n))}function oP(e){const t=e.children.length>0?` { ${e.children.map(oP).join(", ")} } `:"";return`${e.value}${t}`}function jC(e){if(e.snapshot){const t=e.snapshot,n=e._futureSnapshot;e.snapshot=n,mc(t.queryParams,n.queryParams)||e.queryParams.next(n.queryParams),t.fragment!==n.fragment&&e.fragment.next(n.fragment),mc(t.params,n.params)||e.params.next(n.params),function ej(e,t){if(e.length!==t.length)return!1;for(let n=0;nmc(n.parameters,t[r].parameters))}(e.url,t.url);return n&&!(!e.parent!=!t.parent)&&(!e.parent||HC(e.parent,t.parent))}function by(e,t,n){if(n&&e.shouldReuseRoute(t.value,n.value.snapshot)){const r=n.value;r._futureSnapshot=t.value;const i=function Uj(e,t,n){return t.children.map(r=>{for(const i of n.children)if(e.shouldReuseRoute(r.value,i.value.snapshot))return by(e,r,i);return by(e,r)})}(e,t,n);return new du(r,i)}{if(e.shouldAttach(t.value)){const o=e.retrieve(t.value);if(null!==o){const c=o.route;return c.value._futureSnapshot=t.value,c.children=t.children.map(d=>by(e,d)),c}}const r=function $j(e){return new df(new bl(e.url),new bl(e.params),new bl(e.queryParams),new bl(e.fragment),new bl(e.data),e.outlet,e.component,e)}(t.value),i=t.children.map(o=>by(e,o));return new du(r,i)}}const GC="ngNavigationCancelingError";function sP(e,t){const{redirectTo:n,navigationBehaviorOptions:r}=uf(t)?{redirectTo:t,navigationBehaviorOptions:void 0}:t,i=aP(!1,0,t);return i.url=n,i.navigationBehaviorOptions=r,i}function aP(e,t,n){const r=new Error("NavigationCancelingError: "+(e||""));return r[GC]=!0,r.cancellationCode=t,n&&(r.url=n),r}function lP(e){return cP(e)&&uf(e.url)}function cP(e){return e&&e[GC]}class jj{constructor(){this.outlet=null,this.route=null,this.resolver=null,this.injector=null,this.children=new xy,this.attachRef=null}}let xy=(()=>{class e{constructor(){this.contexts=new Map}onChildOutletCreated(n,r){const i=this.getOrCreateContext(n);i.outlet=r,this.contexts.set(n,i)}onChildOutletDestroyed(n){const r=this.getContext(n);r&&(r.outlet=null,r.attachRef=null)}onOutletDeactivated(){const n=this.contexts;return this.contexts=new Map,n}onOutletReAttached(n){this.contexts=n}getOrCreateContext(n){let r=this.getContext(n);return r||(r=new jj,this.contexts.set(n,r)),r}getContext(n){return this.contexts.get(n)||null}}return e.\u0275fac=function(n){return new(n||e)},e.\u0275prov=Ot({token:e,factory:e.\u0275fac,providedIn:"root"}),e})();const y0=!1;let uP=(()=>{class e{constructor(n,r,i,o,c){this.parentContexts=n,this.location=r,this.changeDetector=o,this.environmentInjector=c,this.activated=null,this._activatedRoute=null,this.activateEvents=new Qr,this.deactivateEvents=new Qr,this.attachEvents=new Qr,this.detachEvents=new Qr,this.name=i||bn,n.onChildOutletCreated(this.name,this)}ngOnDestroy(){this.parentContexts.getContext(this.name)?.outlet===this&&this.parentContexts.onChildOutletDestroyed(this.name)}ngOnInit(){if(!this.activated){const n=this.parentContexts.getContext(this.name);n&&n.route&&(n.attachRef?this.attach(n.attachRef,n.route):this.activateWith(n.route,n.injector))}}get isActivated(){return!!this.activated}get component(){if(!this.activated)throw new nt(4012,y0);return this.activated.instance}get activatedRoute(){if(!this.activated)throw new nt(4012,y0);return this._activatedRoute}get activatedRouteData(){return this._activatedRoute?this._activatedRoute.snapshot.data:{}}detach(){if(!this.activated)throw new nt(4012,y0);this.location.detach();const n=this.activated;return this.activated=null,this._activatedRoute=null,this.detachEvents.emit(n.instance),n}attach(n,r){this.activated=n,this._activatedRoute=r,this.location.insert(n.hostView),this.attachEvents.emit(n.instance)}deactivate(){if(this.activated){const n=this.component;this.activated.destroy(),this.activated=null,this._activatedRoute=null,this.deactivateEvents.emit(n)}}activateWith(n,r){if(this.isActivated)throw new nt(4013,y0);this._activatedRoute=n;const i=this.location,c=n._futureSnapshot.component,d=this.parentContexts.getOrCreateContext(this.name).children,p=new Hj(n,d,i.injector);if(r&&function Gj(e){return!!e.resolveComponentFactory}(r)){const v=r.resolveComponentFactory(c);this.activated=i.createComponent(v,i.length,p)}else this.activated=i.createComponent(c,{index:i.length,injector:p,environmentInjector:r??this.environmentInjector});this.changeDetector.markForCheck(),this.activateEvents.emit(this.activated.instance)}}return e.\u0275fac=function(n){return new(n||e)(qe(xy),qe(gl),function Sd(e){return function Wm(e,t){if("class"===t)return e.classes;if("style"===t)return e.styles;const n=e.attrs;if(n){const r=n.length;let i=0;for(;i{class e{}return e.\u0275fac=function(n){return new(n||e)},e.\u0275cmp=Vs({type:e,selectors:[["ng-component"]],standalone:!0,features:[hT],decls:1,vars:0,template:function(n,r){1&n&&Is(0,"router-outlet")},dependencies:[uP],encapsulation:2}),e})();function hP(e,t){return e.providers&&!e._injector&&(e._injector=Pv(e.providers,t,`Route: ${e.path}`)),e._injector??t}function WC(e){const t=e.children&&e.children.map(WC),n=t?{...e,children:t}:{...e};return!n.component&&!n.loadComponent&&(t||n.loadChildren)&&n.outlet&&n.outlet!==bn&&(n.component=qC),n}function Da(e){return e.outlet||bn}function dP(e,t){const n=e.filter(r=>Da(r)===t);return n.push(...e.filter(r=>Da(r)!==t)),n}function wy(e){if(!e)return null;if(e.routeConfig?._injector)return e.routeConfig._injector;for(let t=e.parent;t;t=t.parent){const n=t.routeConfig;if(n?._loadedInjector)return n._loadedInjector;if(n?._injector)return n._injector}return null}class Yj{constructor(t,n,r,i){this.routeReuseStrategy=t,this.futureState=n,this.currState=r,this.forwardEvent=i}activate(t){const n=this.futureState._root,r=this.currState?this.currState._root:null;this.deactivateChildRoutes(n,r,t),jC(this.futureState.root),this.activateChildRoutes(n,r,t)}deactivateChildRoutes(t,n,r){const i=Xp(n);t.children.forEach(o=>{const c=o.value.outlet;this.deactivateRoutes(o,i[c],r),delete i[c]}),Eo(i,(o,c)=>{this.deactivateRouteAndItsChildren(o,r)})}deactivateRoutes(t,n,r){const i=t.value,o=n?n.value:null;if(i===o)if(i.component){const c=r.getContext(i.outlet);c&&this.deactivateChildRoutes(t,n,c.children)}else this.deactivateChildRoutes(t,n,r);else o&&this.deactivateRouteAndItsChildren(n,r)}deactivateRouteAndItsChildren(t,n){t.value.component&&this.routeReuseStrategy.shouldDetach(t.value.snapshot)?this.detachAndStoreRouteSubtree(t,n):this.deactivateRouteAndOutlet(t,n)}detachAndStoreRouteSubtree(t,n){const r=n.getContext(t.value.outlet),i=r&&t.value.component?r.children:n,o=Xp(t);for(const c of Object.keys(o))this.deactivateRouteAndItsChildren(o[c],i);if(r&&r.outlet){const c=r.outlet.detach(),d=r.children.onOutletDeactivated();this.routeReuseStrategy.store(t.value.snapshot,{componentRef:c,route:t,contexts:d})}}deactivateRouteAndOutlet(t,n){const r=n.getContext(t.value.outlet),i=r&&t.value.component?r.children:n,o=Xp(t);for(const c of Object.keys(o))this.deactivateRouteAndItsChildren(o[c],i);r&&r.outlet&&(r.outlet.deactivate(),r.children.onOutletDeactivated(),r.attachRef=null,r.resolver=null,r.route=null)}activateChildRoutes(t,n,r){const i=Xp(n);t.children.forEach(o=>{this.activateRoutes(o,i[o.value.outlet],r),this.forwardEvent(new Lj(o.value.snapshot))}),t.children.length&&this.forwardEvent(new Fj(t.value.snapshot))}activateRoutes(t,n,r){const i=t.value,o=n?n.value:null;if(jC(i),i===o)if(i.component){const c=r.getOrCreateContext(i.outlet);this.activateChildRoutes(t,n,c.children)}else this.activateChildRoutes(t,n,r);else if(i.component){const c=r.getOrCreateContext(i.outlet);if(this.routeReuseStrategy.shouldAttach(i.snapshot)){const d=this.routeReuseStrategy.retrieve(i.snapshot);this.routeReuseStrategy.store(i.snapshot,null),c.children.onOutletReAttached(d.contexts),c.attachRef=d.componentRef,c.route=d.route.value,c.outlet&&c.outlet.attach(d.componentRef,d.route.value),jC(d.route.value),this.activateChildRoutes(t,null,c.children)}else{const d=wy(i.snapshot),p=d?.get(Ug)??null;c.attachRef=null,c.route=i,c.resolver=p,c.injector=d,c.outlet&&c.outlet.activateWith(i,c.injector),this.activateChildRoutes(t,null,c.children)}}else this.activateChildRoutes(t,null,r)}}class fP{constructor(t){this.path=t,this.route=this.path[this.path.length-1]}}class _0{constructor(t,n){this.component=t,this.route=n}}function Kj(e,t,n){const r=e._root;return Cy(r,t?t._root:null,n,[r.value])}function Yp(e,t){const n=Symbol(),r=t.get(e,n);return r===n?"function"!=typeof e||function td(e){return null!==Uu(e)}(e)?t.get(e):e:r}function Cy(e,t,n,r,i={canDeactivateChecks:[],canActivateChecks:[]}){const o=Xp(t);return e.children.forEach(c=>{(function Qj(e,t,n,r,i={canDeactivateChecks:[],canActivateChecks:[]}){const o=e.value,c=t?t.value:null,d=n?n.getContext(e.value.outlet):null;if(c&&o.routeConfig===c.routeConfig){const p=function eH(e,t,n){if("function"==typeof n)return n(e,t);switch(n){case"pathParamsChange":return!cf(e.url,t.url);case"pathParamsOrQueryParamsChange":return!cf(e.url,t.url)||!mc(e.queryParams,t.queryParams);case"always":return!0;case"paramsOrQueryParamsChange":return!HC(e,t)||!mc(e.queryParams,t.queryParams);default:return!HC(e,t)}}(c,o,o.routeConfig.runGuardsAndResolvers);p?i.canActivateChecks.push(new fP(r)):(o.data=c.data,o._resolvedData=c._resolvedData),Cy(e,t,o.component?d?d.children:null:n,r,i),p&&d&&d.outlet&&d.outlet.isActivated&&i.canDeactivateChecks.push(new _0(d.outlet.component,c))}else c&&Ey(t,d,i),i.canActivateChecks.push(new fP(r)),Cy(e,null,o.component?d?d.children:null:n,r,i)})(c,o[c.value.outlet],n,r.concat([c.value]),i),delete o[c.value.outlet]}),Eo(o,(c,d)=>Ey(c,n.getContext(d),i)),i}function Ey(e,t,n){const r=Xp(e),i=e.value;Eo(r,(o,c)=>{Ey(o,i.component?t?t.children.getContext(c):null:t,n)}),n.canDeactivateChecks.push(new _0(i.component&&t&&t.outlet&&t.outlet.isActivated?t.outlet.component:null,i))}function Dy(e){return"function"==typeof e}function XC(e){return e instanceof a0||"EmptyError"===e?.name}const v0=Symbol("INITIAL_VALUE");function Kp(){return pc(e=>Mk(e.map(t=>t.pipe(fy(1),function Z9(...e){const t=sr(e);return mr((n,r)=>{(t?IC(e,n,t):IC(e,n)).subscribe(r)})}(v0)))).pipe(Pe(t=>{for(const n of t)if(!0!==n){if(n===v0)return v0;if(!1===n||n instanceof lf)return n}return!0}),uu(t=>t!==v0),fy(1)))}function pP(e){return function Oa(...e){return Ns(e)}(Vo(t=>{if(uf(t))throw sP(0,t)}),Pe(t=>!0===t))}const YC={matched:!1,consumedSegments:[],remainingSegments:[],parameters:{},positionalParamSegments:{}};function mP(e,t,n,r,i){const o=KC(e,t,n);return o.matched?function yH(e,t,n,r){const i=t.canMatch;return i&&0!==i.length?Bt(i.map(c=>{const d=Yp(c,e);return Ah(function sH(e){return e&&Dy(e.canMatch)}(d)?d.canMatch(t,n):e.runInContext(()=>d(t,n)))})).pipe(Kp(),pP()):Bt(!0)}(r=hP(t,r),t,n).pipe(Pe(c=>!0===c?o:{...YC})):Bt(o)}function KC(e,t,n){if(""===t.path)return"full"===t.pathMatch&&(e.hasChildren()||n.length>0)?{...YC}:{matched:!0,consumedSegments:[],remainingSegments:n,parameters:{},positionalParamSegments:{}};const i=(t.matcher||Q9)(n,e,t);if(!i)return{...YC};const o={};Eo(i.posParams,(d,p)=>{o[p]=d.path});const c=i.consumed.length>0?{...o,...i.consumed[i.consumed.length-1].parameters}:o;return{matched:!0,consumedSegments:i.consumed,remainingSegments:n.slice(i.consumed.length),parameters:c,positionalParamSegments:i.posParams??{}}}function b0(e,t,n,r,i="corrected"){if(n.length>0&&function bH(e,t,n){return n.some(r=>x0(e,t,r)&&Da(r)!==bn)}(e,n,r)){const c=new En(t,function vH(e,t,n,r){const i={};i[bn]=r,r._sourceSegment=e,r._segmentIndexShift=t.length;for(const o of n)if(""===o.path&&Da(o)!==bn){const c=new En([],{});c._sourceSegment=e,c._segmentIndexShift=t.length,i[Da(o)]=c}return i}(e,t,r,new En(n,e.children)));return c._sourceSegment=e,c._segmentIndexShift=t.length,{segmentGroup:c,slicedSegments:[]}}if(0===n.length&&function xH(e,t,n){return n.some(r=>x0(e,t,r))}(e,n,r)){const c=new En(e.segments,function _H(e,t,n,r,i,o){const c={};for(const d of r)if(x0(e,n,d)&&!i[Da(d)]){const p=new En([],{});p._sourceSegment=e,p._segmentIndexShift="legacy"===o?e.segments.length:t.length,c[Da(d)]=p}return{...i,...c}}(e,t,n,r,e.children,i));return c._sourceSegment=e,c._segmentIndexShift=t.length,{segmentGroup:c,slicedSegments:n}}const o=new En(e.segments,e.children);return o._sourceSegment=e,o._segmentIndexShift=t.length,{segmentGroup:o,slicedSegments:n}}function x0(e,t,n){return(!(e.hasChildren()||t.length>0)||"full"!==n.pathMatch)&&""===n.path}function gP(e,t,n,r){return!!(Da(e)===r||r!==bn&&x0(t,n,e))&&("**"===e.path||KC(t,e,n).matched)}function yP(e,t,n){return 0===t.length&&!e.children[n]}const w0=!1;class C0{constructor(t){this.segmentGroup=t||null}}class _P{constructor(t){this.urlTree=t}}function Sy(e){return dy(new C0(e))}function vP(e){return dy(new _P(e))}class DH{constructor(t,n,r,i,o){this.injector=t,this.configLoader=n,this.urlSerializer=r,this.urlTree=i,this.config=o,this.allowRedirects=!0}apply(){const t=b0(this.urlTree.root,[],[],this.config).segmentGroup,n=new En(t.segments,t.children);return this.expandSegmentGroup(this.injector,this.config,n,bn).pipe(Pe(o=>this.createUrlTree(p0(o),this.urlTree.queryParams,this.urlTree.fragment))).pipe(Th(o=>{if(o instanceof _P)return this.allowRedirects=!1,this.match(o.urlTree);throw o instanceof C0?this.noMatchError(o):o}))}match(t){return this.expandSegmentGroup(this.injector,this.config,t.root,bn).pipe(Pe(i=>this.createUrlTree(p0(i),t.queryParams,t.fragment))).pipe(Th(i=>{throw i instanceof C0?this.noMatchError(i):i}))}noMatchError(t){return new nt(4002,w0)}createUrlTree(t,n,r){const i=OC(t);return new lf(i,n,r)}expandSegmentGroup(t,n,r,i){return 0===r.segments.length&&r.hasChildren()?this.expandChildren(t,n,r).pipe(Pe(o=>new En([],o))):this.expandSegment(t,r,n,r.segments,i,!0)}expandChildren(t,n,r){const i=[];for(const o of Object.keys(r.children))"primary"===o?i.unshift(o):i.push(o);return Cr(i).pipe(Ih(o=>{const c=r.children[o],d=dP(n,o);return this.expandSegmentGroup(t,d,c,o).pipe(Pe(p=>({segment:p,outlet:o})))}),Pk((o,c)=>(o[c.outlet]=c.segment,o),{}),Rk())}expandSegment(t,n,r,i,o,c){return Cr(r).pipe(Ih(d=>this.expandSegmentAgainstRoute(t,n,r,d,i,o,c).pipe(Th(v=>{if(v instanceof C0)return Bt(null);throw v}))),Mh(d=>!!d),Th((d,p)=>{if(XC(d))return yP(n,i,o)?Bt(new En([],{})):Sy(n);throw d}))}expandSegmentAgainstRoute(t,n,r,i,o,c,d){return gP(i,n,o,c)?void 0===i.redirectTo?this.matchSegmentAgainstRoute(t,n,i,o,c):d&&this.allowRedirects?this.expandSegmentAgainstRouteUsingRedirect(t,n,r,i,o,c):Sy(n):Sy(n)}expandSegmentAgainstRouteUsingRedirect(t,n,r,i,o,c){return"**"===i.path?this.expandWildCardWithParamsAgainstRouteUsingRedirect(t,r,i,c):this.expandRegularSegmentAgainstRouteUsingRedirect(t,n,r,i,o,c)}expandWildCardWithParamsAgainstRouteUsingRedirect(t,n,r,i){const o=this.applyRedirectCommands([],r.redirectTo,{});return r.redirectTo.startsWith("/")?vP(o):this.lineralizeSegments(r,o).pipe(dt(c=>{const d=new En(c,{});return this.expandSegment(t,d,n,c,i,!1)}))}expandRegularSegmentAgainstRouteUsingRedirect(t,n,r,i,o,c){const{matched:d,consumedSegments:p,remainingSegments:v,positionalParamSegments:E}=KC(n,i,o);if(!d)return Sy(n);const D=this.applyRedirectCommands(p,i.redirectTo,E);return i.redirectTo.startsWith("/")?vP(D):this.lineralizeSegments(i,D).pipe(dt(I=>this.expandSegment(t,n,r,I.concat(v),c,!1)))}matchSegmentAgainstRoute(t,n,r,i,o){return"**"===r.path?(t=hP(r,t),r.loadChildren?(r._loadedRoutes?Bt({routes:r._loadedRoutes,injector:r._loadedInjector}):this.configLoader.loadChildren(t,r)).pipe(Pe(d=>(r._loadedRoutes=d.routes,r._loadedInjector=d.injector,new En(i,{})))):Bt(new En(i,{}))):mP(n,r,i,t).pipe(pc(({matched:c,consumedSegments:d,remainingSegments:p})=>c?this.getChildConfig(t=r._injector??t,r,i).pipe(dt(E=>{const D=E.injector??t,I=E.routes,{segmentGroup:P,slicedSegments:N}=b0(n,d,p,I),G=new En(P.segments,P.children);if(0===N.length&&G.hasChildren())return this.expandChildren(D,I,G).pipe(Pe(X=>new En(d,X)));if(0===I.length&&0===N.length)return Bt(new En(d,{}));const U=Da(r)===o;return this.expandSegment(D,G,I,N,U?bn:o,!0).pipe(Pe(ne=>new En(d.concat(ne.segments),ne.children)))})):Sy(n)))}getChildConfig(t,n,r){return n.children?Bt({routes:n.children,injector:t}):n.loadChildren?void 0!==n._loadedRoutes?Bt({routes:n._loadedRoutes,injector:n._loadedInjector}):function gH(e,t,n,r){const i=t.canLoad;return void 0===i||0===i.length?Bt(!0):Bt(i.map(c=>{const d=Yp(c,e);return Ah(function nH(e){return e&&Dy(e.canLoad)}(d)?d.canLoad(t,n):e.runInContext(()=>d(t,n)))})).pipe(Kp(),pP())}(t,n,r).pipe(dt(i=>i?this.configLoader.loadChildren(t,n).pipe(Vo(o=>{n._loadedRoutes=o.routes,n._loadedInjector=o.injector})):function CH(e){return dy(aP(w0,3))}())):Bt({routes:[],injector:t})}lineralizeSegments(t,n){let r=[],i=n.root;for(;;){if(r=r.concat(i.segments),0===i.numberOfChildren)return Bt(r);if(i.numberOfChildren>1||!i.children[bn])return dy(new nt(4e3,w0));i=i.children[bn]}}applyRedirectCommands(t,n,r){return this.applyRedirectCreateUrlTree(n,this.urlSerializer.parse(n),t,r)}applyRedirectCreateUrlTree(t,n,r,i){const o=this.createSegmentGroup(t,n.root,r,i);return new lf(o,this.createQueryParams(n.queryParams,this.urlTree.queryParams),n.fragment)}createQueryParams(t,n){const r={};return Eo(t,(i,o)=>{if("string"==typeof i&&i.startsWith(":")){const d=i.substring(1);r[o]=n[d]}else r[o]=i}),r}createSegmentGroup(t,n,r,i){const o=this.createSegments(t,n.segments,r,i);let c={};return Eo(n.children,(d,p)=>{c[p]=this.createSegmentGroup(t,d,r,i)}),new En(o,c)}createSegments(t,n,r,i){return n.map(o=>o.path.startsWith(":")?this.findPosParam(t,o,i):this.findOrReturn(o,r))}findPosParam(t,n,r){const i=r[n.path.substring(1)];if(!i)throw new nt(4001,w0);return i}findOrReturn(t,n){let r=0;for(const i of n){if(i.path===t.path)return n.splice(r),i;r++}return t}}class MH{}class AH{constructor(t,n,r,i,o,c,d,p){this.injector=t,this.rootComponentType=n,this.config=r,this.urlTree=i,this.url=o,this.paramsInheritanceStrategy=c,this.relativeLinkResolution=d,this.urlSerializer=p}recognize(){const t=b0(this.urlTree.root,[],[],this.config.filter(n=>void 0===n.redirectTo),this.relativeLinkResolution).segmentGroup;return this.processSegmentGroup(this.injector,this.config,t,bn).pipe(Pe(n=>{if(null===n)return null;const r=new g0([],Object.freeze({}),Object.freeze({...this.urlTree.queryParams}),this.urlTree.fragment,{},bn,this.rootComponentType,null,this.urlTree.root,-1,{}),i=new du(r,n),o=new iP(this.url,i);return this.inheritParamsAndData(o._root),o}))}inheritParamsAndData(t){const n=t.value,r=rP(n,this.paramsInheritanceStrategy);n.params=Object.freeze(r.params),n.data=Object.freeze(r.data),t.children.forEach(i=>this.inheritParamsAndData(i))}processSegmentGroup(t,n,r,i){return 0===r.segments.length&&r.hasChildren()?this.processChildren(t,n,r):this.processSegment(t,n,r,r.segments,i)}processChildren(t,n,r){return Cr(Object.keys(r.children)).pipe(Ih(i=>{const o=r.children[i],c=dP(n,i);return this.processSegmentGroup(t,c,o,i)}),Pk((i,o)=>i&&o?(i.push(...o),i):null),function Y9(e,t=!1){return mr((n,r)=>{let i=0;n.subscribe(Qn(r,o=>{const c=e(o,i++);(c||t)&&r.next(o),!c&&r.complete()}))})}(i=>null!==i),l0(null),Rk(),Pe(i=>{if(null===i)return null;const o=bP(i);return function kH(e){e.sort((t,n)=>t.value.outlet===bn?-1:n.value.outlet===bn?1:t.value.outlet.localeCompare(n.value.outlet))}(o),o}))}processSegment(t,n,r,i,o){return Cr(n).pipe(Ih(c=>this.processSegmentAgainstRoute(c._injector??t,c,r,i,o)),Mh(c=>!!c),Th(c=>{if(XC(c))return yP(r,i,o)?Bt([]):Bt(null);throw c}))}processSegmentAgainstRoute(t,n,r,i,o){if(n.redirectTo||!gP(n,r,i,o))return Bt(null);let c;if("**"===n.path){const d=i.length>0?Lk(i).parameters:{},p=wP(r)+i.length;c=Bt({snapshot:new g0(i,d,Object.freeze({...this.urlTree.queryParams}),this.urlTree.fragment,EP(n),Da(n),n.component??n._loadedComponent??null,n,xP(r),p,DP(n),p),consumedSegments:[],remainingSegments:[]})}else c=mP(r,n,i,t).pipe(Pe(({matched:d,consumedSegments:p,remainingSegments:v,parameters:E})=>{if(!d)return null;const D=wP(r)+p.length;return{snapshot:new g0(p,E,Object.freeze({...this.urlTree.queryParams}),this.urlTree.fragment,EP(n),Da(n),n.component??n._loadedComponent??null,n,xP(r),D,DP(n),D),consumedSegments:p,remainingSegments:v}}));return c.pipe(pc(d=>{if(null===d)return Bt(null);const{snapshot:p,consumedSegments:v,remainingSegments:E}=d;t=n._injector??t;const D=n._loadedInjector??t,I=function PH(e){return e.children?e.children:e.loadChildren?e._loadedRoutes:[]}(n),{segmentGroup:P,slicedSegments:N}=b0(r,v,E,I.filter(U=>void 0===U.redirectTo),this.relativeLinkResolution);if(0===N.length&&P.hasChildren())return this.processChildren(D,I,P).pipe(Pe(U=>null===U?null:[new du(p,U)]));if(0===I.length&&0===N.length)return Bt([new du(p,[])]);const G=Da(n)===o;return this.processSegment(D,I,P,N,G?bn:o).pipe(Pe(U=>null===U?null:[new du(p,U)]))}))}}function RH(e){const t=e.value.routeConfig;return t&&""===t.path&&void 0===t.redirectTo}function bP(e){const t=[],n=new Set;for(const r of e){if(!RH(r)){t.push(r);continue}const i=t.find(o=>r.value.routeConfig===o.value.routeConfig);void 0!==i?(i.children.push(...r.children),n.add(i)):t.push(r)}for(const r of n){const i=bP(r.children);t.push(new du(r.value,i))}return t.filter(r=>!n.has(r))}function xP(e){let t=e;for(;t._sourceSegment;)t=t._sourceSegment;return t}function wP(e){let t=e,n=t._segmentIndexShift??0;for(;t._sourceSegment;)t=t._sourceSegment,n+=t._segmentIndexShift??0;return n-1}function EP(e){return e.data||{}}function DP(e){return e.resolve||{}}function SP(e){return"string"==typeof e.title||null===e.title}function JC(e){return pc(t=>{const n=e(t);return n?Cr(n).pipe(Pe(()=>t)):Bt(t)})}let MP=(()=>{class e{buildTitle(n){let r,i=n.root;for(;void 0!==i;)r=this.getResolvedTitleForRoute(i)??r,i=i.children.find(o=>o.outlet===bn);return r}getResolvedTitleForRoute(n){return n.data[py]}}return e.\u0275fac=function(n){return new(n||e)},e.\u0275prov=Ot({token:e,factory:function(){return Fr(IP)},providedIn:"root"}),e})(),IP=(()=>{class e extends MP{constructor(n){super(),this.title=n}updateTitle(n){const r=this.buildTitle(n);void 0!==r&&this.title.setTitle(r)}}return e.\u0275fac=function(n){return new(n||e)(St(xk))},e.\u0275prov=Ot({token:e,factory:e.\u0275fac,providedIn:"root"}),e})();class UH{}class jH extends class $H{shouldDetach(t){return!1}store(t,n){}shouldAttach(t){return!1}retrieve(t){return null}shouldReuseRoute(t,n){return t.routeConfig===n.routeConfig}}{}const D0=new It("",{providedIn:"root",factory:()=>({})}),QC=new It("ROUTES");let eE=(()=>{class e{constructor(n,r){this.injector=n,this.compiler=r,this.componentLoaders=new WeakMap,this.childrenLoaders=new WeakMap}loadComponent(n){if(this.componentLoaders.get(n))return this.componentLoaders.get(n);if(n._loadedComponent)return Bt(n._loadedComponent);this.onLoadStartListener&&this.onLoadStartListener(n);const r=Ah(n.loadComponent()).pipe(Vo(o=>{this.onLoadEndListener&&this.onLoadEndListener(n),n._loadedComponent=o}),kC(()=>{this.componentLoaders.delete(n)})),i=new Ak(r,()=>new oi).pipe(TC());return this.componentLoaders.set(n,i),i}loadChildren(n,r){if(this.childrenLoaders.get(r))return this.childrenLoaders.get(r);if(r._loadedRoutes)return Bt({routes:r._loadedRoutes,injector:r._loadedInjector});this.onLoadStartListener&&this.onLoadStartListener(r);const o=this.loadModuleFactoryOrRoutes(r.loadChildren).pipe(Pe(d=>{this.onLoadEndListener&&this.onLoadEndListener(r);let p,v,E=!1;Array.isArray(d)?v=d:(p=d.create(n).injector,v=Ok(p.get(QC,[],Rt.Self|Rt.Optional)));return{routes:v.map(WC),injector:p}}),kC(()=>{this.childrenLoaders.delete(r)})),c=new Ak(o,()=>new oi).pipe(TC());return this.childrenLoaders.set(r,c),c}loadModuleFactoryOrRoutes(n){return Ah(n()).pipe(dt(r=>r instanceof cT||Array.isArray(r)?Bt(r):Cr(this.compiler.compileModuleAsync(r))))}}return e.\u0275fac=function(n){return new(n||e)(St(Ys),St(Hw))},e.\u0275prov=Ot({token:e,factory:e.\u0275fac,providedIn:"root"}),e})();class GH{}class qH{shouldProcessUrl(t){return!0}extract(t){return t}merge(t,n){return t}}function ZH(e){throw e}function WH(e,t,n){return t.parse("/")}const XH={paths:"exact",fragment:"ignored",matrixParams:"ignored",queryParams:"exact"},YH={paths:"subset",fragment:"ignored",matrixParams:"ignored",queryParams:"subset"};function AP(){const e=Fr($k),t=Fr(xy),n=Fr(oC),r=Fr(Ys),i=Fr(Hw),o=Fr(QC,{optional:!0})??[],c=Fr(D0,{optional:!0})??{},d=Fr(IP),p=Fr(MP,{optional:!0}),v=Fr(GH,{optional:!0}),E=Fr(UH,{optional:!0}),D=new Do(null,e,t,n,r,i,Ok(o));return v&&(D.urlHandlingStrategy=v),E&&(D.routeReuseStrategy=E),D.titleStrategy=p??d,function KH(e,t){e.errorHandler&&(t.errorHandler=e.errorHandler),e.malformedUriErrorHandler&&(t.malformedUriErrorHandler=e.malformedUriErrorHandler),e.onSameUrlNavigation&&(t.onSameUrlNavigation=e.onSameUrlNavigation),e.paramsInheritanceStrategy&&(t.paramsInheritanceStrategy=e.paramsInheritanceStrategy),e.relativeLinkResolution&&(t.relativeLinkResolution=e.relativeLinkResolution),e.urlUpdateStrategy&&(t.urlUpdateStrategy=e.urlUpdateStrategy),e.canceledNavigationResolution&&(t.canceledNavigationResolution=e.canceledNavigationResolution)}(c,D),D}let Do=(()=>{class e{constructor(n,r,i,o,c,d,p){this.rootComponentType=n,this.urlSerializer=r,this.rootContexts=i,this.location=o,this.config=p,this.lastSuccessfulNavigation=null,this.currentNavigation=null,this.disposed=!1,this.navigationId=0,this.currentPageId=0,this.isNgZoneEnabled=!1,this.events=new oi,this.errorHandler=ZH,this.malformedUriErrorHandler=WH,this.navigated=!1,this.lastSuccessfulId=-1,this.afterPreactivation=()=>Bt(void 0),this.urlHandlingStrategy=new qH,this.routeReuseStrategy=new jH,this.onSameUrlNavigation="ignore",this.paramsInheritanceStrategy="emptyOnly",this.urlUpdateStrategy="deferred",this.relativeLinkResolution="corrected",this.canceledNavigationResolution="replace",this.configLoader=c.get(eE),this.configLoader.onLoadEndListener=I=>this.triggerEvent(new Pj(I)),this.configLoader.onLoadStartListener=I=>this.triggerEvent(new kj(I)),this.ngModule=c.get(tf),this.console=c.get(SU);const D=c.get(Ri);this.isNgZoneEnabled=D instanceof Ri&&Ri.isInAngularZone(),this.resetConfig(p),this.currentUrlTree=function tj(){return new lf(new En([],{}),{},null)}(),this.rawUrlTree=this.currentUrlTree,this.browserUrlTree=this.currentUrlTree,this.routerState=nP(this.currentUrlTree,this.rootComponentType),this.transitions=new bl({id:0,targetPageId:0,currentUrlTree:this.currentUrlTree,currentRawUrl:this.currentUrlTree,extractedUrl:this.urlHandlingStrategy.extract(this.currentUrlTree),urlAfterRedirects:this.urlHandlingStrategy.extract(this.currentUrlTree),rawUrl:this.currentUrlTree,extras:{},resolve:null,reject:null,promise:Promise.resolve(!0),source:"imperative",restoredState:null,currentSnapshot:this.routerState.snapshot,targetSnapshot:null,currentRouterState:this.routerState,targetRouterState:null,guards:{canActivateChecks:[],canDeactivateChecks:[]},guardsResult:null}),this.navigations=this.setupNavigations(this.transitions),this.processNavigations()}get browserPageId(){return this.location.getState()?.\u0275routerPageId}setupNavigations(n){const r=this.events;return n.pipe(uu(i=>0!==i.id),Pe(i=>({...i,extractedUrl:this.urlHandlingStrategy.extract(i.rawUrl)})),pc(i=>{let o=!1,c=!1;return Bt(i).pipe(Vo(d=>{this.currentNavigation={id:d.id,initialUrl:d.rawUrl,extractedUrl:d.extractedUrl,trigger:d.source,extras:d.extras,previousNavigation:this.lastSuccessfulNavigation?{...this.lastSuccessfulNavigation,previousNavigation:null}:null}}),pc(d=>{const p=this.browserUrlTree.toString(),v=!this.navigated||d.extractedUrl.toString()!==p||p!==this.currentUrlTree.toString();if(("reload"===this.onSameUrlNavigation||v)&&this.urlHandlingStrategy.shouldProcessUrl(d.rawUrl))return kP(d.source)&&(this.browserUrlTree=d.extractedUrl),Bt(d).pipe(pc(D=>{const I=this.transitions.getValue();return r.next(new BC(D.id,this.serializeUrl(D.extractedUrl),D.source,D.restoredState)),I!==this.transitions.getValue()?xt:Promise.resolve(D)}),function SH(e,t,n,r){return pc(i=>function EH(e,t,n,r,i){return new DH(e,t,n,r,i).apply()}(e,t,n,i.extractedUrl,r).pipe(Pe(o=>({...i,urlAfterRedirects:o}))))}(this.ngModule.injector,this.configLoader,this.urlSerializer,this.config),Vo(D=>{this.currentNavigation={...this.currentNavigation,finalUrl:D.urlAfterRedirects},i.urlAfterRedirects=D.urlAfterRedirects}),function OH(e,t,n,r,i,o){return dt(c=>function TH(e,t,n,r,i,o,c="emptyOnly",d="legacy"){return new AH(e,t,n,r,i,c,d,o).recognize().pipe(pc(p=>null===p?function IH(e){return new Nn(t=>t.error(e))}(new MH):Bt(p)))}(e,t,n,c.urlAfterRedirects,r.serialize(c.urlAfterRedirects),r,i,o).pipe(Pe(d=>({...c,targetSnapshot:d}))))}(this.ngModule.injector,this.rootComponentType,this.config,this.urlSerializer,this.paramsInheritanceStrategy,this.relativeLinkResolution),Vo(D=>{if(i.targetSnapshot=D.targetSnapshot,"eager"===this.urlUpdateStrategy){if(!D.extras.skipLocationChange){const P=this.urlHandlingStrategy.merge(D.urlAfterRedirects,D.rawUrl);this.setBrowserUrl(P,D)}this.browserUrlTree=D.urlAfterRedirects}const I=new Sj(D.id,this.serializeUrl(D.extractedUrl),this.serializeUrl(D.urlAfterRedirects),D.targetSnapshot);r.next(I)}));if(v&&this.rawUrlTree&&this.urlHandlingStrategy.shouldProcessUrl(this.rawUrlTree)){const{id:I,extractedUrl:P,source:N,restoredState:G,extras:U}=d,Z=new BC(I,this.serializeUrl(P),N,G);r.next(Z);const ne=nP(P,this.rootComponentType).snapshot;return Bt(i={...d,targetSnapshot:ne,urlAfterRedirects:P,extras:{...U,skipLocationChange:!1,replaceUrl:!1}})}return this.rawUrlTree=d.rawUrl,d.resolve(null),xt}),Vo(d=>{const p=new Mj(d.id,this.serializeUrl(d.extractedUrl),this.serializeUrl(d.urlAfterRedirects),d.targetSnapshot);this.triggerEvent(p)}),Pe(d=>i={...d,guards:Kj(d.targetSnapshot,d.currentSnapshot,this.rootContexts)}),function lH(e,t){return dt(n=>{const{targetSnapshot:r,currentSnapshot:i,guards:{canActivateChecks:o,canDeactivateChecks:c}}=n;return 0===c.length&&0===o.length?Bt({...n,guardsResult:!0}):function cH(e,t,n,r){return Cr(e).pipe(dt(i=>function mH(e,t,n,r,i){const o=t&&t.routeConfig?t.routeConfig.canDeactivate:null;return o&&0!==o.length?Bt(o.map(d=>{const p=wy(t)??i,v=Yp(d,p);return Ah(function oH(e){return e&&Dy(e.canDeactivate)}(v)?v.canDeactivate(e,t,n,r):p.runInContext(()=>v(e,t,n,r))).pipe(Mh())})).pipe(Kp()):Bt(!0)}(i.component,i.route,n,t,r)),Mh(i=>!0!==i,!0))}(c,r,i,e).pipe(dt(d=>d&&function tH(e){return"boolean"==typeof e}(d)?function uH(e,t,n,r){return Cr(t).pipe(Ih(i=>IC(function dH(e,t){return null!==e&&t&&t(new Rj(e)),Bt(!0)}(i.route.parent,r),function hH(e,t){return null!==e&&t&&t(new Oj(e)),Bt(!0)}(i.route,r),function pH(e,t,n){const r=t[t.length-1],o=t.slice(0,t.length-1).reverse().map(c=>function Jj(e){const t=e.routeConfig?e.routeConfig.canActivateChild:null;return t&&0!==t.length?{node:e,guards:t}:null}(c)).filter(c=>null!==c).map(c=>Tk(()=>Bt(c.guards.map(p=>{const v=wy(c.node)??n,E=Yp(p,v);return Ah(function iH(e){return e&&Dy(e.canActivateChild)}(E)?E.canActivateChild(r,e):v.runInContext(()=>E(r,e))).pipe(Mh())})).pipe(Kp())));return Bt(o).pipe(Kp())}(e,i.path,n),function fH(e,t,n){const r=t.routeConfig?t.routeConfig.canActivate:null;if(!r||0===r.length)return Bt(!0);const i=r.map(o=>Tk(()=>{const c=wy(t)??n,d=Yp(o,c);return Ah(function rH(e){return e&&Dy(e.canActivate)}(d)?d.canActivate(t,e):c.runInContext(()=>d(t,e))).pipe(Mh())}));return Bt(i).pipe(Kp())}(e,i.route,n))),Mh(i=>!0!==i,!0))}(r,o,e,t):Bt(d)),Pe(d=>({...n,guardsResult:d})))})}(this.ngModule.injector,d=>this.triggerEvent(d)),Vo(d=>{if(i.guardsResult=d.guardsResult,uf(d.guardsResult))throw sP(0,d.guardsResult);const p=new Ij(d.id,this.serializeUrl(d.extractedUrl),this.serializeUrl(d.urlAfterRedirects),d.targetSnapshot,!!d.guardsResult);this.triggerEvent(p)}),uu(d=>!!d.guardsResult||(this.restoreHistory(d),this.cancelNavigationTransition(d,"",3),!1)),JC(d=>{if(d.guards.canActivateChecks.length)return Bt(d).pipe(Vo(p=>{const v=new Tj(p.id,this.serializeUrl(p.extractedUrl),this.serializeUrl(p.urlAfterRedirects),p.targetSnapshot);this.triggerEvent(v)}),pc(p=>{let v=!1;return Bt(p).pipe(function LH(e,t){return dt(n=>{const{targetSnapshot:r,guards:{canActivateChecks:i}}=n;if(!i.length)return Bt(n);let o=0;return Cr(i).pipe(Ih(c=>function NH(e,t,n,r){const i=e.routeConfig,o=e._resolve;return void 0!==i?.title&&!SP(i)&&(o[py]=i.title),function zH(e,t,n,r){const i=function BH(e){return[...Object.keys(e),...Object.getOwnPropertySymbols(e)]}(e);if(0===i.length)return Bt({});const o={};return Cr(i).pipe(dt(c=>function VH(e,t,n,r){const i=wy(t)??r,o=Yp(e,i);return Ah(o.resolve?o.resolve(t,n):i.runInContext(()=>o(t,n)))}(e[c],t,n,r).pipe(Mh(),Vo(d=>{o[c]=d}))),AC(1),function K9(e){return Pe(()=>e)}(o),Th(c=>XC(c)?xt:dy(c)))}(o,e,t,r).pipe(Pe(c=>(e._resolvedData=c,e.data=rP(e,n).resolve,i&&SP(i)&&(e.data[py]=i.title),null)))}(c.route,r,e,t)),Vo(()=>o++),AC(1),dt(c=>o===i.length?Bt(n):xt))})}(this.paramsInheritanceStrategy,this.ngModule.injector),Vo({next:()=>v=!0,complete:()=>{v||(this.restoreHistory(p),this.cancelNavigationTransition(p,"",2))}}))}),Vo(p=>{const v=new Aj(p.id,this.serializeUrl(p.extractedUrl),this.serializeUrl(p.urlAfterRedirects),p.targetSnapshot);this.triggerEvent(v)}))}),JC(d=>{const p=v=>{const E=[];v.routeConfig?.loadComponent&&!v.routeConfig._loadedComponent&&E.push(this.configLoader.loadComponent(v.routeConfig).pipe(Vo(D=>{v.component=D}),Pe(()=>{})));for(const D of v.children)E.push(...p(D));return E};return Mk(p(d.targetSnapshot.root)).pipe(l0(),fy(1))}),JC(()=>this.afterPreactivation()),Pe(d=>{const p=function Vj(e,t,n){const r=by(e,t._root,n?n._root:void 0);return new tP(r,t)}(this.routeReuseStrategy,d.targetSnapshot,d.currentRouterState);return i={...d,targetRouterState:p}}),Vo(d=>{this.currentUrlTree=d.urlAfterRedirects,this.rawUrlTree=this.urlHandlingStrategy.merge(d.urlAfterRedirects,d.rawUrl),this.routerState=d.targetRouterState,"deferred"===this.urlUpdateStrategy&&(d.extras.skipLocationChange||this.setBrowserUrl(this.rawUrlTree,d),this.browserUrlTree=d.urlAfterRedirects)}),((e,t,n)=>Pe(r=>(new Yj(t,r.targetRouterState,r.currentRouterState,n).activate(e),r)))(this.rootContexts,this.routeReuseStrategy,d=>this.triggerEvent(d)),Vo({next(){o=!0},complete(){o=!0}}),kC(()=>{o||c||this.cancelNavigationTransition(i,"",1),this.currentNavigation?.id===i.id&&(this.currentNavigation=null)}),Th(d=>{if(c=!0,cP(d)){lP(d)||(this.navigated=!0,this.restoreHistory(i,!0));const p=new m0(i.id,this.serializeUrl(i.extractedUrl),d.message,d.cancellationCode);if(r.next(p),lP(d)){const v=this.urlHandlingStrategy.merge(d.url,this.rawUrlTree),E={skipLocationChange:i.extras.skipLocationChange,replaceUrl:"eager"===this.urlUpdateStrategy||kP(i.source)};this.scheduleNavigation(v,"imperative",null,E,{resolve:i.resolve,reject:i.reject,promise:i.promise})}else i.resolve(!1)}else{this.restoreHistory(i,!0);const p=new Jk(i.id,this.serializeUrl(i.extractedUrl),d,i.targetSnapshot??void 0);r.next(p);try{i.resolve(this.errorHandler(d))}catch(v){i.reject(v)}}return xt}))}))}resetRootComponentType(n){this.rootComponentType=n,this.routerState.root.component=this.rootComponentType}setTransition(n){this.transitions.next({...this.transitions.value,...n})}initialNavigation(){this.setUpLocationChangeListener(),0===this.navigationId&&this.navigateByUrl(this.location.path(!0),{replaceUrl:!0})}setUpLocationChangeListener(){this.locationSubscription||(this.locationSubscription=this.location.subscribe(n=>{const r="popstate"===n.type?"popstate":"hashchange";"popstate"===r&&setTimeout(()=>{const i={replaceUrl:!0},o=n.state?.navigationId?n.state:null;if(o){const d={...o};delete d.navigationId,delete d.\u0275routerPageId,0!==Object.keys(d).length&&(i.state=d)}const c=this.parseUrl(n.url);this.scheduleNavigation(c,r,o,i)},0)}))}get url(){return this.serializeUrl(this.currentUrlTree)}getCurrentNavigation(){return this.currentNavigation}triggerEvent(n){this.events.next(n)}resetConfig(n){this.config=n.map(WC),this.navigated=!1,this.lastSuccessfulId=-1}ngOnDestroy(){this.dispose()}dispose(){this.transitions.complete(),this.locationSubscription&&(this.locationSubscription.unsubscribe(),this.locationSubscription=void 0),this.disposed=!0}createUrlTree(n,r={}){const{relativeTo:i,queryParams:o,fragment:c,queryParamsHandling:d,preserveFragment:p}=r,v=i||this.routerState.root,E=p?this.currentUrlTree.fragment:c;let D=null;switch(d){case"merge":D={...this.currentUrlTree.queryParams,...o};break;case"preserve":D=this.currentUrlTree.queryParams;break;default:D=o||null}return null!==D&&(D=this.removeEmptyProps(D)),bj(v,this.currentUrlTree,n,D,E??null)}navigateByUrl(n,r={skipLocationChange:!1}){const i=uf(n)?n:this.parseUrl(n),o=this.urlHandlingStrategy.merge(i,this.rawUrlTree);return this.scheduleNavigation(o,"imperative",null,r)}navigate(n,r={skipLocationChange:!1}){return function JH(e){for(let t=0;t{const o=n[i];return null!=o&&(r[i]=o),r},{})}processNavigations(){this.navigations.subscribe(n=>{this.navigated=!0,this.lastSuccessfulId=n.id,this.currentPageId=n.targetPageId,this.events.next(new hf(n.id,this.serializeUrl(n.extractedUrl),this.serializeUrl(this.currentUrlTree))),this.lastSuccessfulNavigation=this.currentNavigation,this.titleStrategy?.updateTitle(this.routerState.snapshot),n.resolve(!0)},n=>{this.console.warn(`Unhandled Navigation Error: ${n}`)})}scheduleNavigation(n,r,i,o,c){if(this.disposed)return Promise.resolve(!1);let d,p,v;c?(d=c.resolve,p=c.reject,v=c.promise):v=new Promise((I,P)=>{d=I,p=P});const E=++this.navigationId;let D;return"computed"===this.canceledNavigationResolution?(0===this.currentPageId&&(i=this.location.getState()),D=i&&i.\u0275routerPageId?i.\u0275routerPageId:o.replaceUrl||o.skipLocationChange?this.browserPageId??0:(this.browserPageId??0)+1):D=0,this.setTransition({id:E,targetPageId:D,source:r,restoredState:i,currentUrlTree:this.currentUrlTree,currentRawUrl:this.rawUrlTree,rawUrl:n,extras:o,resolve:d,reject:p,promise:v,currentSnapshot:this.routerState.snapshot,currentRouterState:this.routerState}),v.catch(I=>Promise.reject(I))}setBrowserUrl(n,r){const i=this.urlSerializer.serialize(n),o={...r.extras.state,...this.generateNgRouterState(r.id,r.targetPageId)};this.location.isCurrentPathEqualTo(i)||r.extras.replaceUrl?this.location.replaceState(i,"",o):this.location.go(i,"",o)}restoreHistory(n,r=!1){if("computed"===this.canceledNavigationResolution){const i=this.currentPageId-n.targetPageId;"popstate"!==n.source&&"eager"!==this.urlUpdateStrategy&&this.currentUrlTree!==this.currentNavigation?.finalUrl||0===i?this.currentUrlTree===this.currentNavigation?.finalUrl&&0===i&&(this.resetState(n),this.browserUrlTree=n.currentUrlTree,this.resetUrlToCurrentUrlTree()):this.location.historyGo(i)}else"replace"===this.canceledNavigationResolution&&(r&&this.resetState(n),this.resetUrlToCurrentUrlTree())}resetState(n){this.routerState=n.currentRouterState,this.currentUrlTree=n.currentUrlTree,this.rawUrlTree=this.urlHandlingStrategy.merge(this.currentUrlTree,n.rawUrl)}resetUrlToCurrentUrlTree(){this.location.replaceState(this.urlSerializer.serialize(this.rawUrlTree),"",this.generateNgRouterState(this.lastSuccessfulId,this.currentPageId))}cancelNavigationTransition(n,r,i){const o=new m0(n.id,this.serializeUrl(n.extractedUrl),r,i);this.triggerEvent(o),n.resolve(!1)}generateNgRouterState(n,r){return"computed"===this.canceledNavigationResolution?{navigationId:n,\u0275routerPageId:r}:{navigationId:n}}}return e.\u0275fac=function(n){j1()},e.\u0275prov=Ot({token:e,factory:function(){return AP()},providedIn:"root"}),e})();function kP(e){return"imperative"!==e}class PP{}let tG=(()=>{class e{constructor(n,r,i,o,c){this.router=n,this.injector=i,this.preloadingStrategy=o,this.loader=c}setUpPreloading(){this.subscription=this.router.events.pipe(uu(n=>n instanceof hf),Ih(()=>this.preload())).subscribe(()=>{})}preload(){return this.processRoutes(this.injector,this.router.config)}ngOnDestroy(){this.subscription&&this.subscription.unsubscribe()}processRoutes(n,r){const i=[];for(const o of r){o.providers&&!o._injector&&(o._injector=Pv(o.providers,n,`Route: ${o.path}`));const c=o._injector??n,d=o._loadedInjector??c;o.loadChildren&&!o._loadedRoutes&&void 0===o.canLoad||o.loadComponent&&!o._loadedComponent?i.push(this.preloadConfig(c,o)):(o.children||o._loadedRoutes)&&i.push(this.processRoutes(d,o.children??o._loadedRoutes))}return Cr(i).pipe(ft())}preloadConfig(n,r){return this.preloadingStrategy.preload(r,()=>{let i;i=r.loadChildren&&void 0===r.canLoad?this.loader.loadChildren(n,r):Bt(null);const o=i.pipe(dt(c=>null===c?Bt(void 0):(r._loadedRoutes=c.routes,r._loadedInjector=c.injector,this.processRoutes(c.injector??n,c.routes))));return r.loadComponent&&!r._loadedComponent?Cr([o,this.loader.loadComponent(r)]).pipe(ft()):o})}}return e.\u0275fac=function(n){return new(n||e)(St(Do),St(Hw),St(Ms),St(PP),St(eE))},e.\u0275prov=Ot({token:e,factory:e.\u0275fac,providedIn:"root"}),e})();const rE=new It("");let RP=(()=>{class e{constructor(n,r,i={}){this.router=n,this.viewportScroller=r,this.options=i,this.lastId=0,this.lastSource="imperative",this.restoredId=0,this.store={},i.scrollPositionRestoration=i.scrollPositionRestoration||"disabled",i.anchorScrolling=i.anchorScrolling||"disabled"}init(){"disabled"!==this.options.scrollPositionRestoration&&this.viewportScroller.setHistoryScrollRestoration("manual"),this.routerEventsSubscription=this.createScrollEvents(),this.scrollEventsSubscription=this.consumeScrollEvents()}createScrollEvents(){return this.router.events.subscribe(n=>{n instanceof BC?(this.store[this.lastId]=this.viewportScroller.getScrollPosition(),this.lastSource=n.navigationTrigger,this.restoredId=n.restoredState?n.restoredState.navigationId:0):n instanceof hf&&(this.lastId=n.id,this.scheduleScrollEvent(n,this.router.parseUrl(n.urlAfterRedirects).fragment))})}consumeScrollEvents(){return this.router.events.subscribe(n=>{n instanceof Qk&&(n.position?"top"===this.options.scrollPositionRestoration?this.viewportScroller.scrollToPosition([0,0]):"enabled"===this.options.scrollPositionRestoration&&this.viewportScroller.scrollToPosition(n.position):n.anchor&&"enabled"===this.options.anchorScrolling?this.viewportScroller.scrollToAnchor(n.anchor):"disabled"!==this.options.scrollPositionRestoration&&this.viewportScroller.scrollToPosition([0,0]))})}scheduleScrollEvent(n,r){this.router.triggerEvent(new Qk(n,"popstate"===this.lastSource?this.store[this.restoredId]:null,r))}ngOnDestroy(){this.routerEventsSubscription&&this.routerEventsSubscription.unsubscribe(),this.scrollEventsSubscription&&this.scrollEventsSubscription.unsubscribe()}}return e.\u0275fac=function(n){j1()},e.\u0275prov=Ot({token:e,factory:e.\u0275fac}),e})();function Jp(e,t){return{\u0275kind:e,\u0275providers:t}}function iE(e){return[{provide:QC,multi:!0,useValue:e}]}function OP(){const e=Fr(Ys);return t=>{const n=e.get(Bv);if(t!==n.components[0])return;const r=e.get(Do),i=e.get(LP);1===e.get(oE)&&r.initialNavigation(),e.get(NP,null,Rt.Optional)?.setUpPreloading(),e.get(rE,null,Rt.Optional)?.init(),r.resetRootComponentType(n.componentTypes[0]),i.closed||(i.next(),i.unsubscribe())}}const LP=new It("",{factory:()=>new oi}),oE=new It("",{providedIn:"root",factory:()=>1});const NP=new It("");function oG(e){return Jp(0,[{provide:NP,useExisting:tG},{provide:PP,useExisting:e}])}const zP=new It("ROUTER_FORROOT_GUARD"),sG=[oC,{provide:$k,useClass:RC},{provide:Do,useFactory:AP},xy,{provide:df,useFactory:function FP(e){return e.routerState.root},deps:[Do]},eE];function aG(){return new sA("Router",Do)}let BP=(()=>{class e{constructor(n){}static forRoot(n,r){return{ngModule:e,providers:[sG,[],iE(n),{provide:zP,useFactory:hG,deps:[[Do,new Od,new Tr]]},{provide:D0,useValue:r||{}},r?.useHash?{provide:af,useClass:p$}:{provide:af,useClass:kA},{provide:rE,useFactory:()=>{const e=Fr(Do),t=Fr(k7),n=Fr(D0);return n.scrollOffset&&t.setOffset(n.scrollOffset),new RP(e,t,n)}},r?.preloadingStrategy?oG(r.preloadingStrategy).\u0275providers:[],{provide:sA,multi:!0,useFactory:aG},r?.initialNavigation?dG(r):[],[{provide:VP,useFactory:OP},{provide:QT,multi:!0,useExisting:VP}]]}}static forChild(n){return{ngModule:e,providers:[iE(n)]}}}return e.\u0275fac=function(n){return new(n||e)(St(zP,8))},e.\u0275mod=ai({type:e}),e.\u0275inj=Ei({imports:[qC]}),e})();function hG(e){return"guarded"}function dG(e){return["disabled"===e.initialNavigation?Jp(3,[{provide:Lv,multi:!0,useFactory:()=>{const t=Fr(Do);return()=>{t.setUpLocationChangeListener()}}},{provide:oE,useValue:2}]).\u0275providers:[],"enabledBlocking"===e.initialNavigation?Jp(2,[{provide:oE,useValue:0},{provide:Lv,multi:!0,deps:[Ys],useFactory:t=>{const n=t.get(d$,Promise.resolve());let r=!1;return()=>n.then(()=>new Promise(o=>{const c=t.get(Do),d=t.get(LP);(function i(o){t.get(Do).events.pipe(uu(d=>d instanceof hf||d instanceof m0||d instanceof Jk),Pe(d=>d instanceof hf||d instanceof m0&&(0===d.code||1===d.code)&&null),uu(d=>null!==d),fy(1)).subscribe(()=>{o()})})(()=>{o(!0),r=!0}),c.afterPreactivation=()=>(o(!0),r||d.closed?Bt(void 0):d),c.initialNavigation()}))}}]).\u0275providers:[]]}const VP=new It(""),pG=[];let mG=(()=>{class e{}return e.\u0275fac=function(n){return new(n||e)},e.\u0275mod=ai({type:e}),e.\u0275inj=Ei({imports:[BP.forRoot(pG),BP]}),e})();class UP{}class $P{}class gc{constructor(t){this.normalizedNames=new Map,this.lazyUpdate=null,t?this.lazyInit="string"==typeof t?()=>{this.headers=new Map,t.split("\n").forEach(n=>{const r=n.indexOf(":");if(r>0){const i=n.slice(0,r),o=i.toLowerCase(),c=n.slice(r+1).trim();this.maybeSetNormalizedName(i,o),this.headers.has(o)?this.headers.get(o).push(c):this.headers.set(o,[c])}})}:()=>{this.headers=new Map,Object.keys(t).forEach(n=>{let r=t[n];const i=n.toLowerCase();"string"==typeof r&&(r=[r]),r.length>0&&(this.headers.set(i,r),this.maybeSetNormalizedName(n,i))})}:this.headers=new Map}has(t){return this.init(),this.headers.has(t.toLowerCase())}get(t){this.init();const n=this.headers.get(t.toLowerCase());return n&&n.length>0?n[0]:null}keys(){return this.init(),Array.from(this.normalizedNames.values())}getAll(t){return this.init(),this.headers.get(t.toLowerCase())||null}append(t,n){return this.clone({name:t,value:n,op:"a"})}set(t,n){return this.clone({name:t,value:n,op:"s"})}delete(t,n){return this.clone({name:t,value:n,op:"d"})}maybeSetNormalizedName(t,n){this.normalizedNames.has(n)||this.normalizedNames.set(n,t)}init(){this.lazyInit&&(this.lazyInit instanceof gc?this.copyFrom(this.lazyInit):this.lazyInit(),this.lazyInit=null,this.lazyUpdate&&(this.lazyUpdate.forEach(t=>this.applyUpdate(t)),this.lazyUpdate=null))}copyFrom(t){t.init(),Array.from(t.headers.keys()).forEach(n=>{this.headers.set(n,t.headers.get(n)),this.normalizedNames.set(n,t.normalizedNames.get(n))})}clone(t){const n=new gc;return n.lazyInit=this.lazyInit&&this.lazyInit instanceof gc?this.lazyInit:this,n.lazyUpdate=(this.lazyUpdate||[]).concat([t]),n}applyUpdate(t){const n=t.name.toLowerCase();switch(t.op){case"a":case"s":let r=t.value;if("string"==typeof r&&(r=[r]),0===r.length)return;this.maybeSetNormalizedName(t.name,n);const i=("a"===t.op?this.headers.get(n):void 0)||[];i.push(...r),this.headers.set(n,i);break;case"d":const o=t.value;if(o){let c=this.headers.get(n);if(!c)return;c=c.filter(d=>-1===o.indexOf(d)),0===c.length?(this.headers.delete(n),this.normalizedNames.delete(n)):this.headers.set(n,c)}else this.headers.delete(n),this.normalizedNames.delete(n)}}forEach(t){this.init(),Array.from(this.normalizedNames.keys()).forEach(n=>t(this.normalizedNames.get(n),this.headers.get(n)))}}class gG{encodeKey(t){return jP(t)}encodeValue(t){return jP(t)}decodeKey(t){return decodeURIComponent(t)}decodeValue(t){return decodeURIComponent(t)}}const _G=/%(\d[a-f0-9])/gi,vG={40:"@","3A":":",24:"$","2C":",","3B":";","3D":"=","3F":"?","2F":"/"};function jP(e){return encodeURIComponent(e).replace(_G,(t,n)=>vG[n]??t)}function T0(e){return`${e}`}class fu{constructor(t={}){if(this.updates=null,this.cloneFrom=null,this.encoder=t.encoder||new gG,t.fromString){if(t.fromObject)throw new Error("Cannot specify both fromString and fromObject.");this.map=function yG(e,t){const n=new Map;return e.length>0&&e.replace(/^\?/,"").split("&").forEach(i=>{const o=i.indexOf("="),[c,d]=-1==o?[t.decodeKey(i),""]:[t.decodeKey(i.slice(0,o)),t.decodeValue(i.slice(o+1))],p=n.get(c)||[];p.push(d),n.set(c,p)}),n}(t.fromString,this.encoder)}else t.fromObject?(this.map=new Map,Object.keys(t.fromObject).forEach(n=>{const r=t.fromObject[n],i=Array.isArray(r)?r.map(T0):[T0(r)];this.map.set(n,i)})):this.map=null}has(t){return this.init(),this.map.has(t)}get(t){this.init();const n=this.map.get(t);return n?n[0]:null}getAll(t){return this.init(),this.map.get(t)||null}keys(){return this.init(),Array.from(this.map.keys())}append(t,n){return this.clone({param:t,value:n,op:"a"})}appendAll(t){const n=[];return Object.keys(t).forEach(r=>{const i=t[r];Array.isArray(i)?i.forEach(o=>{n.push({param:r,value:o,op:"a"})}):n.push({param:r,value:i,op:"a"})}),this.clone(n)}set(t,n){return this.clone({param:t,value:n,op:"s"})}delete(t,n){return this.clone({param:t,value:n,op:"d"})}toString(){return this.init(),this.keys().map(t=>{const n=this.encoder.encodeKey(t);return this.map.get(t).map(r=>n+"="+this.encoder.encodeValue(r)).join("&")}).filter(t=>""!==t).join("&")}clone(t){const n=new fu({encoder:this.encoder});return n.cloneFrom=this.cloneFrom||this,n.updates=(this.updates||[]).concat(t),n}init(){null===this.map&&(this.map=new Map),null!==this.cloneFrom&&(this.cloneFrom.init(),this.cloneFrom.keys().forEach(t=>this.map.set(t,this.cloneFrom.map.get(t))),this.updates.forEach(t=>{switch(t.op){case"a":case"s":const n=("a"===t.op?this.map.get(t.param):void 0)||[];n.push(T0(t.value)),this.map.set(t.param,n);break;case"d":if(void 0===t.value){this.map.delete(t.param);break}{let r=this.map.get(t.param)||[];const i=r.indexOf(T0(t.value));-1!==i&&r.splice(i,1),r.length>0?this.map.set(t.param,r):this.map.delete(t.param)}}}),this.cloneFrom=this.updates=null)}}class A0{constructor(){this.map=new Map}set(t,n){return this.map.set(t,n),this}get(t){return this.map.has(t)||this.map.set(t,t.defaultValue()),this.map.get(t)}delete(t){return this.map.delete(t),this}has(t){return this.map.has(t)}keys(){return this.map.keys()}}function HP(e){return typeof ArrayBuffer<"u"&&e instanceof ArrayBuffer}function GP(e){return typeof Blob<"u"&&e instanceof Blob}function qP(e){return typeof FormData<"u"&&e instanceof FormData}class My{constructor(t,n,r,i){let o;if(this.url=n,this.body=null,this.reportProgress=!1,this.withCredentials=!1,this.responseType="json",this.method=t.toUpperCase(),function bG(e){switch(e){case"DELETE":case"GET":case"HEAD":case"OPTIONS":case"JSONP":return!1;default:return!0}}(this.method)||i?(this.body=void 0!==r?r:null,o=i):o=r,o&&(this.reportProgress=!!o.reportProgress,this.withCredentials=!!o.withCredentials,o.responseType&&(this.responseType=o.responseType),o.headers&&(this.headers=o.headers),o.context&&(this.context=o.context),o.params&&(this.params=o.params)),this.headers||(this.headers=new gc),this.context||(this.context=new A0),this.params){const c=this.params.toString();if(0===c.length)this.urlWithParams=n;else{const d=n.indexOf("?");this.urlWithParams=n+(-1===d?"?":dD.set(I,t.setHeaders[I]),p)),t.setParams&&(v=Object.keys(t.setParams).reduce((D,I)=>D.set(I,t.setParams[I]),v)),new My(n,r,o,{params:v,headers:p,context:E,reportProgress:d,responseType:i,withCredentials:c})}}var bi=(()=>((bi=bi||{})[bi.Sent=0]="Sent",bi[bi.UploadProgress=1]="UploadProgress",bi[bi.ResponseHeader=2]="ResponseHeader",bi[bi.DownloadProgress=3]="DownloadProgress",bi[bi.Response=4]="Response",bi[bi.User=5]="User",bi))();class aE{constructor(t,n=200,r="OK"){this.headers=t.headers||new gc,this.status=void 0!==t.status?t.status:n,this.statusText=t.statusText||r,this.url=t.url||null,this.ok=this.status>=200&&this.status<300}}class lE extends aE{constructor(t={}){super(t),this.type=bi.ResponseHeader}clone(t={}){return new lE({headers:t.headers||this.headers,status:void 0!==t.status?t.status:this.status,statusText:t.statusText||this.statusText,url:t.url||this.url||void 0})}}class k0 extends aE{constructor(t={}){super(t),this.type=bi.Response,this.body=void 0!==t.body?t.body:null}clone(t={}){return new k0({body:void 0!==t.body?t.body:this.body,headers:t.headers||this.headers,status:void 0!==t.status?t.status:this.status,statusText:t.statusText||this.statusText,url:t.url||this.url||void 0})}}class ZP extends aE{constructor(t){super(t,0,"Unknown Error"),this.name="HttpErrorResponse",this.ok=!1,this.message=this.status>=200&&this.status<300?`Http failure during parsing for ${t.url||"(unknown url)"}`:`Http failure response for ${t.url||"(unknown url)"}: ${t.status} ${t.statusText}`,this.error=t.error||null}}function cE(e,t){return{body:t,headers:e.headers,context:e.context,observe:e.observe,params:e.params,reportProgress:e.reportProgress,responseType:e.responseType,withCredentials:e.withCredentials}}let WP=(()=>{class e{constructor(n){this.handler=n}request(n,r,i={}){let o;if(n instanceof My)o=n;else{let p,v;p=i.headers instanceof gc?i.headers:new gc(i.headers),i.params&&(v=i.params instanceof fu?i.params:new fu({fromObject:i.params})),o=new My(n,r,void 0!==i.body?i.body:null,{headers:p,context:i.context,params:v,reportProgress:i.reportProgress,responseType:i.responseType||"json",withCredentials:i.withCredentials})}const c=Bt(o).pipe(Ih(p=>this.handler.handle(p)));if(n instanceof My||"events"===i.observe)return c;const d=c.pipe(uu(p=>p instanceof k0));switch(i.observe||"body"){case"body":switch(o.responseType){case"arraybuffer":return d.pipe(Pe(p=>{if(null!==p.body&&!(p.body instanceof ArrayBuffer))throw new Error("Response is not an ArrayBuffer.");return p.body}));case"blob":return d.pipe(Pe(p=>{if(null!==p.body&&!(p.body instanceof Blob))throw new Error("Response is not a Blob.");return p.body}));case"text":return d.pipe(Pe(p=>{if(null!==p.body&&"string"!=typeof p.body)throw new Error("Response is not a string.");return p.body}));default:return d.pipe(Pe(p=>p.body))}case"response":return d;default:throw new Error(`Unreachable: unhandled observe type ${i.observe}}`)}}delete(n,r={}){return this.request("DELETE",n,r)}get(n,r={}){return this.request("GET",n,r)}head(n,r={}){return this.request("HEAD",n,r)}jsonp(n,r){return this.request("JSONP",n,{params:(new fu).append(r,"JSONP_CALLBACK"),observe:"body",responseType:"json"})}options(n,r={}){return this.request("OPTIONS",n,r)}patch(n,r,i={}){return this.request("PATCH",n,cE(i,r))}post(n,r,i={}){return this.request("POST",n,cE(i,r))}put(n,r,i={}){return this.request("PUT",n,cE(i,r))}}return e.\u0275fac=function(n){return new(n||e)(St(UP))},e.\u0275prov=Ot({token:e,factory:e.\u0275fac}),e})();class XP{constructor(t,n){this.next=t,this.interceptor=n}handle(t){return this.interceptor.intercept(t,this.next)}}const YP=new It("HTTP_INTERCEPTORS");let wG=(()=>{class e{intercept(n,r){return r.handle(n)}}return e.\u0275fac=function(n){return new(n||e)},e.\u0275prov=Ot({token:e,factory:e.\u0275fac}),e})();const CG=/^\)\]\}',?\n/;let KP=(()=>{class e{constructor(n){this.xhrFactory=n}handle(n){if("JSONP"===n.method)throw new Error("Attempted to construct Jsonp request without HttpClientJsonpModule installed.");return new Nn(r=>{const i=this.xhrFactory.build();if(i.open(n.method,n.urlWithParams),n.withCredentials&&(i.withCredentials=!0),n.headers.forEach((P,N)=>i.setRequestHeader(P,N.join(","))),n.headers.has("Accept")||i.setRequestHeader("Accept","application/json, text/plain, */*"),!n.headers.has("Content-Type")){const P=n.detectContentTypeHeader();null!==P&&i.setRequestHeader("Content-Type",P)}if(n.responseType){const P=n.responseType.toLowerCase();i.responseType="json"!==P?P:"text"}const o=n.serializeBody();let c=null;const d=()=>{if(null!==c)return c;const P=i.statusText||"OK",N=new gc(i.getAllResponseHeaders()),G=function EG(e){return"responseURL"in e&&e.responseURL?e.responseURL:/^X-Request-URL:/m.test(e.getAllResponseHeaders())?e.getResponseHeader("X-Request-URL"):null}(i)||n.url;return c=new lE({headers:N,status:i.status,statusText:P,url:G}),c},p=()=>{let{headers:P,status:N,statusText:G,url:U}=d(),Z=null;204!==N&&(Z=typeof i.response>"u"?i.responseText:i.response),0===N&&(N=Z?200:0);let ne=N>=200&&N<300;if("json"===n.responseType&&"string"==typeof Z){const X=Z;Z=Z.replace(CG,"");try{Z=""!==Z?JSON.parse(Z):null}catch(re){Z=X,ne&&(ne=!1,Z={error:re,text:Z})}}ne?(r.next(new k0({body:Z,headers:P,status:N,statusText:G,url:U||void 0})),r.complete()):r.error(new ZP({error:Z,headers:P,status:N,statusText:G,url:U||void 0}))},v=P=>{const{url:N}=d(),G=new ZP({error:P,status:i.status||0,statusText:i.statusText||"Unknown Error",url:N||void 0});r.error(G)};let E=!1;const D=P=>{E||(r.next(d()),E=!0);let N={type:bi.DownloadProgress,loaded:P.loaded};P.lengthComputable&&(N.total=P.total),"text"===n.responseType&&!!i.responseText&&(N.partialText=i.responseText),r.next(N)},I=P=>{let N={type:bi.UploadProgress,loaded:P.loaded};P.lengthComputable&&(N.total=P.total),r.next(N)};return i.addEventListener("load",p),i.addEventListener("error",v),i.addEventListener("timeout",v),i.addEventListener("abort",v),n.reportProgress&&(i.addEventListener("progress",D),null!==o&&i.upload&&i.upload.addEventListener("progress",I)),i.send(o),r.next({type:bi.Sent}),()=>{i.removeEventListener("error",v),i.removeEventListener("abort",v),i.removeEventListener("load",p),i.removeEventListener("timeout",v),n.reportProgress&&(i.removeEventListener("progress",D),null!==o&&i.upload&&i.upload.removeEventListener("progress",I)),i.readyState!==i.DONE&&i.abort()}})}}return e.\u0275fac=function(n){return new(n||e)(St(tk))},e.\u0275prov=Ot({token:e,factory:e.\u0275fac}),e})();const uE=new It("XSRF_COOKIE_NAME"),hE=new It("XSRF_HEADER_NAME");class JP{}let DG=(()=>{class e{constructor(n,r,i){this.doc=n,this.platform=r,this.cookieName=i,this.lastCookieString="",this.lastToken=null,this.parseCount=0}getToken(){if("server"===this.platform)return null;const n=this.doc.cookie||"";return n!==this.lastCookieString&&(this.parseCount++,this.lastToken=UA(n,this.cookieName),this.lastCookieString=n),this.lastToken}}return e.\u0275fac=function(n){return new(n||e)(St(ss),St(jw),St(uE))},e.\u0275prov=Ot({token:e,factory:e.\u0275fac}),e})(),dE=(()=>{class e{constructor(n,r){this.tokenService=n,this.headerName=r}intercept(n,r){const i=n.url.toLowerCase();if("GET"===n.method||"HEAD"===n.method||i.startsWith("http://")||i.startsWith("https://"))return r.handle(n);const o=this.tokenService.getToken();return null!==o&&!n.headers.has(this.headerName)&&(n=n.clone({headers:n.headers.set(this.headerName,o)})),r.handle(n)}}return e.\u0275fac=function(n){return new(n||e)(St(JP),St(hE))},e.\u0275prov=Ot({token:e,factory:e.\u0275fac}),e})(),SG=(()=>{class e{constructor(n,r){this.backend=n,this.injector=r,this.chain=null}handle(n){if(null===this.chain){const r=this.injector.get(YP,[]);this.chain=r.reduceRight((i,o)=>new XP(i,o),this.backend)}return this.chain.handle(n)}}return e.\u0275fac=function(n){return new(n||e)(St($P),St(Ys))},e.\u0275prov=Ot({token:e,factory:e.\u0275fac}),e})(),MG=(()=>{class e{static disable(){return{ngModule:e,providers:[{provide:dE,useClass:wG}]}}static withOptions(n={}){return{ngModule:e,providers:[n.cookieName?{provide:uE,useValue:n.cookieName}:[],n.headerName?{provide:hE,useValue:n.headerName}:[]]}}}return e.\u0275fac=function(n){return new(n||e)},e.\u0275mod=ai({type:e}),e.\u0275inj=Ei({providers:[dE,{provide:YP,useExisting:dE,multi:!0},{provide:JP,useClass:DG},{provide:uE,useValue:"XSRF-TOKEN"},{provide:hE,useValue:"X-XSRF-TOKEN"}]}),e})(),IG=(()=>{class e{}return e.\u0275fac=function(n){return new(n||e)},e.\u0275mod=ai({type:e}),e.\u0275inj=Ei({providers:[WP,{provide:UP,useClass:SG},KP,{provide:$P,useExisting:KP}],imports:[MG.withOptions({cookieName:"XSRF-TOKEN",headerName:"X-XSRF-TOKEN"})]}),e})();class TG{encodeKey(t){return encodeURIComponent(t)}encodeValue(t){return encodeURIComponent(t)}decodeKey(t){return decodeURIComponent(t)}decodeValue(t){return decodeURIComponent(t)}}const AG=new It("basePath");class QP{constructor(t={}){this.apiKeys=t.apiKeys,this.username=t.username,this.password=t.password,this.accessToken=t.accessToken,this.basePath=t.basePath,this.withCredentials=t.withCredentials,this.encoder=t.encoder,this.encodeParam=t.encodeParam?t.encodeParam:n=>this.defaultEncodeParam(n),this.credentials=t.credentials?t.credentials:{}}selectHeaderContentType(t){if(0===t.length)return;const n=t.find(r=>this.isJsonMime(r));return void 0===n?t[0]:n}selectHeaderAccept(t){if(0===t.length)return;const n=t.find(r=>this.isJsonMime(r));return void 0===n?t[0]:n}isJsonMime(t){const n=new RegExp("^(application/json|[^;/ \t]+/[^;/ \t]+[+]json)[ \t]*(;.*)?$","i");return null!==t&&(n.test(t)||"application/json-patch+json"===t.toLowerCase())}lookupCredential(t){const n=this.credentials[t];return"function"==typeof n?n():n}defaultEncodeParam(t){const n="date-time"===t.dataFormat?t.value.toISOString():t.value;return encodeURIComponent(String(n))}}let fE=(()=>{class e{constructor(n,r,i){this.httpClient=n,this.basePath="http://localhost",this.defaultHeaders=new gc,this.configuration=new QP,i&&(this.configuration=i),"string"!=typeof this.configuration.basePath&&(Array.isArray(r)&&r.length>0&&(r=r[0]),"string"!=typeof r&&(r=this.basePath),this.configuration.basePath=r),this.encoder=this.configuration.encoder||new TG}addToHttpParams(n,r,i){return"object"!=typeof r||r instanceof Date?this.addToHttpParamsRecursive(n,r,i):this.addToHttpParamsRecursive(n,r)}addToHttpParamsRecursive(n,r,i){if(null==r)return n;if("object"==typeof r)if(Array.isArray(r))r.forEach(o=>n=this.addToHttpParamsRecursive(n,o,i));else if(r instanceof Date){if(null==i)throw Error("key may not be null if value is Date");n=n.append(i,r.toISOString().substr(0,10))}else Object.keys(r).forEach(o=>n=this.addToHttpParamsRecursive(n,r[o],null!=i?`${i}.${o}`:o));else{if(null==i)throw Error("key may not be null if value is not object or array");n=n.append(i,r)}return n}paxServiceGetDevice(n,r="body",i=!1,o){if(null==n)throw new Error("Required parameter id was null or undefined when calling paxServiceGetDevice.");let c=this.defaultHeaders,d=o&&o.httpHeaderAccept;void 0===d&&(d=this.configuration.selectHeaderAccept(["application/json"])),void 0!==d&&(c=c.set("Accept",d));let p=o&&o.context;void 0===p&&(p=new A0);let v="json";d&&(v=d.startsWith("text")?"text":this.configuration.isJsonMime(d)?"json":"blob");let E=`/api/v1/devices/${this.configuration.encodeParam({name:"id",value:n,in:"path",style:"simple",explode:!1,dataType:"string",dataFormat:void 0})}`;return this.httpClient.request("get",`${this.configuration.basePath}${E}`,{context:p,responseType:v,withCredentials:this.configuration.withCredentials,headers:c,observe:r,reportProgress:i})}paxServiceListData(n,r,i,o="body",c=!1,d){let p=new fu({encoder:this.encoder});null!=n&&(p=this.addToHttpParams(p,n,"since")),null!=r&&(p=this.addToHttpParams(p,r,"until")),null!=i&&(p=this.addToHttpParams(p,i,"limit"));let v=this.defaultHeaders,E=d&&d.httpHeaderAccept;void 0===E&&(E=this.configuration.selectHeaderAccept(["application/json"])),void 0!==E&&(v=v.set("Accept",E));let D=d&&d.context;void 0===D&&(D=new A0);let I="json";return E&&(I=E.startsWith("text")?"text":this.configuration.isJsonMime(E)?"json":"blob"),this.httpClient.request("get",`${this.configuration.basePath}/api/v1/data`,{context:D,params:p,responseType:I,withCredentials:this.configuration.withCredentials,headers:v,observe:o,reportProgress:c})}paxServiceListDevices(n="body",r=!1,i){let o=this.defaultHeaders,c=i&&i.httpHeaderAccept;void 0===c&&(c=this.configuration.selectHeaderAccept(["application/json"])),void 0!==c&&(o=o.set("Accept",c));let d=i&&i.context;void 0===d&&(d=new A0);let p="json";return c&&(p=c.startsWith("text")?"text":this.configuration.isJsonMime(c)?"json":"blob"),this.httpClient.request("get",`${this.configuration.basePath}/api/v1/devices`,{context:d,responseType:p,withCredentials:this.configuration.withCredentials,headers:o,observe:n,reportProgress:r})}}return e.\u0275fac=function(n){return new(n||e)(St(WP),St(AG,8),St(QP,8))},e.\u0275prov=Ot({token:e,factory:e.\u0275fac,providedIn:"root"}),e})();class kG extends _r{constructor(t,n){super()}schedule(t,n=0){return this}}const P0={setInterval(e,t,...n){const{delegate:r}=P0;return r?.setInterval?r.setInterval(e,t,...n):setInterval(e,t,...n)},clearInterval(e){const{delegate:t}=P0;return(t?.clearInterval||clearInterval)(e)},delegate:void 0},pE={now:()=>(pE.delegate||Date).now(),delegate:void 0};class Iy{constructor(t,n=Iy.now){this.schedulerActionCtor=t,this.now=n}schedule(t,n=0,r){return new this.schedulerActionCtor(this,t).schedule(r,n)}}Iy.now=pE.now;const eR=new class RG extends Iy{constructor(t,n=Iy.now){super(t,n),this.actions=[],this._active=!1}flush(t){const{actions:n}=this;if(this._active)return void n.push(t);let r;this._active=!0;do{if(r=t.execute(t.state,t.delay))break}while(t=n.shift());if(this._active=!1,r){for(;t=n.shift();)t.unsubscribe();throw r}}}(class PG extends kG{constructor(t,n){super(t,n),this.scheduler=t,this.work=n,this.pending=!1}schedule(t,n=0){var r;if(this.closed)return this;this.state=t;const i=this.id,o=this.scheduler;return null!=i&&(this.id=this.recycleAsyncId(o,i,n)),this.pending=!0,this.delay=n,this.id=null!==(r=this.id)&&void 0!==r?r:this.requestAsyncId(o,this.id,n),this}requestAsyncId(t,n,r=0){return P0.setInterval(t.flush.bind(t,this),r)}recycleAsyncId(t,n,r=0){if(null!=r&&this.delay===r&&!1===this.pending)return n;null!=n&&P0.clearInterval(n)}execute(t,n){if(this.closed)return new Error("executing a cancelled action");this.pending=!1;const r=this._execute(t,n);if(r)return r;!1===this.pending&&null!=this.id&&(this.id=this.recycleAsyncId(this.scheduler,this.id,null))}_execute(t,n){let i,r=!1;try{this.work(t)}catch(o){r=!0,i=o||new Error("Scheduled action threw falsy error")}if(r)return this.unsubscribe(),i}unsubscribe(){if(!this.closed){const{id:t,scheduler:n}=this,{actions:r}=n;this.work=this.state=this.scheduler=null,this.pending=!1,b(r,this),null!=t&&(this.id=this.recycleAsyncId(n,t,null)),this.delay=null,super.unsubscribe()}}}),FG=eR;class R0 extends oi{constructor(t=1/0,n=1/0,r=pE){super(),this._bufferSize=t,this._windowTime=n,this._timestampProvider=r,this._buffer=[],this._infiniteTimeWindow=!0,this._infiniteTimeWindow=n===1/0,this._bufferSize=Math.max(1,t),this._windowTime=Math.max(1,n)}next(t){const{isStopped:n,_buffer:r,_infiniteTimeWindow:i,_timestampProvider:o,_windowTime:c}=this;n||(r.push(t),!i&&r.push(o.now()+c)),this._trimBuffer(),super.next(t)}_subscribe(t){this._throwIfClosed(),this._trimBuffer();const n=this._innerSubscribe(t),{_infiniteTimeWindow:r,_buffer:i}=this,o=i.slice();for(let c=0;c{class e{constructor(n){this.paxService=n,this.errorMessage="",this.lastDataUpdate=new Date,this.dataSubject=new R0,this.activeDeviceSubject=new R0,this.allSamples=[],this.allActiveDevices=[],this.fetchData()}activeDevices(){return this.activeDeviceSubject}fetchData(){let r=""+((new Date).getTime()-864e5),i=""+(new Date).getTime();this.lastDataUpdate=new Date,this.paxService.paxServiceListData(r,i).subscribe({next:o=>{o.data&&(this.allSamples=o.data),this.allSamples.forEach(c=>{c.samples?.forEach(d=>{this.dataSubject.next({id:c.deviceId||"",name:c.deviceName||"",time:new Date(parseInt(d.timestamp)),ble:d.bluetoothCount||0,wifi:d.wifiCount||0})})}),this.allActiveDevices=this.allSamples.map(c=>({id:c.deviceId,name:c.deviceName,lat:c.lat,lon:c.lon})),this.allActiveDevices.forEach(c=>{this.activeDeviceSubject.next(c),this.allActiveDevices.push(c)})},error:o=>{this.errorMessage=o.message,this.activeDeviceSubject.error(o),this.dataSubject.complete()},complete:()=>{this.activeDeviceSubject.complete(),this.dataSubject.complete()}})}hasError(){return""!=this.errorMessage}allData(){return(new Date).getTime()-this.lastDataUpdate.getTime()>6e4&&(this.dataSubject=new R0,this.activeDeviceSubject=new R0,this.fetchData()),this.dataSubject}addMapMarkers(n){this.allActiveDevices.forEach(r=>{if(r.lat&&0!=r.lat&&r.lon&&0!=r.lon){let i=new F0.Marker({color:"#ff0000"});i.setLngLat([r.lat,r.lon]),i.addTo(n)}})}}return e.\u0275fac=function(n){return new(n||e)(St(fE))},e.\u0275prov=Ot({token:e,factory:e.\u0275fac,providedIn:"root"}),e})();function xl(e,t){return null==e||null==t?NaN:et?1:e>=t?0:NaN}function BG(e){return 0|e.length}function VG(e){return!(e>0)}function UG(e){return"object"!=typeof e||"length"in e?e:Array.from(e)}function Ty(e,t){return null==e||null==t?NaN:te?1:t>=e?0:NaN}function mE(e,t){let r,n=0,i=0,o=0;if(void 0===t)for(let c of e)null!=c&&(c=+c)>=c&&(r=c-i,i+=r/++n,o+=r*(c-i));else{let c=-1;for(let d of e)null!=(d=t(d,++c,e))&&(d=+d)>=d&&(r=d-i,i+=r/++n,o+=r*(d-i))}if(n>1)return o/(n-1)}function tR(e,t){const n=mE(e,t);return n&&Math.sqrt(n)}function Qp(e,t){let n,r;if(void 0===t)for(const i of e)null!=i&&(void 0===n?i>=i&&(n=r=i):(n>i&&(n=i),r=o&&(n=r=o):(n>o&&(n=o),r=r.length)return n(o);const d=new L0,p=r[c++];let v=-1;for(const E of o){const D=p(E,++v,o),I=d.get(D);I?I.push(E):d.set(D,[E])}for(const[E,D]of d)d.set(E,i(D,c));return t(d)}(e,0)}function As(e,t){let n;if(void 0===t)for(const r of e)null!=r&&(n=r)&&(n=r);else{let r=-1;for(let i of e)null!=(i=t(i,++r,e))&&(n=i)&&(n=i)}return n}function qG(e,t){let n,r=-1,i=-1;if(void 0===t)for(const o of e)++i,null!=o&&(n=o)&&(n=o,r=i);else for(let o of e)null!=(o=t(o,++i,e))&&(n=o)&&(n=o,r=i);return r}function ZG(e,t){let n=0,r=0;if(void 0===t)for(let i of e)null!=i&&(i=+i)>=i&&(++n,r+=i);else{let i=-1;for(let o of e)null!=(o=t(o,++i,e))&&(o=+o)>=o&&(++n,r+=o)}if(n)return r/n}function ff(e,t){let n;if(void 0===t)for(const r of e)null!=r&&(n>r||void 0===n&&r>=r)&&(n=r);else{let r=-1;for(let i of e)null!=(i=t(i,++r,e))&&(n>i||void 0===n&&i>=i)&&(n=i)}return n}function vE(e,...t){if("function"!=typeof e[Symbol.iterator])throw new TypeError("values is not iterable");e=Array.from(e);let[n]=t;if(n&&2!==n.length||t.length>1){const r=Uint32Array.from(e,(i,o)=>o);return t.length>1?(t=t.map(i=>e.map(i)),r.sort((i,o)=>{for(const c of t){const d=ky(c[i],c[o]);if(d)return d}})):(n=e.map(n),r.sort((i,o)=>ky(n[i],n[o]))),function WG(e,t){return Array.from(t,n=>e[n])}(e,r)}return e.sort(bE(n))}function bE(e=xl){if(e===xl)return ky;if("function"!=typeof e)throw new TypeError("compare is not a function");return(t,n)=>{const r=e(t,n);return r||0===r?r:(0===e(n,n))-(0===e(t,t))}}function ky(e,t){return(null==e||!(e>=e))-(null==t||!(t>=t))||(et?1:0)}function lR(e,t,n=0,r=1/0,i){if(t=Math.floor(t),n=Math.floor(Math.max(0,n)),r=Math.floor(Math.min(e.length-1,r)),!(n<=t&&t<=r))return e;for(i=void 0===i?ky:bE(i);r>n;){if(r-n>600){const p=r-n+1,v=t-n+1,E=Math.log(p),D=.5*Math.exp(2*E/3),I=.5*Math.sqrt(E*D*(p-D)/p)*(v-p/2<0?-1:1);lR(e,t,Math.max(n,Math.floor(t-v*D/p+I)),Math.min(r,Math.floor(t+(p-v)*D/p+I)),i)}const o=e[t];let c=n,d=r;for(Py(e,n,t),i(e[r],o)>0&&Py(e,n,r);c0;)--d}0===i(e[n],o)?Py(e,n,d):(++d,Py(e,d,r)),d<=t&&(n=d+1),t<=d&&(r=d-1)}return e}function Py(e,t,n){const r=e[t];e[t]=e[n],e[n]=r}function cR(e){return null===e?NaN:+e}function N0(e,t,n){if(e=Float64Array.from(function*XG(e,t){if(void 0===t)for(let n of e)null!=n&&(n=+n)>=n&&(yield n);else{let n=-1;for(let r of e)null!=(r=t(r,++n,e))&&(r=+r)>=r&&(yield r)}}(e,n)),(r=e.length)&&!isNaN(t=+t)){if(t<=0||r<2)return ff(e);if(t>=1)return As(e);var r,i=(r-1)*t,o=Math.floor(i),c=As(lR(e,o).subarray(0,o+1));return c+(ff(e.subarray(o+1))-c)*(i-o)}}function YG(e,t,n=cR){if((r=e.length)&&!isNaN(t=+t)){if(t<=0||r<2)return+n(e[0],0,e);if(t>=1)return+n(e[r-1],r-1,e);var r,i=(r-1)*t,o=Math.floor(i),c=+n(e[o],o,e);return c+(+n(e[o+1],o+1,e)-c)*(i-o)}}function z0(e,t){return N0(e,.5,t)}function KG(e,t){let n,r=-1,i=-1;if(void 0===t)for(const o of e)++i,null!=o&&(n>o||void 0===n&&o>=o)&&(n=o,r=i);else for(let o of e)null!=(o=t(o,++i,e))&&(n>o||void 0===n&&o>=o)&&(n=o,r=i);return r}function uR(e,t){const n=new L0;if(void 0===t)for(let o of e)null!=o&&o>=o&&n.set(o,(n.get(o)||0)+1);else{let o=-1;for(let c of e)null!=(c=t(c,++o,e))&&c>=c&&n.set(c,(n.get(c)||0)+1)}let r,i=0;for(const[o,c]of n)c>i&&(i=c,r=o);return r}function hR(e,t,n){e=+e,t=+t,n=(i=arguments.length)<2?(t=e,e=0,1):i<3?1:+n;for(var r=-1,i=0|Math.max(0,Math.ceil((t-e)/n)),o=new Array(i);++rt(n[d],n[p]);let o,c;return(e=Uint32Array.from(n,(d,p)=>p)).sort(t===xl?(d,p)=>ky(n[d],n[p]):bE(i)),e.forEach((d,p)=>{const v=i(d,void 0===o?d:o);v>=0?((void 0===o||v>0)&&(o=d,c=p),r[d]=c):r[d]=NaN}),r}function B0(e,t){let n=0;if(void 0===t)for(let r of e)(r=+r)&&(n+=r);else{let r=-1;for(let i of e)(i=+t(i,++r,e))&&(n+=i)}return n}const JG=Math.sqrt(50),QG=Math.sqrt(10),eq=Math.sqrt(2);function V0(e,t,n){const r=(t-e)/Math.max(0,n),i=Math.floor(Math.log10(r)),o=r/Math.pow(10,i),c=o>=JG?10:o>=QG?5:o>=eq?2:1;let d,p,v;return i<0?(v=Math.pow(10,-i)/c,d=Math.round(e*v),p=Math.round(t*v),d/vt&&--p,v=-v):(v=Math.pow(10,i)*c,d=Math.round(e/v),p=Math.round(t/v),d*vt&&--p),p0))return[];if((e=+e)==(t=+t))return[e];const r=t=i))return[];const d=o-i+1,p=new Array(d);if(r)if(c<0)for(let v=0;v+e(t)}function oq(e,t){return t=Math.max(0,e.bandwidth()-2*t)/2,e.round()&&(t=Math.round(t)),n=>+e(n)+t}function sq(){return!this.__axis}function G0(e,t){var n=[],r=null,i=null,o=6,c=6,d=3,p=typeof window<"u"&&window.devicePixelRatio>1?0:.5,v=1===e||4===e?-1:1,E=4===e||2===e?"x":"y",D=1===e||3===e?nq:rq;function I(P){var N=r??(t.ticks?t.ticks.apply(t,n):t.domain()),G=i??(t.tickFormat?t.tickFormat.apply(t,n):tq),U=Math.max(o,0)+d,Z=t.range(),ne=+Z[0]+p,X=+Z[Z.length-1]+p,re=(t.bandwidth?oq:iq)(t.copy(),p),fe=P.selection?P.selection():P,ve=fe.selectAll(".domain").data([null]),Re=fe.selectAll(".tick").data(N,t).order(),We=Re.exit(),Ke=Re.enter().append("g").attr("class","tick"),lt=Re.select("line"),Ue=Re.select("text");ve=ve.merge(ve.enter().insert("path",".tick").attr("class","domain").attr("stroke","currentColor")),Re=Re.merge(Ke),lt=lt.merge(Ke.append("line").attr("stroke","currentColor").attr(E+"2",v*o)),Ue=Ue.merge(Ke.append("text").attr("fill","currentColor").attr(E,v*U).attr("dy",1===e?"0em":3===e?"0.71em":"0.32em")),P!==fe&&(ve=ve.transition(P),Re=Re.transition(P),lt=lt.transition(P),Ue=Ue.transition(P),We=We.transition(P).attr("opacity",1e-6).attr("transform",function(st){return isFinite(st=re(st))?D(st+p):this.getAttribute("transform")}),Ke.attr("opacity",1e-6).attr("transform",function(st){var Fe=this.parentNode.__axis;return D((Fe&&isFinite(Fe=Fe(st))?Fe:re(st))+p)})),We.remove(),ve.attr("d",4===e||2===e?c?"M"+v*c+","+ne+"H"+p+"V"+X+"H"+v*c:"M"+p+","+ne+"V"+X:c?"M"+ne+","+v*c+"V"+p+"H"+X+"V"+v*c:"M"+ne+","+p+"H"+X),Re.attr("opacity",1).attr("transform",function(st){return D(re(st)+p)}),lt.attr(E+"2",v*o),Ue.attr(E,v*U).text(G),fe.filter(sq).attr("fill","none").attr("font-size",10).attr("font-family","sans-serif").attr("text-anchor",2===e?"start":4===e?"end":"middle"),fe.each(function(){this.__axis=re})}return I.scale=function(P){return arguments.length?(t=P,I):t},I.ticks=function(){return n=Array.from(arguments),I},I.tickArguments=function(P){return arguments.length?(n=null==P?[]:Array.from(P),I):n.slice()},I.tickValues=function(P){return arguments.length?(r=null==P?null:Array.from(P),I):r&&r.slice()},I.tickFormat=function(P){return arguments.length?(i=P,I):i},I.tickSize=function(P){return arguments.length?(o=c=+P,I):o},I.tickSizeInner=function(P){return arguments.length?(o=+P,I):o},I.tickSizeOuter=function(P){return arguments.length?(c=+P,I):c},I.tickPadding=function(P){return arguments.length?(d=+P,I):d},I.offset=function(P){return arguments.length?(p=+P,I):p},I}function lq(){}function EE(e){return null==e?lq:function(){return this.querySelector(e)}}function uq(e){return null==e?[]:Array.isArray(e)?e:Array.from(e)}function hq(){return[]}function pR(e){return null==e?hq:function(){return this.querySelectorAll(e)}}function mR(e){return function(){return this.matches(e)}}function gR(e){return function(t){return t.matches(e)}}var pq=Array.prototype.find;function gq(){return this.firstElementChild}var _q=Array.prototype.filter;function vq(){return Array.from(this.children)}function yR(e){return new Array(e.length)}function q0(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}function Eq(e){return function(){return e}}function Dq(e,t,n,r,i,o){for(var d,c=0,p=t.length,v=o.length;ct?1:e>=t?0:NaN}q0.prototype={constructor:q0,appendChild:function(e){return this._parent.insertBefore(e,this._next)},insertBefore:function(e,t){return this._parent.insertBefore(e,t)},querySelector:function(e){return this._parent.querySelector(e)},querySelectorAll:function(e){return this._parent.querySelectorAll(e)}};var DE="http://www.w3.org/1999/xhtml";const tm={svg:"http://www.w3.org/2000/svg",xhtml:DE,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function Z0(e){var t=e+="",n=t.indexOf(":");return n>=0&&"xmlns"!==(t=e.slice(0,n))&&(e=e.slice(n+1)),tm.hasOwnProperty(t)?{space:tm[t],local:e}:e}function $q(e){return function(){this.removeAttribute(e)}}function jq(e){return function(){this.removeAttributeNS(e.space,e.local)}}function Hq(e,t){return function(){this.setAttribute(e,t)}}function Gq(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function qq(e,t){return function(){var n=t.apply(this,arguments);null==n?this.removeAttribute(e):this.setAttribute(e,n)}}function Zq(e,t){return function(){var n=t.apply(this,arguments);null==n?this.removeAttributeNS(e.space,e.local):this.setAttributeNS(e.space,e.local,n)}}function _R(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function Xq(e){return function(){this.style.removeProperty(e)}}function Yq(e,t,n){return function(){this.style.setProperty(e,t,n)}}function Kq(e,t,n){return function(){var r=t.apply(this,arguments);null==r?this.style.removeProperty(e):this.style.setProperty(e,r,n)}}function nm(e,t){return e.style.getPropertyValue(t)||_R(e).getComputedStyle(e,null).getPropertyValue(t)}function Qq(e){return function(){delete this[e]}}function eZ(e,t){return function(){this[e]=t}}function tZ(e,t){return function(){var n=t.apply(this,arguments);null==n?delete this[e]:this[e]=n}}function vR(e){return e.trim().split(/^|\s+/)}function SE(e){return e.classList||new bR(e)}function bR(e){this._node=e,this._names=vR(e.getAttribute("class")||"")}function xR(e,t){for(var n=SE(e),r=-1,i=t.length;++r=0&&(n=t.slice(r+1),t=t.slice(0,r)),{type:t,name:n}})}function PZ(e){return function(){var t=this.__on;if(t){for(var o,n=0,r=-1,i=t.length;n=0&&(this._names.splice(t,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(e){return this._names.indexOf(e)>=0}};var ER=[null];function Js(e,t){this._groups=e,this._parents=t}function DR(){return new Js([[document.documentElement]],ER)}Js.prototype=DR.prototype={constructor:Js,select:function cq(e){"function"!=typeof e&&(e=EE(e));for(var t=this._groups,n=t.length,r=new Array(n),i=0;i=X&&(X=ne+1);!(fe=U[X])&&++X=0;)(c=r[i])&&(o&&4^c.compareDocumentPosition(o)&&o.parentNode.insertBefore(c,o),o=c);return this},sort:function Fq(e){function t(D,I){return D&&I?e(D.__data__,I.__data__):!D-!I}e||(e=Oq);for(var n=this._groups,r=n.length,i=new Array(r),o=0;o1?this.each((null==t?Xq:"function"==typeof t?Kq:Yq)(e,t,n??"")):nm(this.node(),e)},property:function nZ(e,t){return arguments.length>1?this.each((null==t?Qq:"function"==typeof t?tZ:eZ)(e,t)):this.node()[e]},classed:function sZ(e,t){var n=vR(e+"");if(arguments.length<2){for(var r=SE(this.node()),i=-1,o=n.length;++i{}};function SR(){for(var r,e=0,t=arguments.length,n={};e=0&&(r=n.slice(i+1),n=n.slice(0,i)),n&&!t.hasOwnProperty(n))throw new Error("unknown type: "+n);return{type:n,name:r}})}function $Z(e,t){for(var i,n=0,r=e.length;n0)for(var i,o,n=new Array(i),r=0;r=0&&e._call.call(void 0,t),e=e._next;--rm}()}finally{rm=0,function ZZ(){for(var e,n,t=X0,r=1/0;t;)t._call?(r>t._time&&(r=t._time),e=t,t=t._next):(n=t._next,t._next=null,t=e?e._next=n:X0=n);Ny=e,TE(r)}(),pf=0}}function qZ(){var e=zy.now(),t=e-Y0;t>1e3&&(K0-=t,Y0=e)}function TE(e){rm||(Oy&&(Oy=clearTimeout(Oy)),e-pf>24?(e<1/0&&(Oy=setTimeout(kR,e-zy.now()-K0)),Ly&&(Ly=clearInterval(Ly))):(Ly||(Y0=zy.now(),Ly=setInterval(qZ,1e3)),rm=1,TR(kR)))}function PR(e,t,n){var r=new J0;return r.restart(i=>{r.stop(),e(i+t)},t=null==t?0:+t,n),r}J0.prototype=AR.prototype={constructor:J0,restart:function(e,t,n){if("function"!=typeof e)throw new TypeError("callback is not a function");n=(null==n?IE():+n)+(null==t?0:+t),!this._next&&Ny!==this&&(Ny?Ny._next=this:X0=this,Ny=this),this._call=e,this._time=n,TE()},stop:function(){this._call&&(this._call=null,this._time=1/0,TE())}};var WZ=jZ("start","end","cancel","interrupt"),XZ=[];function tb(e,t,n,r,i,o){var c=e.__transition;if(c){if(n in c)return}else e.__transition={};!function YZ(e,t,n){var i,r=e.__transition;function c(v){var E,D,I,P;if(1!==n.state)return p();for(E in r)if((P=r[E]).name===n.name){if(3===P.state)return PR(c);4===P.state?(P.state=6,P.timer.stop(),P.on.call("interrupt",e,e.__data__,P.index,P.group),delete r[E]):+E0)throw new Error("too late; already scheduled");return n}function yc(e,t){var n=wl(e,t);if(n.state>3)throw new Error("too late; already running");return n}function wl(e,t){var n=e.__transition;if(!n||!(n=n[t]))throw new Error("transition not found");return n}function Uo(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}var nb,LR=180/Math.PI,RE={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function NR(e,t,n,r,i,o){var c,d,p;return(c=Math.sqrt(e*e+t*t))&&(e/=c,t/=c),(p=e*n+t*r)&&(n-=e*p,r-=t*p),(d=Math.sqrt(n*n+r*r))&&(n/=d,r/=d,p/=d),e*r180?E+=360:E-v>180&&(v+=360),I.push({i:D.push(i(D)+"rotate(",null,r)-2,x:Uo(v,E)})):E&&D.push(i(D)+"rotate("+E+r)}(v.rotate,E.rotate,D,I),function d(v,E,D,I){v!==E?I.push({i:D.push(i(D)+"skewX(",null,r)-2,x:Uo(v,E)}):E&&D.push(i(D)+"skewX("+E+r)}(v.skewX,E.skewX,D,I),function p(v,E,D,I,P,N){if(v!==D||E!==I){var G=P.push(i(P)+"scale(",null,",",null,")");N.push({i:G-4,x:Uo(v,D)},{i:G-2,x:Uo(E,I)})}else(1!==D||1!==I)&&P.push(i(P)+"scale("+D+","+I+")")}(v.scaleX,v.scaleY,E.scaleX,E.scaleY,D,I),v=E=null,function(P){for(var U,N=-1,G=I.length;++N>8&15|t>>4&240,t>>4&15|240&t,(15&t)<<4|15&t,1):8===n?rb(t>>24&255,t>>16&255,t>>8&255,(255&t)/255):4===n?rb(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|240&t,((15&t)<<4|15&t)/255):null):(t=aW.exec(e))?new Ji(t[1],t[2],t[3],1):(t=lW.exec(e))?new Ji(255*t[1]/100,255*t[2]/100,255*t[3]/100,1):(t=cW.exec(e))?rb(t[1],t[2],t[3],t[4]):(t=uW.exec(e))?rb(255*t[1]/100,255*t[2]/100,255*t[3]/100,t[4]):(t=hW.exec(e))?GR(t[1],t[2]/100,t[3]/100,1):(t=dW.exec(e))?GR(t[1],t[2]/100,t[3]/100,t[4]):BR.hasOwnProperty(e)?$R(BR[e]):"transparent"===e?new Ji(NaN,NaN,NaN,0):null}function $R(e){return new Ji(e>>16&255,e>>8&255,255&e,1)}function rb(e,t,n,r){return r<=0&&(e=t=n=NaN),new Ji(e,t,n,r)}function OE(e){return e instanceof kh||(e=Ph(e)),e?new Ji((e=e.rgb()).r,e.g,e.b,e.opacity):new Ji}function Rh(e,t,n,r){return 1===arguments.length?OE(e):new Ji(e,t,n,r??1)}function Ji(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}function jR(){return`#${yf(this.r)}${yf(this.g)}${yf(this.b)}`}function HR(){const e=ib(this.opacity);return`${1===e?"rgb(":"rgba("}${gf(this.r)}, ${gf(this.g)}, ${gf(this.b)}${1===e?")":`, ${e})`}`}function ib(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function gf(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function yf(e){return((e=gf(e))<16?"0":"")+e.toString(16)}function GR(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new Cl(e,t,n,r)}function qR(e){if(e instanceof Cl)return new Cl(e.h,e.s,e.l,e.opacity);if(e instanceof kh||(e=Ph(e)),!e)return new Cl;if(e instanceof Cl)return e;var t=(e=e.rgb()).r/255,n=e.g/255,r=e.b/255,i=Math.min(t,n,r),o=Math.max(t,n,r),c=NaN,d=o-i,p=(o+i)/2;return d?(c=t===o?(n-r)/d+6*(n0&&p<1?0:c,new Cl(c,d,p,e.opacity)}function LE(e,t,n,r){return 1===arguments.length?qR(e):new Cl(e,t,n,r??1)}function Cl(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}function ZR(e){return(e=(e||0)%360)<0?e+360:e}function ob(e){return Math.max(0,Math.min(1,e||0))}function NE(e,t,n){return 255*(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)}function WR(e,t,n,r,i){var o=e*e,c=o*e;return((1-3*e+3*o-c)*t+(4-6*o+3*c)*n+(1+3*e+3*o-3*c)*r+c*i)/6}im(kh,Ph,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:VR,formatHex:VR,formatHex8:function fW(){return this.rgb().formatHex8()},formatHsl:function pW(){return qR(this).formatHsl()},formatRgb:UR,toString:UR}),im(Ji,Rh,By(kh,{brighter(e){return e=null==e?om:Math.pow(om,e),new Ji(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=null==e?.7:Math.pow(.7,e),new Ji(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new Ji(gf(this.r),gf(this.g),gf(this.b),ib(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:jR,formatHex:jR,formatHex8:function mW(){return`#${yf(this.r)}${yf(this.g)}${yf(this.b)}${yf(255*(isNaN(this.opacity)?1:this.opacity))}`},formatRgb:HR,toString:HR})),im(Cl,LE,By(kh,{brighter(e){return e=null==e?om:Math.pow(om,e),new Cl(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=null==e?.7:Math.pow(.7,e),new Cl(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+360*(this.h<0),t=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*t,i=2*n-r;return new Ji(NE(e>=240?e-240:e+120,i,r),NE(e,i,r),NE(e<120?e+240:e-120,i,r),this.opacity)},clamp(){return new Cl(ZR(this.h),ob(this.s),ob(this.l),ib(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const e=ib(this.opacity);return`${1===e?"hsl(":"hsla("}${ZR(this.h)}, ${100*ob(this.s)}%, ${100*ob(this.l)}%${1===e?")":`, ${e})`}`}}));const sb=e=>()=>e;function XR(e,t){return function(n){return e+n*t}}function zE(e,t){var n=t-e;return n?XR(e,n>180||n<-180?n-360*Math.round(n/360):n):sb(isNaN(e)?t:e)}function Qi(e,t){var n=t-e;return n?XR(e,n):sb(isNaN(e)?t:e)}const _f=function e(t){var n=function vW(e){return 1==(e=+e)?Qi:function(t,n){return n-t?function _W(e,t,n){return e=Math.pow(e,n),t=Math.pow(t,n)-e,n=1/n,function(r){return Math.pow(e+r*t,n)}}(t,n,e):sb(isNaN(t)?n:t)}}(t);function r(i,o){var c=n((i=Rh(i)).r,(o=Rh(o)).r),d=n(i.g,o.g),p=n(i.b,o.b),v=Qi(i.opacity,o.opacity);return function(E){return i.r=c(E),i.g=d(E),i.b=p(E),i.opacity=v(E),i+""}}return r.gamma=e,r}(1);function YR(e){return function(t){var c,d,n=t.length,r=new Array(n),i=new Array(n),o=new Array(n);for(c=0;c=1?(n=1,t-1):Math.floor(n*t),i=e[r],o=e[r+1];return WR((n-r/t)*t,r>0?e[r-1]:2*i-o,i,o,rn&&(o=t.slice(n,o),d[c]?d[c]+=o:d[++c]=o),(r=r[0])===(i=i[0])?d[c]?d[c]+=i:d[++c]=i:(d[++c]=null,p.push({i:c,x:Uo(r,i)})),n=VE.lastIndex;return n=0&&(t=t.slice(0,n)),!t||"start"===t})}(t)?PE:yc;return function(){var c=o(this,e),d=c.on;d!==r&&(i=(r=d).copy()).on(t,n),c.on=i}}var eX=Fy.prototype.constructor;function QR(e){return function(){this.style.removeProperty(e)}}function aX(e,t,n){return function(r){this.style.setProperty(e,t.call(this,r),n)}}function lX(e,t,n){var r,i;function o(){var c=t.apply(this,arguments);return c!==i&&(r=(i=c)&&aX(e,c,n)),r}return o._value=t,o}function fX(e){return function(t){this.textContent=e.call(this,t)}}function pX(e){var t,n;function r(){var i=e.apply(this,arguments);return i!==n&&(t=(n=i)&&fX(i)),t}return r._value=e,r}var _X=0;function pu(e,t,n,r){this._groups=e,this._parents=t,this._name=n,this._id=r}function eF(){return++_X}var mu=Fy.prototype;pu.prototype=function vX(e){return Fy().transition(e)}.prototype={constructor:pu,select:function JW(e){var t=this._name,n=this._id;"function"!=typeof e&&(e=EE(e));for(var r=this._groups,i=r.length,o=new Array(i),c=0;c2&&r.state<5,r.state=6,r.timer.stop(),r.on.call(i?"interrupt":"cancel",e,e.__data__,r.index,r.group),delete n[c]):o=!1;o&&delete e.__transition}}(this,e)})},Fy.prototype.transition=function CX(e){var t,n;e instanceof pu?(t=e._id,e=e._name):(t=eF(),(n=xX).time=IE(),e=null==e?null:e+"");for(var r=this._groups,i=r.length,o=0;o1?r[0]+r.slice(2):r,+e.slice(n+1)]}function cm(e){return(e=cb(Math.abs(e)))?e[1]:NaN}["w","e"].map(Uy),["n","s"].map(Uy),["n","w","e","s","nw","ne","sw","se"].map(Uy);var sF,FX=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function $y(e){if(!(t=FX.exec(e)))throw new Error("invalid format: "+e);var t;return new GE({fill:t[1],align:t[2],sign:t[3],symbol:t[4],zero:t[5],width:t[6],comma:t[7],precision:t[8]&&t[8].slice(1),trim:t[9],type:t[10]})}function GE(e){this.fill=void 0===e.fill?" ":e.fill+"",this.align=void 0===e.align?">":e.align+"",this.sign=void 0===e.sign?"-":e.sign+"",this.symbol=void 0===e.symbol?"":e.symbol+"",this.zero=!!e.zero,this.width=void 0===e.width?void 0:+e.width,this.comma=!!e.comma,this.precision=void 0===e.precision?void 0:+e.precision,this.trim=!!e.trim,this.type=void 0===e.type?"":e.type+""}function aF(e,t){var n=cb(e,t);if(!n)return e+"";var r=n[0],i=n[1];return i<0?"0."+new Array(-i).join("0")+r:r.length>i+1?r.slice(0,i+1)+"."+r.slice(i+1):r+new Array(i-r.length+2).join("0")}$y.prototype=GE.prototype,GE.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(void 0===this.width?"":Math.max(1,0|this.width))+(this.comma?",":"")+(void 0===this.precision?"":"."+Math.max(0,0|this.precision))+(this.trim?"~":"")+this.type};const lF={"%":(e,t)=>(100*e).toFixed(t),b:e=>Math.round(e).toString(2),c:e=>e+"",d:function kX(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString("en").replace(/,/g,""):e.toString(10)},e:(e,t)=>e.toExponential(t),f:(e,t)=>e.toFixed(t),g:(e,t)=>e.toPrecision(t),o:e=>Math.round(e).toString(8),p:(e,t)=>aF(100*e,t),r:aF,s:function LX(e,t){var n=cb(e,t);if(!n)return e+"";var r=n[0],i=n[1],o=i-(sF=3*Math.max(-8,Math.min(8,Math.floor(i/3))))+1,c=r.length;return o===c?r:o>c?r+new Array(o-c+1).join("0"):o>0?r.slice(0,o)+"."+r.slice(o):"0."+new Array(1-o).join("0")+cb(e,Math.max(0,t+o-1))[0]},X:e=>Math.round(e).toString(16).toUpperCase(),x:e=>Math.round(e).toString(16)};function cF(e){return e}var ub,um,dF,uF=Array.prototype.map,hF=["y","z","a","f","p","n","\xb5","m","","k","M","G","T","P","E","Z","Y"];!function zX(e){ub=function NX(e){var t=void 0===e.grouping||void 0===e.thousands?cF:function PX(e,t){return function(n,r){for(var i=n.length,o=[],c=0,d=e[0],p=0;i>0&&d>0&&(p+d+1>r&&(d=Math.max(1,r-p)),o.push(n.substring(i-=d,i+d)),!((p+=d+1)>r));)d=e[c=(c+1)%e.length];return o.reverse().join(t)}}(uF.call(e.grouping,Number),e.thousands+""),n=void 0===e.currency?"":e.currency[0]+"",r=void 0===e.currency?"":e.currency[1]+"",i=void 0===e.decimal?".":e.decimal+"",o=void 0===e.numerals?cF:function RX(e){return function(t){return t.replace(/[0-9]/g,function(n){return e[+n]})}}(uF.call(e.numerals,String)),c=void 0===e.percent?"%":e.percent+"",d=void 0===e.minus?"\u2212":e.minus+"",p=void 0===e.nan?"NaN":e.nan+"";function v(D){var I=(D=$y(D)).fill,P=D.align,N=D.sign,G=D.symbol,U=D.zero,Z=D.width,ne=D.comma,X=D.precision,re=D.trim,fe=D.type;"n"===fe?(ne=!0,fe="g"):lF[fe]||(void 0===X&&(X=12),re=!0,fe="g"),(U||"0"===I&&"="===P)&&(U=!0,I="0",P="=");var ve="$"===G?n:"#"===G&&/[boxX]/.test(fe)?"0"+fe.toLowerCase():"",Re="$"===G?r:/[%p]/.test(fe)?c:"",We=lF[fe],Ke=/[defgprs%]/.test(fe);function lt(Ue){var le,de,pe,st=ve,Fe=Re;if("c"===fe)Fe=We(Ue)+Fe,Ue="";else{var Oe=(Ue=+Ue)<0||1/Ue<0;if(Ue=isNaN(Ue)?p:We(Math.abs(Ue),X),re&&(Ue=function OX(e){e:for(var i,t=e.length,n=1,r=-1;n0&&(r=0)}return r>0?e.slice(0,r)+e.slice(i+1):e}(Ue)),Oe&&0==+Ue&&"+"!==N&&(Oe=!1),st=(Oe?"("===N?N:d:"-"===N||"("===N?"":N)+st,Fe=("s"===fe?hF[8+sF/3]:"")+Fe+(Oe&&"("===N?")":""),Ke)for(le=-1,de=Ue.length;++le(pe=Ue.charCodeAt(le))||pe>57){Fe=(46===pe?i+Ue.slice(le+1):Ue.slice(le))+Fe,Ue=Ue.slice(0,le);break}}ne&&!U&&(Ue=t(Ue,1/0));var Ye=st.length+Ue.length+Fe.length,Ze=Ye>1)+st+Ue+Fe+Ze.slice(Ye);break;default:Ue=Ze+st+Ue+Fe}return o(Ue)}return X=void 0===X?6:/[gprs]/.test(fe)?Math.max(1,Math.min(21,X)):Math.max(0,Math.min(20,X)),lt.toString=function(){return D+""},lt}return{format:v,formatPrefix:function E(D,I){var P=v(((D=$y(D)).type="f",D)),N=3*Math.max(-8,Math.min(8,Math.floor(cm(I)/3))),G=Math.pow(10,-N),U=hF[8+N/3];return function(Z){return P(G*Z)+U}}}}(e),um=ub.format,dF=ub.formatPrefix}({thousands:",",grouping:[3],currency:["$",""]});var hn=1e-6,Dn=Math.PI,ei=Dn/2,pF=Dn/4,Qs=2*Dn,as=180/Dn,ti=Dn/180,fr=Math.abs,hm=Math.atan,yu=Math.atan2,xn=Math.cos,mF=(Math,Math.exp),hb=(Math,Math,Math.log),qE=Math.pow,sn=Math.sin,Sa=Math.sign||function(e){return e>0?1:e<0?-1:0},ks=Math.sqrt,ZE=Math.tan;function gF(e){return e>1?0:e<-1?Dn:Math.acos(e)}function Ma(e){return e>1?ei:e<-1?-ei:Math.asin(e)}function Ia(){}function yF(){var t,e=[];return{point:function(n,r,i){t.push([n,r,i])},lineStart:function(){e.push(t=[])},lineEnd:Ia,rejoin:function(){e.length>1&&e.push(e.pop().concat(e.shift()))},result:function(){var n=e;return e=[],t=null,n}}}function db(e,t){return fr(e[0]-t[0])=0;--d)i.point((D=E[d])[0],D[1]);else r(I.x,I.p.x,-1,i);I=I.p}E=(I=I.o).z,P=!P}while(!I.v);i.lineEnd()}}}function vF(e){if(t=e.length){for(var t,i,n=0,r=e[0];++n0)do{I.point(0===P||3===P?e:n,P>1?r:t)}while((P=(P+D+4)%4)!==N);else I.point(E[0],E[1])}function c(v,E){return fr(v[0]-e)0?0:3:fr(v[0]-n)0?2:1:fr(v[1]-t)0?1:0:E>0?3:2}function d(v,E){return p(v.x,E.x)}function p(v,E){var D=c(v,1),I=c(E,1);return D!==I?D-I:0===D?E[1]-v[1]:1===D?v[0]-E[0]:2===D?v[1]-E[1]:E[0]-v[0]}return function(v){var I,P,N,G,U,Z,ne,X,re,fe,ve,E=v,D=yF(),Re={point:We,lineStart:function st(){Re.point=le,P&&P.push(N=[]),fe=!0,re=!1,ne=X=NaN},lineEnd:function Fe(){I&&(le(G,U),Z&&re&&D.rejoin(),I.push(D.result())),Re.point=We,re&&E.lineEnd()},polygonStart:function lt(){E=D,I=[],P=[],ve=!0},polygonEnd:function Ue(){var de=function Ke(){for(var de=0,pe=0,Oe=P.length;per&&(jn-Ft)*(r-ir)>(pr-ir)*(e-Ft)&&++de:pr<=r&&(jn-Ft)*(r-ir)<(pr-ir)*(e-Ft)&&--de;return de}(),pe=ve&&de,Oe=(I=bF(I)).length;(pe||Oe)&&(v.polygonStart(),pe&&(v.lineStart(),o(null,null,1,v),v.lineEnd()),Oe&&_F(I,d,de,o,v),v.polygonEnd()),E=v,I=P=N=null}};function We(de,pe){i(de,pe)&&E.point(de,pe)}function le(de,pe){var Oe=i(de,pe);if(P&&N.push([de,pe]),fe)G=de,U=pe,Z=Oe,fe=!1,Oe&&(E.lineStart(),E.point(de,pe));else if(Oe&&re)E.point(de,pe);else{var Ye=[ne=Math.max(pb,Math.min(jy,ne)),X=Math.max(pb,Math.min(jy,X))],Ze=[de=Math.max(pb,Math.min(jy,de)),pe=Math.max(pb,Math.min(jy,pe))];!function BX(e,t,n,r,i,o){var N,c=e[0],d=e[1],E=0,D=1,I=t[0]-c,P=t[1]-d;if(N=n-c,I||!(N>0)){if(N/=I,I<0){if(N0){if(N>D)return;N>E&&(E=N)}if(N=i-c,I||!(N<0)){if(N/=I,I<0){if(N>D)return;N>E&&(E=N)}else if(I>0){if(N0)){if(N/=P,P<0){if(N0){if(N>D)return;N>E&&(E=N)}if(N=o-d,P||!(N<0)){if(N/=P,P<0){if(N>D)return;N>E&&(E=N)}else if(P>0){if(N0&&(e[0]=c+E*I,e[1]=d+E*P),D<1&&(t[0]=c+D*I,t[1]=d+D*P),!0}}}}}(Ye,Ze,e,t,n,r)?Oe&&(E.lineStart(),E.point(de,pe),ve=!1):(re||(E.lineStart(),E.point(Ye[0],Ye[1])),E.point(Ze[0],Ze[1]),Oe||E.lineEnd(),ve=!1)}ne=de,X=pe,re=Oe}return Re}}const WE=e=>e;function mb(e,t){e&&CF.hasOwnProperty(e.type)&&CF[e.type](e,t)}var wF={Feature:function(e,t){mb(e.geometry,t)},FeatureCollection:function(e,t){for(var n=e.features,r=-1,i=n.length;++r0){for(c=t[--n];n>0&&(r=c,i=t[--n],c=r+i,o=i-(c-r),!o););n>0&&(o<0&&t[n-1]<0||o>0&&t[n-1]>0)&&(i=2*o,r=c+i,i==r-c&&(c=r))}return c}}var DF,SF,JE,QE,YE=new _u,KE=new _u,Fh={point:Ia,lineStart:Ia,lineEnd:Ia,polygonStart:function(){Fh.lineStart=UX,Fh.lineEnd=jX},polygonEnd:function(){Fh.lineStart=Fh.lineEnd=Fh.point=Ia,YE.add(fr(KE)),KE=new _u},result:function(){var e=YE/2;return YE=new _u,e}};function UX(){Fh.point=$X}function $X(e,t){Fh.point=MF,DF=JE=e,SF=QE=t}function MF(e,t){KE.add(QE*e-JE*t),JE=e,QE=t}function jX(){MF(DF,SF)}const IF=Fh;var fm=1/0,gb=fm,Hy=-fm,yb=Hy;const _b={point:function GX(e,t){eHy&&(Hy=e),tyb&&(yb=t)},lineStart:Ia,lineEnd:Ia,polygonStart:Ia,polygonEnd:Ia,result:function(){var e=[[fm,gb],[Hy,yb]];return Hy=yb=-(gb=fm=1/0),e}};var TF,AF,vc,bc,eD=0,tD=0,Gy=0,vb=0,bb=0,pm=0,nD=0,rD=0,qy=0,El={point:vf,lineStart:kF,lineEnd:PF,polygonStart:function(){El.lineStart=WX,El.lineEnd=XX},polygonEnd:function(){El.point=vf,El.lineStart=kF,El.lineEnd=PF},result:function(){var e=qy?[nD/qy,rD/qy]:pm?[vb/pm,bb/pm]:Gy?[eD/Gy,tD/Gy]:[NaN,NaN];return eD=tD=Gy=vb=bb=pm=nD=rD=qy=0,e}};function vf(e,t){eD+=e,tD+=t,++Gy}function kF(){El.point=qX}function qX(e,t){El.point=ZX,vf(vc=e,bc=t)}function ZX(e,t){var n=e-vc,r=t-bc,i=ks(n*n+r*r);vb+=i*(vc+e)/2,bb+=i*(bc+t)/2,pm+=i,vf(vc=e,bc=t)}function PF(){El.point=vf}function WX(){El.point=YX}function XX(){RF(TF,AF)}function YX(e,t){El.point=RF,vf(TF=vc=e,AF=bc=t)}function RF(e,t){var n=e-vc,r=t-bc,i=ks(n*n+r*r);vb+=i*(vc+e)/2,bb+=i*(bc+t)/2,pm+=i,nD+=(i=bc*e-vc*t)*(vc+e),rD+=i*(bc+t),qy+=3*i,vf(vc=e,bc=t)}const FF=El;function OF(e){this._context=e}OF.prototype={_radius:4.5,pointRadius:function(e){return this._radius=e,this},polygonStart:function(){this._line=0},polygonEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){0===this._line&&this._context.closePath(),this._point=NaN},point:function(e,t){switch(this._point){case 0:this._context.moveTo(e,t),this._point=1;break;case 1:this._context.lineTo(e,t);break;default:this._context.moveTo(e+this._radius,t),this._context.arc(e,t,this._radius,0,Qs)}},result:Ia};var oD,LF,NF,Zy,Wy,iD=new _u,xb={point:Ia,lineStart:function(){xb.point=KX},lineEnd:function(){oD&&zF(LF,NF),xb.point=Ia},polygonStart:function(){oD=!0},polygonEnd:function(){oD=null},result:function(){var e=+iD;return iD=new _u,e}};function KX(e,t){xb.point=zF,LF=Zy=e,NF=Wy=t}function zF(e,t){iD.add(ks((Zy-=e)*Zy+(Wy-=t)*Wy)),Zy=e,Wy=t}const BF=xb;let VF,wb,UF,$F;class jF{constructor(t){this._append=null==t?HF:function JX(e){const t=Math.floor(e);if(!(t>=0))throw new RangeError(`invalid digits: ${e}`);if(t>15)return HF;if(t!==VF){const n=10**t;VF=t,wb=function(i){let o=1;this._+=i[0];for(const c=i.length;o=0))throw new RangeError(`invalid digits: ${d}`);n=p}return null===t&&(o=new jF(n)),c},c.projection(e).digits(n).context(t)}function aD(e){return[yu(e[1],e[0]),Ma(e[2])]}function mm(e){var t=e[0],n=e[1],r=xn(n);return[r*xn(t),r*sn(t),sn(n)]}function Cb(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]}function Eb(e,t){return[e[1]*t[2]-e[2]*t[1],e[2]*t[0]-e[0]*t[2],e[0]*t[1]-e[1]*t[0]]}function lD(e,t){e[0]+=t[0],e[1]+=t[1],e[2]+=t[2]}function Db(e,t){return[e[0]*t,e[1]*t,e[2]*t]}function cD(e){var t=ks(e[0]*e[0]+e[1]*e[1]+e[2]*e[2]);e[0]/=t,e[1]/=t,e[2]/=t}function uD(e){return fr(e[0])<=Dn?e[0]:Sa(e[0])*((fr(e[0])+Dn)%Qs-Dn)}function GF(e,t,n,r){return function(i){var v,E,D,o=t(i),c=yF(),d=t(c),p=!1,I={point:P,lineStart:G,lineEnd:U,polygonStart:function(){I.point=Z,I.lineStart=ne,I.lineEnd=X,E=[],v=[]},polygonEnd:function(){I.point=P,I.lineStart=G,I.lineEnd=U,E=bF(E);var re=function QX(e,t){var n=uD(t),r=t[1],i=sn(r),o=[sn(n),-xn(n),0],c=0,d=0,p=new _u;1===i?r=ei+hn:-1===i&&(r=-ei-hn);for(var v=0,E=e.length;v=0?1:-1,lt=Ke*We,Ue=lt>Dn,st=U*ve;if(p.add(yu(st*Ke*sn(lt),Z*Re+st*xn(lt))),c+=Ue?We+Ke*Qs:We,Ue^N>=n^re>=n){var Fe=Eb(mm(P),mm(X));cD(Fe);var le=Eb(o,Fe);cD(le);var de=(Ue^We>=0?-1:1)*Ma(le[2]);(r>de||r===de&&(Fe[0]||Fe[1]))&&(d+=Ue^We>=0?1:-1)}}return(c<-hn||c0){for(p||(i.polygonStart(),p=!0),i.lineStart(),ve=0;ve1&&2&re&&fe.push(fe.pop().concat(fe.shift())),E.push(fe.filter(eY))}}return I}}function eY(e){return e.length>1}function tY(e,t){return((e=e.x)[0]<0?e[1]-ei-hn:ei-e[1])-((t=t.x)[0]<0?t[1]-ei-hn:ei-t[1])}const qF=GF(function(){return!0},function nY(e){var i,t=NaN,n=NaN,r=NaN;return{lineStart:function(){e.lineStart(),i=1},point:function(o,c){var d=o>0?Dn:-Dn,p=fr(o-t);fr(p-Dn)0?ei:-ei),e.point(r,n),e.lineEnd(),e.lineStart(),e.point(d,n),e.point(o,n),i=0):r!==d&&p>=Dn&&(fr(t-r)hn?hm((sn(t)*(o=xn(r))*sn(n)-sn(r)*(i=xn(t))*sn(e))/(i*o*c)):(t+r)/2}(t,n,o,c),e.point(r,n),e.lineEnd(),e.lineStart(),e.point(d,n),i=0),e.point(t=o,n=c),r=d},lineEnd:function(){e.lineEnd(),t=n=NaN},clean:function(){return 2-i}}},function iY(e,t,n,r){var i;if(null==e)r.point(-Dn,i=n*ei),r.point(0,i),r.point(Dn,i),r.point(Dn,0),r.point(Dn,-i),r.point(0,-i),r.point(-Dn,-i),r.point(-Dn,0),r.point(-Dn,i);else if(fr(e[0]-t[0])>hn){var o=e[0]0,i=fr(t)>hn;function c(E,D){return xn(E)*xn(D)>t}function p(E,D,I){var G=[1,0,0],U=Eb(mm(E),mm(D)),Z=Cb(U,U),ne=U[0],X=Z-ne*ne;if(!X)return!I&&E;var re=t*Z/X,fe=-t*ne/X,ve=Eb(G,U),Re=Db(G,re);lD(Re,Db(U,fe));var Ke=ve,lt=Cb(Re,Ke),Ue=Cb(Ke,Ke),st=lt*lt-Ue*(Cb(Re,Re)-1);if(!(st<0)){var Fe=ks(st),le=Db(Ke,(-lt-Fe)/Ue);if(lD(le,Re),le=aD(le),!I)return le;var Ze,de=E[0],pe=D[0],Oe=E[1],Ye=D[1];pe0^le[1]<(fr(le[0]-de)Dn^(de<=le[0]&&le[0]<=pe)){var ir=Db(Ke,(-lt+Fe)/Ue);return lD(ir,Re),[le,aD(ir)]}}}function v(E,D){var I=r?e:Dn-e,P=0;return E<-I?P|=1:E>I&&(P|=2),D<-I?P|=4:D>I&&(P|=8),P}return GF(c,function d(E){var D,I,P,N,G;return{lineStart:function(){N=P=!1,G=1},point:function(U,Z){var X,ne=[U,Z],re=c(U,Z),fe=r?re?0:v(U,Z):re?v(U+(U<0?Dn:-Dn),Z):0;if(!D&&(N=P=re)&&E.lineStart(),re!==P&&(!(X=p(D,ne))||db(D,X)||db(ne,X))&&(ne[2]=1),re!==P)G=0,re?(E.lineStart(),X=p(ne,D),E.point(X[0],X[1])):(X=p(D,ne),E.point(X[0],X[1],2),E.lineEnd()),D=X;else if(i&&D&&r^re){var ve;!(fe&I)&&(ve=p(ne,D,!0))&&(G=0,r?(E.lineStart(),E.point(ve[0][0],ve[0][1]),E.point(ve[1][0],ve[1][1]),E.lineEnd()):(E.point(ve[1][0],ve[1][1]),E.lineEnd(),E.lineStart(),E.point(ve[0][0],ve[0][1],3)))}re&&(!D||!db(D,ne))&&E.point(ne[0],ne[1]),D=ne,P=re,I=fe},lineEnd:function(){P&&E.lineEnd(),D=null},clean:function(){return G|(N&&P)<<1}}},function o(E,D,I,P){!function ZF(e,t,n,r,i,o){if(n){var c=xn(t),d=sn(t),p=r*n;null==i?(i=t+r*Qs,o=t-p/2):(i=WF(c,i),o=WF(c,o),(r>0?io)&&(i+=r*Qs));for(var v,E=i;r>0?E>o:EDn&&(e-=Math.round(e/Qs)*Qs),[e,t]}function XF(e,t,n){return(e%=Qs)?t||n?hD(KF(e),JF(t,n)):KF(e):t||n?JF(t,n):dD}function YF(e){return function(t,n){return fr(t+=e)>Dn&&(t-=Math.round(t/Qs)*Qs),[t,n]}}function KF(e){var t=YF(e);return t.invert=YF(-e),t}function JF(e,t){var n=xn(e),r=sn(e),i=xn(t),o=sn(t);function c(d,p){var v=xn(p),E=xn(d)*v,D=sn(d)*v,I=sn(p),P=I*n+E*r;return[yu(D*i-P*o,E*n-I*r),Ma(P*i+D*o)]}return c.invert=function(d,p){var v=xn(p),E=xn(d)*v,D=sn(d)*v,I=sn(p),P=I*i-D*o;return[yu(D*i+I*o,E*n+P*r),Ma(P*n-E*r)]},c}function fD(e){return{stream:Sb(e)}}function Sb(e){return function(t){var n=new pD;for(var r in e)n[r]=e[r];return n.stream=t,n}}function pD(){}function mD(e,t,n){var r=e.clipExtent&&e.clipExtent();return e.scale(150).translate([0,0]),null!=r&&e.clipExtent(null),dm(n,e.stream(_b)),t(_b.result()),null!=r&&e.clipExtent(r),e}function gD(e,t,n){return mD(e,function(r){var i=t[1][0]-t[0][0],o=t[1][1]-t[0][1],c=Math.min(i/(r[1][0]-r[0][0]),o/(r[1][1]-r[0][1])),d=+t[0][0]+(i-c*(r[1][0]+r[0][0]))/2,p=+t[0][1]+(o-c*(r[1][1]+r[0][1]))/2;e.scale(150*c).translate([d,p])},n)}function QF(e,t,n){return gD(e,[[0,0],t],n)}function eO(e,t,n){return mD(e,function(r){var i=+t,o=i/(r[1][0]-r[0][0]),c=(i-o*(r[1][0]+r[0][0]))/2,d=-o*r[0][1];e.scale(150*o).translate([c,d])},n)}function tO(e,t,n){return mD(e,function(r){var i=+t,o=i/(r[1][1]-r[0][1]),c=-o*r[0][0],d=(i-o*(r[1][1]+r[0][1]))/2;e.scale(150*o).translate([c,d])},n)}dD.invert=dD,pD.prototype={constructor:pD,point:function(e,t){this.stream.point(e,t)},sphere:function(){this.stream.sphere()},lineStart:function(){this.stream.lineStart()},lineEnd:function(){this.stream.lineEnd()},polygonStart:function(){this.stream.polygonStart()},polygonEnd:function(){this.stream.polygonEnd()}};var aY=xn(30*ti);function rO(e,t){return+t?function cY(e,t){function n(r,i,o,c,d,p,v,E,D,I,P,N,G,U){var Z=v-r,ne=E-i,X=Z*Z+ne*ne;if(X>4*t&&G--){var re=c+I,fe=d+P,ve=p+N,Re=ks(re*re+fe*fe+ve*ve),We=Ma(ve/=Re),Ke=fr(fr(ve)-1)t||fr((Z*Fe+ne*le)/X-.5)>.3||c*I+d*P+p*N2?de[2]%360*ti:0,Fe()):[d*as,p*as,v*as]},Ue.angle=function(de){return arguments.length?(D=de%360*ti,Fe()):D*as},Ue.reflectX=function(de){return arguments.length?(I=de?-1:1,Fe()):I<0},Ue.reflectY=function(de){return arguments.length?(P=de?-1:1,Fe()):P<0},Ue.precision=function(de){return arguments.length?(ve=rO(Re,fe=de*de),le()):ks(fe)},Ue.fitExtent=function(de,pe){return gD(Ue,de,pe)},Ue.fitSize=function(de,pe){return QF(Ue,de,pe)},Ue.fitWidth=function(de,pe){return eO(Ue,de,pe)},Ue.fitHeight=function(de,pe){return tO(Ue,de,pe)},function(){return t=e.apply(this,arguments),Ue.invert=t.invert&&st,Fe()}}function yD(e){var t=0,n=Dn/3,r=oO(e),i=r(t,n);return i.parallels=function(o){return arguments.length?r(t=o[0]*ti,n=o[1]*ti):[t*as,n*as]},i}function pY(e,t){var n=sn(e),r=(n+sn(t))/2;if(fr(r)=.12&&U<.234&&G>=-.425&&G<-.214?i:U>=.166&&U<.234&&G>=-.214&&G<-.115?c:n).invert(I)},E.stream=function(I){return e&&t===I?e:e=function mY(e){var t=e.length;return{point:function(n,r){for(var i=-1;++i2?e[2]*ti:0),t.invert=function(n){return(n=e.invert(n[0]*ti,n[1]*ti))[0]*=as,n[1]*=as,n},t}(t.rotate()).invert([0,0]));return o(null==c?[[I[0]-D,I[1]-D],[I[0]+D,I[1]+D]]:e===Ib?[[Math.max(I[0]-D,c),d],[Math.min(I[0]+D,p),v]]:[[c,Math.max(I[1]-D,d)],[p,Math.min(I[1]+D,v)]])}return t.scale=function(D){return arguments.length?(r(D),E()):r()},t.translate=function(D){return arguments.length?(i(D),E()):i()},t.center=function(D){return arguments.length?(n(D),E()):n()},t.clipExtent=function(D){return arguments.length?(null==D?c=d=p=v=null:(c=+D[0][0],d=+D[0][1],p=+D[1][0],v=+D[1][1]),E()):null==c?null:[[c,d],[p,v]]},E()}function Tb(e){return ZE((ei+e)/2)}function bY(e,t){var n=xn(e),r=e===t?sn(e):hb(n/xn(t))/hb(Tb(t)/Tb(e)),i=n*qE(Tb(e),r)/r;if(!r)return Ib;function o(c,d){i>0?d<-ei+hn&&(d=-ei+hn):d>ei-hn&&(d=ei-hn);var p=i/qE(Tb(d),r);return[p*sn(r*c),i-p*xn(r*c)]}return o.invert=function(c,d){var p=i-d,v=Sa(r)*ks(c*c+p*p),E=yu(c,fr(p))*Sa(p);return p*r<0&&(E-=Dn*Sa(c)*Sa(p)),[E/r,2*hm(qE(i/v,1/r))-ei]},o}function xY(){return yD(bY).scale(109.5).parallels([30,30])}function Ab(e,t){return[e,t]}function wY(){return Oh(Ab).scale(152.63)}function CY(e,t){var n=xn(e),r=e===t?sn(e):(n-xn(t))/(t-e),i=n/r+e;if(fr(r)2?r[2]+90:90]):[(r=n())[0],r[1],r[2]-90]},n([0,0,90]).scale(159.155)}function _D(e,t){return e=+e,t=+t,function(n){return Math.round(e*(1-n)+t*n)}}function gO(e){return function(t,n){var r=e((t=LE(t)).h,(n=LE(n)).h),i=Qi(t.s,n.s),o=Qi(t.l,n.l),c=Qi(t.opacity,n.opacity);return function(d){return t.h=r(d),t.s=i(d),t.l=o(d),t.opacity=c(d),t+""}}}hO.invert=function(e,t){for(var c,n=t,r=n*n,i=r*r*r,o=0;o<12&&(i=(r=(n-=c=(n*(Yy+Ky*r+i*(Jy+Qy*r))-t)/(Yy+3*Ky*r+i*(7*Jy+9*Qy*r)))*n)*r*r,!(fr(c)<1e-12));++o);return[kb*e*(Yy+3*Ky*r+i*(7*Jy+9*Qy*r))/xn(n),Ma(sn(n)/kb)]},dO.invert=Xy(hm),fO.invert=Xy(Ma),pO.invert=Xy(function(e){return 2*hm(e)}),mO.invert=function(e,t){return[-t,2*hm(mF(e))-ei]};const kY=gO(zE);gO(Qi);const yO=Math.PI/180,_O=180/Math.PI,wO=4/29,gm=6/29,CO=3*gm*gm;function EO(e){if(e instanceof Dl)return new Dl(e.l,e.a,e.b,e.opacity);if(e instanceof xc)return SO(e);e instanceof Ji||(e=OE(e));var o,c,t=CD(e.r),n=CD(e.g),r=CD(e.b),i=bD((.2225045*t+.7168786*n+.0606169*r)/1);return t===n&&n===r?o=c=i:(o=bD((.4360747*t+.3850649*n+.1430804*r)/.96422),c=bD((.0139322*t+.0971045*n+.7141733*r)/.82521)),new Dl(116*i-16,500*(o-i),200*(i-c),e.opacity)}function vD(e,t,n,r){return 1===arguments.length?EO(e):new Dl(e,t,n,r??1)}function Dl(e,t,n,r){this.l=+e,this.a=+t,this.b=+n,this.opacity=+r}function bD(e){return e>.008856451679035631?Math.pow(e,1/3):e/CO+wO}function xD(e){return e>gm?e*e*e:CO*(e-wO)}function wD(e){return 255*(e<=.0031308?12.92*e:1.055*Math.pow(e,1/2.4)-.055)}function CD(e){return(e/=255)<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4)}function DO(e){if(e instanceof xc)return new xc(e.h,e.c,e.l,e.opacity);if(e instanceof Dl||(e=EO(e)),0===e.a&&0===e.b)return new xc(NaN,0=0))throw new Error(`invalid digits: ${e}`);if(t>15)return TO;const n=10**t;return function(r){this._+=r[0];for(let i=1,o=r.length;ibf)if(Math.abs(D*p-v*E)>bf&&o){let P=r-c,N=i-d,G=p*p+v*v,U=P*P+N*N,Z=Math.sqrt(G),ne=Math.sqrt(I),X=o*Math.tan((SD-Math.acos((G+I-U)/(2*Z*ne)))/2),re=X/ne,fe=X/Z;Math.abs(re-1)>bf&&this._append`L${t+re*E},${n+re*D}`,this._append`A${o},${o},0,0,${+(D*P>E*N)},${this._x1=t+fe*p},${this._y1=n+fe*v}`}else this._append`L${this._x1=t},${this._y1=n}`}arc(t,n,r,i,o,c){if(t=+t,n=+n,c=!!c,(r=+r)<0)throw new Error(`negative radius: ${r}`);let d=r*Math.cos(i),p=r*Math.sin(i),v=t+d,E=n+p,D=1^c,I=c?i-o:o-i;null===this._x1?this._append`M${v},${E}`:(Math.abs(this._x1-v)>bf||Math.abs(this._y1-E)>bf)&&this._append`L${v},${E}`,r&&(I<0&&(I=I%MD+MD),I>BY?this._append`A${r},${r},0,1,${D},${t-d},${n-p}A${r},${r},0,1,${D},${this._x1=v},${this._y1=E}`:I>bf&&this._append`A${r},${r},0,${+(I>=SD)},${D},${this._x1=t+r*Math.cos(o)},${this._y1=n+r*Math.sin(o)}`)}rect(t,n,r,i){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+n}h${r=+r}v${+i}h${-r}Z`}toString(){return this._}}function xf(e=3){return new Rb(+e)}function wc(e,t){switch(arguments.length){case 0:break;case 1:this.range(e);break;default:this.range(t).domain(e)}return this}function Fb(e,t){switch(arguments.length){case 0:break;case 1:"function"==typeof e?this.interpolator(e):this.range(e);break;default:this.domain(e),"function"==typeof t?this.interpolator(t):this.range(t)}return this}const ID=Symbol("implicit");function TD(){var e=new L0,t=[],n=[],r=ID;function i(o){let c=e.get(o);if(void 0===c){if(r!==ID)return r;e.set(o,c=t.push(o)-1)}return n[c%n.length]}return i.domain=function(o){if(!arguments.length)return t.slice();t=[],e=new L0;for(const c of o)e.has(c)||e.set(c,t.push(c)-1);return i},i.range=function(o){return arguments.length?(n=Array.from(o),i):n.slice()},i.unknown=function(o){return arguments.length?(r=o,i):r},i.copy=function(){return TD(t,n).unknown(r)},wc.apply(i,arguments),i}function Ob(){var o,c,e=TD().unknown(void 0),t=e.domain,n=e.range,r=0,i=1,d=!1,p=0,v=0,E=.5;function D(){var I=t().length,P=i>>1;n(d[D],p)<0?v=D+1:E=D}while(vxl(e(d),p),r=(d,p)=>e(d)-p):(t=e===xl||e===Ty?e:jY,n=e,r=e),{left:i,center:function c(d,p,v=0,E=d.length){const D=i(d,p,v,E-1);return D>v&&r(d[D-1],p)>-r(d[D],p)?D-1:D},right:function o(d,p,v=0,E=d.length){if(v>>1;n(d[D],p)<=0?v=D+1:E=D}while(vt&&(n=e,e=t,t=n),function(r){return Math.max(e,Math.min(t,r))}}(e[0],e[I-1])),d=I>2?WY:ZY,p=v=null,D}function D(I){return null==I||isNaN(I=+I)?o:(p||(p=d(e.map(r),t,n)))(r(c(I)))}return D.invert=function(I){return c(i((v||(v=d(t,e.map(r),Uo)))(I)))},D.domain=function(I){return arguments.length?(e=Array.from(I,PD),E()):e.slice()},D.range=function(I){return arguments.length?(t=Array.from(I),E()):t.slice()},D.rangeRound=function(I){return t=Array.from(I),n=_D,E()},D.clamp=function(I){return arguments.length?(c=!!I||Ta,E()):c!==Ta},D.interpolate=function(I){return arguments.length?(n=I,E()):n},D.unknown=function(I){return arguments.length?(o=I,D):o},function(I,P){return r=I,i=P,E()}}function RO(){return Lb()(Ta,Ta)}function n_(e){var t=e.domain;return e.ticks=function(n){var r=t();return U0(r[0],r[r.length-1],n??10)},e.tickFormat=function(n,r){var i=t();return function JY(e,t,n,r){var o,i=wE(e,t,n);switch((r=$y(r??",f")).type){case"s":var c=Math.max(Math.abs(e),Math.abs(t));return null==r.precision&&!isNaN(o=function XY(e,t){return Math.max(0,3*Math.max(-8,Math.min(8,Math.floor(cm(t)/3)))-cm(Math.abs(e)))}(i,c))&&(r.precision=o),dF(r,c);case"":case"e":case"g":case"p":case"r":null==r.precision&&!isNaN(o=function YY(e,t){return e=Math.abs(e),t=Math.abs(t)-e,Math.max(0,cm(t)-cm(e))+1}(i,Math.max(Math.abs(e),Math.abs(t))))&&(r.precision=o-("e"===r.type));break;case"f":case"%":null==r.precision&&!isNaN(o=function KY(e){return Math.max(0,-cm(Math.abs(e)))}(i))&&(r.precision=o-2*("%"===r.type))}return um(r)}(i[0],i[i.length-1],n??10,r)},e.nice=function(n){null==n&&(n=10);var p,v,r=t(),i=0,o=r.length-1,c=r[i],d=r[o],E=10;for(d0;){if((v=xE(c,d,n))===p)return r[i]=c,r[o]=d,t(r);if(v>0)c=Math.floor(c/v)*v,d=Math.ceil(d/v)*v;else{if(!(v<0))break;c=Math.ceil(c*v)/v,d=Math.floor(d*v)/v}p=v}return e},e}function FD(){var e=RO();return e.copy=function(){return t_(e,FD())},wc.apply(e,arguments),n_(e)}function FO(e){var t;function n(r){return null==r||isNaN(r=+r)?t:r}return n.invert=n,n.domain=n.range=function(r){return arguments.length?(e=Array.from(r,PD),n):e.slice()},n.unknown=function(r){return arguments.length?(t=r,n):t},n.copy=function(){return FO(e).unknown(t)},e=arguments.length?Array.from(e,PD):[0,1],n_(n)}function OO(e,t){var c,n=0,r=(e=e.slice()).length-1,i=e[n],o=e[r];return o-e(-t,n)}function BO(e){const t=e(LO,NO),n=t.domain;let i,o,r=10;function c(){return i=function rK(e){return e===Math.E?Math.log:10===e&&Math.log10||2===e&&Math.log2||(e=Math.log(e),t=>Math.log(t)/e)}(r),o=function nK(e){return 10===e?tK:e===Math.E?Math.exp:t=>Math.pow(e,t)}(r),n()[0]<0?(i=zO(i),o=zO(o),e(QY,eK)):e(LO,NO),t}return t.base=function(d){return arguments.length?(r=+d,c()):r},t.domain=function(d){return arguments.length?(n(d),c()):n()},t.ticks=d=>{const p=n();let v=p[0],E=p[p.length-1];const D=E0){for(;I<=P;++I)for(N=1;NE)break;Z.push(G)}}else for(;I<=P;++I)for(N=r-1;N>=1;--N)if(G=I>0?N/o(-I):N*o(I),!(GE)break;Z.push(G)}2*Z.length{if(null==d&&(d=10),null==p&&(p=10===r?"s":","),"function"!=typeof p&&(!(r%1)&&null==(p=$y(p)).precision&&(p.trim=!0),p=um(p)),d===1/0)return p;const v=Math.max(1,r*d/t.ticks().length);return E=>{let D=E/o(Math.round(i(E)));return D*rn(OO(n(),{floor:d=>o(Math.floor(i(d))),ceil:d=>o(Math.ceil(i(d)))})),t}function VO(){const e=BO(Lb()).domain([1,10]);return e.copy=()=>t_(e,VO()).base(e.base()),wc.apply(e,arguments),e}function UO(e){return function(t){return Math.sign(t)*Math.log1p(Math.abs(t/e))}}function $O(e){return function(t){return Math.sign(t)*Math.expm1(Math.abs(t))*e}}function jO(e){var t=1,n=e(UO(t),$O(t));return n.constant=function(r){return arguments.length?e(UO(t=+r),$O(t)):t},n_(n)}function HO(){var e=jO(Lb());return e.copy=function(){return t_(e,HO()).constant(e.constant())},wc.apply(e,arguments)}function GO(e){return function(t){return t<0?-Math.pow(-t,e):Math.pow(t,e)}}function iK(e){return e<0?-Math.sqrt(-e):Math.sqrt(e)}function oK(e){return e<0?-e*e:e*e}function qO(e){var t=e(Ta,Ta),n=1;function r(){return 1===n?e(Ta,Ta):.5===n?e(iK,oK):e(GO(n),GO(1/n))}return t.exponent=function(i){return arguments.length?(n=+i,r()):n},n_(t)}function OD(){var e=qO(Lb());return e.copy=function(){return t_(e,OD()).exponent(e.exponent())},wc.apply(e,arguments),e}function ZO(){var r,e=[],t=[],n=[];function i(){var c=0,d=Math.max(1,t.length);for(n=new Array(d-1);++c0?n[d-1]:e[0],d(e(o=new Date(+o)),o),i.ceil=o=>(e(o=new Date(o-1)),t(o,1),e(o),o),i.round=o=>{const c=i(o),d=i.ceil(o);return o-c(t(o=new Date(+o),null==c?1:Math.floor(c)),o),i.range=(o,c,d)=>{const p=[];if(o=i.ceil(o),d=null==d?1:Math.floor(d),!(o0))return p;let v;do{p.push(v=new Date(+o)),t(o,d),e(o)}while(vOi(c=>{if(c>=c)for(;e(c),!o(c);)c.setTime(c-1)},(c,d)=>{if(c>=c)if(d<0)for(;++d<=0;)for(;t(c,-1),!o(c););else for(;--d>=0;)for(;t(c,1),!o(c););}),n&&(i.count=(o,c)=>(zD.setTime(+o),BD.setTime(+c),e(zD),e(BD),Math.floor(n(zD,BD))),i.every=o=>(o=Math.floor(o),isFinite(o)&&o>0?o>1?i.filter(r?c=>r(c)%o==0:c=>i.count(0,c)%o==0):i:null)),i}const Nb=Oi(()=>{},(e,t)=>{e.setTime(+e+t)},(e,t)=>t-e);Nb.every=e=>(e=Math.floor(e),isFinite(e)&&e>0?e>1?Oi(t=>{t.setTime(Math.floor(t/e)*e)},(t,n)=>{t.setTime(+t+n*e)},(t,n)=>(n-t)/e):Nb:null);const wu=Oi(e=>{e.setTime(e-e.getMilliseconds())},(e,t)=>{e.setTime(+e+t*vu)},(e,t)=>(t-e)/vu,e=>e.getUTCSeconds()),zb=Oi(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*vu)},(e,t)=>{e.setTime(+e+t*Aa)},(e,t)=>(t-e)/Aa,e=>e.getMinutes()),Bb=Oi(e=>{e.setUTCSeconds(0,0)},(e,t)=>{e.setTime(+e+t*Aa)},(e,t)=>(t-e)/Aa,e=>e.getUTCMinutes()),Vb=Oi(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*vu-e.getMinutes()*Aa)},(e,t)=>{e.setTime(+e+t*bu)},(e,t)=>(t-e)/bu,e=>e.getHours()),Ub=Oi(e=>{e.setUTCMinutes(0,0,0)},(e,t)=>{e.setTime(+e+t*bu)},(e,t)=>(t-e)/bu,e=>e.getUTCHours()),ym=Oi(e=>e.setHours(0,0,0,0),(e,t)=>e.setDate(e.getDate()+t),(e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*Aa)/xu,e=>e.getDate()-1),r_=Oi(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/xu,e=>e.getUTCDate()-1),YO=Oi(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/xu,e=>Math.floor(e/xu));function wf(e){return Oi(t=>{t.setDate(t.getDate()-(t.getDay()+7-e)%7),t.setHours(0,0,0,0)},(t,n)=>{t.setDate(t.getDate()+7*n)},(t,n)=>(n-t-(n.getTimezoneOffset()-t.getTimezoneOffset())*Aa)/LD)}const _m=wf(0),i_=wf(1),KO=wf(2),JO=wf(3),Cf=wf(4),QO=wf(5),eL=wf(6);function Ef(e){return Oi(t=>{t.setUTCDate(t.getUTCDate()-(t.getUTCDay()+7-e)%7),t.setUTCHours(0,0,0,0)},(t,n)=>{t.setUTCDate(t.getUTCDate()+7*n)},(t,n)=>(n-t)/LD)}const vm=Ef(0),o_=Ef(1),tL=Ef(2),nL=Ef(3),Df=Ef(4),rL=Ef(5),iL=Ef(6),bm=Oi(e=>{e.setDate(1),e.setHours(0,0,0,0)},(e,t)=>{e.setMonth(e.getMonth()+t)},(e,t)=>t.getMonth()-e.getMonth()+12*(t.getFullYear()-e.getFullYear()),e=>e.getMonth()),xm=Oi(e=>{e.setUTCDate(1),e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCMonth(e.getUTCMonth()+t)},(e,t)=>t.getUTCMonth()-e.getUTCMonth()+12*(t.getUTCFullYear()-e.getUTCFullYear()),e=>e.getUTCMonth()),Cc=Oi(e=>{e.setMonth(0,1),e.setHours(0,0,0,0)},(e,t)=>{e.setFullYear(e.getFullYear()+t)},(e,t)=>t.getFullYear()-e.getFullYear(),e=>e.getFullYear());Cc.every=e=>isFinite(e=Math.floor(e))&&e>0?Oi(t=>{t.setFullYear(Math.floor(t.getFullYear()/e)*e),t.setMonth(0,1),t.setHours(0,0,0,0)},(t,n)=>{t.setFullYear(t.getFullYear()+n*e)}):null;const Ec=Oi(e=>{e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCFullYear(e.getUTCFullYear()+t)},(e,t)=>t.getUTCFullYear()-e.getUTCFullYear(),e=>e.getUTCFullYear());function oL(e,t,n,r,i,o){const c=[[wu,1,vu],[wu,5,5e3],[wu,15,15e3],[wu,30,3e4],[o,1,Aa],[o,5,5*Aa],[o,15,15*Aa],[o,30,30*Aa],[i,1,bu],[i,3,3*bu],[i,6,6*bu],[i,12,12*bu],[r,1,xu],[r,2,2*xu],[n,1,LD],[t,1,XO],[t,3,3*XO],[e,1,ND]];function p(v,E,D){const I=Math.abs(E-v)/D,P=AD(([,,U])=>U).right(c,I);if(P===c.length)return e.every(wE(v/ND,E/ND,D));if(0===P)return Nb.every(Math.max(wE(v,E,D),1));const[N,G]=c[I/c[P-1][2]isFinite(e=Math.floor(e))&&e>0?Oi(t=>{t.setUTCFullYear(Math.floor(t.getUTCFullYear()/e)*e),t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)},(t,n)=>{t.setUTCFullYear(t.getUTCFullYear()+n*e)}):null;const[sK,aK]=oL(Ec,xm,vm,YO,Ub,Bb),[lK,cK]=oL(Cc,bm,_m,ym,Vb,zb);function VD(e){if(0<=e.y&&e.y<100){var t=new Date(-1,e.m,e.d,e.H,e.M,e.S,e.L);return t.setFullYear(e.y),t}return new Date(e.y,e.m,e.d,e.H,e.M,e.S,e.L)}function UD(e){if(0<=e.y&&e.y<100){var t=new Date(Date.UTC(-1,e.m,e.d,e.H,e.M,e.S,e.L));return t.setUTCFullYear(e.y),t}return new Date(Date.UTC(e.y,e.m,e.d,e.H,e.M,e.S,e.L))}function s_(e,t,n){return{y:e,m:t,d:n,H:0,M:0,S:0,L:0}}var wm,$b,jb,sL={"-":"",_:" ",0:"0"},eo=/^\s*\d+/,hK=/^%/,dK=/[\\^$*+?|[\]().{}]/g;function Zn(e,t,n){var r=e<0?"-":"",i=(r?-e:e)+"",o=i.length;return r+(o[t.toLowerCase(),n]))}function pK(e,t,n){var r=eo.exec(t.slice(n,n+1));return r?(e.w=+r[0],n+r[0].length):-1}function mK(e,t,n){var r=eo.exec(t.slice(n,n+1));return r?(e.u=+r[0],n+r[0].length):-1}function gK(e,t,n){var r=eo.exec(t.slice(n,n+2));return r?(e.U=+r[0],n+r[0].length):-1}function yK(e,t,n){var r=eo.exec(t.slice(n,n+2));return r?(e.V=+r[0],n+r[0].length):-1}function _K(e,t,n){var r=eo.exec(t.slice(n,n+2));return r?(e.W=+r[0],n+r[0].length):-1}function aL(e,t,n){var r=eo.exec(t.slice(n,n+4));return r?(e.y=+r[0],n+r[0].length):-1}function lL(e,t,n){var r=eo.exec(t.slice(n,n+2));return r?(e.y=+r[0]+(+r[0]>68?1900:2e3),n+r[0].length):-1}function vK(e,t,n){var r=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(t.slice(n,n+6));return r?(e.Z=r[1]?0:-(r[2]+(r[3]||"00")),n+r[0].length):-1}function bK(e,t,n){var r=eo.exec(t.slice(n,n+1));return r?(e.q=3*r[0]-3,n+r[0].length):-1}function xK(e,t,n){var r=eo.exec(t.slice(n,n+2));return r?(e.m=r[0]-1,n+r[0].length):-1}function cL(e,t,n){var r=eo.exec(t.slice(n,n+2));return r?(e.d=+r[0],n+r[0].length):-1}function wK(e,t,n){var r=eo.exec(t.slice(n,n+3));return r?(e.m=0,e.d=+r[0],n+r[0].length):-1}function uL(e,t,n){var r=eo.exec(t.slice(n,n+2));return r?(e.H=+r[0],n+r[0].length):-1}function CK(e,t,n){var r=eo.exec(t.slice(n,n+2));return r?(e.M=+r[0],n+r[0].length):-1}function EK(e,t,n){var r=eo.exec(t.slice(n,n+2));return r?(e.S=+r[0],n+r[0].length):-1}function DK(e,t,n){var r=eo.exec(t.slice(n,n+3));return r?(e.L=+r[0],n+r[0].length):-1}function SK(e,t,n){var r=eo.exec(t.slice(n,n+6));return r?(e.L=Math.floor(r[0]/1e3),n+r[0].length):-1}function MK(e,t,n){var r=hK.exec(t.slice(n,n+1));return r?n+r[0].length:-1}function IK(e,t,n){var r=eo.exec(t.slice(n));return r?(e.Q=+r[0],n+r[0].length):-1}function TK(e,t,n){var r=eo.exec(t.slice(n));return r?(e.s=+r[0],n+r[0].length):-1}function hL(e,t){return Zn(e.getDate(),t,2)}function AK(e,t){return Zn(e.getHours(),t,2)}function kK(e,t){return Zn(e.getHours()%12||12,t,2)}function PK(e,t){return Zn(1+ym.count(Cc(e),e),t,3)}function dL(e,t){return Zn(e.getMilliseconds(),t,3)}function RK(e,t){return dL(e,t)+"000"}function FK(e,t){return Zn(e.getMonth()+1,t,2)}function OK(e,t){return Zn(e.getMinutes(),t,2)}function LK(e,t){return Zn(e.getSeconds(),t,2)}function NK(e){var t=e.getDay();return 0===t?7:t}function zK(e,t){return Zn(_m.count(Cc(e)-1,e),t,2)}function fL(e){var t=e.getDay();return t>=4||0===t?Cf(e):Cf.ceil(e)}function BK(e,t){return e=fL(e),Zn(Cf.count(Cc(e),e)+(4===Cc(e).getDay()),t,2)}function VK(e){return e.getDay()}function UK(e,t){return Zn(i_.count(Cc(e)-1,e),t,2)}function $K(e,t){return Zn(e.getFullYear()%100,t,2)}function jK(e,t){return Zn((e=fL(e)).getFullYear()%100,t,2)}function HK(e,t){return Zn(e.getFullYear()%1e4,t,4)}function GK(e,t){var n=e.getDay();return Zn((e=n>=4||0===n?Cf(e):Cf.ceil(e)).getFullYear()%1e4,t,4)}function qK(e){var t=e.getTimezoneOffset();return(t>0?"-":(t*=-1,"+"))+Zn(t/60|0,"0",2)+Zn(t%60,"0",2)}function pL(e,t){return Zn(e.getUTCDate(),t,2)}function ZK(e,t){return Zn(e.getUTCHours(),t,2)}function WK(e,t){return Zn(e.getUTCHours()%12||12,t,2)}function XK(e,t){return Zn(1+r_.count(Ec(e),e),t,3)}function mL(e,t){return Zn(e.getUTCMilliseconds(),t,3)}function YK(e,t){return mL(e,t)+"000"}function KK(e,t){return Zn(e.getUTCMonth()+1,t,2)}function JK(e,t){return Zn(e.getUTCMinutes(),t,2)}function QK(e,t){return Zn(e.getUTCSeconds(),t,2)}function eJ(e){var t=e.getUTCDay();return 0===t?7:t}function tJ(e,t){return Zn(vm.count(Ec(e)-1,e),t,2)}function gL(e){var t=e.getUTCDay();return t>=4||0===t?Df(e):Df.ceil(e)}function nJ(e,t){return e=gL(e),Zn(Df.count(Ec(e),e)+(4===Ec(e).getUTCDay()),t,2)}function rJ(e){return e.getUTCDay()}function iJ(e,t){return Zn(o_.count(Ec(e)-1,e),t,2)}function oJ(e,t){return Zn(e.getUTCFullYear()%100,t,2)}function sJ(e,t){return Zn((e=gL(e)).getUTCFullYear()%100,t,2)}function aJ(e,t){return Zn(e.getUTCFullYear()%1e4,t,4)}function lJ(e,t){var n=e.getUTCDay();return Zn((e=n>=4||0===n?Df(e):Df.ceil(e)).getUTCFullYear()%1e4,t,4)}function cJ(){return"+0000"}function yL(){return"%"}function _L(e){return+e}function vL(e){return Math.floor(+e/1e3)}function fJ(e){return new Date(e)}function pJ(e){return e instanceof Date?+e:+new Date(+e)}function $D(e,t,n,r,i,o,c,d,p,v){var E=RO(),D=E.invert,I=E.domain,P=v(".%L"),N=v(":%S"),G=v("%I:%M"),U=v("%I %p"),Z=v("%a %d"),ne=v("%b %d"),X=v("%B"),re=v("%Y");function fe(ve){return(p(ve)=12)]},q:function Ft(bt){return 1+~~(bt.getMonth()/3)},Q:_L,s:vL,S:LK,u:NK,U:zK,V:BK,w:VK,W:UK,x:null,X:null,y:$K,Y:HK,Z:qK,"%":yL},re={a:function ir(bt){return c[bt.getUTCDay()]},A:function jn(bt){return o[bt.getUTCDay()]},b:function pr(bt){return p[bt.getUTCMonth()]},B:function xi(bt){return d[bt.getUTCMonth()]},c:null,d:pL,e:pL,f:YK,g:sJ,G:lJ,H:ZK,I:WK,j:XK,L:mL,m:KK,M:JK,p:function Wn(bt){return i[+(bt.getUTCHours()>=12)]},q:function zr(bt){return 1+~~(bt.getUTCMonth()/3)},Q:_L,s:vL,S:QK,u:eJ,U:tJ,V:nJ,w:rJ,W:iJ,x:null,X:null,y:oJ,Y:aJ,Z:cJ,"%":yL},fe={a:function lt(bt,Kt,Pn){var Je=P.exec(Kt.slice(Pn));return Je?(bt.w=N.get(Je[0].toLowerCase()),Pn+Je[0].length):-1},A:function Ue(bt,Kt,Pn){var Je=D.exec(Kt.slice(Pn));return Je?(bt.w=I.get(Je[0].toLowerCase()),Pn+Je[0].length):-1},b:function st(bt,Kt,Pn){var Je=Z.exec(Kt.slice(Pn));return Je?(bt.m=ne.get(Je[0].toLowerCase()),Pn+Je[0].length):-1},B:function Fe(bt,Kt,Pn){var Je=G.exec(Kt.slice(Pn));return Je?(bt.m=U.get(Je[0].toLowerCase()),Pn+Je[0].length):-1},c:function le(bt,Kt,Pn){return We(bt,t,Kt,Pn)},d:cL,e:cL,f:SK,g:lL,G:aL,H:uL,I:uL,j:wK,L:DK,m:xK,M:CK,p:function Ke(bt,Kt,Pn){var Je=v.exec(Kt.slice(Pn));return Je?(bt.p=E.get(Je[0].toLowerCase()),Pn+Je[0].length):-1},q:bK,Q:IK,s:TK,S:EK,u:mK,U:gK,V:yK,w:pK,W:_K,x:function de(bt,Kt,Pn){return We(bt,n,Kt,Pn)},X:function pe(bt,Kt,Pn){return We(bt,r,Kt,Pn)},y:lL,Y:aL,Z:vK,"%":MK};function ve(bt,Kt){return function(Pn){var So,qt,ri,Je=[],Br=-1,Jn=0,Gr=bt.length;for(Pn instanceof Date||(Pn=new Date(+Pn));++Br53)return null;"w"in Je||(Je.w=1),"Z"in Je?(Gr=(Jn=UD(s_(Je.y,0,1))).getUTCDay(),Jn=Gr>4||0===Gr?o_.ceil(Jn):o_(Jn),Jn=r_.offset(Jn,7*(Je.V-1)),Je.y=Jn.getUTCFullYear(),Je.m=Jn.getUTCMonth(),Je.d=Jn.getUTCDate()+(Je.w+6)%7):(Gr=(Jn=VD(s_(Je.y,0,1))).getDay(),Jn=Gr>4||0===Gr?i_.ceil(Jn):i_(Jn),Jn=ym.offset(Jn,7*(Je.V-1)),Je.y=Jn.getFullYear(),Je.m=Jn.getMonth(),Je.d=Jn.getDate()+(Je.w+6)%7)}else("W"in Je||"U"in Je)&&("w"in Je||(Je.w="u"in Je?Je.u%7:"W"in Je?1:0),Gr="Z"in Je?UD(s_(Je.y,0,1)).getUTCDay():VD(s_(Je.y,0,1)).getDay(),Je.m=0,Je.d="W"in Je?(Je.w+6)%7+7*Je.W-(Gr+5)%7:Je.w+7*Je.U-(Gr+6)%7);return"Z"in Je?(Je.H+=Je.Z/100|0,Je.M+=Je.Z%100,UD(Je)):VD(Je)}}function We(bt,Kt,Pn,Je){for(var So,qt,Br=0,Jn=Kt.length,Gr=Pn.length;Br=Gr)return-1;if(37===(So=Kt.charCodeAt(Br++))){if(So=Kt.charAt(Br++),!(qt=fe[So in sL?Kt.charAt(Br++):So])||(Je=qt(bt,Pn,Je))<0)return-1}else if(So!=Pn.charCodeAt(Je++))return-1}return Je}return X.x=ve(n,X),X.X=ve(r,X),X.c=ve(t,X),re.x=ve(n,re),re.X=ve(r,re),re.c=ve(t,re),{format:function(bt){var Kt=ve(bt+="",X);return Kt.toString=function(){return bt},Kt},parse:function(bt){var Kt=Re(bt+="",!1);return Kt.toString=function(){return bt},Kt},utcFormat:function(bt){var Kt=ve(bt+="",re);return Kt.toString=function(){return bt},Kt},utcParse:function(bt){var Kt=Re(bt+="",!0);return Kt.toString=function(){return bt},Kt}}}(e),$b=wm.format,jb=wm.utcFormat}({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]});const bJ=dn("1f77b4ff7f0e2ca02cd627289467bd8c564be377c27f7f7fbcbd2217becf"),xJ=dn("7fc97fbeaed4fdc086ffff99386cb0f0027fbf5b17666666"),wJ=dn("1b9e77d95f027570b3e7298a66a61ee6ab02a6761d666666"),CJ=dn("a6cee31f78b4b2df8a33a02cfb9a99e31a1cfdbf6fff7f00cab2d66a3d9affff99b15928"),EJ=dn("fbb4aeb3cde3ccebc5decbe4fed9a6ffffcce5d8bdfddaecf2f2f2"),DJ=dn("b3e2cdfdcdaccbd5e8f4cae4e6f5c9fff2aef1e2cccccccc"),SJ=dn("e41a1c377eb84daf4a984ea3ff7f00ffff33a65628f781bf999999"),MJ=dn("66c2a5fc8d628da0cbe78ac3a6d854ffd92fe5c494b3b3b3"),IJ=dn("8dd3c7ffffb3bebadafb807280b1d3fdb462b3de69fccde5d9d9d9bc80bdccebc5ffed6f"),TJ=dn("4e79a7f28e2ce1575976b7b259a14fedc949af7aa1ff9da79c755fbab0ab"),wr=e=>bW(e[e.length-1]);var EL=new Array(3).concat("d8b365f5f5f55ab4ac","a6611adfc27d80cdc1018571","a6611adfc27df5f5f580cdc1018571","8c510ad8b365f6e8c3c7eae55ab4ac01665e","8c510ad8b365f6e8c3f5f5f5c7eae55ab4ac01665e","8c510abf812ddfc27df6e8c3c7eae580cdc135978f01665e","8c510abf812ddfc27df6e8c3f5f5f5c7eae580cdc135978f01665e","5430058c510abf812ddfc27df6e8c3c7eae580cdc135978f01665e003c30","5430058c510abf812ddfc27df6e8c3f5f5f5c7eae580cdc135978f01665e003c30").map(dn);const DL=wr(EL);var SL=new Array(3).concat("af8dc3f7f7f77fbf7b","7b3294c2a5cfa6dba0008837","7b3294c2a5cff7f7f7a6dba0008837","762a83af8dc3e7d4e8d9f0d37fbf7b1b7837","762a83af8dc3e7d4e8f7f7f7d9f0d37fbf7b1b7837","762a839970abc2a5cfe7d4e8d9f0d3a6dba05aae611b7837","762a839970abc2a5cfe7d4e8f7f7f7d9f0d3a6dba05aae611b7837","40004b762a839970abc2a5cfe7d4e8d9f0d3a6dba05aae611b783700441b","40004b762a839970abc2a5cfe7d4e8f7f7f7d9f0d3a6dba05aae611b783700441b").map(dn);const ML=wr(SL);var IL=new Array(3).concat("e9a3c9f7f7f7a1d76a","d01c8bf1b6dab8e1864dac26","d01c8bf1b6daf7f7f7b8e1864dac26","c51b7de9a3c9fde0efe6f5d0a1d76a4d9221","c51b7de9a3c9fde0eff7f7f7e6f5d0a1d76a4d9221","c51b7dde77aef1b6dafde0efe6f5d0b8e1867fbc414d9221","c51b7dde77aef1b6dafde0eff7f7f7e6f5d0b8e1867fbc414d9221","8e0152c51b7dde77aef1b6dafde0efe6f5d0b8e1867fbc414d9221276419","8e0152c51b7dde77aef1b6dafde0eff7f7f7e6f5d0b8e1867fbc414d9221276419").map(dn);const TL=wr(IL);var AL=new Array(3).concat("998ec3f7f7f7f1a340","5e3c99b2abd2fdb863e66101","5e3c99b2abd2f7f7f7fdb863e66101","542788998ec3d8daebfee0b6f1a340b35806","542788998ec3d8daebf7f7f7fee0b6f1a340b35806","5427888073acb2abd2d8daebfee0b6fdb863e08214b35806","5427888073acb2abd2d8daebf7f7f7fee0b6fdb863e08214b35806","2d004b5427888073acb2abd2d8daebfee0b6fdb863e08214b358067f3b08","2d004b5427888073acb2abd2d8daebf7f7f7fee0b6fdb863e08214b358067f3b08").map(dn);const kL=wr(AL);var HD=new Array(3).concat("ef8a62f7f7f767a9cf","ca0020f4a58292c5de0571b0","ca0020f4a582f7f7f792c5de0571b0","b2182bef8a62fddbc7d1e5f067a9cf2166ac","b2182bef8a62fddbc7f7f7f7d1e5f067a9cf2166ac","b2182bd6604df4a582fddbc7d1e5f092c5de4393c32166ac","b2182bd6604df4a582fddbc7f7f7f7d1e5f092c5de4393c32166ac","67001fb2182bd6604df4a582fddbc7d1e5f092c5de4393c32166ac053061","67001fb2182bd6604df4a582fddbc7f7f7f7d1e5f092c5de4393c32166ac053061").map(dn);const qb=wr(HD);var PL=new Array(3).concat("ef8a62ffffff999999","ca0020f4a582bababa404040","ca0020f4a582ffffffbababa404040","b2182bef8a62fddbc7e0e0e09999994d4d4d","b2182bef8a62fddbc7ffffffe0e0e09999994d4d4d","b2182bd6604df4a582fddbc7e0e0e0bababa8787874d4d4d","b2182bd6604df4a582fddbc7ffffffe0e0e0bababa8787874d4d4d","67001fb2182bd6604df4a582fddbc7e0e0e0bababa8787874d4d4d1a1a1a","67001fb2182bd6604df4a582fddbc7ffffffe0e0e0bababa8787874d4d4d1a1a1a").map(dn);const RL=wr(PL);var GD=new Array(3).concat("fc8d59ffffbf91bfdb","d7191cfdae61abd9e92c7bb6","d7191cfdae61ffffbfabd9e92c7bb6","d73027fc8d59fee090e0f3f891bfdb4575b4","d73027fc8d59fee090ffffbfe0f3f891bfdb4575b4","d73027f46d43fdae61fee090e0f3f8abd9e974add14575b4","d73027f46d43fdae61fee090ffffbfe0f3f8abd9e974add14575b4","a50026d73027f46d43fdae61fee090e0f3f8abd9e974add14575b4313695","a50026d73027f46d43fdae61fee090ffffbfe0f3f8abd9e974add14575b4313695").map(dn);const Zb=wr(GD);var FL=new Array(3).concat("fc8d59ffffbf91cf60","d7191cfdae61a6d96a1a9641","d7191cfdae61ffffbfa6d96a1a9641","d73027fc8d59fee08bd9ef8b91cf601a9850","d73027fc8d59fee08bffffbfd9ef8b91cf601a9850","d73027f46d43fdae61fee08bd9ef8ba6d96a66bd631a9850","d73027f46d43fdae61fee08bffffbfd9ef8ba6d96a66bd631a9850","a50026d73027f46d43fdae61fee08bd9ef8ba6d96a66bd631a9850006837","a50026d73027f46d43fdae61fee08bffffbfd9ef8ba6d96a66bd631a9850006837").map(dn);const OL=wr(FL);var LL=new Array(3).concat("fc8d59ffffbf99d594","d7191cfdae61abdda42b83ba","d7191cfdae61ffffbfabdda42b83ba","d53e4ffc8d59fee08be6f59899d5943288bd","d53e4ffc8d59fee08bffffbfe6f59899d5943288bd","d53e4ff46d43fdae61fee08be6f598abdda466c2a53288bd","d53e4ff46d43fdae61fee08bffffbfe6f598abdda466c2a53288bd","9e0142d53e4ff46d43fdae61fee08be6f598abdda466c2a53288bd5e4fa2","9e0142d53e4ff46d43fdae61fee08bffffbfe6f598abdda466c2a53288bd5e4fa2").map(dn);const NL=wr(LL);var zL=new Array(3).concat("e5f5f999d8c92ca25f","edf8fbb2e2e266c2a4238b45","edf8fbb2e2e266c2a42ca25f006d2c","edf8fbccece699d8c966c2a42ca25f006d2c","edf8fbccece699d8c966c2a441ae76238b45005824","f7fcfde5f5f9ccece699d8c966c2a441ae76238b45005824","f7fcfde5f5f9ccece699d8c966c2a441ae76238b45006d2c00441b").map(dn);const BL=wr(zL);var VL=new Array(3).concat("e0ecf49ebcda8856a7","edf8fbb3cde38c96c688419d","edf8fbb3cde38c96c68856a7810f7c","edf8fbbfd3e69ebcda8c96c68856a7810f7c","edf8fbbfd3e69ebcda8c96c68c6bb188419d6e016b","f7fcfde0ecf4bfd3e69ebcda8c96c68c6bb188419d6e016b","f7fcfde0ecf4bfd3e69ebcda8c96c68c6bb188419d810f7c4d004b").map(dn);const UL=wr(VL);var $L=new Array(3).concat("e0f3dba8ddb543a2ca","f0f9e8bae4bc7bccc42b8cbe","f0f9e8bae4bc7bccc443a2ca0868ac","f0f9e8ccebc5a8ddb57bccc443a2ca0868ac","f0f9e8ccebc5a8ddb57bccc44eb3d32b8cbe08589e","f7fcf0e0f3dbccebc5a8ddb57bccc44eb3d32b8cbe08589e","f7fcf0e0f3dbccebc5a8ddb57bccc44eb3d32b8cbe0868ac084081").map(dn);const jL=wr($L);var HL=new Array(3).concat("fee8c8fdbb84e34a33","fef0d9fdcc8afc8d59d7301f","fef0d9fdcc8afc8d59e34a33b30000","fef0d9fdd49efdbb84fc8d59e34a33b30000","fef0d9fdd49efdbb84fc8d59ef6548d7301f990000","fff7ecfee8c8fdd49efdbb84fc8d59ef6548d7301f990000","fff7ecfee8c8fdd49efdbb84fc8d59ef6548d7301fb300007f0000").map(dn);const GL=wr(HL);var qL=new Array(3).concat("ece2f0a6bddb1c9099","f6eff7bdc9e167a9cf02818a","f6eff7bdc9e167a9cf1c9099016c59","f6eff7d0d1e6a6bddb67a9cf1c9099016c59","f6eff7d0d1e6a6bddb67a9cf3690c002818a016450","fff7fbece2f0d0d1e6a6bddb67a9cf3690c002818a016450","fff7fbece2f0d0d1e6a6bddb67a9cf3690c002818a016c59014636").map(dn);const ZL=wr(qL);var WL=new Array(3).concat("ece7f2a6bddb2b8cbe","f1eef6bdc9e174a9cf0570b0","f1eef6bdc9e174a9cf2b8cbe045a8d","f1eef6d0d1e6a6bddb74a9cf2b8cbe045a8d","f1eef6d0d1e6a6bddb74a9cf3690c00570b0034e7b","fff7fbece7f2d0d1e6a6bddb74a9cf3690c00570b0034e7b","fff7fbece7f2d0d1e6a6bddb74a9cf3690c00570b0045a8d023858").map(dn);const XL=wr(WL);var YL=new Array(3).concat("e7e1efc994c7dd1c77","f1eef6d7b5d8df65b0ce1256","f1eef6d7b5d8df65b0dd1c77980043","f1eef6d4b9dac994c7df65b0dd1c77980043","f1eef6d4b9dac994c7df65b0e7298ace125691003f","f7f4f9e7e1efd4b9dac994c7df65b0e7298ace125691003f","f7f4f9e7e1efd4b9dac994c7df65b0e7298ace125698004367001f").map(dn);const KL=wr(YL);var JL=new Array(3).concat("fde0ddfa9fb5c51b8a","feebe2fbb4b9f768a1ae017e","feebe2fbb4b9f768a1c51b8a7a0177","feebe2fcc5c0fa9fb5f768a1c51b8a7a0177","feebe2fcc5c0fa9fb5f768a1dd3497ae017e7a0177","fff7f3fde0ddfcc5c0fa9fb5f768a1dd3497ae017e7a0177","fff7f3fde0ddfcc5c0fa9fb5f768a1dd3497ae017e7a017749006a").map(dn);const QL=wr(JL);var e3=new Array(3).concat("edf8b17fcdbb2c7fb8","ffffcca1dab441b6c4225ea8","ffffcca1dab441b6c42c7fb8253494","ffffccc7e9b47fcdbb41b6c42c7fb8253494","ffffccc7e9b47fcdbb41b6c41d91c0225ea80c2c84","ffffd9edf8b1c7e9b47fcdbb41b6c41d91c0225ea80c2c84","ffffd9edf8b1c7e9b47fcdbb41b6c41d91c0225ea8253494081d58").map(dn);const t3=wr(e3);var n3=new Array(3).concat("f7fcb9addd8e31a354","ffffccc2e69978c679238443","ffffccc2e69978c67931a354006837","ffffccd9f0a3addd8e78c67931a354006837","ffffccd9f0a3addd8e78c67941ab5d238443005a32","ffffe5f7fcb9d9f0a3addd8e78c67941ab5d238443005a32","ffffe5f7fcb9d9f0a3addd8e78c67941ab5d238443006837004529").map(dn);const r3=wr(n3);var i3=new Array(3).concat("fff7bcfec44fd95f0e","ffffd4fed98efe9929cc4c02","ffffd4fed98efe9929d95f0e993404","ffffd4fee391fec44ffe9929d95f0e993404","ffffd4fee391fec44ffe9929ec7014cc4c028c2d04","ffffe5fff7bcfee391fec44ffe9929ec7014cc4c028c2d04","ffffe5fff7bcfee391fec44ffe9929ec7014cc4c02993404662506").map(dn);const o3=wr(i3);var s3=new Array(3).concat("ffeda0feb24cf03b20","ffffb2fecc5cfd8d3ce31a1c","ffffb2fecc5cfd8d3cf03b20bd0026","ffffb2fed976feb24cfd8d3cf03b20bd0026","ffffb2fed976feb24cfd8d3cfc4e2ae31a1cb10026","ffffccffeda0fed976feb24cfd8d3cfc4e2ae31a1cb10026","ffffccffeda0fed976feb24cfd8d3cfc4e2ae31a1cbd0026800026").map(dn);const a3=wr(s3);var l3=new Array(3).concat("deebf79ecae13182bd","eff3ffbdd7e76baed62171b5","eff3ffbdd7e76baed63182bd08519c","eff3ffc6dbef9ecae16baed63182bd08519c","eff3ffc6dbef9ecae16baed64292c62171b5084594","f7fbffdeebf7c6dbef9ecae16baed64292c62171b5084594","f7fbffdeebf7c6dbef9ecae16baed64292c62171b508519c08306b").map(dn);const c3=wr(l3);var u3=new Array(3).concat("e5f5e0a1d99b31a354","edf8e9bae4b374c476238b45","edf8e9bae4b374c47631a354006d2c","edf8e9c7e9c0a1d99b74c47631a354006d2c","edf8e9c7e9c0a1d99b74c47641ab5d238b45005a32","f7fcf5e5f5e0c7e9c0a1d99b74c47641ab5d238b45005a32","f7fcf5e5f5e0c7e9c0a1d99b74c47641ab5d238b45006d2c00441b").map(dn);const h3=wr(u3);var d3=new Array(3).concat("f0f0f0bdbdbd636363","f7f7f7cccccc969696525252","f7f7f7cccccc969696636363252525","f7f7f7d9d9d9bdbdbd969696636363252525","f7f7f7d9d9d9bdbdbd969696737373525252252525","fffffff0f0f0d9d9d9bdbdbd969696737373525252252525","fffffff0f0f0d9d9d9bdbdbd969696737373525252252525000000").map(dn);const f3=wr(d3);var p3=new Array(3).concat("efedf5bcbddc756bb1","f2f0f7cbc9e29e9ac86a51a3","f2f0f7cbc9e29e9ac8756bb154278f","f2f0f7dadaebbcbddc9e9ac8756bb154278f","f2f0f7dadaebbcbddc9e9ac8807dba6a51a34a1486","fcfbfdefedf5dadaebbcbddc9e9ac8807dba6a51a34a1486","fcfbfdefedf5dadaebbcbddc9e9ac8807dba6a51a354278f3f007d").map(dn);const m3=wr(p3);var g3=new Array(3).concat("fee0d2fc9272de2d26","fee5d9fcae91fb6a4acb181d","fee5d9fcae91fb6a4ade2d26a50f15","fee5d9fcbba1fc9272fb6a4ade2d26a50f15","fee5d9fcbba1fc9272fb6a4aef3b2ccb181d99000d","fff5f0fee0d2fcbba1fc9272fb6a4aef3b2ccb181d99000d","fff5f0fee0d2fcbba1fc9272fb6a4aef3b2ccb181da50f1567000d").map(dn);const y3=wr(g3);var _3=new Array(3).concat("fee6cefdae6be6550d","feeddefdbe85fd8d3cd94701","feeddefdbe85fd8d3ce6550da63603","feeddefdd0a2fdae6bfd8d3ce6550da63603","feeddefdd0a2fdae6bfd8d3cf16913d948018c2d04","fff5ebfee6cefdd0a2fdae6bfd8d3cf16913d948018c2d04","fff5ebfee6cefdd0a2fdae6bfd8d3cf16913d94801a636037f2704").map(dn);const v3=wr(_3);function b3(e){return e=Math.max(0,Math.min(1,e)),"rgb("+Math.max(0,Math.min(255,Math.round(-4.54-e*(35.34-e*(2381.73-e*(6402.7-e*(7024.72-2710.57*e)))))))+", "+Math.max(0,Math.min(255,Math.round(32.49+e*(170.73+e*(52.82-e*(131.46-e*(176.58-67.37*e)))))))+", "+Math.max(0,Math.min(255,Math.round(81.24+e*(442.36-e*(2482.43-e*(6167.24-e*(6614.94-2475.67*e)))))))+")"}var qD=1.78277,ZD=-.29227,Wb=-.90649,c_=1.97294,w3=c_*Wb,C3=c_*qD,E3=qD*ZD- -.14861*Wb;function AJ(e){if(e instanceof Sf)return new Sf(e.h,e.s,e.l,e.opacity);e instanceof Ji||(e=OE(e));var n=e.g/255,r=e.b/255,i=(E3*r+w3*(e.r/255)-C3*n)/(E3+w3-C3),o=r-i,c=(c_*(n-i)-ZD*o)/Wb,d=Math.sqrt(c*c+o*o)/(c_*i*(1-i)),p=d?Math.atan2(c,o)*_O-120:NaN;return new Sf(p<0?p+360:p,d,i,e.opacity)}function Dc(e,t,n,r){return 1===arguments.length?AJ(e):new Sf(e,t,n,r??1)}function Sf(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}function D3(e){return function t(n){function r(i,o){var c=e((i=Dc(i)).h,(o=Dc(o)).h),d=Qi(i.s,o.s),p=Qi(i.l,o.l),v=Qi(i.opacity,o.opacity);return function(E){return i.h=c(E),i.s=d(E),i.l=p(Math.pow(E,n)),i.opacity=v(E),i+""}}return n=+n,r.gamma=t,r}(1)}im(Sf,Dc,By(kh,{brighter(e){return e=null==e?om:Math.pow(om,e),new Sf(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=null==e?.7:Math.pow(.7,e),new Sf(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=isNaN(this.h)?0:(this.h+120)*yO,t=+this.l,n=isNaN(this.s)?0:this.s*t*(1-t),r=Math.cos(e),i=Math.sin(e);return new Ji(255*(t+n*(-.14861*r+qD*i)),255*(t+n*(ZD*r+Wb*i)),255*(t+n*(c_*r)),this.opacity)}})),D3(zE);var WD=D3(Qi);const S3=WD(Dc(300,.5,0),Dc(-240,.5,1));var M3=WD(Dc(-100,.75,.35),Dc(80,1.5,.8)),I3=WD(Dc(260,.75,.35),Dc(80,1.5,.8)),Xb=Dc();function T3(e){(e<0||e>1)&&(e-=Math.floor(e));var t=Math.abs(e-.5);return Xb.h=360*e-100,Xb.s=1.5-1.5*t,Xb.l=.8-.9*t,Xb+""}var Yb=Rh(),kJ=Math.PI/3,PJ=2*Math.PI/3;function A3(e){var t;return e=(.5-e)*Math.PI,Yb.r=255*(t=Math.sin(e))*t,Yb.g=255*(t=Math.sin(e+kJ))*t,Yb.b=255*(t=Math.sin(e+PJ))*t,Yb+""}function k3(e){return e=Math.max(0,Math.min(1,e)),"rgb("+Math.max(0,Math.min(255,Math.round(34.61+e*(1172.33-e*(10793.56-e*(33300.12-e*(38394.49-14825.05*e)))))))+", "+Math.max(0,Math.min(255,Math.round(23.31+e*(557.33+e*(1225.33-e*(3574.96-e*(1073.77+707.56*e)))))))+", "+Math.max(0,Math.min(255,Math.round(27.2+e*(3211.1-e*(15327.97-e*(27814-e*(22569.18-6838.66*e)))))))+")"}function Kb(e){var t=e.length;return function(n){return e[Math.max(0,Math.min(t-1,Math.floor(n*t)))]}}const P3=Kb(dn("44015444025645045745055946075a46085c460a5d460b5e470d60470e6147106347116447136548146748166848176948186a481a6c481b6d481c6e481d6f481f70482071482173482374482475482576482677482878482979472a7a472c7a472d7b472e7c472f7d46307e46327e46337f463480453581453781453882443983443a83443b84433d84433e85423f854240864241864142874144874045884046883f47883f48893e49893e4a893e4c8a3d4d8a3d4e8a3c4f8a3c508b3b518b3b528b3a538b3a548c39558c39568c38588c38598c375a8c375b8d365c8d365d8d355e8d355f8d34608d34618d33628d33638d32648e32658e31668e31678e31688e30698e306a8e2f6b8e2f6c8e2e6d8e2e6e8e2e6f8e2d708e2d718e2c718e2c728e2c738e2b748e2b758e2a768e2a778e2a788e29798e297a8e297b8e287c8e287d8e277e8e277f8e27808e26818e26828e26828e25838e25848e25858e24868e24878e23888e23898e238a8d228b8d228c8d228d8d218e8d218f8d21908d21918c20928c20928c20938c1f948c1f958b1f968b1f978b1f988b1f998a1f9a8a1e9b8a1e9c891e9d891f9e891f9f881fa0881fa1881fa1871fa28720a38620a48621a58521a68522a78522a88423a98324aa8325ab8225ac8226ad8127ad8128ae8029af7f2ab07f2cb17e2db27d2eb37c2fb47c31b57b32b67a34b67935b77937b87838b9773aba763bbb753dbc743fbc7340bd7242be7144bf7046c06f48c16e4ac16d4cc26c4ec36b50c46a52c56954c56856c66758c7655ac8645cc8635ec96260ca6063cb5f65cb5e67cc5c69cd5b6ccd5a6ece5870cf5773d05675d05477d1537ad1517cd2507fd34e81d34d84d44b86d54989d5488bd6468ed64590d74393d74195d84098d83e9bd93c9dd93ba0da39a2da37a5db36a8db34aadc32addc30b0dd2fb2dd2db5de2bb8de29bade28bddf26c0df25c2df23c5e021c8e020cae11fcde11dd0e11cd2e21bd5e21ad8e219dae319dde318dfe318e2e418e5e419e7e419eae51aece51befe51cf1e51df4e61ef6e620f8e621fbe723fde725"));var R3=Kb(dn("00000401000501010601010802010902020b02020d03030f03031204041405041606051806051a07061c08071e0907200a08220b09240c09260d0a290e0b2b100b2d110c2f120d31130d34140e36150e38160f3b180f3d19103f1a10421c10441d11471e114920114b21114e22115024125325125527125829115a2a115c2c115f2d11612f116331116533106734106936106b38106c390f6e3b0f703d0f713f0f72400f74420f75440f764510774710784910784a10794c117a4e117b4f127b51127c52137c54137d56147d57157e59157e5a167e5c167f5d177f5f187f601880621980641a80651a80671b80681c816a1c816b1d816d1d816e1e81701f81721f817320817521817621817822817922827b23827c23827e24828025828125818326818426818627818827818928818b29818c29818e2a81902a81912b81932b80942c80962c80982d80992d809b2e7f9c2e7f9e2f7fa02f7fa1307ea3307ea5317ea6317da8327daa337dab337cad347cae347bb0357bb2357bb3367ab5367ab73779b83779ba3878bc3978bd3977bf3a77c03a76c23b75c43c75c53c74c73d73c83e73ca3e72cc3f71cd4071cf4070d0416fd2426fd3436ed5446dd6456cd8456cd9466bdb476adc4869de4968df4a68e04c67e24d66e34e65e44f64e55064e75263e85362e95462ea5661eb5760ec5860ed5a5fee5b5eef5d5ef05f5ef1605df2625df2645cf3655cf4675cf4695cf56b5cf66c5cf66e5cf7705cf7725cf8745cf8765cf9785df9795df97b5dfa7d5efa7f5efa815ffb835ffb8560fb8761fc8961fc8a62fc8c63fc8e64fc9065fd9266fd9467fd9668fd9869fd9a6afd9b6bfe9d6cfe9f6dfea16efea36ffea571fea772fea973feaa74feac76feae77feb078feb27afeb47bfeb67cfeb77efeb97ffebb81febd82febf84fec185fec287fec488fec68afec88cfeca8dfecc8ffecd90fecf92fed194fed395fed597fed799fed89afdda9cfddc9efddea0fde0a1fde2a3fde3a5fde5a7fde7a9fde9aafdebacfcecaefceeb0fcf0b2fcf2b4fcf4b6fcf6b8fcf7b9fcf9bbfcfbbdfcfdbf")),F3=Kb(dn("00000401000501010601010802010a02020c02020e03021004031204031405041706041907051b08051d09061f0a07220b07240c08260d08290e092b10092d110a30120a32140b34150b37160b39180c3c190c3e1b0c411c0c431e0c451f0c48210c4a230c4c240c4f260c51280b53290b552b0b572d0b592f0a5b310a5c320a5e340a5f3609613809623909633b09643d09653e0966400a67420a68440a68450a69470b6a490b6a4a0c6b4c0c6b4d0d6c4f0d6c510e6c520e6d540f6d550f6d57106e59106e5a116e5c126e5d126e5f136e61136e62146e64156e65156e67166e69166e6a176e6c186e6d186e6f196e71196e721a6e741a6e751b6e771c6d781c6d7a1d6d7c1d6d7d1e6d7f1e6c801f6c82206c84206b85216b87216b88226a8a226a8c23698d23698f24699025689225689326679526679727669827669a28659b29649d29649f2a63a02a63a22b62a32c61a52c60a62d60a82e5fa92e5eab2f5ead305dae305cb0315bb1325ab3325ab43359b63458b73557b93556ba3655bc3754bd3853bf3952c03a51c13a50c33b4fc43c4ec63d4dc73e4cc83f4bca404acb4149cc4248ce4347cf4446d04545d24644d34743d44842d54a41d74b3fd84c3ed94d3dda4e3cdb503bdd513ade5238df5337e05536e15635e25734e35933e45a31e55c30e65d2fe75e2ee8602de9612bea632aeb6429eb6628ec6726ed6925ee6a24ef6c23ef6e21f06f20f1711ff1731df2741cf3761bf37819f47918f57b17f57d15f67e14f68013f78212f78410f8850ff8870ef8890cf98b0bf98c0af98e09fa9008fa9207fa9407fb9606fb9706fb9906fb9b06fb9d07fc9f07fca108fca309fca50afca60cfca80dfcaa0ffcac11fcae12fcb014fcb216fcb418fbb61afbb81dfbba1ffbbc21fbbe23fac026fac228fac42afac62df9c72ff9c932f9cb35f8cd37f8cf3af7d13df7d340f6d543f6d746f5d949f5db4cf4dd4ff4df53f4e156f3e35af3e55df2e661f2e865f2ea69f1ec6df1ed71f1ef75f1f179f2f27df2f482f3f586f3f68af4f88ef5f992f6fa96f8fb9af9fc9dfafda1fcffa4")),O3=Kb(dn("0d088710078813078916078a19068c1b068d1d068e20068f2206902406912605912805922a05932c05942e05952f059631059733059735049837049938049a3a049a3c049b3e049c3f049c41049d43039e44039e46039f48039f4903a04b03a14c02a14e02a25002a25102a35302a35502a45601a45801a45901a55b01a55c01a65e01a66001a66100a76300a76400a76600a76700a86900a86a00a86c00a86e00a86f00a87100a87201a87401a87501a87701a87801a87a02a87b02a87d03a87e03a88004a88104a78305a78405a78606a68707a68808a68a09a58b0aa58d0ba58e0ca48f0da4910ea3920fa39410a29511a19613a19814a099159f9a169f9c179e9d189d9e199da01a9ca11b9ba21d9aa31e9aa51f99a62098a72197a82296aa2395ab2494ac2694ad2793ae2892b02991b12a90b22b8fb32c8eb42e8db52f8cb6308bb7318ab83289ba3388bb3488bc3587bd3786be3885bf3984c03a83c13b82c23c81c33d80c43e7fc5407ec6417dc7427cc8437bc9447aca457acb4679cc4778cc4977cd4a76ce4b75cf4c74d04d73d14e72d24f71d35171d45270d5536fd5546ed6556dd7566cd8576bd9586ada5a6ada5b69db5c68dc5d67dd5e66de5f65de6164df6263e06363e16462e26561e26660e3685fe4695ee56a5de56b5de66c5ce76e5be76f5ae87059e97158e97257ea7457eb7556eb7655ec7754ed7953ed7a52ee7b51ef7c51ef7e50f07f4ff0804ef1814df1834cf2844bf3854bf3874af48849f48948f58b47f58c46f68d45f68f44f79044f79143f79342f89441f89540f9973ff9983ef99a3efa9b3dfa9c3cfa9e3bfb9f3afba139fba238fca338fca537fca636fca835fca934fdab33fdac33fdae32fdaf31fdb130fdb22ffdb42ffdb52efeb72dfeb82cfeba2cfebb2bfebd2afebe2afec029fdc229fdc328fdc527fdc627fdc827fdca26fdcb26fccd25fcce25fcd025fcd225fbd324fbd524fbd724fad824fada24f9dc24f9dd25f8df25f8e125f7e225f7e425f6e626f6e826f5e926f5eb27f4ed27f3ee27f3f027f2f227f1f426f1f525f0f724f0f921"));function XD(e){return"string"==typeof e?new Js([[document.querySelector(e)]],[document.documentElement]):new Js([[e]],ER)}function Cm(e){return function(){return e}}function L3(e){this._context=e}function Jb(e){return new L3(e)}function OJ(e){return e[0]}function LJ(e){return e[1]}L3.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:this._context.lineTo(e,t)}}},Math,Math;const N3=Math.cos,YD=(Math,Math.min),Qb=Math.sin,Li=Math.sqrt,Em=Math.PI,ex=2*Em,zJ=Li(3),V3={draw(e,t){const n=.59436*Li(t+YD(t/28,.75)),r=n/2,i=r*zJ;e.moveTo(0,n),e.lineTo(0,-n),e.moveTo(-i,-r),e.lineTo(i,r),e.moveTo(-i,r),e.lineTo(i,-r)}},u_={draw(e,t){const n=Li(t/Em);e.moveTo(n,0),e.arc(0,0,n,0,ex)}},U3={draw(e,t){const n=Li(t/5)/2;e.moveTo(-3*n,-n),e.lineTo(-n,-n),e.lineTo(-n,-3*n),e.lineTo(n,-3*n),e.lineTo(n,-n),e.lineTo(3*n,-n),e.lineTo(3*n,n),e.lineTo(n,n),e.lineTo(n,3*n),e.lineTo(-n,3*n),e.lineTo(-n,n),e.lineTo(-3*n,n),e.closePath()}},$3=Li(1/3),BJ=2*$3,j3={draw(e,t){const n=Li(t/BJ),r=n*$3;e.moveTo(0,-n),e.lineTo(r,0),e.lineTo(0,n),e.lineTo(-r,0),e.closePath()}},H3={draw(e,t){const n=.62625*Li(t);e.moveTo(0,-n),e.lineTo(n,0),e.lineTo(0,n),e.lineTo(-n,0),e.closePath()}},G3={draw(e,t){const n=.87559*Li(t-YD(t/7,2));e.moveTo(-n,0),e.lineTo(n,0),e.moveTo(0,n),e.lineTo(0,-n)}},q3={draw(e,t){const n=Li(t),r=-n/2;e.rect(r,r,n,n)}},Z3={draw(e,t){const n=.4431*Li(t);e.moveTo(n,n),e.lineTo(n,-n),e.lineTo(-n,-n),e.lineTo(-n,n),e.closePath()}},W3=Qb(Em/10)/Qb(7*Em/10),UJ=Qb(ex/10)*W3,$J=-N3(ex/10)*W3,X3={draw(e,t){const n=Li(.8908130915292852*t),r=UJ*n,i=$J*n;e.moveTo(0,-n),e.lineTo(r,i);for(let o=1;o<5;++o){const c=ex*o/5,d=N3(c),p=Qb(c);e.lineTo(p*n,-d*n),e.lineTo(d*r-p*i,p*r+d*i)}e.closePath()}},KD=Li(3),Y3={draw(e,t){const n=-Li(t/(3*KD));e.moveTo(0,2*n),e.lineTo(-KD*n,-n),e.lineTo(KD*n,-n),e.closePath()}},jJ=Li(3),K3={draw(e,t){const n=.6824*Li(t),r=n/2,i=n*jJ/2;e.moveTo(0,-n),e.lineTo(i,r),e.lineTo(-i,r),e.closePath()}},ka=-.5,Pa=Li(3)/2,JD=1/Li(12),HJ=3*(JD/2+1),J3={draw(e,t){const n=Li(t/HJ),r=n/2,i=n*JD,o=r,c=n*JD+n,d=-o,p=c;e.moveTo(r,i),e.lineTo(o,c),e.lineTo(d,p),e.lineTo(ka*r-Pa*i,Pa*r+ka*i),e.lineTo(ka*o-Pa*c,Pa*o+ka*c),e.lineTo(ka*d-Pa*p,Pa*d+ka*p),e.lineTo(ka*r+Pa*i,ka*i-Pa*r),e.lineTo(ka*o+Pa*c,ka*c-Pa*o),e.lineTo(ka*d+Pa*p,ka*p-Pa*d),e.closePath()}},Q3={draw(e,t){const n=.6189*Li(t-YD(t/6,1.7));e.moveTo(-n,-n),e.lineTo(n,n),e.moveTo(-n,n),e.lineTo(n,-n)}},GJ=[u_,U3,j3,q3,X3,Y3,J3],qJ=[u_,G3,Q3,K3,V3,Z3,H3];function Nh(){}function tx(e,t,n){e._context.bezierCurveTo((2*e._x0+e._x1)/3,(2*e._y0+e._y1)/3,(e._x0+2*e._x1)/3,(e._y0+2*e._y1)/3,(e._x0+4*e._x1+t)/6,(e._y0+4*e._y1+n)/6)}function nx(e){this._context=e}function eN(e){this._context=e}function tN(e){this._context=e}nx.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){switch(this._point){case 3:tx(this,this._x1,this._y1);case 2:this._context.lineTo(this._x1,this._y1)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,this._context.lineTo((5*this._x0+this._x1)/6,(5*this._y0+this._y1)/6);default:tx(this,e,t)}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}},eN.prototype={areaStart:Nh,areaEnd:Nh,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._y0=this._y1=this._y2=this._y3=this._y4=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:this._context.moveTo(this._x2,this._y2),this._context.closePath();break;case 2:this._context.moveTo((this._x2+2*this._x3)/3,(this._y2+2*this._y3)/3),this._context.lineTo((this._x3+2*this._x2)/3,(this._y3+2*this._y2)/3),this._context.closePath();break;case 3:this.point(this._x2,this._y2),this.point(this._x3,this._y3),this.point(this._x4,this._y4)}},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._x2=e,this._y2=t;break;case 1:this._point=2,this._x3=e,this._y3=t;break;case 2:this._point=3,this._x4=e,this._y4=t,this._context.moveTo((this._x0+4*this._x1+e)/6,(this._y0+4*this._y1+t)/6);break;default:tx(this,e,t)}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}},tN.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){(this._line||0!==this._line&&3===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3;var n=(this._x0+4*this._x1+e)/6,r=(this._y0+4*this._y1+t)/6;this._line?this._context.lineTo(n,r):this._context.moveTo(n,r);break;case 3:this._point=4;default:tx(this,e,t)}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};class nN{constructor(t,n){this._context=t,this._x=n}areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._point=0}lineEnd(){(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line}point(t,n){switch(t=+t,n=+n,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,n):this._context.moveTo(t,n);break;case 1:this._point=2;default:this._x?this._context.bezierCurveTo(this._x0=(this._x0+t)/2,this._y0,this._x0,n,t,n):this._context.bezierCurveTo(this._x0,this._y0=(this._y0+n)/2,t,this._y0,t,n)}this._x0=t,this._y0=n}}function rN(e,t){this._basis=new nx(e),this._beta=t}rN.prototype={lineStart:function(){this._x=[],this._y=[],this._basis.lineStart()},lineEnd:function(){var e=this._x,t=this._y,n=e.length-1;if(n>0)for(var p,r=e[0],i=t[0],o=e[n]-r,c=t[n]-i,d=-1;++d<=n;)this._basis.point(this._beta*e[d]+(1-this._beta)*(r+(p=d/n)*o),this._beta*t[d]+(1-this._beta)*(i+p*c));this._x=this._y=null,this._basis.lineEnd()},point:function(e,t){this._x.push(+e),this._y.push(+t)}};const QJ=function e(t){function n(r){return 1===t?new nx(r):new rN(r,t)}return n.beta=function(r){return e(+r)},n}(.85);function rx(e,t,n){e._context.bezierCurveTo(e._x1+e._k*(e._x2-e._x0),e._y1+e._k*(e._y2-e._y0),e._x2+e._k*(e._x1-t),e._y2+e._k*(e._y1-n),e._x2,e._y2)}function QD(e,t){this._context=e,this._k=(1-t)/6}QD.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:rx(this,this._x1,this._y1)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2,this._x1=e,this._y1=t;break;case 2:this._point=3;default:rx(this,e,t)}this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};const eQ=function e(t){function n(r){return new QD(r,t)}return n.tension=function(r){return e(+r)},n}(0);function eS(e,t){this._context=e,this._k=(1-t)/6}eS.prototype={areaStart:Nh,areaEnd:Nh,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:this._context.moveTo(this._x3,this._y3),this._context.closePath();break;case 2:this._context.lineTo(this._x3,this._y3),this._context.closePath();break;case 3:this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5)}},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._x3=e,this._y3=t;break;case 1:this._point=2,this._context.moveTo(this._x4=e,this._y4=t);break;case 2:this._point=3,this._x5=e,this._y5=t;break;default:rx(this,e,t)}this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};const tQ=function e(t){function n(r){return new eS(r,t)}return n.tension=function(r){return e(+r)},n}(0);function tS(e,t){this._context=e,this._k=(1-t)/6}tS.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){(this._line||0!==this._line&&3===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:rx(this,e,t)}this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};const nQ=function e(t){function n(r){return new tS(r,t)}return n.tension=function(r){return e(+r)},n}(0);function nS(e,t,n){var r=e._x1,i=e._y1,o=e._x2,c=e._y2;if(e._l01_a>1e-12){var d=2*e._l01_2a+3*e._l01_a*e._l12_a+e._l12_2a,p=3*e._l01_a*(e._l01_a+e._l12_a);r=(r*d-e._x0*e._l12_2a+e._x2*e._l01_2a)/p,i=(i*d-e._y0*e._l12_2a+e._y2*e._l01_2a)/p}if(e._l23_a>1e-12){var v=2*e._l23_2a+3*e._l23_a*e._l12_a+e._l12_2a,E=3*e._l23_a*(e._l23_a+e._l12_a);o=(o*v+e._x1*e._l23_2a-t*e._l12_2a)/E,c=(c*v+e._y1*e._l23_2a-n*e._l12_2a)/E}e._context.bezierCurveTo(r,i,o,c,e._x2,e._y2)}function iN(e,t){this._context=e,this._alpha=t}iN.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:this.point(this._x2,this._y2)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){if(e=+e,t=+t,this._point){var n=this._x2-e,r=this._y2-t;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+r*r,this._alpha))}switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3;default:nS(this,e,t)}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};const rQ=function e(t){function n(r){return t?new iN(r,t):new QD(r,0)}return n.alpha=function(r){return e(+r)},n}(.5);function oN(e,t){this._context=e,this._alpha=t}oN.prototype={areaStart:Nh,areaEnd:Nh,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 1:this._context.moveTo(this._x3,this._y3),this._context.closePath();break;case 2:this._context.lineTo(this._x3,this._y3),this._context.closePath();break;case 3:this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5)}},point:function(e,t){if(e=+e,t=+t,this._point){var n=this._x2-e,r=this._y2-t;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+r*r,this._alpha))}switch(this._point){case 0:this._point=1,this._x3=e,this._y3=t;break;case 1:this._point=2,this._context.moveTo(this._x4=e,this._y4=t);break;case 2:this._point=3,this._x5=e,this._y5=t;break;default:nS(this,e,t)}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};const iQ=function e(t){function n(r){return t?new oN(r,t):new eS(r,0)}return n.alpha=function(r){return e(+r)},n}(.5);function sN(e,t){this._context=e,this._alpha=t}sN.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){(this._line||0!==this._line&&3===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){if(e=+e,t=+t,this._point){var n=this._x2-e,r=this._y2-t;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+r*r,this._alpha))}switch(this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:nS(this,e,t)}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};const oQ=function e(t){function n(r){return t?new sN(r,t):new tS(r,0)}return n.alpha=function(r){return e(+r)},n}(.5);function aN(e){this._context=e}function lN(e){return e<0?-1:1}function cN(e,t,n){var r=e._x1-e._x0,i=t-e._x1,o=(e._y1-e._y0)/(r||i<0&&-0),c=(n-e._y1)/(i||r<0&&-0),d=(o*i+c*r)/(r+i);return(lN(o)+lN(c))*Math.min(Math.abs(o),Math.abs(c),.5*Math.abs(d))||0}function uN(e,t){var n=e._x1-e._x0;return n?(3*(e._y1-e._y0)/n-t)/2:t}function rS(e,t,n){var r=e._x0,o=e._x1,c=e._y1,d=(o-r)/3;e._context.bezierCurveTo(r+d,e._y0+d*t,o-d,c-d*n,o,c)}function ix(e){this._context=e}function hN(e){this._context=new dN(e)}function dN(e){this._context=e}function fN(e){this._context=e}function pN(e){var t,r,n=e.length-1,i=new Array(n),o=new Array(n),c=new Array(n);for(i[0]=0,o[0]=2,c[0]=e[0]+2*e[1],t=1;t=0;--t)i[t]=(c[t]-i[t+1])/o[t];for(o[n-1]=(e[n]+i[n-1])/2,t=0;t0&&isFinite(e)?e:NaN}function oS(e){return e<0&&isFinite(e)?e:NaN}aN.prototype={areaStart:Nh,areaEnd:Nh,lineStart:function(){this._point=0},lineEnd:function(){this._point&&this._context.closePath()},point:function(e,t){e=+e,t=+t,this._point?this._context.lineTo(e,t):(this._point=1,this._context.moveTo(e,t))}},ix.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=this._t0=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x1,this._y1);break;case 3:rS(this,this._t0,uN(this,this._t0))}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){var n=NaN;if(t=+t,(e=+e)!==this._x1||t!==this._y1){switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,rS(this,uN(this,n=cN(this,e,t)),n);break;default:rS(this,this._t0,n=cN(this,e,t))}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t,this._t0=n}}},(hN.prototype=Object.create(ix.prototype)).point=function(e,t){ix.prototype.point.call(this,t,e)},dN.prototype={moveTo:function(e,t){this._context.moveTo(t,e)},closePath:function(){this._context.closePath()},lineTo:function(e,t){this._context.lineTo(t,e)},bezierCurveTo:function(e,t,n,r,i,o){this._context.bezierCurveTo(t,e,r,n,o,i)}},fN.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=[],this._y=[]},lineEnd:function(){var e=this._x,t=this._y,n=e.length;if(n)if(this._line?this._context.lineTo(e[0],t[0]):this._context.moveTo(e[0],t[0]),2===n)this._context.lineTo(e[1],t[1]);else for(var r=pN(e),i=pN(t),o=0,c=1;c=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:if(this._t<=0)this._context.lineTo(this._x,t),this._context.lineTo(e,t);else{var n=this._x*(1-this._t)+e*this._t;this._context.lineTo(n,this._y),this._context.lineTo(n,t)}}this._x=e,this._y=t}},Dm.prototype={constructor:Dm,scale:function(e){return 1===e?this:new Dm(this.k*e,this.x,this.y)},translate:function(e,t){return 0===e&0===t?this:new Dm(this.k,this.x+this.k*e,this.y+this.k*t)},apply:function(e){return[e[0]*this.k+this.x,e[1]*this.k+this.y]},applyX:function(e){return e*this.k+this.x},applyY:function(e){return e*this.k+this.y},invert:function(e){return[(e[0]-this.x)/this.k,(e[1]-this.y)/this.k]},invertX:function(e){return(e-this.x)/this.k},invertY:function(e){return(e-this.y)/this.k},rescaleX:function(e){return e.copy().domain(e.range().map(this.invertX,this).map(e.invert,e))},rescaleY:function(e){return e.copy().domain(e.range().map(this.invertY,this).map(e.invert,e))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}},new Dm(1,0,0);const bQ=/^(?:[-+]\d{2})?\d{4}(?:-\d{2}(?:-\d{2})?)?(?:T\d{2}:\d{2}(?::\d{2}(?:\.\d{3})?)?(?:Z|[-+]\d{2}:?\d{2})?)?$/;function _N(e,t){return bQ.test(e+="")?new Date(e):"function"==typeof t?t(e):t}const xQ=new Map([["second",wu],["minute",zb],["hour",Vb],["day",ym],["week",_m],["month",bm],["quarter",bm.every(3)],["half",bm.every(6)],["year",Cc],["monday",i_],["tuesday",KO],["wednesday",JO],["thursday",Cf],["friday",QO],["saturday",eL],["sunday",_m]]),wQ=new Map([["second",wu],["minute",Bb],["hour",Ub],["day",r_],["week",vm],["month",xm],["quarter",xm.every(3)],["half",xm.every(6)],["year",Ec],["monday",o_],["tuesday",tL],["wednesday",nL],["thursday",Df],["friday",rL],["saturday",iL],["sunday",vm]]);function CQ(e){const t=xQ.get(`${e}`.toLowerCase());if(!t)throw new Error(`unknown interval: ${e}`);return t}function EQ(e){const t=wQ.get(`${e}`.toLowerCase());if(!t)throw new Error(`unknown interval: ${e}`);return t}const h_=Object.getPrototypeOf(Uint8Array),DQ=Object.prototype.toString;function Sc(e,t,n){const r=typeof t;return"string"===r?vN(e,MQ(t),n):"function"===r?vN(e,t,n):"number"===r||t instanceof Date||"boolean"===r?Ho(e,Mm(t),n):function bN(e,t){return void 0===t?Mc(e):e instanceof t?e:t.prototype instanceof h_&&!(e instanceof h_)?t.from(e,aS):t.from(e)}("function"==typeof t?.transform?t.transform(e):t,n)}function vN(e,t,n){return Ho(e,n?.prototype instanceof h_?function SQ(e){return(t,n)=>aS(e(t,n))}(t):t,n)}const MQ=e=>t=>t[e],IQ=(e,t)=>t,Cu={transform:e=>e},TQ=()=>!0,Il=e=>null==e?e:`${e}`,fi=e=>null==e?e:+e,xN=e=>e?e[0]:void 0,sS=e=>e?e[1]:void 0,Mm=e=>()=>e;function wN(e){const t=+`${e}`.slice(1)/100;return(n,r)=>N0(n,t,r)}function ax(e){return e instanceof h_?e:Ho(e,aS,Float64Array)}function aS(e){return null==e?NaN:Number(e)}function AQ(e){return Ho(e,kQ)}function kQ(e){return e instanceof Date&&!isNaN(e)?e:"string"==typeof e?_N(e):null==e||isNaN(e=+e)?void 0:new Date(e)}function Im(e,t){return void 0===e&&(e=t),null===e?[void 0,"none"]:ux(e)?[void 0,e]:[e,void 0]}function Ps(e,t){return void 0===e&&(e=t),null===e||"number"==typeof e?[void 0,e]:[e,void 0]}function CN(e,t,n){if(null!=e)return Eu(e,t,n)}function Eu(e,t,n){const r=`${e}`.toLowerCase();if(!n.includes(r))throw new Error(`invalid ${t}: ${e}`);return r}function Mc(e){return null==e||e instanceof Array||e instanceof h_?e:Array.from(e)}function Ho(e,t,n=Array){return null==e?e:e instanceof n?e.map(t):n.from(e,t)}function lS(e,t=Array){return e instanceof t?e.slice():t.from(e)}function Tm(e){return e?.toString===DQ}function Am(e){return Tm(e)&&(void 0!==e.type||void 0!==e.domain)}function lx(e){return Tm(e)&&"function"!=typeof e.transform}function km(e){return lx(e)&&void 0===e.value&&void 0===e.channel}function cx(e,t){return void 0===e&&void 0===t?[xN,sS]:[e,t]}function EN({z:e,fill:t,stroke:n}={}){return void 0===e&&([e]=Im(t)),void 0===e&&([e]=Im(n)),e}function d_(e){const t=e.length,n=new Uint32Array(t);for(let r=0;re[n])}function cS(e){return null!==e&&"object"==typeof e?e.valueOf():e}function f_(e,t){return"string"==typeof e?e:e&&void 0!==e.label?e.label:t}function uS(e,t){if(null!=e){if("number"==typeof e){const n=e;return{floor:r=>n*Math.floor(r/n),offset:r=>r+n,range:(r,i)=>hR(Math.ceil(r/n),i/n).map(o=>n*o)}}if("string"==typeof e)return("time"===t?CQ:EQ)(e);if("function"!=typeof e.floor)throw new Error("invalid interval; missing floor method");if("function"!=typeof e.offset)throw new Error("invalid interval; missing offset method");return e}}function p_(e,t){if((e=uS(e,t))&&"function"!=typeof e.range)throw new Error("invalid interval: missing range method");return e}function hS(e){return void 0===e||lx(e)?e:{value:e}}function zh(e){return e&&"function"==typeof e[Symbol.iterator]}function OQ(e){for(const t of e)if(null!=t)return"object"!=typeof t||t instanceof Date}function SN(e){for(const t of e){if(null==t)continue;const n=typeof t;return"string"===n||"boolean"===n}}function Tl(e){for(const t of e)if(null!=t)return t instanceof Date}function LQ(e){for(const t of e)if(null!=t)return"string"==typeof t&&isNaN(t)&&_N(t)}function NQ(e){for(const t of e)if(null!=t){if("string"!=typeof t)return!1;if(t.trim())return!isNaN(t)}}function dS(e,t){let n;for(const r of e)if(null!=r){if(!t(r))return!1;n=!0}return n}function ux(e){return"string"==typeof e&&("none"===(e=e.toLowerCase().trim())||"currentcolor"===e||e.startsWith("url(")&&e.endsWith(")")||e.startsWith("var(")&&e.endsWith(")")||null!==Ph(e))}function BQ(e){return"number"==typeof e&&(0<=e&&e<=1||isNaN(e))}function ea(e){return null==e||m_(e)}function m_(e){return/^\s*none\s*$/i.test(e)}function fS(e="middle"){return Eu(e,"frameAnchor",["middle","top-left","top","top-right","right","bottom-right","bottom","bottom-left","left"])}function g_(e){if(null!=e)return Ty(e[0],e[e.length-1])}function MN(e){return zh(e)?function $Q(e){console.warn("named iterables are deprecated; please use an object instead");const t=new Set;return Object.fromEntries(Array.from(e,n=>{const{name:r}=n;if(null==r)throw new Error("missing name");const i=`${r}`;if("__proto__"===i)throw new Error(`illegal name: ${i}`);if(t.has(i))throw new Error(`duplicate name: ${i}`);return t.add(i),[r,n]}))}(e):e}const Ic=Symbol("position"),Tc=Symbol("color"),hx=Symbol("radius"),dx=Symbol("length"),fx=Symbol("opacity"),px=Symbol("symbol"),ni=new Map([["x",Ic],["y",Ic],["fx",Ic],["fy",Ic],["r",hx],["color",Tc],["opacity",fx],["symbol",px],["length",dx]]),HQ=2/Math.sqrt(3),pS=new Map([["asterisk",V3],["circle",u_],["cross",U3],["diamond",j3],["diamond2",H3],["hexagon",{draw(e,t){const n=Math.sqrt(t/Math.PI),r=n*HQ,i=r/2;e.moveTo(0,r),e.lineTo(n,i),e.lineTo(n,-i),e.lineTo(0,-r),e.lineTo(-n,-i),e.lineTo(-n,i),e.closePath()}}],["plus",G3],["square",q3],["square2",Z3],["star",X3],["times",Q3],["triangle",Y3],["triangle2",K3],["wye",J3]]);function mS(e){return e&&"function"==typeof e.draw}function qQ(e){return!!mS(e)||"string"==typeof e&&pS.has(e.toLowerCase())}function gS(e){if(null==e||mS(e))return e;const t=pS.get(`${e}`.toLowerCase());if(t)return t;throw new Error(`invalid symbol: ${e}`)}function _S(e,t,n=YQ){if(null==e)return n(e);if("function"==typeof e.reduceIndex)return e;if("function"==typeof e.reduce&&Tm(e))return function QQ(e){return console.warn("deprecated reduce interface; implement reduceIndex instead."),{...e,reduceIndex:e.reduce.bind(e)}}(e);if("function"==typeof e)return function eee(e){return{reduceIndex:(t,n,r)=>e(Pm(n,t),r)}}(e);if(/^p\d{2}$/i.test(e))return Du(wN(e));switch(`${e}`.toLowerCase()){case"first":return RN;case"last":return nee;case"identity":return PN;case"count":return vS;case"distinct":return ree;case"sum":return null==t?vS:iee;case"proportion":return FN(t,"data");case"proportion-facet":return FN(t,"facet");case"deviation":return Du(tR);case"min":return Du(ff);case"min-index":return Du(KG);case"max":return Du(As);case"max-index":return Du(qG);case"mean":return kN(ZG);case"median":return kN(z0);case"variance":return Du(mE);case"mode":return Du(uR)}return n(e)}function YQ(e){throw new Error(`invalid reduce: ${e}`)}function Du(e){return{reduceIndex:(t,n)=>e(t,r=>n[r])}}function kN(e){return{reduceIndex(t,n){const r=e(t,i=>n[i]);return Tl(n)?new Date(r):r}}}const PN={reduceIndex:(e,t)=>Pm(t,e)},RN={reduceIndex:(e,t)=>t[e[0]]},nee={reduceIndex:(e,t)=>t[e[e.length-1]]},vS={label:"Frequency",reduceIndex:e=>e.length},ree={label:"Distinct",reduceIndex(e,t){const n=new gE;for(const r of e)n.add(t[r]);return n.size}},iee=Du(B0);function FN(e,t){return null==e?{scope:t,label:"Frequency",reduceIndex:(n,r,i=1)=>n.length/i}:{scope:t,reduceIndex:(n,r,i=1)=>B0(n,o=>r[o])/i}}function y_(e,{scale:t,type:n,value:r,filter:i,hint:o},c){return ON(c,{scale:t,type:n,value:Sc(e,r),label:f_(r),filter:i,hint:o})}function ON(e,t){const{scale:n,value:r}=t;if(!0===n||"auto"===n)switch(e){case"fill":case"stroke":case"color":t.scale=!0!==n&&dS(r,ux)?null:"color";break;case"fillOpacity":case"strokeOpacity":t.scale=!0!==n&&dS(r,BQ)?null:"opacity";break;case"symbol":!0!==n&&dS(r,qQ)?(t.scale=null,t.value=Ho(r,gS)):t.scale="symbol";break;default:t.scale=ni.has(e)?e:null}else if(!1===n)t.scale=null;else if(null!=n&&!ni.has(n))throw new Error(`unknown scale: ${n}`);return t}function lee(e,t){for(const n in e){const r=e[n];if(r.scale===t)return r}}function cee(e,t){const n=e.original;if(n===e)return t;const r=t.value,i=t.value=[];for(let o=0;oMath.abs(o-r[c]),Float64Array)}function bS(e,t,n){let r=e[t];if(!r&&void 0!==n&&(r=e[n]),r)return r.value;throw new Error(`missing channel: ${t}`)}function uee([e,t],[n,r]){return Sm(t,r)||Sm(e,n)}function hee([e,t],[n,r]){return gN(t,r)||Sm(e,n)}let xS=0;function Mf(e){console.warn(e),++xS}const NN=Math.PI,Su=2*NN;function fee({projection:e,inset:t=0,insetTop:n=t,insetRight:r=t,insetBottom:i=t,insetLeft:o=t}={},c){if(null==e)return;if("function"==typeof e.stream)return e;let d,p,v="frame";if(Tm(e)){let fe;if(({type:e,domain:p,inset:fe,insetTop:n=(void 0!==fe?fe:n),insetRight:r=(void 0!==fe?fe:r),insetBottom:i=(void 0!==fe?fe:i),insetLeft:o=(void 0!==fe?fe:o),clip:v=v,...d}=e),null==e)return}"function"!=typeof e&&({type:e}=zN(e));const{width:E,height:D,marginLeft:I,marginRight:P,marginTop:N,marginBottom:G}=c,U=E-I-P-o-r,Z=D-N-G-n-i;if(e=e?.({width:U,height:Z,clip:v,...d}),null==e)return;v=function pee(e,t,n,r,i){if(!1===e||null==e||"number"==typeof e)return o=>o;if("frame"===(!0===e&&(e="frame"),`${e}`.toLowerCase()))return xF(t,n,r,i);throw new Error(`unknown projection clip type: ${e}`)}(v,I,N,E-P,D-G);let re,ne=I+o,X=N+n;if(null!=p){const[[fe,ve],[Re,We]]=sD(e).bounds(p),Ke=Math.min(U/(Re-fe),Z/(We-ve));Ke>0?(ne-=(Ke*(fe+Re)-U)/2,X-=(Ke*(ve+We)-Z)/2,re=fD({point(lt,Ue){this.stream.point(lt*Ke+ne,Ue*Ke+X)}})):Mf("Warning: the projection could not be fit to the specified domain; using the default scale.")}return re??(re=0===ne&&0===X?BN():fD({point(fe,ve){this.stream.point(fe+ne,ve+X)}})),{stream:fe=>e.stream(re.stream(v(fe)))}}function zN(e){switch(`${e}`.toLowerCase()){case"albers-usa":return Al(gY,.7463,.4673);case"albers":return gx(sO,.7463,.4673);case"azimuthal-equal-area":return Al(yY,4,4);case"azimuthal-equidistant":return Al(_Y,Su,Su);case"conic-conformal":return gx(xY,Su,Su);case"conic-equal-area":return gx(Mb,6.1702,2.9781);case"conic-equidistant":return gx(EY,7.312,3.6282);case"equal-earth":return Al(SY,5.4133,2.6347);case"equirectangular":return Al(wY,Su,NN);case"gnomonic":return Al(MY,3.4641,3.4641);case"identity":return{type:BN};case"reflect-y":return{type:mee};case"mercator":return Al(vY,Su,Su);case"orthographic":return Al(IY,2,2);case"stereographic":return Al(TY,2,2);case"transverse-mercator":return Al(AY,Su,Su);default:throw new Error(`unknown projection type: ${e}`)}}function Al(e,t,n){return{type:({width:r,height:i,rotate:o,precision:c=.15,clip:d})=>{const p=e();return null!=c&&p.precision?.(c),null!=o&&p.rotate?.(o),"number"==typeof d&&p.clipAngle?.(d),p.scale(Math.min(r/t,i/n)),p.translate([r/2,i/2]),p},aspectRatio:n/t}}function gx(e,t,n){const{type:r,aspectRatio:i}=Al(e,t,n);return{type:o=>{const{parallels:c,domain:d,width:p,height:v}=o,E=r(o);return null!=c&&(E.parallels(c),void 0===d&&E.fitSize([p,v],{type:"Sphere"})),E},aspectRatio:i}}const BN=Mm({stream:e=>e}),mee=Mm(fD({point(e,t){this.stream.point(e,-t)}}));function yx(e,t,n,r,i){const o=n[e]&&"x"===n[e].scale,c=n[t]&&"y"===n[t].scale;if(o&&c)!function gee(e,t,n,r){const i=n[e],o=n[t],c=i.length,d=n[e]=new Float64Array(c).fill(NaN),p=n[t]=new Float64Array(c).fill(NaN);let v;const E=r.stream({point(D,I){d[v]=D,p[v]=I}});for(v=0;v1===n?[e[3][1]]:2===n?[e[3][1],e[3][2]]:(n=Math.max(3,Math.floor(n)))>9?Sl(t,n):e[n]}function Mu(e,t){return({length:n})=>2===n?[e[3][0],e[3][2]]:(n=Math.max(3,Math.floor(n)))>11?Sl(t,n):e[n]}function UN(e,t){return({length:n})=>2===n?[e[3][2],e[3][0]]:(n=Math.max(3,Math.floor(n)))>11?Sl(r=>t(1-r),n):e[n].slice().reverse()}function Iu(e){return({length:t})=>Sl(e,Math.max(2,Math.floor(t)))}function $N(e){return({length:t})=>Sl(e,Math.floor(t)+1).slice(0,-1)}function jN(e){const t=`${e}`.toLowerCase();if(!VN.has(t))throw new Error(`unknown ordinal scheme: ${t}`);return VN.get(t)}function vx(e,t){const n=jN(e),r="function"==typeof n?n({length:t}):n;return r.length!==t?r.slice(0,t):r}const HN=new Map([["brbg",DL],["prgn",ML],["piyg",TL],["puor",kL],["rdbu",qb],["rdgy",RL],["rdylbu",Zb],["rdylgn",OL],["spectral",NL],["burd",e=>qb(1-e)],["buylrd",e=>Zb(1-e)],["blues",c3],["greens",h3],["greys",f3],["purples",m3],["reds",y3],["oranges",v3],["turbo",k3],["viridis",P3],["magma",R3],["inferno",F3],["plasma",O3],["cividis",b3],["cubehelix",S3],["warm",M3],["cool",I3],["bugn",BL],["bupu",UL],["gnbu",jL],["orrd",GL],["pubugn",ZL],["pubu",XL],["purd",KL],["rdpu",QL],["ylgnbu",t3],["ylgn",r3],["ylorbr",o3],["ylorrd",a3],["rainbow",T3],["sinebow",A3]]);function CS(e){const t=`${e}`.toLowerCase();if(!HN.has(t))throw new Error(`unknown quantitative scheme: ${t}`);return HN.get(t)}const bee=new Set(["brbg","prgn","piyg","puor","rdbu","rdgy","rdylbu","rdylgn","spectral","burd","buylrd"]);function GN(e){return null!=e&&bee.has(`${e}`.toLowerCase())}const qN=e=>t=>e(1-t),ES=[0,1],ZN=new Map([["number",Uo],["rgb",_f],["hsl",kY],["hcl",FY],["lab",function RY(e,t){var n=Qi((e=vD(e)).l,(t=vD(t)).l),r=Qi(e.a,t.a),i=Qi(e.b,t.b),o=Qi(e.opacity,t.opacity);return function(c){return e.l=n(c),e.a=r(c),e.b=i(c),e.opacity=o(c),e+""}}]]);function WN(e){const t=`${e}`.toLowerCase();if(!ZN.has(t))throw new Error(`unknown interpolator: ${t}`);return ZN.get(t)}function __(e,t,n,{type:r,nice:i,clamp:o,zero:c,domain:d=YN(e,n),unknown:p,round:v,scheme:E,interval:D,range:I=(ni.get(e)===hx?kee(n,d):ni.get(e)===dx?Pee(n,d):ni.get(e)===fx?ES:void 0),interpolate:P=(ni.get(e)===Tc?null==E&&void 0!==I?_f:CS(void 0!==E?E:"cyclical"===r?"rainbow":"turbo"):v?_D:Uo),reverse:N}){if(D=p_(D,r),("cyclical"===r||"sequential"===r)&&(r="linear"),N=!!N,"function"!=typeof P&&(P=WN(P)),1===P.length?(N&&(P=qN(P),N=!1),void 0===I&&2===(I=Float64Array.from(d,(G,U)=>U/(d.length-1))).length&&(I=ES),t.interpolate((I===ES?Mm:SS)(P))):t.interpolate(P),c){const[G,U]=Qp(d);(G>0||U<0)&&(g_(d=lS(d))!==Math.sign(G)?d[d.length-1]=0:d[0]=0)}return N&&(d=$0(d)),t.domain(d).unknown(p),i&&(t.nice(function xee(e,t){return!0===e?void 0:"number"==typeof e?e:function RQ(e,t){if((e=p_(e,t))&&"function"!=typeof e.ceil)throw new Error("invalid interval: missing ceil method");return e}(e,t)}(i,r)),d=t.domain()),void 0!==I&&t.range(I),o&&t.clamp(o),{type:r,domain:d,range:I,scale:t,interpolate:P,interval:D}}function XN(e,t,{exponent:n=1,...r}){return __(e,OD().exponent(n),t,{...r,type:"pow"})}function Eee(e,t,{base:n=10,domain:r=Ree(t),...i}){return __(e,VO().base(n),t,{...i,domain:r})}function Dee(e,t,{constant:n=1,...r}){return __(e,HO().constant(n),t,r)}function See(e,t,{range:n,quantiles:r=(void 0===n?5:(n=[...n]).length),n:i=r,scheme:o="rdylbu",domain:c=Fee(t),unknown:d,interpolate:p,reverse:v}){return void 0===n&&(n=void 0!==p?Sl(p,i):ni.get(e)===Tc?vx(o,i):void 0),c.length>0&&(c=ZO(c,void 0===n?{length:i}:n).quantiles()),DS(e,0,{domain:c,range:n,reverse:v,unknown:d})}function DS(e,t,{domain:n=[0],unknown:r,scheme:i="rdylbu",interpolate:o,range:c=(void 0!==o?Sl(o,n.length+1):ni.get(e)===Tc?vx(i,n.length+1):void 0),reverse:d}){const p=g_(n=Mc(n));if(!isNaN(p)&&!function Iee(e,t){for(let n=1,r=e.length,i=e[0];nvoid 0===n?n:ff(n,t)),As(e,({value:n})=>void 0===n?n:As(n,t))]:[0,1]}function YN(e,t){const n=ni.get(e);return(n===hx||n===fx||n===dx?Aee:v_)(t)}function Aee(e){return[0,e.length?As(e,({value:t})=>void 0===t?t:As(t,yN)):1]}function kee(e,t){const n=e.find(({radius:c})=>void 0!==c);if(void 0!==n)return[0,n.radius];const r=N0(e,.5,({value:c})=>void 0===c?NaN:N0(c,.25,sx)),i=t.map(c=>3*Math.sqrt(c/r)),o=30/As(i);return o<1?i.map(c=>c*o):i}function Pee(e,t){const n=z0(e,({value:o})=>void 0===o?NaN:z0(o,Math.abs)),r=t.map(o=>12*o/n),i=60/As(r);return i<1?r.map(o=>o*i):r}function Ree(e){for(const{value:t}of e)if(void 0!==t)for(let n of t){if(n>0)return v_(e,sx);if(n<0)return v_(e,oS)}return[1,10]}function Fee(e){const t=[];for(const{value:n}of e)if(void 0!==n)for(const r of n)t.push(r);return t}function SS(e){return(t,n)=>r=>e(t+r*(n-t))}function bx(e,t,n,r,{type:i,nice:o,clamp:c,domain:d=v_(r),unknown:p,pivot:v=0,scheme:E,range:D,symmetric:I=!0,interpolate:P=(ni.get(e)===Tc?null==E&&void 0!==D?_f:CS(void 0!==E?E:"rdbu"):Uo),reverse:N}){v=+v;let[G,U]=d;if(Ty(G,U)<0&&([G,U]=[U,G],N=!N),G=Math.min(G,v),U=Math.max(U,v),"function"!=typeof P&&(P=WN(P)),void 0!==D&&(P=1===P.length?SS(P)(...D):DD(P,D)),N&&(P=qN(P)),I){const Z=n.apply(v),ne=Z-n.apply(G),X=n.apply(U)-Z;neX&&(U=n.invert(Z+ne))}return t.domain([G,v,U]).unknown(p).interpolator(P),c&&t.clamp(c),o&&t.nice(o),{type:i,domain:[G,U],pivot:v,interpolate:P,scale:t}}function Oee(e,t,n){return bx(e,xL(),Bee,t,n)}function KN(e,t,{exponent:n=1,...r}){return bx(e,jD().exponent(n=+n),function $ee(e){return.5===e?Uee:{apply:t=>Math.sign(t)*Math.pow(Math.abs(t),e),invert:t=>Math.sign(t)*Math.pow(Math.abs(t),1/e)}}(n),t,{...r,type:"diverging-pow"})}function Nee(e,t,{base:n=10,pivot:r=1,domain:i=v_(t,r<0?oS:sx),...o}){return bx(e,wL().base(n=+n),Vee,t,{domain:i,pivot:r,...o})}function zee(e,t,{constant:n=1,...r}){return bx(e,CL().constant(n=+n),function jee(e){return{apply:t=>Math.sign(t)*Math.log1p(Math.abs(t/e)),invert:t=>Math.sign(t)*Math.expm1(Math.abs(t))*e}}(n),t,r)}const Bee={apply:e=>e,invert:e=>e},Vee={apply:Math.log,invert:Math.exp},Uee={apply:e=>Math.sign(e)*Math.sqrt(Math.abs(e)),invert:e=>Math.sign(e)*(e*e)};function JN(e,t,n,r){return __(e,t,n,r)}const b_=Symbol("ordinal");function QN(e,t,n,{type:r,interval:i,domain:o,range:c,reverse:d,hint:p}){return i=p_(i,r),void 0===o&&(o=t5(n,i,e)),("categorical"===r||r===b_)&&(r="ordinal"),d&&(o=$0(o)),t.domain(o),void 0!==c&&("function"==typeof c&&(c=c(o)),t.range(c)),{type:r,domain:o,range:c,scale:t,hint:p,interval:i}}function e5(e,t,n,r){let{round:i}=n;return void 0!==i&&e.round(i=!!i),(e=QN(r,e,t,n)).round=i,e}function t5(e,t,n){const r=new gE;for(const{value:i,domain:o}of e){if(void 0!==o)return o();if(void 0!==i)for(const c of i)r.add(c)}if(void 0!==t){const[i,o]=Qp(r).map(t.floor,t);return t.range(i,t.offset(o))}if(r.size>1e4&&ni.get(n)===Ic)throw new Error(`implicit ordinal domain of ${n} scale has more than 10,000 values`);return vE(r,Sm)}function n5(e,t){let n;for(const{hint:r}of e){const i=r?.[t];if(void 0!==i)if(void 0===n)n=i;else if(n!==i)return}return n}function MS(e,{label:t,inset:n=0,insetTop:r=n,insetRight:i=n,insetBottom:o=n,insetLeft:c=n,round:d,nice:p,clamp:v,zero:E,align:D,padding:I,projection:P,facet:{label:N=t}={},...G}={}){const U={};for(const[Z,ne]of e){const X=G[Z],re=c5(Z,ne,{round:ni.get(Z)===Ic?d:void 0,nice:p,clamp:v,zero:E,align:D,padding:I,projection:P,...X});if(re){let{label:fe=("fx"===Z||"fy"===Z?N:t),percent:ve,transform:Re,inset:We,insetTop:Ke=(void 0!==We?We:"y"===Z?r:0),insetRight:lt=(void 0!==We?We:"x"===Z?i:0),insetBottom:Ue=(void 0!==We?We:"y"===Z?o:0),insetLeft:st=(void 0!==We?We:"x"===Z?c:0)}=X||{};if(null==Re)Re=void 0;else if("function"!=typeof Re)throw new Error("invalid scale transform; not a function");re.percent=!!ve,re.label=void 0===fe?Jee(ne,re):fe,re.transform=Re,"x"===Z||"fx"===Z?(re.insetLeft=+st,re.insetRight=+lt):("y"===Z||"fy"===Z)&&(re.insetTop=+Ke,re.insetBottom=+Ue),U[Z]=re}}return U}function r5(e){return Object.fromEntries(Object.entries(e).filter(([,{scale:t}])=>t).map(([t,{scale:n,type:r,interval:i,label:o}])=>(n.type=r,null!=i&&(n.interval=i),null!=o&&(n.label=o),[t,n])))}function Jee(e=[],t){let n;for(const{label:r}of e)if(void 0!==r)if(void 0===n)n=r;else if(n!==r)return;if(!(void 0===n||h5(t)&&/^(date|time|year)$/i.test(n)))return!If(t)&&t.percent&&(n=`${n} (%)`),{inferred:!0,toString:()=>n}}function IS(e){const{marginTop:t,marginRight:n,marginBottom:r,marginLeft:i,width:o,height:c,facet:{marginTop:d,marginRight:p,marginBottom:v,marginLeft:E}}=e;return{marginTop:Math.max(t,d),marginRight:Math.max(n,p),marginBottom:Math.max(r,v),marginLeft:Math.max(i,E),width:o,height:c}}function i5({fx:e,fy:t},n){const{marginTop:r,marginRight:i,marginBottom:o,marginLeft:c,width:d,height:p}=IS(n);return{marginTop:r,marginRight:i,marginBottom:o,marginLeft:c,width:e?e.scale.bandwidth()+c+i:d,height:t?t.scale.bandwidth()+r+o:p}}function o5(e,t){if(void 0===e.range){const{insetLeft:n,insetRight:r}=e,{width:i,marginLeft:o=0,marginRight:c=0}=t,d=o+n;e.range=[d,Math.max(d,i-c-r)],If(e)||(e.range=l5(e)),e.scale.range(e.range)}a5(e)}function s5(e,t){if(void 0===e.range){const{insetTop:n,insetBottom:r}=e,{height:i,marginTop:o=0,marginBottom:c=0}=t,d=o+n;e.range=[Math.max(d,i-c-r),d],If(e)?e.range.reverse():e.range=l5(e),e.scale.range(e.range)}a5(e)}function a5(e){void 0===e.round&&function tte({type:e}){return"point"===e||"band"===e}(e)&&function Qee({scale:e}){const t=e.domain().length,[n,r]=e.range(),i=e.paddingInner?e.paddingInner():1,o=e.paddingOuter?e.paddingOuter():e.padding(),c=t-i,d=Math.abs(r-n)/Math.max(1,c+2*o);return(d-Math.floor(d))*c}(e)<=30&&e.scale.round(!0)}function l5(e){const t=e.scale.domain().length+d5(e);if(!(t>2))return e.range;const[n,r]=e.range;return Array.from({length:t},(i,o)=>n+o/(t-1)*(r-n))}function TS(e,t,n){return c5(e,void 0===n?void 0:[{hint:n}],{...t})}function c5(e,t=[],n={}){const r=function ete(e,t,{type:n,domain:r,range:i,scheme:o,pivot:c,projection:d}){if("fx"===e||"fy"===e)return"band";("x"===e||"y"===e)&&null!=d&&(n=u5);for(const{type:E}of t)if(void 0!==E)if(void 0===n)n=E;else if(n!==E)throw new Error(`scale incompatible with channel: ${n} !== ${E}`);if(n===u5)return;if(void 0!==n)return n;if(void 0===r&&!t.some(({value:E})=>void 0!==E))return;const p=ni.get(e);if(p===hx)return"sqrt";if(p===fx||p===dx)return"linear";if(p===px)return"ordinal";if((r||i||[]).length>2)return AS(p);if(void 0!==r)return SN(r)?AS(p):Tl(r)?"utc":p!==Tc||null==c&&!GN(o)?"linear":"diverging";const v=t.map(({value:E})=>E).filter(E=>void 0!==E);return v.some(SN)?AS(p):v.some(Tl)?"utc":p!==Tc||null==c&&!GN(o)?"linear":"diverging"}(e,t,n);if(void 0===n.type&&void 0===n.domain&&void 0===n.range&&null==n.interval&&"fx"!==e&&"fy"!==e&&If({type:r})){const i=t.map(({value:o})=>o).filter(o=>void 0!==o);i.some(Tl)?Mf(`Warning: some data associated with the ${e} scale are dates. Dates are typically associated with a "utc" or "time" scale rather than a "${Rm(r)}" scale. If you are using a bar mark, you probably want a rect mark with the interval option instead; if you are using a group transform, you probably want a bin transform instead. If you want to treat this data as ordinal, you can specify the interval of the ${e} scale (e.g., d3.utcDay), or you can suppress this warning by setting the type of the ${e} scale to "${Rm(r)}".`):i.some(LQ)?Mf(`Warning: some data associated with the ${e} scale are strings that appear to be dates (e.g., YYYY-MM-DD). If these strings represent dates, you should parse them to Date objects. Dates are typically associated with a "utc" or "time" scale rather than a "${Rm(r)}" scale. If you are using a bar mark, you probably want a rect mark with the interval option instead; if you are using a group transform, you probably want a bin transform instead. If you want to treat this data as ordinal, you can suppress this warning by setting the type of the ${e} scale to "${Rm(r)}".`):i.some(NQ)&&Mf(`Warning: some data associated with the ${e} scale are strings that appear to be numbers. If these strings represent numbers, you should parse or coerce them to numbers. Numbers are typically associated with a "linear" scale rather than a "${Rm(r)}" scale. If you want to treat this data as ordinal, you can specify the interval of the ${e} scale (e.g., 1 for integers), or you can suppress this warning by setting the type of the ${e} scale to "${Rm(r)}".`)}switch(n.type=r,r){case"diverging":case"diverging-sqrt":case"diverging-pow":case"diverging-log":case"diverging-symlog":case"cyclical":case"sequential":case"linear":case"sqrt":case"threshold":case"quantile":case"pow":case"log":case"symlog":n=wx(t,n,ax);break;case"identity":switch(ni.get(e)){case Ic:n=wx(t,n,ax);break;case px:n=wx(t,n,nte)}break;case"utc":case"time":n=wx(t,n,AQ)}switch(r){case"diverging":return Oee(e,t,n);case"diverging-sqrt":return function Lee(e,t,n){return KN(e,t,{...n,exponent:.5})}(e,t,n);case"diverging-pow":return KN(e,t,n);case"diverging-log":return Nee(e,t,n);case"diverging-symlog":return zee(e,t,n);case"categorical":case"ordinal":case b_:return function qee(e,t,{type:n,interval:r,domain:i,range:o,scheme:c,unknown:d,...p}){let v;if(r=p_(r,n),void 0===i&&(i=t5(t,r,e)),ni.get(e)===px)v=function Xee(e){return{fill:n5(e,"fill"),stroke:n5(e,"stroke")}}(t),o=void 0===o?function Yee(e){return ea(e.fill)?qJ:GJ}(v):Ho(o,gS);else if(ni.get(e)===Tc&&(void 0===o&&("ordinal"===n||n===b_)&&(o=function vee(e,t="greys"){const n=new Set,[r,i]=vx(t,2);for(const o of e)if(null!=o)if(!0===o)n.add(i);else{if(!1!==o)return;n.add(r)}return[...n]}(i,c),void 0!==o&&(c=void 0)),void 0===c&&void 0===o&&(c="ordinal"===n?"turbo":"tableau10"),void 0!==c))if(void 0!==o){const E=CS(c),D=o[0],I=o[1]-o[0];o=({length:P})=>Sl(N=>E(D+I*N),P)}else o=jN(c);if(d===ID)throw new Error(`implicit unknown on ${e} scale is not supported`);return QN(e,TD().unknown(d),t,{...p,type:n,domain:i,range:o,hint:v})}(e,t,n);case"cyclical":case"sequential":case"linear":return function wee(e,t,n){return __(e,FD(),t,n)}(e,t,n);case"sqrt":return function Cee(e,t,n){return XN(e,t,{...n,exponent:.5})}(e,t,n);case"threshold":return DS(e,0,n);case"quantile":return See(e,t,n);case"quantize":return function Mee(e,t,{range:n,n:r=(void 0===n?5:(n=[...n]).length),scheme:i="rdylbu",domain:o=YN(e,t),unknown:c,interpolate:d,reverse:p}){const[v,E]=Qp(o);let D;return void 0===n?(D=U0(v,E,r),D[0]<=v&&D.splice(0,1),D[D.length-1]>=E&&D.pop(),r=D.length+1,n=void 0!==d?Sl(d,r):ni.get(e)===Tc?vx(i,r):void 0):(D=Sl(Uo(v,E),r+1).slice(1,-1),v instanceof Date&&(D=D.map(I=>new Date(I)))),g_(Mc(o))<0&&D.reverse(),DS(e,0,{domain:D,range:n,reverse:p,unknown:c})}(e,t,n);case"pow":return XN(e,t,n);case"log":return Eee(e,t,n);case"symlog":return Dee(e,t,n);case"utc":return function Gee(e,t,n){return JN(e,function gJ(){return wc.apply($D(sK,aK,Ec,xm,vm,r_,Ub,Bb,wu,jb).domain([Date.UTC(2e3,0,1),Date.UTC(2e3,0,2)]),arguments)}(),t,n)}(e,t,n);case"time":return function Hee(e,t,n){return JN(e,function mJ(){return wc.apply($D(lK,cK,Cc,bm,_m,ym,Vb,zb,wu,$b).domain([new Date(2e3,0,1),new Date(2e3,0,2)]),arguments)}(),t,n)}(e,t,n);case"point":return function Zee(e,t,{align:n=.5,padding:r=.5,...i}){return e5(function $Y(){return AO(Ob.apply(null,arguments).paddingInner(1))}().align(n).padding(r),t,i,e)}(e,t,n);case"band":return function Wee(e,t,{align:n=.5,padding:r=.1,paddingInner:i=r,paddingOuter:o=("fx"===e||"fy"===e?0:r),...c}){return e5(Ob().align(n).paddingInner(i).paddingOuter(o),t,c,e)}(e,t,n);case"identity":return ni.get(e)===Ic?function Tee(){return{type:"identity",scale:FO()}}():{type:"identity"};case void 0:return;default:throw new Error(`unknown scale type: ${r}`)}}function Rm(e){return"symbol"==typeof e?e.description:e}const u5={toString:()=>"projection"};function AS(e){switch(e){case Ic:return"point";case Tc:return b_;default:return"ordinal"}}function h5({type:e}){return"time"===e||"utc"===e}function If({type:e}){return"ordinal"===e||"point"===e||"band"===e||e===b_}function d5({type:e}){return"threshold"===e}function xx(e){if(void 0===e)return!0;const t=e.domain(),n=e(t[0]);for(let r=1,i=t.length;r((n?.length!==r.length||n.some((i,o)=>i!==r[o]))&&(n=r,t=e(...r)),t)}const ste=kS(e=>new Intl.NumberFormat(e));function p5(e){return function ite(e,t){if(e instanceof Date||(e=new Date(+e)),isNaN(e))return"function"==typeof t?t(e):t;const n=e.getUTCHours(),r=e.getUTCMinutes(),i=e.getUTCSeconds(),o=e.getUTCMilliseconds();return`${function ote(e){return e<0?`-${Tu(-e,6)}`:e>9999?`+${Tu(e,6)}`:Tu(e,4)}(e.getUTCFullYear())}-${Tu(e.getUTCMonth()+1,2)}-${Tu(e.getUTCDate(),2)}${n||r||i||o?`T${Tu(n,2)}:${Tu(r,2)}${i||o?`:${Tu(i,2)}${o?`.${Tu(o,3)}`:""}`:""}Z`:""}`}(e,"Invalid Date")}kS((e,t)=>new Intl.DateTimeFormat(e,{timeZone:"UTC",...t&&{month:t}})),kS((e,t)=>new Intl.DateTimeFormat(e,{timeZone:"UTC",...t&&{weekday:t}}));const Cx=function ute(e="en-US"){const t=function cte(e="en-US"){const t=ste(e);return n=>null==n||isNaN(n)?void 0:t.format(n)}(e);return n=>(n instanceof Date?p5:"number"==typeof n?t:Il)(n)}(),ta=typeof window<"u"&&window.devicePixelRatio>1?0:.5;let hte=0;function m5(){return"plot-clip-"+ ++hte}function dte(e,{title:t,href:n,ariaLabel:r,ariaDescription:i,ariaHidden:o,target:c,fill:d,fillOpacity:p,stroke:v,strokeWidth:E,strokeOpacity:D,strokeLinejoin:I,strokeLinecap:P,strokeMiterlimit:N,strokeDasharray:G,strokeDashoffset:U,opacity:Z,mixBlendMode:ne,paintOrder:X,pointerEvents:re,shapeRendering:fe},{ariaLabel:ve,fill:Re="currentColor",fillOpacity:We,stroke:Ke="none",strokeOpacity:lt,strokeWidth:Ue,strokeLinecap:st,strokeLinejoin:Fe,strokeMiterlimit:le,paintOrder:de}){null===Re&&(d=null,p=null),null===Ke&&(v=null,D=null),ea(Re)?!ea(Ke)&&!ea(d)&&(Ke="none"):ea(Ke)&&!ea(v)&&(Re="none");const[pe,Oe]=Im(d,Re),[Ye,Ze]=Ps(p,We),[et,_t]=Im(v,Ke),[Ft,ir]=Ps(D,lt),[jn,pr]=Ps(Z);m_(_t)||(void 0===E&&(E=Ue),void 0===P&&(P=st),void 0===I&&(I=Fe),void 0===N&&!function VQ(e){return/^\s*round\s*$/i.test(e)}(I)&&(N=le),!m_(Oe)&&void 0===X&&(X=de));const[xi,Wn]=Ps(E);return null!==Re&&(e.fill=ls(Oe,"currentColor"),e.fillOpacity=x_(Ze,1)),null!==Ke&&(e.stroke=ls(_t,"none"),e.strokeWidth=x_(Wn,1),e.strokeOpacity=x_(ir,1),e.strokeLinejoin=ls(I,"miter"),e.strokeLinecap=ls(P,"butt"),e.strokeMiterlimit=x_(N,4),e.strokeDasharray=ls(G,"none"),e.strokeDashoffset=ls(U,"0")),e.target=Il(c),e.ariaLabel=Il(ve),e.ariaDescription=Il(i),e.ariaHidden=Il(o),e.opacity=x_(pr,1),e.mixBlendMode=ls(ne,"normal"),e.paintOrder=ls(X,"normal"),e.pointerEvents=ls(re,"auto"),e.shapeRendering=ls(fe,"auto"),{title:{value:t,optional:!0},href:{value:n,optional:!0},ariaLabel:{value:r,optional:!0},fill:{value:pe,scale:"auto",optional:!0},fillOpacity:{value:Ye,scale:"auto",optional:!0},stroke:{value:et,scale:"auto",optional:!0},strokeOpacity:{value:Ft,scale:"auto",optional:!0},strokeWidth:{value:xi,optional:!0},opacity:{value:jn,scale:"auto",optional:!0}}}function mte(e,t){t&&e.text(n=>Cx(t[n]))}function gte(e,t){t&&e.text(([n])=>Cx(t[n]))}function Fm(e,{target:t},{ariaLabel:n,title:r,fill:i,fillOpacity:o,stroke:c,strokeOpacity:d,strokeWidth:p,opacity:v,href:E}){n&&fn(e,"aria-label",D=>n[D]),i&&fn(e,"fill",D=>i[D]),o&&fn(e,"fill-opacity",D=>o[D]),c&&fn(e,"stroke",D=>c[D]),d&&fn(e,"stroke-opacity",D=>d[D]),p&&fn(e,"stroke-width",D=>p[D]),v&&fn(e,"opacity",D=>v[D]),E&&g5(e,D=>E[D],t),function fte(e,t){t&&e.filter(n=>iS(t[n])).append("title").call(mte,t)}(e,r)}function yte(e,{target:t},{ariaLabel:n,title:r,fill:i,fillOpacity:o,stroke:c,strokeOpacity:d,strokeWidth:p,opacity:v,href:E}){n&&fn(e,"aria-label",([D])=>n[D]),i&&fn(e,"fill",([D])=>i[D]),o&&fn(e,"fill-opacity",([D])=>o[D]),c&&fn(e,"stroke",([D])=>c[D]),d&&fn(e,"stroke-opacity",([D])=>d[D]),p&&fn(e,"stroke-width",([D])=>p[D]),v&&fn(e,"opacity",([D])=>v[D]),E&&g5(e,([D])=>E[D],t),function pte(e,t){t&&e.filter(([n])=>iS(t[n])).append("title").call(gte,t)}(e,r)}function Bh(e,t,n,r){(function wte(e,t,n,r){let i;switch(t.clip){case"frame":{const{width:o,height:c,marginLeft:d,marginRight:p,marginTop:v,marginBottom:E}=n,D=m5();i=`url(#${D})`,e=Go("svg:g",r).call(I=>I.append("svg:clipPath").attr("id",D).append("rect").attr("x",d).attr("y",v).attr("width",o-p-d).attr("height",c-v-E)).each(function(){this.appendChild(e.node()),e.node=()=>this});break}case"sphere":{const{projection:o}=r;if(!o)throw new Error('the "sphere" clip option requires a projection');const c=m5();i=`url(#${c})`,e.append("clipPath").attr("id",c).append("path").attr("d",sD(o)({type:"Sphere"}));break}}fn(e,"aria-label",t.ariaLabel),fn(e,"aria-description",t.ariaDescription),fn(e,"aria-hidden",t.ariaHidden),fn(e,"clip-path",i)})(e,t,n,r),fn(e,"fill",t.fill),fn(e,"fill-opacity",t.fillOpacity),fn(e,"stroke",t.stroke),fn(e,"stroke-width",t.strokeWidth),fn(e,"stroke-opacity",t.strokeOpacity),fn(e,"stroke-linejoin",t.strokeLinejoin),fn(e,"stroke-linecap",t.strokeLinecap),fn(e,"stroke-miterlimit",t.strokeMiterlimit),fn(e,"stroke-dasharray",t.strokeDasharray),fn(e,"stroke-dashoffset",t.strokeDashoffset),fn(e,"shape-rendering",t.shapeRendering),fn(e,"paint-order",t.paintOrder),fn(e,"pointer-events",t.pointerEvents)}function Vh(e,t){(function Cte(e,t,n){null!=n&&e.style(t,n)})(e,"mix-blend-mode",t.mixBlendMode),fn(e,"opacity",t.opacity)}function g5(e,t,n){e.each(function(r){const i=t(r);if(null!=i){const o=this.ownerDocument.createElementNS(tm.svg,"a");o.setAttribute("fill","inherit"),o.setAttributeNS(tm.xlink,"href",i),null!=n&&o.setAttribute("target",n),this.parentNode.insertBefore(o,this).appendChild(this)}})}function fn(e,t,n){null!=n&&e.attr(t,n)}function Uh(e,t,{x:n,y:r},i=ta,o=ta){i+=t.dx,o+=t.dy,n?.bandwidth&&(i+=n.bandwidth()/2),r?.bandwidth&&(o+=r.bandwidth()/2),(i||o)&&e.attr("transform",`translate(${i},${o})`)}function ls(e,t){if((e=Il(e))!==t)return e}function x_(e,t){if((e=fi(e))!==t)return e}const Ete=/^-?([_a-z]|[\240-\377]|\\[0-9a-f]{1,6}(\r\n|[ \t\r\n\f])?|\\[^\r\n\f0-9a-f])([_a-z0-9-]|[\240-\377]|\\[0-9a-f]{1,6}(\r\n|[ \t\r\n\f])?|\\[^\r\n\f0-9a-f])*$/i;function PS(e){if(void 0===e)return`plot-${Math.random().toString(16).slice(2)}`;if(!Ete.test(e=`${e}`))throw new Error(`invalid class name: ${e}`);return e}function RS(e,t){if("string"==typeof t)e.property("style",t);else if(null!=t)for(const n of e)Object.assign(n.style,t)}function FS({frameAnchor:e},{width:t,height:n,marginTop:r,marginRight:i,marginBottom:o,marginLeft:c}){return[/left$/.test(e)?c:/right$/.test(e)?t-i:(c+t-i)/2,/^top/.test(e)?r:/^bottom/.test(e)?n-o:(r+n-o)/2]}function Ste({x:e,y:t,fy:n,fx:r},i,{projection:o,aspectRatio:c},{width:d,marginTopDefault:p,marginRightDefault:v,marginBottomDefault:E,marginLeftDefault:D}){const I=n?n.scale.domain().length:1,P=function yee(e,t){if("function"==typeof e?.stream)return.618;if(Tm(e)&&(e=e.type),null==e)return function _ee(e){for(const t of e)if(t.channels.geometry)return!0;return!1}(t)?.618:void 0;if("function"!=typeof e){const{aspectRatio:n}=zN(e);if(n)return n}return.618}(o,i);if(P){const G=r?r.scale.domain().length:1,Z=Math.max(.1,Math.min(10,(1.1*I-.1)/(1.1*G-.1)*P));return Math.round((d-D-v)*Z+p+E)}const N=t?If(t)?t.scale.domain().length:Math.max(7,17/I):1;if(null!=c){if(c=+c,!(isFinite(c)&&c>0))throw new Error(`invalid aspectRatio: ${c}`);const G=y5("y",t)/(y5("x",e)*c),U=r?r.scale.bandwidth():1,Z=n?n.scale.bandwidth():1;return(G*(U*(d-D-v)-e.insetLeft-e.insetRight)+t.insetTop+t.insetBottom)/Z+p+E}return!(!t&&!n)*Math.max(1,Math.min(60,N*I))*20+30*!!r+60}function y5(e,t){if(!t)throw new Error(`aspectRatio requires ${e} scale`);const{type:n,domain:r}=t;let i;switch(n){case"linear":case"utc":case"time":i=Number;break;case"pow":{const d=t.scale.exponent();i=p=>Math.pow(p,d);break}case"log":i=Math.log;break;case"point":case"band":return r.length;default:throw new Error(`unsupported ${e} scale for aspectRatio: ${n}`)}const[o,c]=Qp(r);return Math.abs(i(c)-i(o))}function OS(e,{fx:t,fy:n}){const r=d_(e),i=t?.value,o=n?.value;return t&&n?Ay(r,c=>(c.fx=i[c[0]],c.fy=o[c[0]],c),c=>i[c],c=>o[c]):t?Ay(r,c=>(c.fx=i[c[0]],c),c=>i[c]):Ay(r,c=>(c.fy=o[c[0]],c),c=>o[c])}function Ate(e){const t=[],n=new Uint32Array(B0(e,r=>r.length));for(const r of e){let i=0;for(const o of e)r!==o&&(n.set(o,i),i+=o.length);t.push(n.slice(0,i))}return t}const kte=new Map([["top",LS],["right",BS],["bottom",NS],["left",zS],["top-left",Ex(LS,zS)],["top-right",Ex(LS,BS)],["bottom-left",Ex(NS,zS)],["bottom-right",Ex(NS,BS)],["top-empty",function Rte(e,{y:t},{x:n,y:r,empty:i}){if(i)return!1;const o=t?.indexOf(r);if(o>0){const c=t[o-1];return e.find(d=>d.x===n&&d.y===c)?.empty}}],["right-empty",function Lte(e,{x:t},{x:n,y:r,empty:i}){if(i)return!1;const o=t?.indexOf(n);if(od.x===c&&d.y===r)?.empty}}],["bottom-empty",function Fte(e,{y:t},{x:n,y:r,empty:i}){if(i)return!1;const o=t?.indexOf(r);if(od.x===n&&d.y===c)?.empty}}],["left-empty",function Ote(e,{x:t},{x:n,y:r,empty:i}){if(i)return!1;const o=t?.indexOf(n);if(o>0){const c=t[o-1];return e.find(d=>d.x===c&&d.y===r)?.empty}}],["empty",function Nte(e,t,{empty:n}){return n}]]);function LS(e,{y:t},{y:n}){return!t||0===t.indexOf(n)}function NS(e,{y:t},{y:n}){return!t||t.indexOf(n)===t.length-1}function zS(e,{x:t},{x:n}){return!t||0===t.indexOf(n)}function BS(e,{x:t},{x:n}){return!t||t.indexOf(n)===t.length-1}function Ex(e,t){return function(){return e.apply(null,arguments)&&t.apply(null,arguments)}}function VS(e,{channels:{fx:t,fy:n},groups:r}){return e.map(t&&n?({x:i,y:o})=>r.get(i)?.get(o)??[]:t?({x:i})=>r.get(i)??[]:({y:i})=>r.get(i)??[])}function _5(e){return If(e)&&void 0===e.interval?void 0:"tabular-nums"}function v5(e,t){if(null==t)return t;const n=e(t);if(!n)throw new Error(`scale not found: ${t}`);return n}function b5(e,t={},n,r){let{columns:i,tickFormat:o,fontVariant:c=_5(e),swatchSize:d=15,swatchWidth:p=d,swatchHeight:v=d,marginLeft:E=0,className:D,style:I,width:P}=t;const N=_x(t);D=PS(D),o=function zte(e,t){return void 0===e?Tl(t)?p5:Il:"function"==typeof e?e:("string"==typeof e?Tl(t)?jb:um:Mm)(e)}(o,e.domain);const G=Go("div",N).attr("class",D).attr("style",`\n --swatchWidth: ${+p}px;\n --swatchHeight: ${+v}px;\n `);let U;return null!=i?(U=`\n .${D}-swatch {\n display: flex;\n align-items: center;\n break-inside: avoid;\n padding-bottom: 1px;\n }\n .${D}-swatch::before {\n flex-shrink: 0;\n }\n .${D}-label {\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n }\n `,G.style("columns",i).selectAll().data(e.domain).enter().append("div").attr("class",`${D}-swatch`).call(n,e).call(Z=>Z.append("div").attr("class",`${D}-label`).attr("title",o).text(o))):(U=`\n .${D} {\n display: flex;\n align-items: center;\n min-height: 33px;\n flex-wrap: wrap;\n }\n .${D}-swatch {\n display: inline-flex;\n align-items: center;\n margin-right: 1em;\n }\n `,G.selectAll().data(e.domain).enter().append("span").attr("class",`${D}-swatch`).call(n,e).append(function(){return this.ownerDocument.createTextNode(o.apply(this,arguments))})),G.call(Z=>Z.insert("style","*").text(`\n .${D} {\n font-family: system-ui, sans-serif;\n font-size: 10px;\n margin-bottom: 0.5em;${void 0===E?"":`\n margin-left: ${+E}px;`}${void 0===P?"":`\n width: ${P}px;`}\n }\n ${r(D)}\n ${U}\n `)).style("font-variant",ls(c,"normal")).call(RS,I).node()}const Dx=new Map([["symbol",function Ute(e,{fill:t=(void 0!==e.hint?.fill?e.hint.fill:"none"),fillOpacity:n=1,stroke:r=(void 0!==e.hint?.stroke?e.hint.stroke:ea(t)?"currentColor":"none"),strokeOpacity:i=1,strokeWidth:o=1.5,r:c=4.5,...d}={},p){const[v,E]=Im(t),[D,I]=Im(r),P=v5(p,v),N=v5(p,D),G=c*c*Math.PI;return n=Ps(n)[1],i=Ps(i)[1],o=Ps(o)[1],b5(e,d,U=>U.append("svg").attr("viewBox","-8 -8 16 16").attr("fill","color"===v?Z=>P.scale(Z):null).attr("stroke","color"===D?Z=>N.scale(Z):null).append("path").attr("d",Z=>{const ne=xf();return e.scale(Z).draw(ne,G),ne}),U=>`.${U}-swatch > svg {\n width: var(--swatchWidth);\n height: var(--swatchHeight);\n margin-right: 0.5em;\n overflow: visible;\n fill: ${E};\n fill-opacity: ${n};\n stroke: ${I};\n stroke-width: ${o}px;\n stroke-opacity: ${i};\n }`)}],["color",x5],["opacity",function Hte({type:e,interpolate:t,...n},{legend:r=!0,color:i=Rh(0,0,0),...o}){if(!t)throw new Error(`${e} opacity scales are not supported`);if(!0===r&&(r="ramp"),"ramp"!==`${r}`.toLowerCase())throw new Error(`${r} opacity legends are not supported`);return x5({type:e,...n,interpolate:Gte(i)},{legend:r,...o})}]]);function US(e,{label:t,ticks:n,tickFormat:r}={},i){return function UQ(e={},...t){let n=e;for(const r of t)for(const i in r)if(void 0===n[i]){const o=r[i];n===e?n={...n,[i]:o}:n[i]=o}return n}(i,e,{label:t,ticks:n,tickFormat:r})}function x5(e,{legend:t=!0,...n}){if(!0===t&&(t="ordinal"===e.type?"swatches":"ramp"),void 0!==e.domain)switch(`${t}`.toLowerCase()){case"swatches":return function Vte(e,{opacity:t,...n}={}){if(!If(e)&&!d5(e))throw new Error(`swatches legend requires ordinal or threshold color scale (not ${e.type})`);return b5(e,n,(r,i)=>r.append("svg").attr("fill",i.scale).attr("fill-opacity",Ps(t)[1]).append("rect").attr("width","100%").attr("height","100%"),r=>`.${r}-swatch svg {\n width: var(--swatchWidth);\n height: var(--swatchHeight);\n margin-right: 0.5em;\n }`)}(e,n);case"ramp":return function Bte(e,t){let{label:n=e.label,tickSize:r=6,width:i=240,height:o=44+r,marginTop:c=18,marginRight:d=0,marginBottom:p=16+r,marginLeft:v=0,style:E,ticks:D=(i-v-d)/64,tickFormat:I,fontVariant:P=_5(e),round:N=!0,opacity:G,className:U}=t;const Z=_x(t);U=PS(U),G=Ps(G)[1],null===I&&(I=()=>null);const ne=Go("svg",Z).attr("class",U).attr("font-family","system-ui, sans-serif").attr("font-size",10).attr("width",i).attr("height",o).attr("viewBox",`0 0 ${i} ${o}`).call(st=>st.append("style").text(`\n .${U} {\n display: block;\n background: white;\n height: auto;\n height: intrinsic;\n max-width: 100%;\n overflow: visible;\n }\n .${U} text {\n white-space: pre;\n }\n `)).call(RS,E);let re,X=st=>st.selectAll(".tick line").attr("y1",c+p-o);const fe=N?(st,Fe)=>st.rangeRound(Fe):(st,Fe)=>st.range(Fe),{type:ve,domain:Re,range:We,interpolate:Ke,scale:lt,pivot:Ue}=e;if(Ke){const st=void 0===We?Ke:DD(1===Ke.length?SS(Ke):Ke,We);re=fe(lt.copy(),Sl(Uo(v,i-d),Math.min(Re.length+(void 0!==Ue),void 0===We?1/0:We.length)));const Fe=256,le=Z.document.createElement("canvas");le.width=Fe,le.height=1;const de=le.getContext("2d");for(let pe=0,Oe=Fe-1;pele:"string"==typeof I?um(I):I;re=fe(FD().domain([-1,We.length-1]),[v,i-d]),ne.append("g").attr("fill-opacity",G).selectAll().data(We).enter().append("rect").attr("x",(le,de)=>re(de-1)).attr("y",c).attr("width",(le,de)=>re(de)-re(de-1)).attr("height",o-c-p).attr("fill",le=>le),D=Ho(st,(le,de)=>de),I=le=>Fe(st[le],le)}else re=fe(Ob().domain(Re),[v,i-d]),ne.append("g").attr("fill-opacity",G).selectAll().data(Re).enter().append("rect").attr("x",re).attr("y",c).attr("width",Math.max(0,re.bandwidth()-1)).attr("height",o-c-p).attr("fill",lt),X=()=>{};return ne.append("g").attr("transform",`translate(0,${o-p})`).call(function aq(e){return G0(3,e)}(re).ticks(Array.isArray(D)?null:D,"string"==typeof I?I:void 0).tickFormat("function"==typeof I?I:void 0).tickSize(r).tickValues(Array.isArray(D)?D:null)).attr("font-size",null).attr("font-family",null).attr("font-variant",ls(P,"normal")).call(X).call(st=>st.select(".domain").remove()),void 0!==n&&ne.append("text").attr("x",v).attr("y",c-6).attr("fill","currentColor").attr("font-weight","bold").text(n),ne.node()}(e,n);default:throw new Error(`unknown legend type: ${t}`)}}function Gte(e){const{r:t,g:n,b:r}=Rh(e)||Rh(0,0,0);return i=>`rgba(${t},${n},${r},${i})`}function $S({filter:e,sort:t,reverse:n,transform:r,initializer:i,...o}={},c){if(void 0===r&&(null!=e&&(r=GS(e)),null!=t&&!km(t)&&(r=jS(r,ZS(t))),n&&(r=jS(r,qS))),null!=c&&null!=i)throw new Error("transforms cannot be applied after initializers");return{...o,...(null===t||km(t))&&{sort:t},transform:jS(r,c)}}function Sx({filter:e,sort:t,reverse:n,initializer:r,...i}={},o){return void 0===r&&(null!=e&&(r=GS(e)),null!=t&&!km(t)&&(r=HS(r,ZS(t))),n&&(r=HS(r,qS))),{...i,...(null===t||km(t))&&{sort:t},initializer:HS(r,o)}}function jS(e,t){return null==e?null===t?void 0:t:null==t?null===e?void 0:e:function(n,r){return({data:n,facets:r}=e.call(this,n,r)),t.call(this,Mc(n),r)}}function HS(e,t){return null==e?null===t?void 0:t:null==t?null===e?void 0:e:function(n,r,i,...o){let c,d,p,v,E,D;return({data:d=n,facets:p=r,channels:c}=e.call(this,n,r,i,...o)),({data:E=d,facets:D=p,channels:v}=t.call(this,d,p,{...i,...c},...o)),{data:E,facets:D,channels:{...c,...v}}}}function Mx(e,t){return(null!=e.initializer?Sx:$S)(e,t)}function GS(e){return(t,n)=>{const r=Sc(t,e);return{data:t,facets:n.map(i=>i.filter(o=>r[o]))}}}function qS(e,t){return{data:e,facets:t.map(n=>n.slice().reverse())}}function ZS(e){return("function"==typeof e&&1!==e.length?Wte:w5)(e)}function Wte(e){return(t,n)=>{const r=(i,o)=>e(t[i],t[o]);return{data:t,facets:n.map(i=>i.slice().sort(r))}}}function w5(e){let t,n;if(({channel:t,value:e,order:n=Sm}={...hS(e)}),"function"!=typeof n)switch(`${n}`.toLowerCase()){case"ascending":n=Sm;break;case"descending":n=gN;break;default:throw new Error(`invalid order: ${n}`)}return(r,i,o)=>{let c;if(void 0===t)c=Sc(r,e);else{if(void 0===o)throw new Error("channel sort requires an initializer");if(c=o[t],!c)return{};c=c.value}const d=(p,v)=>n(c[p],c[v]);return{data:r,facets:i.map(p=>p.slice().sort(d))}}}class kl{constructor(t,n={},r={},i){const{facet:o="auto",facetAnchor:c,fx:d,fy:p,sort:v,dx:E=0,dy:D=0,margin:I=0,marginTop:P=I,marginRight:N=I,marginBottom:G=I,marginLeft:U=I,clip:Z,channels:ne}=r;if(this.data=t,this.sort=km(v)?v:null,this.initializer=Sx(r).initializer,this.transform=this.initializer?r.transform:$S(r).transform,null===o||!1===o?this.facet=null:(this.facet=Eu(!0===o?"include":o,"facet",["auto","include","exclude","super"]),this.fx=d,this.fy=p),this.facetAnchor=function Pte(e){if(null==e)return null;const t=kte.get(`${e}`.toLowerCase());if(t)return t;throw new Error(`invalid facet anchor: ${e}`)}(c),n=MN(n),void 0!==ne&&(n={...MN(ne),...n}),void 0!==i&&(n={...dte(this,r,i),...n}),this.channels=Object.fromEntries(Object.entries(n).map(([X,re])=>{const{value:fe}=re;return lx(fe)&&(re={...re,value:fe.value},void 0!==fe.scale&&(re.scale=fe.scale)),[X,re]}).filter(([X,{value:re,optional:fe}])=>{if(null!=re)return!0;if(fe)return!1;throw new Error(`missing channel value: ${X}`)})),this.dx=+E,this.dy=+D,this.marginTop=+P,this.marginRight=+N,this.marginBottom=+G,this.marginLeft=+U,this.clip=function xte(e){return!0===e?e="frame":!1===e&&(e=null),CN(e,"clip",["frame","sphere"])}(Z),"super"===this.facet){if(d||p)throw new Error("super-faceting cannot use fx or fy");for(const X in this.channels){const{scale:re}=n[X];if("x"===re||"y"===re)throw new Error("super-faceting cannot use x or y")}}}initialize(t,n){let r=Mc(this.data);void 0===t&&null!=r&&(t=[d_(r)]);const i=t;null!=this.transform&&(({facets:t,data:r}=this.transform(r,t)),r=Mc(r)),void 0!==t&&(t.original=i);const o=function oee(e,t){return Object.fromEntries(Object.entries(e).map(([n,r])=>[n,y_(t,r,n)]))}(this.channels,r);return null!=this.sort&&function aee(e,t,n,r,i){const{reverse:o,reduce:c=!0,limit:d}=i;for(const p in i){if(!ni.has(p))continue;let{value:v,reverse:E=o,reduce:D=c,limit:I=d}=hS(i[p]);if(void 0===E&&(E="width"===v||"height"===v),null==D||!1===D)continue;const P="fx"===p||"fy"===p?cee(t,r[p]):lee(n,p);if(!P)throw new Error(`missing channel for scale: ${p}`);const N=P.value,[G=0,U=1/0]=zh(I)?I:I<0?[I]:[0,I];if(null==v)P.domain=()=>{let Z=Array.from(new gE(N));return E&&(Z=Z.reverse()),(0!==G||U!==1/0)&&(Z=Z.slice(G,U)),Z};else{const Z="data"===v?e:"height"===v?LN(n,"y1","y2"):"width"===v?LN(n,"x1","x2"):bS(n,v,"y"===v?"y2":"x"===v?"x2":void 0),ne=_S(!0===D?"max":D,Z);P.domain=()=>{let X=Ay(d_(N),re=>ne.reduceIndex(re,Z),re=>N[re]);return X=vE(X,E?hee:uee),(0!==G||U!==1/0)&&(X=X.slice(G,U)),X.map(xN)}}}}(r,t,o,n,this.sort),{data:r,facets:t,channels:o}}filter(t,n,r){for(const i in n){const{filter:o=Ml}=n[i];if(null!==o){const c=r[i];t=t.filter(d=>o(c[d]))}}return t}project(t,n,r){yx("x","y",t,n,r),yx("x1","y1",t,n,r),yx("x2","y2",t,n,r)}scale(t,n,r){const i=function see(e,t){const n=Object.fromEntries(Object.entries(e).map(([r,{scale:i,value:o}])=>{const c=null==i?null:t[i];return[r,null==c?o:Ho(o,c)]}));return n.channels=e,n}(t,n);return r.projection&&this.project(t,i,r),i}}function C5(...e){return e.plot=kl.prototype.plot,e}const E5=Math.PI/180;function D5({inset:e,insetLeft:t,insetRight:n,...r}={}){return[t,n]=M5(e,t,n),{inset:e,insetLeft:t,insetRight:n,...r}}function S5({inset:e,insetTop:t,insetBottom:n,...r}={}){return[t,n]=M5(e,t,n),{inset:e,insetTop:t,insetBottom:n,...r}}function M5(e,t,n){return void 0===e&&void 0===t&&void 0===n?ta?[1,0]:[.5,.5]:[t,n]}function I5(e,{interval:t}){return(e={...hS(e)}).interval=uS(void 0===e.interval?t:e.interval),e}function Ix(e,t,n,r){const{[e]:i,[`${e}1`]:o,[`${e}2`]:c}=n,{value:d,interval:p}=I5(i,n);if(null==d||null==p&&!r)return n;const v=f_(i);if(null==p){let P;const N={transform:G=>P||(P=Sc(G,d)),label:v};return{...n,[e]:void 0,[`${e}1`]:void 0===o?N:o,[`${e}2`]:void 0===c?N:c}}let E,D;function I(P){return void 0!==D&&P===E?D:D=Ho(Sc(E=P,d),N=>p.floor(N))}return t({...n,[e]:void 0,[`${e}1`]:void 0===o?{transform:I,label:v}:o,[`${e}2`]:void 0===c?{transform:P=>I(P).map(N=>p.offset(N)),label:v}:c})}function T5(e,t,n){const{[e]:r}=n,{value:i,interval:o}=I5(r,n);return null==i||null==o?n:t({...n,[e]:{label:f_(r),transform:c=>{const d=Ho(Sc(c,i),v=>o.floor(v)),p=d.map(v=>o.offset(v));return d.map(Tl(d)?(v,E)=>null==v||isNaN(v=+v)||null==(E=p[E])||isNaN(E=+E)?void 0:new Date((v+E)/2):(v,E)=>null==v||null==(E=p[E])?NaN:(+v+ +E)/2)}}})}const A5={ariaLabel:"rule",fill:null,stroke:"currentColor"};class Qte extends kl{constructor(t,n={}){const{x:r,y1:i,y2:o,inset:c=0,insetTop:d=c,insetBottom:p=c}=n;super(t,{x:{value:r,scale:"x",optional:!0},y1:{value:i,scale:"y",optional:!0},y2:{value:o,scale:"y",optional:!0}},n,A5),this.insetTop=fi(d),this.insetBottom=fi(p)}render(t,n,r,i,o){const{x:c,y:d}=n,{x:p,y1:v,y2:E}=r,{width:D,height:I,marginTop:P,marginRight:N,marginLeft:G,marginBottom:U}=i,{insetTop:Z,insetBottom:ne}=this;return Go("svg:g",o).call(Bh,this,i).call(Uh,this,{x:p&&c},ta,0).call(X=>X.selectAll().data(t).enter().append("line").call(Vh,this).attr("x1",p?re=>p[re]:(G+D-N)/2).attr("x2",p?re=>p[re]:(G+D-N)/2).attr("y1",v&&!xx(d)?re=>v[re]+Z:P+Z).attr("y2",E&&!xx(d)?d.bandwidth?re=>E[re]+d.bandwidth()-ne:re=>E[re]-ne:I-U-ne).call(Fm,this,r)).node()}}class ene extends kl{constructor(t,n={}){const{x1:r,x2:i,y:o,inset:c=0,insetRight:d=c,insetLeft:p=c}=n;super(t,{y:{value:o,scale:"y",optional:!0},x1:{value:r,scale:"x",optional:!0},x2:{value:i,scale:"x",optional:!0}},n,A5),this.insetRight=fi(d),this.insetLeft=fi(p)}render(t,n,r,i,o){const{x:c,y:d}=n,{y:p,x1:v,x2:E}=r,{width:D,height:I,marginTop:P,marginRight:N,marginLeft:G,marginBottom:U}=i,{insetLeft:Z,insetRight:ne}=this;return Go("svg:g",o).call(Bh,this,i,o).call(Uh,this,{y:p&&d},0,ta).call(X=>X.selectAll().data(t).enter().append("line").call(Vh,this).attr("x1",v&&!xx(c)?re=>v[re]+Z:G+Z).attr("x2",E&&!xx(c)?c.bandwidth?re=>E[re]+c.bandwidth()-ne:re=>E[re]-ne:D-N-ne).attr("y1",p?re=>p[re]:(P+I-U)/2).attr("y2",p?re=>p[re]:(P+I-U)/2).call(Fm,this,r)).node()}}function tne(e,t){let{x:n=Cu,y:r,y1:i,y2:o,...c}=function Yte(e={}){return Ix("y",S5,e)}(t);return[i,o]=k5(r,i,o),new Qte(e,{...c,x:n,y1:i,y2:o})}function nne(e,t){let{y:n=Cu,x:r,x1:i,x2:o,...c}=function Xte(e={}){return Ix("x",D5,e)}(t);return[i,o]=k5(r,i,o),new ene(e,{...c,y:n,x1:i,x2:o})}function k5(e,t,n){if(void 0===e){if(void 0===t){if(void 0!==n)return[0,n]}else if(void 0===n)return[0,t]}else{if(void 0===t)return void 0===n?[0,e]:[e,n];if(void 0===n)return[e,t]}return[t,n]}function WS(e,...t){let n=t.length;for(let r=0,i=!0;r{let i=e[0];for(let o=0;oSc(t,e,Float64Array),label:f_(e)}),optional:!0},text:{value:o,filter:iS,optional:!0}},n,rne),this.rotate=re,this.textAnchor=ls(d,"middle"),this.lineAnchor=Eu(p,"lineAnchor",["top","middle","bottom"]),this.lineHeight=+v,this.lineWidth=+E,this.textOverflow=function ine(e){return null==e?null:Eu(e,"textOverflow",["clip","ellipsis","clip-start","clip-end","ellipsis-start","ellipsis-middle","ellipsis-end"]).replace(/^(clip|ellipsis)$/,"$1-end")}(D),this.monospace=!!I,this.fontFamily=Il(P),this.fontSize=ve,this.fontStyle=Il(G),this.fontVariant=Il(U),this.fontWeight=Il(Z),this.frameAnchor=fS(c),!(this.lineWidth>=0))throw new Error(`invalid lineWidth: ${E}`);var e;this.splitLines=function pne({monospace:e,lineWidth:t,textOverflow:n}){if(null!=n||t==1/0)return o=>o.split(/\r\n?|\n/g);const r=e?L5:O5,i=100*t;return o=>function dne(e,t,n){const r=[];let i,o=0;for(const[c,d,p]of function*fne(e){let t=0,n=0;const r=e.length;for(;ni&&n(e,i,d)>t&&(r.push(e.slice(i,o)+("\xad"===e[o-1]?"-":"")),i=c),p?(r.push(e.slice(i,d)),i=void 0):o=d;return r}(o,i,r)}(this),this.clipLine=function mne({monospace:e,lineWidth:t,textOverflow:n}){if(null==n||t==1/0)return o=>o;const r=e?L5:O5,i=100*t;switch(n){case"clip-start":return o=>z5(o,i,r,"");case"clip-end":return o=>N5(o,i,r,"");case"ellipsis-start":return o=>z5(o,i,r,"\u2026");case"ellipsis-middle":return o=>function gne(e,t,n,r){const i=n(e=e.trim());if(i<=t)return e;const o=n(r)/2,[c,d]=Tx(e,t/2,n,o),[p]=Tx(e,i-t/2-d+o,n,-o);return p<0?r:e.slice(0,c).trimEnd()+r+e.slice(Om(e,p)).trimStart()}(o,i,r,"\u2026");case"ellipsis-end":return o=>N5(o,i,r,"\u2026")}}(this)}render(t,n,r,i,o){const{x:c,y:d}=n,{x:p,y:v,rotate:E,text:D,title:I,fontSize:P}=r,{rotate:N}=this,[G,U]=FS(this,i);return Go("svg:g",o).call(Bh,this,i,o).call(lne,this,D,i).call(Uh,this,{x:p&&c,y:v&&d}).call(Z=>Z.selectAll().data(t).enter().append("text").call(Vh,this).call(one,this,D,I).attr("transform",WS`translate(${p?ne=>p[ne]:G},${v?ne=>v[ne]:U})${E?ne=>` rotate(${E[ne]})`:N?` rotate(${N})`:""}`).call(fn,"font-size",P&&(ne=>P[ne])).call(Fm,this,r)).node()}}function one(e,t,n,r){if(!n)return;const{lineAnchor:i,lineHeight:o,textOverflow:c,splitLines:d,clipLine:p}=t;e.each(function(v){const E=d(Cx(n[v])??"").map(p),D=E.length,I="top"===i?.71:"bottom"===i?1-D:(164-100*D)/200;if(D>1)for(let P=0;Pt){for(o+=r;o>t&&c>0;)d=c,c=i.pop(),o-=n(e,c,d);return[c,t-o]}o+=v,i.push(c)}return[-1,0]}function N5(e,t,n,r){e=e.trim();const i=n(r),[o]=Tx(e,t,n,i);return o<0?e:e.slice(0,o).trimEnd()+r}function z5(e,t,n,r){const i=n(e=e.trim());if(i<=t)return e;const o=n(r),[c]=Tx(e,i-t+o,n,-o);return c<0?r:r+e.slice(Om(e,c)).trimStart()}const YS=/[\p{Combining_Mark}\p{Emoji_Modifier}]+/uy,B5=/\p{Extended_Pictographic}/uy;function Om(e,t){return t+=function yne(e,t){const n=e.charCodeAt(t);if(n>=55296&&n<56320){const r=e.charCodeAt(t+1);return r>=56320&&r<57344}return!1}(e,t)?2:1,function vne(e,t){return!V5(e,t)&&(YS.lastIndex=t,YS.test(e))}(e,t)&&(t=YS.lastIndex),function _ne(e,t){return 8205===e.charCodeAt(t)}(e,t)?Om(e,t+1):t}function V5(e,t){return e.charCodeAt(t)<128}function U5(e,t){return!V5(e,t)&&(B5.lastIndex=t,B5.test(e))}const $5={ariaLabel:"vector",fill:"none",stroke:"currentColor",strokeWidth:1.5,strokeLinejoin:"round",strokeLinecap:"round"},j5=3.5,bne=5*j5,H5={draw(e,t,n){const r=t*n/bne;e.moveTo(0,0),e.lineTo(0,-t),e.moveTo(-r,r-t),e.lineTo(0,-t),e.lineTo(r,r-t)}},xne=new Map([["arrow",H5],["spike",{draw(e,t,n){e.moveTo(-n,0),e.lineTo(0,-t),e.lineTo(n,0)}}]]);class KS extends kl{constructor(t,n={}){const{x:r,y:i,r:o=j5,length:c,rotate:d,shape:p=H5,anchor:v="middle",frameAnchor:E}=n,[D,I]=Ps(c,12),[P,N]=Ps(d,0);super(t,{x:{value:r,scale:"x",optional:!0},y:{value:i,scale:"y",optional:!0},length:{value:D,scale:"length",optional:!0},rotate:{value:P,optional:!0}},n,$5),this.r=+o,this.length=I,this.rotate=N,this.shape=function Cne(e){if(function wne(e){return e&&"function"==typeof e.draw}(e))return e;const t=xne.get(`${e}`.toLowerCase());if(t)return t;throw new Error(`invalid shape: ${e}`)}(p),this.anchor=Eu(v,"anchor",["start","middle","end"]),this.frameAnchor=fS(E)}render(t,n,r,i,o){const{x:c,y:d}=n,{x:p,y:v,length:E,rotate:D}=r,{length:I,rotate:P,anchor:N,shape:G,r:U}=this,[Z,ne]=FS(this,i);return Go("svg:g",o).call(Bh,this,i,o).call(Uh,this,{x:p&&c,y:v&&d}).call(X=>X.selectAll().data(t).enter().append("path").call(Vh,this).attr("transform",WS`translate(${p?re=>p[re]:Z},${v?re=>v[re]:ne})${D?re=>` rotate(${D[re]})`:P?` rotate(${P})`:""}${"start"===N?"":"end"===N?E?re=>` translate(0,${E[re]})`:` translate(0,${I})`:E?re=>` translate(0,${E[re]/2})`:` translate(0,${I/2})`}`).attr("d",E?re=>{const fe=xf();return G.draw(fe,E[re],U),fe}:(()=>{const re=xf();return G.draw(re,I,U),re})()).call(Fm,this,r)).node()}}function Dne(e,t={}){const{x:n=Cu,...r}=t;return new KS(e,{...r,x:n})}function Sne(e,t={}){const{y:n=Cu,...r}=t;return new KS(e,{...r,y:n})}function $h(e,t){return arguments.length<2&&!zh(e)&&(t=e,e=null),void 0===t&&(t={}),[e,t]}function Ax({anchor:e}={},t){return void 0===e?t[0]:Eu(e,"anchor",t)}function q5(e){return Ax(e,["left","right"])}function Z5(e){return Ax(e,["right","left"])}function W5(e){return Ax(e,["bottom","top"])}function X5(e){return Ax(e,["top","bottom"])}function Y5(){const[e,t]=$h(...arguments);return J5("y",q5(t),e,t)}function Mne(){const[e,t]=$h(...arguments);return J5("fy",Z5(t),e,t)}function K5(){const[e,t]=$h(...arguments);return Q5("x",W5(t),e,t)}function Ine(){const[e,t]=$h(...arguments);return Q5("fx",X5(t),e,t)}function J5(e,t,n,{color:r="currentColor",opacity:i=1,stroke:o=r,strokeOpacity:c=i,strokeWidth:d=1,fill:p=r,fillOpacity:v=i,textAnchor:E,textStroke:D,textStrokeOpacity:I,textStrokeWidth:P,tickSize:N=("y"===e?6:0),tickPadding:G,tickRotate:U,x:Z,marginTop:ne=20,marginRight:X=("right"===t?40:0),marginBottom:re=20,marginLeft:fe=("left"===t?40:0),label:ve,labelOffset:Re,labelAnchor:We,...Ke}){return N=fi(N),G=fi(G),U=fi(U),void 0!==We&&(We=Eu(We,"labelAnchor",["center","top","bottom"])),C5(N&&!ea(o)?function Tne(e,t,n,{strokeWidth:r=1,strokeLinecap:i=null,strokeLinejoin:o=null,facetAnchor:c=t+("y"===e?"-empty":""),frameAnchor:d=t,tickSize:p,inset:v=0,insetLeft:E=v,insetRight:D=v,dx:I=0,y:P=("y"===e?void 0:null),...N}){return Lm(Sne,e,`${e}-axis tick`,n,{strokeWidth:r,strokeLinecap:i,strokeLinejoin:o,facetAnchor:c,frameAnchor:d,y:P,...N,dx:"left"===t?+I-ta+ +E:+I+ta-D,anchor:"start",length:p,shape:"left"===t?Vne:Une})}(e,t,n,{stroke:o,strokeOpacity:c,strokeWidth:d,tickSize:N,tickPadding:G,tickRotate:U,x:Z,...Ke}):null,ea(p)?null:function kne(e,t,n,{facetAnchor:r=t+("y"===e?"-empty":""),frameAnchor:i=t,tickSize:o,tickRotate:c=0,tickPadding:d=Math.max(3,9-o)+(Math.abs(c)>60?4*Math.cos(c*E5):0),tickFormat:p,text:v=("function"==typeof p?p:void 0),textAnchor:E=(Math.abs(c)>60?"middle":"left"===t?"end":"start"),lineAnchor:D=(c>60?"top":c<-60?"bottom":"middle"),fontVariant:I,inset:P=0,insetLeft:N=P,insetRight:G=P,dx:U=0,y:Z=("y"===e?void 0:null),...ne}){return Lm(ane,e,`${e}-axis tick label`,n,{facetAnchor:r,frameAnchor:i,text:void 0===v?null:v,textAnchor:E,lineAnchor:D,fontVariant:I,rotate:c,y:Z,...ne,dx:"left"===t?+U-o-d+ +N:+U+ +o+ +d-G},function(X,re,fe){void 0===I&&(this.fontVariant=i4(X)),void 0===v&&(fe.text=r4(X,re,p))})}(e,t,n,{fill:p,fillOpacity:v,stroke:D,strokeOpacity:I,strokeWidth:P,textAnchor:E,tickSize:N,tickPadding:G,tickRotate:U,x:Z,marginTop:ne,marginRight:X,marginBottom:re,marginLeft:fe,...Ke}),ea(p)||null===ve?null:R5([],{fill:p,fillOpacity:v,...Ke,lineWidth:void 0,textOverflow:void 0,facet:"super",x:null,y:null,initializer:function(lt,Ue,st,Fe,le){const de=Fe[e],{marginTop:pe,marginRight:Oe,marginBottom:Ye,marginLeft:Ze}="y"===e&&le.inset||le,et=We??(de.bandwidth?"center":"top"),_t=Re??("right"===t?Oe:Ze)-3;return"center"===et?(this.textAnchor=void 0,this.lineAnchor="right"===t?"bottom":"top",this.frameAnchor=t,this.rotate=-90):(this.textAnchor="right"===t?"end":"start",this.lineAnchor=et,this.frameAnchor=`${et}-${t}`,this.rotate=0),this.dy="top"===et?3-pe:"bottom"===et?Ye-3:0,this.dx="right"===t?_t:-_t,this.ariaLabel=`${e}-axis label`,{facets:[[0]],channels:{text:{value:[void 0===ve?o4(e,de,et):ve]}}}}}))}function Q5(e,t,n,{color:r="currentColor",opacity:i=1,stroke:o=r,strokeOpacity:c=i,strokeWidth:d=1,fill:p=r,fillOpacity:v=i,textAnchor:E,textStroke:D,textStrokeOpacity:I,textStrokeWidth:P,tickSize:N=("x"===e?6:0),tickPadding:G,tickRotate:U,y:Z,marginTop:ne=("top"===t?30:0),marginRight:X=20,marginBottom:re=("bottom"===t?30:0),marginLeft:fe=20,label:ve,labelAnchor:Re,labelOffset:We,...Ke}){return N=fi(N),G=fi(G),U=fi(U),void 0!==Re&&(Re=Eu(Re,"labelAnchor",["center","left","right"])),C5(N&&!ea(o)?function Ane(e,t,n,{strokeWidth:r=1,strokeLinecap:i=null,strokeLinejoin:o=null,facetAnchor:c=t+("x"===e?"-empty":""),frameAnchor:d=t,tickSize:p,inset:v=0,insetTop:E=v,insetBottom:D=v,dy:I=0,x:P=("x"===e?void 0:null),...N}){return Lm(Dne,e,`${e}-axis tick`,n,{strokeWidth:r,strokeLinejoin:o,strokeLinecap:i,facetAnchor:c,frameAnchor:d,x:P,...N,dy:"bottom"===t?+I-ta-D:+I+ta+ +E,anchor:"start",length:p,shape:"bottom"===t?zne:Bne})}(e,t,n,{stroke:o,strokeOpacity:c,strokeWidth:d,tickSize:N,tickPadding:G,tickRotate:U,y:Z,...Ke}):null,ea(p)?null:function Pne(e,t,n,{facetAnchor:r=t+("x"===e?"-empty":""),frameAnchor:i=t,tickSize:o,tickRotate:c=0,tickPadding:d=Math.max(3,9-o)+(Math.abs(c)>=10?4*Math.cos(c*E5):0),tickFormat:p,text:v=("function"==typeof p?p:void 0),textAnchor:E=(Math.abs(c)>=10?c<0^"bottom"===t?"start":"end":"middle"),lineAnchor:D=(Math.abs(c)>=10?"middle":"bottom"===t?"top":"bottom"),fontVariant:I,inset:P=0,insetTop:N=P,insetBottom:G=P,dy:U=0,x:Z=("x"===e?void 0:null),...ne}){return Lm(sne,e,`${e}-axis tick label`,n,{facetAnchor:r,frameAnchor:i,text:void 0===v?null:v,textAnchor:E,lineAnchor:D,fontVariant:I,rotate:c,x:Z,...ne,dy:"bottom"===t?+U+ +o+ +d-G:+U-o-d+ +N},function(X,re,fe){void 0===I&&(this.fontVariant=i4(X)),void 0===v&&(fe.text=r4(X,re,p))})}(e,t,n,{fill:p,fillOpacity:v,stroke:D,strokeOpacity:I,strokeWidth:P,textAnchor:E,tickSize:N,tickPadding:G,tickRotate:U,y:Z,marginTop:ne,marginRight:X,marginBottom:re,marginLeft:fe,...Ke}),ea(p)||null===ve?null:R5([],{fill:p,fillOpacity:v,...Ke,lineWidth:void 0,textOverflow:void 0,facet:"super",x:null,y:null,initializer:function(lt,Ue,st,Fe,le){const de=Fe[e],{marginTop:pe,marginRight:Oe,marginBottom:Ye,marginLeft:Ze}="x"===e&&le.inset||le,et=Re??(de.bandwidth?"center":"right"),_t=We??("top"===t?pe:Ye)-3;return"center"===et?(this.frameAnchor=t,this.textAnchor=void 0):(this.frameAnchor=`${t}-${et}`,this.textAnchor="right"===et?"end":"start"),this.lineAnchor=t,this.dy="top"===t?-_t:_t,this.dx="right"===et?Oe-3:"left"===et?3-Ze:0,this.ariaLabel=`${e}-axis label`,{facets:[[0]],channels:{text:{value:[void 0===ve?o4(e,de,et):ve]}}}}}))}function Rne(){const[e,t]=$h(...arguments);return e4("y",q5(t),e,t)}function Fne(){const[e,t]=$h(...arguments);return e4("fy",Z5(t),e,t)}function One(){const[e,t]=$h(...arguments);return t4("x",W5(t),e,t)}function Lne(){const[e,t]=$h(...arguments);return t4("fx",X5(t),e,t)}function e4(e,t,n,{y:r=("y"===e?void 0:null),x:i=null,x1:o=("left"===t?i:null),x2:c=("right"===t?i:null),...d}){return Lm(nne,e,`${e}-grid`,n,{y:r,x1:o,x2:c,...n4(d)})}function t4(e,t,n,{x:r=("x"===e?void 0:null),y:i=null,y1:o=("top"===t?i:null),y2:c=("bottom"===t?i:null),...d}){return Lm(tne,e,`${e}-grid`,n,{x:r,y1:o,y2:c,...n4(d)})}function n4({color:e="currentColor",opacity:t=.1,stroke:n=e,strokeOpacity:r=t,strokeWidth:i=1,...o}){return{stroke:n,strokeOpacity:r,strokeWidth:i,...o}}function Lm(e,t,n,r,i,o){let c;const d=e(r,Sx(i,function(p,v,E,D){const{[t]:I}=D;if(!I)throw new Error(`missing scale: ${t}`);let{ticks:P,tickSpacing:N,interval:G}=i;if(h5(I)&&"string"==typeof P&&(G=P,P=void 0),null==p){if(zh(P))p=Mc(P);else if(I.ticks)if(void 0!==P)p=I.ticks(P);else if(G=p_(void 0===G?I.interval:G,I.type),void 0!==G){const[U,Z]=Qp(I.domain());p=G.range(U,G.offset(G.floor(Z)))}else{const[U,Z]=Qp(I.range());P=(Z-U)/(void 0===N?"x"===t?80:35:N),p=I.ticks(P)}else p=I.domain();"y"===t||"x"===t?v=[d_(p)]:(c[t]={scale:t,value:Cu},v=void 0)}return o?.call(this,I,P,c),{data:p,facets:v,channels:Object.fromEntries(Object.entries(c).map(([U,Z])=>[U,{...Z,value:Sc(p,Z.value)}]))}}));return null==r?(c=d.channels,d.channels={}):c={},d.ariaLabel=n,d}function r4(e,t,n){return{value:Nne(e,t,n)}}function Nne(e,t,n){return e.tickFormat?e.tickFormat(zh(t)?null:t,n):void 0===n?Cx:"string"==typeof n?(Tl(e.domain())?jb:um)(n):Mm(n)}const zne={draw(e,t){e.moveTo(0,0),e.lineTo(0,t)}},Bne={draw(e,t){e.moveTo(0,0),e.lineTo(0,-t)}},Vne={draw(e,t){e.moveTo(0,0),e.lineTo(-t,0)}},Une={draw(e,t){e.moveTo(0,0),e.lineTo(t,0)}};function i4(e){return e.bandwidth&&void 0===e.interval?void 0:"tabular-nums"}function o4(e,t,n){const r=t.label;if(t.bandwidth||!r?.inferred)return r;const i=function $ne(e){return Math.sign(g_(e.domain()))*Math.sign(g_(e.range()))}(t);return i?"x"===e||"center"===n?"x"===e==i<0?`\u2190 ${r}`:`${r} \u2192`:`${i<0?"\u2191 ":"\u2193 "}${r}`:r}const jne={ariaLabel:"frame",fill:"none",stroke:"currentColor"},Hne={ariaLabel:"frame",fill:null,stroke:"currentColor",strokeLinecap:"square"};class Gne extends kl{constructor(t={}){const{anchor:n=null,inset:r=0,insetTop:i=r,insetRight:o=r,insetBottom:c=r,insetLeft:d=r,rx:p,ry:v}=t;super(void 0,void 0,t,null==n?jne:Hne),this.anchor=CN(n,"anchor",["top","right","bottom","left"]),this.insetTop=fi(i),this.insetRight=fi(o),this.insetBottom=fi(c),this.insetLeft=fi(d),this.rx=fi(p),this.ry=fi(v)}render(t,n,r,i,o){const{marginTop:c,marginRight:d,marginBottom:p,marginLeft:v,width:E,height:D}=i,{anchor:I,insetTop:P,insetRight:N,insetBottom:G,insetLeft:U,rx:Z,ry:ne}=this,X=v+U,re=E-d-N,fe=c+P,ve=D-p-G;return Go(I?"svg:line":"svg:rect",o).call(Bh,this,i,o).call(Vh,this).call(Uh,this,{}).call("left"===I?Re=>Re.attr("x1",X).attr("x2",X).attr("y1",fe).attr("y2",ve):"right"===I?Re=>Re.attr("x1",re).attr("x2",re).attr("y1",fe).attr("y2",ve):"top"===I?Re=>Re.attr("x1",X).attr("x2",re).attr("y1",fe).attr("y2",fe):"bottom"===I?Re=>Re.attr("x1",X).attr("x2",re).attr("y1",ve).attr("y2",ve):Re=>Re.attr("x",X).attr("y",fe).attr("width",re-X).attr("height",ve-fe).attr("rx",Z).attr("ry",ne)).node()}}function JS(e){return new Gne(e)}function QS(e={}){const{facet:t,style:n,caption:r,ariaLabel:i,ariaDescription:o}=e,c=PS(e.className),d=void 0===e.marks?[]:s4(e.marks),p=function Yne(e,t){if(null==e)return;const{x:n,y:r}=e;if(null==n&&null==r)return;const i=Mc(e.data??n??r);if(void 0===i)throw new Error("missing facet data");const o={};null!=n&&(o.fx=y_(i,{value:n,scale:"fx"})),null!=r&&(o.fy=y_(i,{value:r,scale:"fy"})),e2(o,t);return{channels:o,groups:OS(i,o),data:e.data}}(t,e),v=new Map;for(const Fe of d){const le=l4(Fe,p,e);le&&v.set(Fe,le)}const E=new Map;p&&w_(E,[p]),w_(E,v);const D=s4(function Kne(e,t,n){let{projection:r,x:i={},y:o={},fx:c={},fy:d={},axis:p,grid:v,facet:E={},facet:{axis:D=p,grid:I}=E,x:{axis:P=p,grid:N=(null===P?null:v)}=i,y:{axis:G=p,grid:U=(null===G?null:v)}=o,fx:{axis:Z=D,grid:ne=(null===Z?null:I)}=c,fy:{axis:X=D,grid:re=(null===X?null:I)}=d}=n;(r||!Am(i)&&!c4("x",e))&&(P=N=null),(r||!Am(o)&&!c4("y",e))&&(G=U=null),t.has("fx")||(Z=ne=null),t.has("fy")||(X=re=null),void 0===P&&(P=!Rx(e,"x")),void 0===G&&(G=!Rx(e,"y")),void 0===Z&&(Z=!Rx(e,"fx")),void 0===X&&(X=!Rx(e,"fy")),!0===P&&(P="bottom"),!0===G&&(G="left"),!0===Z&&(Z="top"===P||null===P?"bottom":"top"),!0===X&&(X="right"===G||null===G?"left":"right");const fe=[];return Px(fe,re,Fne,d),kx(fe,X,Mne,"right","left",E,d),Px(fe,ne,Lne,c),kx(fe,Z,Ine,"top","bottom",E,c),Px(fe,U,Rne,o),kx(fe,G,Y5,"left","right",n,o),Px(fe,N,One,i),kx(fe,P,K5,"bottom","top",n,i),fe}(d,E,e));for(const Fe of D){const le=l4(Fe,p,e);le&&v.set(Fe,le)}d.unshift(...D);const I=function Mte(e,t){const{fx:n,fy:r}=MS(e,t),i=n?.scale.domain(),o=r?.scale.domain();return i&&o?function jG(...e){const t="function"==typeof e[e.length-1]&&function $G(e){return t=>e(...t)}(e.pop()),n=(e=e.map(UG)).map(BG),r=e.length-1,i=new Array(r+1).fill(0),o=[];if(r<0||n.some(VG))return o;for(;;){o.push(i.map((d,p)=>e[p][d]));let c=r;for(;++i[c]===n[c];){if(0===c)return t?o.map(t):o;i[c--]=0}}}(i,o).map(([c,d],p)=>({x:c,y:d,i:p})):i?i.map((c,d)=>({x:c,i:d})):o?o.map((c,d)=>({y:c,i:d})):void 0}(E,e);if(void 0!==I){const Fe=p?VS(I,p):void 0;for(const de of d){if(null===de.facet||"super"===de.facet)continue;const pe=v.get(de);void 0!==pe&&(pe.facetsIndex=null!=de.fx||null!=de.fy?VS(I,pe):Fe)}const le=new Set;for(const{facetsIndex:de}of v.values())de?.forEach((pe,Oe)=>{pe?.length>0&&le.add(Oe)});I.forEach(0de.empty=!le.has(pe):de=>de.empty=!1);for(const de of d)if("exclude"===de.facet){const pe=v.get(de);void 0!==pe&&(pe.facetsIndex=Ate(pe.facetsIndex))}}for(const Fe of ni.keys())Am(e[Fe])&&"fx"!==Fe&&"fy"!==Fe&&E.set(Fe,[]);const P=new Map;for(const Fe of d){if(P.has(Fe))throw new Error("duplicate mark; each mark must be unique");const{facetsIndex:le,channels:de}=v.get(Fe)??{},{data:pe,facets:Oe,channels:Ye}=Fe.initialize(le,de);e2(Ye,e),P.set(Fe,{data:pe,facets:Oe,channels:Ye})}const N=MS(w_(E,P),e),G=r5(N),U=function Dte(e,t,n={}){let r=.5-ta,i=.5+ta,o=.5+ta,c=.5-ta;for(const{marginTop:G,marginRight:U,marginBottom:Z,marginLeft:ne}of t)G>r&&(r=G),U>i&&(i=U),Z>o&&(o=Z),ne>c&&(c=ne);let{margin:d,marginTop:p=(void 0!==d?d:r),marginRight:v=(void 0!==d?d:i),marginBottom:E=(void 0!==d?d:o),marginLeft:D=(void 0!==d?d:c)}=n;p=+p,v=+v,E=+E,D=+D;let{width:I=640,height:P=Ste(e,t,n,{width:I,marginTopDefault:r,marginRightDefault:i,marginBottomDefault:o,marginLeftDefault:c})+Math.max(0,p-r+E-o)}=n;I=+I,P=+P;const N={width:I,height:P,marginTop:p,marginRight:v,marginBottom:E,marginLeft:D};if(e.fx||e.fy){let{margin:G,marginTop:U=(void 0!==G?G:p),marginRight:Z=(void 0!==G?G:v),marginBottom:ne=(void 0!==G?G:E),marginLeft:X=(void 0!==G?G:D)}=n.facet??{};U=+U,Z=+Z,ne=+ne,X=+X,N.facet={marginTop:U,marginRight:Z,marginBottom:ne,marginLeft:X}}return N}(N,d,e);!function Kee(e,t){const{x:n,y:r,fx:i,fy:o}=e,c=i||o?IS(t):t;i&&o5(i,c),o&&s5(o,c);const d=i||o?i5(e,t):t;n&&o5(n,d),r&&s5(r,d)}(N,U);const{fx:Z,fy:ne}=G,X=Z||ne?i5(N,U):U,re=Z||ne?function ire({fx:e,fy:t},n){const{marginTop:r,marginRight:i,marginBottom:o,marginLeft:c,width:d,height:p}=IS(n),v=e&&u4(e),E=t&&u4(t);return{marginTop:t?E[0]:r,marginRight:e?d-v[1]:i,marginBottom:t?p-E[1]:o,marginLeft:e?v[0]:c,inset:{marginTop:n.marginTop,marginRight:n.marginRight,marginBottom:n.marginBottom,marginLeft:n.marginLeft},width:d,height:p}}(G,U):U,fe=_x(e,X),ve=new Set;for(const[Fe,le]of P)if(null!=Fe.initializer){const pe=Fe.initializer(le.data,le.facets,le.channels,G,"super"===Fe.facet?re:X,fe);if(void 0!==pe.data&&(le.data=pe.data),void 0!==pe.facets&&(le.facets=pe.facets),void 0!==pe.channels){Xne(pe.channels),Object.assign(le.channels,pe.channels);for(const Ze of Object.values(pe.channels)){const{scale:et}=Ze;null!=et&&ni.get(et)!==Ic&&(a4(Ze,e),ve.add(et))}const{fx:Oe,fy:Ye}=pe.channels;if(null!=Oe||null!=Ye){const Ze=v.get(Fe)??{channels:{}};null!=Oe&&(Ze.channels.fx=Oe),null!=Ye&&(Ze.channels.fy=Ye),Ze.groups=OS(le.data,Ze.channels),Ze.facetsIndex=le.facets=VS(I,Ze),v.set(Fe,Ze)}}}if(ve.size){const Fe=new Map;w_(Fe,P,pe=>ve.has(pe)),w_(E,P,pe=>ve.has(pe));const le=function rre(e,t){for(const n in e){const r=e[n],i=t[n];void 0===r.label&&i&&(r.label=i.label)}return e}(MS(Fe,e),N),de=r5(le);Object.assign(N,le),Object.assign(G,de)}for(const[Fe,le]of P)le.values=Fe.scale(le.channels,G,fe);const{width:Re,height:We}=U,Ke=Go("svg",fe).attr("class",c).attr("fill","currentColor").attr("font-family","system-ui, sans-serif").attr("font-size",10).attr("text-anchor","middle").attr("width",Re).attr("height",We).attr("viewBox",`0 0 ${Re} ${We}`).attr("aria-label",i).attr("aria-description",o).call(Fe=>Fe.append("style").text(`\n .${c} {\n display: block;\n background: white;\n height: auto;\n height: intrinsic;\n max-width: 100%;\n }\n .${c} text,\n .${c} tspan {\n white-space: pre;\n }\n `)).call(RS,n).node();if(void 0!==I){const Fe={x:Z?.domain(),y:ne?.domain()};I.sort(function Ite({x:e,y:t}){const n=e&&new Map(e.map((i,o)=>[i,o])),r=t&&new Map(t.map((i,o)=>[i,o]));return e&&t?(i,o)=>n.get(i.x)-n.get(o.x)||r.get(i.y)-r.get(o.y):e?(i,o)=>n.get(i.x)-n.get(o.x):(i,o)=>r.get(i.y)-r.get(o.y)}(Fe)),XD(Ke).selectAll().data(I).enter().append("g").attr("aria-label","facet").attr("transform",function Tte(e,t,{marginTop:n,marginLeft:r}){return e&&t?({x:i,y:o})=>`translate(${e(i)-r},${t(o)-n})`:e?({x:i})=>`translate(${e(i)-r},0)`:({y:i})=>`translate(0,${t(i)-n})`}(Z,ne,U)).each(function(le){let de=!0;for(const pe of d){if("super"===pe.facet)continue;const{channels:Oe,values:Ye,facets:Ze}=P.get(pe);if(!(pe.facetAnchor?.(I,Fe,le)??!le.empty))continue;let et=null;if(Ze){if(et=Ze[v.has(pe)?le.i:0],et=pe.filter(et,Oe,Ye),0===et.length)continue;et.fi=le.i}const _t=pe.render(et,G,Ye,X,fe);null!=_t&&(de=!1,this.appendChild(_t))}de&&this.remove()})}for(const Fe of d){if(void 0!==I&&"super"!==Fe.facet)continue;const{channels:le,values:de,facets:pe}=P.get(Fe);let Oe=null;if(pe&&(Oe=pe[0],Oe=Fe.filter(Oe,le,de),0===Oe.length))continue;const Ye=Fe.render(Oe,G,de,re,fe);null!=Ye&&Ke.appendChild(Ye)}let lt=Ke;const Ue=function qte(e,t,n){const r=[];for(const[i,o]of Dx){const c=n[i];if(c?.legend&&i in e){const d=o(e[i],US(t,e[i],c),p=>e[p]);null!=d&&r.push(d)}}return r}(N,fe,e);if(null!=r||Ue.length>0){const{document:Fe}=fe;lt=Fe.createElement("figure"),lt.style.maxWidth="initial";for(const le of Ue)lt.appendChild(le);if(lt.appendChild(Ke),null!=r){const le=Fe.createElement("figcaption");le.appendChild(r instanceof Node?r:Fe.createTextNode(r)),lt.appendChild(le)}}lt.scale=function rte(e){return t=>{if(!ni.has(t=`${t}`))throw new Error(`unknown scale: ${t}`);return t in e?function f5({scale:e,type:t,domain:n,range:r,interpolate:i,interval:o,transform:c,percent:d,pivot:p}){if("identity"===t)return{type:"identity",apply:E=>E,invert:E=>E};const v=e.unknown?e.unknown():void 0;return{type:t,domain:lS(n),...void 0!==r&&{range:lS(r)},...void 0!==c&&{transform:c},...d&&{percent:d},...void 0!==v&&{unknown:v},...void 0!==o&&{interval:o},...void 0!==i&&{interpolate:i},...e.clamp&&{clamp:e.clamp()},...void 0!==p&&{pivot:p,symmetric:!1},...e.base&&{base:e.base()},...e.exponent&&{exponent:e.exponent()},...e.constant&&{constant:e.constant()},...e.align&&{align:e.align(),round:e.round()},...e.padding&&(e.paddingInner?{paddingInner:e.paddingInner(),paddingOuter:e.paddingOuter()}:{padding:e.padding()}),...e.bandwidth&&{bandwidth:e.bandwidth(),step:e.step()},apply:E=>e(E),...e.invert&&{invert:E=>e.invert(E)}}}(e[t]):void 0}}(N),lt.legend=function jte(e,t,n={}){return(r,i)=>{if(!Dx.has(r))throw new Error(`unknown legend type: ${r}`);if(r in e)return Dx.get(r)(e[r],US(t,n[r],i),o=>e[o])}}(N,fe,e);const st=function dee(){const e=xS;return xS=0,e}();return st>0&&XD(Ke).append("text").attr("x",Re).attr("y",20).attr("dy","-1em").attr("text-anchor","end").attr("font-family","initial").text("\u26a0\ufe0f").append("title").text(`${st.toLocaleString("en-US")} warning${1===st?"":"s"}. Please check the console.`),lt}function s4(e){return e.flat(1/0).filter(t=>null!=t).map(Zne)}function Zne(e){return"function"==typeof e.render?e:new Wne(e)}kl.prototype.plot=function qne({marks:e=[],...t}={}){return QS({...t,marks:[...e,this]})};class Wne extends kl{constructor(t){if("function"!=typeof t)throw new TypeError("invalid mark; missing render function");super(),this.render=t}render(){}}function e2(e,t){for(const n in e)a4(e[n],t);return e}function a4(e,t){const{scale:n}=e;if(null==n)return;const{type:r,percent:i,interval:o,transform:c=(i?d=>100*d:uS(o,r)?.floor)}=t[n]??{};null!=c&&(e.value=Ho(e.value,c))}function Xne(e){for(const t in e)ON(t,e[t])}function w_(e,t,n=TQ){for(const{channels:r}of t.values())for(const i in r){const o=r[i],{scale:c}=o;if(null!=c&&n(c)){const d=e.get(c);void 0!==d?d.push(o):e.set(c,[o])}}return e}function l4(e,t,n){if(null===e.facet||"super"===e.facet)return;const{fx:r,fy:i}=e;if(null!=r||null!=i){const p=Mc(e.data??r??i);if(void 0===p)throw new Error(`missing facet data in ${e.ariaLabel}`);if(null===p)return;const v={};return null!=r&&(v.fx=y_(p,{value:r,scale:"fx"})),null!=i&&(v.fy=y_(p,{value:i,scale:"fy"})),e2(v,n),{channels:v,groups:OS(p,v)}}if(void 0===t)return;const{channels:o,groups:c,data:d}=t;if("auto"!==e.facet||e.data===d)return{channels:o,groups:c};(c.size>1||1===c.size&&o.fx&&o.fy&&[...c][0][1].size>1)&&Mc(e.data)?.length===d.length&&Mf(`Warning: the ${e.ariaLabel} mark appears to use faceted data, but isn\u2019t faceted. The mark data has the same length as the facet data and the mark facet option is "auto", but the mark data and facet data are distinct. If this mark should be faceted, set the mark facet option to true; otherwise, suppress this warning by setting the mark facet option to false.`)}function kx(e,t,n,r,i,o,c){if(!t)return;const d=function Jne(e){return/^\s*both\s*$/i.test(e)}(t);c=function Qne(e,t,{line:n=t.line,ticks:r,tickSize:i,tickSpacing:o,tickPadding:c,tickFormat:d,tickRotate:p,fontVariant:v,ariaLabel:E,ariaDescription:D,label:I=t.label,labelAnchor:P,labelOffset:N}){return{anchor:e,line:n,ticks:r,tickSize:i,tickSpacing:o,tickPadding:c,tickFormat:d,tickRotate:p,fontVariant:v,ariaLabel:E,ariaDescription:D,label:I,labelAnchor:P,labelOffset:N}}(d?r:t,o,c);const{line:p}=c;(n===Y5||n===K5)&&p&&!m_(p)&&e.push(JS(function ere(e){const{anchor:t,line:n}=e;return{anchor:t,facetAnchor:t+"-empty",stroke:!0===n?void 0:n}}(c))),e.push(n(c)),d&&e.push(n({...c,anchor:i,label:null}))}function Px(e,t,n,r){!t||m_(t)||e.push(n(function tre(e,{stroke:t=(ux(e)?e:void 0),ticks:n=(nre(e)?e:void 0),tickSpacing:r,ariaLabel:i,ariaDescription:o}){return{stroke:t,ticks:n,tickSpacing:r,ariaLabel:i,ariaDescription:o}}(t,r)))}function nre(e){switch(typeof e){case"number":return!0;case"string":return!ux(e)}return zh(e)||"function"==typeof e?.range}function Rx(e,t){const n=`${t}-axis `;return e.some(r=>r.ariaLabel?.startsWith(n))}function c4(e,t){for(const n of t)for(const r in n.channels)if(n.channels[r].scale===e)return!0;return!1}function u4(e){const t=e.domain();let n=e(t[0]),r=e(t[t.length-1]);return rre.selectAll().data(t).enter().append(ne?"circle":"path").call(Vh,this).call(ne?fe=>{fe.attr("cx",p?ve=>p[ve]:U).attr("cy",v?ve=>v[ve]:Z).attr("r",E?ve=>E[ve]:P)}:fe=>{fe.attr("transform",WS`translate(${p?ve=>p[ve]:U},${v?ve=>v[ve]:Z})${D?ve=>` rotate(${D[ve]})`:N?` rotate(${N})`:""}`).attr("d",E&&I?ve=>{const Re=xf();return I[ve].draw(Re,E[ve]*E[ve]*Math.PI),Re}:E?ve=>{const Re=xf();return G.draw(Re,E[ve]*E[ve]*Math.PI),Re}:I?ve=>{const Re=xf();return I[ve].draw(Re,X),Re}:(()=>{const ve=xf();return G.draw(ve,X),ve})())}).call(Fm,this,r)).node()}}function Fx(e,t={}){let{x:n,y:r,...i}=t;return void 0===t.frameAnchor&&([n,r]=cx(n,r)),new t2(e,{...i,x:n,y:r})}const are=new Map([["basis",function ZJ(e){return new nx(e)}],["basis-closed",function WJ(e){return new eN(e)}],["basis-open",function XJ(e){return new tN(e)}],["bundle",QJ],["bump-x",function KJ(e){return new nN(e,!0)}],["bump-y",function JJ(e){return new nN(e,!1)}],["cardinal",eQ],["cardinal-closed",tQ],["cardinal-open",nQ],["catmull-rom",rQ],["catmull-rom-closed",iQ],["catmull-rom-open",oQ],["linear",Jb],["linear-closed",function sQ(e){return new aN(e)}],["monotone-x",function aQ(e){return new ix(e)}],["monotone-y",function lQ(e){return new hN(e)}],["natural",function cQ(e){return new fN(e)}],["step",function uQ(e){return new ox(e,.5)}],["step-after",function dQ(e){return new ox(e,1)}],["step-before",function hQ(e){return new ox(e,0)}]]);function Ox(e){return Jb(e)}function n2(e){if(null==e||!1===e)return null;if(!0===e)return h4;if("function"==typeof e)return e;switch(`${e}`.toLowerCase()){case"none":return null;case"arrow":return hre;case"dot":return dre;case"circle":case"circle-fill":return h4;case"circle-stroke":return fre}throw new Error(`invalid marker: ${e}`)}function hre(e,t){return Go("svg:marker",t).attr("viewBox","-5 -5 10 10").attr("markerWidth",6.67).attr("markerHeight",6.67).attr("orient","auto").attr("fill","none").attr("stroke",e).attr("stroke-width",1.5).attr("stroke-linecap","round").attr("stroke-linejoin","round").call(n=>n.append("path").attr("d","M-1.5,-3l3,3l-3,3")).node()}function dre(e,t){return Go("svg:marker",t).attr("viewBox","-5 -5 10 10").attr("markerWidth",6.67).attr("markerHeight",6.67).attr("fill",e).attr("stroke","none").call(n=>n.append("circle").attr("r",2.5)).node()}function h4(e,t){return Go("svg:marker",t).attr("viewBox","-5 -5 10 10").attr("markerWidth",6.67).attr("markerHeight",6.67).attr("fill",e).attr("stroke","white").attr("stroke-width",1.5).call(n=>n.append("circle").attr("r",3)).node()}function fre(e,t){return Go("svg:marker",t).attr("viewBox","-5 -5 10 10").attr("markerWidth",6.67).attr("markerHeight",6.67).attr("fill","white").attr("stroke",e).attr("stroke-width",1.5).call(n=>n.append("circle").attr("r",3)).node()}let pre=0;function mre(e,t,{stroke:n},r){return function d4(e,{markerStart:t,markerMid:n,markerEnd:r,stroke:i},o=(()=>i),c){const d=new Map;function p(v){return function(E){const D=o(E);let I=d.get(v);I||d.set(v,I=new Map);let P=I.get(D);if(!P){const N=this.parentNode.insertBefore(v(D,c),this),G="plot-marker-"+ ++pre;N.setAttribute("id",G),I.set(D,P=`url(#${G})`)}return P}}t&&e.attr("marker-start",p(t)),n&&e.attr("marker-mid",p(n)),r&&e.attr("marker-end",p(r))}(e,t,n&&(([i])=>n[i]),r)}const gre={ariaLabel:"line",fill:"none",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round",strokeMiterlimit:1};class r2 extends kl{constructor(t,n={}){const{x:r,y:i,z:o,curve:c,tension:d}=n;super(t,{x:{value:r,scale:"x"},y:{value:i,scale:"y"},z:{value:EN(n),optional:!0}},n,gre),this.z=o,this.curve=function cre(e=Ox,t){return"function"!=typeof e&&"auto"===`${e}`.toLowerCase()?Ox:function lre(e=Jb,t){if("function"==typeof e)return e;const n=are.get(`${e}`.toLowerCase());if(!n)throw new Error(`unknown curve: ${e}`);if(void 0!==t){if("beta"in n)return n.beta(t);if("tension"in n)return n.tension(t);if("alpha"in n)return n.alpha(t)}return n}(e,t)}(c,d),function ure(e,{marker:t,markerStart:n=t,markerMid:r=t,markerEnd:i=t}={}){e.markerStart=n2(n),e.markerMid=n2(r),e.markerEnd=n2(i)}(this,n)}filter(t){return t}project(t,n,r){this.curve!==Ox&&super.project(t,n,r)}render(t,n,r,i,o){const{x:c,y:d}=r,{curve:p}=this;return Go("svg:g",o).call(Bh,this,i,o).call(Uh,this,n).call(v=>v.selectAll().data(function*bte(e,t,{z:n},r){const{z:i}=r,o=function _te({ariaLabel:e,title:t,fill:n,fillOpacity:r,stroke:i,strokeOpacity:o,strokeWidth:c,opacity:d,href:p}){return[e,t,n,r,i,o,c,d,p].filter(v=>void 0!==v)}(r),c=[...t,...o];for(const d of i?function vte(e,t,n){const r=oR(e,i=>t[i]);return void 0===n&&r.size>e.length>>1&&Mf("Warning: the implicit z channel has high cardinality. This may occur when the fill or stroke channel is associated with quantitative data rather than ordinal or categorical data. You can suppress this warning by setting the z option explicitly; if this data represents a single series, set z to null."),r.values()}(e,i,n):[e]){let p,v;e:for(const E of d){for(const D of c)if(!Ml(D[E])){v&&v.push(-1);continue e}if(void 0!==p){v.push(E);for(let D=0;DcS(P[E])),v=[E];continue e}}else v&&(yield v),p=o.map(D=>cS(D[E])),v=[E]}v&&(yield v)}}(t,[c,d],this,r)).enter().append("path").call(Vh,this).call(yte,this,r).call(mre,this,r,o).attr("d",p===Ox&&o.projection?function yre(e,t,n){const r=sD(e);return t=ax(t),n=ax(n),i=>{let o=[];const c=[o];for(const d of i)-1===d?(o=[],c.push(o)):o.push([t[d],n[d]]);return r({type:"MultiLineString",coordinates:c})}}(o.projection,c,d):function NJ(e,t){var n=Cm(!0),r=null,i=Jb,o=null,c=function FJ(e){let t=3;return e.digits=function(n){if(!arguments.length)return t;if(null==n)t=null;else{const r=Math.floor(n);if(!(r>=0))throw new RangeError(`invalid digits: ${n}`);t=r}return e},()=>new Rb(t)}(d);function d(p){var v,D,P,E=(p=function RJ(e){return"object"==typeof e&&"length"in e?e:Array.from(e)}(p)).length,I=!1;for(null==r&&(o=i(P=c())),v=0;v<=E;++v)!(vE>=0).x(E=>c[E]).y(E=>d[E]))).node()}}function f4(e,t={}){let{x:n,y:r,...i}=t;return[n,r]=cx(n,r),new r2(e,{...i,x:n,y:r})}function _re(e,t={}){return p4(Object.fromEntries(["y","y1","y2"].filter(n=>null!=t[n]).map(n=>[n,e])),t)}const p4=function vre(e={},t={}){const n=EN(t),r=Object.entries(e).map(([i,o])=>{const c=function PQ(e,t){if(void 0!==t[e])return t[e];switch(e){case"x1":case"x2":e="x";break;case"y1":case"y2":e="y"}return t[e]}(i,t);if(null==c)throw new Error(`missing channel: ${i}`);const[d,p]=function DN(e){let t;return[{transform:()=>t,label:f_(e)},n=>t=n]}(c);return{key:i,input:c,output:d,setOutput:p,map:bre(o)}});return{...$S(t,(i,o)=>{const c=Sc(i,n),d=r.map(({input:v})=>Sc(i,v)),p=r.map(({setOutput:v})=>v(new Array(i.length)));for(const v of o)for(const E of c?oR(v,D=>c[D]).values():[v])r.forEach(({map:D},I)=>D.mapIndex(E,d[I],p[I]));return{data:i,facets:o}}),...Object.fromEntries(r.map(({key:i,output:o})=>[i,o]))}};function bre(e){if(null==e)throw new Error("missing map");if("function"==typeof e.mapIndex)return e;if("function"==typeof e.map&&Tm(e))return function xre(e){return console.warn("deprecated map interface; implement mapIndex instead."),{mapIndex:e.map.bind(e)}}(e);if("function"==typeof e)return o2(e);switch(`${e}`.toLowerCase()){case"cumsum":return Cre;case"rank":return o2(dR);case"quantile":return o2(wre)}throw new Error(`invalid map: ${e}`)}function wre(e){const t=function zG(e,t){let n=0;if(void 0===t)for(let r of e)null!=r&&(r=+r)>=r&&++n;else{let r=-1;for(let i of e)null!=(i=t(i,++r,e))&&(i=+i)>=i&&++n}return n}(e)-1;return dR(e).map(n=>n/t)}function o2(e){return{mapIndex(t,n,r){const i=e(Pm(n,t));if(i.length!==t.length)throw new Error("map function returned a mismatched length");for(let o=0,c=t.length;o0))throw new Error(`invalid k: ${t}`);return function Sre(e="mean"){if("string"==typeof e){if(/^p\d{2}$/i.test(e))return Lx(wN(e));switch(e.toLowerCase()){case"deviation":return Lx(tR);case"max":return Nx(As);case"mean":return Mre;case"median":return Lx(z0);case"min":return Nx(ff);case"mode":return Nx(uR);case"sum":return y4;case"variance":return Lx(mE);case"difference":return Are;case"ratio":return kre;case"first":return Pre;case"last":return Rre}}if("function"!=typeof e)throw new Error(`invalid reduce: ${e}`);return Nx(e)}(n)(t,function Ere(e="middle",t){switch(`${e}`.toLowerCase()){case"middle":return t-1>>1;case"start":return 0;case"end":return t-1}throw new Error(`invalid anchor: ${e}`)}(i,t),o)}function s2(e,t,n){return e.subarray?e.subarray(t,n):e.slice(t,n)}function Lx(e){return(t,n,r)=>r?{mapIndex(i,o,c){const d=Float64Array.from(i,v=>null===o[v]?NaN:o[v]);let p=0;for(let v=0;vnull===o[p]?NaN:o[p]);for(let p=-n;p<0;++p)c[i[p+n]]=e(d.subarray(0,p+t));for(let p=0,v=i.length-n;pr?{mapIndex(i,o,c){let d=0;for(let p=0;p=n;--i){const o=e[t[i]];if(Ml(o))return o}}function _4(e,t,n,r){for(let i=n+r;n=n;--i){let o=e[t[i]];if(null!==o&&!isNaN(o=+o))return o}}function Are(e,t,n){return n?{mapIndex(r,i,o){for(let c=0,d=r.length-e;c{class e{constructor(n){this.samples=n,this.device={},this.cameraBearing=0,this.enableRotation=!1}ngOnInit(){}ngOnChanges(){this.flyToMarker(this.device,this.map)}ngAfterViewInit(){this.map||(this.map=new F0.Map({container:this.mapContainer.nativeElement,style:"https://pax.lab5e.com/map/styles/basic.json",center:[10.14,63.42],zoom:3,maxBounds:[[9.78,63.17],[10.97,63.56]]}),this.map.addControl(new F0.NavigationControl),this.map.addControl(new F0.AttributionControl({compact:!1,customAttribution:"Style \xa9 MapTiler | Data \xa9 OpenStreetMap contributors"})),this.samples.activeDevices().subscribe({complete:()=>{this.samples.addMapMarkers(this.map)}}),this.flyToMarker(this.device,this.map))}ngOnDestroy(){this.enableRotation=!1,this.map?.remove()}flyToMarker(n,r){if(!n||!r)return;if(!n.lat||0==n.lat||!n.lon||0==n.lon)return this.enableRotation=!1,this.cameraBearing=0,void this.map?.flyTo({center:[10.14,63.42],zoom:3,pitch:0,bearing:0,speed:2,curve:2,easing:o=>o,essential:!0});this.enableRotation&&(this.enableRotation=!1,this.cameraBearing=0),this.map?.flyTo({center:[n.lat,n.lon],zoom:16,pitch:45,bearing:0,speed:1,curve:1,easing:o=>o,essential:!0});let i=o=>{!this.enableRotation||(r.rotateTo(this.cameraBearing,{duration:0}),this.cameraBearing+=.25,this.cameraBearing>=360&&(this.cameraBearing=0),requestAnimationFrame(i))};this.map?.on("click",()=>{this.enableRotation=!1}),this.map?.once("moveend",()=>{this.enableRotation=!0,i(0)})}}return e.\u0275fac=function(n){return new(n||e)(qe(O0))},e.\u0275cmp=Vs({type:e,selectors:[["app-device-map-view"]],viewQuery:function(n,r){if(1&n&&ny(Fre,5),2&n){let i;nf(i=rf())&&(r.mapContainer=i.first)}},inputs:{device:"device"},features:[yt],decls:2,vars:0,consts:[[1,"map"],["map",""]],template:function(n,r){1&n&&Is(0,"div",0,1)},styles:[".map[_ngcontent-%COMP%]{overflow:hidden;border-radius:1em;border:solid 1px silver;width:100%;height:100%}"]}),e})();const Ore=["chart"];let Lre=(()=>{class e{constructor(n,r,i){this.samples=n,this.renderer=r,this.cd=i,this.device={},this.metricDensity="",this.metricDensityPercent=0,this.metricSampleCount=0,this.metricWifi=0,this.metricBLE=0,this.data=[],this.errorMessage=""}ngOnInit(){}ngAfterViewInit(){this.loadData()}ngOnChanges(n){this.chartRef&&this.loadData()}loadData(){var n=[];this.samples.allData().subscribe({next:r=>{r.id==this.device.id&&n.push(r)},complete:()=>{this.data=n,this.showChart(),this.buildMetrics(),this.cd.detectChanges()}})}showChart(){this.chart&&this.renderer.removeChild(this.chartRef?.nativeElement,this.chart,!1);let n=this.chartRef?.nativeElement.offsetWidth,r=this.chartRef?.nativeElement.height,i=ff(this.data,c=>c.time),o=As(this.data,c=>c.time);this.chart=QS({width:n,height:r,margin:50,inset:5,y:{grid:!0,label:"Antall"},x:{label:"Klokkeslett",grid:!0,tickFormat:$b("%H:%M"),domain:[i,o]},marks:[Fx(this.data,{x:c=>c.time,y:"ble",stroke:"blue",opacity:.2}),f4(this.data,m4({reduce:"mean",k:20,anchor:"middle"},{x:"time",y:"ble",stroke:"blue",strokeWidth:2,opacity:.8})),Fx(this.data,{x:"time",y:"wifi",stroke:"red",opacity:.3}),f4(this.data,m4({reduce:"mean",k:20,anchor:"middle"},{x:"time",y:"wifi",stroke:"red",strokeWidth:2,opacity:.9})),JS()],color:{legend:!1,domain:["wifi","ble"],range:["red","blue"]},style:{fontFamily:"sans-serif",fontSize:"10pt",background:"#eeeeee",fill:"#808080"}}),this.renderer.appendChild(this.chartRef?.nativeElement,this.chart)}buildMetrics(){let n=As(this.data,p=>p.ble)||0,r=As(this.data,p=>p.wifi)||0,i="Rolig",o=this.data.length-1,d=Math.round(100*(this.data[o].ble+this.data[o].wifi)/(n+r));d>=80&&(i="Sv\xe6rt h\xf8y"),d>=60&&d<80&&(i="H\xf8y"),d>=40&&d<60&&(i="Normal"),d>=25&&d<40&&(i="Lav"),d<25&&(i="Sv\xe6rt Lav"),this.metricBLE=n,this.metricWifi=r,this.metricSampleCount=this.data.length,this.metricDensity=i,this.metricDensityPercent=d}}return e.\u0275fac=function(n){return new(n||e)(qe(O0),qe(ul),qe(oy))},e.\u0275cmp=Vs({type:e,selectors:[["app-device-view"]],viewQuery:function(n,r){if(1&n&&ny(Ore,5),2&n){let i;nf(i=rf())&&(r.chartRef=i.first)}},inputs:{device:"device"},features:[yt],decls:31,vars:11,consts:[[1,"device-status-page"],[1,"data"],["id","chart",1,"chart"],["chart",""],[1,"device-info"],[1,"metric"],[1,"metric-value"],[1,"metric-desc"],[1,"location"],[3,"device"]],template:function(n,r){1&n&&(xr(0,"div",0)(1,"div",1)(2,"h2"),Co(3),yr(),Is(4,"div",2,3),Co(6),function CT(e,t){const n=en();let r;const i=e+22;n.firstCreatePass?(r=function VV(e,t){if(t)for(let n=t.length-1;n>=0;n--){const r=t[n];if(e===r.name)return r}}(t,n.pipeRegistry),n.data[i]=r,r.onDestroy&&(n.destroyHooks||(n.destroyHooks=[])).push(i,r.onDestroy)):r=n.data[i];const o=r.factory||(r.factory=_s(r.type)),c=lo(qe);try{const d=Mr(!1),p=o();return Mr(d),function A8(e,t,n,r){n>=e.data.length&&(e.data[n]=null,e.blueprint[n]=null),t[n]=r}(n,He(),i,p),p}finally{lo(c)}}(7,"date"),yr(),xr(8,"div",4)(9,"div",5)(10,"div",6),Co(11),yr(),xr(12,"div",7),Co(13,"Maks antall bluetooth-enheter"),yr()(),xr(14,"div",5)(15,"div",6),Co(16),yr(),xr(17,"div",7),Co(18,"Maks antall WiFi-enheter"),yr()(),xr(19,"div",5)(20,"div",6),Co(21),yr(),xr(22,"div",7),Co(23,"M\xe5linger i perioden"),yr()(),xr(24,"div",5)(25,"div",6),Co(26),yr(),xr(27,"div",7),Co(28),yr()()(),xr(29,"div",8),Is(30,"app-device-map-view",9),yr()()),2&n&&(xo(3),Jd(r.device.name),xo(3),Qd(" Sist oppdatert ",function ET(e,t,n,r){const i=e+22,o=He(),c=function pa(e,t){return e[t]}(o,i);return function ty(e,t){return e[1].data[t].pure}(o,i)?vT(o,h(),t,c.transform,n,r,c):c.transform(n,r)}(7,8,r.samples.lastDataUpdate,"YYYY-MM-dd HH:mm")," "),xo(5),Jd(r.metricBLE),xo(5),Jd(r.metricWifi),xo(5),Jd(r.metricSampleCount),xo(5),Jd(r.metricDensity),xo(2),Qd("Folketetthet (",r.metricDensityPercent,"% av maks)"),xo(2),fl("device",r.device))},dependencies:[b4,YA],styles:[".device-status-page[_ngcontent-%COMP%]{display:grid;grid-template-columns:repeat(2,1fr);grid-template-rows:repeat(2,1fr);grid-row-gap:10px;grid-column-gap:10px;height:100%}.device-info[_ngcontent-%COMP%]{display:grid;grid-template-columns:repeat(2,1fr);grid-template-rows:1fr 1fr;grid-column-gap:1em;grid-row-gap:1em}.metric[_ngcontent-%COMP%]{background-color:#2696f9;color:#fff;border-radius:1em;display:grid;grid-template-columns:1fr;grid-template-rows:3fr 1fr}.metric-value[_ngcontent-%COMP%]{font-size:6vh;text-align:center;margin-top:auto;margin-bottom:auto}.metric-desc[_ngcontent-%COMP%]{font-size:1vw;text-align:center}.location[_ngcontent-%COMP%]{background-color:#ddd;border-radius:1em}.data[_ngcontent-%COMP%]{grid-column:span 2;vertical-align:middle}.chart[_ngcontent-%COMP%]{padding:1em;width:80vw}"]}),e})();class Nre extends kl{constructor(t,n,r={},i){super(t,n,r,i);const{inset:o=0,insetTop:c=o,insetRight:d=o,insetBottom:p=o,insetLeft:v=o,rx:E,ry:D}=r;this.insetTop=fi(c),this.insetRight=fi(d),this.insetBottom=fi(p),this.insetLeft=fi(v),this.rx=ls(E,"auto"),this.ry=ls(D,"auto")}render(t,n,r,i,o){const{rx:c,ry:d}=this;return Go("svg:g",o).call(Bh,this,i,o).call(this._transform,this,n).call(p=>p.selectAll().data(t).enter().append("rect").call(Vh,this).attr("x",this._x(n,r,i)).attr("width",this._width(n,r,i)).attr("y",this._y(n,r,i)).attr("height",this._height(n,r,i)).call(fn,"rx",c).call(fn,"ry",d).call(Fm,this,r)).node()}_x(t,{x:n},{marginLeft:r}){const{insetLeft:i}=this;return n?o=>n[o]+i:r+i}_y(t,{y:n},{marginTop:r}){const{insetTop:i}=this;return n?o=>n[o]+i:r+i}_width({x:t},{x:n},{marginRight:r,marginLeft:i,width:o}){const{insetLeft:c,insetRight:d}=this,p=n&&t?t.bandwidth():o-r-i;return Math.max(0,p-c-d)}_height({y:t},{y:n},{marginTop:r,marginBottom:i,height:o}){const{insetTop:c,insetBottom:d}=this,p=n&&t?t.bandwidth():o-r-i;return Math.max(0,p-c-d)}}const Vre={ariaLabel:"cell"};class a2 extends Nre{constructor(t,{x:n,y:r,...i}={}){super(t,{x:{value:n,scale:"x",type:"band",optional:!0},y:{value:r,scale:"y",type:"band",optional:!0}},i,Vre)}_transform(t,n){t.call(Uh,n,{},0,0)}}function Ure(e,t={}){let{x:n,y:r,...i}=t;return[n,r]=cx(n,r),new a2(e,{...i,x:n,y:r})}const $re=["chart"],jre=["legend"];let Hre=(()=>{class e{constructor(n,r){this.samples=n,this.renderer=r,this.data=[]}ngOnInit(){}ngAfterViewInit(){this.samples.allData().subscribe({next:n=>{this.data.push(n)},complete:()=>{this.showChart()}})}ngOnDestroy(){this.chart&&this.renderer.removeChild(this.chartRef?.nativeElement,this.chart,!1),this.legend&&this.renderer.removeChild(this.legendRef?.nativeElement,this.legend,!1)}showChart(){this.chart&&this.renderer.removeChild(this.chartRef?.nativeElement,this.chart,!1);let n=this.chartRef?.nativeElement.offsetWidth,r=As(this.data,o=>o.ble+o.wifi)||1;const i=$b("%m-%d %H:00");this.chart=QS({width:n,marginLeft:250,marginBottom:100,x:{label:"Tid",tickRotate:-90},y:{label:"Enhet"},marks:[Ure(this.data,{x:o=>i(o.time),y:"name",fill:o=>o.ble+o.wifi}),JS()],color:{legend:!1,scheme:"gnbu",reverse:!1,type:"linear"},style:{fontFamily:"sans-serif",fontSize:"10pt",background:"#eeeeee",fill:"#808080"}}),this.renderer.appendChild(this.chartRef?.nativeElement,this.chart),this.legend||(this.legend=function $te(e={}){for(const[t,n]of Dx){const r=e[t];if(Am(r)){const i=_x(e);let o;if("symbol"===t){const{fill:c,stroke:d=(void 0===c&&Am(e.color)?"color":void 0)}=e;o={fill:c,stroke:d}}return n(TS(t,r,o),US(i,r,e),c=>Am(e[c])?TS(c,e[c]):null)}}throw new Error("unknown legend type; no scale found")}({color:{domain:[0,r],ticks:3,scheme:"gnbu",reverse:!1,type:"linear"},width:350,ticks:5,label:"Antall enheter",style:{background:"#eeeeee"}}),this.renderer.appendChild(this.legendRef?.nativeElement,this.legend))}}return e.\u0275fac=function(n){return new(n||e)(qe(O0),qe(ul))},e.\u0275cmp=Vs({type:e,selectors:[["app-device-overview"]],viewQuery:function(n,r){if(1&n&&(ny($re,5),ny(jre,5)),2&n){let i;nf(i=rf())&&(r.chartRef=i.first),nf(i=rf())&&(r.legendRef=i.first)}},decls:10,vars:0,consts:[[1,"overview-page"],[1,"cell-chart"],["id","chart",1,"chart"],["chart",""],["id","legend",1,"legend"],["legend",""],[1,"allmap"]],template:function(n,r){1&n&&(xr(0,"div",0)(1,"div",1)(2,"h2"),Co(3,"Per enhet"),yr(),Is(4,"div",2,3)(6,"div",4,5),yr(),xr(8,"div",6),Is(9,"app-device-map-view"),yr()())},dependencies:[b4],styles:[".overview-page[_ngcontent-%COMP%]{display:grid;grid-template-columns:1fr;grid-template-rows:1fr 1fr;grid-row-gap:10px;grid-column-gap:10px;height:100%}.cell-chart[_ngcontent-%COMP%]{padding:1em;border:solid 1px silver;border-radius:1em;display:flex;flex-direction:column}.cell-chart[_ngcontent-%COMP%] .legend[_ngcontent-%COMP%]{margin-top:2em;margin-right:0;margin-left:auto}.chart[_ngcontent-%COMP%], .allmap[_ngcontent-%COMP%]{width:100%}"]}),e})();function Gre(e,t){if(1&e){const n=Dv();ht(),xr(0,"svg",16),wo("click",function(){return ma(n),Gs(Vp().autoPlay(!1))}),Is(1,"path",17),yr()}}function qre(e,t){if(1&e){const n=Dv();ht(),xr(0,"svg",16),wo("click",function(){return ma(n),Gs(Vp().autoPlay(!0))}),Is(1,"path",18),yr()}}const w4=function(e){return{active:e}};function Zre(e,t){if(1&e){const n=Dv();xr(0,"div",9),wo("click",function(){const o=ma(n).$implicit;return Gs(Vp().setActiveDevice(o))}),xr(1,"div",10),Co(2),yr(),xr(3,"div",11),Co(4),yr()()}if(2&e){const n=t.$implicit,r=Vp();fl("ngClass",Iw(3,w4,r.activeDevice==n)),xo(2),Qd(" ",n.name," "),xo(2),Qd(" Id: ",n.id," ")}}function Wre(e,t){1&e&&Is(0,"app-device-overview")}function Xre(e,t){1&e&&Is(0,"app-device-view",19),2&e&&fl("device",Vp().activeDevice)}let Yre=(()=>{class e{constructor(n){this.samples=n,this.activeDevices=[],this.autoPlayEnabled=!1,this.activeStep=0;let r=[];this.samples.activeDevices().subscribe({next:i=>{r.push(i)},complete:()=>{this.activeDevices=r}})}ngOnInit(){}setActiveDevice(n){this.activeDevice=n}autoPlay(n){if(!n)return this.autoPlayEnabled=!1,void this.autoPlayer?.unsubscribe();this.activeStep=-1,this.activeDevice=void 0,this.autoPlayEnabled=!0,this.autoPlayer=function NG(e=0,t=eR){return e<0&&(e=0),function LG(e=0,t,n=FG){let r=-1;return null!=t&&(nn(t)?n=t:r=t),new Nn(i=>{let o=function OG(e){return e instanceof Date&&!isNaN(e)}(e)?+e-n.now():e;o<0&&(o=0);let c=0;return n.schedule(function(){i.closed||(i.next(c++),0<=r?this.schedule(void 0,r):i.complete())},o)})}(e,e,t)}(15e3).subscribe(r=>this.autoStep())}autoStep(){if(this.autoPlayEnabled){if(this.activeStep++,this.activeStep>=this.activeDevices.length&&(this.activeStep=-1),-1==this.activeStep)return void(this.activeDevice=void 0);this.activeDevice=this.activeDevices[this.activeStep]}}}return e.\u0275fac=function(n){return new(n||e)(qe(O0))},e.\u0275cmp=Vs({type:e,selectors:[["app-main-page"]],decls:20,vars:8,consts:[[1,"page"],[1,"heading"],[1,"logo"],["src","/assets/trondheim_kommune.png"],[1,"title"],[1,"autoplay"],["fill","white","class","start-stop","height","32px","width","32px","version","1.1","xmlns","http://www.w3.org/2000/svg",0,"xmlns","xlink","http://www.w3.org/1999/xlink","viewBox","0 0 512 512",0,"xml","space","preserve",3,"click",4,"ngIf"],[1,"content"],[1,"list"],[1,"list-item",3,"ngClass","click"],[1,"item-title"],[1,"item-subtitle"],["class","list-item",3,"ngClass","click",4,"ngFor","ngForOf"],[1,"detail"],[4,"ngIf"],[3,"device",4,"ngIf"],["fill","white","height","32px","width","32px","version","1.1","xmlns","http://www.w3.org/2000/svg",0,"xmlns","xlink","http://www.w3.org/1999/xlink","viewBox","0 0 512 512",0,"xml","space","preserve",1,"start-stop",3,"click"],["d","M256,0C114.615,0,0,114.615,0,256s114.615,256,256,256s256-114.615,256-256S397.385,0,256,0z M336,320\n\tc0,8.837-7.163,16-16,16H192c-8.837,0-16-7.163-16-16V192c0-8.837,7.163-16,16-16h128c8.837,0,16,7.163,16,16V320z"],["d","M256,0C114.617,0,0,114.615,0,256s114.617,256,256,256s256-114.615,256-256S397.383,0,256,0z M344.48,269.57l-128,80\n c-2.59,1.617-5.535,2.43-8.48,2.43c-2.668,0-5.34-0.664-7.758-2.008C195.156,347.172,192,341.82,192,336V176\n c0-5.82,3.156-11.172,8.242-13.992c5.086-2.836,11.305-2.664,16.238,0.422l128,80c4.676,2.93,7.52,8.055,7.52,13.57\n S349.156,266.641,344.48,269.57z"],[3,"device"]],template:function(n,r){1&n&&(xr(0,"div",0)(1,"div",1)(2,"span",2),Is(3,"img",3),yr(),xr(4,"span",4),Co(5," PAX - Persontelling "),yr(),xr(6,"span",5),Bp(7,Gre,2,0,"svg",6),Bp(8,qre,2,0,"svg",6),yr()(),xr(9,"div",7)(10,"div",8)(11,"div",9),wo("click",function(){return r.setActiveDevice()}),xr(12,"div",10),Co(13," Alle "),yr(),xr(14,"div",11),Co(15," Vis aggregerte data for alle tellere "),yr()(),Bp(16,Zre,5,5,"div",12),yr(),xr(17,"div",13),Bp(18,Wre,1,0,"app-device-overview",14),Bp(19,Xre,1,1,"app-device-view",15),yr()()()),2&n&&(xo(7),fl("ngIf",r.autoPlayEnabled),xo(1),fl("ngIf",!r.autoPlayEnabled),xo(3),fl("ngClass",Iw(6,w4,null==r.activeDevice)),xo(5),fl("ngForOf",r.activeDevices),xo(2),fl("ngIf",null==r.activeDevice),xo(1),fl("ngIf",null!=r.activeDevice))},dependencies:[$A,GA,ZA,Lre,Hre],styles:[".page[_ngcontent-%COMP%]{margin:0;padding:0;width:100vw;height:100vh;background-color:#eee;display:flex;flex-direction:column}.heading[_ngcontent-%COMP%]{color:#fff;background-color:#009bdf;display:flex;flex-direction:row;align-items:center;justify-content:center;height:5em}.logo[_ngcontent-%COMP%]{min-width:250px}.start-stop[_ngcontent-%COMP%]{cursor:pointer}.heading[_ngcontent-%COMP%] .title[_ngcontent-%COMP%]{font-size:24pt}.content[_ngcontent-%COMP%]{height:calc(100vh - 5em);background-color:gray;display:flex;flex-direction:row}.list[_ngcontent-%COMP%]{direction:rtl;width:20em;min-height:100%;background-color:#ddd;display:flex;flex-direction:column;overflow-y:auto}.list-item[_ngcontent-%COMP%]{direction:ltr;width:100%;height:6em!important}.list-item[_ngcontent-%COMP%]:not(.active){border-bottom:solid 1px #cccccc}.list-item[_ngcontent-%COMP%]:hover:not(.active){background-color:#80add3;cursor:pointer}.active[_ngcontent-%COMP%]{background-color:#eee;color:#000;box-shadow:10px 5px 5px silver}.item-title[_ngcontent-%COMP%]{font-size:14pt;margin-top:1em;margin-left:1em}.item-subtitle[_ngcontent-%COMP%]{font-size:10pt;color:gray;margin-top:.5em;margin-left:2em;margin-bottom:1em;font-weight:light}.detail[_ngcontent-%COMP%]{background-color:#eee;flex:auto 1;padding:1em}.autoplay[_ngcontent-%COMP%]{margin-right:1em;margin-left:auto}"]}),e})(),Kre=(()=>{class e{constructor(n){this.paxService=n,this.title="PAX",this.paxService.configuration.basePath="https://pax.lab5e.com"}}return e.\u0275fac=function(n){return new(n||e)(qe(fE))},e.\u0275cmp=Vs({type:e,selectors:[["app-root"]],decls:1,vars:0,template:function(n,r){1&n&&Is(0,"app-main-page")},dependencies:[Yre]}),e})(),d6=(()=>{class e{}return e.\u0275fac=function(n){return new(n||e)},e.\u0275mod=ai({type:e}),e.\u0275inj=Ei({}),e})();const w2=new It("NgModelWithFormControlWarning");let T6=(()=>{class e{}return e.\u0275fac=function(n){return new(n||e)},e.\u0275mod=ai({type:e}),e.\u0275inj=Ei({imports:[d6]}),e})(),Kie=(()=>{class e{}return e.\u0275fac=function(n){return new(n||e)},e.\u0275mod=ai({type:e}),e.\u0275inj=Ei({imports:[T6]}),e})(),Jie=(()=>{class e{static withConfig(n){return{ngModule:e,providers:[{provide:w2,useValue:n.warnOnNgModelWithFormControl}]}}}return e.\u0275fac=function(n){return new(n||e)},e.\u0275mod=ai({type:e}),e.\u0275inj=Ei({imports:[T6]}),e})(),ioe=(()=>{class e{}return e.\u0275fac=function(n){return new(n||e)},e.\u0275mod=ai({type:e}),e.\u0275inj=Ei({imports:[JA]}),e})(),ooe=(()=>{class e{}return e.\u0275fac=function(n){return new(n||e)},e.\u0275mod=ai({type:e,bootstrap:[Kre]}),e.\u0275inj=Ei({imports:[I9,mG,Kie,Jie,IG,ioe]}),e})();(function GU(){gA=!1})(),M9().bootstrapModule(ooe).catch(e=>console.error(e))},943:function(zm){zm.exports=function(){"use strict";var Au,ku,or;function Zh(b,_r){if(Au)if(ku){var Rs="var sharedChunk = {}; ("+Au+")(sharedChunk); ("+ku+")(sharedChunk);",us={};Au(us),or=_r(us),typeof window<"u"&&(or.workerUrl=window.URL.createObjectURL(new Blob([Rs],{type:"text/javascript"})))}else ku=_r;else Au=_r}return Zh(0,function(b){var _r=Rs;function Rs(l,s,u,f){this.cx=3*l,this.bx=3*(u-l)-this.cx,this.ax=1-this.cx-this.bx,this.cy=3*s,this.by=3*(f-s)-this.cy,this.ay=1-this.cy-this.by,this.p1x=l,this.p1y=s,this.p2x=u,this.p2y=f}function us(l,s,u,f){const _=new _r(l,s,u,f);return function(x){return _.solve(x)}}Rs.prototype={sampleCurveX:function(l){return((this.ax*l+this.bx)*l+this.cx)*l},sampleCurveY:function(l){return((this.ay*l+this.by)*l+this.cy)*l},sampleCurveDerivativeX:function(l){return(3*this.ax*l+2*this.bx)*l+this.cx},solveCurveX:function(l,s){if(void 0===s&&(s=1e-6),l<0)return 0;if(l>1)return 1;for(var u=l,f=0;f<8;f++){var _=this.sampleCurveX(u)-l;if(Math.abs(_)_?C=u:M=u,u=.5*(M-C)+C;return u},solve:function(l,s){return this.sampleCurveY(this.solveCurveX(l,s))}};const Pl=us(.25,.1,.25,1);function Zt(l,s,u){return Math.min(u,Math.max(s,l))}function Te(l,s,u){const f=u-s,_=((l-s)%f+f)%f+s;return _===s?u:_}function Ni(l,...s){for(const u of s)for(const f in u)l[f]=u[f];return l}let Fs=1;function Os(l,s){l.forEach(u=>{s[u]&&(s[u]=s[u].bind(s))})}function Ra(l,s,u){const f={};for(const _ in l)f[_]=s.call(u||this,l[_],_,l);return f}function Rl(l,s,u){const f={};for(const _ in l)s.call(u||this,l[_],_,l)&&(f[_]=l[_]);return f}function wi(l){return Array.isArray(l)?l.map(wi):"object"==typeof l&&l?Ra(l,wi):l}const no={};function pn(l){no[l]||(typeof console<"u"&&console.warn(l),no[l]=!0)}function ii(l,s,u){return(u.y-l.y)*(s.x-l.x)>(s.y-l.y)*(u.x-l.x)}function kc(l){let s=0;for(let u,f,_=0,x=l.length,C=x-1;_cancelAnimationFrame(s)}},getImageData(l,s=0){return this.getImageCanvasContext(l).getImageData(-s,-s,l.width+2*s,l.height+2*s)},getImageCanvasContext(l){const s=window.document.createElement("canvas"),u=s.getContext("2d",{willReadFrequently:!0});if(!u)throw new Error("failed to create canvas 2d context");return s.width=l.width,s.height=l.height,u.drawImage(l,0,0,l.width,l.height),u},resolveURL:l=>(hs||(hs=document.createElement("a")),hs.href=l,hs.href),hardwareConcurrency:typeof navigator<"u"&&navigator.hardwareConcurrency||4,get prefersReducedMotion(){return!!matchMedia&&(null==Hn&&(Hn=matchMedia("(prefers-reduced-motion: reduce)")),Hn.matches)}};var Tt=qr;function qr(l,s){this.x=l,this.y=s}qr.prototype={clone:function(){return new qr(this.x,this.y)},add:function(l){return this.clone()._add(l)},sub:function(l){return this.clone()._sub(l)},multByPoint:function(l){return this.clone()._multByPoint(l)},divByPoint:function(l){return this.clone()._divByPoint(l)},mult:function(l){return this.clone()._mult(l)},div:function(l){return this.clone()._div(l)},rotate:function(l){return this.clone()._rotate(l)},rotateAround:function(l,s){return this.clone()._rotateAround(l,s)},matMult:function(l){return this.clone()._matMult(l)},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(l){return this.x===l.x&&this.y===l.y},dist:function(l){return Math.sqrt(this.distSqr(l))},distSqr:function(l){var s=l.x-this.x,u=l.y-this.y;return s*s+u*u},angle:function(){return Math.atan2(this.y,this.x)},angleTo:function(l){return Math.atan2(this.y-l.y,this.x-l.x)},angleWith:function(l){return this.angleWithSep(l.x,l.y)},angleWithSep:function(l,s){return Math.atan2(this.x*s-this.y*l,this.x*l+this.y*s)},_matMult:function(l){var s=l[2]*this.x+l[3]*this.y;return this.x=l[0]*this.x+l[1]*this.y,this.y=s,this},_add:function(l){return this.x+=l.x,this.y+=l.y,this},_sub:function(l){return this.x-=l.x,this.y-=l.y,this},_mult:function(l){return this.x*=l,this.y*=l,this},_div:function(l){return this.x/=l,this.y/=l,this},_multByPoint:function(l){return this.x*=l.x,this.y*=l.y,this},_divByPoint:function(l){return this.x/=l.x,this.y/=l.y,this},_unit:function(){return this._div(this.mag()),this},_perp:function(){var l=this.y;return this.y=this.x,this.x=-l,this},_rotate:function(l){var s=Math.cos(l),u=Math.sin(l),f=u*this.x+s*this.y;return this.x=s*this.x-u*this.y,this.y=f,this},_rotateAround:function(l,s){var u=Math.cos(l),f=Math.sin(l),_=s.y+f*(this.x-s.x)+u*(this.y-s.y);return this.x=s.x+u*(this.x-s.x)-f*(this.y-s.y),this.y=_,this},_round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}},qr.convert=function(l){return l instanceof qr?l:Array.isArray(l)?new qr(l[0],l[1]):l};const Oa={MAX_PARALLEL_IMAGE_REQUESTS:16,MAX_PARALLEL_IMAGE_REQUESTS_PER_FRAME:8,REGISTERED_PROTOCOLS:{}};class Ns extends Error{constructor(s,u,f,_){super(`AJAXError: ${u} (${s}): ${f}`),this.status=s,this.statusText=u,this.url=f,this.body=_}}const Nn=Mo()?()=>self.worker&&self.worker.referrer:()=>("blob:"===window.location.protocol?window.parent:window).location.href;function Pc(l,s){const u=new AbortController,f=new Request(l.url,{method:l.method||"GET",body:l.body,credentials:l.credentials,headers:l.headers,referrer:Nn(),signal:u.signal});let _=!1,x=!1;return"json"===l.type&&f.headers.set("Accept","application/json"),x||fetch(f).then(C=>{return C.ok?(M=C,void("arrayBuffer"===l.type?M.arrayBuffer():"json"===l.type?M.json():M.text()).then(A=>{x||(_=!0,s(null,A,M.headers.get("Cache-Control"),M.headers.get("Expires")))}).catch(A=>{x||s(new Error(A.message))})):C.blob().then(M=>s(new Ns(C.status,C.statusText,l.url,M)));var M}).catch(C=>{20!==C.code&&s(new Error(C.message))}),{cancel:()=>{x=!0,_||u.abort()}}}const Fl=function(l,s){if(/:\/\//.test(l.url)&&!/^https?:|^file:/.test(l.url)){if(Mo()&&self.worker&&self.worker.actor)return self.worker.actor.send("getResource",l,s);if(!Mo()){const f=l.url.substring(0,l.url.indexOf("://"));return(Oa.REGISTERED_PROTOCOLS[f]||Pc)(l,s)}}if(!(/^file:/.test(u=l.url)||/^file:/.test(Nn())&&!/^\w+:/.test(u))){if(fetch&&Request&&AbortController&&Object.prototype.hasOwnProperty.call(Request.prototype,"signal"))return Pc(l,s);if(Mo()&&self.worker&&self.worker.actor)return self.worker.actor.send("getResource",l,s,void 0,!0)}var u;return function(f,_){const x=new XMLHttpRequest;x.open(f.method||"GET",f.url,!0),"arrayBuffer"===f.type&&(x.responseType="arraybuffer");for(const C in f.headers)x.setRequestHeader(C,f.headers[C]);return"json"===f.type&&(x.responseType="text",x.setRequestHeader("Accept","application/json")),x.withCredentials="include"===f.credentials,x.onerror=()=>{_(new Error(x.statusText))},x.onload=()=>{if((x.status>=200&&x.status<300||0===x.status)&&null!==x.response){let C=x.response;if("json"===f.type)try{C=JSON.parse(x.response)}catch(M){return _(M)}_(null,C,x.getResponseHeader("Cache-Control"),x.getResponseHeader("Expires"))}else{const C=new Blob([x.response],{type:x.getResponseHeader("Content-Type")});_(new Ns(x.status,x.statusText,f.url,C))}},x.send(f.body),{cancel:()=>x.abort()}}(l,s)},La=function(l,s){return Fl(Ni(l,{type:"arrayBuffer"}),s)};function Rc(l){const s=window.document.createElement("a");return s.href=l,s.protocol===window.document.location.protocol&&s.host===window.document.location.host}function oi(l,s,u){u[l]&&-1!==u[l].indexOf(s)||(u[l]=u[l]||[],u[l].push(s))}function Na(l,s,u){if(u&&u[l]){const f=u[l].indexOf(s);-1!==f&&u[l].splice(f,1)}}class ra{constructor(s,u={}){Ni(this,u),this.type=s}}class mr extends ra{constructor(s,u={}){super("error",Ni({error:s},u))}}class Qn{on(s,u){return this._listeners=this._listeners||{},oi(s,u,this._listeners),this}off(s,u){return Na(s,u,this._listeners),Na(s,u,this._oneTimeListeners),this}once(s,u){return u?(this._oneTimeListeners=this._oneTimeListeners||{},oi(s,u,this._oneTimeListeners),this):new Promise(f=>this.once(s,f))}fire(s,u){"string"==typeof s&&(s=new ra(s,u||{}));const f=s.type;if(this.listens(f)){s.target=this;const _=this._listeners&&this._listeners[f]?this._listeners[f].slice():[];for(const M of _)M.call(this,s);const x=this._oneTimeListeners&&this._oneTimeListeners[f]?this._oneTimeListeners[f].slice():[];for(const M of x)Na(f,M,this._oneTimeListeners),M.call(this,s);const C=this._eventedParent;C&&(Ni(s,"function"==typeof this._eventedParentData?this._eventedParentData():this._eventedParentData),C.fire(s))}else s instanceof mr&&console.error(s.error);return this}listens(s){return this._listeners&&this._listeners[s]&&this._listeners[s].length>0||this._oneTimeListeners&&this._oneTimeListeners[s]&&this._oneTimeListeners[s].length>0||this._eventedParent&&this._eventedParent.listens(s)}setEventedParent(s,u){return this._eventedParent=s,this._eventedParentData=u,this}}var Ae={$version:8,$root:{version:{required:!0,type:"enum",values:[8]},name:{type:"string"},metadata:{type:"*"},center:{type:"array",value:"number"},zoom:{type:"number"},bearing:{type:"number",default:0,period:360,units:"degrees"},pitch:{type:"number",default:0,units:"degrees"},light:{type:"light"},terrain:{type:"terrain"},sources:{required:!0,type:"sources"},sprite:{type:"sprite"},glyphs:{type:"string"},transition:{type:"transition"},layers:{required:!0,type:"array",value:"layer"}},sources:{"*":{type:"source"}},source:["source_vector","source_raster","source_raster_dem","source_geojson","source_video","source_image"],source_vector:{type:{required:!0,type:"enum",values:{vector:{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},scheme:{type:"enum",values:{xyz:{},tms:{}},default:"xyz"},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},attribution:{type:"string"},promoteId:{type:"promoteId"},volatile:{type:"boolean",default:!1},"*":{type:"*"}},source_raster:{type:{required:!0,type:"enum",values:{raster:{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},tileSize:{type:"number",default:512,units:"pixels"},scheme:{type:"enum",values:{xyz:{},tms:{}},default:"xyz"},attribution:{type:"string"},volatile:{type:"boolean",default:!1},"*":{type:"*"}},source_raster_dem:{type:{required:!0,type:"enum",values:{"raster-dem":{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},tileSize:{type:"number",default:512,units:"pixels"},attribution:{type:"string"},encoding:{type:"enum",values:{terrarium:{},mapbox:{}},default:"mapbox"},volatile:{type:"boolean",default:!1},"*":{type:"*"}},source_geojson:{type:{required:!0,type:"enum",values:{geojson:{}}},data:{required:!0,type:"*"},maxzoom:{type:"number",default:18},attribution:{type:"string"},buffer:{type:"number",default:128,maximum:512,minimum:0},filter:{type:"*"},tolerance:{type:"number",default:.375},cluster:{type:"boolean",default:!1},clusterRadius:{type:"number",default:50,minimum:0},clusterMaxZoom:{type:"number"},clusterMinPoints:{type:"number"},clusterProperties:{type:"*"},lineMetrics:{type:"boolean",default:!1},generateId:{type:"boolean",default:!1},promoteId:{type:"promoteId"}},source_video:{type:{required:!0,type:"enum",values:{video:{}}},urls:{required:!0,type:"array",value:"string"},coordinates:{required:!0,type:"array",length:4,value:{type:"array",length:2,value:"number"}}},source_image:{type:{required:!0,type:"enum",values:{image:{}}},url:{required:!0,type:"string"},coordinates:{required:!0,type:"array",length:4,value:{type:"array",length:2,value:"number"}}},layer:{id:{type:"string",required:!0},type:{type:"enum",values:{fill:{},line:{},symbol:{},circle:{},heatmap:{},"fill-extrusion":{},raster:{},hillshade:{},background:{}},required:!0},metadata:{type:"*"},source:{type:"string"},"source-layer":{type:"string"},minzoom:{type:"number",minimum:0,maximum:24},maxzoom:{type:"number",minimum:0,maximum:24},filter:{type:"filter"},layout:{type:"layout"},paint:{type:"paint"}},layout:["layout_fill","layout_line","layout_circle","layout_heatmap","layout_fill-extrusion","layout_symbol","layout_raster","layout_hillshade","layout_background"],layout_background:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_fill:{"fill-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_circle:{"circle-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_heatmap:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},"layout_fill-extrusion":{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_line:{"line-cap":{type:"enum",values:{butt:{},round:{},square:{}},default:"butt",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"line-join":{type:"enum",values:{bevel:{},round:{},miter:{}},default:"miter",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"line-miter-limit":{type:"number",default:2,requires:[{"line-join":"miter"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-round-limit":{type:"number",default:1.05,requires:[{"line-join":"round"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_symbol:{"symbol-placement":{type:"enum",values:{point:{},line:{},"line-center":{}},default:"point",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"symbol-spacing":{type:"number",default:250,minimum:1,units:"pixels",requires:[{"symbol-placement":"line"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"symbol-avoid-edges":{type:"boolean",default:!1,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"symbol-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"symbol-z-order":{type:"enum",values:{auto:{},"viewport-y":{},source:{}},default:"auto",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-allow-overlap":{type:"boolean",default:!1,requires:["icon-image",{"!":"icon-overlap"}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-overlap":{type:"enum",values:{never:{},always:{},cooperative:{}},requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-ignore-placement":{type:"boolean",default:!1,requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-optional":{type:"boolean",default:!1,requires:["icon-image","text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-rotation-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-size":{type:"number",default:1,minimum:0,units:"factor of the original icon size",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-text-fit":{type:"enum",values:{none:{},width:{},height:{},both:{}},default:"none",requires:["icon-image","text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-text-fit-padding":{type:"array",value:"number",length:4,default:[0,0,0,0],units:"pixels",requires:["icon-image","text-field",{"icon-text-fit":["both","width","height"]}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-image":{type:"resolvedImage",tokens:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-rotate":{type:"number",default:0,period:360,units:"degrees",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-padding":{type:"padding",default:[2],units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-keep-upright":{type:"boolean",default:!1,requires:["icon-image",{"icon-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-offset":{type:"array",value:"number",length:2,default:[0,0],requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-anchor":{type:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},default:"center",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-pitch-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-pitch-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-rotation-alignment":{type:"enum",values:{map:{},viewport:{},"viewport-glyph":{},auto:{}},default:"auto",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-field":{type:"formatted",default:"",tokens:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-font":{type:"array",value:"string",default:["Open Sans Regular","Arial Unicode MS Regular"],requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-size":{type:"number",default:16,minimum:0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-max-width":{type:"number",default:10,minimum:0,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-line-height":{type:"number",default:1.2,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-letter-spacing":{type:"number",default:0,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-justify":{type:"enum",values:{auto:{},left:{},center:{},right:{}},default:"center",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-radial-offset":{type:"number",units:"ems",default:0,requires:["text-field"],"property-type":"data-driven",expression:{interpolated:!0,parameters:["zoom","feature"]}},"text-variable-anchor":{type:"array",value:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-anchor":{type:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},default:"center",requires:["text-field",{"!":"text-variable-anchor"}],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-max-angle":{type:"number",default:45,units:"degrees",requires:["text-field",{"symbol-placement":["line","line-center"]}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-writing-mode":{type:"array",value:"enum",values:{horizontal:{},vertical:{}},requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-rotate":{type:"number",default:0,period:360,units:"degrees",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-padding":{type:"number",default:2,minimum:0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-keep-upright":{type:"boolean",default:!0,requires:["text-field",{"text-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-transform":{type:"enum",values:{none:{},uppercase:{},lowercase:{}},default:"none",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-offset":{type:"array",value:"number",units:"ems",length:2,default:[0,0],requires:["text-field",{"!":"text-radial-offset"}],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-allow-overlap":{type:"boolean",default:!1,requires:["text-field",{"!":"text-overlap"}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-overlap":{type:"enum",values:{never:{},always:{},cooperative:{}},requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-ignore-placement":{type:"boolean",default:!1,requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-optional":{type:"boolean",default:!1,requires:["text-field","icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_raster:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_hillshade:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},filter:{type:"array",value:"*"},filter_operator:{type:"enum",values:{"==":{},"!=":{},">":{},">=":{},"<":{},"<=":{},in:{},"!in":{},all:{},any:{},none:{},has:{},"!has":{},within:{}}},geometry_type:{type:"enum",values:{Point:{},LineString:{},Polygon:{}}},function:{expression:{type:"expression"},stops:{type:"array",value:"function_stop"},base:{type:"number",default:1,minimum:0},property:{type:"string",default:"$zoom"},type:{type:"enum",values:{identity:{},exponential:{},interval:{},categorical:{}},default:"exponential"},colorSpace:{type:"enum",values:{rgb:{},lab:{},hcl:{}},default:"rgb"},default:{type:"*",required:!1}},function_stop:{type:"array",minimum:0,maximum:24,value:["number","color"],length:2},expression:{type:"array",value:"*",minimum:1},light:{anchor:{type:"enum",default:"viewport",values:{map:{},viewport:{}},"property-type":"data-constant",transition:!1,expression:{interpolated:!1,parameters:["zoom"]}},position:{type:"array",default:[1.15,210,30],length:3,value:"number","property-type":"data-constant",transition:!0,expression:{interpolated:!0,parameters:["zoom"]}},color:{type:"color","property-type":"data-constant",default:"#ffffff",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},intensity:{type:"number","property-type":"data-constant",default:.5,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0}},terrain:{source:{type:"string",required:!0},exaggeration:{type:"number",minimum:0,default:1}},paint:["paint_fill","paint_line","paint_circle","paint_heatmap","paint_fill-extrusion","paint_symbol","paint_raster","paint_hillshade","paint_background"],paint_fill:{"fill-antialias":{type:"boolean",default:!0,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"fill-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-outline-color":{type:"color",transition:!0,requires:[{"!":"fill-pattern"},{"fill-antialias":!0}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["fill-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"}},"paint_fill-extrusion":{"fill-extrusion-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"fill-extrusion-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["fill-extrusion-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"},"fill-extrusion-height":{type:"number",default:0,minimum:0,units:"meters",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-base":{type:"number",default:0,minimum:0,units:"meters",transition:!0,requires:["fill-extrusion-height"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-vertical-gradient":{type:"boolean",default:!0,transition:!1,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},paint_line:{"line-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"line-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["line-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"line-width":{type:"number",default:1,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-gap-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-offset":{type:"number",default:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-dasharray":{type:"array",value:"number",minimum:0,transition:!0,units:"line widths",requires:[{"!":"line-pattern"}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"cross-faded"},"line-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"},"line-gradient":{type:"color",transition:!1,requires:[{"!":"line-dasharray"},{"!":"line-pattern"},{source:"geojson",has:{lineMetrics:!0}}],expression:{interpolated:!0,parameters:["line-progress"]},"property-type":"color-ramp"}},paint_circle:{"circle-radius":{type:"number",default:5,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-blur":{type:"number",default:0,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"circle-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["circle-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-pitch-scale":{type:"enum",values:{map:{},viewport:{}},default:"map",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-pitch-alignment":{type:"enum",values:{map:{},viewport:{}},default:"viewport",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-stroke-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-stroke-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-stroke-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"}},paint_heatmap:{"heatmap-radius":{type:"number",default:30,minimum:1,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"heatmap-weight":{type:"number",default:1,minimum:0,transition:!1,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"heatmap-intensity":{type:"number",default:1,minimum:0,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"heatmap-color":{type:"color",default:["interpolate",["linear"],["heatmap-density"],0,"rgba(0, 0, 255, 0)",.1,"royalblue",.3,"cyan",.5,"lime",.7,"yellow",1,"red"],transition:!1,expression:{interpolated:!0,parameters:["heatmap-density"]},"property-type":"color-ramp"},"heatmap-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_symbol:{"icon-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-color":{type:"color",default:"#000000",transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-color":{type:"color",default:"rgba(0, 0, 0, 0)",transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["icon-image","icon-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-color":{type:"color",default:"#000000",transition:!0,overridable:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-color":{type:"color",default:"rgba(0, 0, 0, 0)",transition:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["text-field","text-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},paint_raster:{"raster-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-hue-rotate":{type:"number",default:0,period:360,transition:!0,units:"degrees",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-brightness-min":{type:"number",default:0,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-brightness-max":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-saturation":{type:"number",default:0,minimum:-1,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-contrast":{type:"number",default:0,minimum:-1,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-resampling":{type:"enum",values:{linear:{},nearest:{}},default:"linear",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"raster-fade-duration":{type:"number",default:300,minimum:0,transition:!1,units:"milliseconds",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_hillshade:{"hillshade-illumination-direction":{type:"number",default:335,minimum:0,maximum:359,transition:!1,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-illumination-anchor":{type:"enum",values:{map:{},viewport:{}},default:"viewport",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-exaggeration":{type:"number",default:.5,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-shadow-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-highlight-color":{type:"color",default:"#FFFFFF",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-accent-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_background:{"background-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"background-pattern"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"background-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"cross-faded"},"background-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},transition:{duration:{type:"number",default:300,minimum:0,units:"milliseconds"},delay:{type:"number",default:0,minimum:0,units:"milliseconds"}},"property-type":{"data-driven":{type:"property-type"},"cross-faded":{type:"property-type"},"cross-faded-data-driven":{type:"property-type"},"color-ramp":{type:"property-type"},"data-constant":{type:"property-type"},constant:{type:"property-type"}},promoteId:{"*":{type:"string"}}};class Pe{constructor(s,u,f,_){this.message=(s?`${s}: `:"")+f,_&&(this.identifier=_),null!=u&&u.__line__&&(this.line=u.__line__)}}function za(l){const s=l.value;return s?[new Pe(l.key,s,"constants have been deprecated as of v8")]:[]}function zi(l,...s){for(const u of s)for(const f in u)l[f]=u[f];return l}function Vn(l){return l instanceof Number||l instanceof String||l instanceof Boolean?l.valueOf():l}function ds(l){if(Array.isArray(l))return l.map(ds);if(l instanceof Object&&!(l instanceof Number||l instanceof String||l instanceof Boolean)){const s={};for(const u in l)s[u]=ds(l[u]);return s}return Vn(l)}class Bi extends Error{constructor(s,u){super(u),this.message=u,this.key=s}}class Ol{constructor(s,u=[]){this.parent=s,this.bindings={};for(const[f,_]of u)this.bindings[f]=_}concat(s){return new Ol(this,s)}get(s){if(this.bindings[s])return this.bindings[s];if(this.parent)return this.parent.get(s);throw new Error(`${s} not found in scope.`)}has(s){return!!this.bindings[s]||!!this.parent&&this.parent.has(s)}}const fs={kind:"null"},rt={kind:"number"},Jt={kind:"string"},jt={kind:"boolean"},io={kind:"color"},ps={kind:"object"},At={kind:"value"},zs={kind:"collator"},Ci={kind:"formatted"},ia={kind:"padding"},oo={kind:"resolvedImage"};function Vi(l,s){return{kind:"array",itemType:l,N:s}}function zn(l){if("array"===l.kind){const s=zn(l.itemType);return"number"==typeof l.N?`array<${s}, ${l.N}>`:"value"===l.itemType.kind?"array":`array<${s}>`}return l.kind}const Fc=[fs,rt,Jt,jt,io,Ci,ps,Vi(At),ia,oo];function so(l,s){if("error"===s.kind)return null;if("array"===l.kind){if("array"===s.kind&&(0===s.N&&"value"===s.itemType.kind||!so(l.itemType,s.itemType))&&("number"!=typeof l.N||l.N===s.N))return null}else{if(l.kind===s.kind)return null;if("value"===l.kind)for(const u of Fc)if(!so(u,s))return null}return`Expected ${zn(l)} but found ${zn(s)} instead.`}function Ll(l,s){return s.some(u=>u.kind===l.kind)}function mn(l,s){return s.some(u=>"null"===u?null===l:"array"===u?Array.isArray(l):"object"===u?l&&!Array.isArray(l)&&"object"==typeof l:u===typeof l)}var oa,Oc={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 Ba(l){return(l=Math.round(l))<0?0:l>255?255:l}function Ru(l){return Ba("%"===l[l.length-1]?parseFloat(l)/100*255:parseInt(l))}function sa(l){return(s="%"===l[l.length-1]?parseFloat(l)/100:parseFloat(l))<0?0:s>1?1:s;var s}function Va(l,s,u){return u<0?u+=1:u>1&&(u-=1),6*u<1?l+(s-l)*u*6:2*u<1?s:3*u<2?l+(s-l)*(2/3-u)*6:l}try{oa={}.parseCSSColor=function(l){var s,u=l.replace(/ /g,"").toLowerCase();if(u in Oc)return Oc[u].slice();if("#"===u[0])return 4===u.length?(s=parseInt(u.substr(1),16))>=0&&s<=4095?[(3840&s)>>4|(3840&s)>>8,240&s|(240&s)>>4,15&s|(15&s)<<4,1]:null:7===u.length&&(s=parseInt(u.substr(1),16))>=0&&s<=16777215?[(16711680&s)>>16,(65280&s)>>8,255&s,1]:null;var f=u.indexOf("("),_=u.indexOf(")");if(-1!==f&&_+1===u.length){var x=u.substr(0,f),C=u.substr(f+1,_-(f+1)).split(","),M=1;switch(x){case"rgba":if(4!==C.length)return null;M=sa(C.pop());case"rgb":return 3!==C.length?null:[Ru(C[0]),Ru(C[1]),Ru(C[2]),M];case"hsla":if(4!==C.length)return null;M=sa(C.pop());case"hsl":if(3!==C.length)return null;var A=(parseFloat(C[0])%360+360)%360/360,F=sa(C[1]),O=sa(C[2]),B=O<=.5?O*(F+1):O+F-O*F,H=2*O-B;return[Ba(255*Va(H,B,A+1/3)),Ba(255*Va(H,B,A)),Ba(255*Va(H,B,A-1/3)),M];default:return null}}return null}}catch{}class Sn{constructor(s,u,f,_=1){this.r=s,this.g=u,this.b=f,this.a=_}static parse(s){if(!s)return;if(s instanceof Sn)return s;if("string"!=typeof s)return;const u=oa(s);return u?new Sn(u[0]/255*u[3],u[1]/255*u[3],u[2]/255*u[3],u[3]):void 0}toString(){const[s,u,f,_]=this.toArray();return`rgba(${Math.round(s)},${Math.round(u)},${Math.round(f)},${_})`}toArray(){const{r:s,g:u,b:f,a:_}=this;return 0===_?[0,0,0,0]:[255*s/_,255*u/_,255*f/_,_]}}Sn.black=new Sn(0,0,0,1),Sn.white=new Sn(1,1,1,1),Sn.transparent=new Sn(0,0,0,0),Sn.red=new Sn(1,0,0,1);class Nl{constructor(s,u,f){this.sensitivity=s?u?"variant":"case":u?"accent":"base",this.locale=f,this.collator=new Intl.Collator(this.locale?this.locale:[],{sensitivity:this.sensitivity,usage:"search"})}compare(s,u){return this.collator.compare(s,u)}resolvedLocale(){return new Intl.Collator(this.locale?this.locale:[]).resolvedOptions().locale}}class ao{constructor(s,u,f,_,x){this.text=s,this.image=u,this.scale=f,this.fontStack=_,this.textColor=x}}class Zr{constructor(s){this.sections=s}static fromString(s){return new Zr([new ao(s,null,null,null,null)])}isEmpty(){return 0===this.sections.length||!this.sections.some(s=>0!==s.text.length||s.image&&0!==s.image.name.length)}static factory(s){return s instanceof Zr?s:Zr.fromString(s)}toString(){return 0===this.sections.length?"":this.sections.map(s=>s.text).join("")}}class Vr{constructor(s){this.values=s.slice()}static parse(s){if(s instanceof Vr)return s;if("number"==typeof s)return new Vr([s,s,s,s]);if(Array.isArray(s)&&!(s.length<1||s.length>4)){for(const u of s)if("number"!=typeof u)return;switch(s.length){case 1:s=[s[0],s[0],s[0],s[0]];break;case 2:s=[s[0],s[1],s[0],s[1]];break;case 3:s=[s[0],s[1],s[2],s[1]]}return new Vr(s)}}toString(){return JSON.stringify(this.values)}}class pi{constructor(s){this.name=s.name,this.available=s.available}toString(){return this.name}static fromString(s){return s?new pi({name:s,available:!1}):null}}function mi(l,s,u,f){return"number"==typeof l&&l>=0&&l<=255&&"number"==typeof s&&s>=0&&s<=255&&"number"==typeof u&&u>=0&&u<=255?void 0===f||"number"==typeof f&&f>=0&&f<=1?null:`Invalid rgba value [${[l,s,u,f].join(", ")}]: 'a' must be between 0 and 1.`:`Invalid rgba value [${("number"==typeof f?[l,s,u,f]:[l,s,u]).join(", ")}]: 'r', 'g', and 'b' must be between 0 and 255.`}function Bs(l){if(null===l||"string"==typeof l||"boolean"==typeof l||"number"==typeof l||l instanceof Sn||l instanceof Nl||l instanceof Zr||l instanceof Vr||l instanceof pi)return!0;if(Array.isArray(l)){for(const s of l)if(!Bs(s))return!1;return!0}if("object"==typeof l){for(const s in l)if(!Bs(l[s]))return!1;return!0}return!1}function J(l){if(null===l)return fs;if("string"==typeof l)return Jt;if("boolean"==typeof l)return jt;if("number"==typeof l)return rt;if(l instanceof Sn)return io;if(l instanceof Nl)return zs;if(l instanceof Zr)return Ci;if(l instanceof Vr)return ia;if(l instanceof pi)return oo;if(Array.isArray(l)){const s=l.length;let u;for(const f of l){const _=J(f);if(u){if(u===_)continue;u=At;break}u=_}return Vi(u||At,s)}return ps}function V(l){const s=typeof l;return null===l?"":"string"===s||"number"===s||"boolean"===s?String(l):l instanceof Sn||l instanceof Zr||l instanceof Vr||l instanceof pi?l.toString():JSON.stringify(l)}class ${constructor(s,u){this.type=s,this.value=u}static parse(s,u){if(2!==s.length)return u.error(`'literal' expression requires exactly one argument, but found ${s.length-1} instead.`);if(!Bs(s[1]))return u.error("invalid value");const f=s[1];let _=J(f);const x=u.expectedType;return"array"!==_.kind||0!==_.N||!x||"array"!==x.kind||"number"==typeof x.N&&0!==x.N||(_=x),new $(_,f)}evaluate(){return this.value}eachChild(){}outputDefined(){return!0}}class K{constructor(s){this.name="ExpressionEvaluationError",this.message=s}toJSON(){return this.message}}const te={string:Jt,number:rt,boolean:jt,object:ps};class ce{constructor(s,u){this.type=s,this.args=u}static parse(s,u){if(s.length<2)return u.error("Expected at least one argument.");let f,_=1;const x=s[0];if("array"===x){let M,A;if(s.length>2){const F=s[1];if("string"!=typeof F||!(F in te)||"object"===F)return u.error('The item type argument of "array" must be one of string, number, boolean',1);M=te[F],_++}else M=At;if(s.length>3){if(null!==s[2]&&("number"!=typeof s[2]||s[2]<0||s[2]!==Math.floor(s[2])))return u.error('The length argument to "array" must be a positive integer literal',2);A=s[2],_++}f=Vi(M,A)}else{if(!te[x])throw new Error(`Types doesn't contain name = ${x}`);f=te[x]}const C=[];for(;_s.outputDefined())}}const ge={"to-boolean":jt,"to-color":io,"to-number":rt,"to-string":Jt};class he{constructor(s,u){this.type=s,this.args=u}static parse(s,u){if(s.length<2)return u.error("Expected at least one argument.");const f=s[0];if(!ge[f])throw new Error(`Can't parse ${f} as it is not part of the known types`);if(("to-boolean"===f||"to-string"===f)&&2!==s.length)return u.error("Expected one argument.");const _=ge[f],x=[];for(let C=1;C4?`Invalid rbga value ${JSON.stringify(u)}: expected an array containing either three or four numeric values.`:mi(u[0],u[1],u[2],u[3]),!f))return new Sn(u[0]/255,u[1]/255,u[2]/255,u[3])}throw new K(f||`Could not parse color from value '${"string"==typeof u?u:JSON.stringify(u)}'`)}if("padding"===this.type.kind){let u;for(const f of this.args){u=f.evaluate(s);const _=Vr.parse(u);if(_)return _}throw new K(`Could not parse padding from value '${"string"==typeof u?u:JSON.stringify(u)}'`)}if("number"===this.type.kind){let u=null;for(const f of this.args){if(u=f.evaluate(s),null===u)return 0;const _=Number(u);if(!isNaN(_))return _}throw new K(`Could not convert ${JSON.stringify(u)} to number.`)}return"formatted"===this.type.kind?Zr.fromString(V(this.args[0].evaluate(s))):"resolvedImage"===this.type.kind?pi.fromString(V(this.args[0].evaluate(s))):V(this.args[0].evaluate(s))}eachChild(s){this.args.forEach(s)}outputDefined(){return this.args.every(s=>s.outputDefined())}}const ue=["Unknown","Point","LineString","Polygon"];class xe{constructor(){this.globals=null,this.feature=null,this.featureState=null,this.formattedSection=null,this._parseColorCache={},this.availableImages=null,this.canonical=null}id(){return this.feature&&"id"in this.feature?this.feature.id:null}geometryType(){return this.feature?"number"==typeof this.feature.type?ue[this.feature.type]:this.feature.type:null}geometry(){return this.feature&&"geometry"in this.feature?this.feature.geometry:null}canonicalID(){return this.canonical}properties(){return this.feature&&this.feature.properties||{}}parseColor(s){let u=this._parseColorCache[s];return u||(u=this._parseColorCache[s]=Sn.parse(s)),u}}class Me{constructor(s,u,f,_){this.name=s,this.type=u,this._evaluate=f,this.args=_}evaluate(s){return this._evaluate(s,this.args)}eachChild(s){this.args.forEach(s)}outputDefined(){return!1}static parse(s,u){const f=s[0],_=Me.definitions[f];if(!_)return u.error(`Unknown expression "${f}". If you wanted a literal array, use ["literal", [...]].`,0);const x=Array.isArray(_)?_[0]:_.type,C=Array.isArray(_)?[[_[1],_[2]]]:_.overloads,M=C.filter(([F])=>!Array.isArray(F)||F.length===s.length-1);let A=null;for(const[F,O]of M){A=new zl(u.registry,u.path,null,u.scope);const B=[];let H=!1;for(let q=1;q{return H=B,Array.isArray(H)?`(${H.map(zn).join(", ")})`:`(${zn(H.type)}...)`;var H}).join(" | "),O=[];for(let B=1;B=s[2]||l[1]<=s[1]||l[3]>=s[3])}function ft(l,s){const u=(180+l[0])/360,f=(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+l[1]*Math.PI/360)))/360,_=Math.pow(2,s.z);return[Math.round(u*_*Ie),Math.round(f*_*Ie)]}function xt(l,s,u){const f=l[0]-s[0],_=l[1]-s[1],x=l[0]-u[0],C=l[1]-u[1];return f*C-x*_==0&&f*x<=0&&_*C<=0}function ln(l,s){let u=!1;for(let C=0,M=s.length;C(f=l)[1]!=(x=A[F+1])[1]>f[1]&&f[0]<(x[0]-_[0])*(f[1]-_[1])/(x[1]-_[1])+_[0]&&(u=!u)}}var f,_,x;return u}function Gn(l,s){for(let u=0;u0&&M<0||C<0&&M>0}function an(l,s,u){for(const F of u)for(let O=0;Ou[2]){const _=.5*f;let x=l[0]-u[0]>_?-f:u[0]-l[0]>_?f:0;0===x&&(x=l[0]-u[2]>_?-f:u[2]-l[0]>_?f:0),l[0]+=x}Dt(s,l)}function kf(l,s,u,f){const _=Math.pow(2,f.z)*Ie,x=[f.x*Ie,f.y*Ie],C=[];for(const M of l)for(const A of M){const F=[A.x+x[0],A.y+x[1]];Ua(F,s,u,_),C.push(F)}return C}function Pf(l,s,u,f){const _=Math.pow(2,f.z)*Ie,x=[f.x*Ie,f.y*Ie],C=[];for(const A of l){const F=[];for(const O of A){const B=[O.x+x[0],O.y+x[1]];Dt(s,B),F.push(B)}C.push(F)}if(s[2]-s[0]<=_/2){(M=s)[0]=M[1]=1/0,M[2]=M[3]=-1/0;for(const A of C)for(const F of A)Ua(F,s,u,_)}var M;return C}class $a{constructor(s,u){this.type=jt,this.geojson=s,this.geometries=u}static parse(s,u){if(2!==s.length)return u.error(`'within' expression requires exactly one argument, but found ${s.length-1} instead.`);if(Bs(s[1])){const f=s[1];if("FeatureCollection"===f.type)for(let _=0;_{s&&!Fu(u)&&(s=!1)}),s}function ja(l){if(l instanceof Me&&"feature-state"===l.name)return!1;let s=!0;return l.eachChild(u=>{s&&!ja(u)&&(s=!1)}),s}function aa(l,s){if(l instanceof Me&&s.indexOf(l.name)>=0)return!1;let u=!0;return l.eachChild(f=>{u&&!aa(f,s)&&(u=!1)}),u}class Ou{constructor(s,u){this.type=u.type,this.name=s,this.boundExpression=u}static parse(s,u){if(2!==s.length||"string"!=typeof s[1])return u.error("'var' expression requires exactly one string literal argument.");const f=s[1];return u.scope.has(f)?new Ou(f,u.scope.get(f)):u.error(`Unknown variable "${f}". Make sure "${f}" has been bound in an enclosing "let" expression before using it.`,1)}evaluate(s){return this.boundExpression.evaluate(s)}eachChild(){}outputDefined(){return!1}}class Cr{constructor(s,u=[],f,_=new Ol,x=[]){this.registry=s,this.path=u,this.key=u.map(C=>`[${C}]`).join(""),this.scope=_,this.errors=x,this.expectedType=f}parse(s,u,f,_,x={}){return u?this.concat(u,f,_)._parse(s,x):this._parse(s,x)}_parse(s,u){function f(_,x,C){return"assert"===C?new ce(x,[_]):"coerce"===C?new he(x,[_]):_}if(null!==s&&"string"!=typeof s&&"boolean"!=typeof s&&"number"!=typeof s||(s=["literal",s]),Array.isArray(s)){if(0===s.length)return this.error('Expected an array with at least one element. If you wanted a literal array, use ["literal", []].');const _=s[0];if("string"!=typeof _)return this.error(`Expression name must be a string, but found ${typeof _} instead. If you wanted a literal array, use ["literal", [...]].`,0),null;const x=this.registry[_];if(x){let C=x.parse(s,this);if(!C)return null;if(this.expectedType){const M=this.expectedType,A=C.type;if("string"!==M.kind&&"number"!==M.kind&&"boolean"!==M.kind&&"object"!==M.kind&&"array"!==M.kind||"value"!==A.kind)if("color"!==M.kind&&"formatted"!==M.kind&&"resolvedImage"!==M.kind||"value"!==A.kind&&"string"!==A.kind)if("padding"!==M.kind||"value"!==A.kind&&"number"!==A.kind&&"array"!==A.kind){if(this.checkSubtype(M,A))return null}else C=f(C,M,u.typeAnnotation||"coerce");else C=f(C,M,u.typeAnnotation||"coerce");else C=f(C,M,u.typeAnnotation||"assert")}if(!(C instanceof $)&&"resolvedImage"!==C.type.kind&&Wh(C)){const M=new xe;try{C=new $(C.type,C.evaluate(M))}catch(A){return this.error(A.message),null}}return C}return this.error(`Unknown expression "${_}". If you wanted a literal array, use ["literal", [...]].`,0)}return this.error(void 0===s?"'undefined' value invalid. Use null instead.":"object"==typeof s?'Bare objects invalid. Use ["literal", {...}] instead.':`Expected an array, but found ${typeof s} instead.`)}concat(s,u,f){const _="number"==typeof s?this.path.concat(s):this.path,x=f?this.scope.concat(f):this.scope;return new Cr(this.registry,_,u||null,x,this.errors)}error(s,...u){const f=`${this.key}${u.map(_=>`[${_}]`).join("")}`;this.errors.push(new Bi(f,s))}checkSubtype(s,u){const f=so(s,u);return f&&this.error(f),f}}var zl=Cr;function Wh(l){if(l instanceof Ou)return Wh(l.boundExpression);if(l instanceof Me&&"error"===l.name||l instanceof je||l instanceof $a)return!1;const s=l instanceof he||l instanceof ce;let u=!0;return l.eachChild(f=>{u=s?u&&Wh(f):u&&f instanceof $}),!!u&&Fu(l)&&aa(l,["zoom","heatmap-density","line-progress","accumulated","is-supported-script"])}function Bl(l,s){const u=l.length-1;let f,_,x=0,C=u,M=0;for(;x<=C;)if(M=Math.floor((x+C)/2),f=l[M],_=l[M+1],f<=s){if(M===u||s<_)return M;x=M+1}else{if(!(f>s))throw new K("Input is not a number.");C=M-1}return 0}class Bn{constructor(s,u,f){this.type=s,this.input=u,this.labels=[],this.outputs=[];for(const[_,x]of f)this.labels.push(_),this.outputs.push(x)}static parse(s,u){if(s.length-1<4)return u.error(`Expected at least 4 arguments, but found only ${s.length-1}.`);if((s.length-1)%2!=0)return u.error("Expected an even number of arguments.");const f=u.parse(s[1],1,rt);if(!f)return null;const _=[];let x=null;u.expectedType&&"value"!==u.expectedType.kind&&(x=u.expectedType);for(let C=1;C=M)return u.error('Input/output pairs for "step" expressions must be arranged with input values in strictly ascending order.',F);const B=u.parse(A,O,x);if(!B)return null;x=x||B.type,_.push([M,B])}return new Bn(x,f,_)}evaluate(s){const u=this.labels,f=this.outputs;if(1===u.length)return f[0].evaluate(s);const _=this.input.evaluate(s);if(_<=u[0])return f[0].evaluate(s);const x=u.length;return _>=u[x-1]?f[x-1].evaluate(s):f[Bl(u,_)].evaluate(s)}eachChild(s){s(this.input);for(const u of this.outputs)s(u)}outputDefined(){return this.outputs.every(s=>s.outputDefined())}}function Xn(l,s,u){return l*(1-u)+s*u}var Mn=Object.freeze({__proto__:null,array:function(l,s,u){return l.map((f,_)=>Xn(f,s[_],u))},color:function(l,s,u){return new Sn(Xn(l.r,s.r,u),Xn(l.g,s.g,u),Xn(l.b,s.b,u),Xn(l.a,s.a,u))},number:Xn,padding:function(l,s,u){const f=l.values,_=s.values;return new Vr([Xn(f[0],_[0],u),Xn(f[1],_[1],u),Xn(f[2],_[2],u),Xn(f[3],_[3],u)])}});const Yn=4/29,Mt=6/29,Vl=3*Mt*Mt,Ff=Math.PI/180,nt=180/Math.PI;function wn(l){return l>.008856451679035631?Math.pow(l,1/3):l/Vl+Yn}function $t(l){return l>Mt?l*l*l:Vl*(l-Yn)}function yn(l){return 255*(l<=.0031308?12.92*l:1.055*Math.pow(l,1/2.4)-.055)}function Xh(l){return(l/=255)<=.04045?l/12.92:Math.pow((l+.055)/1.055,2.4)}function Of(l){const s=Xh(l.r),u=Xh(l.g),f=Xh(l.b),_=wn((.4124564*s+.3575761*u+.1804375*f)/.95047),x=wn((.2126729*s+.7151522*u+.072175*f)/1);return{l:116*x-16,a:500*(_-x),b:200*(x-wn((.0193339*s+.119192*u+.9503041*f)/1.08883)),alpha:l.a}}function Yh(l){let s=(l.l+16)/116,u=isNaN(l.a)?s:s+l.a/500,f=isNaN(l.b)?s:s-l.b/200;return s=1*$t(s),u=.95047*$t(u),f=1.08883*$t(f),new Sn(yn(3.2404542*u-1.5371385*s-.4985314*f),yn(-.969266*u+1.8760108*s+.041556*f),yn(.0556434*u-.2040259*s+1.0572252*f),l.alpha)}function Nu(l,s,u){const f=s-l;return l+u*(f>180||f<-180?f-360*Math.round(f/360):f)}const Wr={forward:Of,reverse:Yh,interpolate:function(l,s,u){return{l:Xn(l.l,s.l,u),a:Xn(l.a,s.a,u),b:Xn(l.b,s.b,u),alpha:Xn(l.alpha,s.alpha,u)}}},Lc={forward:function(l){const{l:s,a:u,b:f}=Of(l),_=Math.atan2(f,u)*nt;return{h:_<0?_+360:_,c:Math.sqrt(u*u+f*f),l:s,alpha:l.a}},reverse:function(l){const s=l.h*Ff,u=l.c;return Yh({l:l.l,a:Math.cos(s)*u,b:Math.sin(s)*u,alpha:l.alpha})},interpolate:function(l,s,u){return{h:Nu(l.h,s.h,u),c:Xn(l.c,s.c,u),l:Xn(l.l,s.l,u),alpha:Xn(l.alpha,s.alpha,u)}}};var Lf=Object.freeze({__proto__:null,hcl:Lc,lab:Wr});class Io{constructor(s,u,f,_,x){this.type=s,this.operator=u,this.interpolation=f,this.input=_,this.labels=[],this.outputs=[];for(const[C,M]of x)this.labels.push(C),this.outputs.push(M)}static interpolationFactor(s,u,f,_){let x=0;if("exponential"===s.name)x=Zo(u,s.base,f,_);else if("linear"===s.name)x=Zo(u,1,f,_);else if("cubic-bezier"===s.name){const C=s.controlPoints;x=new _r(C[0],C[1],C[2],C[3]).solve(Zo(u,1,f,_))}return x}static parse(s,u){let[f,_,x,...C]=s;if(!Array.isArray(_)||0===_.length)return u.error("Expected an interpolation type expression.",1);if("linear"===_[0])_={name:"linear"};else if("exponential"===_[0]){const F=_[1];if("number"!=typeof F)return u.error("Exponential interpolation requires a numeric base.",1,1);_={name:"exponential",base:F}}else{if("cubic-bezier"!==_[0])return u.error(`Unknown interpolation type ${String(_[0])}`,1,0);{const F=_.slice(1);if(4!==F.length||F.some(O=>"number"!=typeof O||O<0||O>1))return u.error("Cubic bezier interpolation requires four numeric arguments with values between 0 and 1.",1);_={name:"cubic-bezier",controlPoints:F}}}if(s.length-1<4)return u.error(`Expected at least 4 arguments, but found only ${s.length-1}.`);if((s.length-1)%2!=0)return u.error("Expected an even number of arguments.");if(x=u.parse(x,2,rt),!x)return null;const M=[];let A=null;"interpolate-hcl"===f||"interpolate-lab"===f?A=io:u.expectedType&&"value"!==u.expectedType.kind&&(A=u.expectedType);for(let F=0;F=O)return u.error('Input/output pairs for "interpolate" expressions must be arranged with input values in strictly ascending order.',H);const W=u.parse(B,q,A);if(!W)return null;A=A||W.type,M.push([O,W])}return"number"===A.kind||"color"===A.kind||"padding"===A.kind||"array"===A.kind&&"number"===A.itemType.kind&&"number"==typeof A.N?new Io(A,f,_,x,M):u.error(`Type ${zn(A)} is not interpolatable.`)}evaluate(s){const u=this.labels,f=this.outputs;if(1===u.length)return f[0].evaluate(s);const _=this.input.evaluate(s);if(_<=u[0])return f[0].evaluate(s);const x=u.length;if(_>=u[x-1])return f[x-1].evaluate(s);const C=Bl(u,_),M=Io.interpolationFactor(this.interpolation,_,u[C],u[C+1]),A=f[C].evaluate(s),F=f[C+1].evaluate(s);return"interpolate"===this.operator?Mn[this.type.kind.toLowerCase()](A,F,M):"interpolate-hcl"===this.operator?Lc.reverse(Lc.interpolate(Lc.forward(A),Lc.forward(F),M)):Wr.reverse(Wr.interpolate(Wr.forward(A),Wr.forward(F),M))}eachChild(s){s(this.input);for(const u of this.outputs)s(u)}outputDefined(){return this.outputs.every(s=>s.outputDefined())}}function Zo(l,s,u,f){const _=f-u,x=l-u;return 0===_?0:1===s?x/_:(Math.pow(s,x)-1)/(Math.pow(s,_)-1)}class Kh{constructor(s,u){this.type=s,this.args=u}static parse(s,u){if(s.length<2)return u.error("Expectected at least one argument.");let f=null;const _=u.expectedType;_&&"value"!==_.kind&&(f=_);const x=[];for(const M of s.slice(1)){const A=u.parse(M,1+x.length,f,void 0,{typeAnnotation:"omit"});if(!A)return null;f=f||A.type,x.push(A)}if(!f)throw new Error("No output type");const C=_&&x.some(M=>so(_,M.type));return new Kh(C?At:f,x)}evaluate(s){let u,f=null,_=0;for(const x of this.args)if(_++,f=x.evaluate(s),f&&f instanceof pi&&!f.available&&(u||(u=f.name),f=null,_===this.args.length&&(f=u)),null!==f)break;return f}eachChild(s){this.args.forEach(s)}outputDefined(){return this.args.every(s=>s.outputDefined())}}class zu{constructor(s,u){this.type=u.type,this.bindings=[].concat(s),this.result=u}evaluate(s){return this.result.evaluate(s)}eachChild(s){for(const u of this.bindings)s(u[1]);s(this.result)}static parse(s,u){if(s.length<4)return u.error(`Expected at least 3 arguments, but found ${s.length-1} instead.`);const f=[];for(let x=1;x=f.length)throw new K(`Array index out of bounds: ${u} > ${f.length-1}.`);if(u!==Math.floor(u))throw new K(`Array index must be an integer, but found ${u} instead.`);return f[u]}eachChild(s){s(this.index),s(this.input)}outputDefined(){return!1}}class Nf{constructor(s,u){this.type=jt,this.needle=s,this.haystack=u}static parse(s,u){if(3!==s.length)return u.error(`Expected 2 arguments, but found ${s.length-1} instead.`);const f=u.parse(s[1],1,At),_=u.parse(s[2],2,At);return f&&_?Ll(f.type,[jt,Jt,rt,fs,At])?new Nf(f,_):u.error(`Expected first argument to be of type boolean, string, number or null, but found ${zn(f.type)} instead`):null}evaluate(s){const u=this.needle.evaluate(s),f=this.haystack.evaluate(s);if(!f)return!1;if(!mn(u,["boolean","string","number","null"]))throw new K(`Expected first argument to be of type boolean, string, number or null, but found ${zn(J(u))} instead.`);if(!mn(f,["string","array"]))throw new K(`Expected second argument to be of type array or string, but found ${zn(J(f))} instead.`);return f.indexOf(u)>=0}eachChild(s){s(this.needle),s(this.haystack)}outputDefined(){return!0}}class Bu{constructor(s,u,f){this.type=rt,this.needle=s,this.haystack=u,this.fromIndex=f}static parse(s,u){if(s.length<=2||s.length>=5)return u.error(`Expected 3 or 4 arguments, but found ${s.length-1} instead.`);const f=u.parse(s[1],1,At),_=u.parse(s[2],2,At);if(!f||!_)return null;if(!Ll(f.type,[jt,Jt,rt,fs,At]))return u.error(`Expected first argument to be of type boolean, string, number or null, but found ${zn(f.type)} instead`);if(4===s.length){const x=u.parse(s[3],3,rt);return x?new Bu(f,_,x):null}return new Bu(f,_)}evaluate(s){const u=this.needle.evaluate(s),f=this.haystack.evaluate(s);if(!mn(u,["boolean","string","number","null"]))throw new K(`Expected first argument to be of type boolean, string, number or null, but found ${zn(J(u))} instead.`);if(!mn(f,["string","array"]))throw new K(`Expected second argument to be of type array or string, but found ${zn(J(f))} instead.`);if(this.fromIndex){const _=this.fromIndex.evaluate(s);return f.indexOf(u,_)}return f.indexOf(u)}eachChild(s){s(this.needle),s(this.haystack),this.fromIndex&&s(this.fromIndex)}outputDefined(){return!1}}class Vu{constructor(s,u,f,_,x,C){this.inputType=s,this.type=u,this.input=f,this.cases=_,this.outputs=x,this.otherwise=C}static parse(s,u){if(s.length<5)return u.error(`Expected at least 4 arguments, but found only ${s.length-1}.`);if(s.length%2!=1)return u.error("Expected an even number of arguments.");let f,_;u.expectedType&&"value"!==u.expectedType.kind&&(_=u.expectedType);const x={},C=[];for(let F=2;FNumber.MAX_SAFE_INTEGER)return H.error(`Branch labels must be integers no larger than ${Number.MAX_SAFE_INTEGER}.`);if("number"==typeof W&&Math.floor(W)!==W)return H.error("Numeric branch labels must be integer values.");if(f){if(H.checkSubtype(f,J(W)))return null}else f=J(W);if(void 0!==x[String(W)])return H.error("Branch labels must be unique.");x[String(W)]=C.length}const q=u.parse(B,F,_);if(!q)return null;_=_||q.type,C.push(q)}const M=u.parse(s[1],1,At);if(!M)return null;const A=u.parse(s[s.length-1],s.length-1,_);return A?"value"!==M.type.kind&&u.concat(1).checkSubtype(f,M.type)?null:new Vu(f,_,M,x,C,A):null}evaluate(s){const u=this.input.evaluate(s);return(J(u)===this.inputType&&this.outputs[this.cases[u]]||this.otherwise).evaluate(s)}eachChild(s){s(this.input),this.outputs.forEach(s),s(this.otherwise)}outputDefined(){return this.outputs.every(s=>s.outputDefined())&&this.otherwise.outputDefined()}}class Qh{constructor(s,u,f){this.type=s,this.branches=u,this.otherwise=f}static parse(s,u){if(s.length<4)return u.error(`Expected at least 3 arguments, but found only ${s.length-1}.`);if(s.length%2!=0)return u.error("Expected an odd number of arguments.");let f;u.expectedType&&"value"!==u.expectedType.kind&&(f=u.expectedType);const _=[];for(let C=1;Cu.outputDefined())&&this.otherwise.outputDefined()}}class ed{constructor(s,u,f,_){this.type=s,this.input=u,this.beginIndex=f,this.endIndex=_}static parse(s,u){if(s.length<=2||s.length>=5)return u.error(`Expected 3 or 4 arguments, but found ${s.length-1} instead.`);const f=u.parse(s[1],1,At),_=u.parse(s[2],2,rt);if(!f||!_)return null;if(!Ll(f.type,[Vi(At),Jt,At]))return u.error(`Expected first argument to be of type array or string, but found ${zn(f.type)} instead`);if(4===s.length){const x=u.parse(s[3],3,rt);return x?new ed(f.type,f,_,x):null}return new ed(f.type,f,_)}evaluate(s){const u=this.input.evaluate(s),f=this.beginIndex.evaluate(s);if(!mn(u,["string","array"]))throw new K(`Expected first argument to be of type array or string, but found ${zn(J(u))} instead.`);if(this.endIndex){const _=this.endIndex.evaluate(s);return u.slice(f,_)}return u.slice(f)}eachChild(s){s(this.input),s(this.beginIndex),this.endIndex&&s(this.endIndex)}outputDefined(){return!1}}function Ui(l,s){return"=="===l||"!="===l?"boolean"===s.kind||"string"===s.kind||"number"===s.kind||"null"===s.kind||"value"===s.kind:"string"===s.kind||"number"===s.kind||"value"===s.kind}function Rn(l,s,u,f){return 0===f.compare(s,u)}function Ul(l,s,u){const f="=="!==l&&"!="!==l;return class k6{constructor(x,C,M){this.type=jt,this.lhs=x,this.rhs=C,this.collator=M,this.hasUntypedArgument="value"===x.type.kind||"value"===C.type.kind}static parse(x,C){if(3!==x.length&&4!==x.length)return C.error("Expected two or three arguments.");const M=x[0];let A=C.parse(x[1],1,At);if(!A)return null;if(!Ui(M,A.type))return C.concat(1).error(`"${M}" comparisons are not supported for type '${zn(A.type)}'.`);let F=C.parse(x[2],2,At);if(!F)return null;if(!Ui(M,F.type))return C.concat(2).error(`"${M}" comparisons are not supported for type '${zn(F.type)}'.`);if(A.type.kind!==F.type.kind&&"value"!==A.type.kind&&"value"!==F.type.kind)return C.error(`Cannot compare types '${zn(A.type)}' and '${zn(F.type)}'.`);f&&("value"===A.type.kind&&"value"!==F.type.kind?A=new ce(F.type,[A]):"value"!==A.type.kind&&"value"===F.type.kind&&(F=new ce(A.type,[F])));let O=null;if(4===x.length){if("string"!==A.type.kind&&"string"!==F.type.kind&&"value"!==A.type.kind&&"value"!==F.type.kind)return C.error("Cannot use collator to compare non-string types.");if(O=C.parse(x[3],3,zs),!O)return null}return new k6(A,F,O)}evaluate(x){const C=this.lhs.evaluate(x),M=this.rhs.evaluate(x);if(f&&this.hasUntypedArgument){const A=J(C),F=J(M);if(A.kind!==F.kind||"string"!==A.kind&&"number"!==A.kind)throw new K(`Expected arguments for "${l}" to be (string, string) or (number, number), but found (${A.kind}, ${F.kind}) instead.`)}if(this.collator&&!f&&this.hasUntypedArgument){const A=J(C),F=J(M);if("string"!==A.kind||"string"!==F.kind)return s(x,C,M)}return this.collator?u(x,C,M,this.collator.evaluate(x)):s(x,C,M)}eachChild(x){x(this.lhs),x(this.rhs),this.collator&&x(this.collator)}outputDefined(){return!0}}}const I_=Ul("==",function(l,s,u){return s===u},Rn),T_=Ul("!=",function(l,s,u){return s!==u},function(l,s,u,f){return!Rn(0,s,u,f)}),Ot=Ul("<",function(l,s,u){return s",function(l,s,u){return s>u},function(l,s,u,f){return f.compare(s,u)>0}),Ei=Ul("<=",function(l,s,u){return s<=u},function(l,s,u,f){return f.compare(s,u)<=0}),Uu=Ul(">=",function(l,s,u){return s>=u},function(l,s,u,f){return f.compare(s,u)>=0});class td{constructor(s,u,f,_,x){this.type=Jt,this.number=s,this.locale=u,this.currency=f,this.minFractionDigits=_,this.maxFractionDigits=x}static parse(s,u){if(3!==s.length)return u.error("Expected two arguments.");const f=u.parse(s[1],1,rt);if(!f)return null;const _=s[2];if("object"!=typeof _||Array.isArray(_))return u.error("NumberFormat options argument must be an object.");let x=null;if(_.locale&&(x=u.parse(_.locale,1,Jt),!x))return null;let C=null;if(_.currency&&(C=u.parse(_.currency,1,Jt),!C))return null;let M=null;if(_["min-fraction-digits"]&&(M=u.parse(_["min-fraction-digits"],1,rt),!M))return null;let A=null;return _["max-fraction-digits"]&&(A=u.parse(_["max-fraction-digits"],1,rt),!A)?null:new td(f,x,C,M,A)}evaluate(s){return new Intl.NumberFormat(this.locale?this.locale.evaluate(s):[],{style:this.currency?"currency":"decimal",currency:this.currency?this.currency.evaluate(s):void 0,minimumFractionDigits:this.minFractionDigits?this.minFractionDigits.evaluate(s):void 0,maximumFractionDigits:this.maxFractionDigits?this.maxFractionDigits.evaluate(s):void 0}).format(this.number.evaluate(s))}eachChild(s){s(this.number),this.locale&&s(this.locale),this.currency&&s(this.currency),this.minFractionDigits&&s(this.minFractionDigits),this.maxFractionDigits&&s(this.maxFractionDigits)}outputDefined(){return!1}}class Nc{constructor(s){this.type=Ci,this.sections=s}static parse(s,u){if(s.length<2)return u.error("Expected at least one argument.");const f=s[1];if(!Array.isArray(f)&&"object"==typeof f)return u.error("First argument must be an image or text section.");const _=[];let x=!1;for(let C=1;C<=s.length-1;++C){const M=s[C];if(x&&"object"==typeof M&&!Array.isArray(M)){x=!1;let A=null;if(M["font-scale"]&&(A=u.parse(M["font-scale"],1,rt),!A))return null;let F=null;if(M["text-font"]&&(F=u.parse(M["text-font"],1,Vi(Jt)),!F))return null;let O=null;if(M["text-color"]&&(O=u.parse(M["text-color"],1,io),!O))return null;const B=_[_.length-1];B.scale=A,B.font=F,B.textColor=O}else{const A=u.parse(s[C],1,At);if(!A)return null;const F=A.type.kind;if("string"!==F&&"value"!==F&&"null"!==F&&"resolvedImage"!==F)return u.error("Formatted text type must be 'string', 'value', 'image' or 'null'.");x=!0,_.push({content:A,scale:null,font:null,textColor:null})}}return new Nc(_)}evaluate(s){return new Zr(this.sections.map(u=>{const f=u.content.evaluate(s);return J(f)===oo?new ao("",f,null,null,null):new ao(V(f),null,u.scale?u.scale.evaluate(s):null,u.font?u.font.evaluate(s).join(","):null,u.textColor?u.textColor.evaluate(s):null)}))}eachChild(s){for(const u of this.sections)s(u.content),u.scale&&s(u.scale),u.font&&s(u.font),u.textColor&&s(u.textColor)}outputDefined(){return!1}}class nd{constructor(s){this.type=oo,this.input=s}static parse(s,u){if(2!==s.length)return u.error("Expected two arguments.");const f=u.parse(s[1],1,Jt);return f?new nd(f):u.error("No image name provided.")}evaluate(s){const u=this.input.evaluate(s),f=pi.fromString(u);return f&&s.availableImages&&(f.available=s.availableImages.indexOf(u)>-1),f}eachChild(s){s(this.input)}outputDefined(){return!1}}class rd{constructor(s){this.type=rt,this.input=s}static parse(s,u){if(2!==s.length)return u.error(`Expected 1 argument, but found ${s.length-1} instead.`);const f=u.parse(s[1],1);return f?"array"!==f.type.kind&&"string"!==f.type.kind&&"value"!==f.type.kind?u.error(`Expected argument of type string or array, but found ${zn(f.type)} instead.`):new rd(f):null}evaluate(s){const u=this.input.evaluate(s);if("string"==typeof u||Array.isArray(u))return u.length;throw new K(`Expected value to be of type string or array, but found ${zn(J(u))} instead.`)}eachChild(s){s(this.input)}outputDefined(){return!1}}const Ha={"==":I_,"!=":T_,">":Vm,"<":Ot,">=":Uu,"<=":Ei,array:ce,at:Jh,boolean:ce,case:Qh,coalesce:Kh,collator:je,format:Nc,image:nd,in:Nf,"index-of":Bu,interpolate:Io,"interpolate-hcl":Io,"interpolate-lab":Io,length:rd,let:zu,literal:$,match:Vu,number:ce,"number-format":td,object:ce,slice:ed,step:Bn,string:ce,"to-boolean":he,"to-color":he,"to-number":he,"to-string":he,var:Ou,within:$a};function gn(l,[s,u,f,_]){s=s.evaluate(l),u=u.evaluate(l),f=f.evaluate(l);const x=_?_.evaluate(l):1,C=mi(s,u,f,x);if(C)throw new K(C);return new Sn(s/255*x,u/255*x,f/255*x,x)}function $u(l,s){return l in s}function ju(l,s){const u=s[l];return void 0===u?null:u}function Ga(l){return{type:l}}function Rt(l){return{result:"success",value:l}}function la(l){return{result:"error",value:l}}function $l(l){return"data-driven"===l["property-type"]||"cross-faded-data-driven"===l["property-type"]}function lo(l){return!!l.expression&&l.expression.parameters.indexOf("zoom")>-1}function Hu(l){return!!l.expression&&l.expression.interpolated}function Un(l){return l instanceof Number?"number":l instanceof String?"string":l instanceof Boolean?"boolean":Array.isArray(l)?"array":null===l?"null":typeof l}function Wo(l){return"object"==typeof l&&null!==l&&!Array.isArray(l)}function Xo(l){return l}function Um(l,s){const u="color"===s.type,f=l.stops&&"object"==typeof l.stops[0][0],_=f||!(f||void 0!==l.property),x=l.type||(Hu(s)?"exponential":"interval");if(u||"padding"===s.type){const F=u?Sn.parse:Vr.parse;(l=zi({},l)).stops&&(l.stops=l.stops.map(O=>[O[0],F(O[1])])),l.default=F(l.default?l.default:s.default)}if(l.colorSpace&&"rgb"!==l.colorSpace&&!Lf[l.colorSpace])throw new Error(`Unknown color space: ${l.colorSpace}`);let C,M,A;if("exponential"===x)C=$m;else if("interval"===x)C=er;else if("categorical"===x){C=ms,M=Object.create(null);for(const F of l.stops)M[F[0]]=F[1];A=typeof l.stops[0][0]}else{if("identity"!==x)throw new Error(`Unknown function type "${x}"`);C=A_}if(f){const F={},O=[];for(let q=0;qq[0]),evaluate:({zoom:q},W)=>$m({stops:B,base:l.base},s,q).evaluate(q,W)}}if(_){const F="exponential"===x?{name:"exponential",base:void 0!==l.base?l.base:1}:null;return{kind:"camera",interpolationType:F,interpolationFactor:Io.interpolationFactor.bind(void 0,F),zoomStops:l.stops.map(O=>O[0]),evaluate:({zoom:O})=>C(l,s,O,M,A)}}return{kind:"source",evaluate(F,O){const B=O&&O.properties?O.properties[l.property]:void 0;return void 0===B?Gu(l.default,s.default):C(l,s,B,M,A)}}}function Gu(l,s,u){return void 0!==l?l:void 0!==s?s:void 0!==u?u:void 0}function ms(l,s,u,f,_){return Gu(typeof u===_?f[u]:void 0,l.default,s.default)}function er(l,s,u){if("number"!==Un(u))return Gu(l.default,s.default);const f=l.stops.length;if(1===f||u<=l.stops[0][0])return l.stops[0][1];if(u>=l.stops[f-1][0])return l.stops[f-1][1];const _=Bl(l.stops.map(x=>x[0]),u);return l.stops[_][1]}function $m(l,s,u){const f=void 0!==l.base?l.base:1;if("number"!==Un(u))return Gu(l.default,s.default);const _=l.stops.length;if(1===_||u<=l.stops[0][0])return l.stops[0][1];if(u>=l.stops[_-1][0])return l.stops[_-1][1];const x=Bl(l.stops.map(O=>O[0]),u),C=function(O,B,H,q){const W=q-H,se=O-H;return 0===W?0:1===B?se/W:(Math.pow(B,se)-1)/(Math.pow(B,W)-1)}(u,f,l.stops[x][0],l.stops[x+1][0]),M=l.stops[x][1],A=l.stops[x+1][1];let F=Mn[s.type]||Xo;if(l.colorSpace&&"rgb"!==l.colorSpace){const O=Lf[l.colorSpace];F=(B,H)=>O.reverse(O.interpolate(O.forward(B),O.forward(H),C))}return"function"==typeof M.evaluate?{evaluate(...O){const B=M.evaluate.apply(void 0,O),H=A.evaluate.apply(void 0,O);if(void 0!==B&&void 0!==H)return F(B,H,C)}}:F(M,A,C)}function A_(l,s,u){switch(s.type){case"color":u=Sn.parse(u);break;case"formatted":u=Zr.fromString(u.toString());break;case"resolvedImage":u=pi.fromString(u.toString());break;case"padding":u=Vr.parse(u);break;default:Un(u)===s.type||"enum"===s.type&&s.values[u]||(u=void 0)}return Gu(u,l.default,s.default)}Me.register(Ha,{error:[{kind:"error"},[Jt],(l,[s])=>{throw new K(s.evaluate(l))}],typeof:[Jt,[At],(l,[s])=>zn(J(s.evaluate(l)))],"to-rgba":[Vi(rt,4),[io],(l,[s])=>s.evaluate(l).toArray()],rgb:[io,[rt,rt,rt],gn],rgba:[io,[rt,rt,rt,rt],gn],has:{type:jt,overloads:[[[Jt],(l,[s])=>$u(s.evaluate(l),l.properties())],[[Jt,ps],(l,[s,u])=>$u(s.evaluate(l),u.evaluate(l))]]},get:{type:At,overloads:[[[Jt],(l,[s])=>ju(s.evaluate(l),l.properties())],[[Jt,ps],(l,[s,u])=>ju(s.evaluate(l),u.evaluate(l))]]},"feature-state":[At,[Jt],(l,[s])=>ju(s.evaluate(l),l.featureState||{})],properties:[ps,[],l=>l.properties()],"geometry-type":[Jt,[],l=>l.geometryType()],id:[At,[],l=>l.id()],zoom:[rt,[],l=>l.globals.zoom],"heatmap-density":[rt,[],l=>l.globals.heatmapDensity||0],"line-progress":[rt,[],l=>l.globals.lineProgress||0],accumulated:[At,[],l=>void 0===l.globals.accumulated?null:l.globals.accumulated],"+":[rt,Ga(rt),(l,s)=>{let u=0;for(const f of s)u+=f.evaluate(l);return u}],"*":[rt,Ga(rt),(l,s)=>{let u=1;for(const f of s)u*=f.evaluate(l);return u}],"-":{type:rt,overloads:[[[rt,rt],(l,[s,u])=>s.evaluate(l)-u.evaluate(l)],[[rt],(l,[s])=>-s.evaluate(l)]]},"/":[rt,[rt,rt],(l,[s,u])=>s.evaluate(l)/u.evaluate(l)],"%":[rt,[rt,rt],(l,[s,u])=>s.evaluate(l)%u.evaluate(l)],ln2:[rt,[],()=>Math.LN2],pi:[rt,[],()=>Math.PI],e:[rt,[],()=>Math.E],"^":[rt,[rt,rt],(l,[s,u])=>Math.pow(s.evaluate(l),u.evaluate(l))],sqrt:[rt,[rt],(l,[s])=>Math.sqrt(s.evaluate(l))],log10:[rt,[rt],(l,[s])=>Math.log(s.evaluate(l))/Math.LN10],ln:[rt,[rt],(l,[s])=>Math.log(s.evaluate(l))],log2:[rt,[rt],(l,[s])=>Math.log(s.evaluate(l))/Math.LN2],sin:[rt,[rt],(l,[s])=>Math.sin(s.evaluate(l))],cos:[rt,[rt],(l,[s])=>Math.cos(s.evaluate(l))],tan:[rt,[rt],(l,[s])=>Math.tan(s.evaluate(l))],asin:[rt,[rt],(l,[s])=>Math.asin(s.evaluate(l))],acos:[rt,[rt],(l,[s])=>Math.acos(s.evaluate(l))],atan:[rt,[rt],(l,[s])=>Math.atan(s.evaluate(l))],min:[rt,Ga(rt),(l,s)=>Math.min(...s.map(u=>u.evaluate(l)))],max:[rt,Ga(rt),(l,s)=>Math.max(...s.map(u=>u.evaluate(l)))],abs:[rt,[rt],(l,[s])=>Math.abs(s.evaluate(l))],round:[rt,[rt],(l,[s])=>{const u=s.evaluate(l);return u<0?-Math.round(-u):Math.round(u)}],floor:[rt,[rt],(l,[s])=>Math.floor(s.evaluate(l))],ceil:[rt,[rt],(l,[s])=>Math.ceil(s.evaluate(l))],"filter-==":[jt,[Jt,At],(l,[s,u])=>l.properties()[s.value]===u.value],"filter-id-==":[jt,[At],(l,[s])=>l.id()===s.value],"filter-type-==":[jt,[Jt],(l,[s])=>l.geometryType()===s.value],"filter-<":[jt,[Jt,At],(l,[s,u])=>{const f=l.properties()[s.value],_=u.value;return typeof f==typeof _&&f<_}],"filter-id-<":[jt,[At],(l,[s])=>{const u=l.id(),f=s.value;return typeof u==typeof f&&u":[jt,[Jt,At],(l,[s,u])=>{const f=l.properties()[s.value],_=u.value;return typeof f==typeof _&&f>_}],"filter-id->":[jt,[At],(l,[s])=>{const u=l.id(),f=s.value;return typeof u==typeof f&&u>f}],"filter-<=":[jt,[Jt,At],(l,[s,u])=>{const f=l.properties()[s.value],_=u.value;return typeof f==typeof _&&f<=_}],"filter-id-<=":[jt,[At],(l,[s])=>{const u=l.id(),f=s.value;return typeof u==typeof f&&u<=f}],"filter->=":[jt,[Jt,At],(l,[s,u])=>{const f=l.properties()[s.value],_=u.value;return typeof f==typeof _&&f>=_}],"filter-id->=":[jt,[At],(l,[s])=>{const u=l.id(),f=s.value;return typeof u==typeof f&&u>=f}],"filter-has":[jt,[At],(l,[s])=>s.value in l.properties()],"filter-has-id":[jt,[],l=>null!==l.id()&&void 0!==l.id()],"filter-type-in":[jt,[Vi(Jt)],(l,[s])=>s.value.indexOf(l.geometryType())>=0],"filter-id-in":[jt,[Vi(At)],(l,[s])=>s.value.indexOf(l.id())>=0],"filter-in-small":[jt,[Jt,Vi(At)],(l,[s,u])=>u.value.indexOf(l.properties()[s.value])>=0],"filter-in-large":[jt,[Jt,Vi(At)],(l,[s,u])=>function(f,_,x,C){for(;x<=C;){const M=x+C>>1;if(_[M]===f)return!0;_[M]>f?C=M-1:x=M+1}return!1}(l.properties()[s.value],u.value,0,u.value.length-1)],all:{type:jt,overloads:[[[jt,jt],(l,[s,u])=>s.evaluate(l)&&u.evaluate(l)],[Ga(jt),(l,s)=>{for(const u of s)if(!u.evaluate(l))return!1;return!0}]]},any:{type:jt,overloads:[[[jt,jt],(l,[s,u])=>s.evaluate(l)||u.evaluate(l)],[Ga(jt),(l,s)=>{for(const u of s)if(u.evaluate(l))return!0;return!1}]]},"!":[jt,[jt],(l,[s])=>!s.evaluate(l)],"is-supported-script":[jt,[Jt],(l,[s])=>{const u=l.globals&&l.globals.isSupportedScript;return!u||u(s.evaluate(l))}],upcase:[Jt,[Jt],(l,[s])=>s.evaluate(l).toUpperCase()],downcase:[Jt,[Jt],(l,[s])=>s.evaluate(l).toLowerCase()],concat:[Jt,Ga(At),(l,s)=>s.map(u=>V(u.evaluate(l))).join("")],"resolved-locale":[Jt,[zs],(l,[s])=>s.evaluate(l).resolvedLocale()]});class ca{constructor(s,u){var f;this.expression=s,this._warningHistory={},this._evaluator=new xe,this._defaultValue=u?"color"===(f=u).type&&Wo(f.default)?new Sn(0,0,0,0):"color"===f.type?Sn.parse(f.default)||null:"padding"===f.type?Vr.parse(f.default)||null:void 0===f.default?null:f.default:null,this._enumValues=u&&"enum"===u.type?u.values:null}evaluateWithoutErrorHandling(s,u,f,_,x,C){return this._evaluator.globals=s,this._evaluator.feature=u,this._evaluator.featureState=f,this._evaluator.canonical=_,this._evaluator.availableImages=x||null,this._evaluator.formattedSection=C,this.expression.evaluate(this._evaluator)}evaluate(s,u,f,_,x,C){this._evaluator.globals=s,this._evaluator.feature=u||null,this._evaluator.featureState=f||null,this._evaluator.canonical=_,this._evaluator.availableImages=x||null,this._evaluator.formattedSection=C||null;try{const M=this.expression.evaluate(this._evaluator);if(null==M||"number"==typeof M&&M!=M)return this._defaultValue;if(this._enumValues&&!(M in this._enumValues))throw new K(`Expected value to be one of ${Object.keys(this._enumValues).map(A=>JSON.stringify(A)).join(", ")}, but found ${JSON.stringify(M)} instead.`);return M}catch(M){return this._warningHistory[M.message]||(this._warningHistory[M.message]=!0,typeof console<"u"&&console.warn(M.message)),this._defaultValue}}}function Cn(l){return Array.isArray(l)&&l.length>0&&"string"==typeof l[0]&&l[0]in Ha}function qa(l,s){const u=new zl(Ha,[],s?function(_){const x={color:io,string:Jt,number:rt,enum:Jt,boolean:jt,formatted:Ci,padding:ia,resolvedImage:oo};return"array"===_.type?Vi(x[_.value]||At,_.length):x[_.type]}(s):void 0),f=u.parse(l,void 0,void 0,void 0,s&&"string"===s.type?{typeAnnotation:"coerce"}:void 0);return f?Rt(new ca(f,s)):la(u.errors)}class zc{constructor(s,u){this.kind=s,this._styleExpression=u,this.isStateDependent="constant"!==s&&!ja(u.expression)}evaluateWithoutErrorHandling(s,u,f,_,x,C){return this._styleExpression.evaluateWithoutErrorHandling(s,u,f,_,x,C)}evaluate(s,u,f,_,x,C){return this._styleExpression.evaluate(s,u,f,_,x,C)}}class Bc{constructor(s,u,f,_){this.kind=s,this.zoomStops=f,this._styleExpression=u,this.isStateDependent="camera"!==s&&!ja(u.expression),this.interpolationType=_}evaluateWithoutErrorHandling(s,u,f,_,x,C){return this._styleExpression.evaluateWithoutErrorHandling(s,u,f,_,x,C)}evaluate(s,u,f,_,x,C){return this._styleExpression.evaluate(s,u,f,_,x,C)}interpolationFactor(s,u,f){return this.interpolationType?Io.interpolationFactor(this.interpolationType,s,u,f):0}}function id(l,s){const u=qa(l,s);if("error"===u.result)return u;const f=u.value.expression,_=Fu(f);if(!_&&!$l(s))return la([new Bi("","data expressions not supported")]);const x=aa(f,["zoom"]);if(!x&&!lo(s))return la([new Bi("","zoom expressions not supported")]);const C=ua(f);return C||x?C instanceof Bi?la([C]):C instanceof Io&&!Hu(s)?la([new Bi("",'"interpolate" expressions cannot be used with this property')]):Rt(C?new Bc(_?"camera":"composite",u.value,C.labels,C instanceof Io?C.interpolation:void 0):new zc(_?"constant":"source",u.value)):la([new Bi("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.')])}class To{constructor(s,u){this._parameters=s,this._specification=u,zi(this,Um(this._parameters,this._specification))}static deserialize(s){return new To(s._parameters,s._specification)}static serialize(s){return{_parameters:s._parameters,_specification:s._specification}}}function ua(l){let s=null;if(l instanceof zu)s=ua(l.result);else if(l instanceof Kh){for(const u of l.args)if(s=ua(u),s)break}else(l instanceof Bn||l instanceof Io)&&l.input instanceof Me&&"zoom"===l.input.name&&(s=l);return s instanceof Bi||l.eachChild(u=>{const f=ua(u);f instanceof Bi?s=f:!s&&f?s=new Bi("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.'):s&&f&&s!==f&&(s=new Bi("",'Only one zoom-based "step" or "interpolate" subexpression may be used in an expression.'))}),s}function Ao(l){const s=l.key,u=l.value,f=l.valueSpec||{},_=l.objectElementValidators||{},x=l.style,C=l.styleSpec,M=l.validateSpec;let A=[];const F=Un(u);if("object"!==F)return[new Pe(s,u,`object expected, ${F} found`)];for(const O in u){const B=O.split(".")[0],H=f[B]||f["*"];let q;if(_[B])q=_[B];else if(f[B])q=M;else if(_["*"])q=_["*"];else{if(!f["*"]){A.push(new Pe(s,u[O],`unknown property "${O}"`));continue}q=M}A=A.concat(q({key:(s&&`${s}.`)+O,value:u[O],valueSpec:H,style:x,styleSpec:C,object:u,objectKey:O,validateSpec:M},u))}for(const O in f)_[O]||f[O].required&&void 0===f[O].default&&void 0===u[O]&&A.push(new Pe(s,u,`missing required property "${O}"`));return A}function Vs(l){const s=l.value,u=l.valueSpec,f=l.style,_=l.styleSpec,x=l.key,C=l.arrayElementValidator||l.validateSpec;if("array"!==Un(s))return[new Pe(x,s,`array expected, ${Un(s)} found`)];if(u.length&&s.length!==u.length)return[new Pe(x,s,`array length ${u.length} expected, length ${s.length} found`)];if(u["min-length"]&&s.lengthf.maximum?[new Pe(s,u,`${u} is greater than the maximum value ${f.maximum}`)]:[]}function sd(l){const s=l.valueSpec,u=Vn(l.value.type);let f,_,x,C={};const M="categorical"!==u&&void 0===l.value.property,A=!M,F="array"===Un(l.value.stops)&&"array"===Un(l.value.stops[0])&&"object"===Un(l.value.stops[0][0]),O=Ao({key:l.key,value:l.value,valueSpec:l.styleSpec.function,validateSpec:l.validateSpec,style:l.style,styleSpec:l.styleSpec,objectElementValidators:{stops:function(q){if("identity"===u)return[new Pe(q.key,q.value,'identity function may not have a "stops" property')];let W=[];const se=q.value;return W=W.concat(Vs({key:q.key,value:se,valueSpec:q.valueSpec,validateSpec:q.validateSpec,style:q.style,styleSpec:q.styleSpec,arrayElementValidator:B})),"array"===Un(se)&&0===se.length&&W.push(new Pe(q.key,se,"array must have at least one stop")),W},default:function(q){return q.validateSpec({key:q.key,value:q.value,valueSpec:s,validateSpec:q.validateSpec,style:q.style,styleSpec:q.styleSpec})}}});return"identity"===u&&M&&O.push(new Pe(l.key,l.value,'missing required property "property"')),"identity"===u||l.value.stops||O.push(new Pe(l.key,l.value,'missing required property "stops"')),"exponential"===u&&l.valueSpec.expression&&!Hu(l.valueSpec)&&O.push(new Pe(l.key,l.value,"exponential functions not supported")),l.styleSpec.$version>=8&&(A&&!$l(l.valueSpec)?O.push(new Pe(l.key,l.value,"property functions not supported")):M&&!lo(l.valueSpec)&&O.push(new Pe(l.key,l.value,"zoom functions not supported"))),"categorical"!==u&&!F||void 0!==l.value.property||O.push(new Pe(l.key,l.value,'"property" property is required')),O;function B(q){let W=[];const se=q.value,oe=q.key;if("array"!==Un(se))return[new Pe(oe,se,`array expected, ${Un(se)} found`)];if(2!==se.length)return[new Pe(oe,se,`array length 2 expected, length ${se.length} found`)];if(F){if("object"!==Un(se[0]))return[new Pe(oe,se,`object expected, ${Un(se[0])} found`)];if(void 0===se[0].zoom)return[new Pe(oe,se,"object stop key must have zoom")];if(void 0===se[0].value)return[new Pe(oe,se,"object stop key must have value")];if(x&&x>Vn(se[0].zoom))return[new Pe(oe,se[0].zoom,"stop zoom values must appear in ascending order")];Vn(se[0].zoom)!==x&&(x=Vn(se[0].zoom),_=void 0,C={}),W=W.concat(Ao({key:`${oe}[0]`,value:se[0],valueSpec:{zoom:{}},validateSpec:q.validateSpec,style:q.style,styleSpec:q.styleSpec,objectElementValidators:{zoom:od,value:H}}))}else W=W.concat(H({key:`${oe}[0]`,value:se[0],valueSpec:{},validateSpec:q.validateSpec,style:q.style,styleSpec:q.styleSpec},se));return Cn(ds(se[1]))?W.concat([new Pe(`${oe}[1]`,se[1],"expressions are not allowed in function stops.")]):W.concat(q.validateSpec({key:`${oe}[1]`,value:se[1],valueSpec:s,validateSpec:q.validateSpec,style:q.style,styleSpec:q.styleSpec}))}function H(q,W){const se=Un(q.value),oe=Vn(q.value),be=null!==q.value?q.value:W;if(f){if(se!==f)return[new Pe(q.key,be,`${se} stop domain type must match previous stop domain type ${f}`)]}else f=se;if("number"!==se&&"string"!==se&&"boolean"!==se)return[new Pe(q.key,be,"stop domain value must be a number, string, or boolean")];if("number"!==se&&"categorical"!==u){let Ce=`number expected, ${se} found`;return $l(s)&&void 0===u&&(Ce+='\nIf you intended to use a categorical function, specify `"type": "categorical"`.'),[new Pe(q.key,be,Ce)]}return"categorical"!==u||"number"!==se||isFinite(oe)&&Math.floor(oe)===oe?"categorical"!==u&&"number"===se&&void 0!==_&&oe<_?[new Pe(q.key,be,"stop domain values must appear in ascending order")]:(_=oe,"categorical"===u&&oe in C?[new Pe(q.key,be,"stop domain values must be unique")]:(C[oe]=!0,[])):[new Pe(q.key,be,`integer expected, found ${oe}`)]}}function Za(l){const s=("property"===l.expressionContext?id:qa)(ds(l.value),l.valueSpec);if("error"===s.result)return s.value.map(f=>new Pe(`${l.key}${f.key}`,l.value,f.message));const u=s.value.expression||s.value._styleExpression.expression;if("property"===l.expressionContext&&"text-font"===l.propertyKey&&!u.outputDefined())return[new Pe(l.key,l.value,`Invalid data expression for "${l.propertyKey}". Output values must be contained as literals within the expression.`)];if("property"===l.expressionContext&&"layout"===l.propertyType&&!ja(u))return[new Pe(l.key,l.value,'"feature-state" data expressions are not supported with layout properties.')];if("filter"===l.expressionContext&&!ja(u))return[new Pe(l.key,l.value,'"feature-state" data expressions are not supported with filters.')];if(l.expressionContext&&0===l.expressionContext.indexOf("cluster")){if(!aa(u,["zoom","feature-state"]))return[new Pe(l.key,l.value,'"zoom" and "feature-state" expressions are not supported with cluster properties.')];if("cluster-initial"===l.expressionContext&&!Fu(u))return[new Pe(l.key,l.value,"Feature data expressions are not supported with initial expression part of cluster properties.")]}return[]}function ai(l){const s=l.key,u=l.value,f=l.valueSpec,_=[];return Array.isArray(f.values)?-1===f.values.indexOf(Vn(u))&&_.push(new Pe(s,u,`expected one of [${f.values.join(", ")}], ${JSON.stringify(u)} found`)):-1===Object.keys(f.values).indexOf(Vn(u))&&_.push(new Pe(s,u,`expected one of [${Object.keys(f.values).join(", ")}], ${JSON.stringify(u)} found`)),_}function qu(l){if(!0===l||!1===l)return!0;if(!Array.isArray(l)||0===l.length)return!1;switch(l[0]){case"has":return l.length>=2&&"$id"!==l[1]&&"$type"!==l[1];case"in":return l.length>=3&&("string"!=typeof l[1]||Array.isArray(l[2]));case"!in":case"!has":case"none":return!1;case"==":case"!=":case">":case">=":case"<":case"<=":return 3!==l.length||Array.isArray(l[1])||Array.isArray(l[2]);case"any":case"all":for(const s of l.slice(1))if(!qu(s)&&"boolean"!=typeof s)return!1;return!0;default:return!0}}const zf={type:"boolean",default:!1,transition:!1,"property-type":"data-driven",expression:{interpolated:!1,parameters:["zoom","feature"]}};function Lt(l){if(null==l)return{filter:()=>!0,needGeometry:!1};qu(l)||(l=Xr(l));const s=qa(l,zf);if("error"===s.result)throw new Error(s.value.map(u=>`${u.key}: ${u.message}`).join(", "));return{filter:(u,f,_)=>s.value.evaluate(u,f,{},_),needGeometry:Nt(l)}}function $i(l,s){return ls?1:0}function Nt(l){if(!Array.isArray(l))return!1;if("within"===l[0])return!0;for(let s=1;s"===s||"<="===s||">="===s?kt(l[1],l[2],s):"any"===s?(u=l.slice(1),["any"].concat(u.map(Xr))):"all"===s?["all"].concat(l.slice(1).map(Xr)):"none"===s?["all"].concat(l.slice(1).map(Xr).map(rn)):"in"===s?Us(l[1],l.slice(2)):"!in"===s?rn(Us(l[1],l.slice(2))):"has"===s?cn(l[1]):"!has"===s?rn(cn(l[1])):"within"!==s||l;var u}function kt(l,s,u){switch(l){case"$type":return[`filter-type-${u}`,s];case"$id":return[`filter-id-${u}`,s];default:return[`filter-${u}`,l,s]}}function Us(l,s){if(0===s.length)return!1;switch(l){case"$type":return["filter-type-in",["literal",s]];case"$id":return["filter-id-in",["literal",s]];default:return s.length>200&&!s.some(u=>typeof u!=typeof s[0])?["filter-in-large",l,["literal",s.sort($i)]]:["filter-in-small",l,["literal",s]]}}function cn(l){switch(l){case"$type":return!0;case"$id":return["filter-has-id"];default:return["filter-has",l]}}function rn(l){return["!",l]}function ut(l){return qu(ds(l.value))?Za(zi({},l,{expressionContext:"filter",valueSpec:{value:"boolean"}})):Wt(l)}function Wt(l){const s=l.value,u=l.key;if("array"!==Un(s))return[new Pe(u,s,`array expected, ${Un(s)} found`)];const f=l.styleSpec;let _,x=[];if(s.length<1)return[new Pe(u,s,"filter array must have at least 1 element")];switch(x=x.concat(ai({key:`${u}[0]`,value:s[0],valueSpec:f.filter_operator,style:l.style,styleSpec:l.styleSpec})),Vn(s[0])){case"<":case"<=":case">":case">=":s.length>=2&&"$type"===Vn(s[1])&&x.push(new Pe(u,s,`"$type" cannot be use with operator "${s[0]}"`));case"==":case"!=":3!==s.length&&x.push(new Pe(u,s,`filter array for operator "${s[0]}" must have 3 elements`));case"in":case"!in":s.length>=2&&(_=Un(s[1]),"string"!==_&&x.push(new Pe(`${u}[1]`,s[1],`string expected, ${_} found`)));for(let C=2;C{F in u&&s.push(new Pe(f,u[F],`"${F}" is prohibited for ref layers`))}),_.layers.forEach(F=>{Vn(F.id)===M&&(A=F)}),A?A.ref?s.push(new Pe(f,u.ref,"ref cannot reference another ref layer")):C=Vn(A.type):s.push(new Pe(f,u.ref,`ref layer "${M}" not found`))}else if("background"!==C)if(u.source){const A=_.sources&&_.sources[u.source],F=A&&Vn(A.type);A?"vector"===F&&"raster"===C?s.push(new Pe(f,u.source,`layer "${u.id}" requires a raster source`)):"raster"===F&&"raster"!==C?s.push(new Pe(f,u.source,`layer "${u.id}" requires a vector source`)):"vector"!==F||u["source-layer"]?"raster-dem"===F&&"hillshade"!==C?s.push(new Pe(f,u.source,"raster-dem source can only be used with layer type 'hillshade'.")):"line"!==C||!u.paint||!u.paint["line-gradient"]||"geojson"===F&&A.lineMetrics||s.push(new Pe(f,u,`layer "${u.id}" specifies a line-gradient, which requires a GeoJSON source with \`lineMetrics\` enabled.`)):s.push(new Pe(f,u,`layer "${u.id}" must specify a "source-layer"`)):s.push(new Pe(f,u.source,`source "${u.source}" not found`))}else s.push(new Pe(f,u,'missing required property "source"'));return s=s.concat(Ao({key:f,value:u,valueSpec:x.layer,style:l.style,styleSpec:l.styleSpec,validateSpec:l.validateSpec,objectElementValidators:{"*":()=>[],type:()=>l.validateSpec({key:`${f}.type`,value:u.type,valueSpec:x.layer.type,style:l.style,styleSpec:l.styleSpec,validateSpec:l.validateSpec,object:u,objectKey:"type"}),filter:ut,layout:A=>Ao({layer:u,key:A.key,value:A.value,style:A.style,styleSpec:A.styleSpec,validateSpec:A.validateSpec,objectElementValidators:{"*":F=>ha(zi({layerType:C},F))}}),paint:A=>Ao({layer:u,key:A.key,value:A.value,style:A.style,styleSpec:A.styleSpec,validateSpec:A.validateSpec,objectElementValidators:{"*":F=>ji(zi({layerType:C},F))}})}})),s}function Hi(l){const s=l.value,u=l.key,f=Un(s);return"string"!==f?[new Pe(u,s,`string expected, ${f} found`)]:[]}const gr={promoteId:function({key:l,value:s}){if("string"===Un(s))return Hi({key:l,value:s});{const u=[];for(const f in s)u.push(...Hi({key:`${l}.${f}`,value:s[f]}));return u}}};function Wa(l){const s=l.value,u=l.key,f=l.styleSpec,_=l.style,x=l.validateSpec;if(!s.type)return[new Pe(u,s,'"type" is required')];const C=Vn(s.type);let M;switch(C){case"vector":case"raster":case"raster-dem":return M=Ao({key:u,value:s,valueSpec:f[`source_${C.replace("-","_")}`],style:l.style,styleSpec:f,objectElementValidators:gr,validateSpec:x}),M;case"geojson":if(M=Ao({key:u,value:s,valueSpec:f.source_geojson,style:_,styleSpec:f,validateSpec:x,objectElementValidators:gr}),s.cluster)for(const A in s.clusterProperties){const[F,O]=s.clusterProperties[A],B="string"==typeof F?[F,["accumulated"],["get",A]]:F;M.push(...Za({key:`${u}.${A}.map`,value:O,validateSpec:x,expressionContext:"cluster-map"})),M.push(...Za({key:`${u}.${A}.reduce`,value:B,validateSpec:x,expressionContext:"cluster-reduce"}))}return M;case"video":return Ao({key:u,value:s,valueSpec:f.source_video,style:_,validateSpec:x,styleSpec:f});case"image":return Ao({key:u,value:s,valueSpec:f.source_image,style:_,validateSpec:x,styleSpec:f});case"canvas":return[new Pe(u,null,"Please use runtime APIs to add canvas sources, rather than including them in stylesheets.","source.canvas")];default:return ai({key:`${u}.type`,value:s.type,valueSpec:{values:["vector","raster","raster-dem","geojson","video","image"]},style:_,validateSpec:x,styleSpec:f})}}function Xa(l){const s=l.value,u=l.styleSpec,f=u.light,_=l.style;let x=[];const C=Un(s);if(void 0===s)return x;if("object"!==C)return x=x.concat([new Pe("light",s,`object expected, ${C} found`)]),x;for(const M in s){const A=M.match(/^(.*)-transition$/);x=x.concat(A&&f[A[1]]&&f[A[1]].transition?l.validateSpec({key:M,value:s[M],valueSpec:u.transition,validateSpec:l.validateSpec,style:_,styleSpec:u}):f[M]?l.validateSpec({key:M,value:s[M],valueSpec:f[M],validateSpec:l.validateSpec,style:_,styleSpec:u}):[new Pe(M,s[M],`unknown property "${M}"`)])}return x}function Xt(l){const s=l.value,u=l.styleSpec,f=u.terrain,_=l.style;let x=[];const C=Un(s);if(void 0===s)return x;if("object"!==C)return x=x.concat([new Pe("terrain",s,`object expected, ${C} found`)]),x;for(const M in s)x=x.concat(f[M]?l.validateSpec({key:M,value:s[M],valueSpec:f[M],validateSpec:l.validateSpec,style:_,styleSpec:u}):[new Pe(M,s[M],`unknown property "${M}"`)]);return x}function Vc(l){let s=[];const u=l.value,f=l.key;if(Array.isArray(u)){const _=[],x=[];for(const C in u)u[C].id&&_.includes(u[C].id)&&s.push(new Pe(f,u,`all the sprites' ids must be unique, but ${u[C].id} is duplicated`)),_.push(u[C].id),u[C].url&&x.includes(u[C].url)&&s.push(new Pe(f,u,`all the sprites' URLs must be unique, but ${u[C].url} is duplicated`)),x.push(u[C].url),s=s.concat(Ao({key:`${f}[${C}]`,value:u[C],valueSpec:{id:{type:"string",required:!0},url:{type:"string",required:!0}},validateSpec:l.validateSpec}));return s}return Hi({key:f,value:u})}const Ya={"*":()=>[],array:Vs,boolean:function(l){const s=l.value,u=l.key,f=Un(s);return"boolean"!==f?[new Pe(u,s,`boolean expected, ${f} found`)]:[]},number:od,color:function(l){const s=l.key,u=l.value,f=Un(u);return"string"!==f?[new Pe(s,u,`color expected, ${f} found`)]:null===oa(u)?[new Pe(s,u,`color expected, "${u}" found`)]:[]},constants:za,enum:ai,filter:ut,function:sd,layer:Ur,object:Ao,source:Wa,light:Xa,terrain:Xt,string:Hi,formatted:function(l){return 0===Hi(l).length?[]:Za(l)},resolvedImage:function(l){return 0===Hi(l).length?[]:Za(l)},padding:function(l){const s=l.key,u=l.value;if("array"===Un(u)){if(u.length<1||u.length>4)return[new Pe(s,u,`padding requires 1 to 4 values; ${u.length} values found`)];const f={type:"number"};let _=[];for(let x=0;x[]}})),l.constants&&(u=u.concat(za({key:"constants",value:l.constants,style:l,styleSpec:s,validateSpec:Ka}))),Ja(u)}function co(l){return function(s){return l({...s,validateSpec:Ka})}}function Ja(l){return[].concat(l).sort((s,u)=>s.line-u.line)}function $r(l){return function(...s){return Ja(l.apply(this,s))}}lr.source=$r(co(Wa)),lr.sprite=$r(co(Vc)),lr.glyphs=$r(co(da)),lr.light=$r(co(Xa)),lr.terrain=$r(co(Xt)),lr.layer=$r(co(Ur)),lr.filter=$r(co(ut)),lr.paintProperty=$r(co(ji)),lr.layoutProperty=$r(co(ha));const Yo=lr,ad=Yo.light,$n=Yo.paintProperty,jm=Yo.layoutProperty;function ld(l,s){let u=!1;if(s&&s.length)for(const f of s)l.fire(new mr(new Error(f.message))),u=!0;return u}class $s{constructor(s,u,f){const _=this.cells=[];if(s instanceof ArrayBuffer){this.arrayBuffer=s;const C=new Int32Array(this.arrayBuffer);s=C[0],this.d=(u=C[1])+2*(f=C[2]);for(let A=0;A=B[W+0]&&_>=B[W+1])?(M[q]=!0,C.push(O[q])):M[q]=!1}}}}_forEachCell(s,u,f,_,x,C,M,A){const F=this._convertToCellCoord(s),O=this._convertToCellCoord(u),B=this._convertToCellCoord(f),H=this._convertToCellCoord(_);for(let q=F;q<=B;q++)for(let W=O;W<=H;W++){const se=this.d*W+q;if((!A||A(this._convertFromCellCoord(q),this._convertFromCellCoord(W),this._convertFromCellCoord(q+1),this._convertFromCellCoord(W+1)))&&x.call(this,s,u,f,_,se,C,M,A))return}}_convertFromCellCoord(s){return(s-this.padding)/this.scale}_convertToCellCoord(s){return Math.max(0,Math.min(this.d-1,Math.floor(s*this.scale)+this.padding))}toArrayBuffer(){if(this.arrayBuffer)return this.arrayBuffer;const s=this.cells,u=3+this.cells.length+1+1;let f=0;for(let C=0;C=0)continue;const C=l[x];_[x]=gs[f].shallow.indexOf(x)>=0?C:uo(C,s)}l instanceof Error&&(_.message=l.message)}if(_.$name)throw new Error("$name property is reserved for worker serialization logic.");return"Object"!==f&&(_.$name=f),_}throw new Error("can't serialize object of type "+typeof l)}function Er(l){if(null==l||"boolean"==typeof l||"number"==typeof l||"string"==typeof l||l instanceof Boolean||l instanceof Number||l instanceof String||l instanceof Date||l instanceof RegExp||l instanceof Blob||fa(l)||ro(l)||ArrayBuffer.isView(l)||l instanceof ImageData)return l;if(Array.isArray(l))return l.map(Er);if("object"==typeof l){const s=l.$name||"Object";if(!gs[s])throw new Error(`can't deserialize unregistered class ${s}`);const{klass:u}=gs[s];if(!u)throw new Error(`can't deserialize unregistered class ${s}`);if(u.deserialize)return u.deserialize(l);const f=Object.create(u.prototype);for(const _ of Object.keys(l)){if("$name"===_)continue;const x=l[_];f[_]=gs[s].shallow.indexOf(_)>=0?x:Er(x)}return f}throw new Error("can't deserialize object of type "+typeof l)}class Bf{constructor(){this.first=!0}update(s,u){const f=Math.floor(s);return this.first?(this.first=!1,this.lastIntegerZoom=f,this.lastIntegerZoomTime=0,this.lastZoom=s,this.lastFloorZoom=f,!0):(this.lastFloorZoom>f?(this.lastIntegerZoom=f+1,this.lastIntegerZoomTime=u):this.lastFloorZooml>=128&&l<=255,Arabic:l=>l>=1536&&l<=1791,"Arabic Supplement":l=>l>=1872&&l<=1919,"Arabic Extended-A":l=>l>=2208&&l<=2303,"Hangul Jamo":l=>l>=4352&&l<=4607,"Unified Canadian Aboriginal Syllabics":l=>l>=5120&&l<=5759,Khmer:l=>l>=6016&&l<=6143,"Unified Canadian Aboriginal Syllabics Extended":l=>l>=6320&&l<=6399,"General Punctuation":l=>l>=8192&&l<=8303,"Letterlike Symbols":l=>l>=8448&&l<=8527,"Number Forms":l=>l>=8528&&l<=8591,"Miscellaneous Technical":l=>l>=8960&&l<=9215,"Control Pictures":l=>l>=9216&&l<=9279,"Optical Character Recognition":l=>l>=9280&&l<=9311,"Enclosed Alphanumerics":l=>l>=9312&&l<=9471,"Geometric Shapes":l=>l>=9632&&l<=9727,"Miscellaneous Symbols":l=>l>=9728&&l<=9983,"Miscellaneous Symbols and Arrows":l=>l>=11008&&l<=11263,"CJK Radicals Supplement":l=>l>=11904&&l<=12031,"Kangxi Radicals":l=>l>=12032&&l<=12255,"Ideographic Description Characters":l=>l>=12272&&l<=12287,"CJK Symbols and Punctuation":l=>l>=12288&&l<=12351,Hiragana:l=>l>=12352&&l<=12447,Katakana:l=>l>=12448&&l<=12543,Bopomofo:l=>l>=12544&&l<=12591,"Hangul Compatibility Jamo":l=>l>=12592&&l<=12687,Kanbun:l=>l>=12688&&l<=12703,"Bopomofo Extended":l=>l>=12704&&l<=12735,"CJK Strokes":l=>l>=12736&&l<=12783,"Katakana Phonetic Extensions":l=>l>=12784&&l<=12799,"Enclosed CJK Letters and Months":l=>l>=12800&&l<=13055,"CJK Compatibility":l=>l>=13056&&l<=13311,"CJK Unified Ideographs Extension A":l=>l>=13312&&l<=19903,"Yijing Hexagram Symbols":l=>l>=19904&&l<=19967,"CJK Unified Ideographs":l=>l>=19968&&l<=40959,"Yi Syllables":l=>l>=40960&&l<=42127,"Yi Radicals":l=>l>=42128&&l<=42191,"Hangul Jamo Extended-A":l=>l>=43360&&l<=43391,"Hangul Syllables":l=>l>=44032&&l<=55215,"Hangul Jamo Extended-B":l=>l>=55216&&l<=55295,"Private Use Area":l=>l>=57344&&l<=63743,"CJK Compatibility Ideographs":l=>l>=63744&&l<=64255,"Arabic Presentation Forms-A":l=>l>=64336&&l<=65023,"Vertical Forms":l=>l>=65040&&l<=65055,"CJK Compatibility Forms":l=>l>=65072&&l<=65103,"Small Form Variants":l=>l>=65104&&l<=65135,"Arabic Presentation Forms-B":l=>l>=65136&&l<=65279,"Halfwidth and Fullwidth Forms":l=>l>=65280&&l<=65519};function ho(l){for(const s of l)if(jl(s.charCodeAt(0)))return!0;return!1}function cd(l){for(const s of l)if(!Zu(s.charCodeAt(0)))return!1;return!0}function Zu(l){return!(Xe.Arabic(l)||Xe["Arabic Supplement"](l)||Xe["Arabic Extended-A"](l)||Xe["Arabic Presentation Forms-A"](l)||Xe["Arabic Presentation Forms-B"](l))}function jl(l){return!(746!==l&&747!==l&&(l<4352||!(Xe["Bopomofo Extended"](l)||Xe.Bopomofo(l)||Xe["CJK Compatibility Forms"](l)&&!(l>=65097&&l<=65103)||Xe["CJK Compatibility Ideographs"](l)||Xe["CJK Compatibility"](l)||Xe["CJK Radicals Supplement"](l)||Xe["CJK Strokes"](l)||!(!Xe["CJK Symbols and Punctuation"](l)||l>=12296&&l<=12305||l>=12308&&l<=12319||12336===l)||Xe["CJK Unified Ideographs Extension A"](l)||Xe["CJK Unified Ideographs"](l)||Xe["Enclosed CJK Letters and Months"](l)||Xe["Hangul Compatibility Jamo"](l)||Xe["Hangul Jamo Extended-A"](l)||Xe["Hangul Jamo Extended-B"](l)||Xe["Hangul Jamo"](l)||Xe["Hangul Syllables"](l)||Xe.Hiragana(l)||Xe["Ideographic Description Characters"](l)||Xe.Kanbun(l)||Xe["Kangxi Radicals"](l)||Xe["Katakana Phonetic Extensions"](l)||Xe.Katakana(l)&&12540!==l||!(!Xe["Halfwidth and Fullwidth Forms"](l)||65288===l||65289===l||65293===l||l>=65306&&l<=65310||65339===l||65341===l||65343===l||l>=65371&&l<=65503||65507===l||l>=65512&&l<=65519)||!(!Xe["Small Form Variants"](l)||l>=65112&&l<=65118||l>=65123&&l<=65126)||Xe["Unified Canadian Aboriginal Syllabics"](l)||Xe["Unified Canadian Aboriginal Syllabics Extended"](l)||Xe["Vertical Forms"](l)||Xe["Yijing Hexagram Symbols"](l)||Xe["Yi Syllables"](l)||Xe["Yi Radicals"](l))))}function ko(l){return!(jl(l)||(s=l,Xe["Latin-1 Supplement"](s)&&(167===s||169===s||174===s||177===s||188===s||189===s||190===s||215===s||247===s)||Xe["General Punctuation"](s)&&(8214===s||8224===s||8225===s||8240===s||8241===s||8251===s||8252===s||8258===s||8263===s||8264===s||8265===s||8273===s)||Xe["Letterlike Symbols"](s)||Xe["Number Forms"](s)||Xe["Miscellaneous Technical"](s)&&(s>=8960&&s<=8967||s>=8972&&s<=8991||s>=8996&&s<=9e3||9003===s||s>=9085&&s<=9114||s>=9150&&s<=9165||9167===s||s>=9169&&s<=9179||s>=9186&&s<=9215)||Xe["Control Pictures"](s)&&9251!==s||Xe["Optical Character Recognition"](s)||Xe["Enclosed Alphanumerics"](s)||Xe["Geometric Shapes"](s)||Xe["Miscellaneous Symbols"](s)&&!(s>=9754&&s<=9759)||Xe["Miscellaneous Symbols and Arrows"](s)&&(s>=11026&&s<=11055||s>=11088&&s<=11097||s>=11192&&s<=11243)||Xe["CJK Symbols and Punctuation"](s)||Xe.Katakana(s)||Xe["Private Use Area"](s)||Xe["CJK Compatibility Forms"](s)||Xe["Small Form Variants"](s)||Xe["Halfwidth and Fullwidth Forms"](s)||8734===s||8756===s||8757===s||s>=9984&&s<=10087||s>=10102&&s<=10131||65532===s||65533===s));var s}function Uc(l){return l>=1424&&l<=2303||Xe["Arabic Presentation Forms-A"](l)||Xe["Arabic Presentation Forms-B"](l)}function ud(l,s){return!(!s&&Uc(l)||l>=2304&&l<=3583||l>=3840&&l<=4255||Xe.Khmer(l))}function Po(l){for(const s of l)if(Uc(s.charCodeAt(0)))return!0;return!1}const Hl="deferred",Vf="loading",Uf="loaded";let $f=null,fo="unavailable",js=null;const Hm=function(l){l&&"string"==typeof l&&l.indexOf("NetworkError")>-1&&(fo="error"),$f&&$f(l)};function Wu(){jf.fire(new ra("pluginStateChange",{pluginStatus:fo,pluginURL:js}))}const jf=new Qn,Gl=function(){return fo},Gm=function(){if(fo!==Hl||!js)throw new Error("rtl-text-plugin cannot be downloaded unless a pluginURL is specified");fo=Vf,Wu(),js&&La({url:js},l=>{l?Hm(l):(fo=Uf,Wu())})},po={applyArabicShaping:null,processBidirectionalText:null,processStyledBidirectionalText:null,isLoaded:()=>fo===Uf||null!=po.applyArabicShaping,isLoading:()=>fo===Vf,setState(l){if(!Mo())throw new Error("Cannot set the state of the rtl-text-plugin when not in the web-worker context");fo=l.pluginStatus,js=l.pluginURL},isParsed(){if(!Mo())throw new Error("rtl-text-plugin is only parsed on the worker-threads");return null!=po.applyArabicShaping&&null!=po.processBidirectionalText&&null!=po.processStyledBidirectionalText},getPluginURL(){if(!Mo())throw new Error("rtl-text-plugin url can only be queried from the worker threads");return js}};class cr{constructor(s,u){this.zoom=s,u?(this.now=u.now,this.fadeDuration=u.fadeDuration,this.zoomHistory=u.zoomHistory,this.transition=u.transition):(this.now=0,this.fadeDuration=0,this.zoomHistory=new Bf,this.transition={})}isSupportedScript(s){return function(u,f){for(const _ of u)if(!ud(_.charCodeAt(0),f))return!1;return!0}(s,po.isLoaded())}crossFadingFactor(){return 0===this.fadeDuration?1:Math.min((this.now-this.zoomHistory.lastIntegerZoomTime)/this.fadeDuration,1)}getCrossfadeParameters(){const s=this.zoom,u=s-Math.floor(s),f=this.crossFadingFactor();return s>this.zoomHistory.lastIntegerZoom?{fromScale:2,toScale:1,t:u+(1-u)*f}:{fromScale:.5,toScale:1,t:1-(1-f)*u}}}class $c{constructor(s,u){this.property=s,this.value=u,this.expression=function(f,_){if(Wo(f))return new To(f,_);if(Cn(f)){const x=id(f,_);if("error"===x.result)throw new Error(x.value.map(C=>`${C.key}: ${C.message}`).join(", "));return x.value}{let x=f;return"color"===_.type&&"string"==typeof f?x=Sn.parse(f):"padding"!==_.type||"number"!=typeof f&&!Array.isArray(f)||(x=Vr.parse(f)),{kind:"constant",evaluate:()=>x}}}(void 0===u?s.specification.default:u,s.specification)}isDataDriven(){return"source"===this.expression.kind||"composite"===this.expression.kind}possiblyEvaluate(s,u,f){return this.property.possiblyEvaluate(this,s,u,f)}}class hd{constructor(s){this.property=s,this.value=new $c(s,void 0)}transitioned(s,u){return new Yu(this.property,this.value,u,Ni({},s.transition,this.transition),s.now)}untransitioned(){return new Yu(this.property,this.value,null,{},0)}}class Xu{constructor(s){this._properties=s,this._values=Object.create(s.defaultTransitionablePropertyValues)}getValue(s){return wi(this._values[s].value.value)}setValue(s,u){Object.prototype.hasOwnProperty.call(this._values,s)||(this._values[s]=new hd(this._values[s].property)),this._values[s].value=new $c(this._values[s].property,null===u?void 0:wi(u))}getTransition(s){return wi(this._values[s].transition)}setTransition(s,u){Object.prototype.hasOwnProperty.call(this._values,s)||(this._values[s]=new hd(this._values[s].property)),this._values[s].transition=wi(u)||void 0}serialize(){const s={};for(const u of Object.keys(this._values)){const f=this.getValue(u);void 0!==f&&(s[u]=f);const _=this.getTransition(u);void 0!==_&&(s[`${u}-transition`]=_)}return s}transitioned(s,u){const f=new dd(this._properties);for(const _ of Object.keys(this._values))f._values[_]=this._values[_].transitioned(s,u._values[_]);return f}untransitioned(){const s=new dd(this._properties);for(const u of Object.keys(this._values))s._values[u]=this._values[u].untransitioned();return s}}class Yu{constructor(s,u,f,_,x){this.property=s,this.value=u,this.begin=x+_.delay||0,this.end=this.begin+_.duration||0,s.specification.transition&&(_.delay||_.duration)&&(this.prior=f)}possiblyEvaluate(s,u,f){const _=s.now||0,x=this.value.possiblyEvaluate(s,u,f),C=this.prior;if(C){if(_>this.end)return this.prior=null,x;if(this.value.isDataDriven())return this.prior=null,x;if(_=1)return 1;const F=A*A,O=F*A;return 4*(A<.5?O:3*(A-F)+O-.75)}(M))}}return x}}class dd{constructor(s){this._properties=s,this._values=Object.create(s.defaultTransitioningPropertyValues)}possiblyEvaluate(s,u,f){const _=new _s(this._properties);for(const x of Object.keys(this._values))_._values[x]=this._values[x].possiblyEvaluate(s,u,f);return _}hasTransition(){for(const s of Object.keys(this._values))if(this._values[s].prior)return!0;return!1}}class fd{constructor(s){this._properties=s,this._values=Object.create(s.defaultPropertyValues)}getValue(s){return wi(this._values[s].value)}setValue(s,u){this._values[s]=new $c(this._values[s].property,null===u?void 0:wi(u))}serialize(){const s={};for(const u of Object.keys(this._values)){const f=this.getValue(u);void 0!==f&&(s[u]=f)}return s}possiblyEvaluate(s,u,f){const _=new _s(this._properties);for(const x of Object.keys(this._values))_._values[x]=this._values[x].possiblyEvaluate(s,u,f);return _}}class ys{constructor(s,u,f){this.property=s,this.value=u,this.parameters=f}isConstant(){return"constant"===this.value.kind}constantOr(s){return"constant"===this.value.kind?this.value.value:s}evaluate(s,u,f,_){return this.property.evaluate(this.value,this.parameters,s,u,f,_)}}class _s{constructor(s){this._properties=s,this._values=Object.create(s.defaultPossiblyEvaluatedValues)}get(s){return this._values[s]}}class wt{constructor(s){this.specification=s}possiblyEvaluate(s,u){if(s.isDataDriven())throw new Error("Value should not be data driven");return s.expression.evaluate(u)}interpolate(s,u,f){const _=Mn[this.specification.type];return _?_(s,u,f):s}}class yt{constructor(s,u){this.specification=s,this.overrides=u}possiblyEvaluate(s,u,f,_){return new ys(this,"constant"===s.expression.kind||"camera"===s.expression.kind?{kind:"constant",value:s.expression.evaluate(u,null,{},f,_)}:s.expression,u)}interpolate(s,u,f){if("constant"!==s.value.kind||"constant"!==u.value.kind)return s;if(void 0===s.value.value||void 0===u.value.value)return new ys(this,{kind:"constant",value:void 0},s.parameters);const _=Mn[this.specification.type];return _?new ys(this,{kind:"constant",value:_(s.value.value,u.value.value,f)},s.parameters):s}evaluate(s,u,f,_,x,C){return"constant"===s.kind?s.value:s.evaluate(u,f,_,x,C)}}class Qa extends yt{possiblyEvaluate(s,u,f,_){if(void 0===s.value)return new ys(this,{kind:"constant",value:void 0},u);if("constant"===s.expression.kind){const x=s.expression.evaluate(u,null,{},f,_),C="resolvedImage"===s.property.specification.type&&"string"!=typeof x?x.name:x,M=this._calculate(C,C,C,u);return new ys(this,{kind:"constant",value:M},u)}if("camera"===s.expression.kind){const x=this._calculate(s.expression.evaluate({zoom:u.zoom-1}),s.expression.evaluate({zoom:u.zoom}),s.expression.evaluate({zoom:u.zoom+1}),u);return new ys(this,{kind:"constant",value:x},u)}return new ys(this,s.expression,u)}evaluate(s,u,f,_,x,C){if("source"===s.kind){const M=s.evaluate(u,f,_,x,C);return this._calculate(M,M,M,u)}return"composite"===s.kind?this._calculate(s.evaluate({zoom:Math.floor(u.zoom)-1},f,_),s.evaluate({zoom:Math.floor(u.zoom)},f,_),s.evaluate({zoom:Math.floor(u.zoom)+1},f,_),u):s.value}_calculate(s,u,f,_){return _.zoom>_.zoomHistory.lastIntegerZoom?{from:s,to:u}:{from:f,to:u}}interpolate(s){return s}}class pd{constructor(s){this.specification=s}possiblyEvaluate(s,u,f,_){if(void 0!==s.value){if("constant"===s.expression.kind){const x=s.expression.evaluate(u,null,{},f,_);return this._calculate(x,x,x,u)}return this._calculate(s.expression.evaluate(new cr(Math.floor(u.zoom-1),u)),s.expression.evaluate(new cr(Math.floor(u.zoom),u)),s.expression.evaluate(new cr(Math.floor(u.zoom+1),u)),u)}}_calculate(s,u,f,_){return _.zoom>_.zoomHistory.lastIntegerZoom?{from:s,to:u}:{from:f,to:u}}interpolate(s){return s}}class md{constructor(s){this.specification=s}possiblyEvaluate(s,u,f,_){return!!s.expression.evaluate(u,null,{},f,_)}interpolate(){return!1}}class Di{constructor(s){this.properties=s,this.defaultPropertyValues={},this.defaultTransitionablePropertyValues={},this.defaultTransitioningPropertyValues={},this.defaultPossiblyEvaluatedValues={},this.overridableProperties=[];for(const u in s){const f=s[u];f.specification.overridable&&this.overridableProperties.push(u);const _=this.defaultPropertyValues[u]=new $c(f,void 0),x=this.defaultTransitionablePropertyValues[u]=new hd(f);this.defaultTransitioningPropertyValues[u]=x.untransitioned(),this.defaultPossiblyEvaluatedValues[u]=_.possiblyEvaluate({})}}}ct("DataDrivenProperty",yt),ct("DataConstantProperty",wt),ct("CrossFadedDataDrivenProperty",Qa),ct("CrossFadedProperty",pd),ct("ColorRampProperty",md);const jc="-transition";class Ko extends Qn{constructor(s,u){if(super(),this.id=s.id,this.type=s.type,this._featureFilter={filter:()=>!0,needGeometry:!1},"custom"!==s.type&&(this.metadata=s.metadata,this.minzoom=s.minzoom,this.maxzoom=s.maxzoom,"background"!==s.type&&(this.source=s.source,this.sourceLayer=s["source-layer"],this.filter=s.filter),u.layout&&(this._unevaluatedLayout=new fd(u.layout)),u.paint)){this._transitionablePaint=new Xu(u.paint);for(const f in s.paint)this.setPaintProperty(f,s.paint[f],{validate:!1});for(const f in s.layout)this.setLayoutProperty(f,s.layout[f],{validate:!1});this._transitioningPaint=this._transitionablePaint.untransitioned(),this.paint=new _s(u.paint)}}getCrossfadeParameters(){return this._crossfadeParameters}getLayoutProperty(s){return"visibility"===s?this.visibility:this._unevaluatedLayout.getValue(s)}setLayoutProperty(s,u,f={}){null!=u&&this._validate(jm,`layers.${this.id}.layout.${s}`,s,u,f)||("visibility"!==s?this._unevaluatedLayout.setValue(s,u):this.visibility=u)}getPaintProperty(s){return s.endsWith(jc)?this._transitionablePaint.getTransition(s.slice(0,-jc.length)):this._transitionablePaint.getValue(s)}setPaintProperty(s,u,f={}){if(null!=u&&this._validate($n,`layers.${this.id}.paint.${s}`,s,u,f))return!1;if(s.endsWith(jc))return this._transitionablePaint.setTransition(s.slice(0,-jc.length),u||void 0),!1;{const _=this._transitionablePaint._values[s],x="cross-faded-data-driven"===_.property.specification["property-type"],C=_.value.isDataDriven(),M=_.value;this._transitionablePaint.setValue(s,u),this._handleSpecialPaintPropertyUpdate(s);const A=this._transitionablePaint._values[s].value;return A.isDataDriven()||C||x||this._handleOverridablePaintPropertyUpdate(s,M,A)}}_handleSpecialPaintPropertyUpdate(s){}_handleOverridablePaintPropertyUpdate(s,u,f){return!1}isHidden(s){return!!(this.minzoom&&s=this.maxzoom)||"none"===this.visibility}updateTransitions(s){this._transitioningPaint=this._transitionablePaint.transitioned(s,this._transitioningPaint)}hasTransition(){return this._transitioningPaint.hasTransition()}recalculate(s,u){s.getCrossfadeParameters&&(this._crossfadeParameters=s.getCrossfadeParameters()),this._unevaluatedLayout&&(this.layout=this._unevaluatedLayout.possiblyEvaluate(s,void 0,u)),this.paint=this._transitioningPaint.possiblyEvaluate(s,void 0,u)}serialize(){const s={id:this.id,type:this.type,source:this.source,"source-layer":this.sourceLayer,metadata:this.metadata,minzoom:this.minzoom,maxzoom:this.maxzoom,filter:this.filter,layout:this._unevaluatedLayout&&this._unevaluatedLayout.serialize(),paint:this._transitionablePaint&&this._transitionablePaint.serialize()};return this.visibility&&(s.layout=s.layout||{},s.layout.visibility=this.visibility),Rl(s,(u,f)=>!(void 0===u||"layout"===f&&!Object.keys(u).length||"paint"===f&&!Object.keys(u).length))}_validate(s,u,f,_,x={}){return(!x||!1!==x.validate)&&ld(this,s.call(Yo,{key:u,layerType:this.type,objectKey:f,value:_,styleSpec:Ae,style:{glyphs:!0,sprite:!0}}))}is3D(){return!1}isTileClipped(){return!1}hasOffscreenPass(){return!1}resize(){}isStateDependent(){for(const s in this.paint._values){const u=this.paint.get(s);if(u instanceof ys&&$l(u.property.specification)&&("source"===u.value.kind||"composite"===u.value.kind)&&u.value.isStateDependent)return!0}return!1}}const gd={Int8:Int8Array,Uint8:Uint8Array,Int16:Int16Array,Uint16:Uint16Array,Int32:Int32Array,Uint32:Uint32Array,Float32:Float32Array};class Ku{constructor(s,u){this._structArray=s,this._pos1=u*this.size,this._pos2=this._pos1/2,this._pos4=this._pos1/4,this._pos8=this._pos1/8}}class In{constructor(){this.isTransferred=!1,this.capacity=-1,this.resize(0)}static serialize(s,u){return s._trim(),u&&(s.isTransferred=!0,u.push(s.arrayBuffer)),{length:s.length,arrayBuffer:s.arrayBuffer}}static deserialize(s){const u=Object.create(this.prototype);return u.arrayBuffer=s.arrayBuffer,u.length=s.length,u.capacity=s.arrayBuffer.byteLength/u.bytesPerElement,u._refreshViews(),u}_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(s){this.reserve(s),this.length=s}reserve(s){if(s>this.capacity){this.capacity=Math.max(s,Math.floor(5*this.capacity),128),this.arrayBuffer=new ArrayBuffer(this.capacity*this.bytesPerElement);const u=this.uint8;this._refreshViews(),u&&this.uint8.set(u)}}_refreshViews(){throw new Error("_refreshViews() must be implemented by each concrete StructArray layout")}}function Dr(l,s=1){let u=0,f=0;return{members:l.map(_=>{const x=gd[_.type].BYTES_PER_ELEMENT,C=u=Hf(u,Math.max(s,x)),M=_.components||1;return f=Math.max(f,x),u+=x*M,{name:_.name,type:_.type,components:M,offset:C}}),size:Hf(u,Math.max(f,s)),alignment:s}}function Hf(l,s){return Math.ceil(l/s)*s}class el extends In{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(s,u){const f=this.length;return this.resize(f+1),this.emplace(f,s,u)}emplace(s,u,f){const _=2*s;return this.int16[_+0]=u,this.int16[_+1]=f,s}}el.prototype.bytesPerElement=4,ct("StructArrayLayout2i4",el);class Ju extends In{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(s,u,f){const _=this.length;return this.resize(_+1),this.emplace(_,s,u,f)}emplace(s,u,f,_){const x=3*s;return this.int16[x+0]=u,this.int16[x+1]=f,this.int16[x+2]=_,s}}Ju.prototype.bytesPerElement=6,ct("StructArrayLayout3i6",Ju);class Hc extends In{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(s,u,f,_){const x=this.length;return this.resize(x+1),this.emplace(x,s,u,f,_)}emplace(s,u,f,_,x){const C=4*s;return this.int16[C+0]=u,this.int16[C+1]=f,this.int16[C+2]=_,this.int16[C+3]=x,s}}Hc.prototype.bytesPerElement=8,ct("StructArrayLayout4i8",Hc);class Sr extends In{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(s,u,f,_,x,C){const M=this.length;return this.resize(M+1),this.emplace(M,s,u,f,_,x,C)}emplace(s,u,f,_,x,C,M){const A=6*s;return this.int16[A+0]=u,this.int16[A+1]=f,this.int16[A+2]=_,this.int16[A+3]=x,this.int16[A+4]=C,this.int16[A+5]=M,s}}Sr.prototype.bytesPerElement=12,ct("StructArrayLayout2i4i12",Sr);class Gc extends In{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(s,u,f,_,x,C){const M=this.length;return this.resize(M+1),this.emplace(M,s,u,f,_,x,C)}emplace(s,u,f,_,x,C,M){const A=4*s,F=8*s;return this.int16[A+0]=u,this.int16[A+1]=f,this.uint8[F+4]=_,this.uint8[F+5]=x,this.uint8[F+6]=C,this.uint8[F+7]=M,s}}Gc.prototype.bytesPerElement=8,ct("StructArrayLayout2i4ub8",Gc);class Qu extends In{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(s,u){const f=this.length;return this.resize(f+1),this.emplace(f,s,u)}emplace(s,u,f){const _=2*s;return this.float32[_+0]=u,this.float32[_+1]=f,s}}Qu.prototype.bytesPerElement=8,ct("StructArrayLayout2f8",Qu);class ql extends In{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(s,u,f,_,x,C,M,A,F,O){const B=this.length;return this.resize(B+1),this.emplace(B,s,u,f,_,x,C,M,A,F,O)}emplace(s,u,f,_,x,C,M,A,F,O,B){const H=10*s;return this.uint16[H+0]=u,this.uint16[H+1]=f,this.uint16[H+2]=_,this.uint16[H+3]=x,this.uint16[H+4]=C,this.uint16[H+5]=M,this.uint16[H+6]=A,this.uint16[H+7]=F,this.uint16[H+8]=O,this.uint16[H+9]=B,s}}ql.prototype.bytesPerElement=20,ct("StructArrayLayout10ui20",ql);class Si extends In{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(s,u,f,_,x,C,M,A,F,O,B,H){const q=this.length;return this.resize(q+1),this.emplace(q,s,u,f,_,x,C,M,A,F,O,B,H)}emplace(s,u,f,_,x,C,M,A,F,O,B,H,q){const W=12*s;return this.int16[W+0]=u,this.int16[W+1]=f,this.int16[W+2]=_,this.int16[W+3]=x,this.uint16[W+4]=C,this.uint16[W+5]=M,this.uint16[W+6]=A,this.uint16[W+7]=F,this.int16[W+8]=O,this.int16[W+9]=B,this.int16[W+10]=H,this.int16[W+11]=q,s}}Si.prototype.bytesPerElement=24,ct("StructArrayLayout4i4ui4i24",Si);class eh extends In{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(s,u,f){const _=this.length;return this.resize(_+1),this.emplace(_,s,u,f)}emplace(s,u,f,_){const x=3*s;return this.float32[x+0]=u,this.float32[x+1]=f,this.float32[x+2]=_,s}}eh.prototype.bytesPerElement=12,ct("StructArrayLayout3f12",eh);class Zl extends In{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer)}emplaceBack(s){const u=this.length;return this.resize(u+1),this.emplace(u,s)}emplace(s,u){return this.uint32[1*s+0]=u,s}}Zl.prototype.bytesPerElement=4,ct("StructArrayLayout1ul4",Zl);class pa extends In{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(s,u,f,_,x,C,M,A,F){const O=this.length;return this.resize(O+1),this.emplace(O,s,u,f,_,x,C,M,A,F)}emplace(s,u,f,_,x,C,M,A,F,O){const B=10*s,H=5*s;return this.int16[B+0]=u,this.int16[B+1]=f,this.int16[B+2]=_,this.int16[B+3]=x,this.int16[B+4]=C,this.int16[B+5]=M,this.uint32[H+3]=A,this.uint16[B+8]=F,this.uint16[B+9]=O,s}}pa.prototype.bytesPerElement=20,ct("StructArrayLayout6i1ul2ui20",pa);class Mi extends In{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(s,u,f,_,x,C){const M=this.length;return this.resize(M+1),this.emplace(M,s,u,f,_,x,C)}emplace(s,u,f,_,x,C,M){const A=6*s;return this.int16[A+0]=u,this.int16[A+1]=f,this.int16[A+2]=_,this.int16[A+3]=x,this.int16[A+4]=C,this.int16[A+5]=M,s}}Mi.prototype.bytesPerElement=12,ct("StructArrayLayout2i2i2i12",Mi);class yd extends In{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(s,u,f,_,x){const C=this.length;return this.resize(C+1),this.emplace(C,s,u,f,_,x)}emplace(s,u,f,_,x,C){const M=4*s,A=8*s;return this.float32[M+0]=u,this.float32[M+1]=f,this.float32[M+2]=_,this.int16[A+6]=x,this.int16[A+7]=C,s}}yd.prototype.bytesPerElement=16,ct("StructArrayLayout2f1f2i16",yd);class Wl extends In{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(s,u,f,_){const x=this.length;return this.resize(x+1),this.emplace(x,s,u,f,_)}emplace(s,u,f,_,x){const C=12*s,M=3*s;return this.uint8[C+0]=u,this.uint8[C+1]=f,this.float32[M+1]=_,this.float32[M+2]=x,s}}Wl.prototype.bytesPerElement=12,ct("StructArrayLayout2ub2f12",Wl);class th extends In{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(s,u,f){const _=this.length;return this.resize(_+1),this.emplace(_,s,u,f)}emplace(s,u,f,_){const x=3*s;return this.uint16[x+0]=u,this.uint16[x+1]=f,this.uint16[x+2]=_,s}}th.prototype.bytesPerElement=6,ct("StructArrayLayout3ui6",th);class vs extends In{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(s,u,f,_,x,C,M,A,F,O,B,H,q,W,se,oe,be){const Ce=this.length;return this.resize(Ce+1),this.emplace(Ce,s,u,f,_,x,C,M,A,F,O,B,H,q,W,se,oe,be)}emplace(s,u,f,_,x,C,M,A,F,O,B,H,q,W,se,oe,be,Ce){const me=24*s,Ee=12*s,$e=48*s;return this.int16[me+0]=u,this.int16[me+1]=f,this.uint16[me+2]=_,this.uint16[me+3]=x,this.uint32[Ee+2]=C,this.uint32[Ee+3]=M,this.uint32[Ee+4]=A,this.uint16[me+10]=F,this.uint16[me+11]=O,this.uint16[me+12]=B,this.float32[Ee+7]=H,this.float32[Ee+8]=q,this.uint8[$e+36]=W,this.uint8[$e+37]=se,this.uint8[$e+38]=oe,this.uint32[Ee+10]=be,this.int16[me+22]=Ce,s}}vs.prototype.bytesPerElement=48,ct("StructArrayLayout2i2ui3ul3ui2f3ub1ul1i48",vs);class Hs extends In{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(s,u,f,_,x,C,M,A,F,O,B,H,q,W,se,oe,be,Ce,me,Ee,$e,Ve,gt,Ct,at,tt,Qe,ot){const it=this.length;return this.resize(it+1),this.emplace(it,s,u,f,_,x,C,M,A,F,O,B,H,q,W,se,oe,be,Ce,me,Ee,$e,Ve,gt,Ct,at,tt,Qe,ot)}emplace(s,u,f,_,x,C,M,A,F,O,B,H,q,W,se,oe,be,Ce,me,Ee,$e,Ve,gt,Ct,at,tt,Qe,ot,it){const Ge=34*s,Et=17*s;return this.int16[Ge+0]=u,this.int16[Ge+1]=f,this.int16[Ge+2]=_,this.int16[Ge+3]=x,this.int16[Ge+4]=C,this.int16[Ge+5]=M,this.int16[Ge+6]=A,this.int16[Ge+7]=F,this.uint16[Ge+8]=O,this.uint16[Ge+9]=B,this.uint16[Ge+10]=H,this.uint16[Ge+11]=q,this.uint16[Ge+12]=W,this.uint16[Ge+13]=se,this.uint16[Ge+14]=oe,this.uint16[Ge+15]=be,this.uint16[Ge+16]=Ce,this.uint16[Ge+17]=me,this.uint16[Ge+18]=Ee,this.uint16[Ge+19]=$e,this.uint16[Ge+20]=Ve,this.uint16[Ge+21]=gt,this.uint16[Ge+22]=Ct,this.uint32[Et+12]=at,this.float32[Et+13]=tt,this.float32[Et+14]=Qe,this.float32[Et+15]=ot,this.float32[Et+16]=it,s}}Hs.prototype.bytesPerElement=68,ct("StructArrayLayout8i15ui1ul4f68",Hs);class Xl extends In{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(s){const u=this.length;return this.resize(u+1),this.emplace(u,s)}emplace(s,u){return this.float32[1*s+0]=u,s}}Xl.prototype.bytesPerElement=4,ct("StructArrayLayout1f4",Xl);class Vt extends In{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(s,u,f){const _=this.length;return this.resize(_+1),this.emplace(_,s,u,f)}emplace(s,u,f,_){const x=4*s;return this.uint32[2*s+0]=u,this.uint16[x+2]=f,this.uint16[x+3]=_,s}}Vt.prototype.bytesPerElement=8,ct("StructArrayLayout1ul2ui8",Vt);class nh extends In{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(s,u){const f=this.length;return this.resize(f+1),this.emplace(f,s,u)}emplace(s,u,f){const _=2*s;return this.uint16[_+0]=u,this.uint16[_+1]=f,s}}nh.prototype.bytesPerElement=4,ct("StructArrayLayout2ui4",nh);class _d extends In{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(s){const u=this.length;return this.resize(u+1),this.emplace(u,s)}emplace(s,u){return this.uint16[1*s+0]=u,s}}_d.prototype.bytesPerElement=2,ct("StructArrayLayout1ui2",_d);class vd extends In{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(s,u,f,_){const x=this.length;return this.resize(x+1),this.emplace(x,s,u,f,_)}emplace(s,u,f,_,x){const C=4*s;return this.float32[C+0]=u,this.float32[C+1]=f,this.float32[C+2]=_,this.float32[C+3]=x,s}}vd.prototype.bytesPerElement=16,ct("StructArrayLayout4f16",vd);class Gf extends Ku{get anchorPointX(){return this._structArray.int16[this._pos2+0]}get anchorPointY(){return this._structArray.int16[this._pos2+1]}get x1(){return this._structArray.int16[this._pos2+2]}get y1(){return this._structArray.int16[this._pos2+3]}get x2(){return this._structArray.int16[this._pos2+4]}get y2(){return this._structArray.int16[this._pos2+5]}get featureIndex(){return this._structArray.uint32[this._pos4+3]}get sourceLayerIndex(){return this._structArray.uint16[this._pos2+8]}get bucketIndex(){return this._structArray.uint16[this._pos2+9]}get anchorPoint(){return new Tt(this.anchorPointX,this.anchorPointY)}}Gf.prototype.size=20;class bd extends pa{get(s){return new Gf(this,s)}}ct("CollisionBoxArray",bd);class qc extends Ku{get anchorX(){return this._structArray.int16[this._pos2+0]}get anchorY(){return this._structArray.int16[this._pos2+1]}get glyphStartIndex(){return this._structArray.uint16[this._pos2+2]}get numGlyphs(){return this._structArray.uint16[this._pos2+3]}get vertexStartIndex(){return this._structArray.uint32[this._pos4+2]}get lineStartIndex(){return this._structArray.uint32[this._pos4+3]}get lineLength(){return this._structArray.uint32[this._pos4+4]}get segment(){return this._structArray.uint16[this._pos2+10]}get lowerSize(){return this._structArray.uint16[this._pos2+11]}get upperSize(){return this._structArray.uint16[this._pos2+12]}get lineOffsetX(){return this._structArray.float32[this._pos4+7]}get lineOffsetY(){return this._structArray.float32[this._pos4+8]}get writingMode(){return this._structArray.uint8[this._pos1+36]}get placedOrientation(){return this._structArray.uint8[this._pos1+37]}set placedOrientation(s){this._structArray.uint8[this._pos1+37]=s}get hidden(){return this._structArray.uint8[this._pos1+38]}set hidden(s){this._structArray.uint8[this._pos1+38]=s}get crossTileID(){return this._structArray.uint32[this._pos4+10]}set crossTileID(s){this._structArray.uint32[this._pos4+10]=s}get associatedIconIndex(){return this._structArray.int16[this._pos2+22]}}qc.prototype.size=48;class xd extends vs{get(s){return new qc(this,s)}}ct("PlacedSymbolArray",xd);class rh extends Ku{get anchorX(){return this._structArray.int16[this._pos2+0]}get anchorY(){return this._structArray.int16[this._pos2+1]}get rightJustifiedTextSymbolIndex(){return this._structArray.int16[this._pos2+2]}get centerJustifiedTextSymbolIndex(){return this._structArray.int16[this._pos2+3]}get leftJustifiedTextSymbolIndex(){return this._structArray.int16[this._pos2+4]}get verticalPlacedTextSymbolIndex(){return this._structArray.int16[this._pos2+5]}get placedIconSymbolIndex(){return this._structArray.int16[this._pos2+6]}get verticalPlacedIconSymbolIndex(){return this._structArray.int16[this._pos2+7]}get key(){return this._structArray.uint16[this._pos2+8]}get textBoxStartIndex(){return this._structArray.uint16[this._pos2+9]}get textBoxEndIndex(){return this._structArray.uint16[this._pos2+10]}get verticalTextBoxStartIndex(){return this._structArray.uint16[this._pos2+11]}get verticalTextBoxEndIndex(){return this._structArray.uint16[this._pos2+12]}get iconBoxStartIndex(){return this._structArray.uint16[this._pos2+13]}get iconBoxEndIndex(){return this._structArray.uint16[this._pos2+14]}get verticalIconBoxStartIndex(){return this._structArray.uint16[this._pos2+15]}get verticalIconBoxEndIndex(){return this._structArray.uint16[this._pos2+16]}get featureIndex(){return this._structArray.uint16[this._pos2+17]}get numHorizontalGlyphVertices(){return this._structArray.uint16[this._pos2+18]}get numVerticalGlyphVertices(){return this._structArray.uint16[this._pos2+19]}get numIconVertices(){return this._structArray.uint16[this._pos2+20]}get numVerticalIconVertices(){return this._structArray.uint16[this._pos2+21]}get useRuntimeCollisionCircles(){return this._structArray.uint16[this._pos2+22]}get crossTileID(){return this._structArray.uint32[this._pos4+12]}set crossTileID(s){this._structArray.uint32[this._pos4+12]=s}get textBoxScale(){return this._structArray.float32[this._pos4+13]}get textOffset0(){return this._structArray.float32[this._pos4+14]}get textOffset1(){return this._structArray.float32[this._pos4+15]}get collisionCircleDiameter(){return this._structArray.float32[this._pos4+16]}}rh.prototype.size=68;class He extends Hs{get(s){return new rh(this,s)}}ct("SymbolInstanceArray",He);class en extends Xl{getoffsetX(s){return this.float32[1*s+0]}}ct("GlyphOffsetArray",en);class ma extends Ju{getx(s){return this.int16[3*s+0]}gety(s){return this.int16[3*s+1]}gettileUnitDistanceFromAnchor(s){return this.int16[3*s+2]}}ct("SymbolLineVertexArray",ma);class Gs extends Ku{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]}}Gs.prototype.size=8;class Pr extends Vt{get(s){return new Gs(this,s)}}ct("FeatureIndexArray",Pr);class ih extends el{}class qs extends el{}class bs extends el{}class wd extends Sr{}class oh extends Gc{}class k_ extends Qu{}class ga extends ql{}class g extends Si{}class a extends eh{}class h extends Zl{}class m extends Mi{}class y extends Wl{}class w extends th{}class S extends nh{}const T=Dr([{name:"a_pos",components:2,type:"Int16"}],4),{members:k}=T;class R{constructor(s=[]){this.segments=s}prepareSegment(s,u,f,_){let x=this.segments[this.segments.length-1];return s>R.MAX_VERTEX_ARRAY_LENGTH&&pn(`Max vertices per segment is ${R.MAX_VERTEX_ARRAY_LENGTH}: bucket requested ${s}`),(!x||x.vertexLength+s>R.MAX_VERTEX_ARRAY_LENGTH||x.sortKey!==_)&&(x={vertexOffset:u.length,primitiveOffset:f.length,vertexLength:0,primitiveLength:0},void 0!==_&&(x.sortKey=_),this.segments.push(x)),x}get(){return this.segments}destroy(){for(const s of this.segments)for(const u in s.vaos)s.vaos[u].destroy()}static simpleSegment(s,u,f,_){return new R([{vertexOffset:s,primitiveOffset:u,vertexLength:f,primitiveLength:_,vaos:{},sortKey:0}])}}function z(l,s){return 256*(l=Zt(Math.floor(l),0,255))+Zt(Math.floor(s),0,255)}R.MAX_VERTEX_ARRAY_LENGTH=Math.pow(2,16)-1,ct("SegmentVector",R);const L=Dr([{name:"a_pattern_from",components:4,type:"Uint16"},{name:"a_pattern_to",components:4,type:"Uint16"},{name:"a_pixel_ratio_from",components:1,type:"Uint16"},{name:"a_pixel_ratio_to",components:1,type:"Uint16"}]);var j={},Q={get exports(){return j},set exports(l){j=l}},ee={};({get exports(){return ee},set exports(l){ee=l}}).exports=function(l,s){var u,f,_,x,C,M,A,F;for(f=l.length-(u=3&l.length),_=s,C=3432918353,M=461845907,F=0;F>>16)*C&65535)<<16)&4294967295)<<15|A>>>17))*M+(((A>>>16)*M&65535)<<16)&4294967295)<<13|_>>>19))+((5*(_>>>16)&65535)<<16)&4294967295))+((58964+(x>>>16)&65535)<<16);switch(A=0,u){case 3:A^=(255&l.charCodeAt(F+2))<<16;case 2:A^=(255&l.charCodeAt(F+1))<<8;case 1:_^=A=(65535&(A=(A=(65535&(A^=255&l.charCodeAt(F)))*C+(((A>>>16)*C&65535)<<16)&4294967295)<<15|A>>>17))*M+(((A>>>16)*M&65535)<<16)&4294967295}return _^=l.length,_=2246822507*(65535&(_^=_>>>16))+((2246822507*(_>>>16)&65535)<<16)&4294967295,_=3266489909*(65535&(_^=_>>>13))+((3266489909*(_>>>16)&65535)<<16)&4294967295,(_^=_>>>16)>>>0};var Y={};({get exports(){return Y},set exports(l){Y=l}}).exports=function(l,s){for(var u,f=l.length,_=s^f,x=0;f>=4;)u=1540483477*(65535&(u=255&l.charCodeAt(x)|(255&l.charCodeAt(++x))<<8|(255&l.charCodeAt(++x))<<16|(255&l.charCodeAt(++x))<<24))+((1540483477*(u>>>16)&65535)<<16),_=1540483477*(65535&_)+((1540483477*(_>>>16)&65535)<<16)^(u=1540483477*(65535&(u^=u>>>24))+((1540483477*(u>>>16)&65535)<<16)),f-=4,++x;switch(f){case 3:_^=(255&l.charCodeAt(x+2))<<16;case 2:_^=(255&l.charCodeAt(x+1))<<8;case 1:_=1540483477*(65535&(_^=255&l.charCodeAt(x)))+((1540483477*(_>>>16)&65535)<<16)}return _=1540483477*(65535&(_^=_>>>13))+((1540483477*(_>>>16)&65535)<<16),(_^=_>>>15)>>>0};var ae=ee,_e=Y;Q.exports=ae,j.murmur3=ae,j.murmur2=_e;class ye{constructor(){this.ids=[],this.positions=[],this.indexed=!1}add(s,u,f,_){this.ids.push(ie(s)),this.positions.push(u,f,_)}getPositions(s){if(!this.indexed)throw new Error("Trying to get index, but feature positions are not indexed");const u=ie(s);let f=0,_=this.ids.length-1;for(;f<_;){const C=f+_>>1;this.ids[C]>=u?_=C:f=C+1}const x=[];for(;this.ids[f]===u;)x.push({index:this.positions[3*f],start:this.positions[3*f+1],end:this.positions[3*f+2]}),f++;return x}static serialize(s,u){const f=new Float64Array(s.ids),_=new Uint32Array(s.positions);return we(f,_,0,f.length-1),u&&u.push(f.buffer,_.buffer),{ids:f,positions:_}}static deserialize(s){const u=new ye;return u.ids=s.ids,u.positions=s.positions,u.indexed=!0,u}}function ie(l){const s=+l;return!isNaN(s)&&s<=Number.MAX_SAFE_INTEGER?s:j(String(l))}function we(l,s,u,f){for(;u>1];let x=u-1,C=f+1;for(;;){do{x++}while(l[x]<_);do{C--}while(l[C]>_);if(x>=C)break;De(l,x,C),De(s,3*x,3*C),De(s,3*x+1,3*C+1),De(s,3*x+2,3*C+2)}C-u`u_${_}`),this.type=f}setUniform(s,u,f){s.set(f.constantOr(this.value))}getBinding(s,u,f){return"color"===this.type?new Le(s,u):new ke(s,u)}}class Pt{constructor(s,u){this.uniformNames=u.map(f=>`u_${f}`),this.patternFrom=null,this.patternTo=null,this.pixelRatioFrom=1,this.pixelRatioTo=1}setConstantPatternPositions(s,u){this.pixelRatioFrom=u.pixelRatio,this.pixelRatioTo=s.pixelRatio,this.patternFrom=u.tlbr,this.patternTo=s.tlbr}setUniform(s,u,f,_){const x="u_pattern_to"===_?this.patternTo:"u_pattern_from"===_?this.patternFrom:"u_pixel_ratio_to"===_?this.pixelRatioTo:"u_pixel_ratio_from"===_?this.pixelRatioFrom:null;x&&s.set(x)}getBinding(s,u,f){return"u_pattern"===f.substr(0,9)?new Be(s,u):new ke(s,u)}}class zt{constructor(s,u,f,_){this.expression=s,this.type=f,this.maxValue=0,this.paintVertexAttributes=u.map(x=>({name:`a_${x}`,type:"Float32",components:"color"===f?2:1,offset:0})),this.paintVertexArray=new _}populatePaintArray(s,u,f,_,x){const C=this.paintVertexArray.length,M=this.expression.evaluate(new cr(0),u,{},_,[],x);this.paintVertexArray.resize(s),this._setPaintValue(C,s,M)}updatePaintArray(s,u,f,_){const x=this.expression.evaluate({zoom:0},f,_);this._setPaintValue(s,u,x)}_setPaintValue(s,u,f){if("color"===this.type){const _=ze(f);for(let x=s;x`u_${M}_t`),this.type=f,this.useIntegerZoom=_,this.zoom=x,this.maxValue=0,this.paintVertexAttributes=u.map(M=>({name:`a_${M}`,type:"Float32",components:"color"===f?4:2,offset:0})),this.paintVertexArray=new C}populatePaintArray(s,u,f,_,x){const C=this.expression.evaluate(new cr(this.zoom),u,{},_,[],x),M=this.expression.evaluate(new cr(this.zoom+1),u,{},_,[],x),A=this.paintVertexArray.length;this.paintVertexArray.resize(s),this._setPaintValue(A,s,C,M)}updatePaintArray(s,u,f,_){const x=this.expression.evaluate({zoom:this.zoom},f,_),C=this.expression.evaluate({zoom:this.zoom+1},f,_);this._setPaintValue(s,u,x,C)}_setPaintValue(s,u,f,_){if("color"===this.type){const x=ze(f),C=ze(_);for(let M=s;M`#define HAS_UNIFORM_${_}`))}return s}getBinderAttributes(){const s=[];for(const u in this.binders){const f=this.binders[u];if(f instanceof zt||f instanceof mt)for(let _=0;_!0)){this.programConfigurations={};for(const _ of s)this.programConfigurations[_.id]=new An(_,u,f);this.needsUpload=!1,this._featureMap=new ye,this._bufferOffset=0}populatePaintArrays(s,u,f,_,x,C){for(const M in this.programConfigurations)this.programConfigurations[M].populatePaintArrays(s,u,_,x,C);void 0!==u.id&&this._featureMap.add(u.id,f,this._bufferOffset,s),this._bufferOffset=s,this.needsUpload=!0}updatePaintArrays(s,u,f,_){for(const x of f)this.needsUpload=this.programConfigurations[x.id].updatePaintArrays(s,this._featureMap,u,x,_)||this.needsUpload}get(s){return this.programConfigurations[s]}upload(s){if(this.needsUpload){for(const u in this.programConfigurations)this.programConfigurations[u].upload(s);this.needsUpload=!1}}destroy(){for(const s in this.programConfigurations)this.programConfigurations[s].destroy()}}function on(l,s){return{"text-opacity":["opacity"],"icon-opacity":["opacity"],"text-color":["fill_color"],"icon-color":["fill_color"],"text-halo-color":["halo_color"],"icon-halo-color":["halo_color"],"text-halo-blur":["halo_blur"],"icon-halo-blur":["halo_blur"],"text-halo-width":["halo_width"],"icon-halo-width":["halo_width"],"line-gap-width":["gapwidth"],"line-pattern":["pattern_to","pattern_from","pixel_ratio_to","pixel_ratio_from"],"fill-pattern":["pattern_to","pattern_from","pixel_ratio_to","pixel_ratio_from"],"fill-extrusion-pattern":["pattern_to","pattern_from","pixel_ratio_to","pixel_ratio_from"]}[l]||[l.replace(`${s}-`,"").replace(/-/g,"_")]}function Fn(l,s,u){const _={"line-pattern":{source:ga,composite:ga},"fill-pattern":{source:ga,composite:ga},"fill-extrusion-pattern":{source:ga,composite:ga}}[l];return _&&_[u]||{color:{source:Qu,composite:vd},number:{source:Xl,composite:Qu}}[s][u]}ct("ConstantBinder",ht),ct("CrossFadedConstantBinder",Pt),ct("SourceExpressionBinder",zt),ct("CrossFadedCompositeBinder",Tn),ct("CompositeExpressionBinder",mt),ct("ProgramConfiguration",An,{omit:["_buffers"]}),ct("ProgramConfigurationSet",Ht);var _n=8192;const mo=Math.pow(2,14)-1,Ro=-mo-1;function vr(l){const s=_n/l.extent,u=l.loadGeometry();for(let f=0;fC.x+1||AC.y+1)&&pn("Geometry exceeds allowed extent, reduce your vector tile buffer size")}}return u}function li(l,s){return{type:l.type,id:l.id,properties:l.properties,geometry:s?vr(l):[]}}function Ii(l,s,u,f,_){l.emplaceBack(2*s+(f+1)/2,2*u+(_+1)/2)}class Jo{constructor(s){this.zoom=s.zoom,this.overscaling=s.overscaling,this.layers=s.layers,this.layerIds=this.layers.map(u=>u.id),this.index=s.index,this.hasPattern=!1,this.layoutVertexArray=new qs,this.indexArray=new w,this.segments=new R,this.programConfigurations=new Ht(s.layers,s.zoom),this.stateDependentLayerIds=this.layers.filter(u=>u.isStateDependent()).map(u=>u.id)}populate(s,u,f){const _=this.layers[0],x=[];let C=null,M=!1;"circle"===_.type&&(C=_.layout.get("circle-sort-key"),M=!C.isConstant());for(const{feature:A,id:F,index:O,sourceLayerIndex:B}of s){const H=this.layers[0]._featureFilter.needGeometry,q=li(A,H);if(!this.layers[0]._featureFilter.filter(new cr(this.zoom),q,f))continue;const W=M?C.evaluate(q,{},f):void 0,se={id:F,properties:A.properties,type:A.type,sourceLayerIndex:B,index:O,geometry:H?q.geometry:vr(A),patterns:{},sortKey:W};x.push(se)}M&&x.sort((A,F)=>A.sortKey-F.sortKey);for(const A of x){const{geometry:F,index:O,sourceLayerIndex:B}=A,H=s[O].feature;this.addFeature(A,F,O,f),u.featureIndex.insert(H,F,O,B,this.index)}}update(s,u,f){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(s,u,this.stateDependentLayers,f)}isEmpty(){return 0===this.layoutVertexArray.length}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(s){this.uploaded||(this.layoutVertexBuffer=s.createVertexBuffer(this.layoutVertexArray,k),this.indexBuffer=s.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(s),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())}addFeature(s,u,f,_){for(const x of u)for(const C of x){const M=C.x,A=C.y;if(M<0||M>=_n||A<0||A>=_n)continue;const F=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray,s.sortKey),O=F.vertexLength;Ii(this.layoutVertexArray,M,A,-1,-1),Ii(this.layoutVertexArray,M,A,1,-1),Ii(this.layoutVertexArray,M,A,1,1),Ii(this.layoutVertexArray,M,A,-1,1),this.indexArray.emplaceBack(O,O+1,O+2),this.indexArray.emplaceBack(O,O+3,O+2),F.vertexLength+=4,F.primitiveLength+=2}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,s,f,{},_)}}function Fo(l,s){for(let u=0;u1){if(On(l,s))return!0;for(let f=0;f1?u:u.sub(s)._mult(_)._add(s))}function Qo(l,s){let u,f,_,x=!1;for(let C=0;Cs.y!=_.y>s.y&&s.x<(_.x-f.x)*(s.y-f.y)/(_.y-f.y)+f.x&&(x=!x)}return x}function qi(l,s){let u=!1;for(let f=0,_=l.length-1;fs.y!=C.y>s.y&&s.x<(C.x-x.x)*(s.y-x.y)/(C.y-x.y)+x.x&&(u=!u)}return u}function sh(l,s,u){const f=u[0],_=u[2];if(l.x_.x&&s.x>_.x||l.y_.y&&s.y>_.y)return!1;const x=ii(l,s,u[0]);return x!==ii(l,s,u[1])||x!==ii(l,s,u[2])||x!==ii(l,s,u[3])}function ya(l,s,u){const f=s.paint.get(l).value;return"constant"===f.kind?f.value:u.programConfigurations.get(s.id).getMaxValue(l)}function Zs(l){return Math.sqrt(l[0]*l[0]+l[1]*l[1])}function ah(l,s,u,f,_){if(!s[0]&&!s[1])return l;const x=Tt.convert(s)._mult(_);"viewport"===u&&x._rotate(-f);const C=[];for(let M=0;Ml.width||_.height>l.height||u.x>l.width-_.width||u.y>l.height-_.height)throw new RangeError("out of range source coordinates for image copy");if(_.width>s.width||_.height>s.height||f.x>s.width-_.width||f.y>s.height-_.height)throw new RangeError("out of range destination coordinates for image copy");const C=l.data,M=s.data;if(C===M)throw new Error("srcData equals dstData, so image is already copied");for(let A=0;A<_.height;A++){const F=((u.y+A)*l.width+u.x)*x,O=((f.y+A)*s.width+f.x)*x;for(let B=0;B<_.width*x;B++)M[O+B]=C[F+B]}return s}class uh{constructor(s,u){ch(this,s,1,u)}resize(s){Dd(this,s,1)}clone(){return new uh({width:this.width,height:this.height},new Uint8Array(this.data))}static copy(s,u,f,_,x){Wm(s,u,f,_,x,1)}}class Oo{constructor(s,u){ch(this,s,4,u)}resize(s){Dd(this,s,4)}replace(s,u){u?this.data.set(s):this.data=s instanceof Uint8ClampedArray?new Uint8Array(s.buffer):s}clone(){return new Oo({width:this.width,height:this.height},new Uint8Array(this.data))}static copy(s,u,f,_,x){Wm(s,u,f,_,x,4)}}function Xm(l){const s={},u=l.resolution||256,f=l.clips?l.clips.length:1,_=l.image||new Oo({width:u,height:f});if(Math.log(u)/Math.LN2%1!=0)throw new Error(`width is not a power of 2 - ${u}`);const x=(C,M,A)=>{s[l.evaluationKey]=A;const F=l.expression.evaluate(s);_.data[C+M+0]=Math.floor(255*F.r/F.a),_.data[C+M+1]=Math.floor(255*F.g/F.a),_.data[C+M+2]=Math.floor(255*F.b/F.a),_.data[C+M+3]=Math.floor(255*F.a)};if(l.clips)for(let C=0,M=0;C80*u){f=x=l[0],_=C=l[1];for(var W=u;Wx&&(x=M),A>C&&(C=A);F=0!==(F=Math.max(x-f,C-_))?32767/F:0}return va(H,q,u,f,_,F,0),q}function Ym(l,s,u,f,_){var x,C;if(_===L_(l,s,u,f)>0)for(x=s;x=s;x-=f)C=Kx(x,l[x],l[x+1],C);return C&&Qm(C,C.next)&&(Jf(C),C=C.next),C}function Kl(l,s){if(!l)return l;s||(s=l);var u,f=l;do{if(u=!1,f.steiner||!Qm(f,f.next)&&0!==nr(f.prev,f,f.next))f=f.next;else{if(Jf(f),(f=s=f.prev)===f.next)break;u=!0}}while(u||f!==s);return s}function va(l,s,u,f,_,x,C){if(l){!C&&x&&function(O,B,H,q){var W=O;do{0===W.z&&(W.z=Jl(W.x,W.y,B,H,q)),W.prevZ=W.prev,W.nextZ=W.next,W=W.next}while(W!==O);W.prevZ.nextZ=null,W.prevZ=null,function(se){var oe,be,Ce,me,Ee,$e,Ve,gt,Ct=1;do{for(be=se,se=null,Ee=null,$e=0;be;){for($e++,Ce=be,Ve=0,oe=0;oe0||gt>0&&Ce;)0!==Ve&&(0===gt||!Ce||be.z<=Ce.z)?(me=be,be=be.nextZ,Ve--):(me=Ce,Ce=Ce.nextZ,gt--),Ee?Ee.nextZ=me:se=me,me.prevZ=Ee,Ee=me;be=Ce}Ee.nextZ=null,Ct*=2}while($e>1)}(W)}(l,f,_,x);for(var M,A,F=l;l.prev!==l.next;)if(M=l.prev,A=l.next,x?Zi(l,f,_,x):Wx(l))s.push(M.i/u|0),s.push(l.i/u|0),s.push(A.i/u|0),Jf(l),l=A.next,F=A.next;else if((l=A)===F){C?1===C?va(l=Km(Kl(l),s,u),s,u,f,_,x,2):2===C&&Xx(l,s,u,f,_,x):va(Kl(l),s,u,f,_,x,1);break}}}function Wx(l){var s=l.prev,u=l,f=l.next;if(nr(s,u,f)>=0)return!1;for(var _=s.x,x=u.x,C=f.x,M=s.y,A=u.y,F=f.y,O=_x?_>C?_:C:x>C?x:C,q=M>A?M>F?M:F:A>F?A:F,W=f.next;W!==s;){if(W.x>=O&&W.x<=H&&W.y>=B&&W.y<=q&&Zc(_,M,x,A,C,F,W.x,W.y)&&nr(W.prev,W,W.next)>=0)return!1;W=W.next}return!0}function Zi(l,s,u,f){var _=l.prev,x=l,C=l.next;if(nr(_,x,C)>=0)return!1;for(var M=_.x,A=x.x,F=C.x,O=_.y,B=x.y,H=C.y,q=MA?M>F?M:F:A>F?A:F,oe=O>B?O>H?O:H:B>H?B:H,be=Jl(q,W,s,u,f),Ce=Jl(se,oe,s,u,f),me=l.prevZ,Ee=l.nextZ;me&&me.z>=be&&Ee&&Ee.z<=Ce;){if(me.x>=q&&me.x<=se&&me.y>=W&&me.y<=oe&&me!==_&&me!==C&&Zc(M,O,A,B,F,H,me.x,me.y)&&nr(me.prev,me,me.next)>=0||(me=me.prevZ,Ee.x>=q&&Ee.x<=se&&Ee.y>=W&&Ee.y<=oe&&Ee!==_&&Ee!==C&&Zc(M,O,A,B,F,H,Ee.x,Ee.y)&&nr(Ee.prev,Ee,Ee.next)>=0))return!1;Ee=Ee.nextZ}for(;me&&me.z>=be;){if(me.x>=q&&me.x<=se&&me.y>=W&&me.y<=oe&&me!==_&&me!==C&&Zc(M,O,A,B,F,H,me.x,me.y)&&nr(me.prev,me,me.next)>=0)return!1;me=me.prevZ}for(;Ee&&Ee.z<=Ce;){if(Ee.x>=q&&Ee.x<=se&&Ee.y>=W&&Ee.y<=oe&&Ee!==_&&Ee!==C&&Zc(M,O,A,B,F,H,Ee.x,Ee.y)&&nr(Ee.prev,Ee,Ee.next)>=0)return!1;Ee=Ee.nextZ}return!0}function Km(l,s,u){var f=l;do{var _=f.prev,x=f.next.next;!Qm(_,x)&&F_(_,f,f.next,x)&&Kf(_,x)&&Kf(x,_)&&(s.push(_.i/u|0),s.push(f.i/u|0),s.push(x.i/u|0),Jf(f),Jf(f.next),f=l=x),f=f.next}while(f!==l);return Kl(f)}function Xx(l,s,u,f,_,x){var C=l;do{for(var M=C.next.next;M!==C.prev;){if(C.i!==M.i&&Jm(C,M)){var A=Yx(C,M);return C=Kl(C,C.next),A=Kl(A,A.next),va(C,s,u,f,_,x,0),void va(A,s,u,f,_,x,0)}M=M.next}C=C.next}while(C!==l)}function R_(l,s){return l.x-s.x}function Sd(l,s){var u=function(_,x){var C,M=x,A=_.x,F=_.y,O=-1/0;do{if(F<=M.y&&F>=M.next.y&&M.next.y!==M.y){var B=M.x+(F-M.y)*(M.next.x-M.x)/(M.next.y-M.y);if(B<=A&&B>O&&(O=B,C=M.x=M.x&&M.x>=W&&A!==M.x&&Zc(FC.x||M.x===C.x&&hh(C,M)))&&(C=M,oe=H)),M=M.next}while(M!==q);return C}(l,s);if(!u)return s;var f=Yx(u,l);return Kl(f,f.next),Kl(u,u.next)}function hh(l,s){return nr(l.prev,l,s.prev)<0&&nr(s.next,l,l.next)<0}function Jl(l,s,u,f,_){return(l=1431655765&((l=858993459&((l=252645135&((l=16711935&((l=(l-u)*_|0)|l<<8))|l<<4))|l<<2))|l<<1))|(s=1431655765&((s=858993459&((s=252645135&((s=16711935&((s=(s-f)*_|0)|s<<8))|s<<4))|s<<2))|s<<1))<<1}function dh(l){var s=l,u=l;do{(s.x=(l-C)*(x-M)&&(l-C)*(f-M)>=(u-C)*(s-M)&&(u-C)*(x-M)>=(_-C)*(f-M)}function Jm(l,s){return l.next.i!==s.i&&l.prev.i!==s.i&&!function(u,f){var _=u;do{if(_.i!==u.i&&_.next.i!==u.i&&_.i!==f.i&&_.next.i!==f.i&&F_(_,_.next,u,f))return!0;_=_.next}while(_!==u);return!1}(l,s)&&(Kf(l,s)&&Kf(s,l)&&function(u,f){var _=u,x=!1,C=(u.x+f.x)/2,M=(u.y+f.y)/2;do{_.y>M!=_.next.y>M&&_.next.y!==_.y&&C<(_.next.x-_.x)*(M-_.y)/(_.next.y-_.y)+_.x&&(x=!x),_=_.next}while(_!==u);return x}(l,s)&&(nr(l.prev,l,s.prev)||nr(l,s.prev,s))||Qm(l,s)&&nr(l.prev,l,l.next)>0&&nr(s.prev,s,s.next)>0)}function nr(l,s,u){return(s.y-l.y)*(u.x-s.x)-(s.x-l.x)*(u.y-s.y)}function Qm(l,s){return l.x===s.x&&l.y===s.y}function F_(l,s,u,f){var _=eg(nr(l,s,u)),x=eg(nr(l,s,f)),C=eg(nr(u,f,l)),M=eg(nr(u,f,s));return _!==x&&C!==M||!(0!==_||!It(l,u,s))||!(0!==x||!It(l,f,s))||!(0!==C||!It(u,l,f))||!(0!==M||!It(u,s,f))}function It(l,s,u){return s.x<=Math.max(l.x,u.x)&&s.x>=Math.min(l.x,u.x)&&s.y<=Math.max(l.y,u.y)&&s.y>=Math.min(l.y,u.y)}function eg(l){return l>0?1:l<0?-1:0}function Kf(l,s){return nr(l.prev,l,l.next)<0?nr(l,s,l.next)>=0&&nr(l,l.prev,s)>=0:nr(l,s,l.prev)<0||nr(l,l.next,s)<0}function Yx(l,s){var u=new O_(l.i,l.x,l.y),f=new O_(s.i,s.x,s.y),_=l.next,x=s.prev;return l.next=s,s.prev=l,u.next=_,_.prev=u,f.next=u,u.prev=f,x.next=f,f.prev=x,f}function Kx(l,s,u,f){var _=new O_(l,s,u);return f?(_.next=f.next,_.prev=f,f.next.prev=_,f.next=_):(_.prev=_,_.next=_),_}function Jf(l){l.next.prev=l.prev,l.prev.next=l.next,l.prevZ&&(l.prevZ.nextZ=l.nextZ),l.nextZ&&(l.nextZ.prevZ=l.prevZ)}function O_(l,s,u){this.i=l,this.x=s,this.y=u,this.prev=null,this.next=null,this.z=0,this.prevZ=null,this.nextZ=null,this.steiner=!1}function L_(l,s,u,f){for(var _=0,x=s,C=u-f;xu;){if(f-u>600){var x=f-u+1,C=s-u+1,M=Math.log(x),A=.5*Math.exp(2*M/3),F=.5*Math.sqrt(M*A*(x-A)/x)*(C-x/2<0?-1:1);Jx(l,s,Math.max(u,Math.floor(s-C*A/x+F)),Math.min(f,Math.floor(s+(x-C)*A/x+F)),_)}var O=l[s],B=u,H=f;for(Qf(l,u,s),_(l[f],O)>0&&Qf(l,u,f);B0;)H--}0===_(l[u],O)?Qf(l,u,H):Qf(l,++H,f),H<=s&&(u=H+1),s<=H&&(f=H-1)}}function Qf(l,s,u){var f=l[s];l[s]=l[u],l[u]=f}function ci(l,s){return ls?1:0}function Id(l,s){const u=l.length;if(u<=1)return[l];const f=[];let _,x;for(let C=0;C1)for(let C=0;C0&&u.holes.push(f+=l[_-1].length)}return u};class go{constructor(s){this.zoom=s.zoom,this.overscaling=s.overscaling,this.layers=s.layers,this.layerIds=this.layers.map(u=>u.id),this.index=s.index,this.hasPattern=!1,this.patternFeatures=[],this.layoutVertexArray=new bs,this.indexArray=new w,this.indexArray2=new S,this.programConfigurations=new Ht(s.layers,s.zoom),this.segments=new R,this.segments2=new R,this.stateDependentLayerIds=this.layers.filter(u=>u.isStateDependent()).map(u=>u.id)}populate(s,u,f){this.hasPattern=N_("fill",this.layers,u);const _=this.layers[0].layout.get("fill-sort-key"),x=!_.isConstant(),C=[];for(const{feature:M,id:A,index:F,sourceLayerIndex:O}of s){const B=this.layers[0]._featureFilter.needGeometry,H=li(M,B);if(!this.layers[0]._featureFilter.filter(new cr(this.zoom),H,f))continue;const q=x?_.evaluate(H,{},f,u.availableImages):void 0,W={id:A,properties:M.properties,type:M.type,sourceLayerIndex:O,index:F,geometry:B?H.geometry:vr(M),patterns:{},sortKey:q};C.push(W)}x&&C.sort((M,A)=>M.sortKey-A.sortKey);for(const M of C){const{geometry:A,index:F,sourceLayerIndex:O}=M;if(this.hasPattern){const B=tg("fill",this.layers,M,this.zoom,u);this.patternFeatures.push(B)}else this.addFeature(M,A,F,f,{});u.featureIndex.insert(s[F].feature,A,F,O,this.index)}}update(s,u,f){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(s,u,this.stateDependentLayers,f)}addFeatures(s,u,f){for(const _ of this.patternFeatures)this.addFeature(_,_.geometry,_.index,u,f)}isEmpty(){return 0===this.layoutVertexArray.length}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(s){this.uploaded||(this.layoutVertexBuffer=s.createVertexBuffer(this.layoutVertexArray,Xf),this.indexBuffer=s.createIndexBuffer(this.indexArray),this.indexBuffer2=s.createIndexBuffer(this.indexArray2)),this.programConfigurations.upload(s),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.indexBuffer2.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.segments2.destroy())}addFeature(s,u,f,_,x){for(const C of Id(u,500)){let M=0;for(const q of C)M+=q.length;const A=this.segments.prepareSegment(M,this.layoutVertexArray,this.indexArray),F=A.vertexLength,O=[],B=[];for(const q of C){if(0===q.length)continue;q!==C[0]&&B.push(O.length/2);const W=this.segments2.prepareSegment(q.length,this.layoutVertexArray,this.indexArray2),se=W.vertexLength;this.layoutVertexArray.emplaceBack(q[0].x,q[0].y),this.indexArray2.emplaceBack(se+q.length-1,se),O.push(q[0].x),O.push(q[0].y);for(let oe=1;oe>3}if(_--,1===f||2===f)x+=l.readSVarint(),C+=l.readSVarint(),1===f&&(s&&M.push(s),s=[]),s.push(new Qx(x,C));else{if(7!==f)throw new Error("unknown command "+f);s&&s.push(s[0].clone())}}return s&&M.push(s),M},kd.prototype.bbox=function(){var l=this._pbf;l.pos=this._geometry;for(var s=l.readVarint()+l.pos,u=1,f=0,_=0,x=0,C=1/0,M=-1/0,A=1/0,F=-1/0;l.pos>3}if(f--,1===u||2===u)(_+=l.readSVarint())M&&(M=_),(x+=l.readSVarint())F&&(F=x);else if(7!==u)throw new Error("unknown command "+u)}return[C,A,M,F]},kd.prototype.toGeoJSON=function(l,s,u){var f,_,x=this.extent*Math.pow(2,u),C=this.extent*l,M=this.extent*s,A=this.loadGeometry(),F=kd.types[this.type];function O(q){for(var W=0;W>3;_=1===C?f.readString():2===C?f.readFloat():3===C?f.readDouble():4===C?f.readVarint64():5===C?f.readVarint():6===C?f.readSVarint():7===C?f.readBoolean():null}return _}(u))}t1.prototype.feature=function(l){if(l<0||l>=this._features.length)throw new Error("feature index out of bounds");this._pbf.pos=this._features[l];var s=this._pbf.readVarint()+this._pbf.pos;return new ng(this._pbf,s,this.extent,this._keys,this._values)};var n1=Wc;function r1(l,s,u){if(3===l){var f=new n1(u,u.readVarint()+u.pos);f.length&&(s[f.name]=f)}}Ql.VectorTile=function(l,s){this.layers=l.readFields(r1,{},s)},Ql.VectorTileFeature=e1,Ql.VectorTileLayer=Wc;const i1=Ql.VectorTileFeature.types,rg=Math.pow(2,13);function Pd(l,s,u,f,_,x,C,M){l.emplaceBack(s,u,2*Math.floor(f*rg)+C,_*rg*2,x*rg*2,Math.round(M))}class ig{constructor(s){this.zoom=s.zoom,this.overscaling=s.overscaling,this.layers=s.layers,this.layerIds=this.layers.map(u=>u.id),this.index=s.index,this.hasPattern=!1,this.layoutVertexArray=new wd,this.centroidVertexArray=new ih,this.indexArray=new w,this.programConfigurations=new Ht(s.layers,s.zoom),this.segments=new R,this.stateDependentLayerIds=this.layers.filter(u=>u.isStateDependent()).map(u=>u.id)}populate(s,u,f){this.features=[],this.hasPattern=N_("fill-extrusion",this.layers,u);for(const{feature:_,id:x,index:C,sourceLayerIndex:M}of s){const A=this.layers[0]._featureFilter.needGeometry,F=li(_,A);if(!this.layers[0]._featureFilter.filter(new cr(this.zoom),F,f))continue;const O={id:x,sourceLayerIndex:M,index:C,geometry:A?F.geometry:vr(_),properties:_.properties,type:_.type,patterns:{}};this.hasPattern?this.features.push(tg("fill-extrusion",this.layers,O,this.zoom,u)):this.addFeature(O,O.geometry,C,f,{}),u.featureIndex.insert(_,O.geometry,C,M,this.index,!0)}}addFeatures(s,u,f){for(const _ of this.features){const{geometry:x}=_;this.addFeature(_,x,_.index,u,f)}}update(s,u,f){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(s,u,this.stateDependentLayers,f)}isEmpty(){return 0===this.layoutVertexArray.length&&0===this.centroidVertexArray.length}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(s){this.uploaded||(this.layoutVertexBuffer=s.createVertexBuffer(this.layoutVertexArray,B_),this.centroidVertexBuffer=s.createVertexBuffer(this.centroidVertexArray,Ad.members,!0),this.indexBuffer=s.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(s),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.centroidVertexBuffer.destroy())}addFeature(s,u,f,_,x){const C={x:0,y:0,vertexCount:0};for(const M of Id(u,500)){let A=0;for(const W of M)A+=W.length;let F=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray);for(const W of M){if(0===W.length||((l=W).every(s=>s.x<0)||l.every(s=>s.x>_n)||l.every(s=>s.y<0)||l.every(s=>s.y>_n)))continue;let se=0;for(let oe=0;oe=1){const Ce=W[oe-1];if(!og(be,Ce)){F.vertexLength+4>R.MAX_VERTEX_ARRAY_LENGTH&&(F=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray));const me=be.sub(Ce)._perp()._unit(),Ee=Ce.dist(be);se+Ee>32768&&(se=0),Pd(this.layoutVertexArray,be.x,be.y,me.x,me.y,0,0,se),Pd(this.layoutVertexArray,be.x,be.y,me.x,me.y,0,1,se),C.x+=2*be.x,C.y+=2*be.y,C.vertexCount+=2,se+=Ee,Pd(this.layoutVertexArray,Ce.x,Ce.y,me.x,me.y,0,0,se),Pd(this.layoutVertexArray,Ce.x,Ce.y,me.x,me.y,0,1,se),C.x+=2*Ce.x,C.y+=2*Ce.y,C.vertexCount+=2;const $e=F.vertexLength;this.indexArray.emplaceBack($e,$e+2,$e+1),this.indexArray.emplaceBack($e+1,$e+2,$e+3),F.vertexLength+=4,F.primitiveLength+=2}}}}if(F.vertexLength+A>R.MAX_VERTEX_ARRAY_LENGTH&&(F=this.segments.prepareSegment(A,this.layoutVertexArray,this.indexArray)),"Polygon"!==i1[s.type])continue;const O=[],B=[],H=F.vertexLength;for(const W of M)if(0!==W.length){W!==M[0]&&B.push(O.length/2);for(let se=0;se_n)||l.y===s.y&&(l.y<0||l.y>_n)}ct("FillExtrusionBucket",ig,{omit:["layers","features"]});var T2={paint:new Di({"fill-extrusion-opacity":new wt(Ae["paint_fill-extrusion"]["fill-extrusion-opacity"]),"fill-extrusion-color":new yt(Ae["paint_fill-extrusion"]["fill-extrusion-color"]),"fill-extrusion-translate":new wt(Ae["paint_fill-extrusion"]["fill-extrusion-translate"]),"fill-extrusion-translate-anchor":new wt(Ae["paint_fill-extrusion"]["fill-extrusion-translate-anchor"]),"fill-extrusion-pattern":new Qa(Ae["paint_fill-extrusion"]["fill-extrusion-pattern"]),"fill-extrusion-height":new yt(Ae["paint_fill-extrusion"]["fill-extrusion-height"]),"fill-extrusion-base":new yt(Ae["paint_fill-extrusion"]["fill-extrusion-base"]),"fill-extrusion-vertical-gradient":new wt(Ae["paint_fill-extrusion"]["fill-extrusion-vertical-gradient"])})};function il(l,s){return l.x*s.x+l.y*s.y}function np(l,s){if(1===l.length){let u=0;const f=s[u++];let _;for(;!_||f.equals(_);)if(_=s[u++],!_)return 1/0;for(;uu.id),this.index=s.index,this.hasPattern=!1,this.patternFeatures=[],this.lineClipsArray=[],this.gradients={},this.layers.forEach(u=>{this.gradients[u.id]={}}),this.layoutVertexArray=new oh,this.layoutVertexArray2=new k_,this.indexArray=new w,this.programConfigurations=new Ht(s.layers,s.zoom),this.segments=new R,this.maxLineLength=0,this.stateDependentLayerIds=this.layers.filter(u=>u.isStateDependent()).map(u=>u.id)}populate(s,u,f){this.hasPattern=N_("line",this.layers,u);const _=this.layers[0].layout.get("line-sort-key"),x=!_.isConstant(),C=[];for(const{feature:M,id:A,index:F,sourceLayerIndex:O}of s){const B=this.layers[0]._featureFilter.needGeometry,H=li(M,B);if(!this.layers[0]._featureFilter.filter(new cr(this.zoom),H,f))continue;const q=x?_.evaluate(H,{},f):void 0,W={id:A,properties:M.properties,type:M.type,sourceLayerIndex:O,index:F,geometry:B?H.geometry:vr(M),patterns:{},sortKey:q};C.push(W)}x&&C.sort((M,A)=>M.sortKey-A.sortKey);for(const M of C){const{geometry:A,index:F,sourceLayerIndex:O}=M;if(this.hasPattern){const B=tg("line",this.layers,M,this.zoom,u);this.patternFeatures.push(B)}else this.addFeature(M,A,F,f,{});u.featureIndex.insert(s[F].feature,A,F,O,this.index)}}update(s,u,f){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(s,u,this.stateDependentLayers,f)}addFeatures(s,u,f){for(const _ of this.patternFeatures)this.addFeature(_,_.geometry,_.index,u,f)}isEmpty(){return 0===this.layoutVertexArray.length}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(s){this.uploaded||(0!==this.layoutVertexArray2.length&&(this.layoutVertexBuffer2=s.createVertexBuffer(this.layoutVertexArray2,a1)),this.layoutVertexBuffer=s.createVertexBuffer(this.layoutVertexArray,o1),this.indexBuffer=s.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(s),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())}lineFeatureClips(s){if(s.properties&&Object.prototype.hasOwnProperty.call(s.properties,"mapbox_clip_start")&&Object.prototype.hasOwnProperty.call(s.properties,"mapbox_clip_end"))return{start:+s.properties.mapbox_clip_start,end:+s.properties.mapbox_clip_end}}addFeature(s,u,f,_,x){const C=this.layers[0].layout,M=C.get("line-join").evaluate(s,{}),A=C.get("line-cap"),F=C.get("line-miter-limit"),O=C.get("line-round-limit");this.lineClips=this.lineFeatureClips(s);for(const B of u)this.addLine(B,s,M,A,F,O);this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,s,f,x,_)}addLine(s,u,f,_,x,C){if(this.distance=0,this.scaledDistance=0,this.totalDistance=0,this.lineClips){this.lineClipsArray.push(this.lineClips);for(let be=0;be=2&&s[A-1].equals(s[A-2]);)A--;let F=0;for(;F0;if(gt&&be>F){const Qe=H.dist(q);if(Qe>2*O){const ot=H.sub(H.sub(q)._mult(O/Qe)._round());this.updateDistance(q,ot),this.addCurrentVertex(ot,se,0,0,B),q=ot}}const at=q&&W;let tt=at?f:M?"butt":_;if(at&&"round"===tt&&($ex&&(tt="bevel"),"bevel"===tt&&($e>2&&(tt="flipbevel"),$e100)Ce=oe.mult(-1);else{const Qe=$e*se.add(oe).mag()/se.sub(oe).mag();Ce._perp()._mult(Qe*(Ct?-1:1))}this.addCurrentVertex(H,Ce,0,0,B),this.addCurrentVertex(H,Ce.mult(-1),0,0,B)}else if("bevel"===tt||"fakeround"===tt){const Qe=-Math.sqrt($e*$e-1),ot=Ct?Qe:0,it=Ct?0:Qe;if(q&&this.addCurrentVertex(H,se,ot,it,B),"fakeround"===tt){const Ge=Math.round(180*Ve/Math.PI/20);for(let Et=1;Et2*O){const ot=H.add(W.sub(H)._mult(O/Qe)._round());this.updateDistance(H,ot),this.addCurrentVertex(ot,oe,0,0,B),H=ot}}}}addCurrentVertex(s,u,f,_,x,C=!1){const M=u.y*_-u.x,A=-u.y-u.x*_;this.addHalfVertex(s,u.x+u.y*f,u.y-u.x*f,C,!1,f,x),this.addHalfVertex(s,M,A,C,!0,-_,x),this.distance>Xc/2&&0===this.totalDistance&&(this.distance=0,this.addCurrentVertex(s,u,f,_,x,C))}addHalfVertex({x:s,y:u},f,_,x,C,M,A){const F=.5*(this.lineClips?this.scaledDistance*(Xc-1):this.scaledDistance);this.layoutVertexArray.emplaceBack((s<<1)+(x?1:0),(u<<1)+(C?1:0),Math.round(63*f)+128,Math.round(63*_)+128,1+(0===M?0:M<0?-1:1)|(63&F)<<2,F>>6),this.lineClips&&this.layoutVertexArray2.emplaceBack((this.scaledDistance-this.lineClips.start)/(this.lineClips.end-this.lineClips.start),this.lineClipsArray.length);const O=A.vertexLength++;this.e1>=0&&this.e2>=0&&(this.indexArray.emplaceBack(this.e1,this.e2,O),A.primitiveLength++),C?this.e2=O:this.e1=O}updateScaledDistance(){this.scaledDistance=this.lineClips?this.lineClips.start+(this.lineClips.end-this.lineClips.start)*this.distance/this.totalDistance:this.distance}updateDistance(s,u){this.distance+=s.dist(u),this.updateScaledDistance()}}ct("LineBucket",sg,{omit:["layers","patternFeatures"]});const St=new Di({"line-cap":new wt(Ae.layout_line["line-cap"]),"line-join":new yt(Ae.layout_line["line-join"]),"line-miter-limit":new wt(Ae.layout_line["line-miter-limit"]),"line-round-limit":new wt(Ae.layout_line["line-round-limit"]),"line-sort-key":new yt(Ae.layout_line["line-sort-key"])});var ag={paint:new Di({"line-opacity":new yt(Ae.paint_line["line-opacity"]),"line-color":new yt(Ae.paint_line["line-color"]),"line-translate":new wt(Ae.paint_line["line-translate"]),"line-translate-anchor":new wt(Ae.paint_line["line-translate-anchor"]),"line-width":new yt(Ae.paint_line["line-width"]),"line-gap-width":new yt(Ae.paint_line["line-gap-width"]),"line-offset":new yt(Ae.paint_line["line-offset"]),"line-blur":new yt(Ae.paint_line["line-blur"]),"line-dasharray":new pd(Ae.paint_line["line-dasharray"]),"line-pattern":new Qa(Ae.paint_line["line-pattern"]),"line-gradient":new md(Ae.paint_line["line-gradient"])}),layout:St};const Fr=new class extends yt{possiblyEvaluate(l,s){return s=new cr(Math.floor(s.zoom),{now:s.now,fadeDuration:s.fadeDuration,zoomHistory:s.zoomHistory,transition:s.transition}),super.possiblyEvaluate(l,s)}evaluate(l,s,u,f){return s=Ni({},s,{zoom:Math.floor(s.zoom)}),super.evaluate(l,s,u,f)}}(ag.paint.properties["line-width"].specification);function ip(l,s){return s>0?s+2*l:l}Fr.useIntegerZoom=!0;const Fd=Dr([{name:"a_pos_offset",components:4,type:"Int16"},{name:"a_data",components:4,type:"Uint16"},{name:"a_pixeloffset",components:4,type:"Int16"}],4),l1=Dr([{name:"a_projected_pos",components:3,type:"Float32"}],4);Dr([{name:"a_fade_opacity",components:1,type:"Uint32"}],4);const c1=Dr([{name:"a_placed",components:2,type:"Uint8"},{name:"a_shift",components:2,type:"Float32"}]);Dr([{type:"Int16",name:"anchorPointX"},{type:"Int16",name:"anchorPointY"},{type:"Int16",name:"x1"},{type:"Int16",name:"y1"},{type:"Int16",name:"x2"},{type:"Int16",name:"y2"},{type:"Uint32",name:"featureIndex"},{type:"Uint16",name:"sourceLayerIndex"},{type:"Uint16",name:"bucketIndex"}]);const j_=Dr([{name:"a_pos",components:2,type:"Int16"},{name:"a_anchor_pos",components:2,type:"Int16"},{name:"a_extrude",components:2,type:"Int16"}],4),lg=Dr([{name:"a_pos",components:2,type:"Float32"},{name:"a_radius",components:1,type:"Float32"},{name:"a_flags",components:2,type:"Int16"}],4);function Od(l,s,u){return l.sections.forEach(f=>{f.text=function(_,x,C){const M=x.layout.get("text-transform").evaluate(C,{});return"uppercase"===M?_=_.toLocaleUpperCase():"lowercase"===M&&(_=_.toLocaleLowerCase()),po.applyArabicShaping&&(_=po.applyArabicShaping(_)),_}(f.text,s,u)}),l}Dr([{name:"triangle",components:3,type:"Uint16"}]),Dr([{type:"Int16",name:"anchorX"},{type:"Int16",name:"anchorY"},{type:"Uint16",name:"glyphStartIndex"},{type:"Uint16",name:"numGlyphs"},{type:"Uint32",name:"vertexStartIndex"},{type:"Uint32",name:"lineStartIndex"},{type:"Uint32",name:"lineLength"},{type:"Uint16",name:"segment"},{type:"Uint16",name:"lowerSize"},{type:"Uint16",name:"upperSize"},{type:"Float32",name:"lineOffsetX"},{type:"Float32",name:"lineOffsetY"},{type:"Uint8",name:"writingMode"},{type:"Uint8",name:"placedOrientation"},{type:"Uint8",name:"hidden"},{type:"Uint32",name:"crossTileID"},{type:"Int16",name:"associatedIconIndex"}]),Dr([{type:"Int16",name:"anchorX"},{type:"Int16",name:"anchorY"},{type:"Int16",name:"rightJustifiedTextSymbolIndex"},{type:"Int16",name:"centerJustifiedTextSymbolIndex"},{type:"Int16",name:"leftJustifiedTextSymbolIndex"},{type:"Int16",name:"verticalPlacedTextSymbolIndex"},{type:"Int16",name:"placedIconSymbolIndex"},{type:"Int16",name:"verticalPlacedIconSymbolIndex"},{type:"Uint16",name:"key"},{type:"Uint16",name:"textBoxStartIndex"},{type:"Uint16",name:"textBoxEndIndex"},{type:"Uint16",name:"verticalTextBoxStartIndex"},{type:"Uint16",name:"verticalTextBoxEndIndex"},{type:"Uint16",name:"iconBoxStartIndex"},{type:"Uint16",name:"iconBoxEndIndex"},{type:"Uint16",name:"verticalIconBoxStartIndex"},{type:"Uint16",name:"verticalIconBoxEndIndex"},{type:"Uint16",name:"featureIndex"},{type:"Uint16",name:"numHorizontalGlyphVertices"},{type:"Uint16",name:"numVerticalGlyphVertices"},{type:"Uint16",name:"numIconVertices"},{type:"Uint16",name:"numVerticalIconVertices"},{type:"Uint16",name:"useRuntimeCollisionCircles"},{type:"Uint32",name:"crossTileID"},{type:"Float32",name:"textBoxScale"},{type:"Float32",components:2,name:"textOffset"},{type:"Float32",name:"collisionCircleDiameter"}]),Dr([{type:"Float32",name:"offsetX"}]),Dr([{type:"Int16",name:"x"},{type:"Int16",name:"y"},{type:"Int16",name:"tileUnitDistanceFromAnchor"}]);const fh={"!":"\ufe15","#":"\uff03",$:"\uff04","%":"\uff05","&":"\uff06","(":"\ufe35",")":"\ufe36","*":"\uff0a","+":"\uff0b",",":"\ufe10","-":"\ufe32",".":"\u30fb","/":"\uff0f",":":"\ufe13",";":"\ufe14","<":"\ufe3f","=":"\uff1d",">":"\ufe40","?":"\ufe16","@":"\uff20","[":"\ufe47","\\":"\uff3c","]":"\ufe48","^":"\uff3e",_:"\ufe33","`":"\uff40","{":"\ufe37","|":"\u2015","}":"\ufe38","~":"\uff5e","\xa2":"\uffe0","\xa3":"\uffe1","\xa5":"\uffe5","\xa6":"\uffe4","\xac":"\uffe2","\xaf":"\uffe3","\u2013":"\ufe32","\u2014":"\ufe31","\u2018":"\ufe43","\u2019":"\ufe44","\u201c":"\ufe41","\u201d":"\ufe42","\u2026":"\ufe19","\u2027":"\u30fb","\u20a9":"\uffe6","\u3001":"\ufe11","\u3002":"\ufe12","\u3008":"\ufe3f","\u3009":"\ufe40","\u300a":"\ufe3d","\u300b":"\ufe3e","\u300c":"\ufe41","\u300d":"\ufe42","\u300e":"\ufe43","\u300f":"\ufe44","\u3010":"\ufe3b","\u3011":"\ufe3c","\u3014":"\ufe39","\u3015":"\ufe3a","\u3016":"\ufe17","\u3017":"\ufe18","\uff01":"\ufe15","\uff08":"\ufe35","\uff09":"\ufe36","\uff0c":"\ufe10","\uff0d":"\ufe32","\uff0e":"\u30fb","\uff1a":"\ufe13","\uff1b":"\ufe14","\uff1c":"\ufe3f","\uff1e":"\ufe40","\uff1f":"\ufe16","\uff3b":"\ufe47","\uff3d":"\ufe48","\uff3f":"\ufe33","\uff5b":"\ufe37","\uff5c":"\u2015","\uff5d":"\ufe38","\uff5f":"\ufe35","\uff60":"\ufe36","\uff61":"\ufe12","\uff62":"\ufe41","\uff63":"\ufe42"};var cg=Ln,ug=function(l,s,u,f,_){var x,C,M=8*_-f-1,A=(1<>1,O=-7,B=u?_-1:0,H=u?-1:1,q=l[s+B];for(B+=H,x=q&(1<<-O)-1,q>>=-O,O+=M;O>0;x=256*x+l[s+B],B+=H,O-=8);for(C=x&(1<<-O)-1,x>>=-O,O+=f;O>0;C=256*C+l[s+B],B+=H,O-=8);if(0===x)x=1-F;else{if(x===A)return C?NaN:1/0*(q?-1:1);C+=Math.pow(2,f),x-=F}return(q?-1:1)*C*Math.pow(2,x-f)},ph=function(l,s,u,f,_,x){var C,M,A,F=8*x-_-1,O=(1<>1,H=23===_?Math.pow(2,-24)-Math.pow(2,-77):0,q=f?0:x-1,W=f?1:-1,se=s<0||0===s&&1/s<0?1:0;for(s=Math.abs(s),isNaN(s)||s===1/0?(M=isNaN(s)?1:0,C=O):(C=Math.floor(Math.log(s)/Math.LN2),s*(A=Math.pow(2,-C))<1&&(C--,A*=2),(s+=C+B>=1?H/A:H*Math.pow(2,1-B))*A>=2&&(C++,A/=2),C+B>=O?(M=0,C=O):C+B>=1?(M=(s*A-1)*Math.pow(2,_),C+=B):(M=s*Math.pow(2,B-1)*Math.pow(2,_),C=0));_>=8;l[u+q]=255&M,q+=W,M/=256,_-=8);for(C=C<<_|M,F+=_;F>0;l[u+q]=255&C,q+=W,C/=256,F-=8);l[u+q-W]|=128*se};function Ln(l){this.buf=ArrayBuffer.isView&&ArrayBuffer.isView(l)?l:new Uint8Array(l||0),this.pos=0,this.type=0,this.length=this.buf.length}Ln.Varint=0,Ln.Fixed64=1,Ln.Bytes=2,Ln.Fixed32=5;var ol,hg=4294967296,H_=1/hg,Yc=typeof TextDecoder>"u"?null:new TextDecoder("utf8");function ts(l){return l.type===Ln.Bytes?l.readVarint()+l.pos:l.pos+1}function u1(l,s,u){var f=s<=16383?1:s<=2097151?2:s<=268435455?3:Math.floor(Math.log(s)/(7*Math.LN2));u.realloc(f);for(var _=u.pos-1;_>=l;_--)u.buf[_+f]=u.buf[_]}function G_(l,s){for(var u=0;u>>8,l[u+2]=s>>>16,l[u+3]=s>>>24}function dg(l,s){return(l[s]|l[s+1]<<8|l[s+2]<<16)+(l[s+3]<<24)}function k2(l,s,u){1===l&&u.readMessage(g1,s)}function g1(l,s,u){if(3===l){const{id:f,bitmap:_,width:x,height:C,left:M,top:A,advance:F}=u.readMessage(y1,{});s.push({id:f,bitmap:new uh({width:x+6,height:C+6},_),metrics:{width:x,height:C,left:M,top:A,advance:F}})}}function y1(l,s,u){1===l?s.id=u.readVarint():2===l?s.bitmap=u.readBytes():3===l?s.width=u.readVarint():4===l?s.height=u.readVarint():5===l?s.left=u.readSVarint():6===l?s.top=u.readSVarint():7===l&&(s.advance=u.readVarint())}function sp(l){let s=0,u=0;for(const C of l)s+=C.w*C.h,u=Math.max(u,C.w);l.sort((C,M)=>M.h-C.h);const f=[{x:0,y:0,w:Math.max(Math.ceil(Math.sqrt(s/.95)),u),h:1/0}];let _=0,x=0;for(const C of l)for(let M=f.length-1;M>=0;M--){const A=f[M];if(!(C.w>A.w||C.h>A.h)){if(C.x=A.x,C.y=A.y,x=Math.max(x,C.y+C.h),_=Math.max(_,C.x+C.w),C.w===A.w&&C.h===A.h){const F=f.pop();M>3,x=this.pos;this.type=7&f,l(_,s,this),this.pos===x&&this.skip(f)}return s},readMessage:function(l,s){return this.readFields(l,s,this.readVarint()+this.pos)},readFixed32:function(){var l=Ld(this.buf,this.pos);return this.pos+=4,l},readSFixed32:function(){var l=dg(this.buf,this.pos);return this.pos+=4,l},readFixed64:function(){var l=Ld(this.buf,this.pos)+Ld(this.buf,this.pos+4)*hg;return this.pos+=8,l},readSFixed64:function(){var l=Ld(this.buf,this.pos)+dg(this.buf,this.pos+4)*hg;return this.pos+=8,l},readFloat:function(){var l=ug(this.buf,this.pos,!0,23,4);return this.pos+=4,l},readDouble:function(){var l=ug(this.buf,this.pos,!0,52,8);return this.pos+=8,l},readVarint:function(l){var s,u,f=this.buf;return s=127&(u=f[this.pos++]),u<128?s:(s|=(127&(u=f[this.pos++]))<<7,u<128?s:(s|=(127&(u=f[this.pos++]))<<14,u<128?s:(s|=(127&(u=f[this.pos++]))<<21,u<128?s:function(_,x,C){var M,A,F=C.buf;if(M=(112&(A=F[C.pos++]))>>4,A<128||(M|=(127&(A=F[C.pos++]))<<3,A<128)||(M|=(127&(A=F[C.pos++]))<<10,A<128)||(M|=(127&(A=F[C.pos++]))<<17,A<128)||(M|=(127&(A=F[C.pos++]))<<24,A<128)||(M|=(1&(A=F[C.pos++]))<<31,A<128))return function mh(l,s,u){return u?4294967296*s+(l>>>0):4294967296*(s>>>0)+(l>>>0)}(_,M,x);throw new Error("Expected varint not more than 10 bytes")}(s|=(15&(u=f[this.pos]))<<28,l,this))))},readVarint64:function(){return this.readVarint(!0)},readSVarint:function(){var l=this.readVarint();return l%2==1?(l+1)/-2:l/2},readBoolean:function(){return Boolean(this.readVarint())},readString:function(){var l=this.readVarint()+this.pos,s=this.pos;return this.pos=l,l-s>=12&&Yc?Yc.decode(this.buf.subarray(s,l)):function(u,f,_){for(var x="",C=f;C<_;){var M,A,F,O=u[C],B=null,H=O>239?4:O>223?3:O>191?2:1;if(C+H>_)break;1===H?O<128&&(B=O):2===H?128==(192&(M=u[C+1]))&&(B=(31&O)<<6|63&M)<=127&&(B=null):3===H?(A=u[C+2],128==(192&(M=u[C+1]))&&128==(192&A)&&((B=(15&O)<<12|(63&M)<<6|63&A)<=2047||B>=55296&&B<=57343)&&(B=null)):4===H&&(A=u[C+2],F=u[C+3],128==(192&(M=u[C+1]))&&128==(192&A)&&128==(192&F)&&((B=(15&O)<<18|(63&M)<<12|(63&A)<<6|63&F)<=65535||B>=1114112)&&(B=null)),null===B?(B=65533,H=1):B>65535&&(B-=65536,x+=String.fromCharCode(B>>>10&1023|55296),B=56320|1023&B),x+=String.fromCharCode(B),C+=H}return x}(this.buf,s,l)},readBytes:function(){var l=this.readVarint()+this.pos,s=this.buf.subarray(this.pos,l);return this.pos=l,s},readPackedVarint:function(l,s){if(this.type!==Ln.Bytes)return l.push(this.readVarint(s));var u=ts(this);for(l=l||[];this.pos127;);else if(s===Ln.Bytes)this.pos=this.readVarint()+this.pos;else if(s===Ln.Fixed32)this.pos+=4;else{if(s!==Ln.Fixed64)throw new Error("Unimplemented type: "+s);this.pos+=8}},writeTag:function(l,s){this.writeVarint(l<<3|s)},realloc:function(l){for(var s=this.length||16;s268435455||l<0?function(s,u){var f,_,x,M;if(s>=0?(f=s%4294967296|0,_=s/4294967296|0):(_=~(-s/4294967296),4294967295^(f=~(-s%4294967296))?f=f+1|0:(f=0,_=_+1|0)),s>=0x10000000000000000||s<-0x10000000000000000)throw new Error("Given varint doesn't fit into 10 bytes");u.realloc(10),x=f,(M=u).buf[M.pos++]=127&x|128,x>>>=7,M.buf[M.pos++]=127&x|128,x>>>=7,M.buf[M.pos++]=127&x|128,x>>>=7,M.buf[M.pos++]=127&x|128,M.buf[M.pos]=127&(x>>>=7),function(x,C){var M=(7&x)<<4;C.buf[C.pos++]|=M|((x>>>=3)?128:0),x&&(C.buf[C.pos++]=127&x|((x>>>=7)?128:0),x&&(C.buf[C.pos++]=127&x|((x>>>=7)?128:0),x&&(C.buf[C.pos++]=127&x|((x>>>=7)?128:0),x&&(C.buf[C.pos++]=127&x|((x>>>=7)?128:0),x&&(C.buf[C.pos++]=127&x)))))}(_,u)}(l,this):(this.realloc(4),this.buf[this.pos++]=127&l|(l>127?128:0),l<=127||(this.buf[this.pos++]=127&(l>>>=7)|(l>127?128:0),l<=127||(this.buf[this.pos++]=127&(l>>>=7)|(l>127?128:0),l<=127||(this.buf[this.pos++]=l>>>7&127))))},writeSVarint:function(l){this.writeVarint(l<0?2*-l-1:2*l)},writeBoolean:function(l){this.writeVarint(Boolean(l))},writeString:function(l){l=String(l),this.realloc(4*l.length),this.pos++;var s=this.pos;this.pos=function(f,_,x){for(var C,M,A=0;A<_.length;A++){if((C=_.charCodeAt(A))>55295&&C<57344){if(!M){C>56319||A+1===_.length?(f[x++]=239,f[x++]=191,f[x++]=189):M=C;continue}if(C<56320){f[x++]=239,f[x++]=191,f[x++]=189,M=C;continue}C=M-55296<<10|C-56320|65536,M=null}else M&&(f[x++]=239,f[x++]=191,f[x++]=189,M=null);C<128?f[x++]=C:(C<2048?f[x++]=C>>6|192:(C<65536?f[x++]=C>>12|224:(f[x++]=C>>18|240,f[x++]=C>>12&63|128),f[x++]=C>>6&63|128),f[x++]=63&C|128)}return x}(this.buf,l,this.pos);var u=this.pos-s;u>=128&&u1(s,u,this),this.pos=s-1,this.writeVarint(u),this.pos+=u},writeFloat:function(l){this.realloc(4),ph(this.buf,l,this.pos,!0,23,4),this.pos+=4},writeDouble:function(l){this.realloc(8),ph(this.buf,l,this.pos,!0,52,8),this.pos+=8},writeBytes:function(l){var s=l.length;this.writeVarint(s),this.realloc(s);for(var u=0;u=128&&u1(u,f,this),this.pos=u-1,this.writeVarint(f),this.pos+=f},writeMessage:function(l,s,u){this.writeTag(l,Ln.Bytes),this.writeRawMessage(s,u)},writePackedVarint:function(l,s){s.length&&this.writeMessage(l,G_,s)},writePackedSVarint:function(l,s){s.length&&this.writeMessage(l,h1,s)},writePackedBoolean:function(l,s){s.length&&this.writeMessage(l,f1,s)},writePackedFloat:function(l,s){s.length&&this.writeMessage(l,A2,s)},writePackedDouble:function(l,s){s.length&&this.writeMessage(l,d1,s)},writePackedFixed32:function(l,s){s.length&&this.writeMessage(l,p1,s)},writePackedSFixed32:function(l,s){s.length&&this.writeMessage(l,op,s)},writePackedFixed64:function(l,s){s.length&&this.writeMessage(l,q_,s)},writePackedSFixed64:function(l,s){s.length&&this.writeMessage(l,m1,s)},writeBytesField:function(l,s){this.writeTag(l,Ln.Bytes),this.writeBytes(s)},writeFixed32Field:function(l,s){this.writeTag(l,Ln.Fixed32),this.writeFixed32(s)},writeSFixed32Field:function(l,s){this.writeTag(l,Ln.Fixed32),this.writeSFixed32(s)},writeFixed64Field:function(l,s){this.writeTag(l,Ln.Fixed64),this.writeFixed64(s)},writeSFixed64Field:function(l,s){this.writeTag(l,Ln.Fixed64),this.writeSFixed64(s)},writeVarintField:function(l,s){this.writeTag(l,Ln.Varint),this.writeVarint(s)},writeSVarintField:function(l,s){this.writeTag(l,Ln.Varint),this.writeSVarint(s)},writeStringField:function(l,s){this.writeTag(l,Ln.Bytes),this.writeString(s)},writeFloatField:function(l,s){this.writeTag(l,Ln.Fixed32),this.writeFloat(s)},writeDoubleField:function(l,s){this.writeTag(l,Ln.Fixed64),this.writeDouble(s)},writeBooleanField:function(l,s){this.writeVarintField(l,Boolean(s))}};class Z_{constructor(s,{pixelRatio:u,version:f,stretchX:_,stretchY:x,content:C}){this.paddedRect=s,this.pixelRatio=u,this.stretchX=_,this.stretchY=x,this.content=C,this.version=f}get tl(){return[this.paddedRect.x+1,this.paddedRect.y+1]}get br(){return[this.paddedRect.x+this.paddedRect.w-1,this.paddedRect.y+this.paddedRect.h-1]}get tlbr(){return this.tl.concat(this.br)}get displaySize(){return[(this.paddedRect.w-2)/this.pixelRatio,(this.paddedRect.h-2)/this.pixelRatio]}}class _1{constructor(s,u){const f={},_={};this.haveRenderCallbacks=[];const x=[];this.addImages(s,f,x),this.addImages(u,_,x);const{w:C,h:M}=sp(x),A=new Oo({width:C||1,height:M||1});for(const F in s){const O=s[F],B=f[F].paddedRect;Oo.copy(O.data,A,{x:0,y:0},{x:B.x+1,y:B.y+1},O.data)}for(const F in u){const O=u[F],B=_[F].paddedRect,H=B.x+1,q=B.y+1,W=O.data.width,se=O.data.height;Oo.copy(O.data,A,{x:0,y:0},{x:H,y:q},O.data),Oo.copy(O.data,A,{x:0,y:se-1},{x:H,y:q-1},{width:W,height:1}),Oo.copy(O.data,A,{x:0,y:0},{x:H,y:q+se},{width:W,height:1}),Oo.copy(O.data,A,{x:W-1,y:0},{x:H-1,y:q},{width:1,height:se}),Oo.copy(O.data,A,{x:0,y:0},{x:H+W,y:q},{width:1,height:se})}this.image=A,this.iconPositions=f,this.patternPositions=_}addImages(s,u,f){for(const _ in s){const x=s[_],C={x:0,y:0,w:x.data.width+2,h:x.data.height+2};f.push(C),u[_]=new Z_(C,x),x.hasRenderCallback&&this.haveRenderCallbacks.push(_)}}patchUpdatedImages(s,u){s.dispatchRenderCallbacks(this.haveRenderCallbacks);for(const f in s.updatedImages)this.patchUpdatedImage(this.iconPositions[f],s.getImage(f),u),this.patchUpdatedImage(this.patternPositions[f],s.getImage(f),u)}patchUpdatedImage(s,u,f){if(!s||!u||s.version===u.version)return;s.version=u.version;const[_,x]=s.tl;f.update(u.data,void 0,{x:_,y:x})}}ct("ImagePosition",Z_),ct("ImageAtlas",_1),b.WritingMode=void 0,(ol=b.WritingMode||(b.WritingMode={}))[ol.none=0]="none",ol[ol.horizontal=1]="horizontal",ol[ol.vertical=2]="vertical",ol[ol.horizontalOnly=3]="horizontalOnly";class ap{constructor(){this.scale=1,this.fontStack="",this.imageName=null}static forText(s,u){const f=new ap;return f.scale=s||1,f.fontStack=u,f}static forImage(s){const u=new ap;return u.imageName=s,u}}class zd{constructor(){this.text="",this.sectionIndex=[],this.sections=[],this.imageSectionID=null}static fromFeature(s,u){const f=new zd;for(let _=0;_=0&&f>=s&&pg[this.text.charCodeAt(f)];f--)u--;this.text=this.text.substring(s,u),this.sectionIndex=this.sectionIndex.slice(s,u)}substring(s,u){const f=new zd;return f.text=this.text.substring(s,u),f.sectionIndex=this.sectionIndex.slice(s,u),f.sections=this.sections,f}toString(){return this.text}getMaxScale(){return this.sectionIndex.reduce((s,u)=>Math.max(s,this.sections[u].scale),0)}addTextSection(s,u){this.text+=s.text,this.sections.push(ap.forText(s.scale,s.fontStack||u));const f=this.sections.length-1;for(let _=0;_=63743?null:++this.imageSectionID:(this.imageSectionID=57344,this.imageSectionID)}}function fg(l,s,u,f,_,x,C,M,A,F,O,B,H,q,W,se){const oe=zd.fromFeature(l,_);let be;B===b.WritingMode.vertical&&oe.verticalizePunctuation();const{processBidirectionalText:Ce,processStyledBidirectionalText:me}=po;if(Ce&&1===oe.sections.length){be=[];const Ve=Ce(oe.toString(),lp(oe,F,x,s,f,q,W));for(const gt of Ve){const Ct=new zd;Ct.text=gt,Ct.sections=oe.sections;for(let at=0;at0&&ll>Ki&&(Ki=ll)}else{const rs=Ct[Qt.fontStack],vo=rs&&rs[vn];if(vo&&vo.rect)ns=vo.rect,Cs=vo.metrics;else{const ll=gt[Qt.fontStack],xp=ll&&ll[vn];if(!xp)continue;Cs=xp.metrics}ki=24*(gi-Qt.scale)}Ds?(Ve.verticalizable=!0,_o.push({glyph:vn,imageName:Es,x:Kn,y:rr+ki,vertical:Ds,scale:Qt.scale,fontStack:Qt.fontStack,sectionIndex:zo,metrics:Cs,rect:ns}),Kn+=al*Qt.scale+Et):(_o.push({glyph:vn,imageName:Es,x:Kn,y:rr+ki,vertical:Ds,scale:Qt.scale,fontStack:Qt.fontStack,sectionIndex:zo,metrics:Cs,rect:ns}),Kn+=Cs.advance*Qt.scale+Et)}0!==_o.length&&(Or=Math.max(Kn-Et,Or),v1(_o,0,_o.length-1,Ti,Ki)),Kn=0;const hr=Qe*gi+Ki;Yi.lineOffset=Math.max(Ki,Ai),rr+=hr,ws=Math.max(hr,ws),++jr}var Lr;const Kr=rr- -17,{horizontalAlign:Xi,verticalAlign:No}=Wi(ot);(function(Ar,gi,Ai,Yi,_o,Ki,hr,yi,Qt){const zo=(gi-Ai)*_o;let vn=0;vn=Ki!==hr?-yi*Yi- -17:(-Yi*Qt+.5)*hr;for(const ki of Ar)for(const Cs of ki.positionedGlyphs)Cs.x+=zo,Cs.y+=vn})(Ve.positionedLines,Ti,Xi,No,Or,ws,Qe,Kr,tt.length),Ve.top+=-No*Kr,Ve.bottom=Ve.top+Kr,Ve.left+=-Xi*Or,Ve.right=Ve.left+Or}($e,s,u,f,be,C,M,A,B,F,H,se),!function(Ve){for(const gt of Ve)if(0!==gt.positionedGlyphs.length)return!1;return!0}(Ee)&&$e}const pg={9:!0,10:!0,11:!0,12:!0,13:!0,32:!0},P2={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 W_(l,s,u,f,_,x){if(s.imageName){const C=f[s.imageName];return C?C.displaySize[0]*s.scale*24/x+_:0}{const C=u[s.fontStack],M=C&&C[l];return M?M.metrics.advance*s.scale+_:0}}function mg(l,s,u,f){const _=Math.pow(l-s,2);return f?l=0;let O=0;for(let H=0;H-u/2;){if(C--,C<0)return!1;M-=l[C].dist(x),x=l[C]}M+=l[C].dist(l[C+1]),C++;const A=[];let F=0;for(;Mf;)F-=A.shift().angleDelta;if(F>_)return!1;C++,M+=O.dist(B)}return!0}function K_(l){let s=0;for(let u=0;uF){const W=(F-A)/q,se=Xn(B.x,H.x,W),oe=Xn(B.y,H.y,W),be=new ec(se,oe,H.angleTo(B),O);return be._round(),!C||Y_(l,be,M,C,s)?be:void 0}A+=q}}function yo(l,s,u,f,_,x,C,M,A){const F=vg(f,x,C),O=J_(f,_),B=O*C,H=0===l[0].x||l[0].x===A||0===l[0].y||l[0].y===A;return s-B=0&&Ee=0&&$e=0&&H+F<=O){const Ve=new ec(Ee,$e,Ce,W);Ve._round(),f&&!Y_(l,Ve,x,f,_)||q.push(Ve)}}B+=be}return M||q.length||C||(q=up(l,B/2,u,f,_,x,C,!0,A)),q}function bg(l,s,u,f,_){const x=[];for(let C=0;C=f&&B.x>=f||(O.x>=f?O=new Tt(f,O.y+(f-O.x)/(B.x-O.x)*(B.y-O.y))._round():B.x>=f&&(B=new Tt(f,O.y+(f-O.x)/(B.x-O.x)*(B.y-O.y))._round()),O.y>=_&&B.y>=_||(O.y>=_?O=new Tt(O.x+(_-O.y)/(B.y-O.y)*(B.x-O.x),_)._round():B.y>=_&&(B=new Tt(O.x+(_-O.y)/(B.y-O.y)*(B.x-O.x),_)._round()),A&&O.equals(A[A.length-1])||(A=[O],x.push(A)),A.push(B)))))}}return x}function hp(l,s,u,f){const _=[],x=l.image,C=x.pixelRatio,M=x.paddedRect.w-2,A=x.paddedRect.h-2,F=l.right-l.left,O=l.bottom-l.top,B=x.stretchX||[[0,M]],H=x.stretchY||[[0,A]],q=(Qe,ot)=>Qe+ot[1]-ot[0],W=B.reduce(q,0),se=H.reduce(q,0),oe=M-W,be=A-se;let Ce=0,me=W,Ee=0,$e=se,Ve=0,gt=oe,Ct=0,at=be;if(x.content&&f){const Qe=x.content;Ce=ui(B,0,Qe[0]),Ee=ui(H,0,Qe[1]),me=ui(B,Qe[0],Qe[2]),$e=ui(H,Qe[1],Qe[3]),Ve=Qe[0]-Ce,Ct=Qe[1]-Ee,gt=Qe[2]-Qe[0]-me,at=Qe[3]-Qe[1]-$e}const tt=(Qe,ot,it,Ge)=>{const Et=Bd(Qe.stretch-Ce,me,F,l.left),pt=dp(Qe.fixed-Ve,gt,Qe.stretch,W),Yt=Bd(ot.stretch-Ee,$e,O,l.top),Kn=dp(ot.fixed-Ct,at,ot.stretch,se),rr=Bd(it.stretch-Ce,me,F,l.left),Or=dp(it.fixed-Ve,gt,it.stretch,W),ws=Bd(Ge.stretch-Ee,$e,O,l.top),Ti=dp(Ge.fixed-Ct,at,Ge.stretch,se),jr=new Tt(Et,Yt),Lr=new Tt(rr,Yt),Kr=new Tt(rr,ws),Xi=new Tt(Et,ws),No=new Tt(pt/C,Kn/C),Ar=new Tt(Or/C,Ti/C),gi=s*Math.PI/180;if(gi){const _o=Math.sin(gi),Ki=Math.cos(gi),hr=[Ki,-_o,_o,Ki];jr._matMult(hr),Lr._matMult(hr),Xi._matMult(hr),Kr._matMult(hr)}const Ai=Qe.stretch+Qe.fixed,Yi=ot.stretch+ot.fixed;return{tl:jr,tr:Lr,bl:Xi,br:Kr,tex:{x:x.paddedRect.x+1+Ai,y:x.paddedRect.y+1+Yi,w:it.stretch+it.fixed-Ai,h:Ge.stretch+Ge.fixed-Yi},writingMode:void 0,glyphOffset:[0,0],sectionIndex:0,pixelOffsetTL:No,pixelOffsetBR:Ar,minFontScaleX:gt/C/F,minFontScaleY:at/C/O,isSDF:u}};if(f&&(x.stretchX||x.stretchY)){const Qe=yh(B,oe,W),ot=yh(H,be,se);for(let it=0;it0&&(W=Math.max(10,W),this.circleDiameter=W)}else{let B=C.top*M-A[0],H=C.bottom*M+A[2],q=C.left*M-A[3],W=C.right*M+A[1];const se=C.collisionPadding;if(se&&(q-=se[0]*M,B-=se[1]*M,W+=se[2]*M,H+=se[3]*M),O){const oe=new Tt(q,B),be=new Tt(W,B),Ce=new Tt(q,H),me=new Tt(W,H),Ee=O*Math.PI/180;oe._rotate(Ee),be._rotate(Ee),Ce._rotate(Ee),me._rotate(Ee),q=Math.min(oe.x,be.x,Ce.x,me.x),W=Math.max(oe.x,be.x,Ce.x,me.x),B=Math.min(oe.y,be.y,Ce.y,me.y),H=Math.max(oe.y,be.y,Ce.y,me.y)}s.emplaceBack(u.x,u.y,q,B,W,H,f,_,x)}this.boxEndIndex=s.length}}class Q_{constructor(s=[],u=w1){if(this.data=s,this.length=this.data.length,this.compare=u,this.length>0)for(let f=(this.length>>1)-1;f>=0;f--)this._down(f)}push(s){this.data.push(s),this.length++,this._up(this.length-1)}pop(){if(0===this.length)return;const s=this.data[0],u=this.data.pop();return this.length--,this.length>0&&(this.data[0]=u,this._down(0)),s}peek(){return this.data[0]}_up(s){const{data:u,compare:f}=this,_=u[s];for(;s>0;){const x=s-1>>1,C=u[x];if(f(_,C)>=0)break;u[s]=C,s=x}u[s]=_}_down(s){const{data:u,compare:f}=this,_=this.length>>1,x=u[s];for(;s<_;){let C=1+(s<<1),M=u[C];const A=C+1;if(A=0)break;u[s]=M,s=C}u[s]=x}}function w1(l,s){return ls?1:0}function ev(l,s=1,u=!1){let f=1/0,_=1/0,x=-1/0,C=-1/0;const M=l[0];for(let q=0;qx)&&(x=W.x),(!q||W.y>C)&&(C=W.y)}const A=Math.min(x-f,C-_);let F=A/2;const O=new Q_([],C1);if(0===A)return new Tt(f,_);for(let q=f;qB.d||!B.d)&&(B=q,u&&console.log("found best %d after %d probes",Math.round(1e4*q.d)/1e4,H)),q.max-B.d<=s||(F=q.h/2,O.push(new Kc(q.p.x-F,q.p.y-F,F,l)),O.push(new Kc(q.p.x+F,q.p.y-F,F,l)),O.push(new Kc(q.p.x-F,q.p.y+F,F,l)),O.push(new Kc(q.p.x+F,q.p.y+F,F,l)),H+=4)}return u&&(console.log(`num probes: ${H}`),console.log(`best distance: ${B.d}`)),B.p}function C1(l,s){return s.max-l.max}function Kc(l,s,u,f){this.p=new Tt(l,s),this.h=u,this.d=function(_,x){let C=!1,M=1/0;for(let A=0;A_.y!=W.y>_.y&&_.x<(W.x-q.x)*(_.y-q.y)/(W.y-q.y)+q.x&&(C=!C),M=Math.min(M,tr(_,q,W))}}return(C?1:-1)*Math.sqrt(M)}(this.p,f),this.max=this.d+this.h*Math.SQRT2}const xg=Number.POSITIVE_INFINITY;function tv(l,s){return s[1]!==xg?function(u,f,_){let x=0,C=0;switch(f=Math.abs(f),_=Math.abs(_),u){case"top-right":case"top-left":case"top":C=_-7;break;case"bottom-right":case"bottom-left":case"bottom":C=7-_}switch(u){case"top-right":case"bottom-right":case"right":x=-f;break;case"top-left":case"bottom-left":case"left":x=f}return[x,C]}(l,s[0],s[1]):function(u,f){let _=0,x=0;f<0&&(f=0);const C=f/Math.sqrt(2);switch(u){case"top-right":case"top-left":x=C-7;break;case"bottom-right":case"bottom-left":x=7-C;break;case"bottom":x=7-f;break;case"top":x=f-7}switch(u){case"top-right":case"bottom-right":_=-C;break;case"top-left":case"bottom-left":_=C;break;case"left":_=f;break;case"right":_=-f}return[_,x]}(l,s[0])}function Vd(l){switch(l){case"right":case"top-right":case"bottom-right":return"right";case"left":case"top-left":case"bottom-left":return"left"}return"center"}function wg(l,s,u,f,_,x,C,M,A,F,O){let B=x.textMaxSize.evaluate(s,{});void 0===B&&(B=C);const H=l.layers[0].layout,q=H.get("icon-offset").evaluate(s,{},O),W=nv(u.horizontal),se=C/24,oe=l.tilePixelRatio*se,be=l.tilePixelRatio*B/24,Ce=l.tilePixelRatio*M,me=l.tilePixelRatio*H.get("symbol-spacing"),Ee=H.get("text-padding")*l.tilePixelRatio,$e=function(Ge,Et,pt,Yt=1){const Kn=Ge.get("icon-padding").evaluate(Et,{},pt),rr=Kn&&Kn.values;return[rr[0]*Yt,rr[1]*Yt,rr[2]*Yt,rr[3]*Yt]}(H,s,O,l.tilePixelRatio),Ve=H.get("text-max-angle")/180*Math.PI,gt="viewport"!==H.get("text-rotation-alignment")&&"point"!==H.get("symbol-placement"),Ct="map"===H.get("icon-rotation-alignment")&&"point"!==H.get("symbol-placement"),at=H.get("symbol-placement"),tt=me/2,Qe=H.get("icon-text-fit");let ot;f&&"none"!==Qe&&(l.allowVerticalPlacement&&u.vertical&&(ot=X_(f,u.vertical,Qe,H.get("icon-text-fit-padding"),q,se)),W&&(f=X_(f,W,Qe,H.get("icon-text-fit-padding"),q,se)));const it=(Ge,Et)=>{Et.x<0||Et.x>=_n||Et.y<0||Et.y>=_n||function(pt,Yt,Kn,rr,Or,ws,Ti,jr,Lr,Kr,Xi,No,Ar,gi,Ai,Yi,_o,Ki,hr,yi,Qt,zo,vn,ki,Cs){const ns=pt.addToLineVertexArray(Yt,Kn);let Es,al,Ds,rs,vo=0,ll=0,xp=0,R1=0,Qc=-1,Wd=-1;const xa={};let Og=j(""),wp=0,Lg=0;if(void 0===jr._unevaluatedLayout.getValue("text-radial-offset")?[wp,Lg]=jr.layout.get("text-offset").evaluate(Qt,{},ki).map(bo=>24*bo):(wp=24*jr.layout.get("text-radial-offset").evaluate(Qt,{},ki),Lg=xg),pt.allowVerticalPlacement&&rr.vertical){const bo=jr.layout.get("text-rotate").evaluate(Qt,{},ki)+90;Ds=new fp(Lr,Yt,Kr,Xi,No,rr.vertical,Ar,gi,Ai,bo),Ti&&(rs=new fp(Lr,Yt,Kr,Xi,No,Ti,_o,Ki,Ai,bo))}if(Or){const bo=jr.layout.get("icon-rotate").evaluate(Qt,{}),Ss="none"!==jr.layout.get("icon-text-fit"),ac=hp(Or,bo,vn,Ss),Ms=Ti?hp(Ti,bo,vn,Ss):void 0;al=new fp(Lr,Yt,Kr,Xi,No,Or,_o,Ki,!1,bo),vo=4*ac.length;const Vg=pt.iconSizeData;let cl=null;"source"===Vg.kind?(cl=[ba*jr.layout.get("icon-size").evaluate(Qt,{})],cl[0]>tc&&pn(`${pt.layerIds[0]}: Value for "icon-size" is >= 255. Reduce your "icon-size".`)):"composite"===Vg.kind&&(cl=[ba*zo.compositeIconSizes[0].evaluate(Qt,{},ki),ba*zo.compositeIconSizes[1].evaluate(Qt,{},ki)],(cl[0]>tc||cl[1]>tc)&&pn(`${pt.layerIds[0]}: Value for "icon-size" is >= 255. Reduce your "icon-size".`)),pt.addSymbols(pt.icon,ac,cl,yi,hr,Qt,b.WritingMode.none,Yt,ns.lineStartIndex,ns.lineLength,-1,ki),Qc=pt.icon.placedSymbolArray.length-1,Ms&&(ll=4*Ms.length,pt.addSymbols(pt.icon,Ms,cl,yi,hr,Qt,b.WritingMode.vertical,Yt,ns.lineStartIndex,ns.lineLength,-1,ki),Wd=pt.icon.placedSymbolArray.length-1)}const Ng=Object.keys(rr.horizontal);for(const bo of Ng){const Ss=rr.horizontal[bo];if(!Es){Og=j(Ss.text);const Ms=jr.layout.get("text-rotate").evaluate(Qt,{},ki);Es=new fp(Lr,Yt,Kr,Xi,No,Ss,Ar,gi,Ai,Ms)}const ac=1===Ss.positionedLines.length;if(xp+=Cg(pt,Yt,Ss,ws,jr,Ai,Qt,Yi,ns,rr.vertical?b.WritingMode.horizontal:b.WritingMode.horizontalOnly,ac?Ng:[bo],xa,Qc,zo,ki),ac)break}rr.vertical&&(R1+=Cg(pt,Yt,rr.vertical,ws,jr,Ai,Qt,Yi,ns,b.WritingMode.vertical,["vertical"],xa,Wd,zo,ki));const uv=Es?Es.boxStartIndex:pt.collisionBoxArray.length,zg=Es?Es.boxEndIndex:pt.collisionBoxArray.length,R2=Ds?Ds.boxStartIndex:pt.collisionBoxArray.length,F1=Ds?Ds.boxEndIndex:pt.collisionBoxArray.length,Bg=al?al.boxStartIndex:pt.collisionBoxArray.length,hv=al?al.boxEndIndex:pt.collisionBoxArray.length,dv=rs?rs.boxStartIndex:pt.collisionBoxArray.length,eu=rs?rs.boxEndIndex:pt.collisionBoxArray.length;let Ws=-1;const wh=(bo,Ss)=>bo&&bo.circleDiameter?Math.max(bo.circleDiameter,Ss):Ss;Ws=wh(Es,Ws),Ws=wh(Ds,Ws),Ws=wh(al,Ws),Ws=wh(rs,Ws);const Xd=Ws>-1?1:0;Xd&&(Ws*=Cs/24),pt.glyphOffsetArray.length>=rc.MAX_GLYPHS&&pn("Too many glyphs being rendered in a tile. See https://github.com/mapbox/mapbox-gl-js/issues/2907"),void 0!==Qt.sortKey&&pt.addToSortKeyRanges(pt.symbolInstances.length,Qt.sortKey),pt.symbolInstances.emplaceBack(Yt.x,Yt.y,xa.right>=0?xa.right:-1,xa.center>=0?xa.center:-1,xa.left>=0?xa.left:-1,xa.vertical||-1,Qc,Wd,Og,uv,zg,R2,F1,Bg,hv,dv,eu,Kr,xp,R1,vo,ll,Xd,0,Ar,wp,Lg,Ws)}(l,Et,Ge,u,f,_,ot,l.layers[0],l.collisionBoxArray,s.index,s.sourceLayerIndex,l.index,oe,[Ee,Ee,Ee,Ee],gt,A,Ce,$e,Ct,q,s,x,F,O,C)};if("line"===at)for(const Ge of bg(s.geometry,0,0,_n,_n)){const Et=yo(Ge,me,Ve,u.vertical||W,f,24,be,l.overscaling,_n);for(const pt of Et)W&&Ud(l,W.text,tt,pt)||it(Ge,pt)}else if("line-center"===at){for(const Ge of s.geometry)if(Ge.length>1){const Et=x1(Ge,Ve,u.vertical||W,f,24,be);Et&&it(Ge,Et)}}else if("Polygon"===s.type)for(const Ge of Id(s.geometry,0)){const Et=ev(Ge,16);it(Ge[0],new ec(Et.x,Et.y,0))}else if("LineString"===s.type)for(const Ge of s.geometry)it(Ge,new ec(Ge[0].x,Ge[0].y,0));else if("Point"===s.type)for(const Ge of s.geometry)for(const Et of Ge)it([Et],new ec(Et.x,Et.y,0))}const tc=32640;function Cg(l,s,u,f,_,x,C,M,A,F,O,B,H,q,W){const se=function(Ce,me,Ee,$e,Ve,gt,Ct,at){const tt=$e.layout.get("text-rotate").evaluate(gt,{})*Math.PI/180,Qe=[];for(const ot of me.positionedLines)for(const it of ot.positionedGlyphs){if(!it.rect)continue;const Ge=it.rect||{};let Et=4,pt=!0,Yt=1,Kn=0;const rr=(Ve||at)&&it.vertical,Or=it.metrics.advance*it.scale/2;if(at&&me.verticalizable&&(Kn=ot.lineOffset/2-(it.imageName?-(24-it.metrics.width*it.scale)/2:24*(it.scale-1))),it.imageName){const hr=Ct[it.imageName];pt=hr.sdf,Yt=hr.pixelRatio,Et=1/Yt}const ws=Ve?[it.x+Or,it.y]:[0,0];let Ti=Ve?[0,0]:[it.x+Or+Ee[0],it.y+Ee[1]-Kn],jr=[0,0];rr&&(jr=Ti,Ti=[0,0]);const Lr=(it.metrics.left-Et)*it.scale-Or+Ti[0],Kr=(-it.metrics.top-Et)*it.scale+Ti[1],Xi=Lr+Ge.w*it.scale/Yt,No=Kr+Ge.h*it.scale/Yt,Ar=new Tt(Lr,Kr),gi=new Tt(Xi,Kr),Ai=new Tt(Lr,No),Yi=new Tt(Xi,No);if(rr){const hr=new Tt(-Or,Or- -17),yi=-Math.PI/2,Qt=12-Or,zo=new Tt(22-Qt,-(it.imageName?Qt:0)),vn=new Tt(...jr);Ar._rotateAround(yi,hr)._add(zo)._add(vn),gi._rotateAround(yi,hr)._add(zo)._add(vn),Ai._rotateAround(yi,hr)._add(zo)._add(vn),Yi._rotateAround(yi,hr)._add(zo)._add(vn)}if(tt){const hr=Math.sin(tt),yi=Math.cos(tt),Qt=[yi,-hr,hr,yi];Ar._matMult(Qt),gi._matMult(Qt),Ai._matMult(Qt),Yi._matMult(Qt)}const _o=new Tt(0,0),Ki=new Tt(0,0);Qe.push({tl:Ar,tr:gi,bl:Ai,br:Yi,tex:Ge,writingMode:me.writingMode,glyphOffset:ws,sectionIndex:it.sectionIndex,isSDF:pt,pixelOffsetTL:_o,pixelOffsetBR:Ki,minFontScaleX:0,minFontScaleY:0})}return Qe}(0,u,M,_,x,C,f,l.allowVerticalPlacement),oe=l.textSizeData;let be=null;"source"===oe.kind?(be=[ba*_.layout.get("text-size").evaluate(C,{})],be[0]>tc&&pn(`${l.layerIds[0]}: Value for "text-size" is >= 255. Reduce your "text-size".`)):"composite"===oe.kind&&(be=[ba*q.compositeTextSizes[0].evaluate(C,{},W),ba*q.compositeTextSizes[1].evaluate(C,{},W)],(be[0]>tc||be[1]>tc)&&pn(`${l.layerIds[0]}: Value for "text-size" is >= 255. Reduce your "text-size".`)),l.addSymbols(l.text,se,be,M,x,C,F,s,A.lineStartIndex,A.lineLength,H,W);for(const Ce of O)B[Ce]=l.text.placedSymbolArray.length-1;return 4*se.length}function nv(l){for(const s in l)return l[s];return null}function Ud(l,s,u,f){const _=l.compareText;if(s in _){const x=_[s];for(let C=x.length-1;C>=0;C--)if(f.dist(x[C])C.id),this.index=s.index,this.pixelRatio=s.pixelRatio,this.sourceLayerIndex=s.sourceLayerIndex,this.hasPattern=!1,this.hasRTLText=!1,this.sortKeyRanges=[],this.collisionCircleArray=[],this.placementInvProjMatrix=qf([]),this.placementViewportMatrix=qf([]);const u=this.layers[0]._unevaluatedLayout._values;this.textSizeData=cp(this.zoom,u["text-size"]),this.iconSizeData=cp(this.zoom,u["icon-size"]);const f=this.layers[0].layout,_=f.get("symbol-sort-key"),x=f.get("symbol-z-order");this.canOverlap="never"!==Dg(f,"text-overlap","text-allow-overlap")||"never"!==Dg(f,"icon-overlap","icon-allow-overlap")||f.get("text-ignore-placement")||f.get("icon-ignore-placement"),this.sortFeaturesByKey="viewport-y"!==x&&!_.isConstant(),this.sortFeaturesByY=("viewport-y"===x||"auto"===x&&!this.sortFeaturesByKey)&&this.canOverlap,"point"===f.get("symbol-placement")&&(this.writingModes=f.get("text-writing-mode").map(C=>b.WritingMode[C])),this.stateDependentLayerIds=this.layers.filter(C=>C.isStateDependent()).map(C=>C.id),this.sourceID=s.sourceID}createArrays(){this.text=new iv(new Ht(this.layers,this.zoom,s=>/^text/.test(s))),this.icon=new iv(new Ht(this.layers,this.zoom,s=>/^icon/.test(s))),this.glyphOffsetArray=new en,this.lineVertexArray=new ma,this.symbolInstances=new He}calculateGlyphDependencies(s,u,f,_,x){for(let C=0;C0)&&("constant"!==C.value.kind||C.value.value.length>0),O="constant"!==A.value.kind||!!A.value.value||Object.keys(A.parameters).length>0,B=x.get("symbol-sort-key");if(this.features=[],!F&&!O)return;const H=u.iconDependencies,q=u.glyphDependencies,W=u.availableImages,se=new cr(this.zoom);for(const{feature:oe,id:be,index:Ce,sourceLayerIndex:me}of s){const Ee=_._featureFilter.needGeometry,$e=li(oe,Ee);if(!_._featureFilter.filter(se,$e,f))continue;let Ve,gt;if(Ee||($e.geometry=vr(oe)),F){const at=_.getValueAndResolveTokens("text-field",$e,f,W),tt=Zr.factory(at);rv(tt)&&(this.hasRTLText=!0),(!this.hasRTLText||"unavailable"===Gl()||this.hasRTLText&&po.isParsed())&&(Ve=Od(tt,_,$e))}if(O){const at=_.getValueAndResolveTokens("icon-image",$e,f,W);gt=at instanceof pi?at:pi.fromString(at)}if(!Ve&&!gt)continue;const Ct=this.sortFeaturesByKey?B.evaluate($e,{},f):void 0;if(this.features.push({id:be,text:Ve,icon:gt,index:Ce,sourceLayerIndex:me,geometry:$e.geometry,properties:oe.properties,type:E1[oe.type],sortKey:Ct}),gt&&(H[gt.name]=!0),Ve){const at=C.evaluate($e,{},f).join(","),tt="viewport"!==x.get("text-rotation-alignment")&&"point"!==x.get("symbol-placement");this.allowVerticalPlacement=this.writingModes&&this.writingModes.indexOf(b.WritingMode.vertical)>=0;for(const Qe of Ve.sections)if(Qe.image)H[Qe.image.name]=!0;else{const ot=ho(Ve.toString()),it=Qe.fontStack||at,Ge=q[it]=q[it]||{};this.calculateGlyphDependencies(Qe.text,Ge,tt,this.allowVerticalPlacement,ot)}}}"line"===x.get("symbol-placement")&&(this.features=function(oe){const be={},Ce={},me=[];let Ee=0;function $e(at){me.push(oe[at]),Ee++}function Ve(at,tt,Qe){const ot=Ce[at];return delete Ce[at],Ce[tt]=ot,me[ot].geometry[0].pop(),me[ot].geometry[0]=me[ot].geometry[0].concat(Qe[0]),ot}function gt(at,tt,Qe){const ot=be[tt];return delete be[tt],be[at]=ot,me[ot].geometry[0].shift(),me[ot].geometry[0]=Qe[0].concat(me[ot].geometry[0]),ot}function Ct(at,tt,Qe){const ot=Qe?tt[0][tt[0].length-1]:tt[0][0];return`${at}:${ot.x}:${ot.y}`}for(let at=0;atat.geometry)}(this.features)),this.sortFeaturesByKey&&this.features.sort((oe,be)=>oe.sortKey-be.sortKey)}update(s,u,f){this.stateDependentLayers.length&&(this.text.programConfigurations.updatePaintArrays(s,u,this.layers,f),this.icon.programConfigurations.updatePaintArrays(s,u,this.layers,f))}isEmpty(){return 0===this.symbolInstances.length&&!this.hasRTLText}uploadPending(){return!this.uploaded||this.text.programConfigurations.needsUpload||this.icon.programConfigurations.needsUpload}upload(s){!this.uploaded&&this.hasDebugData()&&(this.textCollisionBox.upload(s),this.iconCollisionBox.upload(s)),this.text.upload(s,this.sortFeaturesByY,!this.uploaded,this.text.programConfigurations.needsUpload),this.icon.upload(s,this.sortFeaturesByY,!this.uploaded,this.icon.programConfigurations.needsUpload),this.uploaded=!0}destroyDebugData(){this.textCollisionBox.destroy(),this.iconCollisionBox.destroy()}destroy(){this.text.destroy(),this.icon.destroy(),this.hasDebugData()&&this.destroyDebugData()}addToLineVertexArray(s,u){const f=this.lineVertexArray.length;if(void 0!==s.segment){let _=s.dist(u[s.segment+1]),x=s.dist(u[s.segment]);const C={};for(let M=s.segment+1;M=0;M--)C[M]={x:u[M].x,y:u[M].y,tileUnitDistanceFromAnchor:x},M>0&&(x+=u[M-1].dist(u[M]));for(let M=0;M0}hasIconData(){return this.icon.segments.get().length>0}hasDebugData(){return this.textCollisionBox&&this.iconCollisionBox}hasTextCollisionBoxData(){return this.hasDebugData()&&this.textCollisionBox.segments.get().length>0}hasIconCollisionBoxData(){return this.hasDebugData()&&this.iconCollisionBox.segments.get().length>0}addIndicesForPlacedSymbol(s,u){const f=s.placedSymbolArray.get(u),_=f.vertexStartIndex+4*f.numGlyphs;for(let x=f.vertexStartIndex;x<_;x+=4)s.indexArray.emplaceBack(x,x+1,x+2),s.indexArray.emplaceBack(x+1,x+2,x+3)}getSortedSymbolIndexes(s){if(this.sortedAngle===s&&void 0!==this.symbolInstanceIndexes)return this.symbolInstanceIndexes;const u=Math.sin(s),f=Math.cos(s),_=[],x=[],C=[];for(let M=0;M_[M]-_[A]||x[A]-x[M]),C}addToSortKeyRanges(s,u){const f=this.sortKeyRanges[this.sortKeyRanges.length-1];f&&f.sortKey===u?f.symbolInstanceEnd=s+1:this.sortKeyRanges.push({sortKey:u,symbolInstanceStart:s,symbolInstanceEnd:s+1})}sortFeatures(s){if(this.sortFeaturesByY&&this.sortedAngle!==s&&!(this.text.segments.get().length>1||this.icon.segments.get().length>1)){this.symbolInstanceIndexes=this.getSortedSymbolIndexes(s),this.sortedAngle=s,this.text.indexArray.clear(),this.icon.indexArray.clear(),this.featureSortOrder=[];for(const u of this.symbolInstanceIndexes){const f=this.symbolInstances.get(u);this.featureSortOrder.push(f.featureIndex),[f.rightJustifiedTextSymbolIndex,f.centerJustifiedTextSymbolIndex,f.leftJustifiedTextSymbolIndex].forEach((_,x,C)=>{_>=0&&C.indexOf(_)===x&&this.addIndicesForPlacedSymbol(this.text,_)}),f.verticalPlacedTextSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.text,f.verticalPlacedTextSymbolIndex),f.placedIconSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.icon,f.placedIconSymbolIndex),f.verticalPlacedIconSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.icon,f.verticalPlacedIconSymbolIndex)}this.text.indexBuffer&&this.text.indexBuffer.updateData(this.text.indexArray),this.icon.indexBuffer&&this.icon.indexBuffer.updateData(this.icon.indexArray)}}}ct("SymbolBucket",rc,{omit:["layers","collisionBoxArray","features","compareText"]}),rc.MAX_GLYPHS=65535,rc.addDynamicAttributes=$d;const ov=new Di({"symbol-placement":new wt(Ae.layout_symbol["symbol-placement"]),"symbol-spacing":new wt(Ae.layout_symbol["symbol-spacing"]),"symbol-avoid-edges":new wt(Ae.layout_symbol["symbol-avoid-edges"]),"symbol-sort-key":new yt(Ae.layout_symbol["symbol-sort-key"]),"symbol-z-order":new wt(Ae.layout_symbol["symbol-z-order"]),"icon-allow-overlap":new wt(Ae.layout_symbol["icon-allow-overlap"]),"icon-overlap":new wt(Ae.layout_symbol["icon-overlap"]),"icon-ignore-placement":new wt(Ae.layout_symbol["icon-ignore-placement"]),"icon-optional":new wt(Ae.layout_symbol["icon-optional"]),"icon-rotation-alignment":new wt(Ae.layout_symbol["icon-rotation-alignment"]),"icon-size":new yt(Ae.layout_symbol["icon-size"]),"icon-text-fit":new wt(Ae.layout_symbol["icon-text-fit"]),"icon-text-fit-padding":new wt(Ae.layout_symbol["icon-text-fit-padding"]),"icon-image":new yt(Ae.layout_symbol["icon-image"]),"icon-rotate":new yt(Ae.layout_symbol["icon-rotate"]),"icon-padding":new yt(Ae.layout_symbol["icon-padding"]),"icon-keep-upright":new wt(Ae.layout_symbol["icon-keep-upright"]),"icon-offset":new yt(Ae.layout_symbol["icon-offset"]),"icon-anchor":new yt(Ae.layout_symbol["icon-anchor"]),"icon-pitch-alignment":new wt(Ae.layout_symbol["icon-pitch-alignment"]),"text-pitch-alignment":new wt(Ae.layout_symbol["text-pitch-alignment"]),"text-rotation-alignment":new wt(Ae.layout_symbol["text-rotation-alignment"]),"text-field":new yt(Ae.layout_symbol["text-field"]),"text-font":new yt(Ae.layout_symbol["text-font"]),"text-size":new yt(Ae.layout_symbol["text-size"]),"text-max-width":new yt(Ae.layout_symbol["text-max-width"]),"text-line-height":new wt(Ae.layout_symbol["text-line-height"]),"text-letter-spacing":new yt(Ae.layout_symbol["text-letter-spacing"]),"text-justify":new yt(Ae.layout_symbol["text-justify"]),"text-radial-offset":new yt(Ae.layout_symbol["text-radial-offset"]),"text-variable-anchor":new wt(Ae.layout_symbol["text-variable-anchor"]),"text-anchor":new yt(Ae.layout_symbol["text-anchor"]),"text-max-angle":new wt(Ae.layout_symbol["text-max-angle"]),"text-writing-mode":new wt(Ae.layout_symbol["text-writing-mode"]),"text-rotate":new yt(Ae.layout_symbol["text-rotate"]),"text-padding":new wt(Ae.layout_symbol["text-padding"]),"text-keep-upright":new wt(Ae.layout_symbol["text-keep-upright"]),"text-transform":new yt(Ae.layout_symbol["text-transform"]),"text-offset":new yt(Ae.layout_symbol["text-offset"]),"text-allow-overlap":new wt(Ae.layout_symbol["text-allow-overlap"]),"text-overlap":new wt(Ae.layout_symbol["text-overlap"]),"text-ignore-placement":new wt(Ae.layout_symbol["text-ignore-placement"]),"text-optional":new wt(Ae.layout_symbol["text-optional"])});var Eg={paint:new Di({"icon-opacity":new yt(Ae.paint_symbol["icon-opacity"]),"icon-color":new yt(Ae.paint_symbol["icon-color"]),"icon-halo-color":new yt(Ae.paint_symbol["icon-halo-color"]),"icon-halo-width":new yt(Ae.paint_symbol["icon-halo-width"]),"icon-halo-blur":new yt(Ae.paint_symbol["icon-halo-blur"]),"icon-translate":new wt(Ae.paint_symbol["icon-translate"]),"icon-translate-anchor":new wt(Ae.paint_symbol["icon-translate-anchor"]),"text-opacity":new yt(Ae.paint_symbol["text-opacity"]),"text-color":new yt(Ae.paint_symbol["text-color"],{runtimeType:io,getOverride:l=>l.textColor,hasOverride:l=>!!l.textColor}),"text-halo-color":new yt(Ae.paint_symbol["text-halo-color"]),"text-halo-width":new yt(Ae.paint_symbol["text-halo-width"]),"text-halo-blur":new yt(Ae.paint_symbol["text-halo-blur"]),"text-translate":new wt(Ae.paint_symbol["text-translate"]),"text-translate-anchor":new wt(Ae.paint_symbol["text-translate-anchor"])}),layout:ov};class pp{constructor(s){if(void 0===s.property.overrides)throw new Error("overrides must be provided to instantiate FormatSectionOverride class");this.type=s.property.overrides?s.property.overrides.runtimeType:fs,this.defaultValue=s}evaluate(s){if(s.formattedSection){const u=this.defaultValue.property.overrides;if(u&&u.hasOverride(s.formattedSection))return u.getOverride(s.formattedSection)}return s.feature&&s.featureState?this.defaultValue.evaluate(s.feature,s.featureState):this.defaultValue.property.specification.default}eachChild(s){this.defaultValue.isConstant()||s(this.defaultValue.value._styleExpression.expression)}outputDefined(){return!1}serialize(){return null}}ct("FormatSectionOverride",pp,{omit:["defaultValue"]});class mp extends Ko{constructor(s){super(s,Eg)}recalculate(s,u){if(super.recalculate(s,u),"auto"===this.layout.get("icon-rotation-alignment")&&(this.layout._values["icon-rotation-alignment"]="point"!==this.layout.get("symbol-placement")?"map":"viewport"),"auto"===this.layout.get("text-rotation-alignment")&&(this.layout._values["text-rotation-alignment"]="point"!==this.layout.get("symbol-placement")?"map":"viewport"),"auto"===this.layout.get("text-pitch-alignment")&&(this.layout._values["text-pitch-alignment"]="map"===this.layout.get("text-rotation-alignment")?"map":"viewport"),"auto"===this.layout.get("icon-pitch-alignment")&&(this.layout._values["icon-pitch-alignment"]=this.layout.get("icon-rotation-alignment")),"point"===this.layout.get("symbol-placement")){const f=this.layout.get("text-writing-mode");if(f){const _=[];for(const x of f)_.indexOf(x)<0&&_.push(x);this.layout._values["text-writing-mode"]=_}else this.layout._values["text-writing-mode"]=["horizontal"]}this._setPaintOverrides()}getValueAndResolveTokens(s,u,f,_){const x=this.layout.get(s).evaluate(u,{},f,_),C=this._unevaluatedLayout._values[s];return C.isDataDriven()||Cn(C.value)||!x?x:(M=u.properties,x.replace(/{([^{}]+)}/g,(F,O)=>O in M?String(M[O]):""));var M}createBucket(s){return new rc(s)}queryRadius(){return 0}queryIntersectsFeature(){throw new Error("Should take a different path in FeatureIndex")}_setPaintOverrides(){for(const s of Eg.paint.overridableProperties){if(!mp.hasPaintOverride(this.layout,s))continue;const u=this.paint.get(s),f=new pp(u),_=new ca(f,u.property.specification);let x=null;x="constant"===u.value.kind||"source"===u.value.kind?new zc("source",_):new Bc("composite",_,u.value.zoomStops),this.paint._values[s]=new ys(u.property,x,u.parameters)}}_handleOverridablePaintPropertyUpdate(s,u,f){return!(!this.layout||u.isDataDriven()||f.isDataDriven())&&mp.hasPaintOverride(this.layout,s)}static hasPaintOverride(s,u){const f=s.get("text-field"),_=Eg.paint.properties[u];let x=!1;const C=M=>{for(const A of M)if(_.overrides&&_.overrides.hasOverride(A))return void(x=!0)};if("constant"===f.value.kind&&f.value.value instanceof Zr)C(f.value.value.sections);else if("source"===f.value.kind){const M=F=>{x||(F instanceof $&&J(F.value)===Ci?C(F.value.sections):F instanceof Nc?C(F.sections):F.eachChild(M))},A=f.value;A._styleExpression&&M(A._styleExpression.expression)}return x}}function Dg(l,s,u){let f="never";const _=l.get(s);return _?f=_:l.get(u)&&(f="always"),f}var S1={paint:new Di({"background-color":new wt(Ae.paint_background["background-color"]),"background-pattern":new pd(Ae.paint_background["background-pattern"]),"background-opacity":new wt(Ae.paint_background["background-opacity"])})},M1={paint:new Di({"raster-opacity":new wt(Ae.paint_raster["raster-opacity"]),"raster-hue-rotate":new wt(Ae.paint_raster["raster-hue-rotate"]),"raster-brightness-min":new wt(Ae.paint_raster["raster-brightness-min"]),"raster-brightness-max":new wt(Ae.paint_raster["raster-brightness-max"]),"raster-saturation":new wt(Ae.paint_raster["raster-saturation"]),"raster-contrast":new wt(Ae.paint_raster["raster-contrast"]),"raster-resampling":new wt(Ae.paint_raster["raster-resampling"]),"raster-fade-duration":new wt(Ae.paint_raster["raster-fade-duration"])})};class I1 extends Ko{constructor(s){super(s,{}),this.onAdd=u=>{this.implementation.onAdd&&this.implementation.onAdd(u,u.painter.context.gl)},this.onRemove=u=>{this.implementation.onRemove&&this.implementation.onRemove(u,u.painter.context.gl)},this.implementation=s}is3D(){return"3d"===this.implementation.renderingMode}hasOffscreenPass(){return void 0!==this.implementation.prerender}recalculate(){}updateTransitions(){}hasTransition(){return!1}serialize(){throw new Error("Custom layers cannot be serialized")}}const T1={circle:class extends Ko{constructor(l){super(l,Cd)}createBucket(l){return new Jo(l)}queryRadius(l){const s=l;return ya("circle-radius",this,s)+ya("circle-stroke-width",this,s)+Zs(this.paint.get("circle-translate"))}queryIntersectsFeature(l,s,u,f,_,x,C,M){const A=ah(l,this.paint.get("circle-translate"),this.paint.get("circle-translate-anchor"),x.angle,C),F=this.paint.get("circle-radius").evaluate(s,u)+this.paint.get("circle-stroke-width").evaluate(s,u),O="map"===this.paint.get("circle-pitch-alignment"),B=O?A:(W=M,A.map(se=>lh(se,W))),H=O?F*C:F;var W;for(const q of f)for(const W of q){const se=O?W:lh(W,M);let oe=H;const be=Zf([],[W.x,W.y,0,1],M);if("viewport"===this.paint.get("circle-pitch-scale")&&"map"===this.paint.get("circle-pitch-alignment")?oe*=be[3]/x.cameraToCenterDistance:"map"===this.paint.get("circle-pitch-scale")&&"viewport"===this.paint.get("circle-pitch-alignment")&&(oe*=x.cameraToCenterDistance/be[3]),Yl(B,se,oe))return!0}return!1}},heatmap:class extends Ko{createBucket(l){return new Wf(l)}constructor(l){super(l,Zm),this._updateColorRamp()}_handleSpecialPaintPropertyUpdate(l){"heatmap-color"===l&&this._updateColorRamp()}_updateColorRamp(){this.colorRamp=Xm({expression:this._transitionablePaint._values["heatmap-color"].value.expression,evaluationKey:"heatmapDensity",image:this.colorRamp}),this.colorRampTexture=null}resize(){this.heatmapFbo&&(this.heatmapFbo.destroy(),this.heatmapFbo=null)}queryRadius(){return 0}queryIntersectsFeature(){return!1}hasOffscreenPass(){return 0!==this.paint.get("heatmap-opacity")&&"none"!==this.visibility}},hillshade:class extends Ko{constructor(l){super(l,P_)}hasOffscreenPass(){return 0!==this.paint.get("hillshade-exaggeration")&&"none"!==this.visibility}},fill:class extends Ko{constructor(l){super(l,z_)}recalculate(l,s){super.recalculate(l,s);const u=this.paint._values["fill-outline-color"];"constant"===u.value.kind&&void 0===u.value.value&&(this.paint._values["fill-outline-color"]=this.paint._values["fill-color"])}createBucket(l){return new go(l)}queryRadius(){return Zs(this.paint.get("fill-translate"))}queryIntersectsFeature(l,s,u,f,_,x,C){return Rr(ah(l,this.paint.get("fill-translate"),this.paint.get("fill-translate-anchor"),x.angle,C),f)}isTileClipped(){return!0}},"fill-extrusion":class extends Ko{constructor(l){super(l,T2)}createBucket(l){return new ig(l)}queryRadius(){return Zs(this.paint.get("fill-extrusion-translate"))}is3D(){return!0}queryIntersectsFeature(l,s,u,f,_,x,C,M){const A=ah(l,this.paint.get("fill-extrusion-translate"),this.paint.get("fill-extrusion-translate-anchor"),x.angle,C),F=this.paint.get("fill-extrusion-height").evaluate(s,u),O=this.paint.get("fill-extrusion-base").evaluate(s,u),B=function(q,W,se,oe){const be=[];for(const Ce of q){const me=[Ce.x,Ce.y,0,1];Zf(me,me,W),be.push(new Tt(me[0]/me[3],me[1]/me[3]))}return be}(A,M),H=function(q,W,se,oe){const be=[],Ce=[],me=oe[8]*W,Ee=oe[9]*W,$e=oe[10]*W,Ve=oe[11]*W,gt=oe[8]*se,Ct=oe[9]*se,at=oe[10]*se,tt=oe[11]*se;for(const Qe of q){const ot=[],it=[];for(const Ge of Qe){const Et=Ge.x,pt=Ge.y,Yt=oe[0]*Et+oe[4]*pt+oe[12],Kn=oe[1]*Et+oe[5]*pt+oe[13],rr=oe[2]*Et+oe[6]*pt+oe[14],Or=oe[3]*Et+oe[7]*pt+oe[15],ws=rr+$e,Ti=Or+Ve,jr=Yt+gt,Lr=Kn+Ct,Kr=rr+at,Xi=Or+tt,No=new Tt((Yt+me)/Ti,(Kn+Ee)/Ti);No.z=ws/Ti,ot.push(No);const Ar=new Tt(jr/Xi,Lr/Xi);Ar.z=Kr/Xi,it.push(Ar)}be.push(ot),Ce.push(it)}return[be,Ce]}(f,O,F,M);return function(q,W,se){let oe=1/0;Rr(se,W)&&(oe=np(se,W[0]));for(let be=0;be=3)for(let se=0;se{this._triggered=!1,this._callback()})}trigger(){this._triggered||(this._triggered=!0,this._channel?this._channel.port1.postMessage(!0):setTimeout(()=>{this._triggered=!1,this._callback()},0))}remove(){delete this._channel,this._callback=()=>{}}}const jd=6371008.8;class br{constructor(s,u){if(isNaN(s)||isNaN(u))throw new Error(`Invalid LngLat object: (${s}, ${u})`);if(this.lng=+s,this.lat=+u,this.lat>90||this.lat<-90)throw new Error("Invalid LngLat latitude value: must be between -90 and 90")}wrap(){return new br(Te(this.lng,-180,180),this.lat)}toArray(){return[this.lng,this.lat]}toString(){return`LngLat(${this.lng}, ${this.lat})`}distanceTo(s){const u=Math.PI/180,f=this.lat*u,_=s.lat*u,x=Math.sin(f)*Math.sin(_)+Math.cos(f)*Math.cos(_)*Math.cos((s.lng-this.lng)*u);return jd*Math.acos(Math.min(x,1))}toBounds(s=0){const u=360*s/40075017,f=u/Math.cos(Math.PI/180*this.lat);return new av(new br(this.lng-f,this.lat-u),new br(this.lng+f,this.lat+u))}static convert(s){if(s instanceof br)return s;if(Array.isArray(s)&&(2===s.length||3===s.length))return new br(Number(s[0]),Number(s[1]));if(!Array.isArray(s)&&"object"==typeof s&&null!==s)return new br(Number("lng"in s?s.lng:s.lon),Number(s.lat));throw new Error("`LngLatLike` argument must be specified as a LngLat instance, an object {lng: , lat: }, an object {lon: , lat: }, or an array of [, ]")}}class ic{constructor(s,u){s&&(u?this.setSouthWest(s).setNorthEast(u):4===s.length?this.setSouthWest([s[0],s[1]]).setNorthEast([s[2],s[3]]):this.setSouthWest(s[0]).setNorthEast(s[1]))}setNorthEast(s){return this._ne=s instanceof br?new br(s.lng,s.lat):br.convert(s),this}setSouthWest(s){return this._sw=s instanceof br?new br(s.lng,s.lat):br.convert(s),this}extend(s){const u=this._sw,f=this._ne;let _,x;if(s instanceof br)_=s,x=s;else{if(!(s instanceof ic))return Array.isArray(s)?4===s.length||s.every(Array.isArray)?this.extend(ic.convert(s)):this.extend(br.convert(s)):this;if(_=s._sw,x=s._ne,!_||!x)return this}return u||f?(u.lng=Math.min(_.lng,u.lng),u.lat=Math.min(_.lat,u.lat),f.lng=Math.max(x.lng,f.lng),f.lat=Math.max(x.lat,f.lat)):(this._sw=new br(_.lng,_.lat),this._ne=new br(x.lng,x.lat)),this}getCenter(){return new br((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 br(this.getWest(),this.getNorth())}getSouthEast(){return new br(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(s){const{lng:u,lat:f}=br.convert(s);let _=this._sw.lng<=u&&u<=this._ne.lng;return this._sw.lng>this._ne.lng&&(_=this._sw.lng>=u&&u>=this._ne.lng),this._sw.lat<=f&&f<=this._ne.lat&&_}static convert(s){return s instanceof ic?s:s&&new ic(s)}}var av=ic;const lv=2*Math.PI*jd;function Sg(l){return lv*Math.cos(l*Math.PI/180)}function Mg(l){return(180+l)/360}function oc(l){return(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+l*Math.PI/360)))/360}function Ig(l,s){return l/Sg(s)}function gp(l){return 360/Math.PI*Math.atan(Math.exp((180-360*l)*Math.PI/180))-90}class yp{constructor(s,u,f=0){this.x=+s,this.y=+u,this.z=+f}static fromLngLat(s,u=0){const f=br.convert(s);return new yp(Mg(f.lng),oc(f.lat),Ig(u,f.lat))}toLngLat(){return new br(360*this.x-180,gp(this.y))}toAltitude(){return this.z*Sg(gp(this.y))}meterInMercatorCoordinateUnits(){return 1/lv*(s=gp(this.y),1/Math.cos(s*Math.PI/180));var s}}function A1(l,s,u){var f=2*Math.PI*6378137/256/Math.pow(2,u);return[l*f-2*Math.PI*6378137/2,s*f-2*Math.PI*6378137/2]}class vh{constructor(s,u,f){if(s<0||s>25||f<0||f>=Math.pow(2,s)||u<0||u>=Math.pow(2,s))throw new Error(`x=${u}, y=${f}, z=${s} outside of bounds. 0<=x<${Math.pow(2,s)}, 0<=y<${Math.pow(2,s)} 0<=z<=25 `);this.z=s,this.x=u,this.y=f,this.key=bh(0,s,s,u,f)}equals(s){return this.z===s.z&&this.x===s.x&&this.y===s.y}url(s,u,f){const _=(C=this.y,M=this.z,A=A1(256*(x=this.x),256*(C=Math.pow(2,M)-C-1),M),F=A1(256*(x+1),256*(C+1),M),A[0]+","+A[1]+","+F[0]+","+F[1]);var x,C,M,A,F;const O=function(B,H,q){let W,se="";for(let oe=B;oe>0;oe--)W=1<1?"@2x":"").replace(/{quadkey}/g,O).replace(/{bbox-epsg-3857}/g,_)}isChildOf(s){const u=this.z-s.z;return u>0&&s.x===this.x>>u&&s.y===this.y>>u}getTilePoint(s){const u=Math.pow(2,this.z);return new Tt((s.x*u-this.x)*_n,(s.y*u-this.y)*_n)}toString(){return`${this.z}/${this.x}/${this.y}`}}class cv{constructor(s,u){this.wrap=s,this.canonical=u,this.key=bh(s,u.z,u.z,u.x,u.y)}}class Lo{constructor(s,u,f,_,x){if(s= z; overscaledZ = ${s}; z = ${f}`);this.overscaledZ=s,this.wrap=u,this.canonical=new vh(f,+_,+x),this.key=bh(u,s,f,_,x)}clone(){return new Lo(this.overscaledZ,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y)}equals(s){return this.overscaledZ===s.overscaledZ&&this.wrap===s.wrap&&this.canonical.equals(s.canonical)}scaledTo(s){if(s>this.overscaledZ)throw new Error(`targetZ > this.overscaledZ; targetZ = ${s}; overscaledZ = ${this.overscaledZ}`);const u=this.canonical.z-s;return s>this.canonical.z?new Lo(s,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y):new Lo(s,this.wrap,s,this.canonical.x>>u,this.canonical.y>>u)}calculateScaledKey(s,u){if(s>this.overscaledZ)throw new Error(`targetZ > this.overscaledZ; targetZ = ${s}; overscaledZ = ${this.overscaledZ}`);const f=this.canonical.z-s;return s>this.canonical.z?bh(this.wrap*+u,s,this.canonical.z,this.canonical.x,this.canonical.y):bh(this.wrap*+u,s,s,this.canonical.x>>f,this.canonical.y>>f)}isChildOf(s){if(s.wrap!==this.wrap)return!1;const u=this.canonical.z-s.canonical.z;return 0===s.overscaledZ||s.overscaledZ>u&&s.canonical.y===this.canonical.y>>u}children(s){if(this.overscaledZ>=s)return[new Lo(this.overscaledZ+1,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y)];const u=this.canonical.z+1,f=2*this.canonical.x,_=2*this.canonical.y;return[new Lo(u,this.wrap,u,f,_),new Lo(u,this.wrap,u,f+1,_),new Lo(u,this.wrap,u,f,_+1),new Lo(u,this.wrap,u,f+1,_+1)]}isLessThan(s){return this.wraps.wrap)&&(this.overscaledZs.overscaledZ)&&(this.canonical.xs.canonical.x)&&this.canonical.ythis.max&&(this.max=M),M=this.dim+1||u<-1||u>=this.dim+1)throw new RangeError("out of range source coordinates for DEM data");return(u+1)*this.stride+(s+1)}_unpackMapbox(s,u,f){return(256*s*256+256*u+f)/10-1e4}_unpackTerrarium(s,u,f){return 256*s+u+f/256-32768}getPixels(){return new Oo({width:this.stride,height:this.stride},new Uint8Array(this.data.buffer))}backfillBorder(s,u,f){if(this.dim!==s.dim)throw new Error("dem dimension mismatch");let _=u*this.dim,x=u*this.dim+this.dim,C=f*this.dim,M=f*this.dim+this.dim;switch(u){case-1:_=x-1;break;case 1:x=_+1}switch(f){case-1:C=M-1;break;case 1:M=C+1}const A=-u*this.dim,F=-f*this.dim;for(let O=C;O=this._numberToString.length)throw new Error(`Out of bounds. Index requested n=${s} can't be >= this._numberToString.length ${this._numberToString.length}`);return this._numberToString[s]}}class Ag{constructor(s,u,f,_,x){this.type="Feature",this._vectorTileFeature=s,s._z=u,s._x=f,s._y=_,this.properties=s.properties,this.id=x}get geometry(){return void 0===this._geometry&&(this._geometry=this._vectorTileFeature.toGeoJSON(this._vectorTileFeature._x,this._vectorTileFeature._y,this._vectorTileFeature._z).geometry),this._geometry}set geometry(s){this._geometry=s}toJSON(){const s={geometry:this.geometry};for(const u in this)"_geometry"!==u&&"_vectorTileFeature"!==u&&(s[u]=this[u]);return s}}class Hd{constructor(s,u){this.tileID=s,this.x=s.canonical.x,this.y=s.canonical.y,this.z=s.canonical.z,this.grid=new $s(_n,16,0),this.grid3D=new $s(_n,16,0),this.featureIndexArray=new Pr,this.promoteId=u}insert(s,u,f,_,x,C){const M=this.featureIndexArray.length;this.featureIndexArray.emplaceBack(f,_,x);const A=C?this.grid3D:this.grid;for(let F=0;F=0&&B[3]>=0&&A.insert(M,B[0],B[1],B[2],B[3])}}loadVTLayers(){return this.vtLayers||(this.vtLayers=new Ql.VectorTile(new cg(this.rawTileData)).layers,this.sourceLayerCoder=new _p(this.vtLayers?Object.keys(this.vtLayers).sort():["_geojsonTileLayer"])),this.vtLayers}query(s,u,f,_){this.loadVTLayers();const x=s.params||{},C=_n/s.tileSize/s.scale,M=Lt(x.filter),A=s.queryGeometry,F=s.queryPadding*C,O=kg(A),B=this.grid.query(O.minX-F,O.minY-F,O.maxX+F,O.maxY+F),H=kg(s.cameraQueryGeometry),q=this.grid3D.query(H.minX-F,H.minY-F,H.maxX+F,H.maxY+F,(oe,be,Ce,me)=>function(Ee,$e,Ve,gt,Ct){for(const tt of Ee)if($e<=tt.x&&Ve<=tt.y&>>=tt.x&&Ct>=tt.y)return!0;const at=[new Tt($e,Ve),new Tt($e,Ct),new Tt(gt,Ct),new Tt(gt,Ve)];if(Ee.length>2)for(const tt of at)if(qi(Ee,tt))return!0;for(let tt=0;tt(me||(me=vr(Ee)),$e.queryIntersectsFeature(A,Ee,Ve,me,this.z,s.transform,C,s.pixelPosMatrix)))}return W}loadMatchingFeature(s,u,f,_,x,C,M,A,F,O,B){const H=this.bucketLayerIDs[u];if(C&&!function(oe,be){for(let Ce=0;Ce=0)return!0;return!1}(C,H))return;const q=this.sourceLayerCoder.decode(f),W=this.vtLayers[q].feature(_);if(x.needGeometry){const oe=li(W,!0);if(!x.filter(new cr(this.tileID.overscaledZ),oe,this.tileID.canonical))return}else if(!x.filter(new cr(this.tileID.overscaledZ),W))return;const se=this.getId(W,q);for(let oe=0;oe{const M=s instanceof _s?s.get(C):null;return M&&M.evaluate?M.evaluate(u,f,_):M})}function kg(l){let s=1/0,u=1/0,f=-1/0,_=-1/0;for(const x of l)s=Math.min(s,x.x),u=Math.min(u,x.y),f=Math.max(f,x.x),_=Math.max(_,x.y);return{minX:s,minY:u,maxX:f,maxY:_}}function Pg(l,s){return s-l}function qd(l,s,u,f,_,x){if(_-f<=u)return;const C=f+_>>1;vp(l,s,C,f,_,x%2),qd(l,s,u,f,C-1,x+1),qd(l,s,u,C+1,_,x+1)}function vp(l,s,u,f,_,x){for(;_>f;){if(_-f>600){const F=_-f+1,O=u-f+1,B=Math.log(F),H=.5*Math.exp(2*B/3),q=.5*Math.sqrt(B*H*(F-H)/F)*(O-F/2<0?-1:1);vp(l,s,u,Math.max(f,Math.floor(u-O*H/F+q)),Math.min(_,Math.floor(u+(F-O)*H/F+q)),x)}const C=s[2*u+x];let M=f,A=_;for(sl(l,s,f,u),s[2*_+x]>C&&sl(l,s,f,_);MC;)A--}s[2*f+x]===C?sl(l,s,f,A):(A++,sl(l,s,A,_)),A<=u&&(f=A+1),u<=A&&(_=A-1)}}function sl(l,s,u,f){Rg(l,u,f),Rg(s,2*u,2*f),Rg(s,2*u+1,2*f+1)}function Rg(l,s,u){const f=l[s];l[s]=l[u],l[u]=f}function Fg(l,s,u,f){const _=l-u,x=s-f;return _*_+x*x}ct("FeatureIndex",Hd,{omit:["rawTileData","sourceLayerCoder"]});const k1=l=>l[0],P1=l=>l[1];var bp;b.PerformanceMarkers=void 0,(bp=b.PerformanceMarkers||(b.PerformanceMarkers={})).create="create",bp.load="load",bp.fullLoad="fullLoad";let xh=null,sc=[];const Zd=1e3/30,Jc={mark(l){performance.mark(l)},frame(l){const s=l;null!=xh&&sc.push(s-xh),xh=s},clearMetrics(){xh=null,sc=[],performance.clearMeasures("loadTime"),performance.clearMeasures("fullLoadTime");for(const l in b.PerformanceMarkers)performance.clearMarks(b.PerformanceMarkers[l])},getPerformanceMetrics(){performance.measure("loadTime",b.PerformanceMarkers.create,b.PerformanceMarkers.load),performance.measure("fullLoadTime",b.PerformanceMarkers.create,b.PerformanceMarkers.fullLoad);const l=performance.getEntriesByName("loadTime")[0].duration,s=performance.getEntriesByName("fullLoadTime")[0].duration,u=sc.length,f=1/(sc.reduce((x,C)=>x+C,0)/u/1e3),_=sc.filter(x=>x>Zd).reduce((x,C)=>x+(C-Zd)/Zd,0);return{loadTime:l,fullLoadTime:s,fps:f,percentDroppedFrames:_/(u+_)*100}}};b.AJAXError=Ns,b.ARRAY_TYPE=tl,b.Actor=class{constructor(l,s,u){this.target=l,this.parent=s,this.mapId=u,this.callbacks={},this.tasks={},this.taskQueue=[],this.cancelCallbacks={},Os(["receive","process"],this),this.invoker=new sv(this.process),this.target.addEventListener("message",this.receive,!1),this.globalScope=Mo()?l:window}send(l,s,u,f,_=!1){const x=Math.round(1e18*Math.random()).toString(36).substring(0,10);u&&(this.callbacks[x]=u);const C=Ls(this.globalScope)?void 0:[];return this.target.postMessage({id:x,type:l,hasCallback:!!u,targetMapId:f,mustQueue:_,sourceMapId:this.mapId,data:uo(s,C)},C),{cancel:()=>{u&&delete this.callbacks[x],this.target.postMessage({id:x,type:"",targetMapId:f,sourceMapId:this.mapId})}}}receive(l){const s=l.data,u=s.id;if(u&&(!s.targetMapId||this.mapId===s.targetMapId))if(""===s.type){delete this.tasks[u];const f=this.cancelCallbacks[u];delete this.cancelCallbacks[u],f&&f()}else Mo()||s.mustQueue?(this.tasks[u]=s,this.taskQueue.push(u),this.invoker.trigger()):this.processTask(u,s)}process(){if(!this.taskQueue.length)return;const l=this.taskQueue.shift(),s=this.tasks[l];delete this.tasks[l],this.taskQueue.length&&this.invoker.trigger(),s&&this.processTask(l,s)}processTask(l,s){if(""===s.type){const u=this.callbacks[l];delete this.callbacks[l],u&&(s.error?u(Er(s.error)):u(null,Er(s.data)))}else{let u=!1;const f=Ls(this.globalScope)?void 0:[],_=s.hasCallback?(M,A)=>{u=!0,delete this.cancelCallbacks[l],this.target.postMessage({id:l,type:"",sourceMapId:this.mapId,error:M?uo(M):null,data:uo(A,f)},f)}:M=>{u=!0};let x=null;const C=Er(s.data);if(this.parent[s.type])x=this.parent[s.type](s.sourceMapId,C,_);else if(this.parent.getWorkerSource){const M=s.type.split(".");x=this.parent.getWorkerSource(s.sourceMapId,M[0],C.source)[M[1]](C,_)}else _(new Error(`Could not find function ${s.type}`));!u&&x&&x.cancel&&(this.cancelCallbacks[l]=x.cancel)}}remove(){this.invoker.remove(),this.target.removeEventListener("message",this.receive,!1)}},b.AlphaImage=uh,b.CanonicalTileID=vh,b.CollisionBoxArray=bd,b.CollisionCircleLayoutArray=class extends yd{},b.Color=Sn,b.DEMData=Tg,b.DataConstantProperty=wt,b.DictionaryCoder=_p,b.EXTENT=_n,b.ErrorEvent=mr,b.EvaluationParameters=cr,b.Event=ra,b.Evented=Qn,b.FeatureIndex=Hd,b.FillBucket=go,b.FillExtrusionBucket=ig,b.GeoJSONFeature=Ag,b.ImageAtlas=_1,b.ImagePosition=Z_,b.KDBush=class{constructor(l,s=k1,u=P1,f=64,_=Float64Array){this.nodeSize=f,this.points=l;const x=l.length<65536?Uint16Array:Uint32Array,C=this.ids=new x(l.length),M=this.coords=new _(2*l.length);for(let A=0;A=C&&q<=A&&W>=M&&W<=F&&H.push(_[Ee]);continue}const Ce=Math.floor((be+oe)/2);q=x[2*Ce],W=x[2*Ce+1],q>=C&&q<=A&&W>=M&&W<=F&&H.push(_[Ce]);const me=(se+1)%2;(0===se?C<=q:M<=W)&&(B.push(be),B.push(Ce-1),B.push(me)),(0===se?A>=q:F>=W)&&(B.push(Ce+1),B.push(oe),B.push(me))}return H}(this.ids,this.coords,l,s,u,f,this.nodeSize)}within(l,s,u){return function(f,_,x,C,M,A){const F=[0,f.length-1,0],O=[],B=M*M;for(;F.length;){const H=F.pop(),q=F.pop(),W=F.pop();if(q-W<=A){for(let me=W;me<=q;me++)Fg(_[2*me],_[2*me+1],x,C)<=B&&O.push(f[me]);continue}const se=Math.floor((W+q)/2),oe=_[2*se],be=_[2*se+1];Fg(oe,be,x,C)<=B&&O.push(f[se]);const Ce=(H+1)%2;(0===H?x-M<=oe:C-M<=be)&&(F.push(W),F.push(se-1),F.push(Ce)),(0===H?x+M>=oe:C+M>=be)&&(F.push(se+1),F.push(q),F.push(Ce))}return O}(this.ids,this.coords,l,s,u,this.nodeSize)}},b.LineBucket=sg,b.LineStripIndexArray=class extends _d{},b.LngLat=br,b.LngLatBounds=av,b.MercatorCoordinate=yp,b.ONE_EM=24,b.OverscaledTileID=Lo,b.PerformanceUtils=Jc,b.Pos3dArray=class extends Ju{},b.PosArray=ih,b.Properties=Di,b.QuadTriangleArray=class extends th{},b.RGBAImage=Oo,b.RasterBoundsArray=class extends Hc{},b.RequestPerformance=class{constructor(l){this._marks={start:[l.url,"start"].join("#"),end:[l.url,"end"].join("#"),measure:l.url.toString()},performance.mark(this._marks.start)}finish(){performance.mark(this._marks.end);let l=performance.getEntriesByName(this._marks.measure);return 0===l.length&&(performance.measure(this._marks.measure,this._marks.start,this._marks.end),l=performance.getEntriesByName(this._marks.measure),performance.clearMarks(this._marks.start),performance.clearMarks(this._marks.end),performance.clearMeasures(this._marks.measure)),l}},b.SegmentVector=R,b.SymbolBucket=rc,b.Transitionable=Xu,b.TriangleIndexArray=w,b.Uniform1f=ke,b.Uniform1i=class extends Se{constructor(l,s){super(l,s),this.current=0}set(l){this.current!==l&&(this.current=l,this.gl.uniform1i(this.location,l))}},b.Uniform2f=class extends Se{constructor(l,s){super(l,s),this.current=[0,0]}set(l){l[0]===this.current[0]&&l[1]===this.current[1]||(this.current=l,this.gl.uniform2f(this.location,l[0],l[1]))}},b.Uniform3f=class extends Se{constructor(l,s){super(l,s),this.current=[0,0,0]}set(l){l[0]===this.current[0]&&l[1]===this.current[1]&&l[2]===this.current[2]||(this.current=l,this.gl.uniform3f(this.location,l[0],l[1],l[2]))}},b.Uniform4f=Be,b.UniformColor=Le,b.UniformMatrix4f=class extends Se{constructor(l,s){super(l,s),this.current=Ne}set(l){if(l[12]!==this.current[12]||l[0]!==this.current[0])return this.current=l,void this.gl.uniformMatrix4fv(this.location,!1,l);for(let s=1;s<16;s++)if(l[s]!==this.current[s]){this.current=l,this.gl.uniformMatrix4fv(this.location,!1,l);break}}},b.UnwrappedTileID=cv,b.ValidationError=Pe,b.ZoomHistory=Bf,b.addDynamicAttributes=$d,b.arrayBufferToImage=function(l,s){const u=new Image;u.onload=()=>{s(null,u),URL.revokeObjectURL(u.src),u.onload=null,window.requestAnimationFrame(()=>{u.src=Fa})},u.onerror=()=>s(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 f=new Blob([new Uint8Array(l)],{type:"image/png"});u.src=l.byteLength?URL.createObjectURL(f):Fa},b.arrayBufferToImageBitmap=function(l,s){const u=new Blob([new Uint8Array(l)],{type:"image/png"});createImageBitmap(u).then(f=>{s(null,f)}).catch(f=>{s(new Error(`Could not load image because of ${f.message}. Please make sure to use a supported image type such as PNG or JPEG. Note that SVGs are not supported.`))})},b.asyncAll=function(l,s,u){if(!l.length)return u(null,[]);let f=l.length;const _=new Array(l.length);let x=null;l.forEach((C,M)=>{s(C,(A,F)=>{A&&(x=A),_[M]=F,0==--f&&u(x,_)})})},b.bezier=us,b.bindAll=Os,b.clamp=Zt,b.clipLine=bg,b.clone=function(l){var s=new tl(16);return s[0]=l[0],s[1]=l[1],s[2]=l[2],s[3]=l[3],s[4]=l[4],s[5]=l[5],s[6]=l[6],s[7]=l[7],s[8]=l[8],s[9]=l[9],s[10]=l[10],s[11]=l[11],s[12]=l[12],s[13]=l[13],s[14]=l[14],s[15]=l[15],s},b.clone$1=wi,b.collisionCircleLayout=lg,b.config=Oa,b.copy=function(l,s){return l[0]=s[0],l[1]=s[1],l[2]=s[2],l[3]=s[3],l[4]=s[4],l[5]=s[5],l[6]=s[6],l[7]=s[7],l[8]=s[8],l[9]=s[9],l[10]=s[10],l[11]=s[11],l[12]=s[12],l[13]=s[13],l[14]=s[14],l[15]=s[15],l},b.create=function(){var l=new tl(16);return tl!=Float32Array&&(l[1]=0,l[2]=0,l[3]=0,l[4]=0,l[6]=0,l[7]=0,l[8]=0,l[9]=0,l[11]=0,l[12]=0,l[13]=0,l[14]=0),l[0]=1,l[5]=1,l[10]=1,l[15]=1,l},b.createExpression=qa,b.createFilter=Lt,b.createLayout=Dr,b.createStyleLayer=function(l){return"custom"===l.type?new I1(l):new T1[l.type](l)},b.dot=function(l,s){return l[0]*s[0]+l[1]*s[1]+l[2]*s[2]+l[3]*s[3]},b.earthRadius=jd,b.ease=Pl,b.emitValidationErrors=ld,b.equals=function(l,s){var u=l[0],f=l[1],_=l[2],x=l[3],C=l[4],M=l[5],A=l[6],F=l[7],O=l[8],B=l[9],H=l[10],q=l[11],W=l[12],se=l[13],oe=l[14],be=l[15],Ce=s[0],me=s[1],Ee=s[2],$e=s[3],Ve=s[4],gt=s[5],Ct=s[6],at=s[7],tt=s[8],Qe=s[9],ot=s[10],it=s[11],Ge=s[12],Et=s[13],pt=s[14],Yt=s[15];return Math.abs(u-Ce)<=Mr*Math.max(1,Math.abs(u),Math.abs(Ce))&&Math.abs(f-me)<=Mr*Math.max(1,Math.abs(f),Math.abs(me))&&Math.abs(_-Ee)<=Mr*Math.max(1,Math.abs(_),Math.abs(Ee))&&Math.abs(x-$e)<=Mr*Math.max(1,Math.abs(x),Math.abs($e))&&Math.abs(C-Ve)<=Mr*Math.max(1,Math.abs(C),Math.abs(Ve))&&Math.abs(M-gt)<=Mr*Math.max(1,Math.abs(M),Math.abs(gt))&&Math.abs(A-Ct)<=Mr*Math.max(1,Math.abs(A),Math.abs(Ct))&&Math.abs(F-at)<=Mr*Math.max(1,Math.abs(F),Math.abs(at))&&Math.abs(O-tt)<=Mr*Math.max(1,Math.abs(O),Math.abs(tt))&&Math.abs(B-Qe)<=Mr*Math.max(1,Math.abs(B),Math.abs(Qe))&&Math.abs(H-ot)<=Mr*Math.max(1,Math.abs(H),Math.abs(ot))&&Math.abs(q-it)<=Mr*Math.max(1,Math.abs(q),Math.abs(it))&&Math.abs(W-Ge)<=Mr*Math.max(1,Math.abs(W),Math.abs(Ge))&&Math.abs(se-Et)<=Mr*Math.max(1,Math.abs(se),Math.abs(Et))&&Math.abs(oe-pt)<=Mr*Math.max(1,Math.abs(oe),Math.abs(pt))&&Math.abs(be-Yt)<=Mr*Math.max(1,Math.abs(be),Math.abs(Yt))},b.evaluateSizeForFeature=function(l,{uSize:s,uSizeT:u},{lowerSize:f,upperSize:_}){return"source"===l.kind?f/ba:"composite"===l.kind?Xn(f/ba,_/ba,u):s},b.evaluateSizeForZoom=function(l,s){let u=0,f=0;if("constant"===l.kind)f=l.layoutSize;else if("source"!==l.kind){const{interpolationType:_,minZoom:x,maxZoom:C}=l,M=_?Zt(Io.interpolationFactor(_,s,x,C),0,1):0;"camera"===l.kind?f=Xn(l.minSize,l.maxSize,M):u=M}return{uSizeT:u,uSize:f}},b.evaluateVariableOffset=tv,b.evented=jf,b.exported=Pu,b.extend=Ni,b.filterObject=Rl,b.fromScaling=function(l,s){return l[0]=s[0],l[1]=0,l[2]=0,l[3]=0,l[4]=0,l[5]=s[1],l[6]=0,l[7]=0,l[8]=0,l[9]=0,l[10]=s[2],l[11]=0,l[12]=0,l[13]=0,l[14]=0,l[15]=1,l},b.getAnchorAlignment=Wi,b.getAnchorJustification=Vd,b.getArrayBuffer=La,b.getJSON=function(l,s){return Fl(Ni(l,{type:"json"}),s)},b.getOverlapMode=Dg,b.getRTLTextPluginStatus=Gl,b.getReferrer=Nn,b.getVideo=function(l,s){const u=window.document.createElement("video");u.muted=!0,u.onloadstart=function(){s(null,u)};for(let f=0;f{}}},b.identity=qf,b.invert=function(l,s){var u=s[0],f=s[1],_=s[2],x=s[3],C=s[4],M=s[5],A=s[6],F=s[7],O=s[8],B=s[9],H=s[10],q=s[11],W=s[12],se=s[13],oe=s[14],be=s[15],Ce=u*M-f*C,me=u*A-_*C,Ee=u*F-x*C,$e=f*A-_*M,Ve=f*F-x*M,gt=_*F-x*A,Ct=O*se-B*W,at=O*oe-H*W,tt=O*be-q*W,Qe=B*oe-H*se,ot=B*be-q*se,it=H*be-q*oe,Ge=Ce*it-me*ot+Ee*Qe+$e*tt-Ve*at+gt*Ct;return Ge?(l[0]=(M*it-A*ot+F*Qe)*(Ge=1/Ge),l[1]=(_*ot-f*it-x*Qe)*Ge,l[2]=(se*gt-oe*Ve+be*$e)*Ge,l[3]=(H*Ve-B*gt-q*$e)*Ge,l[4]=(A*tt-C*it-F*at)*Ge,l[5]=(u*it-_*tt+x*at)*Ge,l[6]=(oe*Ee-W*gt-be*me)*Ge,l[7]=(O*gt-H*Ee+q*me)*Ge,l[8]=(C*ot-M*tt+F*Ct)*Ge,l[9]=(f*tt-u*ot-x*Ct)*Ge,l[10]=(W*Ve-se*Ee+be*Ce)*Ge,l[11]=(B*Ee-O*Ve-q*Ce)*Ge,l[12]=(M*at-C*Qe-A*Ct)*Ge,l[13]=(u*Qe-f*at+_*Ct)*Ge,l[14]=(se*me-W*$e-oe*Ce)*Ge,l[15]=(O*$e-B*me+H*Ce)*Ge,l):null},b.isImageBitmap=ro,b.isSafari=Ls,b.isWorker=Mo,b.keysDifference=function(l,s){const u=[];for(const f in l)f in s||u.push(f);return u},b.lazyLoadRTLTextPlugin=function(){po.isLoading()||po.isLoaded()||"deferred"!==Gl()||Gm()},b.makeRequest=Fl,b.mapObject=Ra,b.mercatorXfromLng=Mg,b.mercatorYfromLat=oc,b.mercatorZfromAltitude=Ig,b.mul=_a,b.mul$1=function(l,s,u){return l[0]=s[0]*u[0],l[1]=s[1]*u[1],l[2]=s[2]*u[2],l[3]=s[3]*u[3],l},b.multiply=qm,b.nextPowerOfTwo=function(l){return l<=1?1:Math.pow(2,Math.ceil(Math.log(l)/Math.LN2))},b.number=Xn,b.ortho=function(l,s,u,f,_,x,C){var M=1/(s-u),A=1/(f-_),F=1/(x-C);return l[0]=-2*M,l[1]=0,l[2]=0,l[3]=0,l[4]=0,l[5]=-2*A,l[6]=0,l[7]=0,l[8]=0,l[9]=0,l[10]=2*F,l[11]=0,l[12]=(s+u)*M,l[13]=(_+f)*A,l[14]=(C+x)*F,l[15]=1,l},b.parseCacheControl=function(l){const s={};if(l.replace(/(?:^|(?:\s*\,\s*))([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)(?:\=(?:([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)|(?:\"((?:[^"\\]|\\.)*)\")))?/g,(u,f,_,x)=>{const C=_||x;return s[f]=!C||C.toLowerCase(),""}),s["max-age"]){const u=parseInt(s["max-age"],10);isNaN(u)?delete s["max-age"]:s["max-age"]=u}return s},b.parseGlyphPbf=function(l){return new cg(l).readFields(k2,[])},b.pbf=cg,b.performSymbolLayout=function(l){l.bucket.createArrays(),l.bucket.tilePixelRatio=_n/(512*l.bucket.overscaling),l.bucket.compareText={},l.bucket.iconsNeedLinear=!1;const s=l.bucket.layers[0].layout,u=l.bucket.layers[0]._unevaluatedLayout._values,f={layoutIconSize:u["icon-size"].possiblyEvaluate(new cr(l.bucket.zoom+1),l.canonical),layoutTextSize:u["text-size"].possiblyEvaluate(new cr(l.bucket.zoom+1),l.canonical),textMaxSize:u["text-size"].possiblyEvaluate(new cr(18))};if("composite"===l.bucket.textSizeData.kind){const{minZoom:A,maxZoom:F}=l.bucket.textSizeData;f.compositeTextSizes=[u["text-size"].possiblyEvaluate(new cr(A),l.canonical),u["text-size"].possiblyEvaluate(new cr(F),l.canonical)]}if("composite"===l.bucket.iconSizeData.kind){const{minZoom:A,maxZoom:F}=l.bucket.iconSizeData;f.compositeIconSizes=[u["icon-size"].possiblyEvaluate(new cr(A),l.canonical),u["icon-size"].possiblyEvaluate(new cr(F),l.canonical)]}const _=24*s.get("text-line-height"),x="viewport"!==s.get("text-rotation-alignment")&&"point"!==s.get("symbol-placement"),C=s.get("text-keep-upright"),M=s.get("text-size");for(const A of l.bucket.features){const F=s.get("text-font").evaluate(A,{},l.canonical).join(","),O=M.evaluate(A,{},l.canonical),B=f.layoutTextSize.evaluate(A,{},l.canonical),H=f.layoutIconSize.evaluate(A,{},l.canonical),q={horizontal:{},vertical:void 0},W=A.text;let se,oe=[0,0];if(W){const me=W.toString(),Ee=24*s.get("text-letter-spacing").evaluate(A,{},l.canonical),$e=cd(me)?Ee:0,Ve=s.get("text-anchor").evaluate(A,{},l.canonical),gt=s.get("text-variable-anchor");if(!gt){const ot=s.get("text-radial-offset").evaluate(A,{},l.canonical);oe=ot?tv(Ve,[24*ot,xg]):s.get("text-offset").evaluate(A,{},l.canonical).map(it=>24*it)}let Ct=x?"center":s.get("text-justify").evaluate(A,{},l.canonical);const at=s.get("symbol-placement"),tt="point"===at?24*s.get("text-max-width").evaluate(A,{},l.canonical):0,Qe=()=>{l.bucket.allowVerticalPlacement&&ho(me)&&(q.vertical=fg(W,l.glyphMap,l.glyphPositions,l.imagePositions,F,tt,_,Ve,"left",$e,oe,b.WritingMode.vertical,!0,at,B,O))};if(!x&>){const ot="auto"===Ct?gt.map(Ge=>Vd(Ge)):[Ct];let it=!1;for(let Ge=0;Gethis._layers[je.id]),ge=ce[0];if("none"===ge.visibility)continue;const he=ge.source||"";let ue=this.familiesBySource[he];ue||(ue=this.familiesBySource[he]={});const xe=ge.sourceLayer||"_geojsonTileLayer";let Me=ue[xe];Me||(Me=ue[xe]=[]),Me.push(ce)}}}class Pl{constructor(V){const $={},K=[];for(const he in V){const ue=V[he],xe=$[he]={};for(const Me in ue){const je=ue[+Me];if(!je||0===je.bitmap.width||0===je.bitmap.height)continue;const Ie={x:0,y:0,w:je.bitmap.width+2,h:je.bitmap.height+2};K.push(Ie),xe[Me]={rect:Ie,metrics:je.metrics}}}const{w:te,h:ce}=b.potpack(K),ge=new b.AlphaImage({width:te||1,height:ce||1});for(const he in V){const ue=V[he];for(const xe in ue){const Me=ue[+xe];if(!Me||0===Me.bitmap.width||0===Me.bitmap.height)continue;const je=$[he][xe].rect;b.AlphaImage.copy(Me.bitmap,ge,{x:0,y:0},{x:je.x+1,y:je.y+1},Me.bitmap)}}this.image=ge,this.positions=$}}b.register("GlyphAtlas",Pl);class Zt{constructor(V){this.tileID=new b.OverscaledTileID(V.tileID.overscaledZ,V.tileID.wrap,V.tileID.canonical.z,V.tileID.canonical.x,V.tileID.canonical.y),this.uid=V.uid,this.zoom=V.zoom,this.pixelRatio=V.pixelRatio,this.tileSize=V.tileSize,this.source=V.source,this.overscaling=this.tileID.overscaleFactor(),this.showCollisionBoxes=V.showCollisionBoxes,this.collectResourceTiming=!!V.collectResourceTiming,this.returnDependencies=!!V.returnDependencies,this.promoteId=V.promoteId}parse(V,$,K,te,ce){this.status="parsing",this.data=V,this.collisionBoxArray=new b.CollisionBoxArray;const ge=new b.DictionaryCoder(Object.keys(V.layers).sort()),he=new b.FeatureIndex(this.tileID,this.promoteId);he.bucketLayerIDs=[];const ue={},xe={featureIndex:he,iconDependencies:{},patternDependencies:{},glyphDependencies:{},availableImages:K},Me=$.familiesBySource[this.source];for(const nn in Me){const an=V.layers[nn];if(!an)continue;1===an.version&&b.warnOnce(`Vector tile source "${this.source}" layer "${nn}" does not use vector tile spec v2 and therefore may have some rendering errors.`);const qn=ge.encode(nn),sr=[];for(let si=0;si=kr.maxzoom||"none"!==kr.visibility&&(Te(si,this.zoom,K),(ue[kr.id]=kr.createBucket({index:he.bucketLayerIDs.length,layers:si,zoom:this.zoom,pixelRatio:this.pixelRatio,overscaling:this.overscaling,collisionBoxArray:this.collisionBoxArray,sourceLayerIndex:qn,sourceID:this.source})).populate(sr,xe,this.tileID.canonical),he.bucketLayerIDs.push(si.map(Ua=>Ua.id)))}}let je,Ie,Dt,dt;const ft=b.mapObject(xe.glyphDependencies,nn=>Object.keys(nn).map(Number));Object.keys(ft).length?te.send("getGlyphs",{uid:this.uid,stacks:ft,source:this.source,tileID:this.tileID,type:"glyphs"},(nn,an)=>{je||(je=nn,Ie=an,Gn.call(this))}):Ie={};const xt=Object.keys(xe.iconDependencies);xt.length?te.send("getImages",{icons:xt,source:this.source,tileID:this.tileID,type:"icons"},(nn,an)=>{je||(je=nn,Dt=an,Gn.call(this))}):Dt={};const ln=Object.keys(xe.patternDependencies);function Gn(){if(je)return ce(je);if(Ie&&Dt&&dt){const nn=new Pl(Ie),an=new b.ImageAtlas(Dt,dt);for(const qn in ue){const sr=ue[qn];sr instanceof b.SymbolBucket?(Te(sr.layers,this.zoom,K),b.performSymbolLayout({bucket:sr,glyphMap:Ie,glyphPositions:nn.positions,imageMap:Dt,imagePositions:an.iconPositions,showCollisionBoxes:this.showCollisionBoxes,canonical:this.tileID.canonical})):sr.hasPattern&&(sr instanceof b.LineBucket||sr instanceof b.FillBucket||sr instanceof b.FillExtrusionBucket)&&(Te(sr.layers,this.zoom,K),sr.addFeatures(xe,this.tileID.canonical,an.patternPositions))}this.status="done",ce(null,{buckets:Object.values(ue).filter(qn=>!qn.isEmpty()),featureIndex:he,collisionBoxArray:this.collisionBoxArray,glyphAtlasImage:nn.image,imageAtlas:an,glyphMap:this.returnDependencies?Ie:null,iconMap:this.returnDependencies?Dt:null,glyphPositions:this.returnDependencies?nn.positions:null})}}ln.length?te.send("getImages",{icons:ln,source:this.source,tileID:this.tileID,type:"patterns"},(nn,an)=>{je||(je=nn,dt=an,Gn.call(this))}):dt={},Gn.call(this)}}function Te(J,V,$){const K=new b.EvaluationParameters(V);for(const te of J)te.recalculate(K,$)}function Ni(J,V){const $=b.getArrayBuffer(J.request,(K,te,ce,ge)=>{K?V(K):te&&V(null,{vectorTile:new b.vectorTile.VectorTile(new b.pbf(te)),rawData:te,cacheControl:ce,expires:ge})});return()=>{$.cancel(),V()}}class Fs{constructor(V,$,K,te){this.actor=V,this.layerIndex=$,this.availableImages=K,this.loadVectorData=te||Ni,this.loading={},this.loaded={}}loadTile(V,$){const K=V.uid;this.loading||(this.loading={});const te=!!(V&&V.request&&V.request.collectResourceTiming)&&new b.RequestPerformance(V.request),ce=this.loading[K]=new Zt(V);ce.abort=this.loadVectorData(V,(ge,he)=>{if(delete this.loading[K],ge||!he)return ce.status="done",this.loaded[K]=ce,$(ge);const ue=he.rawData,xe={};he.expires&&(xe.expires=he.expires),he.cacheControl&&(xe.cacheControl=he.cacheControl);const Me={};if(te){const je=te.finish();je&&(Me.resourceTiming=JSON.parse(JSON.stringify(je)))}ce.vectorTile=he.vectorTile,ce.parse(he.vectorTile,this.layerIndex,this.availableImages,this.actor,(je,Ie)=>{if(je||!Ie)return $(je);$(null,b.extend({rawTileData:ue.slice(0)},Ie,xe,Me))}),this.loaded=this.loaded||{},this.loaded[K]=ce})}reloadTile(V,$){const K=this.loaded,te=V.uid,ce=this;if(K&&K[te]){const ge=K[te];ge.showCollisionBoxes=V.showCollisionBoxes;const he=(ue,xe)=>{const Me=ge.reloadCallback;Me&&(delete ge.reloadCallback,ge.parse(ge.vectorTile,ce.layerIndex,this.availableImages,ce.actor,Me)),$(ue,xe)};"parsing"===ge.status?ge.reloadCallback=he:"done"===ge.status&&(ge.vectorTile?ge.parse(ge.vectorTile,this.layerIndex,this.availableImages,this.actor,he):he())}}abortTile(V,$){const K=this.loading,te=V.uid;K&&K[te]&&K[te].abort&&(K[te].abort(),delete K[te]),$()}removeTile(V,$){const K=this.loaded,te=V.uid;K&&K[te]&&delete K[te],$()}}class Os{constructor(){this.loaded={}}loadTile(V,$){const{uid:K,encoding:te,rawImageData:ce}=V,ge=b.isImageBitmap(ce)?this.getImageData(ce):ce,he=new b.DEMData(K,ge,te);this.loaded=this.loaded||{},this.loaded[K]=he,$(null,he)}getImageData(V){this.offscreenCanvas&&this.offscreenCanvasContext||(this.offscreenCanvas=new OffscreenCanvas(V.width,V.height),this.offscreenCanvasContext=this.offscreenCanvas.getContext("2d",{willReadFrequently:!0})),this.offscreenCanvas.width=V.width,this.offscreenCanvas.height=V.height,this.offscreenCanvasContext.drawImage(V,0,0,V.width,V.height);const $=this.offscreenCanvasContext.getImageData(-1,-1,V.width+2,V.height+2);return this.offscreenCanvasContext.clearRect(0,0,this.offscreenCanvas.width,this.offscreenCanvas.height),new b.RGBAImage({width:$.width,height:$.height},$.data)}removeTile(V){const $=this.loaded,K=V.uid;$&&$[K]&&delete $[K]}}var Ra=function J(V,$){var K,te=V&&V.type;if("FeatureCollection"===te)for(K=0;K=Math.abs(he)?$-ue+he:he-ue+$,$=ue}$+K>=0!=!!V&&J.reverse()}const no=b.vectorTile.VectorTileFeature.prototype.toGeoJSON;var pn={},ii={get exports(){return pn},set exports(J){pn=J}},kc=b.pointGeometry,Mo=b.vectorTile.VectorTileFeature,na=Ls;function Ls(J,V){this.options=V||{},this.features=J,this.length=J.length}function ro(J,V){this.id="number"==typeof J.id?J.id:void 0,this.type=J.type,this.rawGeometry=1===J.type?[J.geometry]:J.geometry,this.properties=J.tags,this.extent=V||4096}Ls.prototype.feature=function(J){return new ro(this.features[J],this.options.extent)},ro.prototype.loadGeometry=function(){var J=this.rawGeometry;this.geometry=[];for(var V=0;V>31}function Nn(J,V){for(var $=J.loadGeometry(),K=J.type,te=0,ce=0,ge=$.length,he=0;heJ},La=Math.fround||(Rc=new Float32Array(1),J=>(Rc[0]=+J,Rc[0]));var Rc;class oi{constructor(V){this.options=zi(Object.create(Fl),V),this.trees=new Array(this.options.maxZoom+1)}load(V){const{log:$,minZoom:K,maxZoom:te,nodeSize:ce}=this.options;$&&console.time("total time");const ge=`prepare ${V.length} points`;$&&console.time(ge),this.points=V;let he=[];for(let ue=0;ue=K;ue--){const xe=+Date.now();he=this._cluster(he,ue),this.trees[ue]=new b.KDBush(he,Vn,ds,ce,Float32Array),$&&console.log("z%d: %d clusters in %dms",ue,he.length,+Date.now()-xe)}return $&&console.timeEnd("total time"),this}getClusters(V,$){let K=((V[0]+180)%360+360)%360-180;const te=Math.max(-90,Math.min(90,V[1]));let ce=180===V[2]?180:((V[2]+180)%360+360)%360-180;const ge=Math.max(-90,Math.min(90,V[3]));if(V[2]-V[0]>=360)K=-180,ce=180;else if(K>ce){const Me=this.getClusters([K,te,180,ge],$),je=this.getClusters([-180,te,ce,ge],$);return Me.concat(je)}const he=this.trees[this._limitZoom($)],ue=he.range(Ae(K),Pe(ge),Ae(ce),Pe(te)),xe=[];for(const Me of ue){const je=he.points[Me];xe.push(je.numPoints?mr(je):this.points[je.index])}return xe}getChildren(V){const $=this._getOriginId(V),K=this._getOriginZoom(V),te="No cluster with the specified id.",ce=this.trees[K];if(!ce)throw new Error(te);const ge=ce.points[$];if(!ge)throw new Error(te);const he=this.options.radius/(this.options.extent*Math.pow(2,K-1)),ue=ce.within(ge.x,ge.y,he),xe=[];for(const Me of ue){const je=ce.points[Me];je.parentId===V&&xe.push(je.numPoints?mr(je):this.points[je.index])}if(0===xe.length)throw new Error(te);return xe}getLeaves(V,$,K){const te=[];return this._appendLeaves(te,V,$=$||10,K=K||0,0),te}getTile(V,$,K){const te=this.trees[this._limitZoom(V)],ce=Math.pow(2,V),{extent:ge,radius:he}=this.options,ue=he/ge,xe=(K-ue)/ce,Me=(K+1+ue)/ce,je={features:[]};return this._addTileFeatures(te.range(($-ue)/ce,xe,($+1+ue)/ce,Me),te.points,$,K,ce,je),0===$&&this._addTileFeatures(te.range(1-ue/ce,xe,1,Me),te.points,ce,K,ce,je),$===ce-1&&this._addTileFeatures(te.range(0,xe,ue/ce,Me),te.points,-1,K,ce,je),je.features.length?je:null}getClusterExpansionZoom(V){let $=this._getOriginZoom(V)-1;for(;$<=this.options.maxZoom;){const K=this.getChildren(V);if($++,1!==K.length)break;V=K[0].properties.cluster_id}return $}_appendLeaves(V,$,K,te,ce){const ge=this.getChildren($);for(const he of ge){const ue=he.properties;if(ue&&ue.cluster?ce+ue.point_count<=te?ce+=ue.point_count:ce=this._appendLeaves(V,ue.cluster_id,K,te,ce):ce$&&(dt+=xt.numPoints||1)}if(dt>Dt&&dt>=he){let ft=Me.x*Dt,xt=Me.y*Dt,ln=ge&&Dt>1?this._map(Me,!0):null;const Gn=(xe<<5)+($+1)+this.points.length;for(const nn of Ie){const an=je.points[nn];if(an.zoom<=$)continue;an.zoom=$;const qn=an.numPoints||1;ft+=an.x*qn,xt+=an.y*qn,an.parentId=Gn,ge&&(ln||(ln=this._map(Me,!0)),ge(ln,this._map(an)))}Me.parentId=Gn,K.push(Na(ft/dt,xt/dt,Gn,dt,ln))}else if(K.push(Me),dt>1)for(const ft of Ie){const xt=je.points[ft];xt.zoom<=$||(xt.zoom=$,K.push(xt))}}return K}_getOriginId(V){return V-this.points.length>>5}_getOriginZoom(V){return(V-this.points.length)%32}_map(V,$){if(V.numPoints)return $?zi({},V.properties):V.properties;const K=this.points[V.index].properties,te=this.options.map(K);return $&&te===K?zi({},te):te}}function Na(J,V,$,K,te){return{x:La(J),y:La(V),zoom:1/0,id:$,parentId:-1,numPoints:K,properties:te}}function ra(J,V){const[$,K]=J.geometry.coordinates;return{x:La(Ae($)),y:La(Pe(K)),zoom:1/0,index:V,parentId:-1}}function mr(J){return{type:"Feature",id:J.id,properties:Qn(J),geometry:{type:"Point",coordinates:[(V=J.x,360*(V-.5)),za(J.y)]}};var V}function Qn(J){const V=J.numPoints,$=V>=1e4?`${Math.round(V/1e3)}k`:V>=1e3?Math.round(V/100)/10+"k":V;return zi(zi({},J.properties),{cluster:!0,cluster_id:J.id,point_count:V,point_count_abbreviated:$})}function Ae(J){return J/360+.5}function Pe(J){const V=Math.sin(J*Math.PI/180),$=.5-.25*Math.log((1+V)/(1-V))/Math.PI;return $<0?0:$>1?1:$}function za(J){const V=(180-360*J)*Math.PI/180;return 360*Math.atan(Math.exp(V))/Math.PI-90}function zi(J,V){for(const $ in V)J[$]=V[$];return J}function Vn(J){return J.x}function ds(J){return J.y}function Bi(J,V,$,K){for(var te,ce=K,ge=$-V>>1,he=$-V,ue=J[V],xe=J[V+1],Me=J[$],je=J[$+1],Ie=V+3;Ie<$;Ie+=3){var Dt=Ol(J[Ie],J[Ie+1],ue,xe,Me,je);if(Dt>ce)te=Ie,ce=Dt;else if(Dt===ce){var dt=Math.abs(Ie-ge);dtK&&(te-V>3&&Bi(J,V,te,K),J[te+2]=ce,$-te>3&&Bi(J,te,$,K))}function Ol(J,V,$,K,te,ce){var ge=te-$,he=ce-K;if(0!==ge||0!==he){var ue=((J-$)*ge+(V-K)*he)/(ge*ge+he*he);ue>1?($=te,K=ce):ue>0&&($+=ge*ue,K+=he*ue)}return(ge=J-$)*ge+(he=V-K)*he}function fs(J,V,$,K){var te={id:void 0===J?null:J,type:V,geometry:$,tags:K,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0};return function(ce){var ge=ce.geometry,he=ce.type;if("Point"===he||"MultiPoint"===he||"LineString"===he)rt(ce,ge);else if("Polygon"===he||"MultiLineString"===he)for(var ue=0;ue0&&(ge+=K?(te*xe-ue*ce)/2:Math.sqrt(Math.pow(ue-te,2)+Math.pow(xe-ce,2))),te=ue,ce=xe}var Me=V.length-3;V[2]=1,Bi(V,0,Me,$),V[Me+2]=1,V.size=Math.abs(ge),V.start=0,V.end=V.size}function ps(J,V,$,K){for(var te=0;te1?1:$}function Ci(J,V,$,K,te,ce,ge,he){if(K/=V,ce>=($/=V)&&ge=K)return null;for(var ue=[],xe=0;xe=$&&dt=K)){var ft=[];if("Point"===Ie||"MultiPoint"===Ie)ia(je,ft,$,K,te);else if("LineString"===Ie)oo(je,ft,$,K,te,!1,he.lineMetrics);else if("MultiLineString"===Ie)zn(je,ft,$,K,te,!1);else if("Polygon"===Ie)zn(je,ft,$,K,te,!0);else if("MultiPolygon"===Ie)for(var xt=0;xt=$&&ge<=K&&(V.push(J[ce]),V.push(J[ce+1]),V.push(J[ce+2]))}}function oo(J,V,$,K,te,ce,ge){for(var he,ue,xe=Vi(J),Me=0===te?so:Ll,je=J.start,Ie=0;Ie$&&(ue=Me(xe,Dt,dt,xt,ln,$),ge&&(xe.start=je+he*ue)):Gn>K?nn=$&&(ue=Me(xe,Dt,dt,xt,ln,$),an=!0),nn>K&&Gn<=K&&(ue=Me(xe,Dt,dt,xt,ln,K),an=!0),!ce&&an&&(ge&&(xe.end=je+he*ue),V.push(xe),xe=Vi(J)),ge&&(je+=he)}var qn=J.length-3;Dt=J[qn],dt=J[qn+1],ft=J[qn+2],(Gn=0===te?Dt:dt)>=$&&Gn<=K&&Fc(xe,Dt,dt,ft),qn=xe.length-3,ce&&qn>=3&&(xe[qn]!==xe[0]||xe[qn+1]!==xe[1])&&Fc(xe,xe[0],xe[1],xe[2]),xe.length&&V.push(xe)}function Vi(J){var V=[];return V.size=J.size,V.start=J.start,V.end=J.end,V}function zn(J,V,$,K,te,ce){for(var ge=0;gege.maxX&&(ge.maxX=Me),je>ge.maxY&&(ge.maxY=je)}return ge}function sa(J,V,$,K){var te=V.geometry,ce=V.type,ge=[];if("Point"===ce||"MultiPoint"===ce)for(var he=0;he0&&V.size<(te?ge:K))$.numPoints+=V.length/3;else{for(var he=[],ue=0;uege)&&($.numSimplified++,he.push(V[ue]),he.push(V[ue+1])),$.numPoints++;te&&function(xe,Me){for(var je=0,Ie=0,Dt=xe.length,dt=Dt-2;Ie0===Me)for(Ie=0,Dt=xe.length;Ie
24)throw new Error("maxZoom should be in the 0-24 range");if(V.promoteId&&V.generateId)throw new Error("promoteId and generateId cannot be used together.");var te,ce,ge,he,ue,xe,K=function(te,ce){var ge=[];if("FeatureCollection"===te.type)for(var he=0;he1&&console.time("creation"),Ie=this.tiles[je]=Ru(J,V,$,K,ue),this.tileCoords.push({z:V,x:$,y:K}),xe)){xe>1&&(console.log("tile z%d-%d-%d (features: %d, points: %d, simplified: %d)",V,$,K,Ie.numFeatures,Ie.numPoints,Ie.numSimplified),console.timeEnd("creation"));var Dt="z"+V;this.stats[Dt]=(this.stats[Dt]||0)+1,this.total++}if(Ie.source=J,te){if(V===ue.maxZoom||V===te)continue;var dt=1<1&&console.time("clipping");var ft,xt,ln,Gn,nn,an,qn=.5*ue.buffer/ue.extent,sr=.5-qn,si=.5+qn,kr=1+qn;ft=xt=ln=Gn=null,nn=Ci(J,Me,$-qn,$+si,0,Ie.minX,Ie.maxX,ue),an=Ci(J,Me,$+sr,$+kr,0,Ie.minX,Ie.maxX,ue),J=null,nn&&(ft=Ci(nn,Me,K-qn,K+si,1,Ie.minY,Ie.maxY,ue),xt=Ci(nn,Me,K+sr,K+kr,1,Ie.minY,Ie.maxY,ue),nn=null),an&&(ln=Ci(an,Me,K-qn,K+si,1,Ie.minY,Ie.maxY,ue),Gn=Ci(an,Me,K+sr,K+kr,1,Ie.minY,Ie.maxY,ue),an=null),xe>1&&console.timeEnd("clipping"),he.push(ft||[],V+1,2*$,2*K),he.push(xt||[],V+1,2*$,2*K+1),he.push(ln||[],V+1,2*$+1,2*K),he.push(Gn||[],V+1,2*$+1,2*K+1)}}},Sn.prototype.getTile=function(J,V,$){var K=this.options,te=K.extent,ce=K.debug;if(J<0||J>24)return null;var ge=1<1&&console.log("drilling down to z%d-%d-%d",J,V,$);for(var ue,xe=J,Me=V,je=$;!ue&&xe>0;)xe--,Me=Math.floor(Me/2),je=Math.floor(je/2),ue=this.tiles[Nl(xe,Me,je)];return ue&&ue.source?(ce>1&&console.log("found parent tile z%d-%d-%d",xe,Me,je),ce>1&&console.time("drilling down"),this.splitTile(ue.source,xe,Me,je,J,V,$),ce>1&&console.timeEnd("drilling down"),this.tiles[he]?Oc(this.tiles[he],te):null):null};class mi extends Fs{constructor(V,$,K,te){super(V,$,K,pi),this._dataUpdateable=new Map,this.loadGeoJSON=(ce,ge)=>{const{promoteId:he}=ce;if(ce.request)return b.getJSON(ce.request,(ue,xe,Me,je)=>{this._dataUpdateable=Zr(xe,he)?Vr(xe,he):void 0,ge(ue,xe,Me,je)});if("string"==typeof ce.data)try{const ue=JSON.parse(ce.data);this._dataUpdateable=Zr(ue,he)?Vr(ue,he):void 0,ge(null,ue)}catch{ge(new Error(`Input data given to '${ce.source}' is not a valid GeoJSON object.`))}else ce.dataDiff?this._dataUpdateable?(function(ue,xe,Me){var je,Ie,Dt,dt;if(xe.removeAll&&ue.clear(),xe.remove)for(const ft of xe.remove)ue.delete(ft);if(xe.add)for(const ft of xe.add){const xt=ao(ft,Me);null!=xt&&ue.set(xt,ft)}if(xe.update)for(const ft of xe.update){let xt=ue.get(ft.id);if(null==xt)continue;const ln=!ft.removeAllProperties&&((null===(je=ft.removeProperties)||void 0===je?void 0:je.length)>0||(null===(Ie=ft.addOrUpdateProperties)||void 0===Ie?void 0:Ie.length)>0);if((ft.newGeometry||ft.removeAllProperties||ln)&&(xt={...xt},ue.set(ft.id,xt),ln&&(xt.properties={...xt.properties})),ft.newGeometry&&(xt.geometry=ft.newGeometry),ft.removeAllProperties)xt.properties={};else if((null===(Dt=ft.removeProperties)||void 0===Dt?void 0:Dt.length)>0)for(const Gn of ft.removeProperties)Object.prototype.hasOwnProperty.call(xt.properties,Gn)&&delete xt.properties[Gn];if((null===(dt=ft.addOrUpdateProperties)||void 0===dt?void 0:dt.length)>0)for(const{key:Gn,value:nn}of ft.addOrUpdateProperties)xt.properties[Gn]=nn}}(this._dataUpdateable,ce.dataDiff,he),ge(null,{type:"FeatureCollection",features:Array.from(this._dataUpdateable.values())})):ge(new Error(`Cannot update existing geojson data in ${ce.source}`)):ge(new Error(`Input data given to '${ce.source}' is not a valid GeoJSON object.`));return{cancel:()=>{}}},te&&(this.loadGeoJSON=te)}loadData(V,$){var K;null===(K=this._pendingRequest)||void 0===K||K.cancel(),this._pendingCallback&&this._pendingCallback(null,{abandoned:!0});const te=!!(V&&V.request&&V.request.collectResourceTiming)&&new b.RequestPerformance(V.request);this._pendingCallback=$,this._pendingRequest=this.loadGeoJSON(V,(ce,ge)=>{if(delete this._pendingCallback,delete this._pendingRequest,ce||!ge)return $(ce);if("object"!=typeof ge)return $(new Error(`Input data given to '${V.source}' is not a valid GeoJSON object.`));{Ra(ge,!0);try{if(V.filter){const ue=b.createExpression(V.filter,{type:"boolean","property-type":"data-driven",overridable:!1,transition:!1});if("error"===ue.result)throw new Error(ue.value.map(Me=>`${Me.key}: ${Me.message}`).join(", "));const xe=ge.features.filter(Me=>ue.value.evaluate({zoom:0},Me));ge={type:"FeatureCollection",features:xe}}this._geoJSONIndex=V.cluster?new oi(function({superclusterOptions:ue,clusterProperties:xe}){if(!xe||!ue)return ue;const Me={},je={},Ie={accumulated:null,zoom:0},Dt={properties:null},dt=Object.keys(xe);for(const ft of dt){const[xt,ln]=xe[ft],Gn=b.createExpression(ln),nn=b.createExpression("string"==typeof xt?[xt,["accumulated"],["get",ft]]:xt);Me[ft]=Gn.value,je[ft]=nn.value}return ue.map=ft=>{Dt.properties=ft;const xt={};for(const ln of dt)xt[ln]=Me[ln].evaluate(Ie,Dt);return xt},ue.reduce=(ft,xt)=>{Dt.properties=xt;for(const ln of dt)Ie.accumulated=ft[ln],ft[ln]=je[ln].evaluate(Ie,Dt)},ue}(V)).load(ge.features):new Sn(ue=ge,V.geojsonVtOptions)}catch(ue){return $(ue)}this.loaded={};const he={};if(te){const ue=te.finish();ue&&(he.resourceTiming={},he.resourceTiming[V.source]=JSON.parse(JSON.stringify(ue)))}$(null,he)}var ue})}reloadTile(V,$){const K=this.loaded;return K&&K[V.uid]?super.reloadTile(V,$):this.loadTile(V,$)}removeSource(V,$){this._pendingCallback&&this._pendingCallback(null,{abandoned:!0}),$()}getClusterExpansionZoom(V,$){try{$(null,this._geoJSONIndex.getClusterExpansionZoom(V.clusterId))}catch(K){$(K)}}getClusterChildren(V,$){try{$(null,this._geoJSONIndex.getChildren(V.clusterId))}catch(K){$(K)}}getClusterLeaves(V,$){try{$(null,this._geoJSONIndex.getLeaves(V.clusterId,V.limit,V.offset))}catch(K){$(K)}}}class Bs{constructor(V){this.self=V,this.actor=new b.Actor(V,this),this.layerIndexes={},this.availableImages={},this.workerSourceTypes={vector:Fs,geojson:mi},this.workerSources={},this.demWorkerSources={},this.self.registerWorkerSource=($,K)=>{if(this.workerSourceTypes[$])throw new Error(`Worker source with name "${$}" already registered.`);this.workerSourceTypes[$]=K},this.self.registerRTLTextPlugin=$=>{if(b.plugin.isParsed())throw new Error("RTL text plugin already registered.");b.plugin.applyArabicShaping=$.applyArabicShaping,b.plugin.processBidirectionalText=$.processBidirectionalText,b.plugin.processStyledBidirectionalText=$.processStyledBidirectionalText}}setReferrer(V,$){this.referrer=$}setImages(V,$,K){this.availableImages[V]=$;for(const te in this.workerSources[V]){const ce=this.workerSources[V][te];for(const ge in ce)ce[ge].availableImages=$}K()}setLayers(V,$,K){this.getLayerIndex(V).replace($),K()}updateLayers(V,$,K){this.getLayerIndex(V).update($.layers,$.removedIds),K()}loadTile(V,$,K){this.getWorkerSource(V,$.type,$.source).loadTile($,K)}loadDEMTile(V,$,K){this.getDEMWorkerSource(V,$.source).loadTile($,K)}reloadTile(V,$,K){this.getWorkerSource(V,$.type,$.source).reloadTile($,K)}abortTile(V,$,K){this.getWorkerSource(V,$.type,$.source).abortTile($,K)}removeTile(V,$,K){this.getWorkerSource(V,$.type,$.source).removeTile($,K)}removeDEMTile(V,$){this.getDEMWorkerSource(V,$.source).removeTile($)}removeSource(V,$,K){if(!this.workerSources[V]||!this.workerSources[V][$.type]||!this.workerSources[V][$.type][$.source])return;const te=this.workerSources[V][$.type][$.source];delete this.workerSources[V][$.type][$.source],void 0!==te.removeSource?te.removeSource($,K):K()}loadWorkerSource(V,$,K){try{this.self.importScripts($.url),K()}catch(te){K(te.toString())}}syncRTLPluginState(V,$,K){try{b.plugin.setState($);const te=b.plugin.getPluginURL();if(b.plugin.isLoaded()&&!b.plugin.isParsed()&&null!=te){this.self.importScripts(te);const ce=b.plugin.isParsed();K(ce?void 0:new Error(`RTL Text Plugin failed to import scripts from ${te}`),ce)}}catch(te){K(te.toString())}}getAvailableImages(V){let $=this.availableImages[V];return $||($=[]),$}getLayerIndex(V){let $=this.layerIndexes[V];return $||($=this.layerIndexes[V]=new us),$}getWorkerSource(V,$,K){return this.workerSources[V]||(this.workerSources[V]={}),this.workerSources[V][$]||(this.workerSources[V][$]={}),this.workerSources[V][$][K]||(this.workerSources[V][$][K]=new this.workerSourceTypes[$]({send:(ce,ge,he)=>{this.actor.send(ce,ge,he,V)}},this.getLayerIndex(V),this.getAvailableImages(V))),this.workerSources[V][$][K]}getDEMWorkerSource(V,$){return this.demWorkerSources[V]||(this.demWorkerSources[V]={}),this.demWorkerSources[V][$]||(this.demWorkerSources[V][$]=new Os),this.demWorkerSources[V][$]}}return b.isWorker()&&(self.worker=new Bs(self)),Bs}),Zh(0,function(b){var _r=Rs;function Rs(g){return a=g,!(typeof window>"u"||typeof document>"u"||!(Array.prototype&&Array.prototype.every&&Array.prototype.filter&&Array.prototype.forEach&&Array.prototype.indexOf&&Array.prototype.lastIndexOf&&Array.prototype.map&&Array.prototype.some&&Array.prototype.reduce&&Array.prototype.reduceRight&&Array.isArray)||!Function.prototype||!Function.prototype.bind||!(Object.keys&&Object.create&&Object.getPrototypeOf&&Object.getOwnPropertyNames&&Object.isSealed&&Object.isFrozen&&Object.isExtensible&&Object.getOwnPropertyDescriptor&&Object.defineProperty&&Object.defineProperties&&Object.seal&&Object.freeze&&Object.preventExtensions)||!("JSON"in window&&"parse"in JSON&&"stringify"in JSON)||!function(){if(!("Worker"in window&&"Blob"in window&&"URL"in window))return!1;var m,y,w=new Blob([""],{type:"text/javascript"}),S=URL.createObjectURL(w);try{y=new Worker(S),m=!0}catch{m=!1}return y&&y.terminate(),URL.revokeObjectURL(S),m}()||!("Uint8ClampedArray"in window)||!ArrayBuffer.isView||!function(){var m=document.createElement("canvas");m.width=m.height=1;var y=m.getContext("2d");if(!y)return!1;var w=y.getImageData(0,0,1,1);return w&&w.width===m.width}()||(void 0===us[h=a&&a.failIfMajorPerformanceCaveat]&&(us[h]=function(m){var y,S,T,k,w=(S=m,T=document.createElement("canvas"),(k=Object.create(Rs.webGLContextAttributes)).failIfMajorPerformanceCaveat=S,T.getContext("webgl",k)||T.getContext("experimental-webgl",k));if(!w)return!1;try{y=w.createShader(w.VERTEX_SHADER)}catch{return!1}return!(!y||w.isContextLost())&&(w.shaderSource(y,"void main() {}"),w.compileShader(y),!0===w.getShaderParameter(y,w.COMPILE_STATUS))}(h)),!us[h]||document.documentMode));var a,h}var us={};Rs.webGLContextAttributes={antialias:!1,alpha:!0,stencil:!0,depth:!0};function Zt(g,a){if(Array.isArray(g)){if(!Array.isArray(a)||g.length!==a.length)return!1;for(let h=0;h{window.removeEventListener("click",Te.suppressClickInternal,!0)},0)}static mousePos(a,h){const m=a.getBoundingClientRect();return new b.pointGeometry(h.clientX-m.left-a.clientLeft,h.clientY-m.top-a.clientTop)}static touchPos(a,h){const m=a.getBoundingClientRect(),y=[];for(let w=0;w{a=[],h=0,m=0,y={}},g.addThrottleControl=T=>{const k=m++;return y[k]=T,k},g.removeThrottleControl=T=>{delete y[T]};const w=()=>{const T=Object.keys(y);let k=!1;if(T.length>0)for(const R of T)if(k=y[R](),k)break;return k};g.getImage=(T,k)=>{Ni.supported&&(T.headers||(T.headers={}),T.headers.accept="image/webp,*/*");const R={requestParameters:T,callback:k,cancelled:!1,completed:!1,cancel:()=>{}};return a.push(R),w()||g.processQueue(),R};const S=T=>{const{requestParameters:k,callback:R}=T;return b.getArrayBuffer(k,(z,L,j,Q)=>{var ee,Y;z?R(z):L&&(ee=L,Y=(ee,Y)=>{null!=ee?R(ee):null!=Y&&R(null,Y,{cacheControl:j,expires:Q})},"function"==typeof createImageBitmap?b.arrayBufferToImageBitmap(ee,Y):b.arrayBufferToImage(ee,Y)),T.cancelled||(T.completed=!0,h--,w()||g.processQueue())})};g.processQueue=(T=0)=>{T<=0&&(T=w()?b.config.MAX_PARALLEL_IMAGE_REQUESTS_PER_FRAME:b.config.MAX_PARALLEL_IMAGE_REQUESTS);for(let k=h;k0;k++){const R=a.shift();if(R.cancelled)continue;const z=S(R);h++,R.innerRequest=z,R.cancel=()=>{var L;(L=R).completed||L.cancelled||(h--,L.cancelled=!0,L.innerRequest.cancel(),g.processQueue())}}return a.length}}(no||(no={})),no.resetRequestQueue();var pn,g,ii=no;(g=pn||(pn={})).Glyphs="Glyphs",g.Image="Image",g.Source="Source",g.SpriteImage="SpriteImage",g.SpriteJSON="SpriteJSON",g.Style="Style",g.Tile="Tile",g.Unknown="Unknown";class kc{constructor(a){this._transformRequestFn=a}transformRequest(a,h){return this._transformRequestFn&&this._transformRequestFn(a,h)||{url:a}}normalizeSpriteURL(a,h,m){const y=function(w){const S=w.match(Mo);if(!S)throw new Error(`Unable to parse URL "${w}"`);return{protocol:S[1],authority:S[2],path:S[3]||"/",params:S[4]?S[4].split("&"):[]}}(a);return y.path+=`${h}${m}`,function(w){const S=w.params.length?`?${w.params.join("&")}`:"";return`${w.protocol}://${w.authority}${w.path}${S}`}(y)}setTransformRequest(a){this._transformRequestFn=a}}const Mo=/^(\w+):\/\/([^/?]*)(\/[^?]+)?\??(.+)?/;function na(g){var a=new b.ARRAY_TYPE(3);return a[0]=g[0],a[1]=g[1],a[2]=g[2],a}var Ls,ro=function(g,a,h){return g[0]=a[0]-h[0],g[1]=a[1]-h[1],g[2]=a[2]-h[2],g};Ls=new b.ARRAY_TYPE(3),b.ARRAY_TYPE!=Float32Array&&(Ls[0]=0,Ls[1]=0,Ls[2]=0);var Fa=function(g){var a=g[0],h=g[1];return a*a+h*h};function hs(g){return"string"==typeof g?[{id:"default",url:g}]:g??[]}!function(){var g=new b.ARRAY_TYPE(2);b.ARRAY_TYPE!=Float32Array&&(g[0]=0,g[1]=0)}();class Hn{constructor(a,h,m,y){this.context=a,this.format=m,this.texture=a.gl.createTexture(),this.update(h,y)}update(a,h,m){const{width:y,height:w}=a,S=!(this.size&&this.size[0]===y&&this.size[1]===w||m),{context:T}=this,{gl:k}=T;if(this.useMipmap=Boolean(h&&h.useMipmap),k.bindTexture(k.TEXTURE_2D,this.texture),T.pixelStoreUnpackFlipY.set(!1),T.pixelStoreUnpack.set(1),T.pixelStoreUnpackPremultiplyAlpha.set(this.format===k.RGBA&&(!h||!1!==h.premultiply)),S)this.size=[y,w],a instanceof HTMLImageElement||a instanceof HTMLCanvasElement||a instanceof HTMLVideoElement||a instanceof ImageData||b.isImageBitmap(a)?k.texImage2D(k.TEXTURE_2D,0,this.format,this.format,k.UNSIGNED_BYTE,a):k.texImage2D(k.TEXTURE_2D,0,this.format,y,w,0,this.format,k.UNSIGNED_BYTE,a.data);else{const{x:R,y:z}=m||{x:0,y:0};a instanceof HTMLImageElement||a instanceof HTMLCanvasElement||a instanceof HTMLVideoElement||a instanceof ImageData||b.isImageBitmap(a)?k.texSubImage2D(k.TEXTURE_2D,0,R,z,k.RGBA,k.UNSIGNED_BYTE,a):k.texSubImage2D(k.TEXTURE_2D,0,R,z,y,w,k.RGBA,k.UNSIGNED_BYTE,a.data)}this.useMipmap&&this.isSizePowerOfTwo()&&k.generateMipmap(k.TEXTURE_2D)}bind(a,h,m){const{context:y}=this,{gl:w}=y;w.bindTexture(w.TEXTURE_2D,this.texture),m!==w.LINEAR_MIPMAP_NEAREST||this.isSizePowerOfTwo()||(m=w.LINEAR),a!==this.filter&&(w.texParameteri(w.TEXTURE_2D,w.TEXTURE_MAG_FILTER,a),w.texParameteri(w.TEXTURE_2D,w.TEXTURE_MIN_FILTER,m||a),this.filter=a),h!==this.wrap&&(w.texParameteri(w.TEXTURE_2D,w.TEXTURE_WRAP_S,h),w.texParameteri(w.TEXTURE_2D,w.TEXTURE_WRAP_T,h),this.wrap=h)}isSizePowerOfTwo(){return this.size[0]===this.size[1]&&Math.log(this.size[0])/Math.LN2%1==0}destroy(){const{gl:a}=this.context;a.deleteTexture(this.texture),this.texture=null}}function Pu(g){const{userImage:a}=g;return!!(a&&a.render&&a.render())&&(g.data.replace(new Uint8Array(a.data.buffer)),!0)}class Tt extends b.Evented{constructor(){super(),this.images={},this.updatedImages={},this.callbackDispatchedThisFrame={},this.loaded=!1,this.requestors=[],this.patterns={},this.atlasImage=new b.RGBAImage({width:1,height:1}),this.dirty=!0}isLoaded(){return this.loaded}setLoaded(a){if(this.loaded!==a&&(this.loaded=a,a)){for(const{ids:h,callback:m}of this.requestors)this._notify(h,m);this.requestors=[]}}getImage(a){const h=this.images[a];if(h&&!h.data&&h.spriteData){const m=h.spriteData;h.data=new b.RGBAImage({width:m.width,height:m.height},m.context.getImageData(m.x,m.y,m.width,m.height).data),h.spriteData=null}return h}addImage(a,h){if(this.images[a])throw new Error(`Image id ${a} already exist, use updateImage instead`);this._validate(a,h)&&(this.images[a]=h)}_validate(a,h){let m=!0;const y=h.data||h.spriteData;return this._validateStretch(h.stretchX,y&&y.width)||(this.fire(new b.ErrorEvent(new Error(`Image "${a}" has invalid "stretchX" value`))),m=!1),this._validateStretch(h.stretchY,y&&y.height)||(this.fire(new b.ErrorEvent(new Error(`Image "${a}" has invalid "stretchY" value`))),m=!1),this._validateContent(h.content,h)||(this.fire(new b.ErrorEvent(new Error(`Image "${a}" has invalid "content" value`))),m=!1),m}_validateStretch(a,h){if(!a)return!0;let m=0;for(const y of a){if(y[0]-1);k++,w[k]=T,S[k]=R,S[k+1]=qr}for(let T=0,k=0;T{let T=this.entries[y];T||(T=this.entries[y]={glyphs:{},requests:{},ranges:{}});let k=T.glyphs[w];if(void 0!==k)return void S(null,{stack:y,id:w,glyph:k});if(k=this._tinySDF(T,y,w),k)return T.glyphs[w]=k,void S(null,{stack:y,id:w,glyph:k});const R=Math.floor(w/256);if(256*R>65535)return void S(new Error("glyphs > 65535 not supported"));if(T.ranges[R])return void S(null,{stack:y,id:w,glyph:k});if(!this.url)return void S(new Error("glyphsUrl is not set"));let z=T.requests[R];z||(z=T.requests[R]=[],Nn.loadGlyphRange(y,R,this.url,this.requestManager,(L,j)=>{if(j){for(const Q in j)this._doesCharSupportLocalGlyph(+Q)||(T.glyphs[+Q]=j[+Q]);T.ranges[R]=!0}for(const Q of z)Q(L,j);delete T.requests[R]})),z.push((L,j)=>{L?S(L):j&&S(null,{stack:y,id:w,glyph:j[w]||null})})},(y,w)=>{if(y)h(y);else if(w){const S={};for(const{stack:T,id:k,glyph:R}of w)(S[T]||(S[T]={}))[k]=R&&{id:R.id,bitmap:R.bitmap.clone(),metrics:R.metrics};h(null,S)}})}_doesCharSupportLocalGlyph(a){return!!this.localIdeographFontFamily&&(b.unicodeBlockLookup["CJK Unified Ideographs"](a)||b.unicodeBlockLookup["Hangul Syllables"](a)||b.unicodeBlockLookup.Hiragana(a)||b.unicodeBlockLookup.Katakana(a))}_tinySDF(a,h,m){const y=this.localIdeographFontFamily;if(!y||!this._doesCharSupportLocalGlyph(m))return;let w=a.tinySDF;if(!w){let T="400";/bold/i.test(h)?T="900":/medium/i.test(h)?T="500":/light/i.test(h)&&(T="200"),w=a.tinySDF=new Nn.TinySDF({fontSize:24,buffer:3,radius:8,cutoff:.25,fontFamily:y,fontWeight:T})}const S=w.draw(String.fromCharCode(m));return{id:m,bitmap:new b.AlphaImage({width:S.width||30,height:S.height||30},S.data),metrics:{width:S.glyphWidth||24,height:S.glyphHeight||24,left:S.glyphLeft||0,top:S.glyphTop-27||-8,advance:S.glyphAdvance||24}}}}Nn.loadGlyphRange=function(g,a,h,m,y){const w=256*a,S=w+255,T=m.transformRequest(h.replace("{fontstack}",g).replace("{range}",`${w}-${S}`),pn.Glyphs);b.getArrayBuffer(T,(k,R)=>{if(k)y(k);else if(R){const z={};for(const L of b.parseGlyphPbf(R))z[L.id]=L;y(null,z)}})},Nn.TinySDF=class{constructor({fontSize:g=24,buffer:a=3,radius:h=8,cutoff:m=.25,fontFamily:y="sans-serif",fontWeight:w="normal",fontStyle:S="normal"}={}){this.buffer=a,this.cutoff=m,this.radius=h;const T=this.size=g+4*a,k=this._createCanvas(T),R=this.ctx=k.getContext("2d",{willReadFrequently:!0});R.font=`${S} ${w} ${g}px ${y}`,R.textBaseline="alphabetic",R.textAlign="left",R.fillStyle="black",this.gridOuter=new Float64Array(T*T),this.gridInner=new Float64Array(T*T),this.f=new Float64Array(T),this.z=new Float64Array(T+1),this.v=new Uint16Array(T)}_createCanvas(g){const a=document.createElement("canvas");return a.width=a.height=g,a}draw(g){const{width:a,actualBoundingBoxAscent:h,actualBoundingBoxDescent:m,actualBoundingBoxLeft:y,actualBoundingBoxRight:w}=this.ctx.measureText(g),S=Math.ceil(h),T=Math.max(0,Math.min(this.size-this.buffer,Math.ceil(w-y))),k=Math.min(this.size-this.buffer,S+Math.ceil(m)),R=T+2*this.buffer,z=k+2*this.buffer,L=Math.max(R*z,0),j=new Uint8ClampedArray(L),Q={data:j,width:R,height:z,glyphWidth:T,glyphHeight:k,glyphTop:S,glyphLeft:0,glyphAdvance:a};if(0===T||0===k)return Q;const{ctx:ee,buffer:Y,gridInner:ae,gridOuter:_e}=this;ee.clearRect(Y,Y,T,k),ee.fillText(g,Y,Y+S);const ye=ee.getImageData(Y,Y,T,k);_e.fill(qr,0,L),ae.fill(0,0,L);for(let ie=0;ie0?ke*ke:0,ae[Se]=ke<0?ke*ke:0}}Oa(_e,0,0,R,z,R,this.f,this.v,this.z),Oa(ae,Y,Y,T,k,R,this.f,this.v,this.z);for(let ie=0;ie1&&(k=a[++T]);const z=Math.abs(R-k.left),L=Math.abs(R-k.right),j=Math.min(z,L);let Q;const ee=w/m*(y+1);if(k.isDash){const Y=y-Math.abs(ee);Q=Math.sqrt(j*j+Y*Y)}else Q=y-Math.sqrt(j*j+ee*ee);this.data[S+R]=Math.max(0,Math.min(255,Q+128))}}}addRegularDash(a){for(let T=a.length-1;T>=0;--T){const k=a[T],R=a[T+1];k.zeroLength?a.splice(T,1):R&&R.isDash===k.isDash&&(R.left=k.left,a.splice(T,1))}const h=a[0],m=a[a.length-1];h.isDash===m.isDash&&(h.left=m.left-this.width,m.right=h.right+this.width);const y=this.width*this.nextRow;let w=0,S=a[w];for(let T=0;T1&&(S=a[++w]);const k=Math.abs(T-S.left),R=Math.abs(T-S.right),z=Math.min(k,R);this.data[y+T]=Math.max(0,Math.min(255,(S.isDash?z:-z)+128))}}addDash(a,h){const m=h?7:0,y=2*m+1;if(this.nextRow+y>this.height)return b.warnOnce("LineAtlas out of space"),null;let w=0;for(let T=0;T{y.send(a,h,w)},m=m||function(){})}getActor(){return this.currentActor=(this.currentActor+1)%this.actors.length,this.actors[this.currentActor]}remove(a=!0){this.actors.forEach(h=>{h.remove()}),this.actors=[],a&&this.workerPool.release(this.id)}}function Na(g,a,h){const m=function(y,w){if(y)return h(y);if(w){const S=b.pick(b.extend(w,g),["tiles","minzoom","maxzoom","attribution","bounds","scheme","tileSize","encoding"]);w.vector_layers&&(S.vectorLayers=w.vector_layers,S.vectorLayerIds=S.vectorLayers.map(T=>T.id)),h(null,S)}};return g.url?b.getJSON(a.transformRequest(g.url,pn.Source),m):b.exported.frame(()=>m(null,g))}oi.Actor=b.Actor;class ra{constructor(a,h,m){this.bounds=b.LngLatBounds.convert(this.validateBounds(a)),this.minzoom=h||0,this.maxzoom=m||24}validateBounds(a){return Array.isArray(a)&&4===a.length?[Math.max(-180,a[0]),Math.max(-90,a[1]),Math.min(180,a[2]),Math.min(90,a[3])]:[-180,-90,180,90]}contains(a){const h=Math.pow(2,a.z),m=Math.floor(b.mercatorXfromLng(this.bounds.getWest())*h),y=Math.floor(b.mercatorYfromLat(this.bounds.getNorth())*h),w=Math.ceil(b.mercatorXfromLng(this.bounds.getEast())*h),S=Math.ceil(b.mercatorYfromLat(this.bounds.getSouth())*h);return a.x>=m&&a.x=y&&a.y{this._tileJSONRequest=null,this._loaded=!0,this.map.style.sourceCaches[this.id].clearTiles(),a?this.fire(new b.ErrorEvent(a)):h&&(b.extend(this,h),h.bounds&&(this.tileBounds=new ra(h.bounds,this.minzoom,this.maxzoom)),this.fire(new b.Event("data",{dataType:"source",sourceDataType:"metadata"})),this.fire(new b.Event("data",{dataType:"source",sourceDataType:"content"})))})}loaded(){return this._loaded}hasTile(a){return!this.tileBounds||this.tileBounds.contains(a.canonical)}onAdd(a){this.map=a,this.load()}setSourceProperty(a){this._tileJSONRequest&&this._tileJSONRequest.cancel(),a(),this.load()}setTiles(a){return this.setSourceProperty(()=>{this._options.tiles=a}),this}setUrl(a){return this.setSourceProperty(()=>{this.url=a,this._options.url=a}),this}onRemove(){this._tileJSONRequest&&(this._tileJSONRequest.cancel(),this._tileJSONRequest=null)}serialize(){return b.extend({},this._options)}loadTile(a,h){const m=a.tileID.canonical.url(this.tiles,this.map.getPixelRatio(),this.scheme),y={request:this.map._requestManager.transformRequest(m,pn.Tile),uid:a.uid,tileID:a.tileID,zoom:a.tileID.overscaledZ,tileSize:this.tileSize*a.tileID.overscaleFactor(),type:this.type,source:this.id,pixelRatio:this.map.getPixelRatio(),showCollisionBoxes:this.map.showCollisionBoxes,promoteId:this.promoteId};function w(S,T){return delete a.request,a.aborted?h(null):S&&404!==S.status?h(S):(T&&T.resourceTiming&&(a.resourceTiming=T.resourceTiming),this.map._refreshExpiredTiles&&T&&a.setExpiryData(T),a.loadVectorData(T,this.map.painter),h(null),void(a.reloadCallback&&(this.loadTile(a,a.reloadCallback),a.reloadCallback=null)))}y.request.collectResourceTiming=this._collectResourceTiming,a.actor&&"expired"!==a.state?"loading"===a.state?a.reloadCallback=h:a.request=a.actor.send("reloadTile",y,w.bind(this)):(a.actor=this.dispatcher.getActor(),a.request=a.actor.send("loadTile",y,w.bind(this)))}abortTile(a){a.request&&(a.request.cancel(),delete a.request),a.actor&&a.actor.send("abortTile",{uid:a.uid,type:this.type,source:this.id},void 0)}unloadTile(a){a.unloadVectorData(),a.actor&&a.actor.send("removeTile",{uid:a.uid,type:this.type,source:this.id},void 0)}hasTransition(){return!1}}class Qn extends b.Evented{constructor(a,h,m,y){super(),this.id=a,this.dispatcher=m,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=b.extend({type:"raster"},h),b.extend(this,b.pick(h,["url","scheme","tileSize"]))}load(){this._loaded=!1,this.fire(new b.Event("dataloading",{dataType:"source"})),this._tileJSONRequest=Na(this._options,this.map._requestManager,(a,h)=>{this._tileJSONRequest=null,this._loaded=!0,a?this.fire(new b.ErrorEvent(a)):h&&(b.extend(this,h),h.bounds&&(this.tileBounds=new ra(h.bounds,this.minzoom,this.maxzoom)),this.fire(new b.Event("data",{dataType:"source",sourceDataType:"metadata"})),this.fire(new b.Event("data",{dataType:"source",sourceDataType:"content"})))})}loaded(){return this._loaded}onAdd(a){this.map=a,this.load()}onRemove(){this._tileJSONRequest&&(this._tileJSONRequest.cancel(),this._tileJSONRequest=null)}serialize(){return b.extend({},this._options)}hasTile(a){return!this.tileBounds||this.tileBounds.contains(a.canonical)}loadTile(a,h){const m=a.tileID.canonical.url(this.tiles,this.map.getPixelRatio(),this.scheme);a.request=ii.getImage(this.map._requestManager.transformRequest(m,pn.Tile),(y,w,S)=>{if(delete a.request,a.aborted)a.state="unloaded",h(null);else if(y)a.state="errored",h(y);else if(w){this.map._refreshExpiredTiles&&a.setExpiryData(S);const T=this.map.painter.context,k=T.gl;a.texture=this.map.painter.getTileTexture(w.width),a.texture?a.texture.update(w,{useMipmap:!0}):(a.texture=new Hn(T,w,k.RGBA,{useMipmap:!0}),a.texture.bind(k.LINEAR,k.CLAMP_TO_EDGE,k.LINEAR_MIPMAP_NEAREST),T.extTextureFilterAnisotropic&&k.texParameterf(k.TEXTURE_2D,T.extTextureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,T.extTextureFilterAnisotropicMax)),a.state="loaded",h(null)}})}abortTile(a,h){a.request&&(a.request.cancel(),delete a.request),h()}unloadTile(a,h){a.texture&&this.map.painter.saveTileTexture(a.texture),h()}hasTransition(){return!1}}let Ae;class Pe extends Qn{constructor(a,h,m,y){super(a,h,m,y),this.type="raster-dem",this.maxzoom=22,this._options=b.extend({type:"raster-dem"},h),this.encoding=h.encoding||"mapbox"}serialize(){return{type:"raster-dem",url:this.url,tileSize:this.tileSize,tiles:this.tiles,bounds:this.bounds,encoding:this.encoding}}loadTile(a,h){const m=a.tileID.canonical.url(this.tiles,this.map.getPixelRatio(),this.scheme);function y(w,S){w&&(a.state="errored",h(w)),S&&(a.dem=S,a.needsHillshadePrepare=!0,a.needsTerrainPrepare=!0,a.state="loaded",h(null))}a.request=ii.getImage(this.map._requestManager.transformRequest(m,pn.Tile),function(w,S){if(delete a.request,a.aborted)a.state="unloaded",h(null);else if(w)a.state="errored",h(w);else if(S){this.map._refreshExpiredTiles&&a.setExpiryData(S),delete S.cacheControl,delete S.expires;const T=b.isImageBitmap(S)&&(null==Ae&&(Ae=typeof OffscreenCanvas<"u"&&new OffscreenCanvas(1,1).getContext("2d")&&"function"==typeof createImageBitmap),Ae)?S:b.exported.getImageData(S,1),k={uid:a.uid,coord:a.tileID,source:this.id,rawImageData:T,encoding:this.encoding};a.actor&&"expired"!==a.state||(a.actor=this.dispatcher.getActor(),a.actor.send("loadDEMTile",k,y.bind(this)))}}.bind(this)),a.neighboringTiles=this._getNeighboringTiles(a.tileID)}_getNeighboringTiles(a){const h=a.canonical,m=Math.pow(2,h.z),y=(h.x-1+m)%m,w=0===h.x?a.wrap-1:a.wrap,S=(h.x+1+m)%m,T=h.x+1===m?a.wrap+1:a.wrap,k={};return k[new b.OverscaledTileID(a.overscaledZ,w,h.z,y,h.y).key]={backfilled:!1},k[new b.OverscaledTileID(a.overscaledZ,T,h.z,S,h.y).key]={backfilled:!1},h.y>0&&(k[new b.OverscaledTileID(a.overscaledZ,w,h.z,y,h.y-1).key]={backfilled:!1},k[new b.OverscaledTileID(a.overscaledZ,a.wrap,h.z,h.x,h.y-1).key]={backfilled:!1},k[new b.OverscaledTileID(a.overscaledZ,T,h.z,S,h.y-1).key]={backfilled:!1}),h.y+1{if(this._pendingLoads--,this._removed||y&&y.abandoned)return void this.fire(new b.Event("dataabort",{dataType:"source"}));let w=null;if(y&&y.resourceTiming&&y.resourceTiming[this.id]&&(w=y.resourceTiming[this.id].slice(0)),m)return void this.fire(new b.ErrorEvent(m));const S={dataType:"source"};this._collectResourceTiming&&w&&w.length>0&&b.extend(S,{resourceTiming:w}),this.fire(new b.Event("data",{...S,sourceDataType:"metadata"})),this.fire(new b.Event("data",{...S,sourceDataType:"content"}))})}loaded(){return 0===this._pendingLoads}loadTile(a,h){const m=a.actor?"reloadTile":"loadTile";a.actor=this.actor;const y={type:this.type,uid:a.uid,tileID:a.tileID,zoom:a.tileID.overscaledZ,maxZoom:this.maxzoom,tileSize:this.tileSize,source:this.id,pixelRatio:this.map.getPixelRatio(),showCollisionBoxes:this.map.showCollisionBoxes,promoteId:this.promoteId};a.request=this.actor.send(m,y,(w,S)=>(delete a.request,a.unloadVectorData(),a.aborted?h(null):w?h(w):(a.loadVectorData(S,this.map.painter,"reloadTile"===m),h(null))))}abortTile(a){a.request&&(a.request.cancel(),delete a.request),a.aborted=!0}unloadTile(a){a.unloadVectorData(),this.actor.send("removeTile",{uid:a.uid,type:this.type,source:this.id})}onRemove(){this._removed=!0,this.actor.send("removeSource",{type:this.type,source:this.id})}serialize(){return b.extend({},this._options,{type:this.type,data:this._data})}hasTransition(){return!1}}var zi=b.createLayout([{name:"a_pos",type:"Int16",components:2},{name:"a_texture_pos",type:"Int16",components:2}]);class Vn extends b.Evented{constructor(a,h,m,y){super(),this.id=a,this.dispatcher=m,this.coordinates=h.coordinates,this.type="image",this.minzoom=0,this.maxzoom=22,this.tileSize=512,this.tiles={},this._loaded=!1,this.setEventedParent(y),this.options=h}load(a,h){this._loaded=!1,this.fire(new b.Event("dataloading",{dataType:"source"})),this.url=this.options.url,this._request=ii.getImage(this.map._requestManager.transformRequest(this.url,pn.Image),(m,y)=>{this._request=null,this._loaded=!0,m?this.fire(new b.ErrorEvent(m)):y&&(this.image=y,a&&(this.coordinates=a),h&&h(),this._finishLoading())})}loaded(){return this._loaded}updateImage(a){return a.url?(this._request&&(this._request.cancel(),this._request=null),this.options.url=a.url,this.load(a.coordinates,()=>{this.texture=null}),this):this}_finishLoading(){this.map&&(this.setCoordinates(this.coordinates),this.fire(new b.Event("data",{dataType:"source",sourceDataType:"metadata"})))}onAdd(a){this.map=a,this.load()}onRemove(){this._request&&(this._request.cancel(),this._request=null)}setCoordinates(a){this.coordinates=a;const h=a.map(b.MercatorCoordinate.fromLngLat);this.tileID=function(y){let w=1/0,S=1/0,T=-1/0,k=-1/0;for(const j of y)w=Math.min(w,j.x),S=Math.min(S,j.y),T=Math.max(T,j.x),k=Math.max(k,j.y);const R=Math.max(T-w,k-S),z=Math.max(0,Math.floor(-Math.log(R)/Math.LN2)),L=Math.pow(2,z);return new b.CanonicalTileID(z,Math.floor((w+T)/2*L),Math.floor((S+k)/2*L))}(h),this.minzoom=this.maxzoom=this.tileID.z;const m=h.map(y=>this.tileID.getTilePoint(y)._round());return this._boundsArray=new b.RasterBoundsArray,this._boundsArray.emplaceBack(m[0].x,m[0].y,0,0),this._boundsArray.emplaceBack(m[1].x,m[1].y,b.EXTENT,0),this._boundsArray.emplaceBack(m[3].x,m[3].y,0,b.EXTENT),this._boundsArray.emplaceBack(m[2].x,m[2].y,b.EXTENT,b.EXTENT),this.boundsBuffer&&(this.boundsBuffer.destroy(),delete this.boundsBuffer),this.fire(new b.Event("data",{dataType:"source",sourceDataType:"content"})),this}prepare(){if(0===Object.keys(this.tiles).length||!this.image)return;const a=this.map.painter.context,h=a.gl;this.boundsBuffer||(this.boundsBuffer=a.createVertexBuffer(this._boundsArray,zi.members)),this.boundsSegments||(this.boundsSegments=b.SegmentVector.simpleSegment(0,0,4,2)),this.texture||(this.texture=new Hn(a,this.image,h.RGBA),this.texture.bind(h.LINEAR,h.CLAMP_TO_EDGE));for(const m in this.tiles){const y=this.tiles[m];"loaded"!==y.state&&(y.state="loaded",y.texture=this.texture)}}loadTile(a,h){this.tileID&&this.tileID.equals(a.tileID.canonical)?(this.tiles[String(a.tileID.wrap)]=a,a.buckets={},h(null)):(a.state="errored",h(null))}serialize(){return{type:"image",url:this.options.url,coordinates:this.coordinates}}hasTransition(){return!1}}class ds extends Vn{constructor(a,h,m,y){super(a,h,m,y),this.roundZoom=!0,this.type="video",this.options=h}load(){this._loaded=!1;const a=this.options;this.urls=[];for(const h of a.urls)this.urls.push(this.map._requestManager.transformRequest(h,pn.Source).url);b.getVideo(this.urls,(h,m)=>{this._loaded=!0,h?this.fire(new b.ErrorEvent(h)):m&&(this.video=m,this.video.loop=!0,this.video.addEventListener("playing",()=>{this.map.triggerRepaint()}),this.map&&this.video.play(),this._finishLoading())})}pause(){this.video&&this.video.pause()}play(){this.video&&this.video.play()}seek(a){if(this.video){const h=this.video.seekable;ah.end(0)?this.fire(new b.ErrorEvent(new b.ValidationError(`sources.${this.id}`,null,`Playback for this video can be set only between the ${h.start(0)} and ${h.end(0)}-second mark.`))):this.video.currentTime=a}}getVideo(){return this.video}onAdd(a){this.map||(this.map=a,this.load(),this.video&&(this.video.play(),this.setCoordinates(this.coordinates)))}prepare(){if(0===Object.keys(this.tiles).length||this.video.readyState<2)return;const a=this.map.painter.context,h=a.gl;this.boundsBuffer||(this.boundsBuffer=a.createVertexBuffer(this._boundsArray,zi.members)),this.boundsSegments||(this.boundsSegments=b.SegmentVector.simpleSegment(0,0,4,2)),this.texture?this.video.paused||(this.texture.bind(h.LINEAR,h.CLAMP_TO_EDGE),h.texSubImage2D(h.TEXTURE_2D,0,0,0,h.RGBA,h.UNSIGNED_BYTE,this.video)):(this.texture=new Hn(a,this.video,h.RGBA),this.texture.bind(h.LINEAR,h.CLAMP_TO_EDGE));for(const m in this.tiles){const y=this.tiles[m];"loaded"!==y.state&&(y.state="loaded",y.texture=this.texture)}}serialize(){return{type:"video",urls:this.urls,coordinates:this.coordinates}}hasTransition(){return this.video&&!this.video.paused}}class Bi extends Vn{constructor(a,h,m,y){super(a,h,m,y),h.coordinates?Array.isArray(h.coordinates)&&4===h.coordinates.length&&!h.coordinates.some(w=>!Array.isArray(w)||2!==w.length||w.some(S=>"number"!=typeof S))||this.fire(new b.ErrorEvent(new b.ValidationError(`sources.${a}`,null,'"coordinates" property must be an array of 4 longitude/latitude array pairs'))):this.fire(new b.ErrorEvent(new b.ValidationError(`sources.${a}`,null,'missing required property "coordinates"'))),h.animate&&"boolean"!=typeof h.animate&&this.fire(new b.ErrorEvent(new b.ValidationError(`sources.${a}`,null,'optional "animate" property must be a boolean value'))),h.canvas?"string"==typeof h.canvas||h.canvas instanceof HTMLCanvasElement||this.fire(new b.ErrorEvent(new b.ValidationError(`sources.${a}`,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 b.ErrorEvent(new b.ValidationError(`sources.${a}`,null,'missing required property "canvas"'))),this.options=h,this.animate=void 0===h.animate||h.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 b.ErrorEvent(new Error("Canvas dimensions cannot be less than or equal to zero."))):(this.play=function(){this._playing=!0,this.map.triggerRepaint()},this.pause=function(){this._playing&&(this.prepare(),this._playing=!1)},this._finishLoading())}getCanvas(){return this.canvas}onAdd(a){this.map=a,this.load(),this.canvas&&this.animate&&this.play()}onRemove(){this.pause()}prepare(){let a=!1;if(this.canvas.width!==this.width&&(this.width=this.canvas.width,a=!0),this.canvas.height!==this.height&&(this.height=this.canvas.height,a=!0),this._hasInvalidDimensions()||0===Object.keys(this.tiles).length)return;const h=this.map.painter.context,m=h.gl;this.boundsBuffer||(this.boundsBuffer=h.createVertexBuffer(this._boundsArray,zi.members)),this.boundsSegments||(this.boundsSegments=b.SegmentVector.simpleSegment(0,0,4,2)),this.texture?(a||this._playing)&&this.texture.update(this.canvas,{premultiply:!0}):this.texture=new Hn(h,this.canvas,m.RGBA,{premultiply:!0});for(const y in this.tiles){const w=this.tiles[y];"loaded"!==w.state&&(w.state="loaded",w.texture=this.texture)}}serialize(){return{type:"canvas",coordinates:this.coordinates}}hasTransition(){return this._playing}_hasInvalidDimensions(){for(const a of[this.canvas.width,this.canvas.height])if(isNaN(a)||a<=0)return!0;return!1}}const Ol={vector:mr,raster:Qn,"raster-dem":Pe,geojson:za,video:ds,image:Vn,canvas:Bi};function fs(g,a){const h=b.create();return b.translate(h,h,[1,1,0]),b.scale(h,h,[.5*g.width,.5*g.height,1]),b.multiply(h,h,g.calculatePosMatrix(a.toUnwrapped()))}function rt(g,a,h,m,y,w){const S=function(L,j,Q){if(L)for(const ee of L){const Y=j[ee];if(Y&&Y.source===Q&&"fill-extrusion"===Y.type)return!0}else for(const ee in j){const Y=j[ee];if(Y.source===Q&&"fill-extrusion"===Y.type)return!0}return!1}(y&&y.layers,a,g.id),T=w.maxPitchScaleFactor(),k=g.tilesIn(m,T,S);k.sort(Jt);const R=[];for(const L of k)R.push({wrappedTileID:L.tileID.wrapped().key,queryResults:L.tile.queryRenderedFeatures(a,h,g._state,L.queryGeometry,L.cameraQueryGeometry,L.scale,y,w,T,fs(g.transform,L.tileID))});const z=function(L){const j={},Q={};for(const ee of L){const Y=ee.queryResults,ae=ee.wrappedTileID,_e=Q[ae]=Q[ae]||{};for(const ye in Y){const ie=Y[ye],we=_e[ye]=_e[ye]||{},De=j[ye]=j[ye]||[];for(const Se of ie)we[Se.featureIndex]||(we[Se.featureIndex]=!0,De.push(Se))}}return j}(R);for(const L in z)z[L].forEach(j=>{const Q=j.feature,ee=g.getFeatureState(Q.layer["source-layer"],Q.id);Q.source=Q.layer.source,Q.layer["source-layer"]&&(Q.sourceLayer=Q.layer["source-layer"]),Q.state=ee});return z}function Jt(g,a){const h=g.tileID,m=a.tileID;return h.overscaledZ-m.overscaledZ||h.canonical.y-m.canonical.y||h.wrap-m.wrap||h.canonical.x-m.canonical.x}class jt{constructor(a,h){this.tileID=a,this.uid=b.uniqueId(),this.uses=0,this.tileSize=h,this.buckets={},this.expirationTime=null,this.queryPadding=0,this.hasSymbolBuckets=!1,this.hasRTLText=!1,this.dependencies={},this.rtt=[],this.rttCoords={},this.expiredRequestCount=0,this.state="loading"}registerFadeDuration(a){const h=a+this.timeAdded;hw.getLayer(R)).filter(Boolean);if(0!==k.length){T.layers=k,T.stateDependentLayerIds&&(T.stateDependentLayers=T.stateDependentLayerIds.map(R=>k.filter(z=>z.id===R)[0]));for(const R of k)S[R.id]=T}}return S}(a.buckets,h.style),this.hasSymbolBuckets=!1;for(const y in this.buckets){const w=this.buckets[y];if(w instanceof b.SymbolBucket){if(this.hasSymbolBuckets=!0,!m)break;w.justReloaded=!0}}if(this.hasRTLText=!1,this.hasSymbolBuckets)for(const y in this.buckets){const w=this.buckets[y];if(w instanceof b.SymbolBucket&&w.hasRTLText){this.hasRTLText=!0,b.lazyLoadRTLTextPlugin();break}}this.queryPadding=0;for(const y in this.buckets){const w=this.buckets[y];this.queryPadding=Math.max(this.queryPadding,h.style.getLayer(y).queryRadius(w))}a.imageAtlas&&(this.imageAtlas=a.imageAtlas),a.glyphAtlasImage&&(this.glyphAtlasImage=a.glyphAtlasImage)}else this.collisionBoxArray=new b.CollisionBoxArray}unloadVectorData(){for(const a in this.buckets)this.buckets[a].destroy();this.buckets={},this.imageAtlasTexture&&this.imageAtlasTexture.destroy(),this.imageAtlas&&(this.imageAtlas=null),this.glyphAtlasTexture&&this.glyphAtlasTexture.destroy(),this.latestFeatureIndex=null,this.state="unloaded"}getBucket(a){return this.buckets[a.id]}upload(a){for(const m in this.buckets){const y=this.buckets[m];y.uploadPending()&&y.upload(a)}const h=a.gl;this.imageAtlas&&!this.imageAtlas.uploaded&&(this.imageAtlasTexture=new Hn(a,this.imageAtlas.image,h.RGBA),this.imageAtlas.uploaded=!0),this.glyphAtlasImage&&(this.glyphAtlasTexture=new Hn(a,this.glyphAtlasImage,h.ALPHA),this.glyphAtlasImage=null)}prepare(a){this.imageAtlas&&this.imageAtlas.patchUpdatedImages(a,this.imageAtlasTexture)}queryRenderedFeatures(a,h,m,y,w,S,T,k,R,z){return this.latestFeatureIndex&&this.latestFeatureIndex.rawTileData?this.latestFeatureIndex.query({queryGeometry:y,cameraQueryGeometry:w,scale:S,tileSize:this.tileSize,pixelPosMatrix:z,transform:k,params:T,queryPadding:this.queryPadding*R},a,h,m):{}}querySourceFeatures(a,h){const m=this.latestFeatureIndex;if(!m||!m.rawTileData)return;const y=m.loadVTLayers(),w=h&&h.sourceLayer?h.sourceLayer:"",S=y._geojsonTileLayer||y[w];if(!S)return;const T=b.createFilter(h&&h.filter),{z:k,x:R,y:z}=this.tileID.canonical,L={z:k,x:R,y:z};for(let j=0;jm)y=!1;else if(h)if(this.expirationTime{this.remove(a,w)},m)),this.data[y].push(w),this.order.push(y),this.order.length>this.max){const S=this._getAndRemoveByKey(this.order[0]);S&&this.onRemove(S)}return this}has(a){return a.wrapped().key in this.data}getAndRemove(a){return this.has(a)?this._getAndRemoveByKey(a.wrapped().key):null}_getAndRemoveByKey(a){const h=this.data[a].shift();return h.timeout&&clearTimeout(h.timeout),0===this.data[a].length&&delete this.data[a],this.order.splice(this.order.indexOf(a),1),h.value}getByKey(a){const h=this.data[a];return h?h[0].value:null}get(a){return this.has(a)?this.data[a.wrapped().key][0].value:null}remove(a,h){if(!this.has(a))return this;const m=a.wrapped().key,y=void 0===h?0:this.data[m].indexOf(h),w=this.data[m][y];return this.data[m].splice(y,1),w.timeout&&clearTimeout(w.timeout),0===this.data[m].length&&delete this.data[m],this.onRemove(w.value),this.order.splice(this.order.indexOf(m),1),this}setMaxSize(a){for(this.max=a;this.order.length>this.max;){const h=this._getAndRemoveByKey(this.order[0]);h&&this.onRemove(h)}return this}filter(a){const h=[];for(const m in this.data)for(const y of this.data[m])a(y.value)||h.push(y);for(const m of h)this.remove(m.value.tileID,m)}}class ps{constructor(){this.state={},this.stateChanges={},this.deletedStates={}}updateState(a,h,m){const y=String(h);if(this.stateChanges[a]=this.stateChanges[a]||{},this.stateChanges[a][y]=this.stateChanges[a][y]||{},b.extend(this.stateChanges[a][y],m),null===this.deletedStates[a]){this.deletedStates[a]={};for(const w in this.state[a])w!==y&&(this.deletedStates[a][w]=null)}else if(this.deletedStates[a]&&null===this.deletedStates[a][y]){this.deletedStates[a][y]={};for(const w in this.state[a][y])m[w]||(this.deletedStates[a][y][w]=null)}else for(const w in m)this.deletedStates[a]&&this.deletedStates[a][y]&&null===this.deletedStates[a][y][w]&&delete this.deletedStates[a][y][w]}removeFeatureState(a,h,m){if(null===this.deletedStates[a])return;const y=String(h);if(this.deletedStates[a]=this.deletedStates[a]||{},m&&void 0!==h)null!==this.deletedStates[a][y]&&(this.deletedStates[a][y]=this.deletedStates[a][y]||{},this.deletedStates[a][y][m]=null);else if(void 0!==h)if(this.stateChanges[a]&&this.stateChanges[a][y])for(m in this.deletedStates[a][y]={},this.stateChanges[a][y])this.deletedStates[a][y][m]=null;else this.deletedStates[a][y]=null;else this.deletedStates[a]=null}getState(a,h){const m=String(h),y=b.extend({},(this.state[a]||{})[m],(this.stateChanges[a]||{})[m]);if(null===this.deletedStates[a])return{};if(this.deletedStates[a]){const w=this.deletedStates[a][h];if(null===w)return{};for(const S in w)delete y[S]}return y}initializeTileState(a,h){a.setFeatureState(this.state,h)}coalesceChanges(a,h){const m={};for(const y in this.stateChanges){this.state[y]=this.state[y]||{};const w={};for(const S in this.stateChanges[y])this.state[y][S]||(this.state[y][S]={}),b.extend(this.state[y][S],this.stateChanges[y][S]),w[S]=this.state[y][S];m[y]=w}for(const y in this.deletedStates){this.state[y]=this.state[y]||{};const w={};if(null===this.deletedStates[y])for(const S in this.state[y])w[S]={},this.state[y][S]={};else for(const S in this.deletedStates[y]){if(null===this.deletedStates[y][S])this.state[y][S]={};else for(const T of Object.keys(this.deletedStates[y][S]))delete this.state[y][S][T];w[S]=this.state[y][S]}m[y]=m[y]||{},b.extend(m[y],w)}if(this.stateChanges={},this.deletedStates={},0!==Object.keys(m).length)for(const y in a)a[y].setFeatureState(m,h)}}class At extends b.Evented{constructor(a,h,m){super(),this.id=a,this.dispatcher=m,this.on("data",y=>{"source"===y.dataType&&"metadata"===y.sourceDataType&&(this._sourceLoaded=!0),this._sourceLoaded&&!this._paused&&"source"===y.dataType&&"content"===y.sourceDataType&&(this.reload(),this.transform&&this.update(this.transform,this.terrain))}),this.on("dataloading",()=>{this._sourceErrored=!1}),this.on("error",()=>{this._sourceErrored=this._source.loaded()}),this._source=function(y,w,S,T){const k=new Ol[w.type](y,w,S,T);if(k.id!==y)throw new Error(`Expected Source id to be ${y} instead of ${k.id}`);return b.bindAll(["load","abort","unload","serialize","prepare"],k),k}(a,h,m,this),this._tiles={},this._cache=new io(0,this._unloadTile.bind(this)),this._timers={},this._cacheTimers={},this._maxTileCacheSize=null,this._loadedParentTiles={},this._coveredTiles={},this._state=new ps}onAdd(a){this.map=a,this._maxTileCacheSize=a?a._maxTileCacheSize:null,this._source&&this._source.onAdd&&this._source.onAdd(a)}onRemove(a){this.clearTiles(),this._source&&this._source.onRemove&&this._source.onRemove(a)}loaded(){if(this._sourceErrored)return!0;if(!this._sourceLoaded||!this._source.loaded())return!1;for(const a in this._tiles){const h=this._tiles[a];if("loaded"!==h.state&&"errored"!==h.state)return!1}return!0}getSource(){return this._source}pause(){this._paused=!0}resume(){if(!this._paused)return;const a=this._shouldReloadOnResume;this._paused=!1,this._shouldReloadOnResume=!1,a&&this.reload(),this.transform&&this.update(this.transform,this.terrain)}_loadTile(a,h){return this._source.loadTile(a,h)}_unloadTile(a){if(this._source.unloadTile)return this._source.unloadTile(a,()=>{})}_abortTile(a){this._source.abortTile&&this._source.abortTile(a,()=>{}),this._source.fire(new b.Event("dataabort",{tile:a,coord:a.tileID,dataType:"source"}))}serialize(){return this._source.serialize()}prepare(a){this._source.prepare&&this._source.prepare(),this._state.coalesceChanges(this._tiles,this.map?this.map.painter:null);for(const h in this._tiles){const m=this._tiles[h];m.upload(a),m.prepare(this.map.style.imageManager)}}getIds(){return Object.values(this._tiles).map(a=>a.tileID).sort(zs).map(a=>a.key)}getRenderableIds(a){const h=[];for(const m in this._tiles)this._isIdRenderable(m,a)&&h.push(this._tiles[m]);return a?h.sort((m,y)=>{const w=m.tileID,S=y.tileID,T=new b.pointGeometry(w.canonical.x,w.canonical.y)._rotate(this.transform.angle),k=new b.pointGeometry(S.canonical.x,S.canonical.y)._rotate(this.transform.angle);return w.overscaledZ-S.overscaledZ||k.y-T.y||k.x-T.x}).map(m=>m.tileID.key):h.map(m=>m.tileID).sort(zs).map(m=>m.key)}hasRenderableParent(a){const h=this.findLoadedParent(a,0);return!!h&&this._isIdRenderable(h.tileID.key)}_isIdRenderable(a,h){return this._tiles[a]&&this._tiles[a].hasData()&&!this._coveredTiles[a]&&(h||!this._tiles[a].holdingForFade())}reload(){if(this._paused)this._shouldReloadOnResume=!0;else{this._cache.reset();for(const a in this._tiles)"errored"!==this._tiles[a].state&&this._reloadTile(a,"reloading")}}_reloadTile(a,h){const m=this._tiles[a];m&&("loading"!==m.state&&(m.state=h),this._loadTile(m,this._tileLoaded.bind(this,m,a,h)))}_tileLoaded(a,h,m,y){if(y)return a.state="errored",void(404!==y.status?this._source.fire(new b.ErrorEvent(y,{tile:a})):this.update(this.transform,this.terrain));a.timeAdded=b.exported.now(),"expired"===m&&(a.refreshedUponExpiration=!0),this._setTileReloadTimer(h,a),"raster-dem"===this.getSource().type&&a.dem&&this._backfillDEM(a),this._state.initializeTileState(a,this.map?this.map.painter:null),a.aborted||this._source.fire(new b.Event("data",{dataType:"source",tile:a,coord:a.tileID}))}_backfillDEM(a){const h=this.getRenderableIds();for(let y=0;y1||(Math.abs(S)>1&&(1===Math.abs(S+k)?S+=k:1===Math.abs(S-k)&&(S-=k)),w.dem&&y.dem&&(y.dem.backfillBorder(w.dem,S,T),y.neighboringTiles&&y.neighboringTiles[R]&&(y.neighboringTiles[R].backfilled=!0)))}}getTile(a){return this.getTileByID(a.key)}getTileByID(a){return this._tiles[a]}_retainLoadedChildren(a,h,m,y){for(const w in this._tiles){let S=this._tiles[w];if(y[w]||!S.hasData()||S.tileID.overscaledZ<=h||S.tileID.overscaledZ>m)continue;let T=S.tileID;for(;S&&S.tileID.overscaledZ>h+1;){const R=S.tileID.scaledTo(S.tileID.overscaledZ-1);S=this._tiles[R.key],S&&S.hasData()&&(T=R)}let k=T;for(;k.overscaledZ>h;)if(k=k.scaledTo(k.overscaledZ-1),a[k.key]){y[T.key]=T;break}}}findLoadedParent(a,h){if(a.key in this._loadedParentTiles){const m=this._loadedParentTiles[a.key];return m&&m.tileID.overscaledZ>=h?m:null}for(let m=a.overscaledZ-1;m>=h;m--){const y=a.scaledTo(m),w=this._getLoadedTile(y);if(w)return w}}_getLoadedTile(a){const h=this._tiles[a.key];return h&&h.hasData()?h:this._cache.getByKey(a.wrapped().key)}updateCacheSize(a){const h=Math.ceil(a.width/this._source.tileSize)+1,m=Math.ceil(a.height/this._source.tileSize)+1,y=Math.floor(h*m*5),w="number"==typeof this._maxTileCacheSize?Math.min(this._maxTileCacheSize,y):y;this._cache.setMaxSize(w)}handleWrapJump(a){const h=Math.round((a-(void 0===this._prevLng?a:this._prevLng))/360);if(this._prevLng=a,h){const m={};for(const y in this._tiles){const w=this._tiles[y];w.tileID=w.tileID.unwrapTo(w.tileID.wrap+h),m[w.tileID.key]=w}this._tiles=m;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(a,h){if(this.transform=a,this.terrain=h,!this._sourceLoaded||this._paused)return;let m;this.updateCacheSize(a),this.handleWrapJump(this.transform.center.lng),this._coveredTiles={},this.used||this.usedForTerrain?this._source.tileID?m=a.getVisibleUnwrappedCoordinates(this._source.tileID).map(R=>new b.OverscaledTileID(R.canonical.z,R.wrap,R.canonical.z,R.canonical.x,R.canonical.y)):(m=a.coveringTiles({tileSize:this.usedForTerrain?this.tileSize:this._source.tileSize,minzoom:this._source.minzoom,maxzoom:this._source.maxzoom,roundZoom:!this.usedForTerrain&&this._source.roundZoom,reparseOverscaled:this._source.reparseOverscaled,terrain:h}),this._source.hasTile&&(m=m.filter(R=>this._source.hasTile(R)))):m=[];const y=a.coveringZoomLevel(this._source),w=Math.max(y-At.maxOverzooming,this._source.minzoom),S=Math.max(y+At.maxUnderzooming,this._source.minzoom);if(this.usedForTerrain){const R={};for(const z of m)if(z.canonical.z>this._source.minzoom){const L=z.scaledTo(z.canonical.z-1);R[L.key]=L;const j=z.scaledTo(Math.max(this._source.minzoom,Math.min(z.canonical.z,5)));R[j.key]=j}m=m.concat(Object.values(R))}const T=this._updateRetainedTiles(m,y);if(Ci(this._source.type)){const R={},z={},L=Object.keys(T);for(const j of L){const Q=T[j],ee=this._tiles[j];if(!ee||ee.fadeEndTime&&ee.fadeEndTime<=b.exported.now())continue;const Y=this.findLoadedParent(Q,w);Y&&(this._addTile(Y.tileID),R[Y.tileID.key]=Y.tileID),z[j]=Q}this._retainLoadedChildren(z,y,S,T);for(const j in R)T[j]||(this._coveredTiles[j]=!0,T[j]=R[j]);if(h){const j={},Q={};for(const ee of m)this._tiles[ee.key].hasData()?j[ee.key]=ee:Q[ee.key]=ee;for(const ee in Q){const Y=Q[ee].children(this._source.maxzoom);this._tiles[Y[0].key]&&this._tiles[Y[1].key]&&this._tiles[Y[2].key]&&this._tiles[Y[3].key]&&(j[Y[0].key]=T[Y[0].key]=Y[0],j[Y[1].key]=T[Y[1].key]=Y[1],j[Y[2].key]=T[Y[2].key]=Y[2],j[Y[3].key]=T[Y[3].key]=Y[3],delete Q[ee])}for(const ee in Q){const Y=this.findLoadedParent(Q[ee],this._source.minzoom);if(Y){j[Y.tileID.key]=T[Y.tileID.key]=Y.tileID;for(const ae in j)j[ae].isChildOf(Y.tileID)&&delete j[ae]}}for(const ee in this._tiles)j[ee]||(this._coveredTiles[ee]=!0)}}for(const R in T)this._tiles[R].clearFadeHold();const k=b.keysDifference(this._tiles,T);for(const R of k){const z=this._tiles[R];z.hasSymbolBuckets&&!z.holdingForFade()?z.setHoldDuration(this.map._fadeDuration):z.hasSymbolBuckets&&!z.symbolFadeFinished()||this._removeTile(R)}this._updateLoadedParentTileCache()}releaseSymbolFadeTiles(){for(const a in this._tiles)this._tiles[a].holdingForFade()&&this._removeTile(a)}_updateRetainedTiles(a,h){const m={},y={},w=Math.max(h-At.maxOverzooming,this._source.minzoom),S=Math.max(h+At.maxUnderzooming,this._source.minzoom),T={};for(const k of a){const R=this._addTile(k);m[k.key]=k,R.hasData()||hthis._source.maxzoom){const L=k.children(this._source.maxzoom)[0],j=this.getTile(L);if(j&&j.hasData()){m[L.key]=L;continue}}else{const L=k.children(this._source.maxzoom);if(m[L[0].key]&&m[L[1].key]&&m[L[2].key]&&m[L[3].key])continue}let z=R.wasRequested();for(let L=k.overscaledZ-1;L>=w;--L){const j=k.scaledTo(L);if(y[j.key]||(y[j.key]=!0,R=this.getTile(j),!R&&z&&(R=this._addTile(j)),R&&(m[j.key]=j,z=R.wasRequested(),R.hasData())))break}}return m}_updateLoadedParentTileCache(){this._loadedParentTiles={};for(const a in this._tiles){const h=[];let m,y=this._tiles[a].tileID;for(;y.overscaledZ>0;){if(y.key in this._loadedParentTiles){m=this._loadedParentTiles[y.key];break}h.push(y.key);const w=y.scaledTo(y.overscaledZ-1);if(m=this._getLoadedTile(w),m)break;y=w}for(const w of h)this._loadedParentTiles[w]=m}}_addTile(a){let h=this._tiles[a.key];if(h)return h;h=this._cache.getAndRemove(a),h&&(this._setTileReloadTimer(a.key,h),h.tileID=a,this._state.initializeTileState(h,this.map?this.map.painter:null),this._cacheTimers[a.key]&&(clearTimeout(this._cacheTimers[a.key]),delete this._cacheTimers[a.key],this._setTileReloadTimer(a.key,h)));const m=h;return h||(h=new jt(a,this._source.tileSize*a.overscaleFactor()),this._loadTile(h,this._tileLoaded.bind(this,h,a.key,h.state))),h.uses++,this._tiles[a.key]=h,m||this._source.fire(new b.Event("dataloading",{tile:h,coord:h.tileID,dataType:"source"})),h}_setTileReloadTimer(a,h){a in this._timers&&(clearTimeout(this._timers[a]),delete this._timers[a]);const m=h.getExpiryTimeout();m&&(this._timers[a]=setTimeout(()=>{this._reloadTile(a,"expired"),delete this._timers[a]},m))}_removeTile(a){const h=this._tiles[a];h&&(h.uses--,delete this._tiles[a],this._timers[a]&&(clearTimeout(this._timers[a]),delete this._timers[a]),h.uses>0||(h.hasData()&&"reloading"!==h.state?this._cache.add(h.tileID,h,h.getExpiryTimeout()):(h.aborted=!0,this._abortTile(h),this._unloadTile(h))))}clearTiles(){this._shouldReloadOnResume=!1,this._paused=!1;for(const a in this._tiles)this._removeTile(a);this._cache.reset()}tilesIn(a,h,m){const y=[],w=this.transform;if(!w)return y;const S=m?w.getCameraQueryGeometry(a):a,T=a.map(ee=>w.pointCoordinate(ee,this.terrain)),k=S.map(ee=>w.pointCoordinate(ee,this.terrain)),R=this.getIds();let z=1/0,L=1/0,j=-1/0,Q=-1/0;for(const ee of k)z=Math.min(z,ee.x),L=Math.min(L,ee.y),j=Math.max(j,ee.x),Q=Math.max(Q,ee.y);for(let ee=0;ee=0&&ie[1].y+ye>=0){const we=T.map(Se=>ae.getTilePoint(Se)),De=k.map(Se=>ae.getTilePoint(Se));y.push({tile:Y,tileID:ae,queryGeometry:we,cameraQueryGeometry:De,scale:_e})}}return y}getVisibleCoordinates(a){const h=this.getRenderableIds(a).map(m=>this._tiles[m].tileID);for(const m of h)m.posMatrix=this.transform.calculatePosMatrix(m.toUnwrapped());return h}hasTransition(){if(this._source.hasTransition())return!0;if(Ci(this._source.type))for(const a in this._tiles){const h=this._tiles[a];if(void 0!==h.fadeEndTime&&h.fadeEndTime>=b.exported.now())return!0}return!1}setFeatureState(a,h,m){this._state.updateState(a=a||"_geojsonTileLayer",h,m)}removeFeatureState(a,h,m){this._state.removeFeatureState(a=a||"_geojsonTileLayer",h,m)}getFeatureState(a,h){return this._state.getState(a=a||"_geojsonTileLayer",h)}setDependencies(a,h,m){const y=this._tiles[a];y&&y.setDependencies(h,m)}reloadTilesForDependencies(a,h){for(const m in this._tiles)this._tiles[m].hasDependency(a,h)&&this._reloadTile(m,"reloading");this._cache.filter(m=>!m.hasDependency(a,h))}}function zs(g,a){const h=Math.abs(2*g.wrap)-+(g.wrap<0),m=Math.abs(2*a.wrap)-+(a.wrap<0);return g.overscaledZ-a.overscaledZ||m-h||a.canonical.y-g.canonical.y||a.canonical.x-g.canonical.x}function Ci(g){return"raster"===g||"image"===g||"video"===g}At.maxOverzooming=10,At.maxUnderzooming=3;const ia="mapboxgl_preloaded_worker_pool";class oo{constructor(){this.active={}}acquire(a){if(!this.workers)for(this.workers=[];this.workers.length{h.terminate()}),this.workers=null)}isPreloaded(){return!!this.active[ia]}numActive(){return Object.keys(this.active).length}}const Vi=Math.floor(b.exported.hardwareConcurrency/2);let zn;function Fc(){return zn||(zn=new oo),zn}function so(g,a){const h={};for(const m in g)"ref"!==m&&(h[m]=g[m]);return b.refProperties.forEach(m=>{m in a&&(h[m]=a[m])}),h}function Ll(g){g=g.slice();const a=Object.create(null);for(let h=0;h0?(y-S)/T:0;return this.points[w].mult(1-k).add(this.points[h].mult(k))}}function ao(g,a){let h=!0;return"always"===g||"never"!==g&&"never"!==a||(h=!1),h}class Zr{constructor(a,h,m){const y=this.boxCells=[],w=this.circleCells=[];this.xCellCount=Math.ceil(a/m),this.yCellCount=Math.ceil(h/m);for(let S=0;Sthis.width||y<0||h>this.height)return[];const k=[];if(a<=0&&h<=0&&this.width<=m&&this.height<=y){if(w)return[{key:null,x1:a,y1:h,x2:m,y2:y}];for(let R=0;R0}hitTestCircle(a,h,m,y,w){const S=a-m,T=a+m,k=h-m,R=h+m;if(T<0||S>this.width||R<0||k>this.height)return!1;const z=[];return this._forEachCell(S,k,T,R,this._queryCellCircle,z,{hitTest:!0,overlapMode:y,circle:{x:a,y:h,radius:m},seenUids:{box:{},circle:{}}},w),z.length>0}_queryCell(a,h,m,y,w,S,T,k){const{seenUids:R,hitTest:z,overlapMode:L}=T,j=this.boxCells[w];if(null!==j){const ee=this.bboxes;for(const Y of j)if(!R.box[Y]){R.box[Y]=!0;const ae=4*Y,_e=this.boxKeys[Y];if(a<=ee[ae+2]&&h<=ee[ae+3]&&m>=ee[ae+0]&&y>=ee[ae+1]&&(!k||k(_e))&&(!z||!ao(L,_e.overlapMode))&&(S.push({key:_e,x1:ee[ae],y1:ee[ae+1],x2:ee[ae+2],y2:ee[ae+3]}),z))return!0}}const Q=this.circleCells[w];if(null!==Q){const ee=this.circles;for(const Y of Q)if(!R.circle[Y]){R.circle[Y]=!0;const ae=3*Y,_e=this.circleKeys[Y];if(this._circleAndRectCollide(ee[ae],ee[ae+1],ee[ae+2],a,h,m,y)&&(!k||k(_e))&&(!z||!ao(L,_e.overlapMode))){const ye=ee[ae],ie=ee[ae+1],we=ee[ae+2];if(S.push({key:_e,x1:ye-we,y1:ie-we,x2:ye+we,y2:ie+we}),z)return!0}}}return!1}_queryCellCircle(a,h,m,y,w,S,T,k){const{circle:R,seenUids:z,overlapMode:L}=T,j=this.boxCells[w];if(null!==j){const ee=this.bboxes;for(const Y of j)if(!z.box[Y]){z.box[Y]=!0;const ae=4*Y,_e=this.boxKeys[Y];if(this._circleAndRectCollide(R.x,R.y,R.radius,ee[ae+0],ee[ae+1],ee[ae+2],ee[ae+3])&&(!k||k(_e))&&!ao(L,_e.overlapMode))return S.push(!0),!0}}const Q=this.circleCells[w];if(null!==Q){const ee=this.circles;for(const Y of Q)if(!z.circle[Y]){z.circle[Y]=!0;const ae=3*Y,_e=this.circleKeys[Y];if(this._circlesCollide(ee[ae],ee[ae+1],ee[ae+2],R.x,R.y,R.radius)&&(!k||k(_e))&&!ao(L,_e.overlapMode))return S.push(!0),!0}}}_forEachCell(a,h,m,y,w,S,T,k){const R=this._convertToXCellCoord(a),z=this._convertToYCellCoord(h),L=this._convertToXCellCoord(m),j=this._convertToYCellCoord(y);for(let Q=R;Q<=L;Q++)for(let ee=z;ee<=j;ee++)if(w.call(this,a,h,m,y,this.xCellCount*ee+Q,S,T,k))return}_convertToXCellCoord(a){return Math.max(0,Math.min(this.xCellCount-1,Math.floor(a*this.xScale)))}_convertToYCellCoord(a){return Math.max(0,Math.min(this.yCellCount-1,Math.floor(a*this.yScale)))}_circlesCollide(a,h,m,y,w,S){const T=y-a,k=w-h,R=m+S;return R*R>T*T+k*k}_circleAndRectCollide(a,h,m,y,w,S,T){const k=(S-y)/2,R=Math.abs(a-(y+k));if(R>k+m)return!1;const z=(T-w)/2,L=Math.abs(h-(w+z));if(L>z+m)return!1;if(R<=k||L<=z)return!0;const j=R-k,Q=L-z;return j*j+Q*Q<=m*m}}function Vr(g,a,h,m,y){const w=b.create();return a?(b.scale(w,w,[1/y,1/y,1]),h||b.rotateZ(w,w,m.angle)):b.multiply(w,m.labelPlaneMatrix,g),w}function pi(g,a,h,m,y){if(a){const w=b.clone(g);return b.scale(w,w,[y,y,1]),h||b.rotateZ(w,w,-m.angle),w}return m.glCoordMatrix}function mi(g,a,h){let m;h?(m=[g.x,g.y,h(g.x,g.y),1],b.transformMat4(m,m,a)):(m=[g.x,g.y,0,1],xe(m,m,a));const y=m[3];return{point:new b.pointGeometry(m[0]/y,m[1]/y),signedDistanceFromCamera:y}}function Bs(g,a){return.5+g/a*.5}function J(g,a){const h=g[0]/g[3],m=g[1]/g[3];return h>=-a[0]&&h<=a[0]&&m>=-a[1]&&m<=a[1]}function V(g,a,h,m,y,w,S,T,k,R){const z=m?g.textSizeData:g.iconSizeData,L=b.evaluateSizeForZoom(z,h.transform.zoom),j=[256/h.width*2+1,256/h.height*2+1],Q=m?g.text.dynamicLayoutVertexArray:g.icon.dynamicLayoutVertexArray;Q.clear();const ee=g.lineVertexArray,Y=m?g.text.placedSymbolArray:g.icon.placedSymbolArray,ae=h.transform.width/h.transform.height;let _e=!1;for(let ye=0;yeMath.abs(h.x-a.x)*m?{useVertical:!0}:(g===b.WritingMode.vertical?a.yh.x)?{needsFlipping:!0}:null}function te(g,a,h,m,y,w,S,T,k,R,z,L,j,Q,ee,Y){const ae=a/24,_e=g.lineOffsetX*ae,ye=g.lineOffsetY*ae;let ie;if(g.numGlyphs>1){const we=g.glyphStartIndex+g.numGlyphs,De=g.lineStartIndex,Se=g.lineStartIndex+g.lineLength,ke=$(ae,T,_e,ye,h,z,L,g,k,w,j,ee,Y);if(!ke)return{notEnoughRoom:!0};const Be=mi(ke.first.point,S,Y).point,Le=mi(ke.last.point,S,Y).point;if(m&&!h){const Ne=K(g.writingMode,Be,Le,Q);if(Ne)return Ne}ie=[ke.first];for(let Ne=g.glyphStartIndex+1;Ne0?Be.point:ce(L,ke,De,1,y,Y),Ne=K(g.writingMode,De,Le,Q);if(Ne)return Ne}const we=ge(ae*T.getoffsetX(g.glyphStartIndex),_e,ye,h,z,L,g.segment,g.lineStartIndex,g.lineStartIndex+g.lineLength,k,w,j,ee,Y);if(!we)return{notEnoughRoom:!0};ie=[we]}for(const we of ie)b.addDynamicAttributes(R,we.point,we.angle);return{}}function ce(g,a,h,m,y,w){const S=mi(g.add(g.sub(a)._unit()),y,w).point,T=h.sub(S);return h.add(T._mult(m/T.mag()))}function ge(g,a,h,m,y,w,S,T,k,R,z,L,j,Q){const ee=m?g-a:g+a;let Y=ee>0?1:-1,ae=0;m&&(Y*=-1,ae=Math.PI),Y<0&&(ae+=Math.PI);let _e=Y>0?T+S:T+S+1,ye=y,ie=y,we=0,De=0;const Se=Math.abs(ee),ke=[];for(;we+De<=Se;){if(_e+=Y,_e=k)return null;if(ie=ye,ke.push(ye),ye=L[_e],void 0===ye){const ht=new b.pointGeometry(R.getx(_e),R.gety(_e)),Pt=mi(ht,z,Q);if(Pt.signedDistanceFromCamera>0)ye=L[_e]=Pt.point;else{const zt=_e-Y;ye=ce(0===we?w:new b.pointGeometry(R.getx(zt),R.gety(zt)),ht,ie,Se-we+1,z,Q)}}we+=De,De=ie.dist(ye)}const Be=(Se-we)/De,Le=ye.sub(ie),Ne=Le.mult(Be)._add(ie);Ne._add(Le._unit()._perp()._mult(h*Y));const ze=ae+Math.atan2(ye.y-ie.y,ye.x-ie.x);return ke.push(Ne),{point:Ne,angle:j?ze:0,path:ke}}const he=new Float32Array([-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0]);function ue(g,a){for(let h=0;h=1;Ht--)mt.push(Pt.path[Ht]);for(let Ht=1;Htmi(on,k,ee));mt=Ht.some(on=>on.signedDistanceFromCamera<=0)?[]:Ht.map(on=>on.point)}let An=[];if(mt.length>0){const Ht=mt[0].clone(),on=mt[0].clone();for(let Fn=1;Fn=Ne.x&&on.x<=ze.x&&Ht.y>=Ne.y&&on.y<=ze.y?[mt]:on.xze.x||on.yze.y?[]:b.clipLine([mt],Ne.x,Ne.y,ze.x,ze.y)}for(const Ht of An){ht.reset(Ht,.25*Le);let on=0;on=ht.length<=.5*Le?1:Math.ceil(ht.paddedLength/Tn)+1;for(let Fn=0;Fn=this.screenRightBoundary||ythis.screenBottomBoundary}isInsideGrid(a,h,m,y){return m>=0&&a=0&&hm.collisionGroupID===h}}return this.collisionGroups[a]}}function nn(g,a,h,m,y){const{horizontalAlign:w,verticalAlign:S}=b.getAnchorAlignment(g),T=-(w-.5)*a,k=-(S-.5)*h,R=b.evaluateVariableOffset(g,m);return new b.pointGeometry(T+R[0]*y,k+R[1]*y)}function an(g,a,h,m,y,w){const{x1:S,x2:T,y1:k,y2:R,anchorPointX:z,anchorPointY:L}=g,j=new b.pointGeometry(a,h);return m&&j._rotate(y?w:-w),{x1:S+j.x,y1:k+j.y,x2:T+j.x,y2:R+j.y,anchorPointX:z,anchorPointY:L}}class qn{constructor(a,h,m,y,w){this.transform=a.clone(),this.terrain=h,this.collisionIndex=new je(this.transform),this.placements={},this.opacities={},this.variableOffsets={},this.stale=!1,this.commitTime=0,this.fadeDuration=m,this.retainedQueryData={},this.collisionGroups=new Gn(y),this.collisionCircleArrays={},this.prevPlacement=w,w&&(w.prevPlacement=void 0),this.placedOrientations={}}getBucketParts(a,h,m,y){const w=m.getBucket(h),S=m.latestFeatureIndex;if(!w||!S||h.id!==w.layerIds[0])return;const T=m.collisionBoxArray,k=w.layers[0].layout,R=Math.pow(2,this.transform.zoom-m.tileID.overscaledZ),z=m.tileSize/b.EXTENT,L=this.transform.calculatePosMatrix(m.tileID.toUnwrapped()),j="map"===k.get("text-pitch-alignment"),Q="map"===k.get("text-rotation-alignment"),ee=Ie(m,1,this.transform.zoom),Y=Vr(L,j,Q,this.transform,ee);let ae=null;if(j){const ye=pi(L,j,Q,this.transform,ee);ae=b.multiply([],this.transform.labelPlaneMatrix,ye)}this.retainedQueryData[w.bucketInstanceId]=new ln(w.bucketInstanceId,S,w.sourceLayerIndex,w.index,m.tileID);const _e={bucket:w,layout:k,posMatrix:L,textLabelPlaneMatrix:Y,labelToScreenMatrix:ae,scale:R,textPixelRatio:z,holdingForFade:m.holdingForFade(),collisionBoxArray:T,partiallyEvaluatedTextSize:b.evaluateSizeForZoom(w.textSizeData,this.transform.zoom),collisionGroup:this.collisionGroups.get(w.sourceID)};if(y)for(const ye of w.sortKeyRanges){const{sortKey:ie,symbolInstanceStart:we,symbolInstanceEnd:De}=ye;a.push({sortKey:ie,symbolInstanceStart:we,symbolInstanceEnd:De,parameters:_e})}else a.push({symbolInstanceStart:0,symbolInstanceEnd:w.symbolInstances.length,parameters:_e})}attemptAnchorPlacement(a,h,m,y,w,S,T,k,R,z,L,j,Q,ee,Y,ae){const _e=[j.textOffset0,j.textOffset1],ye=nn(a,m,y,_e,w),ie=this.collisionIndex.placeCollisionBox(an(h,ye.x,ye.y,S,T,this.transform.angle),L,k,R,z.predicate,ae);if((!Y||0!==this.collisionIndex.placeCollisionBox(an(Y,ye.x,ye.y,S,T,this.transform.angle),L,k,R,z.predicate,ae).box.length)&&ie.box.length>0){let we;if(this.prevPlacement&&this.prevPlacement.variableOffsets[j.crossTileID]&&this.prevPlacement.placements[j.crossTileID]&&this.prevPlacement.placements[j.crossTileID].text&&(we=this.prevPlacement.variableOffsets[j.crossTileID].anchor),0===j.crossTileID)throw new Error("symbolInstance.crossTileID can't be 0");return this.variableOffsets[j.crossTileID]={textOffset:_e,width:m,height:y,anchor:a,textBoxScale:w,prevAnchor:we},this.markUsedJustification(Q,a,j,ee),Q.allowVerticalPlacement&&(this.markUsedOrientation(Q,ee,j),this.placedOrientations[j.crossTileID]=ee),{shift:ye,placedGlyphBoxes:ie}}}placeLayerBucketPart(a,h,m){const{bucket:y,layout:w,posMatrix:S,textLabelPlaneMatrix:T,labelToScreenMatrix:k,textPixelRatio:R,holdingForFade:z,collisionBoxArray:L,partiallyEvaluatedTextSize:j,collisionGroup:Q}=a.parameters,ee=w.get("text-optional"),Y=w.get("icon-optional"),ae=b.getOverlapMode(w,"text-overlap","text-allow-overlap"),_e="always"===ae,ye=b.getOverlapMode(w,"icon-overlap","icon-allow-overlap"),ie="always"===ye,we="map"===w.get("text-rotation-alignment"),De="map"===w.get("text-pitch-alignment"),Se="none"!==w.get("icon-text-fit"),ke="viewport-y"===w.get("symbol-z-order"),Be=_e&&(ie||!y.hasIconData()||Y),Le=ie&&(_e||!y.hasTextData()||ee);!y.collisionArrays&&L&&y.deserializeCollisionBoxes(L);const Ne=(ze,ht)=>{if(h[ze.crossTileID])return;if(z)return void(this.placements[ze.crossTileID]=new ft(!1,!1,!1));let Pt=!1,zt=!1,mt=!0,Tn=null,An={box:null,offscreen:null},Ht={box:null,offscreen:null},on=null,Fn=null,_n=null,mo=0,Ro=0,vr=0;ht.textFeatureIndex?mo=ht.textFeatureIndex:ze.useRuntimeCollisionCircles&&(mo=ze.featureIndex),ht.verticalTextFeatureIndex&&(Ro=ht.verticalTextFeatureIndex);const li=this.retainedQueryData[y.bucketInstanceId].tileID,Ii=this.terrain?(Rr,ur)=>this.terrain.getElevation(li,Rr,ur):null;for(const Rr of["textBox","verticalTextBox","iconBox","verticalIconBox"]){const ur=ht[Rr];ur&&(ur.elevation=Ii?Ii(ur.anchorPointX,ur.anchorPointY):0)}const Jo=ht.textBox;if(Jo){const Rr=On=>{let Gi=b.WritingMode.horizontal;if(y.allowVerticalPlacement&&!On&&this.prevPlacement){const Yr=this.prevPlacement.placedOrientations[ze.crossTileID];Yr&&(this.placedOrientations[ze.crossTileID]=Yr,Gi=Yr,this.markUsedOrientation(y,Gi,ze))}return Gi},ur=(On,Gi)=>{if(y.allowVerticalPlacement&&ze.numVerticalGlyphVertices>0&&ht.verticalTextBox){for(const Yr of y.writingModes)if(Yr===b.WritingMode.vertical?(An=Gi(),Ht=An):An=On(),An&&An.box&&An.box.length)break}else An=On()};if(w.get("text-variable-anchor")){let On=w.get("text-variable-anchor");if(this.prevPlacement&&this.prevPlacement.variableOffsets[ze.crossTileID]){const tr=this.prevPlacement.variableOffsets[ze.crossTileID];On.indexOf(tr.anchor)>0&&(On=On.filter(Qo=>Qo!==tr.anchor),On.unshift(tr.anchor))}const Gi=(tr,Qo,qi)=>{const sh=tr.x2-tr.x1,ya=tr.y2-tr.y1,Zs=ze.textBoxScale,ah=Se&&"never"===ye?Qo:null;let xs={box:[],offscreen:!1};const Cd="never"!==ae?2*On.length:On.length;for(let Mr=0;Mr=On.length?ae:"never",ze,y,qi,ah,Ii);if(tl&&(xs=tl.placedGlyphBoxes,xs&&xs.box&&xs.box.length)){Pt=!0,Tn=tl.shift;break}}return xs};ur(()=>Gi(Jo,ht.iconBox,b.WritingMode.horizontal),()=>{const tr=ht.verticalTextBox;return y.allowVerticalPlacement&&!(An&&An.box&&An.box.length)&&ze.numVerticalGlyphVertices>0&&tr?Gi(tr,ht.verticalIconBox,b.WritingMode.vertical):{box:null,offscreen:null}}),An&&(Pt=An.box,mt=An.offscreen);const Yr=Rr(An&&An.box);if(!Pt&&this.prevPlacement){const tr=this.prevPlacement.variableOffsets[ze.crossTileID];tr&&(this.variableOffsets[ze.crossTileID]=tr,this.markUsedJustification(y,tr.anchor,ze,Yr))}}else{const On=(Gi,Yr)=>{const tr=this.collisionIndex.placeCollisionBox(Gi,ae,R,S,Q.predicate,Ii);return tr&&tr.box&&tr.box.length&&(this.markUsedOrientation(y,Yr,ze),this.placedOrientations[ze.crossTileID]=Yr),tr};ur(()=>On(Jo,b.WritingMode.horizontal),()=>{const Gi=ht.verticalTextBox;return y.allowVerticalPlacement&&ze.numVerticalGlyphVertices>0&&Gi?On(Gi,b.WritingMode.vertical):{box:null,offscreen:null}}),Rr(An&&An.box&&An.box.length)}}if(on=An,Pt=on&&on.box&&on.box.length>0,mt=on&&on.offscreen,ze.useRuntimeCollisionCircles){const Rr=y.text.placedSymbolArray.get(ze.centerJustifiedTextSymbolIndex),ur=b.evaluateSizeForFeature(y.textSizeData,j,Rr),On=w.get("text-padding");Fn=this.collisionIndex.placeCollisionCircles(ae,Rr,y.lineVertexArray,y.glyphOffsetArray,ur,S,T,k,m,De,Q.predicate,ze.collisionCircleDiameter,On,Ii),Fn.circles.length&&Fn.collisionDetected&&!m&&b.warnOnce("Collisions detected, but collision boxes are not shown"),Pt=_e||Fn.circles.length>0&&!Fn.collisionDetected,mt=mt&&Fn.offscreen}if(ht.iconFeatureIndex&&(vr=ht.iconFeatureIndex),ht.iconBox){const Rr=ur=>{const On=Se&&Tn?an(ur,Tn.x,Tn.y,we,De,this.transform.angle):ur;return this.collisionIndex.placeCollisionBox(On,ye,R,S,Q.predicate,Ii)};Ht&&Ht.box&&Ht.box.length&&ht.verticalIconBox?(_n=Rr(ht.verticalIconBox),zt=_n.box.length>0):(_n=Rr(ht.iconBox),zt=_n.box.length>0),mt=mt&&_n.offscreen}const Fo=ee||0===ze.numHorizontalGlyphVertices&&0===ze.numVerticalGlyphVertices,Yl=Y||0===ze.numIconVertices;if(Fo||Yl?Yl?Fo||(zt=zt&&Pt):Pt=zt&&Pt:zt=Pt=zt&&Pt,Pt&&on&&on.box&&this.collisionIndex.insertCollisionBox(on.box,ae,w.get("text-ignore-placement"),y.bucketInstanceId,Ht&&Ht.box&&Ro?Ro:mo,Q.ID),zt&&_n&&this.collisionIndex.insertCollisionBox(_n.box,ye,w.get("icon-ignore-placement"),y.bucketInstanceId,vr,Q.ID),Fn&&(Pt&&this.collisionIndex.insertCollisionCircles(Fn.circles,ae,w.get("text-ignore-placement"),y.bucketInstanceId,mo,Q.ID),m)){const Rr=y.bucketInstanceId;let ur=this.collisionCircleArrays[Rr];void 0===ur&&(ur=this.collisionCircleArrays[Rr]=new xt);for(let On=0;On=0;--ht){const Pt=ze[ht];Ne(y.symbolInstances.get(Pt),y.collisionArrays[Pt])}}else for(let ze=a.symbolInstanceStart;ze=0&&(a.text.placedSymbolArray.get(T).crossTileID=w>=0&&T!==w?0:m.crossTileID)}markUsedOrientation(a,h,m){const y=h===b.WritingMode.horizontal||h===b.WritingMode.horizontalOnly?h:0,w=h===b.WritingMode.vertical?h:0,S=[m.leftJustifiedTextSymbolIndex,m.centerJustifiedTextSymbolIndex,m.rightJustifiedTextSymbolIndex];for(const T of S)a.text.placedSymbolArray.get(T).placedOrientation=y;m.verticalPlacedTextSymbolIndex&&(a.text.placedSymbolArray.get(m.verticalPlacedTextSymbolIndex).placedOrientation=w)}commit(a){this.commitTime=a,this.zoomAtLastRecencyCheck=this.transform.zoom;const h=this.prevPlacement;let m=!1;this.prevZoomAdjustment=h?h.zoomAdjustment(this.transform.zoom):0;const y=h?h.symbolFadeChange(a):1,w=h?h.opacities:{},S=h?h.variableOffsets:{},T=h?h.placedOrientations:{};for(const k in this.placements){const R=this.placements[k],z=w[k];z?(this.opacities[k]=new dt(z,y,R.text,R.icon),m=m||R.text!==z.text.placed||R.icon!==z.icon.placed):(this.opacities[k]=new dt(null,y,R.text,R.icon,R.skipFade),m=m||R.text||R.icon)}for(const k in w){const R=w[k];if(!this.opacities[k]){const z=new dt(R,y,!1,!1);z.isHidden()||(this.opacities[k]=z,m=m||R.text.placed||R.icon.placed)}}for(const k in S)this.variableOffsets[k]||!this.opacities[k]||this.opacities[k].isHidden()||(this.variableOffsets[k]=S[k]);for(const k in T)this.placedOrientations[k]||!this.opacities[k]||this.opacities[k].isHidden()||(this.placedOrientations[k]=T[k]);if(h&&void 0===h.lastPlacementChangeTime)throw new Error("Last placement time for previous placement is not defined");m?this.lastPlacementChangeTime=a:"number"!=typeof this.lastPlacementChangeTime&&(this.lastPlacementChangeTime=h?h.lastPlacementChangeTime:a)}updateLayerOpacities(a,h){const m={};for(const y of h){const w=y.getBucket(a);w&&y.latestFeatureIndex&&a.id===w.layerIds[0]&&this.updateBucketOpacities(w,m,y.collisionBoxArray)}}updateBucketOpacities(a,h,m){a.hasTextData()&&(a.text.opacityVertexArray.clear(),a.text.hasVisibleVertices=!1),a.hasIconData()&&(a.icon.opacityVertexArray.clear(),a.icon.hasVisibleVertices=!1),a.hasIconCollisionBoxData()&&a.iconCollisionBox.collisionVertexArray.clear(),a.hasTextCollisionBoxData()&&a.textCollisionBox.collisionVertexArray.clear();const y=a.layers[0].layout,w=new dt(null,0,!1,!1,!0),S=y.get("text-allow-overlap"),T=y.get("icon-allow-overlap"),k=y.get("text-variable-anchor"),R="map"===y.get("text-rotation-alignment"),z="map"===y.get("text-pitch-alignment"),L="none"!==y.get("icon-text-fit"),j=new dt(null,0,S&&(T||!a.hasIconData()||y.get("icon-optional")),T&&(S||!a.hasTextData()||y.get("text-optional")),!0);!a.collisionArrays&&m&&(a.hasIconCollisionBoxData()||a.hasTextCollisionBoxData())&&a.deserializeCollisionBoxes(m);const Q=(ee,Y,ae)=>{for(let _e=0;_e0,De=this.placedOrientations[Y.crossTileID],Se=De===b.WritingMode.vertical,ke=De===b.WritingMode.horizontal||De===b.WritingMode.horizontalOnly;if(ae>0||_e>0){const Be=ja(ie.text);Q(a.text,ae,Se?aa:Be),Q(a.text,_e,ke?aa:Be);const Le=ie.text.isHidden();[Y.rightJustifiedTextSymbolIndex,Y.centerJustifiedTextSymbolIndex,Y.leftJustifiedTextSymbolIndex].forEach(ht=>{ht>=0&&(a.text.placedSymbolArray.get(ht).hidden=Le||Se?1:0)}),Y.verticalPlacedTextSymbolIndex>=0&&(a.text.placedSymbolArray.get(Y.verticalPlacedTextSymbolIndex).hidden=Le||ke?1:0);const Ne=this.variableOffsets[Y.crossTileID];Ne&&this.markUsedJustification(a,Ne.anchor,Y,De);const ze=this.placedOrientations[Y.crossTileID];ze&&(this.markUsedJustification(a,"left",Y,ze),this.markUsedOrientation(a,ze,Y))}if(we){const Be=ja(ie.icon),Le=!(L&&Y.verticalPlacedIconSymbolIndex&&Se);Y.placedIconSymbolIndex>=0&&(Q(a.icon,Y.numIconVertices,Le?Be:aa),a.icon.placedSymbolArray.get(Y.placedIconSymbolIndex).hidden=ie.icon.isHidden()),Y.verticalPlacedIconSymbolIndex>=0&&(Q(a.icon,Y.numVerticalIconVertices,Le?aa:Be),a.icon.placedSymbolArray.get(Y.verticalPlacedIconSymbolIndex).hidden=ie.icon.isHidden())}if(a.hasIconCollisionBoxData()||a.hasTextCollisionBoxData()){const Be=a.collisionArrays[ee];if(Be){let Le=new b.pointGeometry(0,0);if(Be.textBox||Be.verticalTextBox){let ze=!0;if(k){const ht=this.variableOffsets[ye];ht?(Le=nn(ht.anchor,ht.width,ht.height,ht.textOffset,ht.textBoxScale),R&&Le._rotate(z?this.transform.angle:-this.transform.angle)):ze=!1}Be.textBox&&sr(a.textCollisionBox.collisionVertexArray,ie.text.placed,!ze||Se,Le.x,Le.y),Be.verticalTextBox&&sr(a.textCollisionBox.collisionVertexArray,ie.text.placed,!ze||ke,Le.x,Le.y)}const Ne=Boolean(!ke&&Be.verticalIconBox);Be.iconBox&&sr(a.iconCollisionBox.collisionVertexArray,ie.icon.placed,Ne,L?Le.x:0,L?Le.y:0),Be.verticalIconBox&&sr(a.iconCollisionBox.collisionVertexArray,ie.icon.placed,!Ne,L?Le.x:0,L?Le.y:0)}}}if(a.sortFeatures(this.transform.angle),this.retainedQueryData[a.bucketInstanceId]&&(this.retainedQueryData[a.bucketInstanceId].featureSortOrder=a.featureSortOrder),a.hasTextData()&&a.text.opacityVertexBuffer&&a.text.opacityVertexBuffer.updateData(a.text.opacityVertexArray),a.hasIconData()&&a.icon.opacityVertexBuffer&&a.icon.opacityVertexBuffer.updateData(a.icon.opacityVertexArray),a.hasIconCollisionBoxData()&&a.iconCollisionBox.collisionVertexBuffer&&a.iconCollisionBox.collisionVertexBuffer.updateData(a.iconCollisionBox.collisionVertexArray),a.hasTextCollisionBoxData()&&a.textCollisionBox.collisionVertexBuffer&&a.textCollisionBox.collisionVertexBuffer.updateData(a.textCollisionBox.collisionVertexArray),a.text.opacityVertexArray.length!==a.text.layoutVertexArray.length/4)throw new Error(`bucket.text.opacityVertexArray.length (= ${a.text.opacityVertexArray.length}) !== bucket.text.layoutVertexArray.length (= ${a.text.layoutVertexArray.length}) / 4`);if(a.icon.opacityVertexArray.length!==a.icon.layoutVertexArray.length/4)throw new Error(`bucket.icon.opacityVertexArray.length (= ${a.icon.opacityVertexArray.length}) !== bucket.icon.layoutVertexArray.length (= ${a.icon.layoutVertexArray.length}) / 4`);if(a.bucketInstanceId in this.collisionCircleArrays){const ee=this.collisionCircleArrays[a.bucketInstanceId];a.placementInvProjMatrix=ee.invProjMatrix,a.placementViewportMatrix=ee.viewportMatrix,a.collisionCircleArray=ee.circles,delete this.collisionCircleArrays[a.bucketInstanceId]}}symbolFadeChange(a){return 0===this.fadeDuration?1:(a-this.commitTime)/this.fadeDuration+this.prevZoomAdjustment}zoomAdjustment(a){return Math.max(0,(this.transform.zoom-a)/1.5)}hasTransitions(a){return this.stale||a-this.lastPlacementChangeTimea}setStale(){this.stale=!0}}function sr(g,a,h,m,y){g.emplaceBack(a?1:0,h?1:0,m||0,y||0),g.emplaceBack(a?1:0,h?1:0,m||0,y||0),g.emplaceBack(a?1:0,h?1:0,m||0,y||0),g.emplaceBack(a?1:0,h?1:0,m||0,y||0)}const si=Math.pow(2,25),kr=Math.pow(2,24),Ua=Math.pow(2,17),kf=Math.pow(2,16),Pf=Math.pow(2,9),$a=Math.pow(2,8),Fu=Math.pow(2,1);function ja(g){if(0===g.opacity&&!g.placed)return 0;if(1===g.opacity&&g.placed)return 4294967295;const a=g.placed?1:0,h=Math.floor(127*g.opacity);return h*si+a*kr+h*Ua+a*kf+h*Pf+a*$a+h*Fu+a}const aa=0;class Ou{constructor(a){this._sortAcrossTiles="viewport-y"!==a.layout.get("symbol-z-order")&&!a.layout.get("symbol-sort-key").isConstant(),this._currentTileIndex=0,this._currentPartIndex=0,this._seenCrossTileIDs={},this._bucketParts=[]}continuePlacement(a,h,m,y,w){const S=this._bucketParts;for(;this._currentTileIndexT.sortKey-k.sortKey));this._currentPartIndex{const S=b.exported.now()-y;return!this._forceFullPlacement&&S>2};for(;this._currentPlacementIndex>=0;){const S=h[a[this._currentPlacementIndex]],T=this.placement.collisionIndex.transform.zoom;if("symbol"===S.type&&(!S.minzoom||S.minzoom<=T)&&(!S.maxzoom||S.maxzoom>T)){if(this._inProgressLayer||(this._inProgressLayer=new Ou(S)),this._inProgressLayer.continuePlacement(m[S.source],this.placement,this._showCollisionBoxes,S,w))return;delete this._inProgressLayer}this._currentPlacementIndex--}this._done=!0}commit(a){return this.placement.commit(a),this.placement}}const zl=512/b.EXTENT/2;class Wh{constructor(a,h,m){this.tileID=a,this.bucketInstanceId=m,this._symbolsByKey={};const y=new Map;for(let w=0;w({x:Math.floor(k.anchorX*zl),y:Math.floor(k.anchorY*zl)})),crossTileIDs:S.map(k=>k.crossTileID)};if(T.positions.length>128){const k=new b.KDBush(T.positions,R=>R.x,R=>R.y,16,Uint16Array);delete k.points,delete T.positions,T.index=k}this._symbolsByKey[w]=T}}getScaledCoordinates(a,h){const{x:m,y,z:w}=this.tileID.canonical,{x:S,y:T,z:k}=h.canonical,R=zl/Math.pow(2,k-w),z=(T*b.EXTENT+a.anchorY)*R,L=y*b.EXTENT*zl;return{x:Math.floor((S*b.EXTENT+a.anchorX)*R-m*b.EXTENT*zl),y:Math.floor(z-L)}}findMatches(a,h,m){const y=this.tileID.canonical.za)}}class Bl{constructor(){this.maxCrossTileID=0}generate(){return++this.maxCrossTileID}}class Bn{constructor(){this.indexes={},this.usedCrossTileIDs={},this.lng=0}handleWrapJump(a){const h=Math.round((a-this.lng)/360);if(0!==h)for(const m in this.indexes){const y=this.indexes[m],w={};for(const S in y){const T=y[S];T.tileID=T.tileID.unwrapTo(T.tileID.wrap+h),w[T.tileID.key]=T}this.indexes[m]=w}this.lng=a}addBucket(a,h,m){if(this.indexes[a.overscaledZ]&&this.indexes[a.overscaledZ][a.key]){if(this.indexes[a.overscaledZ][a.key].bucketInstanceId===h.bucketInstanceId)return!1;this.removeBucketCrossTileIDs(a.overscaledZ,this.indexes[a.overscaledZ][a.key])}for(let w=0;wa.overscaledZ)for(const T in S){const k=S[T];k.tileID.isChildOf(a)&&k.findMatches(h.symbolInstances,a,y)}else{const T=S[a.scaledTo(Number(w)).key];T&&T.findMatches(h.symbolInstances,a,y)}}for(let w=0;w{h[m]=!0});for(const m in this.layerIndexes)h[m]||delete this.layerIndexes[m]}}const Mn=(g,a)=>b.emitValidationErrors(g,a&&a.filter(h=>"source.canvas"!==h.identifier)),Lu=b.pick(mn,["addLayer","removeLayer","setPaintProperty","setLayoutProperty","setFilter","addSource","removeSource","setLayerZoomRange","setLight","setTransition","setGeoJSONSourceData","setGlyphs","setSprite"]),Rf=b.pick(mn,["setCenter","setZoom","setBearing","setPitch"]),Yn=function(){const g={},a=b.spec.$version;for(const h in b.spec.$root){const m=b.spec.$root[h];if(m.required){let y=null;y="version"===h?a:"array"===m.type?[]:{},null!=y&&(g[h]=y)}}return g}();class Mt extends b.Evented{constructor(a,h={}){super(),this.map=a,this.dispatcher=new oi(Fc(),this,a._getMapId()),this.imageManager=new Tt,this.imageManager.setEventedParent(this),this.glyphManager=new Nn(a._requestManager,h.localIdeographFontFamily),this.lineAtlas=new Rc(256,512),this.crossTileSymbolIndex=new Xn,this._spritesImagesIds={},this._layers={},this._serializedLayers={},this._order=[],this.sourceCaches={},this.zoomHistory=new b.ZoomHistory,this._loaded=!1,this._availableImages=[],this._resetUpdates(),this.dispatcher.broadcast("setReferrer",b.getReferrer());const m=this;this._rtlTextPluginCallback=Mt.registerForPluginStateChange(y=>{m.dispatcher.broadcast("syncRTLPluginState",{pluginStatus:y.pluginStatus,pluginURL:y.pluginURL},(w,S)=>{if(b.triggerPluginCompletionEvent(w),S&&S.every(T=>T))for(const T in m.sourceCaches)m.sourceCaches[T].reload()})}),this.on("data",y=>{if("source"!==y.dataType||"metadata"!==y.sourceDataType)return;const w=this.sourceCaches[y.sourceId];if(!w)return;const S=w.getSource();if(S&&S.vectorLayerIds)for(const T in this._layers){const k=this._layers[T];k.source===S.id&&this._validateLayer(k)}})}loadURL(a,h={},m){this.fire(new b.Event("dataloading",{dataType:"style"})),h.validate="boolean"!=typeof h.validate||h.validate;const y=this.map._requestManager.transformRequest(a,pn.Style);this._request=b.getJSON(y,(w,S)=>{this._request=null,w?this.fire(new b.ErrorEvent(w)):S&&this._load(S,h,m)})}loadJSON(a,h={},m){this.fire(new b.Event("dataloading",{dataType:"style"})),this._request=b.exported.frame(()=>{this._request=null,h.validate=!1!==h.validate,this._load(a,h,m)})}loadEmpty(){this.fire(new b.Event("dataloading",{dataType:"style"})),this._load(Yn,{validate:!1})}_load(a,h,m){const y=h.transformStyle?h.transformStyle(m,a):a;if(h.validate&&Mn(this,b.validateStyle(y)))return;this._loaded=!0,this.stylesheet=y;for(const S in y.sources)this.addSource(S,y.sources[S],{validate:!1});y.sprite?this._loadSprite(y.sprite):this.imageManager.setLoaded(!0),this.glyphManager.setURL(y.glyphs);const w=Ll(this.stylesheet.layers);this._order=w.map(S=>S.id),this._layers={},this._serializedLayers={};for(let S of w)S=b.createStyleLayer(S),S.setEventedParent(this,{layer:{id:S.id}}),this._layers[S.id]=S,this._serializedLayers[S.id]=S.serialize();this.dispatcher.broadcast("setLayers",this._serializeLayers(this._order)),this.light=new La(this.stylesheet.light),this.map.setTerrain(this.stylesheet.terrain),this.fire(new b.Event("data",{dataType:"style"})),this.fire(new b.Event("style.load"))}_loadSprite(a,h=!1,m){this.imageManager.setLoaded(!1),this._spriteRequest=function(y,w,S,T){const k=hs(y),R=S>1?"@2x":"";let z;const L=[],j=[],Q={},ee={};for(const{id:ae,url:_e}of k){const ye=L.push(b.getJSON(w.transformRequest(w.normalizeSpriteURL(_e,R,".json"),pn.SpriteJSON),(we,De)=>{L.splice(ye,1),z||(z=we,Q[ae]=De,Y())})),ie=j.push(ii.getImage(w.transformRequest(w.normalizeSpriteURL(_e,R,".png"),pn.SpriteImage),(we,De)=>{j.splice(ie,1),z||(z=we,ee[ae]=De,Y())}))}function Y(){const ae=Object.values(Q).length,_e=Object.values(ee).length;if(z)T(z);else if(k.length===ae&&ae===_e){const ye={};for(const ie in Q){ye[ie]={};const we=b.exported.getImageCanvasContext(ee[ie]),De=Q[ie];for(const Se in De){const{width:ke,height:Be,x:Le,y:Ne,sdf:ze,pixelRatio:ht,stretchX:Pt,stretchY:zt,content:mt}=De[Se];ye[ie][Se]={data:null,pixelRatio:ht,sdf:ze,stretchX:Pt,stretchY:zt,content:mt,spriteData:{width:ke,height:Be,x:Le,y:Ne,context:we}}}}T(null,ye)}}return{cancel(){if(L.length)for(const ae of L)ae.cancel(),L.splice(L.indexOf(ae),1);if(j.length)for(const ae of j)ae.cancel(),j.splice(j.indexOf(ae),1)}}}(a,this.map._requestManager,this.map.getPixelRatio(),(y,w)=>{if(this._spriteRequest=null,y)this.fire(new b.ErrorEvent(y));else if(w)for(const S in w){this._spritesImagesIds[S]=[];const T=this._spritesImagesIds[S]?this._spritesImagesIds[S].filter(k=>!(k in w)):[];for(const k of T)this.imageManager.removeImage(k),this._changedImages[k]=!0;for(const k in w[S]){const R="default"===S?k:`${S}:${k}`;this._spritesImagesIds[S].push(R),R in this.imageManager.images?this.imageManager.updateImage(R,w[S][k],!1):this.imageManager.addImage(R,w[S][k]),h&&(this._changedImages[R]=!0)}}this.imageManager.setLoaded(!0),this._availableImages=this.imageManager.listImages(),h&&(this._changed=!0),this.dispatcher.broadcast("setImages",this._availableImages),this.fire(new b.Event("data",{dataType:"style"})),m&&m(y)})}_unloadSprite(){for(const a of Object.values(this._spritesImagesIds).flat())this.imageManager.removeImage(a),this._changedImages[a]=!0;this._spritesImagesIds={},this._availableImages=this.imageManager.listImages(),this._changed=!0,this.dispatcher.broadcast("setImages",this._availableImages),this.fire(new b.Event("data",{dataType:"style"}))}_validateLayer(a){const h=this.sourceCaches[a.source];if(!h)return;const m=a.sourceLayer;if(!m)return;const y=h.getSource();("geojson"===y.type||y.vectorLayerIds&&-1===y.vectorLayerIds.indexOf(m))&&this.fire(new b.ErrorEvent(new Error(`Source layer "${m}" does not exist on source "${y.id}" as specified by style layer "${a.id}".`)))}loaded(){if(!this._loaded||Object.keys(this._updatedSources).length)return!1;for(const a in this.sourceCaches)if(!this.sourceCaches[a].loaded())return!1;return!!this.imageManager.isLoaded()}_serializeLayers(a){const h=[];for(const m of a){const y=this._layers[m];"custom"!==y.type&&h.push(y.serialize())}return h}hasTransitions(){if(this.light&&this.light.hasTransition())return!0;for(const a in this.sourceCaches)if(this.sourceCaches[a].hasTransition())return!0;for(const a in this._layers)if(this._layers[a].hasTransition())return!0;return!1}_checkLoaded(){if(!this._loaded)throw new Error("Style is not done loading.")}update(a){if(!this._loaded)return;const h=this._changed;if(this._changed){const y=Object.keys(this._updatedLayers),w=Object.keys(this._removedLayers);(y.length||w.length)&&this._updateWorkerLayers(y,w);for(const S in this._updatedSources){const T=this._updatedSources[S];if("reload"===T)this._reloadSource(S);else{if("clear"!==T)throw new Error(`Invalid action ${T}`);this._clearSource(S)}}this._updateTilesForChangedImages(),this._updateTilesForChangedGlyphs();for(const S in this._updatedPaintProps)this._layers[S].updateTransitions(a);this.light.updateTransitions(a),this._resetUpdates()}const m={};for(const y in this.sourceCaches){const w=this.sourceCaches[y];m[y]=w.used,w.used=!1}for(const y of this._order){const w=this._layers[y];w.recalculate(a,this._availableImages),!w.isHidden(a.zoom)&&w.source&&(this.sourceCaches[w.source].used=!0)}for(const y in m){const w=this.sourceCaches[y];m[y]!==w.used&&w.fire(new b.Event("data",{sourceDataType:"visibility",dataType:"source",sourceId:y}))}this.light.recalculate(a),this.z=a.zoom,h&&this.fire(new b.Event("data",{dataType:"style"}))}_updateTilesForChangedImages(){const a=Object.keys(this._changedImages);if(a.length){for(const h in this.sourceCaches)this.sourceCaches[h].reloadTilesForDependencies(["icons","patterns"],a);this._changedImages={}}}_updateTilesForChangedGlyphs(){if(this._glyphsDidChange){for(const a in this.sourceCaches)this.sourceCaches[a].reloadTilesForDependencies(["glyphs"],[""]);this._glyphsDidChange=!1}}_updateWorkerLayers(a,h){this.dispatcher.broadcast("updateLayers",{layers:this._serializeLayers(a),removedIds:h})}_resetUpdates(){this._changed=!1,this._updatedLayers={},this._removedLayers={},this._updatedSources={},this._updatedPaintProps={},this._changedImages={},this._glyphsDidChange=!1}setState(a,h={}){if(this._checkLoaded(),a=h.transformStyle?h.transformStyle(this.serialize(),a):a,Mn(this,b.validateStyle(a)))return!1;(a=b.clone$1(a)).layers=Ll(a.layers);const m=function(w,S){if(!w)return[{command:mn.setStyle,args:[S]}];let T=[];try{if(!Zt(w.version,S.version))return[{command:mn.setStyle,args:[S]}];Zt(w.center,S.center)||T.push({command:mn.setCenter,args:[S.center]}),Zt(w.zoom,S.zoom)||T.push({command:mn.setZoom,args:[S.zoom]}),Zt(w.bearing,S.bearing)||T.push({command:mn.setBearing,args:[S.bearing]}),Zt(w.pitch,S.pitch)||T.push({command:mn.setPitch,args:[S.pitch]}),Zt(w.sprite,S.sprite)||T.push({command:mn.setSprite,args:[S.sprite]}),Zt(w.glyphs,S.glyphs)||T.push({command:mn.setGlyphs,args:[S.glyphs]}),Zt(w.transition,S.transition)||T.push({command:mn.setTransition,args:[S.transition]}),Zt(w.light,S.light)||T.push({command:mn.setLight,args:[S.light]});const k={},R=[];!function(L,j,Q,ee){let Y;for(Y in j=j||{},L=L||{})Object.prototype.hasOwnProperty.call(L,Y)&&(Object.prototype.hasOwnProperty.call(j,Y)||Oc(Y,Q,ee));for(Y in j)Object.prototype.hasOwnProperty.call(j,Y)&&(Object.prototype.hasOwnProperty.call(L,Y)?Zt(L[Y],j[Y])||("geojson"===L[Y].type&&"geojson"===j[Y].type&&Ru(L,j,Y)?Q.push({command:mn.setGeoJSONSourceData,args:[Y,j[Y].data]}):Ba(Y,j,Q,ee)):oa(Y,j,Q))}(w.sources,S.sources,R,k);const z=[];w.layers&&w.layers.forEach(L=>{k[L.source]?T.push({command:mn.removeLayer,args:[L.id]}):z.push(L)}),T=T.concat(R),function(L,j,Q){j=j||[];const ee=(L=L||[]).map(Va),Y=j.map(Va),ae=L.reduce(Sn,{}),_e=j.reduce(Sn,{}),ye=ee.slice(),ie=Object.create(null);let we,De,Se,ke,Be,Le,Ne;for(we=0,De=0;we!(w.command in Rf));if(0===m.length)return!1;const y=m.filter(w=>!(w.command in Lu));if(y.length>0)throw new Error(`Unimplemented: ${y.map(w=>w.command).join(", ")}.`);return m.forEach(w=>{"setTransition"!==w.command&&this[w.command].apply(this,w.args)}),this.stylesheet=a,!0}addImage(a,h){if(this.getImage(a))return this.fire(new b.ErrorEvent(new Error(`An image named "${a}" already exists.`)));this.imageManager.addImage(a,h),this._afterImageUpdated(a)}updateImage(a,h){this.imageManager.updateImage(a,h)}getImage(a){return this.imageManager.getImage(a)}removeImage(a){if(!this.getImage(a))return this.fire(new b.ErrorEvent(new Error(`An image named "${a}" does not exist.`)));this.imageManager.removeImage(a),this._afterImageUpdated(a)}_afterImageUpdated(a){this._availableImages=this.imageManager.listImages(),this._changedImages[a]=!0,this._changed=!0,this.dispatcher.broadcast("setImages",this._availableImages),this.fire(new b.Event("data",{dataType:"style"}))}listImages(){return this._checkLoaded(),this.imageManager.listImages()}addSource(a,h,m={}){if(this._checkLoaded(),void 0!==this.sourceCaches[a])throw new Error(`Source "${a}" already exists.`);if(!h.type)throw new Error(`The type property must be defined, but only the following properties were given: ${Object.keys(h).join(", ")}.`);if(["vector","raster","geojson","video","image"].indexOf(h.type)>=0&&this._validate(b.validateStyle.source,`sources.${a}`,h,null,m))return;this.map&&this.map._collectResourceTiming&&(h.collectResourceTiming=!0);const y=this.sourceCaches[a]=new At(a,h,this.dispatcher);y.style=this,y.setEventedParent(this,()=>({isSourceLoaded:this.loaded(),source:y.serialize(),sourceId:a})),y.onAdd(this.map),this._changed=!0}removeSource(a){if(this._checkLoaded(),void 0===this.sourceCaches[a])throw new Error("There is no source with this ID");for(const m in this._layers)if(this._layers[m].source===a)return this.fire(new b.ErrorEvent(new Error(`Source "${a}" cannot be removed while layer "${m}" is using it.`)));const h=this.sourceCaches[a];delete this.sourceCaches[a],delete this._updatedSources[a],h.fire(new b.Event("data",{sourceDataType:"metadata",dataType:"source",sourceId:a})),h.setEventedParent(null),h.onRemove(this.map),this._changed=!0}setGeoJSONSourceData(a,h){if(this._checkLoaded(),void 0===this.sourceCaches[a])throw new Error(`There is no source with this ID=${a}`);const m=this.sourceCaches[a].getSource();if("geojson"!==m.type)throw new Error(`geojsonSource.type is ${m.type}, which is !== 'geojson`);m.setData(h),this._changed=!0}getSource(a){return this.sourceCaches[a]&&this.sourceCaches[a].getSource()}addLayer(a,h,m={}){this._checkLoaded();const y=a.id;if(this.getLayer(y))return void this.fire(new b.ErrorEvent(new Error(`Layer "${y}" already exists on this map.`)));let w;if("custom"===a.type){if(Mn(this,b.validateCustomStyleLayer(a)))return;w=b.createStyleLayer(a)}else{if("object"==typeof a.source&&(this.addSource(y,a.source),a=b.clone$1(a),a=b.extend(a,{source:y})),this._validate(b.validateStyle.layer,`layers.${y}`,a,{arrayIndex:-1},m))return;w=b.createStyleLayer(a),this._validateLayer(w),w.setEventedParent(this,{layer:{id:y}}),this._serializedLayers[w.id]=w.serialize()}const S=h?this._order.indexOf(h):this._order.length;if(h&&-1===S)this.fire(new b.ErrorEvent(new Error(`Cannot add layer "${y}" before non-existing layer "${h}".`)));else{if(this._order.splice(S,0,y),this._layerOrderChanged=!0,this._layers[y]=w,this._removedLayers[y]&&w.source&&"custom"!==w.type){const T=this._removedLayers[y];delete this._removedLayers[y],T.type!==w.type?this._updatedSources[w.source]="clear":(this._updatedSources[w.source]="reload",this.sourceCaches[w.source].pause())}this._updateLayer(w),w.onAdd&&w.onAdd(this.map)}}moveLayer(a,h){if(this._checkLoaded(),this._changed=!0,!this._layers[a])return void this.fire(new b.ErrorEvent(new Error(`The layer '${a}' does not exist in the map's style and cannot be moved.`)));if(a===h)return;const m=this._order.indexOf(a);this._order.splice(m,1);const y=h?this._order.indexOf(h):this._order.length;h&&-1===y?this.fire(new b.ErrorEvent(new Error(`Cannot move layer "${a}" before non-existing layer "${h}".`))):(this._order.splice(y,0,a),this._layerOrderChanged=!0)}removeLayer(a){this._checkLoaded();const h=this._layers[a];if(!h)return void this.fire(new b.ErrorEvent(new Error(`Cannot remove non-existing layer "${a}".`)));h.setEventedParent(null);const m=this._order.indexOf(a);this._order.splice(m,1),this._layerOrderChanged=!0,this._changed=!0,this._removedLayers[a]=h,delete this._layers[a],delete this._serializedLayers[a],delete this._updatedLayers[a],delete this._updatedPaintProps[a],h.onRemove&&h.onRemove(this.map)}getLayer(a){return this._layers[a]}hasLayer(a){return a in this._layers}setLayerZoomRange(a,h,m){this._checkLoaded();const y=this.getLayer(a);y?y.minzoom===h&&y.maxzoom===m||(null!=h&&(y.minzoom=h),null!=m&&(y.maxzoom=m),this._updateLayer(y)):this.fire(new b.ErrorEvent(new Error(`Cannot set the zoom range of non-existing layer "${a}".`)))}setFilter(a,h,m={}){this._checkLoaded();const y=this.getLayer(a);if(y){if(!Zt(y.filter,h))return null==h?(y.filter=void 0,void this._updateLayer(y)):void(this._validate(b.validateStyle.filter,`layers.${y.id}.filter`,h,null,m)||(y.filter=b.clone$1(h),this._updateLayer(y)))}else this.fire(new b.ErrorEvent(new Error(`Cannot filter non-existing layer "${a}".`)))}getFilter(a){return b.clone$1(this.getLayer(a).filter)}setLayoutProperty(a,h,m,y={}){this._checkLoaded();const w=this.getLayer(a);w?Zt(w.getLayoutProperty(h),m)||(w.setLayoutProperty(h,m,y),this._updateLayer(w)):this.fire(new b.ErrorEvent(new Error(`Cannot style non-existing layer "${a}".`)))}getLayoutProperty(a,h){const m=this.getLayer(a);if(m)return m.getLayoutProperty(h);this.fire(new b.ErrorEvent(new Error(`Cannot get style of non-existing layer "${a}".`)))}setPaintProperty(a,h,m,y={}){this._checkLoaded();const w=this.getLayer(a);w?Zt(w.getPaintProperty(h),m)||(w.setPaintProperty(h,m,y)&&this._updateLayer(w),this._changed=!0,this._updatedPaintProps[a]=!0):this.fire(new b.ErrorEvent(new Error(`Cannot style non-existing layer "${a}".`)))}getPaintProperty(a,h){return this.getLayer(a).getPaintProperty(h)}setFeatureState(a,h){this._checkLoaded();const m=a.source,y=a.sourceLayer,w=this.sourceCaches[m];if(void 0===w)return void this.fire(new b.ErrorEvent(new Error(`The source '${m}' does not exist in the map's style.`)));const S=w.getSource().type;"geojson"===S&&y?this.fire(new b.ErrorEvent(new Error("GeoJSON sources cannot have a sourceLayer parameter."))):"vector"!==S||y?(void 0===a.id&&this.fire(new b.ErrorEvent(new Error("The feature id parameter must be provided."))),w.setFeatureState(y,a.id,h)):this.fire(new b.ErrorEvent(new Error("The sourceLayer parameter must be provided for vector source types.")))}removeFeatureState(a,h){this._checkLoaded();const m=a.source,y=this.sourceCaches[m];if(void 0===y)return void this.fire(new b.ErrorEvent(new Error(`The source '${m}' does not exist in the map's style.`)));const w=y.getSource().type,S="vector"===w?a.sourceLayer:void 0;"vector"!==w||S?h&&"string"!=typeof a.id&&"number"!=typeof a.id?this.fire(new b.ErrorEvent(new Error("A feature id is required to remove its specific state property."))):y.removeFeatureState(S,a.id,h):this.fire(new b.ErrorEvent(new Error("The sourceLayer parameter must be provided for vector source types.")))}getFeatureState(a){this._checkLoaded();const h=a.source,m=a.sourceLayer,y=this.sourceCaches[h];if(void 0!==y)return"vector"!==y.getSource().type||m?(void 0===a.id&&this.fire(new b.ErrorEvent(new Error("The feature id parameter must be provided."))),y.getFeatureState(m,a.id)):void this.fire(new b.ErrorEvent(new Error("The sourceLayer parameter must be provided for vector source types.")));this.fire(new b.ErrorEvent(new Error(`The source '${h}' does not exist in the map's style.`)))}getTransition(){return b.extend({duration:300,delay:0},this.stylesheet&&this.stylesheet.transition)}serialize(){return b.filterObject({version:this.stylesheet.version,name:this.stylesheet.name,metadata:this.stylesheet.metadata,light:this.stylesheet.light,center:this.stylesheet.center,zoom:this.stylesheet.zoom,bearing:this.stylesheet.bearing,pitch:this.stylesheet.pitch,sprite:this.stylesheet.sprite,glyphs:this.stylesheet.glyphs,transition:this.stylesheet.transition,sources:b.mapObject(this.sourceCaches,a=>a.serialize()),layers:this._serializeLayers(this._order)},a=>void 0!==a)}_updateLayer(a){this._updatedLayers[a.id]=!0,a.source&&!this._updatedSources[a.source]&&"raster"!==this.sourceCaches[a.source].getSource().type&&(this._updatedSources[a.source]="reload",this.sourceCaches[a.source].pause()),this._changed=!0}_flattenAndSortRenderedFeatures(a){const h=S=>"fill-extrusion"===this._layers[S].type,m={},y=[];for(let S=this._order.length-1;S>=0;S--){const T=this._order[S];if(h(T)){m[T]=S;for(const k of a){const R=k[T];if(R)for(const z of R)y.push(z)}}}y.sort((S,T)=>T.intersectionZ-S.intersectionZ);const w=[];for(let S=this._order.length-1;S>=0;S--){const T=this._order[S];if(h(T))for(let k=y.length-1;k>=0;k--){const R=y[k].feature;if(m[R.layer.id]{const ke=ae.featureSortOrder;if(ke){const Be=ke.indexOf(De.featureIndex);return ke.indexOf(Se.featureIndex)-Be}return Se.featureIndex-De.featureIndex});for(const De of we)ie.push(De)}}for(const ae in Q)Q[ae].forEach(_e=>{const ye=_e.feature,ie=k[S[ae].source].getFeatureState(ye.layer["source-layer"],ye.id);ye.source=ye.layer.source,ye.layer["source-layer"]&&(ye.sourceLayer=ye.layer["source-layer"]),ye.state=ie});return Q}(this._layers,this._serializedLayers,this.sourceCaches,a,h,this.placement.collisionIndex,this.placement.retainedQueryData)),this._flattenAndSortRenderedFeatures(w)}querySourceFeatures(a,h){h&&h.filter&&this._validate(b.validateStyle.filter,"querySourceFeatures.filter",h.filter,null,h);const m=this.sourceCaches[a];return m?function(y,w){const S=y.getRenderableIds().map(R=>y.getTileByID(R)),T=[],k={};for(let R=0;Rj.getTileByID(Q)).sort((Q,ee)=>ee.tileID.overscaledZ-Q.tileID.overscaledZ||(Q.tileID.isLessThan(ee.tileID)?-1:1))}const L=this.crossTileSymbolIndex.addLayer(z,k[z.source],a.center.lng);S=S||L}if(this.crossTileSymbolIndex.pruneUnusedLayers(this._order),((w=w||this._layerOrderChanged||0===m)||!this.pauseablePlacement||this.pauseablePlacement.isDone()&&!this.placement.stillRecent(b.exported.now(),a.zoom))&&(this.pauseablePlacement=new Cr(a,this.map.terrain,this._order,w,h,m,y,this.placement),this._layerOrderChanged=!1),this.pauseablePlacement.isDone()?this.placement.setStale():(this.pauseablePlacement.continuePlacement(this._order,this._layers,k),this.pauseablePlacement.isDone()&&(this.placement=this.pauseablePlacement.commit(b.exported.now()),T=!0),S&&this.pauseablePlacement.placement.setStale()),T||S)for(const R of this._order){const z=this._layers[R];"symbol"===z.type&&this.placement.updateLayerOpacities(z,k[z.source])}return!this.pauseablePlacement.isDone()||this.placement.hasTransitions(b.exported.now())}_releaseSymbolFadeTiles(){for(const a in this.sourceCaches)this.sourceCaches[a].releaseSymbolFadeTiles()}getImages(a,h,m){this.imageManager.getImages(h.icons,m),this._updateTilesForChangedImages();const y=this.sourceCaches[h.source];y&&y.setDependencies(h.tileID.key,h.type,h.icons)}getGlyphs(a,h,m){this.glyphManager.getGlyphs(h.stacks,m);const y=this.sourceCaches[h.source];y&&y.setDependencies(h.tileID.key,h.type,[""])}getResource(a,h,m){return b.makeRequest(h,m)}getGlyphsUrl(){return this.stylesheet.glyphs||null}setGlyphs(a,h={}){this._checkLoaded(),a&&this._validate(b.validateStyle.glyphs,"glyphs",a,null,h)||(this._glyphsDidChange=!0,this.stylesheet.glyphs=a,this.glyphManager.entries={},this.glyphManager.setURL(a))}addSprite(a,h,m={},y){this._checkLoaded();const w=[{id:a,url:h}],S=[...hs(this.stylesheet.sprite),...w];this._validate(b.validateStyle.sprite,"sprite",S,null,m)||(this.stylesheet.sprite=S,this._loadSprite(w,!0,y))}removeSprite(a){this._checkLoaded();const h=hs(this.stylesheet.sprite);if(h.find(m=>m.id===a)){if(this._spritesImagesIds[a])for(const m of this._spritesImagesIds[a])this.imageManager.removeImage(m),this._changedImages[m]=!0;h.splice(h.findIndex(m=>m.id===a),1),this.stylesheet.sprite=h.length>0?h:void 0,delete this._spritesImagesIds[a],this._availableImages=this.imageManager.listImages(),this._changed=!0,this.dispatcher.broadcast("setImages",this._availableImages),this.fire(new b.Event("data",{dataType:"style"}))}else this.fire(new b.ErrorEvent(new Error(`Sprite "${a}" doesn't exists on this map.`)))}getSprite(){return hs(this.stylesheet.sprite)}setSprite(a,h={},m){this._checkLoaded(),a&&this._validate(b.validateStyle.sprite,"sprite",a,null,h)||(this.stylesheet.sprite=a,a?this._loadSprite(a,!0,m):(this._unloadSprite(),m(null)))}}Mt.getSourceType=function(g){return Ol[g]},Mt.setSourceType=function(g,a){Ol[g]=a},Mt.registerForPluginStateChange=b.registerForPluginStateChange;var Vl=b.createLayout([{name:"a_pos",type:"Int16",components:2}]),Ff="attribute vec3 a_pos3d;uniform mat4 u_matrix;uniform float u_ele_delta;varying vec2 v_texture_pos;varying float v_depth;void main() {float extent=8192.0;float ele_delta=a_pos3d.z==1.0 ? u_ele_delta : 0.0;v_texture_pos=a_pos3d.xy/extent;gl_Position=u_matrix*vec4(a_pos3d.xy,get_elevation(a_pos3d.xy)-ele_delta,1.0);v_depth=gl_Position.z/gl_Position.w;}";const nt={prelude:wn("#ifdef GL_ES\nprecision mediump float;\n#else\n#if !defined(lowp)\n#define lowp\n#endif\n#if !defined(mediump)\n#define mediump\n#endif\n#if !defined(highp)\n#define highp\n#endif\n#endif","#ifdef GL_ES\nprecision highp float;\n#else\n#if !defined(lowp)\n#define lowp\n#endif\n#if !defined(mediump)\n#define mediump\n#endif\n#if !defined(highp)\n#define highp\n#endif\n#endif\nvec2 unpack_float(const float packedValue) {int packedIntValue=int(packedValue);int v0=packedIntValue/256;return vec2(v0,packedIntValue-v0*256);}vec2 unpack_opacity(const float packedOpacity) {int intOpacity=int(packedOpacity)/2;return vec2(float(intOpacity)/127.0,mod(packedOpacity,2.0));}vec4 decode_color(const vec2 encodedColor) {return vec4(unpack_float(encodedColor[0])/255.0,unpack_float(encodedColor[1])/255.0\n);}float unpack_mix_vec2(const vec2 packedValue,const float t) {return mix(packedValue[0],packedValue[1],t);}vec4 unpack_mix_color(const vec4 packedColors,const float t) {vec4 minColor=decode_color(vec2(packedColors[0],packedColors[1]));vec4 maxColor=decode_color(vec2(packedColors[2],packedColors[3]));return mix(minColor,maxColor,t);}vec2 get_pattern_pos(const vec2 pixel_coord_upper,const vec2 pixel_coord_lower,const vec2 pattern_size,const float tile_units_to_pixels,const vec2 pos) {vec2 offset=mod(mod(mod(pixel_coord_upper,pattern_size)*256.0,pattern_size)*256.0+pixel_coord_lower,pattern_size);return (tile_units_to_pixels*pos+offset)/pattern_size;}\n#ifdef TERRAIN3D\nuniform sampler2D u_terrain;uniform float u_terrain_dim;uniform mat4 u_terrain_matrix;uniform vec4 u_terrain_unpack;uniform float u_terrain_exaggeration;uniform highp sampler2D u_depth;\n#endif\nconst highp vec4 bitSh=vec4(256.*256.*256.,256.*256.,256.,1.);const highp vec4 bitShifts=vec4(1.)/bitSh;highp float unpack(highp vec4 color) {return dot(color,bitShifts);}highp float depthOpacity(vec3 frag) {\n#ifdef TERRAIN3D\nhighp float d=unpack(texture2D(u_depth,frag.xy*0.5+0.5))+0.0001-frag.z;return 1.0-max(0.0,min(1.0,-d*500.0));\n#else\nreturn 1.0;\n#endif\n}float calculate_visibility(vec4 pos) {\n#ifdef TERRAIN3D\nvec3 frag=pos.xyz/pos.w;highp float d=depthOpacity(frag);if (d > 0.95) return 1.0;return (d+depthOpacity(frag+vec3(0.0,0.01,0.0)))/2.0;\n#else\nreturn 1.0;\n#endif\n}float ele(vec2 pos) {\n#ifdef TERRAIN3D\nvec4 rgb=(texture2D(u_terrain,pos)*255.0)*u_terrain_unpack;return rgb.r+rgb.g+rgb.b-u_terrain_unpack.a;\n#else\nreturn 0.0;\n#endif\n}float get_elevation(vec2 pos) {\n#ifdef TERRAIN3D\nvec2 coord=(u_terrain_matrix*vec4(pos,0.0,1.0)).xy*u_terrain_dim+1.0;vec2 f=fract(coord);vec2 c=(floor(coord)+0.5)/(u_terrain_dim+2.0);float d=1.0/(u_terrain_dim+2.0);float tl=ele(c);float tr=ele(c+vec2(d,0.0));float bl=ele(c+vec2(0.0,d));float br=ele(c+vec2(d,d));float elevation=mix(mix(tl,tr,f.x),mix(bl,br,f.x),f.y);return elevation*u_terrain_exaggeration;\n#else\nreturn 0.0;\n#endif\n}"),background:wn("uniform vec4 u_color;uniform float u_opacity;void main() {gl_FragColor=u_color*u_opacity;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","attribute vec2 a_pos;uniform mat4 u_matrix;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);}"),backgroundPattern:wn("uniform vec2 u_pattern_tl_a;uniform vec2 u_pattern_br_a;uniform vec2 u_pattern_tl_b;uniform vec2 u_pattern_br_b;uniform vec2 u_texsize;uniform float u_mix;uniform float u_opacity;uniform sampler2D u_image;varying vec2 v_pos_a;varying vec2 v_pos_b;void main() {vec2 imagecoord=mod(v_pos_a,1.0);vec2 pos=mix(u_pattern_tl_a/u_texsize,u_pattern_br_a/u_texsize,imagecoord);vec4 color1=texture2D(u_image,pos);vec2 imagecoord_b=mod(v_pos_b,1.0);vec2 pos2=mix(u_pattern_tl_b/u_texsize,u_pattern_br_b/u_texsize,imagecoord_b);vec4 color2=texture2D(u_image,pos2);gl_FragColor=mix(color1,color2,u_mix)*u_opacity;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform vec2 u_pattern_size_a;uniform vec2 u_pattern_size_b;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform float u_scale_a;uniform float u_scale_b;uniform float u_tile_units_to_pixels;attribute vec2 a_pos;varying vec2 v_pos_a;varying vec2 v_pos_b;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);v_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,u_scale_a*u_pattern_size_a,u_tile_units_to_pixels,a_pos);v_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,u_scale_b*u_pattern_size_b,u_tile_units_to_pixels,a_pos);}"),circle:wn("varying vec3 v_data;varying float v_visibility;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define mediump float radius\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define highp vec4 stroke_color\n#pragma mapbox: define mediump float stroke_width\n#pragma mapbox: define lowp float stroke_opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize mediump float radius\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize highp vec4 stroke_color\n#pragma mapbox: initialize mediump float stroke_width\n#pragma mapbox: initialize lowp float stroke_opacity\nvec2 extrude=v_data.xy;float extrude_length=length(extrude);lowp float antialiasblur=v_data.z;float antialiased_blur=-max(blur,antialiasblur);float opacity_t=smoothstep(0.0,antialiased_blur,extrude_length-1.0);float color_t=stroke_width < 0.01 ? 0.0 : smoothstep(antialiased_blur,0.0,extrude_length-radius/(radius+stroke_width));gl_FragColor=v_visibility*opacity_t*mix(color*opacity,stroke_color*stroke_opacity,color_t);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform bool u_scale_with_map;uniform bool u_pitch_with_map;uniform vec2 u_extrude_scale;uniform lowp float u_device_pixel_ratio;uniform highp float u_camera_to_center_distance;attribute vec2 a_pos;varying vec3 v_data;varying float v_visibility;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define mediump float radius\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define highp vec4 stroke_color\n#pragma mapbox: define mediump float stroke_width\n#pragma mapbox: define lowp float stroke_opacity\nvoid main(void) {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize mediump float radius\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize highp vec4 stroke_color\n#pragma mapbox: initialize mediump float stroke_width\n#pragma mapbox: initialize lowp float stroke_opacity\nvec2 extrude=vec2(mod(a_pos,2.0)*2.0-1.0);vec2 circle_center=floor(a_pos*0.5);float ele=get_elevation(circle_center);v_visibility=calculate_visibility(u_matrix*vec4(circle_center,ele,1.0));if (u_pitch_with_map) {vec2 corner_position=circle_center;if (u_scale_with_map) {corner_position+=extrude*(radius+stroke_width)*u_extrude_scale;} else {vec4 projected_center=u_matrix*vec4(circle_center,0,1);corner_position+=extrude*(radius+stroke_width)*u_extrude_scale*(projected_center.w/u_camera_to_center_distance);}gl_Position=u_matrix*vec4(corner_position,ele,1);} else {gl_Position=u_matrix*vec4(circle_center,ele,1);if (u_scale_with_map) {gl_Position.xy+=extrude*(radius+stroke_width)*u_extrude_scale*u_camera_to_center_distance;} else {gl_Position.xy+=extrude*(radius+stroke_width)*u_extrude_scale*gl_Position.w;}}lowp float antialiasblur=1.0/u_device_pixel_ratio/(radius+stroke_width);v_data=vec3(extrude.x,extrude.y,antialiasblur);}"),clippingMask:wn("void main() {gl_FragColor=vec4(1.0);}","attribute vec2 a_pos;uniform mat4 u_matrix;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);}"),heatmap:wn("uniform highp float u_intensity;varying vec2 v_extrude;\n#pragma mapbox: define highp float weight\n#define GAUSS_COEF 0.3989422804014327\nvoid main() {\n#pragma mapbox: initialize highp float weight\nfloat d=-0.5*3.0*3.0*dot(v_extrude,v_extrude);float val=weight*u_intensity*GAUSS_COEF*exp(d);gl_FragColor=vec4(val,1.0,1.0,1.0);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform float u_extrude_scale;uniform float u_opacity;uniform float u_intensity;attribute vec2 a_pos;varying vec2 v_extrude;\n#pragma mapbox: define highp float weight\n#pragma mapbox: define mediump float radius\nconst highp float ZERO=1.0/255.0/16.0;\n#define GAUSS_COEF 0.3989422804014327\nvoid main(void) {\n#pragma mapbox: initialize highp float weight\n#pragma mapbox: initialize mediump float radius\nvec2 unscaled_extrude=vec2(mod(a_pos,2.0)*2.0-1.0);float S=sqrt(-2.0*log(ZERO/weight/u_intensity/GAUSS_COEF))/3.0;v_extrude=S*unscaled_extrude;vec2 extrude=v_extrude*radius*u_extrude_scale;vec4 pos=vec4(floor(a_pos*0.5)+extrude,0,1);gl_Position=u_matrix*pos;}"),heatmapTexture:wn("uniform sampler2D u_image;uniform sampler2D u_color_ramp;uniform float u_opacity;varying vec2 v_pos;void main() {float t=texture2D(u_image,v_pos).r;vec4 color=texture2D(u_color_ramp,vec2(t,0.5));gl_FragColor=color*u_opacity;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(0.0);\n#endif\n}","uniform mat4 u_matrix;uniform vec2 u_world;attribute vec2 a_pos;varying vec2 v_pos;void main() {gl_Position=u_matrix*vec4(a_pos*u_world,0,1);v_pos.x=a_pos.x;v_pos.y=1.0-a_pos.y;}"),collisionBox:wn("varying float v_placed;varying float v_notUsed;void main() {float alpha=0.5;gl_FragColor=vec4(1.0,0.0,0.0,1.0)*alpha;if (v_placed > 0.5) {gl_FragColor=vec4(0.0,0.0,1.0,0.5)*alpha;}if (v_notUsed > 0.5) {gl_FragColor*=.1;}}","attribute vec2 a_pos;attribute vec2 a_anchor_pos;attribute vec2 a_extrude;attribute vec2 a_placed;attribute vec2 a_shift;uniform mat4 u_matrix;uniform vec2 u_extrude_scale;uniform float u_camera_to_center_distance;varying float v_placed;varying float v_notUsed;void main() {vec4 projectedPoint=u_matrix*vec4(a_anchor_pos,0,1);highp float camera_to_anchor_distance=projectedPoint.w;highp float collision_perspective_ratio=clamp(0.5+0.5*(u_camera_to_center_distance/camera_to_anchor_distance),0.0,4.0);gl_Position=u_matrix*vec4(a_pos,get_elevation(a_pos),1.0);gl_Position.xy+=(a_extrude+a_shift)*u_extrude_scale*gl_Position.w*collision_perspective_ratio;v_placed=a_placed.x;v_notUsed=a_placed.y;}"),collisionCircle:wn("varying float v_radius;varying vec2 v_extrude;varying float v_perspective_ratio;varying float v_collision;void main() {float alpha=0.5*min(v_perspective_ratio,1.0);float stroke_radius=0.9*max(v_perspective_ratio,1.0);float distance_to_center=length(v_extrude);float distance_to_edge=abs(distance_to_center-v_radius);float opacity_t=smoothstep(-stroke_radius,0.0,-distance_to_edge);vec4 color=mix(vec4(0.0,0.0,1.0,0.5),vec4(1.0,0.0,0.0,1.0),v_collision);gl_FragColor=color*alpha*opacity_t;}","attribute vec2 a_pos;attribute float a_radius;attribute vec2 a_flags;uniform mat4 u_matrix;uniform mat4 u_inv_matrix;uniform vec2 u_viewport_size;uniform float u_camera_to_center_distance;varying float v_radius;varying vec2 v_extrude;varying float v_perspective_ratio;varying float v_collision;vec3 toTilePosition(vec2 screenPos) {vec4 rayStart=u_inv_matrix*vec4(screenPos,-1.0,1.0);vec4 rayEnd =u_inv_matrix*vec4(screenPos, 1.0,1.0);rayStart.xyz/=rayStart.w;rayEnd.xyz /=rayEnd.w;highp float t=(0.0-rayStart.z)/(rayEnd.z-rayStart.z);return mix(rayStart.xyz,rayEnd.xyz,t);}void main() {vec2 quadCenterPos=a_pos;float radius=a_radius;float collision=a_flags.x;float vertexIdx=a_flags.y;vec2 quadVertexOffset=vec2(mix(-1.0,1.0,float(vertexIdx >=2.0)),mix(-1.0,1.0,float(vertexIdx >=1.0 && vertexIdx <=2.0)));vec2 quadVertexExtent=quadVertexOffset*radius;vec3 tilePos=toTilePosition(quadCenterPos);vec4 clipPos=u_matrix*vec4(tilePos,1.0);highp float camera_to_anchor_distance=clipPos.w;highp float collision_perspective_ratio=clamp(0.5+0.5*(u_camera_to_center_distance/camera_to_anchor_distance),0.0,4.0);float padding_factor=1.2;v_radius=radius;v_extrude=quadVertexExtent*padding_factor;v_perspective_ratio=collision_perspective_ratio;v_collision=collision;gl_Position=vec4(clipPos.xyz/clipPos.w,1.0)+vec4(quadVertexExtent*padding_factor/u_viewport_size*2.0,0.0,0.0);}"),debug:wn("uniform highp vec4 u_color;uniform sampler2D u_overlay;varying vec2 v_uv;void main() {vec4 overlay_color=texture2D(u_overlay,v_uv);gl_FragColor=mix(u_color,overlay_color,overlay_color.a);}","attribute vec2 a_pos;varying vec2 v_uv;uniform mat4 u_matrix;uniform float u_overlay_scale;void main() {v_uv=a_pos/8192.0;gl_Position=u_matrix*vec4(a_pos*u_overlay_scale,get_elevation(a_pos),1);}"),fill:wn("#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float opacity\ngl_FragColor=color*opacity;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","attribute vec2 a_pos;uniform mat4 u_matrix;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float opacity\ngl_Position=u_matrix*vec4(a_pos,0,1);}"),fillOutline:wn("varying vec2 v_pos;\n#pragma mapbox: define highp vec4 outline_color\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 outline_color\n#pragma mapbox: initialize lowp float opacity\nfloat dist=length(v_pos-gl_FragCoord.xy);float alpha=1.0-smoothstep(0.0,1.0,dist);gl_FragColor=outline_color*(alpha*opacity);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","attribute vec2 a_pos;uniform mat4 u_matrix;uniform vec2 u_world;varying vec2 v_pos;\n#pragma mapbox: define highp vec4 outline_color\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 outline_color\n#pragma mapbox: initialize lowp float opacity\ngl_Position=u_matrix*vec4(a_pos,0,1);v_pos=(gl_Position.xy/gl_Position.w+1.0)/2.0*u_world;}"),fillOutlinePattern:wn("uniform vec2 u_texsize;uniform sampler2D u_image;uniform float u_fade;varying vec2 v_pos_a;varying vec2 v_pos_b;varying vec2 v_pos;\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;vec2 imagecoord=mod(v_pos_a,1.0);vec2 pos=mix(pattern_tl_a/u_texsize,pattern_br_a/u_texsize,imagecoord);vec4 color1=texture2D(u_image,pos);vec2 imagecoord_b=mod(v_pos_b,1.0);vec2 pos2=mix(pattern_tl_b/u_texsize,pattern_br_b/u_texsize,imagecoord_b);vec4 color2=texture2D(u_image,pos2);float dist=length(v_pos-gl_FragCoord.xy);float alpha=1.0-smoothstep(0.0,1.0,dist);gl_FragColor=mix(color1,color2,u_fade)*alpha*opacity;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform vec2 u_world;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform vec3 u_scale;attribute vec2 a_pos;varying vec2 v_pos_a;varying vec2 v_pos_b;varying vec2 v_pos;\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\n#pragma mapbox: define lowp float pixel_ratio_from\n#pragma mapbox: define lowp float pixel_ratio_to\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\n#pragma mapbox: initialize lowp float pixel_ratio_from\n#pragma mapbox: initialize lowp float pixel_ratio_to\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float tileRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;gl_Position=u_matrix*vec4(a_pos,0,1);vec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;vec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to;v_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,fromScale*display_size_a,tileRatio,a_pos);v_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,toScale*display_size_b,tileRatio,a_pos);v_pos=(gl_Position.xy/gl_Position.w+1.0)/2.0*u_world;}"),fillPattern:wn("#ifdef GL_ES\nprecision highp float;\n#endif\nuniform vec2 u_texsize;uniform float u_fade;uniform sampler2D u_image;varying vec2 v_pos_a;varying vec2 v_pos_b;\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;vec2 imagecoord=mod(v_pos_a,1.0);vec2 pos=mix(pattern_tl_a/u_texsize,pattern_br_a/u_texsize,imagecoord);vec4 color1=texture2D(u_image,pos);vec2 imagecoord_b=mod(v_pos_b,1.0);vec2 pos2=mix(pattern_tl_b/u_texsize,pattern_br_b/u_texsize,imagecoord_b);vec4 color2=texture2D(u_image,pos2);gl_FragColor=mix(color1,color2,u_fade)*opacity;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform vec3 u_scale;attribute vec2 a_pos;varying vec2 v_pos_a;varying vec2 v_pos_b;\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\n#pragma mapbox: define lowp float pixel_ratio_from\n#pragma mapbox: define lowp float pixel_ratio_to\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\n#pragma mapbox: initialize lowp float pixel_ratio_from\n#pragma mapbox: initialize lowp float pixel_ratio_to\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float tileZoomRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;vec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;vec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to;gl_Position=u_matrix*vec4(a_pos,0,1);v_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,fromScale*display_size_a,tileZoomRatio,a_pos);v_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,toScale*display_size_b,tileZoomRatio,a_pos);}"),fillExtrusion:wn("varying vec4 v_color;void main() {gl_FragColor=v_color;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform vec3 u_lightcolor;uniform lowp vec3 u_lightpos;uniform lowp float u_lightintensity;uniform float u_vertical_gradient;uniform lowp float u_opacity;attribute vec2 a_pos;attribute vec4 a_normal_ed;\n#ifdef TERRAIN3D\nattribute vec2 a_centroid;\n#endif\nvarying vec4 v_color;\n#pragma mapbox: define highp float base\n#pragma mapbox: define highp float height\n#pragma mapbox: define highp vec4 color\nvoid main() {\n#pragma mapbox: initialize highp float base\n#pragma mapbox: initialize highp float height\n#pragma mapbox: initialize highp vec4 color\nvec3 normal=a_normal_ed.xyz;\n#ifdef TERRAIN3D\nfloat baseDelta=10.0;float ele=get_elevation(a_centroid);\n#else\nfloat baseDelta=0.0;float ele=0.0;\n#endif\nbase=max(0.0,ele+base-baseDelta);height=max(0.0,ele+height);float t=mod(normal.x,2.0);gl_Position=u_matrix*vec4(a_pos,t > 0.0 ? height : base,1);float colorvalue=color.r*0.2126+color.g*0.7152+color.b*0.0722;v_color=vec4(0.0,0.0,0.0,1.0);vec4 ambientlight=vec4(0.03,0.03,0.03,1.0);color+=ambientlight;float directional=clamp(dot(normal/16384.0,u_lightpos),0.0,1.0);directional=mix((1.0-u_lightintensity),max((1.0-colorvalue+u_lightintensity),1.0),directional);if (normal.y !=0.0) {directional*=((1.0-u_vertical_gradient)+(u_vertical_gradient*clamp((t+base)*pow(height/150.0,0.5),mix(0.7,0.98,1.0-u_lightintensity),1.0)));}v_color.r+=clamp(color.r*directional*u_lightcolor.r,mix(0.0,0.3,1.0-u_lightcolor.r),1.0);v_color.g+=clamp(color.g*directional*u_lightcolor.g,mix(0.0,0.3,1.0-u_lightcolor.g),1.0);v_color.b+=clamp(color.b*directional*u_lightcolor.b,mix(0.0,0.3,1.0-u_lightcolor.b),1.0);v_color*=u_opacity;}"),fillExtrusionPattern:wn("uniform vec2 u_texsize;uniform float u_fade;uniform sampler2D u_image;varying vec2 v_pos_a;varying vec2 v_pos_b;varying vec4 v_lighting;\n#pragma mapbox: define lowp float base\n#pragma mapbox: define lowp float height\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\n#pragma mapbox: define lowp float pixel_ratio_from\n#pragma mapbox: define lowp float pixel_ratio_to\nvoid main() {\n#pragma mapbox: initialize lowp float base\n#pragma mapbox: initialize lowp float height\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\n#pragma mapbox: initialize lowp float pixel_ratio_from\n#pragma mapbox: initialize lowp float pixel_ratio_to\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;vec2 imagecoord=mod(v_pos_a,1.0);vec2 pos=mix(pattern_tl_a/u_texsize,pattern_br_a/u_texsize,imagecoord);vec4 color1=texture2D(u_image,pos);vec2 imagecoord_b=mod(v_pos_b,1.0);vec2 pos2=mix(pattern_tl_b/u_texsize,pattern_br_b/u_texsize,imagecoord_b);vec4 color2=texture2D(u_image,pos2);vec4 mixedColor=mix(color1,color2,u_fade);gl_FragColor=mixedColor*v_lighting;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform float u_height_factor;uniform vec3 u_scale;uniform float u_vertical_gradient;uniform lowp float u_opacity;uniform vec3 u_lightcolor;uniform lowp vec3 u_lightpos;uniform lowp float u_lightintensity;attribute vec2 a_pos;attribute vec4 a_normal_ed;\n#ifdef TERRAIN3D\nattribute vec2 a_centroid;\n#endif\nvarying vec2 v_pos_a;varying vec2 v_pos_b;varying vec4 v_lighting;\n#pragma mapbox: define lowp float base\n#pragma mapbox: define lowp float height\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\n#pragma mapbox: define lowp float pixel_ratio_from\n#pragma mapbox: define lowp float pixel_ratio_to\nvoid main() {\n#pragma mapbox: initialize lowp float base\n#pragma mapbox: initialize lowp float height\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\n#pragma mapbox: initialize lowp float pixel_ratio_from\n#pragma mapbox: initialize lowp float pixel_ratio_to\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float tileRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;vec3 normal=a_normal_ed.xyz;float edgedistance=a_normal_ed.w;vec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;vec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to;\n#ifdef TERRAIN3D\nfloat baseDelta=10.0;float ele=get_elevation(a_centroid);\n#else\nfloat baseDelta=0.0;float ele=0.0;\n#endif\nbase=max(0.0,ele+base-baseDelta);height=max(0.0,ele+height);float t=mod(normal.x,2.0);float z=t > 0.0 ? height : base;gl_Position=u_matrix*vec4(a_pos,z,1);vec2 pos=normal.x==1.0 && normal.y==0.0 && normal.z==16384.0\n? a_pos\n: vec2(edgedistance,z*u_height_factor);v_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,fromScale*display_size_a,tileRatio,pos);v_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,toScale*display_size_b,tileRatio,pos);v_lighting=vec4(0.0,0.0,0.0,1.0);float directional=clamp(dot(normal/16383.0,u_lightpos),0.0,1.0);directional=mix((1.0-u_lightintensity),max((0.5+u_lightintensity),1.0),directional);if (normal.y !=0.0) {directional*=((1.0-u_vertical_gradient)+(u_vertical_gradient*clamp((t+base)*pow(height/150.0,0.5),mix(0.7,0.98,1.0-u_lightintensity),1.0)));}v_lighting.rgb+=clamp(directional*u_lightcolor,mix(vec3(0.0),vec3(0.3),1.0-u_lightcolor),vec3(1.0));v_lighting*=u_opacity;}"),hillshadePrepare:wn("#ifdef GL_ES\nprecision highp float;\n#endif\nuniform sampler2D u_image;varying vec2 v_pos;uniform vec2 u_dimension;uniform float u_zoom;uniform vec4 u_unpack;float getElevation(vec2 coord,float bias) {vec4 data=texture2D(u_image,coord)*255.0;data.a=-1.0;return dot(data,u_unpack)/4.0;}void main() {vec2 epsilon=1.0/u_dimension;float a=getElevation(v_pos+vec2(-epsilon.x,-epsilon.y),0.0);float b=getElevation(v_pos+vec2(0,-epsilon.y),0.0);float c=getElevation(v_pos+vec2(epsilon.x,-epsilon.y),0.0);float d=getElevation(v_pos+vec2(-epsilon.x,0),0.0);float e=getElevation(v_pos,0.0);float f=getElevation(v_pos+vec2(epsilon.x,0),0.0);float g=getElevation(v_pos+vec2(-epsilon.x,epsilon.y),0.0);float h=getElevation(v_pos+vec2(0,epsilon.y),0.0);float i=getElevation(v_pos+vec2(epsilon.x,epsilon.y),0.0);float exaggerationFactor=u_zoom < 2.0 ? 0.4 : u_zoom < 4.5 ? 0.35 : 0.3;float exaggeration=u_zoom < 15.0 ? (u_zoom-15.0)*exaggerationFactor : 0.0;vec2 deriv=vec2((c+f+f+i)-(a+d+d+g),(g+h+h+i)-(a+b+b+c))/pow(2.0,exaggeration+(19.2562-u_zoom));gl_FragColor=clamp(vec4(deriv.x/2.0+0.5,deriv.y/2.0+0.5,1.0,1.0),0.0,1.0);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform vec2 u_dimension;attribute vec2 a_pos;attribute vec2 a_texture_pos;varying vec2 v_pos;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);highp vec2 epsilon=1.0/u_dimension;float scale=(u_dimension.x-2.0)/u_dimension.x;v_pos=(a_texture_pos/8192.0)*scale+epsilon;}"),hillshade:wn("uniform sampler2D u_image;varying vec2 v_pos;uniform vec2 u_latrange;uniform vec2 u_light;uniform vec4 u_shadow;uniform vec4 u_highlight;uniform vec4 u_accent;\n#define PI 3.141592653589793\nvoid main() {vec4 pixel=texture2D(u_image,v_pos);vec2 deriv=((pixel.rg*2.0)-1.0);float scaleFactor=cos(radians((u_latrange[0]-u_latrange[1])*(1.0-v_pos.y)+u_latrange[1]));float slope=atan(1.25*length(deriv)/scaleFactor);float aspect=deriv.x !=0.0 ? atan(deriv.y,-deriv.x) : PI/2.0*(deriv.y > 0.0 ? 1.0 :-1.0);float intensity=u_light.x;float azimuth=u_light.y+PI;float base=1.875-intensity*1.75;float maxValue=0.5*PI;float scaledSlope=intensity !=0.5 ? ((pow(base,slope)-1.0)/(pow(base,maxValue)-1.0))*maxValue : slope;float accent=cos(scaledSlope);vec4 accent_color=(1.0-accent)*u_accent*clamp(intensity*2.0,0.0,1.0);float shade=abs(mod((aspect+azimuth)/PI+0.5,2.0)-1.0);vec4 shade_color=mix(u_shadow,u_highlight,shade)*sin(scaledSlope)*clamp(intensity*2.0,0.0,1.0);gl_FragColor=accent_color*(1.0-shade_color.a)+shade_color;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;attribute vec2 a_pos;attribute vec2 a_texture_pos;varying vec2 v_pos;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);v_pos=a_texture_pos/8192.0;}"),line:wn("uniform lowp float u_device_pixel_ratio;varying vec2 v_width2;varying vec2 v_normal;varying float v_gamma_scale;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\nfloat dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);gl_FragColor=color*(alpha*opacity);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","\n#define scale 0.015873016\nattribute vec2 a_pos_normal;attribute vec4 a_data;uniform mat4 u_matrix;uniform mediump float u_ratio;uniform vec2 u_units_to_pixels;uniform lowp float u_device_pixel_ratio;varying vec2 v_normal;varying vec2 v_width2;varying float v_gamma_scale;varying highp float v_linesofar;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define mediump float gapwidth\n#pragma mapbox: define lowp float offset\n#pragma mapbox: define mediump float width\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump float gapwidth\n#pragma mapbox: initialize lowp float offset\n#pragma mapbox: initialize mediump float width\nfloat ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;v_linesofar=(floor(a_data.z/4.0)+a_data.w*64.0)*2.0;vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);vec4 projected_extrude=u_matrix*vec4(dist/u_ratio,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude;\n#ifdef TERRAIN3D\nv_gamma_scale=1.0;\n#else\nfloat extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length(projected_extrude.xy/gl_Position.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective;\n#endif\nv_width2=vec2(outset,inset);}"),lineGradient:wn("uniform lowp float u_device_pixel_ratio;uniform sampler2D u_image;varying vec2 v_width2;varying vec2 v_normal;varying float v_gamma_scale;varying highp vec2 v_uv;\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\nfloat dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);vec4 color=texture2D(u_image,v_uv);gl_FragColor=color*(alpha*opacity);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","\n#define scale 0.015873016\nattribute vec2 a_pos_normal;attribute vec4 a_data;attribute float a_uv_x;attribute float a_split_index;uniform mat4 u_matrix;uniform mediump float u_ratio;uniform lowp float u_device_pixel_ratio;uniform vec2 u_units_to_pixels;uniform float u_image_height;varying vec2 v_normal;varying vec2 v_width2;varying float v_gamma_scale;varying highp vec2 v_uv;\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define mediump float gapwidth\n#pragma mapbox: define lowp float offset\n#pragma mapbox: define mediump float width\nvoid main() {\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump float gapwidth\n#pragma mapbox: initialize lowp float offset\n#pragma mapbox: initialize mediump float width\nfloat ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;highp float texel_height=1.0/u_image_height;highp float half_texel_height=0.5*texel_height;v_uv=vec2(a_uv_x,a_split_index*texel_height-half_texel_height);vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);vec4 projected_extrude=u_matrix*vec4(dist/u_ratio,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude;\n#ifdef TERRAIN3D\nv_gamma_scale=1.0;\n#else\nfloat extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length(projected_extrude.xy/gl_Position.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective;\n#endif\nv_width2=vec2(outset,inset);}"),linePattern:wn("#ifdef GL_ES\nprecision highp float;\n#endif\nuniform lowp float u_device_pixel_ratio;uniform vec2 u_texsize;uniform float u_fade;uniform mediump vec3 u_scale;uniform sampler2D u_image;varying vec2 v_normal;varying vec2 v_width2;varying float v_linesofar;varying float v_gamma_scale;varying float v_width;\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\n#pragma mapbox: define lowp float pixel_ratio_from\n#pragma mapbox: define lowp float pixel_ratio_to\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\n#pragma mapbox: initialize lowp float pixel_ratio_from\n#pragma mapbox: initialize lowp float pixel_ratio_to\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float tileZoomRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;vec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;vec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to;vec2 pattern_size_a=vec2(display_size_a.x*fromScale/tileZoomRatio,display_size_a.y);vec2 pattern_size_b=vec2(display_size_b.x*toScale/tileZoomRatio,display_size_b.y);float aspect_a=display_size_a.y/v_width;float aspect_b=display_size_b.y/v_width;float dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);float x_a=mod(v_linesofar/pattern_size_a.x*aspect_a,1.0);float x_b=mod(v_linesofar/pattern_size_b.x*aspect_b,1.0);float y=0.5*v_normal.y+0.5;vec2 texel_size=1.0/u_texsize;vec2 pos_a=mix(pattern_tl_a*texel_size-texel_size,pattern_br_a*texel_size+texel_size,vec2(x_a,y));vec2 pos_b=mix(pattern_tl_b*texel_size-texel_size,pattern_br_b*texel_size+texel_size,vec2(x_b,y));vec4 color=mix(texture2D(u_image,pos_a),texture2D(u_image,pos_b),u_fade);gl_FragColor=color*alpha*opacity;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","\n#define scale 0.015873016\n#define LINE_DISTANCE_SCALE 2.0\nattribute vec2 a_pos_normal;attribute vec4 a_data;uniform mat4 u_matrix;uniform vec2 u_units_to_pixels;uniform mediump float u_ratio;uniform lowp float u_device_pixel_ratio;varying vec2 v_normal;varying vec2 v_width2;varying float v_linesofar;varying float v_gamma_scale;varying float v_width;\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp float offset\n#pragma mapbox: define mediump float gapwidth\n#pragma mapbox: define mediump float width\n#pragma mapbox: define lowp float floorwidth\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\n#pragma mapbox: define lowp float pixel_ratio_from\n#pragma mapbox: define lowp float pixel_ratio_to\nvoid main() {\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize lowp float offset\n#pragma mapbox: initialize mediump float gapwidth\n#pragma mapbox: initialize mediump float width\n#pragma mapbox: initialize lowp float floorwidth\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\n#pragma mapbox: initialize lowp float pixel_ratio_from\n#pragma mapbox: initialize lowp float pixel_ratio_to\nfloat ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;float a_linesofar=(floor(a_data.z/4.0)+a_data.w*64.0)*LINE_DISTANCE_SCALE;vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);vec4 projected_extrude=u_matrix*vec4(dist/u_ratio,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude;\n#ifdef TERRAIN3D\nv_gamma_scale=1.0;\n#else\nfloat extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length(projected_extrude.xy/gl_Position.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective;\n#endif\nv_linesofar=a_linesofar;v_width2=vec2(outset,inset);v_width=floorwidth;}"),lineSDF:wn("uniform lowp float u_device_pixel_ratio;uniform sampler2D u_image;uniform float u_sdfgamma;uniform float u_mix;varying vec2 v_normal;varying vec2 v_width2;varying vec2 v_tex_a;varying vec2 v_tex_b;varying float v_gamma_scale;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define mediump float width\n#pragma mapbox: define lowp float floorwidth\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump float width\n#pragma mapbox: initialize lowp float floorwidth\nfloat dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);float sdfdist_a=texture2D(u_image,v_tex_a).a;float sdfdist_b=texture2D(u_image,v_tex_b).a;float sdfdist=mix(sdfdist_a,sdfdist_b,u_mix);alpha*=smoothstep(0.5-u_sdfgamma/floorwidth,0.5+u_sdfgamma/floorwidth,sdfdist);gl_FragColor=color*(alpha*opacity);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","\n#define scale 0.015873016\n#define LINE_DISTANCE_SCALE 2.0\nattribute vec2 a_pos_normal;attribute vec4 a_data;uniform mat4 u_matrix;uniform mediump float u_ratio;uniform lowp float u_device_pixel_ratio;uniform vec2 u_patternscale_a;uniform float u_tex_y_a;uniform vec2 u_patternscale_b;uniform float u_tex_y_b;uniform vec2 u_units_to_pixels;varying vec2 v_normal;varying vec2 v_width2;varying vec2 v_tex_a;varying vec2 v_tex_b;varying float v_gamma_scale;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define mediump float gapwidth\n#pragma mapbox: define lowp float offset\n#pragma mapbox: define mediump float width\n#pragma mapbox: define lowp float floorwidth\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump float gapwidth\n#pragma mapbox: initialize lowp float offset\n#pragma mapbox: initialize mediump float width\n#pragma mapbox: initialize lowp float floorwidth\nfloat ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;float a_linesofar=(floor(a_data.z/4.0)+a_data.w*64.0)*LINE_DISTANCE_SCALE;vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);vec4 projected_extrude=u_matrix*vec4(dist/u_ratio,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude;\n#ifdef TERRAIN3D\nv_gamma_scale=1.0;\n#else\nfloat extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length(projected_extrude.xy/gl_Position.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective;\n#endif\nv_tex_a=vec2(a_linesofar*u_patternscale_a.x/floorwidth,normal.y*u_patternscale_a.y+u_tex_y_a);v_tex_b=vec2(a_linesofar*u_patternscale_b.x/floorwidth,normal.y*u_patternscale_b.y+u_tex_y_b);v_width2=vec2(outset,inset);}"),raster:wn("uniform float u_fade_t;uniform float u_opacity;uniform sampler2D u_image0;uniform sampler2D u_image1;varying vec2 v_pos0;varying vec2 v_pos1;uniform float u_brightness_low;uniform float u_brightness_high;uniform float u_saturation_factor;uniform float u_contrast_factor;uniform vec3 u_spin_weights;void main() {vec4 color0=texture2D(u_image0,v_pos0);vec4 color1=texture2D(u_image1,v_pos1);if (color0.a > 0.0) {color0.rgb=color0.rgb/color0.a;}if (color1.a > 0.0) {color1.rgb=color1.rgb/color1.a;}vec4 color=mix(color0,color1,u_fade_t);color.a*=u_opacity;vec3 rgb=color.rgb;rgb=vec3(dot(rgb,u_spin_weights.xyz),dot(rgb,u_spin_weights.zxy),dot(rgb,u_spin_weights.yzx));float average=(color.r+color.g+color.b)/3.0;rgb+=(average-rgb)*u_saturation_factor;rgb=(rgb-0.5)*u_contrast_factor+0.5;vec3 u_high_vec=vec3(u_brightness_low,u_brightness_low,u_brightness_low);vec3 u_low_vec=vec3(u_brightness_high,u_brightness_high,u_brightness_high);gl_FragColor=vec4(mix(u_high_vec,u_low_vec,rgb)*color.a,color.a);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform vec2 u_tl_parent;uniform float u_scale_parent;uniform float u_buffer_scale;attribute vec2 a_pos;attribute vec2 a_texture_pos;varying vec2 v_pos0;varying vec2 v_pos1;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);v_pos0=(((a_texture_pos/8192.0)-0.5)/u_buffer_scale )+0.5;v_pos1=(v_pos0*u_scale_parent)+u_tl_parent;}"),symbolIcon:wn("uniform sampler2D u_texture;varying vec2 v_tex;varying float v_fade_opacity;\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\nlowp float alpha=opacity*v_fade_opacity;gl_FragColor=texture2D(u_texture,v_tex)*alpha;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","const float PI=3.141592653589793;attribute vec4 a_pos_offset;attribute vec4 a_data;attribute vec4 a_pixeloffset;attribute vec3 a_projected_pos;attribute float a_fade_opacity;uniform bool u_is_size_zoom_constant;uniform bool u_is_size_feature_constant;uniform highp float u_size_t;uniform highp float u_size;uniform highp float u_camera_to_center_distance;uniform highp float u_pitch;uniform bool u_rotate_symbol;uniform highp float u_aspect_ratio;uniform float u_fade_change;uniform mat4 u_matrix;uniform mat4 u_label_plane_matrix;uniform mat4 u_coord_matrix;uniform bool u_is_text;uniform bool u_pitch_with_map;uniform vec2 u_texsize;varying vec2 v_tex;varying float v_fade_opacity;\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\nvec2 a_pos=a_pos_offset.xy;vec2 a_offset=a_pos_offset.zw;vec2 a_tex=a_data.xy;vec2 a_size=a_data.zw;float a_size_min=floor(a_size[0]*0.5);vec2 a_pxoffset=a_pixeloffset.xy;vec2 a_minFontScale=a_pixeloffset.zw/256.0;float ele=get_elevation(a_pos);highp float segment_angle=-a_projected_pos[2];float size;if (!u_is_size_zoom_constant && !u_is_size_feature_constant) {size=mix(a_size_min,a_size[1],u_size_t)/128.0;} else if (u_is_size_zoom_constant && !u_is_size_feature_constant) {size=a_size_min/128.0;} else {size=u_size;}vec4 projectedPoint=u_matrix*vec4(a_pos,ele,1);highp float camera_to_anchor_distance=projectedPoint.w;highp float distance_ratio=u_pitch_with_map ?\ncamera_to_anchor_distance/u_camera_to_center_distance :\nu_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp(0.5+0.5*distance_ratio,0.0,4.0);size*=perspective_ratio;float fontScale=u_is_text ? size/24.0 : size;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offsetProjectedPoint=u_matrix*vec4(a_pos+vec2(1,0),ele,1);vec2 a=projectedPoint.xy/projectedPoint.w;vec2 b=offsetProjectedPoint.xy/offsetProjectedPoint.w;symbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);}highp float angle_sin=sin(segment_angle+symbol_rotation);highp float angle_cos=cos(segment_angle+symbol_rotation);mat2 rotation_matrix=mat2(angle_cos,-1.0*angle_sin,angle_sin,angle_cos);vec4 projected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy,ele,1.0);float z=float(u_pitch_with_map)*projected_pos.z/projected_pos.w;gl_Position=u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+rotation_matrix*(a_offset/32.0*max(a_minFontScale,fontScale)+a_pxoffset/16.0),z,1.0);v_tex=a_tex/u_texsize;vec2 fade_opacity=unpack_opacity(a_fade_opacity);float fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;float visibility=calculate_visibility(projectedPoint);v_fade_opacity=max(0.0,min(visibility,fade_opacity[0]+fade_change));}"),symbolSDF:wn("#define SDF_PX 8.0\nuniform bool u_is_halo;uniform sampler2D u_texture;uniform highp float u_gamma_scale;uniform lowp float u_device_pixel_ratio;uniform bool u_is_text;varying vec2 v_data0;varying vec3 v_data1;\n#pragma mapbox: define highp vec4 fill_color\n#pragma mapbox: define highp vec4 halo_color\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp float halo_width\n#pragma mapbox: define lowp float halo_blur\nvoid main() {\n#pragma mapbox: initialize highp vec4 fill_color\n#pragma mapbox: initialize highp vec4 halo_color\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize lowp float halo_width\n#pragma mapbox: initialize lowp float halo_blur\nfloat EDGE_GAMMA=0.105/u_device_pixel_ratio;vec2 tex=v_data0.xy;float gamma_scale=v_data1.x;float size=v_data1.y;float fade_opacity=v_data1[2];float fontScale=u_is_text ? size/24.0 : size;lowp vec4 color=fill_color;highp float gamma=EDGE_GAMMA/(fontScale*u_gamma_scale);lowp float buff=(256.0-64.0)/256.0;if (u_is_halo) {color=halo_color;gamma=(halo_blur*1.19/SDF_PX+EDGE_GAMMA)/(fontScale*u_gamma_scale);buff=(6.0-halo_width/fontScale)/SDF_PX;}lowp float dist=texture2D(u_texture,tex).a;highp float gamma_scaled=gamma*gamma_scale;highp float alpha=smoothstep(buff-gamma_scaled,buff+gamma_scaled,dist);gl_FragColor=color*(alpha*opacity*fade_opacity);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","const float PI=3.141592653589793;attribute vec4 a_pos_offset;attribute vec4 a_data;attribute vec4 a_pixeloffset;attribute vec3 a_projected_pos;attribute float a_fade_opacity;uniform bool u_is_size_zoom_constant;uniform bool u_is_size_feature_constant;uniform highp float u_size_t;uniform highp float u_size;uniform mat4 u_matrix;uniform mat4 u_label_plane_matrix;uniform mat4 u_coord_matrix;uniform bool u_is_text;uniform bool u_pitch_with_map;uniform highp float u_pitch;uniform bool u_rotate_symbol;uniform highp float u_aspect_ratio;uniform highp float u_camera_to_center_distance;uniform float u_fade_change;uniform vec2 u_texsize;varying vec2 v_data0;varying vec3 v_data1;\n#pragma mapbox: define highp vec4 fill_color\n#pragma mapbox: define highp vec4 halo_color\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp float halo_width\n#pragma mapbox: define lowp float halo_blur\nvoid main() {\n#pragma mapbox: initialize highp vec4 fill_color\n#pragma mapbox: initialize highp vec4 halo_color\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize lowp float halo_width\n#pragma mapbox: initialize lowp float halo_blur\nvec2 a_pos=a_pos_offset.xy;vec2 a_offset=a_pos_offset.zw;vec2 a_tex=a_data.xy;vec2 a_size=a_data.zw;float a_size_min=floor(a_size[0]*0.5);vec2 a_pxoffset=a_pixeloffset.xy;float ele=get_elevation(a_pos);highp float segment_angle=-a_projected_pos[2];float size;if (!u_is_size_zoom_constant && !u_is_size_feature_constant) {size=mix(a_size_min,a_size[1],u_size_t)/128.0;} else if (u_is_size_zoom_constant && !u_is_size_feature_constant) {size=a_size_min/128.0;} else {size=u_size;}vec4 projectedPoint=u_matrix*vec4(a_pos,ele,1);highp float camera_to_anchor_distance=projectedPoint.w;highp float distance_ratio=u_pitch_with_map ?\ncamera_to_anchor_distance/u_camera_to_center_distance :\nu_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp(0.5+0.5*distance_ratio,0.0,4.0);size*=perspective_ratio;float fontScale=u_is_text ? size/24.0 : size;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offsetProjectedPoint=u_matrix*vec4(a_pos+vec2(1,0),ele,1);vec2 a=projectedPoint.xy/projectedPoint.w;vec2 b=offsetProjectedPoint.xy/offsetProjectedPoint.w;symbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);}highp float angle_sin=sin(segment_angle+symbol_rotation);highp float angle_cos=cos(segment_angle+symbol_rotation);mat2 rotation_matrix=mat2(angle_cos,-1.0*angle_sin,angle_sin,angle_cos);vec4 projected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy,ele,1.0);float z=float(u_pitch_with_map)*projected_pos.z/projected_pos.w;gl_Position=u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+rotation_matrix*(a_offset/32.0*fontScale+a_pxoffset),z,1.0);float gamma_scale=gl_Position.w;vec2 fade_opacity=unpack_opacity(a_fade_opacity);float visibility=calculate_visibility(projectedPoint);float fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;float interpolated_fade_opacity=max(0.0,min(visibility,fade_opacity[0]+fade_change));v_data0=a_tex/u_texsize;v_data1=vec3(gamma_scale,size,interpolated_fade_opacity);}"),symbolTextAndIcon:wn("#define SDF_PX 8.0\n#define SDF 1.0\n#define ICON 0.0\nuniform bool u_is_halo;uniform sampler2D u_texture;uniform sampler2D u_texture_icon;uniform highp float u_gamma_scale;uniform lowp float u_device_pixel_ratio;varying vec4 v_data0;varying vec4 v_data1;\n#pragma mapbox: define highp vec4 fill_color\n#pragma mapbox: define highp vec4 halo_color\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp float halo_width\n#pragma mapbox: define lowp float halo_blur\nvoid main() {\n#pragma mapbox: initialize highp vec4 fill_color\n#pragma mapbox: initialize highp vec4 halo_color\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize lowp float halo_width\n#pragma mapbox: initialize lowp float halo_blur\nfloat fade_opacity=v_data1[2];if (v_data1.w==ICON) {vec2 tex_icon=v_data0.zw;lowp float alpha=opacity*fade_opacity;gl_FragColor=texture2D(u_texture_icon,tex_icon)*alpha;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\nreturn;}vec2 tex=v_data0.xy;float EDGE_GAMMA=0.105/u_device_pixel_ratio;float gamma_scale=v_data1.x;float size=v_data1.y;float fontScale=size/24.0;lowp vec4 color=fill_color;highp float gamma=EDGE_GAMMA/(fontScale*u_gamma_scale);lowp float buff=(256.0-64.0)/256.0;if (u_is_halo) {color=halo_color;gamma=(halo_blur*1.19/SDF_PX+EDGE_GAMMA)/(fontScale*u_gamma_scale);buff=(6.0-halo_width/fontScale)/SDF_PX;}lowp float dist=texture2D(u_texture,tex).a;highp float gamma_scaled=gamma*gamma_scale;highp float alpha=smoothstep(buff-gamma_scaled,buff+gamma_scaled,dist);gl_FragColor=color*(alpha*opacity*fade_opacity);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","const float PI=3.141592653589793;attribute vec4 a_pos_offset;attribute vec4 a_data;attribute vec3 a_projected_pos;attribute float a_fade_opacity;uniform bool u_is_size_zoom_constant;uniform bool u_is_size_feature_constant;uniform highp float u_size_t;uniform highp float u_size;uniform mat4 u_matrix;uniform mat4 u_label_plane_matrix;uniform mat4 u_coord_matrix;uniform bool u_is_text;uniform bool u_pitch_with_map;uniform highp float u_pitch;uniform bool u_rotate_symbol;uniform highp float u_aspect_ratio;uniform highp float u_camera_to_center_distance;uniform float u_fade_change;uniform vec2 u_texsize;uniform vec2 u_texsize_icon;varying vec4 v_data0;varying vec4 v_data1;\n#pragma mapbox: define highp vec4 fill_color\n#pragma mapbox: define highp vec4 halo_color\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp float halo_width\n#pragma mapbox: define lowp float halo_blur\nvoid main() {\n#pragma mapbox: initialize highp vec4 fill_color\n#pragma mapbox: initialize highp vec4 halo_color\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize lowp float halo_width\n#pragma mapbox: initialize lowp float halo_blur\nvec2 a_pos=a_pos_offset.xy;vec2 a_offset=a_pos_offset.zw;vec2 a_tex=a_data.xy;vec2 a_size=a_data.zw;float a_size_min=floor(a_size[0]*0.5);float is_sdf=a_size[0]-2.0*a_size_min;float ele=get_elevation(a_pos);highp float segment_angle=-a_projected_pos[2];float size;if (!u_is_size_zoom_constant && !u_is_size_feature_constant) {size=mix(a_size_min,a_size[1],u_size_t)/128.0;} else if (u_is_size_zoom_constant && !u_is_size_feature_constant) {size=a_size_min/128.0;} else {size=u_size;}vec4 projectedPoint=u_matrix*vec4(a_pos,ele,1);highp float camera_to_anchor_distance=projectedPoint.w;highp float distance_ratio=u_pitch_with_map ?\ncamera_to_anchor_distance/u_camera_to_center_distance :\nu_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp(0.5+0.5*distance_ratio,0.0,4.0);size*=perspective_ratio;float fontScale=size/24.0;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offsetProjectedPoint=u_matrix*vec4(a_pos+vec2(1,0),ele,1);vec2 a=projectedPoint.xy/projectedPoint.w;vec2 b=offsetProjectedPoint.xy/offsetProjectedPoint.w;symbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);}highp float angle_sin=sin(segment_angle+symbol_rotation);highp float angle_cos=cos(segment_angle+symbol_rotation);mat2 rotation_matrix=mat2(angle_cos,-1.0*angle_sin,angle_sin,angle_cos);vec4 projected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy,ele,1.0);float z=float(u_pitch_with_map)*projected_pos.z/projected_pos.w;gl_Position=u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+rotation_matrix*(a_offset/32.0*fontScale),z,1.0);float gamma_scale=gl_Position.w;vec2 fade_opacity=unpack_opacity(a_fade_opacity);float visibility=calculate_visibility(projectedPoint);float fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;float interpolated_fade_opacity=max(0.0,min(visibility,fade_opacity[0]+fade_change));v_data0.xy=a_tex/u_texsize;v_data0.zw=a_tex/u_texsize_icon;v_data1=vec4(gamma_scale,size,interpolated_fade_opacity,is_sdf);}"),terrain:wn("uniform sampler2D u_texture;varying vec2 v_texture_pos;void main() {gl_FragColor=texture2D(u_texture,v_texture_pos);}",Ff),terrainDepth:wn("varying float v_depth;const highp vec4 bitSh=vec4(256.*256.*256.,256.*256.,256.,1.);const highp vec4 bitMsk=vec4(0.,vec3(1./256.0));highp vec4 pack(highp float value) {highp vec4 comp=fract(value*bitSh);comp-=comp.xxyz*bitMsk;return comp;}void main() {gl_FragColor=pack(v_depth);}",Ff),terrainCoords:wn("precision mediump float;uniform sampler2D u_texture;uniform float u_terrain_coords_id;varying vec2 v_texture_pos;void main() {vec4 rgba=texture2D(u_texture,v_texture_pos);gl_FragColor=vec4(rgba.r,rgba.g,rgba.b,u_terrain_coords_id);}",Ff)};function wn(g,a){const h=/#pragma mapbox: ([\w]+) ([\w]+) ([\w]+) ([\w]+)/g,m=a.match(/attribute ([\w]+) ([\w]+)/g),y=g.match(/uniform ([\w]+) ([\w]+)([\s]*)([\w]*)/g),w=a.match(/uniform ([\w]+) ([\w]+)([\s]*)([\w]*)/g),S=w?w.concat(y):y,T={};return{fragmentSource:g=g.replace(h,(k,R,z,L,j)=>(T[j]=!0,"define"===R?`\n#ifndef HAS_UNIFORM_u_${j}\nvarying ${z} ${L} ${j};\n#else\nuniform ${z} ${L} u_${j};\n#endif\n`:`\n#ifdef HAS_UNIFORM_u_${j}\n ${z} ${L} ${j} = u_${j};\n#endif\n`)),vertexSource:a=a.replace(h,(k,R,z,L,j)=>{const Q="float"===L?"vec2":"vec4",ee=j.match(/color/)?"color":Q;return T[j]?"define"===R?`\n#ifndef HAS_UNIFORM_u_${j}\nuniform lowp float u_${j}_t;\nattribute ${z} ${Q} a_${j};\nvarying ${z} ${L} ${j};\n#else\nuniform ${z} ${L} u_${j};\n#endif\n`:"vec4"===ee?`\n#ifndef HAS_UNIFORM_u_${j}\n ${j} = a_${j};\n#else\n ${z} ${L} ${j} = u_${j};\n#endif\n`:`\n#ifndef HAS_UNIFORM_u_${j}\n ${j} = unpack_mix_${ee}(a_${j}, u_${j}_t);\n#else\n ${z} ${L} ${j} = u_${j};\n#endif\n`:"define"===R?`\n#ifndef HAS_UNIFORM_u_${j}\nuniform lowp float u_${j}_t;\nattribute ${z} ${Q} a_${j};\n#else\nuniform ${z} ${L} u_${j};\n#endif\n`:"vec4"===ee?`\n#ifndef HAS_UNIFORM_u_${j}\n ${z} ${L} ${j} = a_${j};\n#else\n ${z} ${L} ${j} = u_${j};\n#endif\n`:`\n#ifndef HAS_UNIFORM_u_${j}\n ${z} ${L} ${j} = unpack_mix_${ee}(a_${j}, u_${j}_t);\n#else\n ${z} ${L} ${j} = u_${j};\n#endif\n`}),staticAttributes:m,staticUniforms:S}}class $t{constructor(){this.boundProgram=null,this.boundLayoutVertexBuffer=null,this.boundPaintVertexBuffers=[],this.boundIndexBuffer=null,this.boundVertexOffset=null,this.boundDynamicVertexBuffer=null,this.vao=null}bind(a,h,m,y,w,S,T,k,R){this.context=a;let z=this.boundPaintVertexBuffers.length!==y.length;for(let L=0;!z&&L>16,T>>16],u_pixel_coord_lower:[65535&S,65535&T]}}const Yh=(g,a,h,m)=>{const y=a.style.light,w=y.properties.get("position"),S=[w.x,w.y,w.z],T=(R=new b.ARRAY_TYPE(9),b.ARRAY_TYPE!=Float32Array&&(R[1]=0,R[2]=0,R[3]=0,R[5]=0,R[6]=0,R[7]=0),R[0]=1,R[4]=1,R[8]=1,R);var R;"viewport"===y.properties.get("anchor")&&function(R,z){var L=Math.sin(z),j=Math.cos(z);R[0]=j,R[1]=L,R[2]=0,R[3]=-L,R[4]=j,R[5]=0,R[6]=0,R[7]=0,R[8]=1}(T,-a.transform.angle),function(R,z,L){var j=z[0],Q=z[1],ee=z[2];R[0]=j*L[0]+Q*L[3]+ee*L[6],R[1]=j*L[1]+Q*L[4]+ee*L[7],R[2]=j*L[2]+Q*L[5]+ee*L[8]}(S,S,T);const k=y.properties.get("color");return{u_matrix:g,u_lightpos:S,u_lightintensity:y.properties.get("intensity"),u_lightcolor:[k.r,k.g,k.b],u_vertical_gradient:+h,u_opacity:m}},Nu=(g,a,h,m,y,w,S)=>b.extend(Yh(g,a,h,m),Of(w,a,S),{u_height_factor:-Math.pow(2,y.overscaledZ)/S.tileSize/8}),Wr=g=>({u_matrix:g}),Lc=(g,a,h,m)=>b.extend(Wr(g),Of(h,a,m)),Lf=(g,a)=>({u_matrix:g,u_world:a}),Io=(g,a,h,m,y)=>b.extend(Lc(g,a,h,m),{u_world:y}),Zo=(g,a,h,m)=>{const y=g.transform;let w,S;if("map"===m.paint.get("circle-pitch-alignment")){const T=Ie(h,1,y.zoom);w=!0,S=[T,T]}else w=!1,S=y.pixelsToGLUnits;return{u_camera_to_center_distance:y.cameraToCenterDistance,u_scale_with_map:+("map"===m.paint.get("circle-pitch-scale")),u_matrix:g.translatePosMatrix(a.posMatrix,h,m.paint.get("circle-translate"),m.paint.get("circle-translate-anchor")),u_pitch_with_map:+w,u_device_pixel_ratio:g.pixelRatio,u_extrude_scale:S}},Kh=(g,a,h)=>{const m=Ie(h,1,a.zoom),y=Math.pow(2,a.zoom-h.tileID.overscaledZ),w=h.tileID.overscaleFactor();return{u_matrix:g,u_camera_to_center_distance:a.cameraToCenterDistance,u_pixels_to_tile_units:m,u_extrude_scale:[a.pixelsToGLUnits[0]/(m*y),a.pixelsToGLUnits[1]/(m*y)],u_overscale_factor:w}},zu=(g,a,h=1)=>({u_matrix:g,u_color:a,u_overlay:0,u_overlay_scale:h}),Jh=g=>({u_matrix:g}),Nf=(g,a,h,m)=>({u_matrix:g,u_extrude_scale:Ie(a,1,h),u_intensity:m});function Bu(g,a){const h=Math.pow(2,a.canonical.z),m=a.canonical.y;return[new b.MercatorCoordinate(0,m/h).toLngLat().lat,new b.MercatorCoordinate(0,(m+1)/h).toLngLat().lat]}const Vu=(g,a,h,m)=>{const y=g.transform;return{u_matrix:Ul(g,a,h,m),u_ratio:1/Ie(a,1,y.zoom),u_device_pixel_ratio:g.pixelRatio,u_units_to_pixels:[1/y.pixelsToGLUnits[0],1/y.pixelsToGLUnits[1]]}},Qh=(g,a,h,m,y)=>b.extend(Vu(g,a,h,y),{u_image:0,u_image_height:m}),ed=(g,a,h,m,y)=>{const w=g.transform,S=Rn(a,w);return{u_matrix:Ul(g,a,h,y),u_texsize:a.imageAtlasTexture.size,u_ratio:1/Ie(a,1,w.zoom),u_device_pixel_ratio:g.pixelRatio,u_image:0,u_scale:[S,m.fromScale,m.toScale],u_fade:m.t,u_units_to_pixels:[1/w.pixelsToGLUnits[0],1/w.pixelsToGLUnits[1]]}},Ui=(g,a,h,m,y,w)=>{const S=g.lineAtlas,T=Rn(a,g.transform),k="round"===h.layout.get("line-cap"),R=S.getDash(m.from,k),z=S.getDash(m.to,k),L=R.width*y.fromScale,j=z.width*y.toScale;return b.extend(Vu(g,a,h,w),{u_patternscale_a:[T/L,-R.height/2],u_patternscale_b:[T/j,-z.height/2],u_sdfgamma:S.width/(256*Math.min(L,j)*g.pixelRatio)/2,u_image:0,u_tex_y_a:R.y,u_tex_y_b:z.y,u_mix:y.t})};function Rn(g,a){return 1/Ie(g,1,a.tileZoom)}function Ul(g,a,h,m){return g.translatePosMatrix(m?m.posMatrix:a.tileID.posMatrix,a,h.paint.get("line-translate"),h.paint.get("line-translate-anchor"))}const I_=(g,a,h,m,y)=>{return{u_matrix:g,u_tl_parent:a,u_scale_parent:h,u_buffer_scale:1,u_fade_t:m.mix,u_opacity:m.opacity*y.paint.get("raster-opacity"),u_image0:0,u_image1:1,u_brightness_low:y.paint.get("raster-brightness-min"),u_brightness_high:y.paint.get("raster-brightness-max"),u_saturation_factor:(S=y.paint.get("raster-saturation"),S>0?1-1/(1.001-S):-S),u_contrast_factor:(w=y.paint.get("raster-contrast"),w>0?1/(1-w):1+w),u_spin_weights:T_(y.paint.get("raster-hue-rotate"))};var w,S};function T_(g){g*=Math.PI/180;const a=Math.sin(g),h=Math.cos(g);return[(2*h+1)/3,(-Math.sqrt(3)*a-h+1)/3,(Math.sqrt(3)*a-h+1)/3]}const Ot=(g,a,h,m,y,w,S,T,k,R)=>{const z=y.transform;return{u_is_size_zoom_constant:+("constant"===g||"source"===g),u_is_size_feature_constant:+("constant"===g||"camera"===g),u_size_t:a?a.uSizeT:0,u_size:a?a.uSize:0,u_camera_to_center_distance:z.cameraToCenterDistance,u_pitch:z.pitch/360*2*Math.PI,u_rotate_symbol:+h,u_aspect_ratio:z.width/z.height,u_fade_change:y.options.fadeDuration?y.symbolFadeChange:1,u_matrix:w,u_label_plane_matrix:S,u_coord_matrix:T,u_is_text:+k,u_pitch_with_map:+m,u_texsize:R,u_texture:0}},Vm=(g,a,h,m,y,w,S,T,k,R,z)=>{const L=y.transform;return b.extend(Ot(g,a,h,m,y,w,S,T,k,R),{u_gamma_scale:m?Math.cos(L._pitch)*L.cameraToCenterDistance:1,u_device_pixel_ratio:y.pixelRatio,u_is_halo:+z})},Ei=(g,a,h,m,y,w,S,T,k,R)=>b.extend(Vm(g,a,h,m,y,w,S,T,!0,k,!0),{u_texsize_icon:R,u_texture_icon:1}),Uu=(g,a,h)=>({u_matrix:g,u_opacity:a,u_color:h}),td=(g,a,h,m,y,w)=>b.extend(function(S,T,k,R){const z=k.imageManager.getPattern(S.from.toString()),L=k.imageManager.getPattern(S.to.toString()),{width:j,height:Q}=k.imageManager.getPixelSize(),ee=Math.pow(2,R.tileID.overscaledZ),Y=R.tileSize*Math.pow(2,k.transform.tileZoom)/ee,ae=Y*(R.tileID.canonical.x+R.tileID.wrap*ee),_e=Y*R.tileID.canonical.y;return{u_image:0,u_pattern_tl_a:z.tl,u_pattern_br_a:z.br,u_pattern_tl_b:L.tl,u_pattern_br_b:L.br,u_texsize:[j,Q],u_mix:T.t,u_pattern_size_a:z.displaySize,u_pattern_size_b:L.displaySize,u_scale_a:T.fromScale,u_scale_b:T.toScale,u_tile_units_to_pixels:1/Ie(R,1,k.transform.tileZoom),u_pixel_coord_upper:[ae>>16,_e>>16],u_pixel_coord_lower:[65535&ae,65535&_e]}}(m,w,h,y),{u_matrix:g,u_opacity:a}),Nc={fillExtrusion:(g,a)=>({u_matrix:new b.UniformMatrix4f(g,a.u_matrix),u_lightpos:new b.Uniform3f(g,a.u_lightpos),u_lightintensity:new b.Uniform1f(g,a.u_lightintensity),u_lightcolor:new b.Uniform3f(g,a.u_lightcolor),u_vertical_gradient:new b.Uniform1f(g,a.u_vertical_gradient),u_opacity:new b.Uniform1f(g,a.u_opacity)}),fillExtrusionPattern:(g,a)=>({u_matrix:new b.UniformMatrix4f(g,a.u_matrix),u_lightpos:new b.Uniform3f(g,a.u_lightpos),u_lightintensity:new b.Uniform1f(g,a.u_lightintensity),u_lightcolor:new b.Uniform3f(g,a.u_lightcolor),u_vertical_gradient:new b.Uniform1f(g,a.u_vertical_gradient),u_height_factor:new b.Uniform1f(g,a.u_height_factor),u_image:new b.Uniform1i(g,a.u_image),u_texsize:new b.Uniform2f(g,a.u_texsize),u_pixel_coord_upper:new b.Uniform2f(g,a.u_pixel_coord_upper),u_pixel_coord_lower:new b.Uniform2f(g,a.u_pixel_coord_lower),u_scale:new b.Uniform3f(g,a.u_scale),u_fade:new b.Uniform1f(g,a.u_fade),u_opacity:new b.Uniform1f(g,a.u_opacity)}),fill:(g,a)=>({u_matrix:new b.UniformMatrix4f(g,a.u_matrix)}),fillPattern:(g,a)=>({u_matrix:new b.UniformMatrix4f(g,a.u_matrix),u_image:new b.Uniform1i(g,a.u_image),u_texsize:new b.Uniform2f(g,a.u_texsize),u_pixel_coord_upper:new b.Uniform2f(g,a.u_pixel_coord_upper),u_pixel_coord_lower:new b.Uniform2f(g,a.u_pixel_coord_lower),u_scale:new b.Uniform3f(g,a.u_scale),u_fade:new b.Uniform1f(g,a.u_fade)}),fillOutline:(g,a)=>({u_matrix:new b.UniformMatrix4f(g,a.u_matrix),u_world:new b.Uniform2f(g,a.u_world)}),fillOutlinePattern:(g,a)=>({u_matrix:new b.UniformMatrix4f(g,a.u_matrix),u_world:new b.Uniform2f(g,a.u_world),u_image:new b.Uniform1i(g,a.u_image),u_texsize:new b.Uniform2f(g,a.u_texsize),u_pixel_coord_upper:new b.Uniform2f(g,a.u_pixel_coord_upper),u_pixel_coord_lower:new b.Uniform2f(g,a.u_pixel_coord_lower),u_scale:new b.Uniform3f(g,a.u_scale),u_fade:new b.Uniform1f(g,a.u_fade)}),circle:(g,a)=>({u_camera_to_center_distance:new b.Uniform1f(g,a.u_camera_to_center_distance),u_scale_with_map:new b.Uniform1i(g,a.u_scale_with_map),u_pitch_with_map:new b.Uniform1i(g,a.u_pitch_with_map),u_extrude_scale:new b.Uniform2f(g,a.u_extrude_scale),u_device_pixel_ratio:new b.Uniform1f(g,a.u_device_pixel_ratio),u_matrix:new b.UniformMatrix4f(g,a.u_matrix)}),collisionBox:(g,a)=>({u_matrix:new b.UniformMatrix4f(g,a.u_matrix),u_camera_to_center_distance:new b.Uniform1f(g,a.u_camera_to_center_distance),u_pixels_to_tile_units:new b.Uniform1f(g,a.u_pixels_to_tile_units),u_extrude_scale:new b.Uniform2f(g,a.u_extrude_scale),u_overscale_factor:new b.Uniform1f(g,a.u_overscale_factor)}),collisionCircle:(g,a)=>({u_matrix:new b.UniformMatrix4f(g,a.u_matrix),u_inv_matrix:new b.UniformMatrix4f(g,a.u_inv_matrix),u_camera_to_center_distance:new b.Uniform1f(g,a.u_camera_to_center_distance),u_viewport_size:new b.Uniform2f(g,a.u_viewport_size)}),debug:(g,a)=>({u_color:new b.UniformColor(g,a.u_color),u_matrix:new b.UniformMatrix4f(g,a.u_matrix),u_overlay:new b.Uniform1i(g,a.u_overlay),u_overlay_scale:new b.Uniform1f(g,a.u_overlay_scale)}),clippingMask:(g,a)=>({u_matrix:new b.UniformMatrix4f(g,a.u_matrix)}),heatmap:(g,a)=>({u_extrude_scale:new b.Uniform1f(g,a.u_extrude_scale),u_intensity:new b.Uniform1f(g,a.u_intensity),u_matrix:new b.UniformMatrix4f(g,a.u_matrix)}),heatmapTexture:(g,a)=>({u_matrix:new b.UniformMatrix4f(g,a.u_matrix),u_world:new b.Uniform2f(g,a.u_world),u_image:new b.Uniform1i(g,a.u_image),u_color_ramp:new b.Uniform1i(g,a.u_color_ramp),u_opacity:new b.Uniform1f(g,a.u_opacity)}),hillshade:(g,a)=>({u_matrix:new b.UniformMatrix4f(g,a.u_matrix),u_image:new b.Uniform1i(g,a.u_image),u_latrange:new b.Uniform2f(g,a.u_latrange),u_light:new b.Uniform2f(g,a.u_light),u_shadow:new b.UniformColor(g,a.u_shadow),u_highlight:new b.UniformColor(g,a.u_highlight),u_accent:new b.UniformColor(g,a.u_accent)}),hillshadePrepare:(g,a)=>({u_matrix:new b.UniformMatrix4f(g,a.u_matrix),u_image:new b.Uniform1i(g,a.u_image),u_dimension:new b.Uniform2f(g,a.u_dimension),u_zoom:new b.Uniform1f(g,a.u_zoom),u_unpack:new b.Uniform4f(g,a.u_unpack)}),line:(g,a)=>({u_matrix:new b.UniformMatrix4f(g,a.u_matrix),u_ratio:new b.Uniform1f(g,a.u_ratio),u_device_pixel_ratio:new b.Uniform1f(g,a.u_device_pixel_ratio),u_units_to_pixels:new b.Uniform2f(g,a.u_units_to_pixels)}),lineGradient:(g,a)=>({u_matrix:new b.UniformMatrix4f(g,a.u_matrix),u_ratio:new b.Uniform1f(g,a.u_ratio),u_device_pixel_ratio:new b.Uniform1f(g,a.u_device_pixel_ratio),u_units_to_pixels:new b.Uniform2f(g,a.u_units_to_pixels),u_image:new b.Uniform1i(g,a.u_image),u_image_height:new b.Uniform1f(g,a.u_image_height)}),linePattern:(g,a)=>({u_matrix:new b.UniformMatrix4f(g,a.u_matrix),u_texsize:new b.Uniform2f(g,a.u_texsize),u_ratio:new b.Uniform1f(g,a.u_ratio),u_device_pixel_ratio:new b.Uniform1f(g,a.u_device_pixel_ratio),u_image:new b.Uniform1i(g,a.u_image),u_units_to_pixels:new b.Uniform2f(g,a.u_units_to_pixels),u_scale:new b.Uniform3f(g,a.u_scale),u_fade:new b.Uniform1f(g,a.u_fade)}),lineSDF:(g,a)=>({u_matrix:new b.UniformMatrix4f(g,a.u_matrix),u_ratio:new b.Uniform1f(g,a.u_ratio),u_device_pixel_ratio:new b.Uniform1f(g,a.u_device_pixel_ratio),u_units_to_pixels:new b.Uniform2f(g,a.u_units_to_pixels),u_patternscale_a:new b.Uniform2f(g,a.u_patternscale_a),u_patternscale_b:new b.Uniform2f(g,a.u_patternscale_b),u_sdfgamma:new b.Uniform1f(g,a.u_sdfgamma),u_image:new b.Uniform1i(g,a.u_image),u_tex_y_a:new b.Uniform1f(g,a.u_tex_y_a),u_tex_y_b:new b.Uniform1f(g,a.u_tex_y_b),u_mix:new b.Uniform1f(g,a.u_mix)}),raster:(g,a)=>({u_matrix:new b.UniformMatrix4f(g,a.u_matrix),u_tl_parent:new b.Uniform2f(g,a.u_tl_parent),u_scale_parent:new b.Uniform1f(g,a.u_scale_parent),u_buffer_scale:new b.Uniform1f(g,a.u_buffer_scale),u_fade_t:new b.Uniform1f(g,a.u_fade_t),u_opacity:new b.Uniform1f(g,a.u_opacity),u_image0:new b.Uniform1i(g,a.u_image0),u_image1:new b.Uniform1i(g,a.u_image1),u_brightness_low:new b.Uniform1f(g,a.u_brightness_low),u_brightness_high:new b.Uniform1f(g,a.u_brightness_high),u_saturation_factor:new b.Uniform1f(g,a.u_saturation_factor),u_contrast_factor:new b.Uniform1f(g,a.u_contrast_factor),u_spin_weights:new b.Uniform3f(g,a.u_spin_weights)}),symbolIcon:(g,a)=>({u_is_size_zoom_constant:new b.Uniform1i(g,a.u_is_size_zoom_constant),u_is_size_feature_constant:new b.Uniform1i(g,a.u_is_size_feature_constant),u_size_t:new b.Uniform1f(g,a.u_size_t),u_size:new b.Uniform1f(g,a.u_size),u_camera_to_center_distance:new b.Uniform1f(g,a.u_camera_to_center_distance),u_pitch:new b.Uniform1f(g,a.u_pitch),u_rotate_symbol:new b.Uniform1i(g,a.u_rotate_symbol),u_aspect_ratio:new b.Uniform1f(g,a.u_aspect_ratio),u_fade_change:new b.Uniform1f(g,a.u_fade_change),u_matrix:new b.UniformMatrix4f(g,a.u_matrix),u_label_plane_matrix:new b.UniformMatrix4f(g,a.u_label_plane_matrix),u_coord_matrix:new b.UniformMatrix4f(g,a.u_coord_matrix),u_is_text:new b.Uniform1i(g,a.u_is_text),u_pitch_with_map:new b.Uniform1i(g,a.u_pitch_with_map),u_texsize:new b.Uniform2f(g,a.u_texsize),u_texture:new b.Uniform1i(g,a.u_texture)}),symbolSDF:(g,a)=>({u_is_size_zoom_constant:new b.Uniform1i(g,a.u_is_size_zoom_constant),u_is_size_feature_constant:new b.Uniform1i(g,a.u_is_size_feature_constant),u_size_t:new b.Uniform1f(g,a.u_size_t),u_size:new b.Uniform1f(g,a.u_size),u_camera_to_center_distance:new b.Uniform1f(g,a.u_camera_to_center_distance),u_pitch:new b.Uniform1f(g,a.u_pitch),u_rotate_symbol:new b.Uniform1i(g,a.u_rotate_symbol),u_aspect_ratio:new b.Uniform1f(g,a.u_aspect_ratio),u_fade_change:new b.Uniform1f(g,a.u_fade_change),u_matrix:new b.UniformMatrix4f(g,a.u_matrix),u_label_plane_matrix:new b.UniformMatrix4f(g,a.u_label_plane_matrix),u_coord_matrix:new b.UniformMatrix4f(g,a.u_coord_matrix),u_is_text:new b.Uniform1i(g,a.u_is_text),u_pitch_with_map:new b.Uniform1i(g,a.u_pitch_with_map),u_texsize:new b.Uniform2f(g,a.u_texsize),u_texture:new b.Uniform1i(g,a.u_texture),u_gamma_scale:new b.Uniform1f(g,a.u_gamma_scale),u_device_pixel_ratio:new b.Uniform1f(g,a.u_device_pixel_ratio),u_is_halo:new b.Uniform1i(g,a.u_is_halo)}),symbolTextAndIcon:(g,a)=>({u_is_size_zoom_constant:new b.Uniform1i(g,a.u_is_size_zoom_constant),u_is_size_feature_constant:new b.Uniform1i(g,a.u_is_size_feature_constant),u_size_t:new b.Uniform1f(g,a.u_size_t),u_size:new b.Uniform1f(g,a.u_size),u_camera_to_center_distance:new b.Uniform1f(g,a.u_camera_to_center_distance),u_pitch:new b.Uniform1f(g,a.u_pitch),u_rotate_symbol:new b.Uniform1i(g,a.u_rotate_symbol),u_aspect_ratio:new b.Uniform1f(g,a.u_aspect_ratio),u_fade_change:new b.Uniform1f(g,a.u_fade_change),u_matrix:new b.UniformMatrix4f(g,a.u_matrix),u_label_plane_matrix:new b.UniformMatrix4f(g,a.u_label_plane_matrix),u_coord_matrix:new b.UniformMatrix4f(g,a.u_coord_matrix),u_is_text:new b.Uniform1i(g,a.u_is_text),u_pitch_with_map:new b.Uniform1i(g,a.u_pitch_with_map),u_texsize:new b.Uniform2f(g,a.u_texsize),u_texsize_icon:new b.Uniform2f(g,a.u_texsize_icon),u_texture:new b.Uniform1i(g,a.u_texture),u_texture_icon:new b.Uniform1i(g,a.u_texture_icon),u_gamma_scale:new b.Uniform1f(g,a.u_gamma_scale),u_device_pixel_ratio:new b.Uniform1f(g,a.u_device_pixel_ratio),u_is_halo:new b.Uniform1i(g,a.u_is_halo)}),background:(g,a)=>({u_matrix:new b.UniformMatrix4f(g,a.u_matrix),u_opacity:new b.Uniform1f(g,a.u_opacity),u_color:new b.UniformColor(g,a.u_color)}),backgroundPattern:(g,a)=>({u_matrix:new b.UniformMatrix4f(g,a.u_matrix),u_opacity:new b.Uniform1f(g,a.u_opacity),u_image:new b.Uniform1i(g,a.u_image),u_pattern_tl_a:new b.Uniform2f(g,a.u_pattern_tl_a),u_pattern_br_a:new b.Uniform2f(g,a.u_pattern_br_a),u_pattern_tl_b:new b.Uniform2f(g,a.u_pattern_tl_b),u_pattern_br_b:new b.Uniform2f(g,a.u_pattern_br_b),u_texsize:new b.Uniform2f(g,a.u_texsize),u_mix:new b.Uniform1f(g,a.u_mix),u_pattern_size_a:new b.Uniform2f(g,a.u_pattern_size_a),u_pattern_size_b:new b.Uniform2f(g,a.u_pattern_size_b),u_scale_a:new b.Uniform1f(g,a.u_scale_a),u_scale_b:new b.Uniform1f(g,a.u_scale_b),u_pixel_coord_upper:new b.Uniform2f(g,a.u_pixel_coord_upper),u_pixel_coord_lower:new b.Uniform2f(g,a.u_pixel_coord_lower),u_tile_units_to_pixels:new b.Uniform1f(g,a.u_tile_units_to_pixels)}),terrain:(g,a)=>({u_matrix:new b.UniformMatrix4f(g,a.u_matrix),u_texture:new b.Uniform1i(g,a.u_texture),u_ele_delta:new b.Uniform1f(g,a.u_ele_delta)}),terrainDepth:(g,a)=>({u_matrix:new b.UniformMatrix4f(g,a.u_matrix),u_ele_delta:new b.Uniform1f(g,a.u_ele_delta)}),terrainCoords:(g,a)=>({u_matrix:new b.UniformMatrix4f(g,a.u_matrix),u_texture:new b.Uniform1i(g,a.u_texture),u_terrain_coords_id:new b.Uniform1f(g,a.u_terrain_coords_id),u_ele_delta:new b.Uniform1f(g,a.u_ele_delta)})};class nd{constructor(a,h,m){this.context=a;const y=a.gl;this.buffer=y.createBuffer(),this.dynamicDraw=Boolean(m),this.context.unbindVAO(),a.bindElementBuffer.set(this.buffer),y.bufferData(y.ELEMENT_ARRAY_BUFFER,h.arrayBuffer,this.dynamicDraw?y.DYNAMIC_DRAW:y.STATIC_DRAW),this.dynamicDraw||delete h.arrayBuffer}bind(){this.context.bindElementBuffer.set(this.buffer)}updateData(a){const h=this.context.gl;if(!this.dynamicDraw)throw new Error("Attempted to update data while not in dynamic mode.");this.context.unbindVAO(),this.bind(),h.bufferSubData(h.ELEMENT_ARRAY_BUFFER,0,a.arrayBuffer)}destroy(){this.buffer&&(this.context.gl.deleteBuffer(this.buffer),delete this.buffer)}}const rd={Int8:"BYTE",Uint8:"UNSIGNED_BYTE",Int16:"SHORT",Uint16:"UNSIGNED_SHORT",Int32:"INT",Uint32:"UNSIGNED_INT",Float32:"FLOAT"};class Ha{constructor(a,h,m,y){this.length=h.length,this.attributes=m,this.itemSize=h.bytesPerElement,this.dynamicDraw=y,this.context=a;const w=a.gl;this.buffer=w.createBuffer(),a.bindVertexBuffer.set(this.buffer),w.bufferData(w.ARRAY_BUFFER,h.arrayBuffer,this.dynamicDraw?w.DYNAMIC_DRAW:w.STATIC_DRAW),this.dynamicDraw||delete h.arrayBuffer}bind(){this.context.bindVertexBuffer.set(this.buffer)}updateData(a){if(a.length!==this.length)throw new Error(`Length of new data is ${a.length}, which doesn't match current length of ${this.length}`);const h=this.context.gl;this.bind(),h.bufferSubData(h.ARRAY_BUFFER,0,a.arrayBuffer)}enableAttributes(a,h){for(let m=0;m0){const Ne=b.create(),ze=ke;b.mul(Ne,Se.placementInvProjMatrix,g.transform.glCoordMatrix),b.mul(Ne,Ne,Se.placementViewportMatrix),z.push({circleArray:Le,circleOffset:j,transform:ze,invTransform:Ne,coord:we}),L+=Le.length/4,j=L}Be&&R.draw(T,k.LINES,kt.disabled,cn.disabled,g.colorModeForRenderPass(),rn.disabled,Kh(ke,g.transform,De),g.style.map.terrain&&g.style.map.terrain.getTerrainData(we),h.id,Be.layoutVertexBuffer,Be.indexBuffer,Be.segments,null,g.transform.zoom,null,null,Be.collisionVertexBuffer)}if(!S||!z.length)return;const Q=g.useProgram("collisionCircle"),ee=new b.CollisionCircleLayoutArray;ee.resize(4*L),ee._trim();let Y=0;for(const ie of z)for(let we=0;we=0&&(ee[ae.associatedIconIndex]={shiftedAnchor:ht,angle:Pt})}else ue(ae.numGlyphs,j)}if(R){Q.clear();const Y=g.icon.placedSymbolArray;for(let ae=0;aeg.style.map.terrain.getElevation(Be,sh,ya):null,qi="map"===h.layout.get("text-rotation-alignment");V(Ne,Be.posMatrix,g,y,Ii,Jo,ae,R,qi,Qo)}const Rr=g.translatePosMatrix(Be.posMatrix,Le,w,S),ur=_e||y&&Se||Yl?ar:Ii,On=g.translatePosMatrix(Jo,Le,w,S,!0),Gi=Pt&&0!==h.paint.get(y?"text-halo-width":"icon-halo-width").constantOr(1);let Yr;Yr=Pt?Ne.iconsInText?Ei(zt.kind,An,ye,ae,g,Rr,ur,On,on,Ro):Vm(zt.kind,An,ye,ae,g,Rr,ur,On,y,on,!0):Ot(zt.kind,An,ye,ae,g,Rr,ur,On,y,on);const tr={program:Tn,buffers:ze,uniformValues:Yr,atlasTexture:Fn,atlasTextureIcon:vr,atlasInterpolation:_n,atlasInterpolationIcon:mo,isSDF:Pt,hasHalo:Gi};if(ie&&Ne.canOverlap){we=!0;const Qo=ze.segments.get();for(const qi of Qo)ke.push({segments:new b.SegmentVector([qi]),sortKey:qi.sortKey,state:tr,terrainData:Ht})}else ke.push({segments:ze.segments,sortKey:0,state:tr,terrainData:Ht})}we&&ke.sort((Be,Le)=>Be.sortKey-Le.sortKey);for(const Be of ke){const Le=Be.state;if(j.activeTexture.set(Q.TEXTURE0),Le.atlasTexture.bind(Le.atlasInterpolation,Q.CLAMP_TO_EDGE),Le.atlasTextureIcon&&(j.activeTexture.set(Q.TEXTURE1),Le.atlasTextureIcon&&Le.atlasTextureIcon.bind(Le.atlasInterpolationIcon,Q.CLAMP_TO_EDGE)),Le.isSDF){const Ne=Le.uniformValues;Le.hasHalo&&(Ne.u_is_halo=1,gr(Le.buffers,Be.segments,h,g,Le.program,De,z,L,Ne,Be.terrainData)),Ne.u_is_halo=0}gr(Le.buffers,Be.segments,h,g,Le.program,De,z,L,Le.uniformValues,Be.terrainData)}}function gr(g,a,h,m,y,w,S,T,k,R){const z=m.context;y.draw(z,z.gl.TRIANGLES,w,S,T,rn.disabled,k,R,h.id,g.layoutVertexBuffer,g.indexBuffer,a,h.paint,m.transform.zoom,g.programConfigurations.get(h.id),g.dynamicLayoutVertexBuffer,g.opacityVertexBuffer)}function Wa(g,a,h,m,y){if(!h||!m||!m.imageAtlas)return;const w=m.imageAtlas.patternPositions;let S=w[h.to.toString()],T=w[h.from.toString()];if(!S||!T){const k=y.getPaintProperty(a);S=w[k],T=w[k]}S&&T&&g.setConstantPatternPositions(S,T)}function Xa(g,a,h,m,y,w,S){const T=g.context.gl,k="fill-pattern",R=h.paint.get(k),z=R&&R.constantOr(1),L=h.getCrossfadeParameters();let j,Q,ee,Y,ae;S?(Q=z&&!h.getPaintProperty("fill-outline-color")?"fillOutlinePattern":"fillOutline",j=T.LINES):(Q=z?"fillPattern":"fill",j=T.TRIANGLES);const _e=R.constantOr(null);for(const ye of m){const ie=a.getTile(ye);if(z&&!ie.patternsLoaded())continue;const we=ie.getBucket(h);if(!we)continue;const De=we.programConfigurations.get(h.id),Se=g.useProgram(Q,De),ke=g.style.map.terrain&&g.style.map.terrain.getTerrainData(ye);z&&(g.context.activeTexture.set(T.TEXTURE0),ie.imageAtlasTexture.bind(T.LINEAR,T.CLAMP_TO_EDGE),De.updatePaintBuffers(L)),Wa(De,k,_e,ie,h);const Be=ke?ye:null,Le=g.translatePosMatrix(Be?Be.posMatrix:ye.posMatrix,ie,h.paint.get("fill-translate"),h.paint.get("fill-translate-anchor"));if(S){Y=we.indexBuffer2,ae=we.segments2;const Ne=[T.drawingBufferWidth,T.drawingBufferHeight];ee="fillOutlinePattern"===Q&&z?Io(Le,g,L,ie,Ne):Lf(Le,Ne)}else Y=we.indexBuffer,ae=we.segments,ee=z?Lc(Le,g,L,ie):Wr(Le);Se.draw(g.context,j,y,g.stencilModeForClipping(ye),w,rn.disabled,ee,ke,h.id,we.layoutVertexBuffer,Y,ae,h.paint,g.transform.zoom,De)}}function Xt(g,a,h,m,y,w,S){const T=g.context,k=T.gl,R="fill-extrusion-pattern",z=h.paint.get(R),L=z.constantOr(1),j=h.getCrossfadeParameters(),Q=h.paint.get("fill-extrusion-opacity"),ee=z.constantOr(null);for(const Y of m){const ae=a.getTile(Y),_e=ae.getBucket(h);if(!_e)continue;const ye=g.style.map.terrain&&g.style.map.terrain.getTerrainData(Y),ie=_e.programConfigurations.get(h.id),we=g.useProgram(L?"fillExtrusionPattern":"fillExtrusion",ie);L&&(g.context.activeTexture.set(k.TEXTURE0),ae.imageAtlasTexture.bind(k.LINEAR,k.CLAMP_TO_EDGE),ie.updatePaintBuffers(j)),Wa(ie,R,ee,ae,h);const De=g.translatePosMatrix(Y.posMatrix,ae,h.paint.get("fill-extrusion-translate"),h.paint.get("fill-extrusion-translate-anchor")),Se=h.paint.get("fill-extrusion-vertical-gradient"),ke=L?Nu(De,g,Se,Q,Y,j,ae):Yh(De,g,Se,Q);we.draw(T,T.gl.TRIANGLES,y,w,S,rn.backCCW,ke,ye,h.id,_e.layoutVertexBuffer,_e.indexBuffer,_e.segments,h.paint,g.transform.zoom,ie,g.style.map.terrain&&_e.centroidVertexBuffer)}}function Vc(g,a,h,m,y,w,S){const T=g.context,k=T.gl,R=h.fbo;if(!R)return;const z=g.useProgram("hillshade"),L=g.style.map.terrain&&g.style.map.terrain.getTerrainData(a);T.activeTexture.set(k.TEXTURE0),k.bindTexture(k.TEXTURE_2D,R.colorAttachment.get()),z.draw(T,k.TRIANGLES,y,w,S,rn.disabled,((j,Q,ee,Y)=>{const ae=ee.paint.get("hillshade-shadow-color"),_e=ee.paint.get("hillshade-highlight-color"),ye=ee.paint.get("hillshade-accent-color");let ie=ee.paint.get("hillshade-illumination-direction")*(Math.PI/180);"viewport"===ee.paint.get("hillshade-illumination-anchor")&&(ie-=j.transform.angle);const we=!j.options.moving;return{u_matrix:Y?Y.posMatrix:j.transform.calculatePosMatrix(Q.tileID.toUnwrapped(),we),u_image:0,u_latrange:Bu(0,Q.tileID),u_light:[ee.paint.get("hillshade-exaggeration"),ie],u_shadow:ae,u_highlight:_e,u_accent:ye}})(g,h,m,L?a:null),L,m.id,g.rasterBoundsBuffer,g.quadTriangleIndexBuffer,g.rasterBoundsSegments)}function Ya(g,a,h,m,y,w){const S=g.context,T=S.gl,k=a.dem;if(k&&k.data){const R=k.dim,z=k.stride,L=k.getPixels();if(S.activeTexture.set(T.TEXTURE1),S.pixelStoreUnpackPremultiplyAlpha.set(!1),a.demTexture=a.demTexture||g.getTileTexture(z),a.demTexture){const Q=a.demTexture;Q.update(L,{premultiply:!1}),Q.bind(T.NEAREST,T.CLAMP_TO_EDGE)}else a.demTexture=new Hn(S,L,T.RGBA,{premultiply:!1}),a.demTexture.bind(T.NEAREST,T.CLAMP_TO_EDGE);S.activeTexture.set(T.TEXTURE0);let j=a.fbo;if(!j){const Q=new Hn(S,{width:R,height:R,data:null},T.RGBA);Q.bind(T.LINEAR,T.CLAMP_TO_EDGE),j=a.fbo=S.createFramebuffer(R,R,!0),j.colorAttachment.set(Q.texture)}S.bindFramebuffer.set(j.framebuffer),S.viewport.set([0,0,R,R]),g.useProgram("hillshadePrepare").draw(S,T.TRIANGLES,m,y,w,rn.disabled,((Q,ee)=>{const Y=ee.stride,ae=b.create();return b.ortho(ae,0,b.EXTENT,-b.EXTENT,0,0,1),b.translate(ae,ae,[0,-b.EXTENT,0]),{u_matrix:ae,u_image:1,u_dimension:[Y,Y],u_zoom:Q.overscaledZ,u_unpack:ee.getUnpackVector()}})(a.tileID,k),null,h.id,g.rasterBoundsBuffer,g.quadTriangleIndexBuffer,g.rasterBoundsSegments),a.needsHillshadePrepare=!1}}function Ka(g,a,h,m,y,w){const S=m.paint.get("raster-fade-duration");if(!w&&S>0){const T=b.exported.now(),k=(T-g.timeAdded)/S,R=a?(T-a.timeAdded)/S:-1,z=h.getSource(),L=y.coveringZoomLevel({tileSize:z.tileSize,roundZoom:z.roundZoom}),j=!a||Math.abs(a.tileID.overscaledZ-L)>Math.abs(g.tileID.overscaledZ-L),Q=j&&g.refreshedUponExpiration?1:b.clamp(j?k:1-R,0,1);return g.refreshedUponExpiration&&k>=1&&(g.refreshedUponExpiration=!1),a?{opacity:1,mix:1-Q}:{opacity:Q,mix:0}}return{opacity:1,mix:0}}const da=new b.Color(1,0,0,1),lr=new b.Color(0,1,0,1),co=new b.Color(0,0,1,1),Ja=new b.Color(1,0,1,1),$r=new b.Color(0,1,1,1);function Yo(g,a,h,m){$n(g,0,a+h/2,g.transform.width,h,m)}function ad(g,a,h,m){$n(g,a-h/2,0,h,g.transform.height,m)}function $n(g,a,h,m,y,w){const S=g.context,T=S.gl;T.enable(T.SCISSOR_TEST),T.scissor(a*g.pixelRatio,h*g.pixelRatio,m*g.pixelRatio,y*g.pixelRatio),S.clear({color:w}),T.disable(T.SCISSOR_TEST)}function jm(g,a,h){const m=g.context,y=m.gl,w=h.posMatrix,S=g.useProgram("debug"),T=kt.disabled,k=cn.disabled,R=g.colorModeForRenderPass(),z="$debug",L=g.style.map.terrain&&g.style.map.terrain.getTerrainData(h);m.activeTexture.set(y.TEXTURE0),g.emptyTexture.bind(y.LINEAR,y.CLAMP_TO_EDGE);const j=a.getTileByID(h.key).latestRawTileData,Q=Math.floor((j&&j.byteLength||0)/1024),ee=a.getTile(h).tileSize,Y=512/Math.min(ee,512)*(h.overscaledZ/g.transform.zoom)*.5;let ae=h.canonical.toString();h.overscaledZ!==h.canonical.z&&(ae+=` => ${h.overscaledZ}`),function(_e,ye){_e.initDebugOverlayCanvas();const ie=_e.debugOverlayCanvas,we=_e.context.gl,De=_e.debugOverlayCanvas.getContext("2d");De.clearRect(0,0,ie.width,ie.height),De.shadowColor="white",De.shadowBlur=2,De.lineWidth=1.5,De.strokeStyle="white",De.textBaseline="top",De.font="bold 36px Open Sans, sans-serif",De.fillText(ye,5,5),De.strokeText(ye,5,5),_e.debugOverlayTexture.update(ie),_e.debugOverlayTexture.bind(we.LINEAR,we.CLAMP_TO_EDGE)}(g,`${ae} ${Q}kB`),S.draw(m,y.TRIANGLES,T,k,Nt.alphaBlended,rn.disabled,zu(w,b.Color.transparent,Y),null,z,g.debugBuffer,g.quadTriangleIndexBuffer,g.debugSegments),S.draw(m,y.LINE_STRIP,T,k,R,rn.disabled,zu(w,b.Color.red),L,z,g.debugBuffer,g.tileBorderIndexBuffer,g.debugSegments)}function ld(g,a,h){const m=g.context,y=m.gl,w=g.colorModeForRenderPass(),S=new kt(y.LEQUAL,kt.ReadWrite,g.depthRangeFor3D),T=g.useProgram("terrain"),k=a.getTerrainMesh();m.bindFramebuffer.set(null),m.viewport.set([0,0,g.width,g.height]);for(const R of h){const z=g.renderToTexture.getTexture(R),L=a.getTerrainData(R.tileID);m.activeTexture.set(y.TEXTURE0),y.bindTexture(y.TEXTURE_2D,z.texture);const j={u_matrix:g.transform.calculatePosMatrix(R.tileID.toUnwrapped()),u_texture:0,u_ele_delta:a.getMeshFrameDelta(g.transform.zoom)};T.draw(m,y.TRIANGLES,S,cn.disabled,w,rn.backCCW,j,L,"terrain",k.vertexBuffer,k.indexBuffer,k.segments)}}const $s={symbol:function(g,a,h,m,y){if("translucent"!==g.renderPass)return;const w=cn.disabled,S=g.colorModeForRenderPass();h.layout.get("text-variable-anchor")&&function(T,k,R,z,L,j,Q){const ee=k.transform,Y="map"===L,ae="map"===j;for(const _e of T){const ye=z.getTile(_e),ie=ye.getBucket(R);if(!ie||!ie.text||!ie.text.segments.get().length)continue;const we=b.evaluateSizeForZoom(ie.textSizeData,ee.zoom),De=Ie(ye,1,k.transform.zoom),Se=Vr(_e.posMatrix,ae,Y,k.transform,De),ke="none"!==R.layout.get("icon-text-fit")&&ie.hasIconData();if(we){const Be=Math.pow(2,ee.zoom-ye.tileID.overscaledZ);ha(ie,Y,ae,Q,ee,Se,_e.posMatrix,Be,we,ke,k.style.map.terrain?(Le,Ne)=>k.style.map.terrain.getElevation(_e,Le,Ne):null)}}}(m,g,h,a,h.layout.get("text-rotation-alignment"),h.layout.get("text-pitch-alignment"),y),0!==h.paint.get("icon-opacity").constantOr(1)&&Hi(g,a,h,m,!1,h.paint.get("icon-translate"),h.paint.get("icon-translate-anchor"),h.layout.get("icon-rotation-alignment"),h.layout.get("icon-pitch-alignment"),h.layout.get("icon-keep-upright"),w,S),0!==h.paint.get("text-opacity").constantOr(1)&&Hi(g,a,h,m,!0,h.paint.get("text-translate"),h.paint.get("text-translate-anchor"),h.layout.get("text-rotation-alignment"),h.layout.get("text-pitch-alignment"),h.layout.get("text-keep-upright"),w,S),a.map.showCollisionBoxes&&(Wt(g,a,h,m,h.paint.get("text-translate"),h.paint.get("text-translate-anchor"),!0),Wt(g,a,h,m,h.paint.get("icon-translate"),h.paint.get("icon-translate-anchor"),!1))},circle:function(g,a,h,m){if("translucent"!==g.renderPass)return;const y=h.paint.get("circle-opacity"),w=h.paint.get("circle-stroke-width"),S=h.paint.get("circle-stroke-opacity"),T=!h.layout.get("circle-sort-key").isConstant();if(0===y.constantOr(1)&&(0===w.constantOr(1)||0===S.constantOr(1)))return;const k=g.context,R=k.gl,z=g.depthModeForSublayer(0,kt.ReadOnly),L=cn.disabled,j=g.colorModeForRenderPass(),Q=[];for(let ee=0;eeee.sortKey-Y.sortKey);for(const ee of Q){const{programConfiguration:Y,program:ae,layoutVertexBuffer:_e,indexBuffer:ye,uniformValues:ie,terrainData:we}=ee.state;ae.draw(k,R.TRIANGLES,z,L,j,rn.disabled,ie,we,h.id,_e,ye,ee.segments,h.paint,g.transform.zoom,Y)}},heatmap:function(g,a,h,m){if(0!==h.paint.get("heatmap-opacity"))if("offscreen"===g.renderPass){const y=g.context,w=y.gl,S=cn.disabled,T=new Nt([w.ONE,w.ONE],b.Color.transparent,[!0,!0,!0,!0]);(function(k,R,z){const L=k.gl;k.activeTexture.set(L.TEXTURE1),k.viewport.set([0,0,R.width/4,R.height/4]);let j=z.heatmapFbo;if(j)L.bindTexture(L.TEXTURE_2D,j.colorAttachment.get()),k.bindFramebuffer.set(j.framebuffer);else{const Q=L.createTexture();L.bindTexture(L.TEXTURE_2D,Q),L.texParameteri(L.TEXTURE_2D,L.TEXTURE_WRAP_S,L.CLAMP_TO_EDGE),L.texParameteri(L.TEXTURE_2D,L.TEXTURE_WRAP_T,L.CLAMP_TO_EDGE),L.texParameteri(L.TEXTURE_2D,L.TEXTURE_MIN_FILTER,L.LINEAR),L.texParameteri(L.TEXTURE_2D,L.TEXTURE_MAG_FILTER,L.LINEAR),j=z.heatmapFbo=k.createFramebuffer(R.width/4,R.height/4,!1),function(ee,Y,ae,_e){const ye=ee.gl;ye.texImage2D(ye.TEXTURE_2D,0,ye.RGBA,Y.width/4,Y.height/4,0,ye.RGBA,ee.extRenderToTextureHalfFloat?ee.extTextureHalfFloat.HALF_FLOAT_OES:ye.UNSIGNED_BYTE,null),_e.colorAttachment.set(ae)}(k,R,Q,j)}})(y,g,h),y.clear({color:b.Color.transparent});for(let k=0;k{const ee=b.create();b.ortho(ee,0,z.width,z.height,0,0,1);const Y=z.context.gl;return{u_matrix:ee,u_world:[Y.drawingBufferWidth,Y.drawingBufferHeight],u_image:0,u_color_ramp:1,u_opacity:L.paint.get("heatmap-opacity")}})(y,w),null,w.id,y.viewportBuffer,y.quadTriangleIndexBuffer,y.viewportSegments,w.paint,y.transform.zoom)}(g,h))},line:function(g,a,h,m){if("translucent"!==g.renderPass)return;const y=h.paint.get("line-opacity"),w=h.paint.get("line-width");if(0===y.constantOr(1)||0===w.constantOr(1))return;const S=g.depthModeForSublayer(0,kt.ReadOnly),T=g.colorModeForRenderPass(),k=h.paint.get("line-dasharray"),R=h.paint.get("line-pattern"),z=R.constantOr(1),L=h.paint.get("line-gradient"),j=h.getCrossfadeParameters(),Q=z?"linePattern":k?"lineSDF":L?"lineGradient":"line",ee=g.context,Y=ee.gl;let ae=!0;for(const _e of m){const ye=a.getTile(_e);if(z&&!ye.patternsLoaded())continue;const ie=ye.getBucket(h);if(!ie)continue;const we=ie.programConfigurations.get(h.id),De=g.context.program.get(),Se=g.useProgram(Q,we),ke=ae||Se.program!==De,Be=g.style.map.terrain&&g.style.map.terrain.getTerrainData(_e),Le=R.constantOr(null);if(Le&&ye.imageAtlas){const ht=ye.imageAtlas,Pt=ht.patternPositions[Le.to.toString()],zt=ht.patternPositions[Le.from.toString()];Pt&&zt&&we.setConstantPatternPositions(Pt,zt)}const Ne=Be?_e:null,ze=z?ed(g,ye,h,j,Ne):k?Ui(g,ye,h,k,j,Ne):L?Qh(g,ye,h,ie.lineClipsArray.length,Ne):Vu(g,ye,h,Ne);if(z)ee.activeTexture.set(Y.TEXTURE0),ye.imageAtlasTexture.bind(Y.LINEAR,Y.CLAMP_TO_EDGE),we.updatePaintBuffers(j);else if(k&&(ke||g.lineAtlas.dirty))ee.activeTexture.set(Y.TEXTURE0),g.lineAtlas.bind(ee);else if(L){const ht=ie.gradients[h.id];let Pt=ht.texture;if(h.gradientVersion!==ht.version){let zt=256;if(h.stepInterpolant){const mt=a.getSource().maxzoom,Tn=_e.canonical.z===mt?Math.ceil(1<256&&this.clearStencil(),m.setColorMode(Nt.disabled),m.setDepthMode(kt.disabled);const w=this.useProgram("clippingMask");this._tileClippingMaskIDs={};for(const S of h){const T=this._tileClippingMaskIDs[S.key]=this.nextStencilID++,k=this.style.map.terrain&&this.style.map.terrain.getTerrainData(S);w.draw(m,y.TRIANGLES,kt.disabled,new cn({func:y.ALWAYS,mask:0},T,255,y.KEEP,y.KEEP,y.REPLACE),Nt.disabled,rn.disabled,Jh(S.posMatrix),k,"$clipping",this.tileExtentBuffer,this.quadTriangleIndexBuffer,this.tileExtentSegments)}}stencilModeFor3D(){this.currentStencilSource=void 0,this.nextStencilID+1>256&&this.clearStencil();const a=this.nextStencilID++,h=this.context.gl;return new cn({func:h.NOTEQUAL,mask:255},a,255,h.KEEP,h.KEEP,h.REPLACE)}stencilModeForClipping(a){const h=this.context.gl;return new cn({func:h.EQUAL,mask:255},this._tileClippingMaskIDs[a.key],0,h.KEEP,h.KEEP,h.REPLACE)}stencilConfigForOverlap(a){const h=this.context.gl,m=a.sort((S,T)=>T.overscaledZ-S.overscaledZ),y=m[m.length-1].overscaledZ,w=m[0].overscaledZ-y+1;if(w>1){this.currentStencilSource=void 0,this.nextStencilID+w>256&&this.clearStencil();const S={};for(let T=0;T=0;this.currentLayer--){const k=this.style._layers[m[this.currentLayer]],R=y[k.source],z=w[k.source];this._renderTileClippingMasks(k,z),this.renderLayer(this,R,k,z)}for(this.renderPass="translucent",this.currentLayer=0;this.currentLayerae.source&&!ae.isHidden(z)?[R.sourceCaches[ae.source]]:[]),Q=j.filter(ae=>"vector"===ae.getSource().type),ee=j.filter(ae=>"vector"!==ae.getSource().type),Y=ae=>{(!L||L.getSource().maxzoomY(ae)),L||ee.forEach(ae=>Y(ae)),L}(this.style,this.transform.zoom);k&&$s.debug(this,k,k.getVisibleCoordinates())}this.options.showPadding&&function(k){const R=k.transform.padding;Yo(k,k.transform.height-(R.top||0),3,da),Yo(k,R.bottom||0,3,lr),ad(k,R.left||0,3,co),ad(k,k.transform.width-(R.right||0),3,Ja);const z=k.transform.centerPoint;var L,j,Q,ee;$n(L=k,(j=z.x)-1,(Q=k.transform.height-z.y)-10,2,20,ee=$r),$n(L,j-10,Q-1,20,2,ee)}(this),this.context.setDefault()}renderLayer(a,h,m,y){m.isHidden(this.transform.zoom)||("background"===m.type||"custom"===m.type||(y||[]).length)&&(this.id=m.id,this.gpuTimingStart(m),$s[m.type](a,h,m,y,this.style.placement.variableOffsets),this.gpuTimingEnd())}gpuTimingStart(a){if(!this.options.gpuTiming)return;const h=this.context.extTimerQuery;let m=this.gpuTimers[a.id];m||(m=this.gpuTimers[a.id]={calls:0,cpuTime:0,query:h.createQueryEXT()}),m.calls++,h.beginQueryEXT(h.TIME_ELAPSED_EXT,m.query)}gpuTimingEnd(){if(!this.options.gpuTiming)return;const a=this.context.extTimerQuery;a.endQueryEXT(a.TIME_ELAPSED_EXT)}collectGpuTimers(){const a=this.gpuTimers;return this.gpuTimers={},a}queryGpuTimers(a){const h={};for(const m in a){const y=a[m],w=this.context.extTimerQuery,S=w.getQueryObjectEXT(y.query,w.QUERY_RESULT_EXT)/1e6;w.deleteQueryEXT(y.query),h[m]=S}return h}translatePosMatrix(a,h,m,y,w){if(!m[0]&&!m[1])return a;const S=w?"map"===y?this.transform.angle:0:"viewport"===y?-this.transform.angle:0;if(S){const R=Math.sin(S),z=Math.cos(S);m=[m[0]*z-m[1]*R,m[0]*R+m[1]*z]}const T=[w?m[0]:Ie(h,m[0],this.transform.zoom),w?m[1]:Ie(h,m[1],this.transform.zoom),0],k=new Float32Array(16);return b.translate(k,a,T),k}saveTileTexture(a){const h=this._tileTextures[a.size[0]];h?h.push(a):this._tileTextures[a.size[0]]=[a]}getTileTexture(a){const h=this._tileTextures[a];return h&&h.length>0?h.pop():null}isPatternMissing(a){if(!a)return!1;if(!a.from||!a.to)return!0;const h=this.imageManager.getPattern(a.from.toString()),m=this.imageManager.getPattern(a.to.toString());return!h||!m}useProgram(a,h){this.cache=this.cache||{};const m=a+(h?h.cacheKey:"")+(this._showOverdrawInspector?"/overdraw":"")+(this.style.map.terrain?"/terrain":"");return this.cache[m]||(this.cache[m]=new Xh(this.context,a,nt[a],h,Nc[a],this._showOverdrawInspector,this.style.map.terrain)),this.cache[m]}setCustomLayerDefaults(){this.context.unbindVAO(),this.context.cullFace.setDefault(),this.context.activeTexture.setDefault(),this.context.pixelStoreUnpack.setDefault(),this.context.pixelStoreUnpackPremultiplyAlpha.setDefault(),this.context.pixelStoreUnpackFlipY.setDefault()}setBaseState(){const a=this.context.gl;this.context.cullFace.set(!1),this.context.viewport.set([0,0,this.width,this.height]),this.context.blendEquation.set(a.FUNC_ADD)}initDebugOverlayCanvas(){null==this.debugOverlayCanvas&&(this.debugOverlayCanvas=document.createElement("canvas"),this.debugOverlayCanvas.width=512,this.debugOverlayCanvas.height=512,this.debugOverlayTexture=new Hn(this.context,this.debugOverlayCanvas,this.context.gl.RGBA))}destroy(){this.emptyTexture.destroy(),this.debugOverlayTexture&&this.debugOverlayTexture.destroy()}}class ct{constructor(a,h){this.points=a,this.planes=h}static fromInvProjectionMatrix(a,h,m){const y=Math.pow(2,m),w=[[-1,1,-1,1],[1,1,-1,1],[1,-1,-1,1],[-1,-1,-1,1],[-1,1,1,1],[1,1,1,1],[1,-1,1,1],[-1,-1,1,1]].map(T=>{const k=1/(T=b.transformMat4([],T,a))[3]/h*y;return b.mul$1(T,T,[k,k,1/T[3],k])}),S=[[0,1,2],[6,5,4],[0,3,7],[2,1,5],[3,2,6],[0,4,5]].map(T=>{const k=function(j,Q){var ee=Q[0],Y=Q[1],ae=Q[2],_e=ee*ee+Y*Y+ae*ae;return _e>0&&(_e=1/Math.sqrt(_e)),j[0]=Q[0]*_e,j[1]=Q[1]*_e,j[2]=Q[2]*_e,j}([],(j=[],Q=ro([],w[T[0]],w[T[1]]),ee=ro([],w[T[2]],w[T[1]]),Y=Q[0],ye=ee[0],j[0]=(ae=Q[1])*(we=ee[2])-(_e=Q[2])*(ie=ee[1]),j[1]=_e*ye-Y*we,j[2]=Y*ie-ae*ye,j)),R=-((z=k)[0]*(L=w[T[1]])[0]+z[1]*L[1]+z[2]*L[2]);var j,Q,ee,Y,ae,_e,ye,ie,we,z,L;return k.concat(R)});return new ct(w,S)}}class fa{constructor(a,h){var m,y,w;this.min=a,this.max=h,this.center=function(m,y,w){return m[0]=.5*y[0],m[1]=.5*y[1],m[2]=.5*y[2],m}([],((m=[])[0]=(y=this.min)[0]+(w=this.max)[0],m[1]=y[1]+w[1],m[2]=y[2]+w[2],m))}quadrant(a){const h=[a%2==0,a<2],m=na(this.min),y=na(this.max);for(let w=0;w=0&&S++;if(0===S)return 0;S!==h.length&&(m=!1)}if(m)return 2;for(let y=0;y<3;y++){let w=Number.MAX_VALUE,S=-Number.MAX_VALUE;for(let T=0;Tthis.max[y]-this.min[y])return 0}return 1}}class uo{constructor(a=0,h=0,m=0,y=0){if(isNaN(a)||a<0||isNaN(h)||h<0||isNaN(m)||m<0||isNaN(y)||y<0)throw new Error("Invalid value for edge-insets, top, bottom, left and right must all be numbers");this.top=a,this.bottom=h,this.left=m,this.right=y}interpolate(a,h,m){return null!=h.top&&null!=a.top&&(this.top=b.number(a.top,h.top,m)),null!=h.bottom&&null!=a.bottom&&(this.bottom=b.number(a.bottom,h.bottom,m)),null!=h.left&&null!=a.left&&(this.left=b.number(a.left,h.left,m)),null!=h.right&&null!=a.right&&(this.right=b.number(a.right,h.right,m)),this}getCenter(a,h){const m=b.clamp((this.left+a-this.right)/2,0,a),y=b.clamp((this.top+h-this.bottom)/2,0,h);return new b.pointGeometry(m,y)}equals(a){return this.top===a.top&&this.bottom===a.bottom&&this.left===a.left&&this.right===a.right}clone(){return new uo(this.top,this.bottom,this.left,this.right)}toJSON(){return{top:this.top,bottom:this.bottom,left:this.left,right:this.right}}}class Er{constructor(a,h,m,y,w){this.tileSize=512,this.maxValidLatitude=85.051129,this.freezeElevation=!1,this._renderWorldCopies=void 0===w||!!w,this._minZoom=a||0,this._maxZoom=h||22,this._minPitch=m??0,this._maxPitch=y??60,this.setMaxBounds(),this.width=0,this.height=0,this._center=new b.LngLat(0,0),this._elevation=0,this.zoom=0,this.angle=0,this._fov=.6435011087932844,this._pitch=0,this._unmodified=!0,this._edgeInsets=new uo,this._posMatrixCache={},this._alignedPosMatrixCache={}}clone(){const a=new Er(this._minZoom,this._maxZoom,this._minPitch,this.maxPitch,this._renderWorldCopies);return a.tileSize=this.tileSize,a.latRange=this.latRange,a.width=this.width,a.height=this.height,a._center=this._center,a._elevation=this._elevation,a.zoom=this.zoom,a.angle=this.angle,a._fov=this._fov,a._pitch=this._pitch,a._unmodified=this._unmodified,a._edgeInsets=this._edgeInsets.clone(),a._calcMatrices(),a}get minZoom(){return this._minZoom}set minZoom(a){this._minZoom!==a&&(this._minZoom=a,this.zoom=Math.max(this.zoom,a))}get maxZoom(){return this._maxZoom}set maxZoom(a){this._maxZoom!==a&&(this._maxZoom=a,this.zoom=Math.min(this.zoom,a))}get minPitch(){return this._minPitch}set minPitch(a){this._minPitch!==a&&(this._minPitch=a,this.pitch=Math.max(this.pitch,a))}get maxPitch(){return this._maxPitch}set maxPitch(a){this._maxPitch!==a&&(this._maxPitch=a,this.pitch=Math.min(this.pitch,a))}get renderWorldCopies(){return this._renderWorldCopies}set renderWorldCopies(a){void 0===a?a=!0:null===a&&(a=!1),this._renderWorldCopies=a}get worldSize(){return this.tileSize*this.scale}get centerOffset(){return this.centerPoint._sub(this.size._div(2))}get size(){return new b.pointGeometry(this.width,this.height)}get bearing(){return-this.angle/Math.PI*180}set bearing(a){const h=-b.wrap(a,-180,180)*Math.PI/180;var m;this.angle!==h&&(this._unmodified=!1,this.angle=h,this._calcMatrices(),this.rotationMatrix=(m=new b.ARRAY_TYPE(4),b.ARRAY_TYPE!=Float32Array&&(m[1]=0,m[2]=0),m[0]=1,m[3]=1,m),function(m,y,w){var S=y[0],T=y[1],k=y[2],R=y[3],z=Math.sin(w),L=Math.cos(w);m[0]=S*L+k*z,m[1]=T*L+R*z,m[2]=S*-z+k*L,m[3]=T*-z+R*L}(this.rotationMatrix,this.rotationMatrix,this.angle))}get pitch(){return this._pitch/Math.PI*180}set pitch(a){const h=b.clamp(a,this.minPitch,this.maxPitch)/180*Math.PI;this._pitch!==h&&(this._unmodified=!1,this._pitch=h,this._calcMatrices())}get fov(){return this._fov/Math.PI*180}set fov(a){a=Math.max(.01,Math.min(60,a)),this._fov!==a&&(this._unmodified=!1,this._fov=a/180*Math.PI,this._calcMatrices())}get zoom(){return this._zoom}set zoom(a){const h=Math.min(Math.max(a,this.minZoom),this.maxZoom);this._zoom!==h&&(this._unmodified=!1,this._zoom=h,this.tileZoom=Math.max(0,Math.floor(h)),this.scale=this.zoomScale(h),this._constrain(),this._calcMatrices())}get center(){return this._center}set center(a){a.lat===this._center.lat&&a.lng===this._center.lng||(this._unmodified=!1,this._center=a,this._constrain(),this._calcMatrices())}get elevation(){return this._elevation}set elevation(a){a!==this._elevation&&(this._elevation=a,this._constrain(),this._calcMatrices())}get padding(){return this._edgeInsets.toJSON()}set padding(a){this._edgeInsets.equals(a)||(this._unmodified=!1,this._edgeInsets.interpolate(this._edgeInsets,a,1),this._calcMatrices())}get centerPoint(){return this._edgeInsets.getCenter(this.width,this.height)}isPaddingEqual(a){return this._edgeInsets.equals(a)}interpolatePadding(a,h,m){this._unmodified=!1,this._edgeInsets.interpolate(a,h,m),this._constrain(),this._calcMatrices()}coveringZoomLevel(a){const h=(a.roundZoom?Math.round:Math.floor)(this.zoom+this.scaleZoom(this.tileSize/a.tileSize));return Math.max(0,h)}getVisibleUnwrappedCoordinates(a){const h=[new b.UnwrappedTileID(0,a)];if(this._renderWorldCopies){const m=this.pointCoordinate(new b.pointGeometry(0,0)),y=this.pointCoordinate(new b.pointGeometry(this.width,0)),w=this.pointCoordinate(new b.pointGeometry(this.width,this.height)),S=this.pointCoordinate(new b.pointGeometry(0,this.height)),T=Math.floor(Math.min(m.x,y.x,w.x,S.x)),k=Math.floor(Math.max(m.x,y.x,w.x,S.x)),R=1;for(let z=T-R;z<=k+R;z++)0!==z&&h.push(new b.UnwrappedTileID(z,a))}return h}coveringTiles(a){var h,m;let y=this.coveringZoomLevel(a);const w=y;if(void 0!==a.minzoom&&ya.maxzoom&&(y=a.maxzoom);const S=this.pointCoordinate(this.getCameraPoint()),T=b.MercatorCoordinate.fromLngLat(this.center),k=Math.pow(2,y),R=[k*S.x,k*S.y,0],z=[k*T.x,k*T.y,0],L=ct.fromInvProjectionMatrix(this.invProjMatrix,this.worldSize,y);let j=a.minzoom||0;!a.terrain&&this.pitch<=60&&this._edgeInsets.top<.1&&(j=y);const Q=a.terrain?2/Math.min(this.tileSize,a.tileSize)*this.tileSize:3,ee=ie=>({aabb:new fa([ie*k,0,0],[(ie+1)*k,k,0]),zoom:0,x:0,y:0,wrap:ie,fullyVisible:!1}),Y=[],ae=[],_e=y,ye=a.reparseOverscaled?w:y;if(this._renderWorldCopies)for(let ie=1;ie<=3;ie++)Y.push(ee(-ie)),Y.push(ee(ie));for(Y.push(ee(0));Y.length>0;){const ie=Y.pop(),we=ie.x,De=ie.y;let Se=ie.fullyVisible;if(!Se){const ze=ie.aabb.intersects(L);if(0===ze)continue;Se=2===ze}const ke=a.terrain?R:z,Be=ie.aabb.distanceX(ke),Le=ie.aabb.distanceY(ke),Ne=Math.max(Math.abs(Be),Math.abs(Le));if(ie.zoom===_e||Ne>Q+(1<<_e-ie.zoom)-2&&ie.zoom>=j){const ze=_e-ie.zoom,ht=R[0]-.5-(we<>1),zt=ie.zoom+1;let mt=ie.aabb.quadrant(ze);if(a.terrain){const Tn=new b.OverscaledTileID(zt,ie.wrap,zt,ht,Pt),An=a.terrain.getMinMaxElevation(Tn),Ht=null!==(h=An.minElevation)&&void 0!==h?h:this.elevation,on=null!==(m=An.maxElevation)&&void 0!==m?m:this.elevation;mt=new fa([mt.min[0],mt.min[1],Ht],[mt.max[0],mt.max[1],on])}Y.push({aabb:mt,zoom:zt,x:ht,y:Pt,wrap:ie.wrap,fullyVisible:Se})}}return ae.sort((ie,we)=>ie.distanceSq-we.distanceSq).map(ie=>ie.tileID)}resize(a,h){this.width=a,this.height=h,this.pixelsToGLUnits=[2/a,-2/h],this._constrain(),this._calcMatrices()}get unmodified(){return this._unmodified}zoomScale(a){return Math.pow(2,a)}scaleZoom(a){return Math.log(a)/Math.LN2}project(a){const h=b.clamp(a.lat,-this.maxValidLatitude,this.maxValidLatitude);return new b.pointGeometry(b.mercatorXfromLng(a.lng)*this.worldSize,b.mercatorYfromLat(h)*this.worldSize)}unproject(a){return new b.MercatorCoordinate(a.x/this.worldSize,a.y/this.worldSize).toLngLat()}get point(){return this.project(this.center)}updateElevation(a){this.freezeElevation||(this.elevation=a?this.getElevation(this._center,a):0)}getElevation(a,h){const m=b.MercatorCoordinate.fromLngLat(a),y=(1<S&&(y=S-ee)}if(this.lngRange){const Q=(T+k)/2,ee=b.wrap(L.x,Q-this.worldSize/2,Q+this.worldSize/2),Y=R.x/2;ee-Yk&&(m=k-Y)}void 0===m&&void 0===y||(this.center=this.unproject(new b.pointGeometry(void 0!==m?m:L.x,void 0!==y?y:L.y)).wrap()),this._unmodified=z,this._constraining=!1}_calcMatrices(){if(!this.height)return;const a=this.centerOffset,h=this.point.x,m=this.point.y;this.cameraToCenterDistance=.5/Math.tan(this._fov/2)*this.height,this._pixelPerMeter=b.mercatorZfromAltitude(1,this.center.lat)*this.worldSize;let y=b.identity(new Float64Array(16));b.scale(y,y,[this.width/2,-this.height/2,1]),b.translate(y,y,[1,-1,0]),this.labelPlaneMatrix=y,y=b.identity(new Float64Array(16)),b.scale(y,y,[1,-1,1]),b.translate(y,y,[-1,-1,0]),b.scale(y,y,[2/this.width,2/this.height,1]),this.glCoordMatrix=y,this.cameraToSeaLevelDistance=this.cameraToCenterDistance+this._elevation*this._pixelPerMeter/Math.cos(this._pitch);const w=this._elevation<0?this.cameraToCenterDistance:this.cameraToSeaLevelDistance,S=Math.PI/2+this._pitch,T=this._fov*(.5+a.y/this.height),k=Math.sin(T)*w/Math.sin(b.clamp(Math.PI-S-T,.01,Math.PI-.01)),R=this.getHorizon(),z=2*Math.atan(R/this.cameraToCenterDistance)*(.5+a.y/(2*R)),L=Math.sin(z)*w/Math.sin(b.clamp(Math.PI-S-z,.01,Math.PI-.01)),j=Math.min(k,L),Q=1.01*(Math.cos(Math.PI/2-this._pitch)*j+w),ee=this.height/50;y=new Float64Array(16),b.perspective(y,this._fov,this.width/this.height,ee,Q),y[8]=2*-a.x/this.width,y[9]=2*a.y/this.height,b.scale(y,y,[1,-1,1]),b.translate(y,y,[0,0,-this.cameraToCenterDistance]),b.rotateX(y,y,this._pitch),b.rotateZ(y,y,this.angle),b.translate(y,y,[-h,-m,0]),this.mercatorMatrix=b.scale([],y,[this.worldSize,this.worldSize,this.worldSize]),b.scale(y,y,[1,1,this._pixelPerMeter]),this.pixelMatrix=b.multiply(new Float64Array(16),this.labelPlaneMatrix,y),b.translate(y,y,[0,0,-this.elevation]),this.projMatrix=y,this.invProjMatrix=b.invert([],y),this.pixelMatrix3D=b.multiply(new Float64Array(16),this.labelPlaneMatrix,y);const Y=this.width%2/2,ae=this.height%2/2,_e=Math.cos(this.angle),ye=Math.sin(this.angle),ie=h-Math.round(h)+_e*Y+ye*ae,we=m-Math.round(m)+_e*ae+ye*Y,De=new Float64Array(y);if(b.translate(De,De,[ie>.5?ie-1:ie,we>.5?we-1:we,0]),this.alignedProjMatrix=De,y=b.invert(new Float64Array(16),this.pixelMatrix),!y)throw new Error("failed to invert matrix");this.pixelMatrixInverse=y,this._posMatrixCache={},this._alignedPosMatrixCache={}}maxPitchScaleFactor(){if(!this.pixelMatrixInverse)return 1;const a=this.pointCoordinate(new b.pointGeometry(0,0)),h=[a.x*this.worldSize,a.y*this.worldSize,0,1];return b.transformMat4(h,h,this.pixelMatrix)[3]/this.cameraToCenterDistance}getCameraPoint(){const a=Math.tan(this._pitch)*(this.cameraToCenterDistance||1);return this.centerPoint.add(new b.pointGeometry(0,a))}getCameraQueryGeometry(a){const h=this.getCameraPoint();if(1===a.length)return[a[0],h];{let m=h.x,y=h.y,w=h.x,S=h.y;for(const T of a)m=Math.min(m,T.x),y=Math.min(y,T.y),w=Math.max(w,T.x),S=Math.max(S,T.y);return[new b.pointGeometry(m,y),new b.pointGeometry(w,y),new b.pointGeometry(w,S),new b.pointGeometry(m,S),new b.pointGeometry(m,y)]}}}class Bf{constructor(a){this._hashName=a&&encodeURIComponent(a),b.bindAll(["_getCurrentHash","_onHashChange","_updateHash"],this),this._updateHash=function(h,m){let y=!1,w=null;const S=()=>{w=null,y&&(h(),w=setTimeout(S,300),y=!1)};return()=>(y=!0,w||S(),w)}(this._updateHashUnthrottled.bind(this))}addTo(a){return this._map=a,addEventListener("hashchange",this._onHashChange,!1),this._map.on("moveend",this._updateHash),this}remove(){return removeEventListener("hashchange",this._onHashChange,!1),this._map.off("moveend",this._updateHash),clearTimeout(this._updateHash()),delete this._map,this}getHashString(a){const h=this._map.getCenter(),m=Math.round(100*this._map.getZoom())/100,y=Math.ceil((m*Math.LN2+Math.log(512/360/.5))/Math.LN10),w=Math.pow(10,y),S=Math.round(h.lng*w)/w,T=Math.round(h.lat*w)/w,k=this._map.getBearing(),R=this._map.getPitch();let z="";if(z+=a?`/${S}/${T}/${m}`:`${m}/${T}/${S}`,(k||R)&&(z+="/"+Math.round(10*k)/10),R&&(z+=`/${Math.round(R)}`),this._hashName){const L=this._hashName;let j=!1;const Q=window.location.hash.slice(1).split("&").map(ee=>{const Y=ee.split("=")[0];return Y===L?(j=!0,`${Y}=${z}`):ee}).filter(ee=>ee);return j||Q.push(`${L}=${z}`),`#${Q.join("&")}`}return`#${z}`}_getCurrentHash(){const a=window.location.hash.replace("#","");if(this._hashName){let h;return a.split("&").map(m=>m.split("=")).forEach(m=>{m[0]===this._hashName&&(h=m)}),(h&&h[1]||"").split("/")}return a.split("/")}_onHashChange(){const a=this._getCurrentHash();if(a.length>=3&&!a.some(h=>isNaN(h))){const h=this._map.dragRotate.isEnabled()&&this._map.touchZoomRotate.isEnabled()?+(a[3]||0):this._map.getBearing();return this._map.jumpTo({center:[+a[2],+a[1]],zoom:+a[0],bearing:h,pitch:+(a[4]||0)}),!0}return!1}_updateHashUnthrottled(){const a=window.location.href.replace(/(#.+)?$/,this.getHashString());try{window.history.replaceState(window.history.state,null,a)}catch{}}}const Xe={linearity:.3,easing:b.bezier(0,0,.3,1)},ho=b.extend({deceleration:2500,maxSpeed:1400},Xe),cd=b.extend({deceleration:20,maxSpeed:1400},Xe),Zu=b.extend({deceleration:1e3,maxSpeed:360},Xe),jl=b.extend({deceleration:1e3,maxSpeed:90},Xe);class ko{constructor(a){this._map=a,this.clear()}clear(){this._inertiaBuffer=[]}record(a){this._drainInertiaBuffer(),this._inertiaBuffer.push({time:b.exported.now(),settings:a})}_drainInertiaBuffer(){const a=this._inertiaBuffer,h=b.exported.now();for(;a.length>0&&h-a[0].time>160;)a.shift()}_onMoveEnd(a){if(this._drainInertiaBuffer(),this._inertiaBuffer.length<2)return;const h={zoom:0,bearing:0,pitch:0,pan:new b.pointGeometry(0,0),pinchAround:void 0,around:void 0};for(const{settings:w}of this._inertiaBuffer)h.zoom+=w.zoomDelta||0,h.bearing+=w.bearingDelta||0,h.pitch+=w.pitchDelta||0,w.panDelta&&h.pan._add(w.panDelta),w.around&&(h.around=w.around),w.pinchAround&&(h.pinchAround=w.pinchAround);const m=this._inertiaBuffer[this._inertiaBuffer.length-1].time-this._inertiaBuffer[0].time,y={};if(h.pan.mag()){const w=ud(h.pan.mag(),m,b.extend({},ho,a||{}));y.offset=h.pan.mult(w.amount/h.pan.mag()),y.center=this._map.transform.center,Uc(y,w)}if(h.zoom){const w=ud(h.zoom,m,cd);y.zoom=this._map.transform.zoom+w.amount,Uc(y,w)}if(h.bearing){const w=ud(h.bearing,m,Zu);y.bearing=this._map.transform.bearing+b.clamp(w.amount,-179,179),Uc(y,w)}if(h.pitch){const w=ud(h.pitch,m,jl);y.pitch=this._map.transform.pitch+w.amount,Uc(y,w)}if(y.zoom||y.bearing){const w=void 0===h.pinchAround?h.around:h.pinchAround;y.around=w?this._map.unproject(w):this._map.getCenter()}return this.clear(),b.extend(y,{noMoveStart:!0})}}function Uc(g,a){(!g.duration||g.durationh.unproject(k)),T=w.reduce((k,R,z,L)=>k.add(R.div(L.length)),new b.pointGeometry(0,0));super(a,{points:w,point:T,lngLats:S,lngLat:h.unproject(T),originalEvent:m}),this._defaultPrevented=!1}}class Vf extends b.Event{preventDefault(){this._defaultPrevented=!0}get defaultPrevented(){return this._defaultPrevented}constructor(a,h,m){super(a,{originalEvent:m}),this._defaultPrevented=!1}}class Uf{constructor(a,h){this._map=a,this._clickTolerance=h.clickTolerance}reset(){delete this._mousedownPos}wheel(a){return this._firePreventable(new Vf(a.type,this._map,a))}mousedown(a,h){return this._mousedownPos=h,this._firePreventable(new Po(a.type,this._map,a))}mouseup(a){this._map.fire(new Po(a.type,this._map,a))}click(a,h){this._mousedownPos&&this._mousedownPos.dist(h)>=this._clickTolerance||this._map.fire(new Po(a.type,this._map,a))}dblclick(a){return this._firePreventable(new Po(a.type,this._map,a))}mouseover(a){this._map.fire(new Po(a.type,this._map,a))}mouseout(a){this._map.fire(new Po(a.type,this._map,a))}touchstart(a){return this._firePreventable(new Hl(a.type,this._map,a))}touchmove(a){this._map.fire(new Hl(a.type,this._map,a))}touchend(a){this._map.fire(new Hl(a.type,this._map,a))}touchcancel(a){this._map.fire(new Hl(a.type,this._map,a))}_firePreventable(a){if(this._map.fire(a),a.defaultPrevented)return{}}isEnabled(){return!0}isActive(){return!1}enable(){}disable(){}}class $f{constructor(a){this._map=a}reset(){this._delayContextMenu=!1,this._ignoreContextMenu=!0,delete this._contextMenuEvent}mousemove(a){this._map.fire(new Po(a.type,this._map,a))}mousedown(){this._delayContextMenu=!0,this._ignoreContextMenu=!1}mouseup(){this._delayContextMenu=!1,this._contextMenuEvent&&(this._map.fire(new Po("contextmenu",this._map,this._contextMenuEvent)),delete this._contextMenuEvent)}contextmenu(a){this._delayContextMenu?this._contextMenuEvent=a:this._ignoreContextMenu||this._map.fire(new Po(a.type,this._map,a)),this._map.listens("contextmenu")&&a.preventDefault()}isEnabled(){return!0}isActive(){return!1}enable(){}disable(){}}class fo{constructor(a,h){this._map=a,this._el=a.getCanvasContainer(),this._container=a.getContainer(),this._clickTolerance=h.clickTolerance||1}isEnabled(){return!!this._enabled}isActive(){return!!this._active}enable(){this.isEnabled()||(this._enabled=!0)}disable(){this.isEnabled()&&(this._enabled=!1)}mousedown(a,h){this.isEnabled()&&a.shiftKey&&0===a.button&&(Te.disableDrag(),this._startPos=this._lastPos=h,this._active=!0)}mousemoveWindow(a,h){if(!this._active)return;const m=h;if(this._lastPos.equals(m)||!this._box&&m.dist(this._startPos)w.fitScreenCoordinates(m,y,this._map.getBearing(),{linear:!0})};this._fireEvent("boxzoomcancel",a)}keydown(a){this._active&&27===a.keyCode&&(this.reset(),this._fireEvent("boxzoomcancel",a))}reset(){this._active=!1,this._container.classList.remove("maplibregl-crosshair"),this._box&&(Te.remove(this._box),this._box=null),Te.enableDrag(),delete this._startPos,delete this._lastPos}_fireEvent(a,h){return this._map.fire(new b.Event(a,{originalEvent:h}))}}function js(g,a){if(g.length!==a.length)throw new Error(`The number of touches and points are not equal - touches ${g.length}, points ${a.length}`);const h={};for(let m=0;mthis.numTouches)&&(this.aborted=!0),this.aborted||(void 0===this.startTime&&(this.startTime=a.timeStamp),m.length===this.numTouches&&(this.centroid=function(y){const w=new b.pointGeometry(0,0);for(const S of y)w._add(S);return w.div(y.length)}(h),this.touches=js(m,h)))}touchmove(a,h,m){if(this.aborted||!this.centroid)return;const y=js(m,h);for(const w in this.touches){const S=y[w];(!S||S.dist(this.touches[w])>30)&&(this.aborted=!0)}}touchend(a,h,m){if((!this.centroid||a.timeStamp-this.startTime>500)&&(this.aborted=!0),0===m.length){const y=!this.aborted&&this.centroid;if(this.reset(),y)return y}}}class Wu{constructor(a){this.singleTap=new Hm(a),this.numTaps=a.numTaps,this.reset()}reset(){this.lastTime=1/0,delete this.lastTap,this.count=0,this.singleTap.reset()}touchstart(a,h,m){this.singleTap.touchstart(a,h,m)}touchmove(a,h,m){this.singleTap.touchmove(a,h,m)}touchend(a,h,m){const y=this.singleTap.touchend(a,h,m);if(y){const w=a.timeStamp-this.lastTime<500,S=!this.lastTap||this.lastTap.dist(y)<30;if(w&&S||this.reset(),this.count++,this.lastTime=a.timeStamp,this.lastTap=y,this.count===this.numTaps)return this.reset(),y}}}class jf{constructor(){this._zoomIn=new Wu({numTouches:1,numTaps:2}),this._zoomOut=new Wu({numTouches:2,numTaps:1}),this.reset()}reset(){this._active=!1,this._zoomIn.reset(),this._zoomOut.reset()}touchstart(a,h,m){this._zoomIn.touchstart(a,h,m),this._zoomOut.touchstart(a,h,m)}touchmove(a,h,m){this._zoomIn.touchmove(a,h,m),this._zoomOut.touchmove(a,h,m)}touchend(a,h,m){const y=this._zoomIn.touchend(a,h,m),w=this._zoomOut.touchend(a,h,m);return y?(this._active=!0,a.preventDefault(),setTimeout(()=>this.reset(),0),{cameraAnimation:S=>S.easeTo({duration:300,zoom:S.getZoom()+1,around:S.unproject(y)},{originalEvent:a})}):w?(this._active=!0,a.preventDefault(),setTimeout(()=>this.reset(),0),{cameraAnimation:S=>S.easeTo({duration:300,zoom:S.getZoom()-1,around:S.unproject(w)},{originalEvent:a})}):void 0}touchcancel(){this.reset()}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class Gl{constructor(a){this._enabled=!!a.enable,this._moveStateManager=a.moveStateManager,this._clickTolerance=a.clickTolerance||1,this._moveFunction=a.move,this._activateOnStart=!!a.activateOnStart,a.assignEvents(this),this.reset()}reset(a){this._active=!1,this._moved=!1,delete this._lastPoint,this._moveStateManager.endMove(a)}_move(...a){const h=this._moveFunction(...a);if(h.bearingDelta||h.pitchDelta||h.around||h.panDelta)return this._active=!0,h}dragStart(a,h){this.isEnabled()&&!this._lastPoint&&this._moveStateManager.isValidStartEvent(a)&&(this._moveStateManager.startMove(a),this._lastPoint=h.length?h[0]:h,this._activateOnStart&&this._lastPoint&&(this._active=!0))}dragMove(a,h){if(!this.isEnabled())return;const m=this._lastPoint;if(!m)return;if(a.preventDefault(),!this._moveStateManager.isValidMoveEvent(a))return void this.reset(a);const y=h.length?h[0]:h;return!this._moved&&y.dist(m){g.mousedown=g.dragStart,g.mousemoveWindow=g.dragMove,g.mouseup=g.dragEnd,g.contextmenu=function(a){a.preventDefault()}},hd=({enable:g,clickTolerance:a,bearingDegreesPerPixelMoved:h=.8})=>{const m=new po({checkCorrectEvent:y=>0===Te.mouseButton(y)&&y.ctrlKey||2===Te.mouseButton(y)});return new Gl({clickTolerance:a,move:(y,w)=>({bearingDelta:(w.x-y.x)*h}),moveStateManager:m,enable:g,assignEvents:$c})},Xu=({enable:g,clickTolerance:a,pitchDegreesPerPixelMoved:h=-.5})=>{const m=new po({checkCorrectEvent:y=>0===Te.mouseButton(y)&&y.ctrlKey||2===Te.mouseButton(y)});return new Gl({clickTolerance:a,move:(y,w)=>({pitchDelta:(w.y-y.y)*h}),moveStateManager:m,enable:g,assignEvents:$c})};class Yu{constructor(a,h){this._minTouches=a.cooperativeGestures?2:1,this._clickTolerance=a.clickTolerance||1,this._map=h,this.reset()}reset(){this._active=!1,this._touches={},this._sum=new b.pointGeometry(0,0),setTimeout(()=>{this._cancelCooperativeMessage=!1},200)}touchstart(a,h,m){return this._calculateTransform(a,h,m)}touchmove(a,h,m){if(this._map._cooperativeGestures&&(2===this._minTouches&&m.length<2&&!this._cancelCooperativeMessage?this._map._onCooperativeGesture(a,!1,m.length):this._cancelCooperativeMessage||(this._cancelCooperativeMessage=!0)),this._active&&!(m.length0&&(this._active=!0);const y=js(m,h),w=new b.pointGeometry(0,0),S=new b.pointGeometry(0,0);let T=0;for(const R in y){const z=y[R],L=this._touches[R];L&&(w._add(z),S._add(z.sub(L)),T++,y[R]=z)}if(this._touches=y,TMath.abs(g.x)}class pd extends dd{constructor(a){super(),this._map=a}reset(){super.reset(),this._valid=void 0,delete this._firstMove,delete this._lastPoints}touchstart(a,h,m){super.touchstart(a,h,m),this._currentTouchCount=m.length}_start(a){this._lastPoints=a,Qa(a[0].sub(a[1]))&&(this._valid=!1)}_move(a,h,m){if(this._map._cooperativeGestures&&this._currentTouchCount<3)return;const y=a[0].sub(this._lastPoints[0]),w=a[1].sub(this._lastPoints[1]);return this._valid=this.gestureBeginsVertically(y,w,m.timeStamp),this._valid?(this._lastPoints=a,this._active=!0,{pitchDelta:(y.y+w.y)/2*-.5}):void 0}gestureBeginsVertically(a,h,m){if(void 0!==this._valid)return this._valid;const y=a.mag()>=2,w=h.mag()>=2;if(!y&&!w)return;if(!y||!w)return void 0===this._firstMove&&(this._firstMove=m),m-this._firstMove<100&&void 0;const S=a.y>0==h.y>0;return Qa(a)&&Qa(h)&&S}}const md={panStep:100,bearingStep:15,pitchStep:10};class Di{constructor(){const a=md;this._panStep=a.panStep,this._bearingStep=a.bearingStep,this._pitchStep=a.pitchStep,this._rotationDisabled=!1}reset(){this._active=!1}keydown(a){if(a.altKey||a.ctrlKey||a.metaKey)return;let h=0,m=0,y=0,w=0,S=0;switch(a.keyCode){case 61:case 107:case 171:case 187:h=1;break;case 189:case 109:case 173:h=-1;break;case 37:a.shiftKey?m=-1:(a.preventDefault(),w=-1);break;case 39:a.shiftKey?m=1:(a.preventDefault(),w=1);break;case 38:a.shiftKey?y=1:(a.preventDefault(),S=-1);break;case 40:a.shiftKey?y=-1:(a.preventDefault(),S=1);break;default:return}return this._rotationDisabled&&(m=0,y=0),{cameraAnimation:T=>{const k=T.getZoom();T.easeTo({duration:300,easeId:"keyboardHandler",easing:jc,zoom:h?Math.round(k)+h*(a.shiftKey?2:1):k,bearing:T.getBearing()+m*this._bearingStep,pitch:T.getPitch()+y*this._pitchStep,offset:[-w*this._panStep,-S*this._panStep],center:T.getCenter()},{originalEvent:a})}}}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 jc(g){return g*(2-g)}const Ko=4.000244140625;class gd{constructor(a,h){this._map=a,this._el=a.getCanvasContainer(),this._handler=h,this._delta=0,this._defaultZoomRate=.01,this._wheelZoomRate=.0022222222222222222,b.bindAll(["_onTimeout"],this)}setZoomRate(a){this._defaultZoomRate=a}setWheelZoomRate(a){this._wheelZoomRate=a}isEnabled(){return!!this._enabled}isActive(){return!!this._active||void 0!==this._finishTimeout}isZooming(){return!!this._zooming}enable(a){this.isEnabled()||(this._enabled=!0,this._aroundCenter=a&&"center"===a.around)}disable(){this.isEnabled()&&(this._enabled=!1)}wheel(a){if(!this.isEnabled())return;if(this._map._cooperativeGestures){if(!this._map._metaPress)return;a.preventDefault()}let h=a.deltaMode===WheelEvent.DOM_DELTA_LINE?40*a.deltaY:a.deltaY;const m=b.exported.now(),y=m-(this._lastWheelEventTime||0);this._lastWheelEventTime=m,0!==h&&h%Ko==0?this._type="wheel":0!==h&&Math.abs(h)<4?this._type="trackpad":y>400?(this._type=null,this._lastValue=h,this._timeout=setTimeout(this._onTimeout,40,a)):this._type||(this._type=Math.abs(y*h)<200?"trackpad":"wheel",this._timeout&&(clearTimeout(this._timeout),this._timeout=null,h+=this._lastValue)),a.shiftKey&&h&&(h/=4),this._type&&(this._lastWheelEvent=a,this._delta-=h,this._active||this._start(a)),a.preventDefault()}_onTimeout(a){this._type="wheel",this._delta-=this._lastValue,this._active||this._start(a)}_start(a){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 h=Te.mousePos(this._el,a);this._around=b.LngLat.convert(this._aroundCenter?this._map.getCenter():this._map.unproject(h)),this._aroundPoint=this._map.transform.locationPoint(this._around),this._frameId||(this._frameId=!0,this._handler._triggerRenderFrame())}renderFrame(){if(!this._frameId||(this._frameId=null,!this.isActive()))return;const a=this._map.transform;if(0!==this._delta){const T="wheel"===this._type&&Math.abs(this._delta)>Ko?this._wheelZoomRate:this._defaultZoomRate;let k=2/(1+Math.exp(-Math.abs(this._delta*T)));this._delta<0&&0!==k&&(k=1/k);const R="number"==typeof this._targetZoom?a.zoomScale(this._targetZoom):a.scale;this._targetZoom=Math.min(a.maxZoom,Math.max(a.minZoom,a.scaleZoom(R*k))),"wheel"===this._type&&(this._startZoom=a.zoom,this._easing=this._smoothOutEasing(200)),this._delta=0}const h="number"==typeof this._targetZoom?this._targetZoom:a.zoom,m=this._startZoom,y=this._easing;let w,S=!1;if("wheel"===this._type&&m&&y){const T=Math.min((b.exported.now()-this._lastWheelEventTime)/200,1),k=y(T);w=b.number(m,h,k),T<1?this._frameId||(this._frameId=!0):S=!0}else w=h,S=!0;return this._active=!0,S&&(this._active=!1,this._finishTimeout=setTimeout(()=>{this._zooming=!1,this._handler._triggerRenderFrame(),delete this._targetZoom,delete this._finishTimeout},200)),{noInertia:!0,needsRenderFrame:!S,zoomDelta:w-a.zoom,around:this._aroundPoint,originalEvent:this._lastWheelEvent}}_smoothOutEasing(a){let h=b.ease;if(this._prevEase){const m=this._prevEase,y=(b.exported.now()-m.start)/m.duration,w=m.easing(y+.01)-m.easing(y),S=.27/Math.sqrt(w*w+1e-4)*.01,T=Math.sqrt(.0729-S*S);h=b.bezier(S,T,.25,1)}return this._prevEase={start:b.exported.now(),duration:a,easing:h},h}reset(){this._active=!1}}class Ku{constructor(a,h){this._clickZoom=a,this._tapZoom=h}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 In{constructor(){this.reset()}reset(){this._active=!1}dblclick(a,h){return a.preventDefault(),{cameraAnimation:m=>{m.easeTo({duration:300,zoom:m.getZoom()+(a.shiftKey?-1:1),around:m.unproject(h)},{originalEvent:a})}}}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class Dr{constructor(){this._tap=new Wu({numTouches:1,numTaps:1}),this.reset()}reset(){this._active=!1,delete this._swipePoint,delete this._swipeTouch,delete this._tapTime,this._tap.reset()}touchstart(a,h,m){this._swipePoint||(this._tapTime&&a.timeStamp-this._tapTime>500&&this.reset(),this._tapTime?m.length>0&&(this._swipePoint=h[0],this._swipeTouch=m[0].identifier):this._tap.touchstart(a,h,m))}touchmove(a,h,m){if(this._tapTime){if(this._swipePoint){if(m[0].identifier!==this._swipeTouch)return;const y=h[0],w=y.y-this._swipePoint.y;return this._swipePoint=y,a.preventDefault(),this._active=!0,{zoomDelta:w/128}}}else this._tap.touchmove(a,h,m)}touchend(a,h,m){this._tapTime?this._swipePoint&&0===m.length&&this.reset():this._tap.touchend(a,h,m)&&(this._tapTime=a.timeStamp)}touchcancel(){this.reset()}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class Hf{constructor(a,h,m){this._el=a,this._mousePan=h,this._touchPan=m}enable(a){this._inertiaOptions=a||{},this._mousePan.enable(),this._touchPan.enable(),this._el.classList.add("maplibregl-touch-drag-pan")}disable(){this._mousePan.disable(),this._touchPan.disable(),this._el.classList.remove("maplibregl-touch-drag-pan")}isEnabled(){return this._mousePan.isEnabled()&&this._touchPan.isEnabled()}isActive(){return this._mousePan.isActive()||this._touchPan.isActive()}}class el{constructor(a,h,m){this._pitchWithRotate=a.pitchWithRotate,this._mouseRotate=h,this._mousePitch=m}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 Ju{constructor(a,h,m,y){this._el=a,this._touchZoom=h,this._touchRotate=m,this._tapDragZoom=y,this._rotationDisabled=!1,this._enabled=!0}enable(a){this._touchZoom.enable(a),this._rotationDisabled||this._touchRotate.enable(a),this._tapDragZoom.enable(),this._el.classList.add("maplibregl-touch-zoom-rotate")}disable(){this._touchZoom.disable(),this._touchRotate.disable(),this._tapDragZoom.disable(),this._el.classList.remove("maplibregl-touch-zoom-rotate")}isEnabled(){return this._touchZoom.isEnabled()&&(this._rotationDisabled||this._touchRotate.isEnabled())&&this._tapDragZoom.isEnabled()}isActive(){return this._touchZoom.isActive()||this._touchRotate.isActive()||this._tapDragZoom.isActive()}disableRotation(){this._rotationDisabled=!0,this._touchRotate.disable()}enableRotation(){this._rotationDisabled=!1,this._touchZoom.isEnabled()&&this._touchRotate.enable()}}const Hc=g=>g.zoom||g.drag||g.pitch||g.rotate;class Sr extends b.Event{}function Gc(g){return g.panDelta&&g.panDelta.mag()||g.zoomDelta||g.bearingDelta||g.pitchDelta}class Qu{constructor(a,h){this._map=a,this._el=this._map.getCanvasContainer(),this._handlers=[],this._handlersById={},this._changes=[],this._inertia=new ko(a),this._bearingSnap=h.bearingSnap,this._previousActiveHandlers={},this._eventsInProgress={},this._addDefaultHandlers(h),b.bindAll(["handleEvent","handleWindowEvent"],this);const m=this._el;this._listeners=[[m,"touchstart",{passive:!0}],[m,"touchmove",{passive:!1}],[m,"touchend",void 0],[m,"touchcancel",void 0],[m,"mousedown",void 0],[m,"mousemove",void 0],[m,"mouseup",void 0],[document,"mousemove",{capture:!0}],[document,"mouseup",void 0],[m,"mouseover",void 0],[m,"mouseout",void 0],[m,"dblclick",void 0],[m,"click",void 0],[m,"keydown",{capture:!1}],[m,"keyup",void 0],[m,"wheel",{passive:!1}],[m,"contextmenu",void 0],[window,"blur",void 0]];for(const[y,w,S]of this._listeners)Te.addEventListener(y,w,y===document?this.handleWindowEvent:this.handleEvent,S)}destroy(){for(const[a,h,m]of this._listeners)Te.removeEventListener(a,h,a===document?this.handleWindowEvent:this.handleEvent,m)}_addDefaultHandlers(a){const h=this._map,m=h.getCanvasContainer();this._add("mapEvent",new Uf(h,a));const y=h.boxZoom=new fo(h,a);this._add("boxZoom",y);const w=new jf,S=new In;h.doubleClickZoom=new Ku(S,w),this._add("tapZoom",w),this._add("clickZoom",S);const T=new Dr;this._add("tapDragZoom",T);const k=h.touchPitch=new pd(h);this._add("touchPitch",k);const R=hd(a),z=Xu(a);h.dragRotate=new el(a,R,z),this._add("mouseRotate",R,["mousePitch"]),this._add("mousePitch",z,["mouseRotate"]);const L=(({enable:_e,clickTolerance:ye})=>{const ie=new po({checkCorrectEvent:we=>0===Te.mouseButton(we)&&!we.ctrlKey});return new Gl({clickTolerance:ye,move:(we,De)=>({around:De,panDelta:De.sub(we)}),activateOnStart:!0,moveStateManager:ie,enable:_e,assignEvents:$c})})(a),j=new Yu(a,h);h.dragPan=new Hf(m,L,j),this._add("mousePan",L),this._add("touchPan",j,["touchZoom","touchRotate"]);const Q=new yt,ee=new _s;h.touchZoomRotate=new Ju(m,ee,Q,T),this._add("touchRotate",Q,["touchPan","touchZoom"]),this._add("touchZoom",ee,["touchPan","touchRotate"]);const Y=h.scrollZoom=new gd(h,this);this._add("scrollZoom",Y,["mousePan"]);const ae=h.keyboard=new Di;this._add("keyboard",ae),this._add("blockableMapEvent",new $f(h));for(const _e of["boxZoom","doubleClickZoom","tapDragZoom","touchPitch","dragRotate","dragPan","touchZoomRotate","scrollZoom","keyboard"])a.interactive&&a[_e]&&h[_e].enable(a[_e])}_add(a,h,m){this._handlers.push({handlerName:a,handler:h,allowed:m}),this._handlersById[a]=h}stop(a){if(!this._updatingCamera){for(const{handler:h}of this._handlers)h.reset();this._inertia.clear(),this._fireEvents({},{},a),this._changes=[]}}isActive(){for(const{handler:a}of this._handlers)if(a.isActive())return!0;return!1}isZooming(){return!!this._eventsInProgress.zoom||this._map.scrollZoom.isZooming()}isRotating(){return!!this._eventsInProgress.rotate}isMoving(){return Boolean(Hc(this._eventsInProgress))||this.isZooming()}_blockedByActive(a,h,m){for(const y in a)if(y!==m&&(!h||h.indexOf(y)<0))return!0;return!1}handleWindowEvent(a){this.handleEvent(a,`${a.type}Window`)}_getMapTouches(a){const h=[];for(const m of a)this._el.contains(m.target)&&h.push(m);return h}handleEvent(a,h){if("blur"===a.type)return void this.stop(!0);this._updatingCamera=!0;const m="renderFrame"===a.type?void 0:a,y={needsRenderFrame:!1},w={},S={},T=a.touches,k=T?this._getMapTouches(T):void 0,R=k?Te.touchPos(this._el,k):Te.mousePos(this._el,a);for(const{handlerName:j,handler:Q,allowed:ee}of this._handlers){if(!Q.isEnabled())continue;let Y;this._blockedByActive(S,ee,j)?Q.reset():Q[h||a.type]&&(Y=Q[h||a.type](a,R,k),this.mergeHandlerResult(y,w,Y,j,m),Y&&Y.needsRenderFrame&&this._triggerRenderFrame()),(Y||Q.isActive())&&(S[j]=Q)}const z={};for(const j in this._previousActiveHandlers)S[j]||(z[j]=m);this._previousActiveHandlers=S,(Object.keys(z).length||Gc(y))&&(this._changes.push([y,w,z]),this._triggerRenderFrame()),(Object.keys(S).length||Gc(y))&&this._map._stop(!0),this._updatingCamera=!1;const{cameraAnimation:L}=y;L&&(this._inertia.clear(),this._fireEvents({},{},!0),this._changes=[],L(this._map))}mergeHandlerResult(a,h,m,y,w){if(!m)return;b.extend(a,m);const S={handlerName:y,originalEvent:m.originalEvent||w};void 0!==m.zoomDelta&&(h.zoom=S),void 0!==m.panDelta&&(h.drag=S),void 0!==m.pitchDelta&&(h.pitch=S),void 0!==m.bearingDelta&&(h.rotate=S)}_applyChanges(){const a={},h={},m={};for(const[y,w,S]of this._changes)y.panDelta&&(a.panDelta=(a.panDelta||new b.pointGeometry(0,0))._add(y.panDelta)),y.zoomDelta&&(a.zoomDelta=(a.zoomDelta||0)+y.zoomDelta),y.bearingDelta&&(a.bearingDelta=(a.bearingDelta||0)+y.bearingDelta),y.pitchDelta&&(a.pitchDelta=(a.pitchDelta||0)+y.pitchDelta),void 0!==y.around&&(a.around=y.around),void 0!==y.pinchAround&&(a.pinchAround=y.pinchAround),y.noInertia&&(a.noInertia=y.noInertia),b.extend(h,w),b.extend(m,S);this._updateMapTransform(a,h,m),this._changes=[]}_updateMapTransform(a,h,m){const y=this._map,w=y.transform,S=y.terrain;if(!(Gc(a)||S&&this._terrainMovement))return this._fireEvents(h,m,!0);let{panDelta:T,zoomDelta:k,bearingDelta:R,pitchDelta:z,around:L,pinchAround:j}=a;void 0!==j&&(L=j),y._stop(!0),L=L||y.transform.centerPoint;const Q=w.pointLocation(T?L.sub(T):L);R&&(w.bearing+=R),z&&(w.pitch+=z),k&&(w.zoom+=k),S?this._terrainMovement||!h.drag&&!h.zoom?h.drag&&this._terrainMovement?w.center=w.pointLocation(w.centerPoint.sub(T)):w.setLocationAtPoint(Q,L):(this._terrainMovement=!0,w.freezeElevation=!0,w.setLocationAtPoint(Q,L),this._map.once("moveend",()=>{w.freezeElevation=!1,this._terrainMovement=!1,w.recalculateZoom(y.terrain)})):w.setLocationAtPoint(Q,L),this._map._update(),a.noInertia||this._inertia.record(a),this._fireEvents(h,m,!0)}_fireEvents(a,h,m){const y=Hc(this._eventsInProgress),w=Hc(a),S={};for(const z in a){const{originalEvent:L}=a[z];this._eventsInProgress[z]||(S[`${z}start`]=L),this._eventsInProgress[z]=a[z]}!y&&w&&this._fireEvent("movestart",w.originalEvent);for(const z in S)this._fireEvent(z,S[z]);w&&this._fireEvent("move",w.originalEvent);for(const z in a){const{originalEvent:L}=a[z];this._fireEvent(z,L)}const T={};let k;for(const z in this._eventsInProgress){const{handlerName:L,originalEvent:j}=this._eventsInProgress[z];this._handlersById[L].isActive()||(delete this._eventsInProgress[z],k=h[L]||j,T[`${z}end`]=k)}for(const z in T)this._fireEvent(z,T[z]);const R=Hc(this._eventsInProgress);if(m&&(y||w)&&!R){this._updatingCamera=!0;const z=this._inertia._onMoveEnd(this._map.dragPan._inertiaOptions),L=j=>0!==j&&-this._bearingSnap{delete this._frameId,this.handleEvent(new Sr("renderFrame",{timeStamp:a})),this._applyChanges()})}_triggerRenderFrame(){void 0===this._frameId&&(this._frameId=this._requestFrame())}}const ql={extend:(g,...a)=>b.extend(g,...a),run(g){g()},logToElement(g,a=!1,h="log"){const m=window.document.getElementById(h);m&&(a&&(m.innerHTML=""),m.innerHTML+=`
${g}`)}};class Si extends b.Evented{constructor(a,h){super(),this._moving=!1,this._zooming=!1,this.transform=a,this._bearingSnap=h.bearingSnap,b.bindAll(["_renderFrameCallback"],this)}getCenter(){return new b.LngLat(this.transform.center.lng,this.transform.center.lat)}setCenter(a,h){return this.jumpTo({center:a},h)}panBy(a,h,m){return a=b.pointGeometry.convert(a).mult(-1),this.panTo(this.transform.center,b.extend({offset:a},h),m)}panTo(a,h,m){return this.easeTo(b.extend({center:a},h),m)}getZoom(){return this.transform.zoom}setZoom(a,h){return this.jumpTo({zoom:a},h),this}zoomTo(a,h,m){return this.easeTo(b.extend({zoom:a},h),m)}zoomIn(a,h){return this.zoomTo(this.getZoom()+1,a,h),this}zoomOut(a,h){return this.zoomTo(this.getZoom()-1,a,h),this}getBearing(){return this.transform.bearing}setBearing(a,h){return this.jumpTo({bearing:a},h),this}getPadding(){return this.transform.padding}setPadding(a,h){return this.jumpTo({padding:a},h),this}rotateTo(a,h,m){return this.easeTo(b.extend({bearing:a},h),m)}resetNorth(a,h){return this.rotateTo(0,b.extend({duration:1e3},a),h),this}resetNorthPitch(a,h){return this.easeTo(b.extend({bearing:0,pitch:0,duration:1e3},a),h),this}snapToNorth(a,h){return Math.abs(this.getBearing()){if(this._zooming&&(m.zoom=b.number(y,k,Se)),this._rotating&&(m.bearing=b.number(w,R,Se)),this._pitching&&(m.pitch=b.number(S,z,Se)),this._padding&&(m.interpolatePadding(T,L,Se),Q=m.centerPoint.add(j)),this.terrain&&!a.freezeElevation&&this._updateElevation(Se),ie)m.setLocationAtPoint(ie,we);else{const ke=m.zoomScale(m.zoom-y),Be=k>y?Math.min(2,ye):Math.max(.5,ye),Le=Math.pow(Be,1-Se),Ne=m.unproject(ae.add(_e.mult(Se*Le)).mult(ke));m.setLocationAtPoint(m.renderWorldCopies?Ne.wrap():Ne,Q)}this._fireMoveEvents(h)},Se=>{this.terrain&&this._finalizeElevation(),this._afterEase(h,Se)},a),this}_prepareEase(a,h,m={}){this._moving=!0,h||m.moving||this.fire(new b.Event("movestart",a)),this._zooming&&!m.zooming&&this.fire(new b.Event("zoomstart",a)),this._rotating&&!m.rotating&&this.fire(new b.Event("rotatestart",a)),this._pitching&&!m.pitching&&this.fire(new b.Event("pitchstart",a))}_prepareElevation(a){this._elevationCenter=a,this._elevationStart=this.transform.elevation,this._elevationTarget=this.transform.getElevation(a,this.terrain),this.transform.freezeElevation=!0}_updateElevation(a){const h=this.transform.getElevation(this._elevationCenter,this.terrain);if(a<1&&h!==this._elevationTarget){const m=this._elevationTarget-this._elevationStart;this._elevationStart+=a*(m-(h-(m*a+this._elevationStart))/(1-a)),this._elevationTarget=h}this.transform.elevation=b.number(this._elevationStart,this._elevationTarget,a)}_finalizeElevation(){this.transform.freezeElevation=!1,this.transform.recalculateZoom(this.terrain)}_fireMoveEvents(a){this.fire(new b.Event("move",a)),this._zooming&&this.fire(new b.Event("zoom",a)),this._rotating&&this.fire(new b.Event("rotate",a)),this._pitching&&this.fire(new b.Event("pitch",a))}_afterEase(a,h){if(this._easeId&&h&&this._easeId===h)return;delete this._easeId;const m=this._zooming,y=this._rotating,w=this._pitching;this._moving=!1,this._zooming=!1,this._rotating=!1,this._pitching=!1,this._padding=!1,m&&this.fire(new b.Event("zoomend",a)),y&&this.fire(new b.Event("rotateend",a)),w&&this.fire(new b.Event("pitchend",a)),this.fire(new b.Event("moveend",a))}flyTo(a,h){if(!a.essential&&b.exported.prefersReducedMotion){const mt=b.pick(a,["center","zoom","bearing","pitch","around"]);return this.jumpTo(mt,h)}this.stop(),a=b.extend({offset:[0,0],speed:1.2,curve:1.42,easing:b.ease},a);const m=this.transform,y=this.getZoom(),w=this.getBearing(),S=this.getPitch(),T=this.getPadding(),k="zoom"in a?b.clamp(+a.zoom,m.minZoom,m.maxZoom):y,R="bearing"in a?this._normalizeBearing(a.bearing,w):w,z="pitch"in a?+a.pitch:S,L="padding"in a?a.padding:m.padding,j=m.zoomScale(k-y),Q=b.pointGeometry.convert(a.offset);let ee=m.centerPoint.add(Q);const Y=m.pointLocation(ee),ae=b.LngLat.convert(a.center||Y);this._normalizeCenter(ae);const _e=m.project(Y),ye=m.project(ae).sub(_e);let ie=a.curve;const we=Math.max(m.width,m.height),De=we/j,Se=ye.mag();if("minZoom"in a){const mt=b.clamp(Math.min(a.minZoom,y,k),m.minZoom,m.maxZoom),Tn=we/m.zoomScale(mt-y);ie=Math.sqrt(Tn/Se*2)}const ke=ie*ie;function Be(mt){const Tn=(De*De-we*we+(mt?-1:1)*ke*ke*Se*Se)/(2*(mt?De:we)*ke*Se);return Math.log(Math.sqrt(Tn*Tn+1)-Tn)}function Le(mt){return(Math.exp(mt)-Math.exp(-mt))/2}function Ne(mt){return(Math.exp(mt)+Math.exp(-mt))/2}const ze=Be(0);let ht=function(mt){return Ne(ze)/Ne(ze+ie*mt)},Pt=function(mt){return we*((Ne(ze)*(Le(Tn=ze+ie*mt)/Ne(Tn))-Le(ze))/ke)/Se;var Tn},zt=(Be(1)-ze)/ie;if(Math.abs(Se)<1e-6||!isFinite(zt)){if(Math.abs(we-De)<1e-6)return this.easeTo(a,h);const mt=Dea.maxDuration&&(a.duration=0),this._zooming=!0,this._rotating=w!==R,this._pitching=z!==S,this._padding=!m.isPaddingEqual(L),this._prepareEase(h,!1),this.terrain&&this._prepareElevation(ae),this._ease(mt=>{const Tn=mt*zt,An=1/ht(Tn);m.zoom=1===mt?k:y+m.scaleZoom(An),this._rotating&&(m.bearing=b.number(w,R,mt)),this._pitching&&(m.pitch=b.number(S,z,mt)),this._padding&&(m.interpolatePadding(T,L,mt),ee=m.centerPoint.add(Q)),this.terrain&&!a.freezeElevation&&this._updateElevation(mt);const Ht=1===mt?ae:m.unproject(_e.add(ye.mult(Pt(Tn))).mult(An));m.setLocationAtPoint(m.renderWorldCopies?Ht.wrap():Ht,ee),this._fireMoveEvents(h)},()=>{this.terrain&&this._finalizeElevation(),this._afterEase(h)},a),this}isEasing(){return!!this._easeFrameId}stop(){return this._stop()}_stop(a,h){if(this._easeFrameId&&(this._cancelRenderFrame(this._easeFrameId),delete this._easeFrameId,delete this._onEaseFrame),this._onEaseEnd){const m=this._onEaseEnd;delete this._onEaseEnd,m.call(this,h)}if(!a){const m=this.handlers;m&&m.stop(!1)}return this}_ease(a,h,m){!1===m.animate||0===m.duration?(a(1),h()):(this._easeStart=b.exported.now(),this._easeOptions=m,this._onEaseFrame=a,this._onEaseEnd=h,this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback))}_renderFrameCallback(){const a=Math.min((b.exported.now()-this._easeStart)/this._easeOptions.duration,1);this._onEaseFrame(this._easeOptions.easing(a)),a<1?this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback):this.stop()}_normalizeBearing(a,h){a=b.wrap(a,-180,180);const m=Math.abs(a-h);return Math.abs(a-360-h)180?-360:m<-180?360:0}}class eh{constructor(a={}){this.options=a,b.bindAll(["_toggleAttribution","_updateData","_updateCompact","_updateCompactMinimize"],this)}getDefaultPosition(){return"bottom-right"}onAdd(a){return this._map=a,this._compact=this.options&&this.options.compact,this._container=Te.create("details","maplibregl-ctrl maplibregl-ctrl-attrib"),this._compactButton=Te.create("summary","maplibregl-ctrl-attrib-button",this._container),this._compactButton.addEventListener("click",this._toggleAttribution),this._setElementTitle(this._compactButton,"ToggleAttribution"),this._innerContainer=Te.create("div","maplibregl-ctrl-attrib-inner",this._container),this._updateAttributions(),this._updateCompact(),this._map.on("styledata",this._updateData),this._map.on("sourcedata",this._updateData),this._map.on("terrain",this._updateData),this._map.on("resize",this._updateCompact),this._map.on("drag",this._updateCompactMinimize),this._container}onRemove(){Te.remove(this._container),this._map.off("styledata",this._updateData),this._map.off("sourcedata",this._updateData),this._map.off("terrain",this._updateData),this._map.off("resize",this._updateCompact),this._map.off("drag",this._updateCompactMinimize),this._map=void 0,this._compact=void 0,this._attribHTML=void 0}_setElementTitle(a,h){const m=this._map._getUIString(`AttributionControl.${h}`);a.title=m,a.setAttribute("aria-label",m)}_toggleAttribution(){this._container.classList.contains("maplibregl-compact")&&(this._container.classList.contains("maplibregl-compact-show")?(this._container.setAttribute("open",""),this._container.classList.remove("maplibregl-compact-show")):(this._container.classList.add("maplibregl-compact-show"),this._container.removeAttribute("open")))}_updateData(a){!a||"metadata"!==a.sourceDataType&&"visibility"!==a.sourceDataType&&"style"!==a.dataType&&"terrain"!==a.type||this._updateAttributions()}_updateAttributions(){if(!this._map.style)return;let a=[];if(this.options.customAttribution&&(Array.isArray(this.options.customAttribution)?a=a.concat(this.options.customAttribution.map(y=>"string"!=typeof y?"":y)):"string"==typeof this.options.customAttribution&&a.push(this.options.customAttribution)),this._map.style.stylesheet){const y=this._map.style.stylesheet;this.styleOwner=y.owner,this.styleId=y.id}const h=this._map.style.sourceCaches;for(const y in h){const w=h[y];if(w.used||w.usedForTerrain){const S=w.getSource();S.attribution&&a.indexOf(S.attribution)<0&&a.push(S.attribution)}}a=a.filter(y=>String(y).trim()),a.sort((y,w)=>y.length-w.length),a=a.filter((y,w)=>{for(let S=w+1;S=0)return!1;return!0});const m=a.join(" | ");m!==this._attribHTML&&(this._attribHTML=m,a.length?(this._innerContainer.innerHTML=m,this._container.classList.remove("maplibregl-attrib-empty")):this._container.classList.add("maplibregl-attrib-empty"),this._updateCompact(),this._editLink=null)}_updateCompact(){this._map.getCanvasContainer().offsetWidth<=640||this._compact?!1===this._compact?this._container.setAttribute("open",""):this._container.classList.contains("maplibregl-compact")||this._container.classList.contains("maplibregl-attrib-empty")||(this._container.setAttribute("open",""),this._container.classList.add("maplibregl-compact","maplibregl-compact-show")):(this._container.setAttribute("open",""),this._container.classList.contains("maplibregl-compact")&&this._container.classList.remove("maplibregl-compact","maplibregl-compact-show"))}_updateCompactMinimize(){this._container.classList.contains("maplibregl-compact")&&this._container.classList.contains("maplibregl-compact-show")&&this._container.classList.remove("maplibregl-compact-show")}}class Zl{constructor(a={}){this.options=a,b.bindAll(["_updateCompact"],this)}getDefaultPosition(){return"bottom-left"}onAdd(a){this._map=a,this._compact=this.options&&this.options.compact,this._container=Te.create("div","maplibregl-ctrl");const h=Te.create("a","maplibregl-ctrl-logo");return h.target="_blank",h.rel="noopener nofollow",h.href="https://maplibre.org/",h.setAttribute("aria-label",this._map._getUIString("LogoControl.Title")),h.setAttribute("rel","noopener nofollow"),this._container.appendChild(h),this._container.style.display="block",this._map.on("resize",this._updateCompact),this._updateCompact(),this._container}onRemove(){Te.remove(this._container),this._map.off("resize",this._updateCompact),this._map=void 0,this._compact=void 0}_updateCompact(){const a=this._container.children;if(a.length){const h=a[0];this._map.getCanvasContainer().offsetWidth<=640||this._compact?!1!==this._compact&&h.classList.add("maplibregl-compact"):h.classList.remove("maplibregl-compact")}}}class pa{constructor(){this._queue=[],this._id=0,this._cleared=!1,this._currentlyRunning=!1}add(a){const h=++this._id;return this._queue.push({callback:a,id:h,cancelled:!1}),h}remove(a){const h=this._currentlyRunning,m=h?this._queue.concat(h):this._queue;for(const y of m)if(y.id===a)return void(y.cancelled=!0)}run(a=0){if(this._currentlyRunning)throw new Error("Attempting to run(), but is already running.");const h=this._currentlyRunning=this._queue;this._queue=[];for(const m of h)if(!m.cancelled&&(m.callback(a),this._cleared))break;this._cleared=!1,this._currentlyRunning=!1}clear(){this._currentlyRunning&&(this._cleared=!0),this._queue=[]}}const Mi={"AttributionControl.ToggleAttribution":"Toggle attribution","AttributionControl.MapFeedback":"Map feedback","FullscreenControl.Enter":"Enter fullscreen","FullscreenControl.Exit":"Exit fullscreen","GeolocateControl.FindMyLocation":"Find my location","GeolocateControl.LocationNotAvailable":"Location not available","LogoControl.Title":"Mapbox logo","NavigationControl.ResetBearing":"Reset bearing to north","NavigationControl.ZoomIn":"Zoom in","NavigationControl.ZoomOut":"Zoom out","ScaleControl.Feet":"ft","ScaleControl.Meters":"m","ScaleControl.Kilometers":"km","ScaleControl.Miles":"mi","ScaleControl.NauticalMiles":"nm","TerrainControl.enableTerrain":"Enable terrain","TerrainControl.disableTerrain":"Disable terrain"};var yd=b.createLayout([{name:"a_pos3d",type:"Int16",components:3}]);class Wl extends b.Evented{constructor(a){super(),this.sourceCache=a,this._tiles={},this._renderableTilesKeys=[],this._sourceTileCache={},this.minzoom=0,this.maxzoom=22,this.tileSize=512,this.deltaZoom=1,a.usedForTerrain=!0,a.tileSize=this.tileSize*2**this.deltaZoom}destruct(){this.sourceCache.usedForTerrain=!1,this.sourceCache.tileSize=null}update(a,h){this.sourceCache.update(a,h),this._renderableTilesKeys=[];const m={};for(const y of a.coveringTiles({tileSize:this.tileSize,minzoom:this.minzoom,maxzoom:this.maxzoom,reparseOverscaled:!1,terrain:h}))m[y.key]=!0,this._renderableTilesKeys.push(y.key),this._tiles[y.key]||(y.posMatrix=new Float64Array(16),b.ortho(y.posMatrix,0,b.EXTENT,0,b.EXTENT,0,1),this._tiles[y.key]=new jt(y,this.tileSize));for(const y in this._tiles)m[y]||delete this._tiles[y]}freeRtt(a){for(const h in this._tiles){const m=this._tiles[h];(!a||m.tileID.equals(a)||m.tileID.isChildOf(a)||a.isChildOf(m.tileID))&&(m.rtt=[])}}getRenderableTiles(){return this._renderableTilesKeys.map(a=>this.getTileByID(a))}getTileByID(a){return this._tiles[a]}getTerrainCoords(a){const h={};for(const m of this._renderableTilesKeys){const y=this._tiles[m].tileID;if(y.canonical.equals(a.canonical)){const w=a.clone();w.posMatrix=new Float64Array(16),b.ortho(w.posMatrix,0,b.EXTENT,0,b.EXTENT,0,1),h[m]=w}else if(y.canonical.isChildOf(a.canonical)){const w=a.clone();w.posMatrix=new Float64Array(16);const S=y.canonical.z-a.canonical.z,T=y.canonical.x-(y.canonical.x>>S<>S<>S;b.ortho(w.posMatrix,0,R,0,R,0,1),b.translate(w.posMatrix,w.posMatrix,[-T*R,-k*R,0]),h[m]=w}else if(a.canonical.isChildOf(y.canonical)){const w=a.clone();w.posMatrix=new Float64Array(16);const S=a.canonical.z-y.canonical.z,T=a.canonical.x-(a.canonical.x>>S<>S<>S;b.ortho(w.posMatrix,0,b.EXTENT,0,b.EXTENT,0,1),b.translate(w.posMatrix,w.posMatrix,[T*R,k*R,0]),b.scale(w.posMatrix,w.posMatrix,[1/2**S,1/2**S,0]),h[m]=w}}return h}getSourceTile(a,h){const m=this.sourceCache._source;let y=a.overscaledZ-this.deltaZoom;if(y>m.maxzoom&&(y=m.maxzoom),y=m.minzoom&&(!w||!w.dem);)w=this.sourceCache.getTileByID(a.scaledTo(y--).key);return w}tilesAfterTime(a=Date.now()){return Object.values(this._tiles).filter(h=>h.timeAdded>=a)}}class th{constructor(a,h,m){this.painter=a,this.sourceCache=new Wl(h),this.options=m,this.exaggeration="number"==typeof m.exaggeration?m.exaggeration:1,this.qualityFactor=2,this.meshSize=128,this._demMatrixCache={},this.coordsIndex=[],this._coordsTextureSize=1024}getDEMElevation(a,h,m,y=b.EXTENT){if(!(h>=0&&h=0&&ma.canonical.z&&(a.canonical.z>=y?w=a.canonical.z-y:b.warnOnce("cannot calculate elevation if elevation maxzoom > source.maxzoom"));const S=a.canonical.x-(a.canonical.x>>w<>w<>8<<4|w>>8,h[S+3]=0;const m=new b.RGBAImage({width:this._coordsTextureSize,height:this._coordsTextureSize},new Uint8Array(h.buffer)),y=new Hn(a,m,a.gl.RGBA,{premultiply:!1});return y.bind(a.gl.NEAREST,a.gl.CLAMP_TO_EDGE),this._coordsTexture=y,y}pointCoordinate(a){const h=new Uint8Array(4),m=this.painter.context,y=m.gl;m.bindFramebuffer.set(this.getFramebuffer("coords").framebuffer),y.readPixels(a.x,this.painter.height/devicePixelRatio-a.y-1,1,1,y.RGBA,y.UNSIGNED_BYTE,h),m.bindFramebuffer.set(null);const w=h[0]+(h[2]>>4<<8),S=h[1]+((15&h[2])<<8),T=this.coordsIndex[255-h[3]],k=T&&this.sourceCache.getTileByID(T);if(!k)return null;const R=this._coordsTextureSize,z=(1<a.id!==h),this._recentlyUsed.push(a.id)}stampObject(a){a.stamp=++this._stamp}getOrCreateFreeObject(){for(const h of this._recentlyUsed)if(!this._objects[h].inUse)return this._objects[h];if(this._objects.length>=this._size)throw new Error("No free RenderPool available, call freeAllObjects() required!");const a=this._createObject(this._objects.length);return this._objects.push(a),a}freeObject(a){a.inUse=!1}freeAllObjects(){for(const a of this._objects)this.freeObject(a)}isFull(){return!(this._objects.length!a.inUse)}}const Hs={background:!0,fill:!0,line:!0,raster:!0,hillshade:!0};class Xl{constructor(a,h){this.painter=a,this.terrain=h,this.pool=new vs(a.context,30,h.sourceCache.tileSize*h.qualityFactor)}destruct(){this.pool.destruct()}getTexture(a){return this.pool.getObjectForId(a.rtt[this._stacks.length-1].id).texture}prepareForRender(a,h){this._stacks=[],this._prevType=null,this._rttTiles=[],this._renderableTiles=this.terrain.sourceCache.getRenderableTiles(),this._renderableLayerIds=a._order.filter(m=>!a._layers[m].isHidden(h)),this._coordsDescendingInv={};for(const m in a.sourceCaches){this._coordsDescendingInv[m]={};const y=a.sourceCaches[m].getVisibleCoordinates();for(const w of y){const S=this.terrain.sourceCache.getTerrainCoords(w);for(const T in S)this._coordsDescendingInv[m][T]||(this._coordsDescendingInv[m][T]=[]),this._coordsDescendingInv[m][T].push(S[T])}}this._coordsDescendingInvStr={};for(const m of a._order){const y=a._layers[m],w=y.source;if(Hs[y.type]&&!this._coordsDescendingInvStr[w]){this._coordsDescendingInvStr[w]={};for(const S in this._coordsDescendingInv[w])this._coordsDescendingInvStr[w][S]=this._coordsDescendingInv[w][S].map(T=>T.key).sort().join()}}for(const m of this._renderableTiles)for(const y in this._coordsDescendingInvStr){const w=this._coordsDescendingInvStr[y][m.tileID.key];w&&w!==m.rttCoords[y]&&(m.rtt=[])}}renderLayer(a){if(a.isHidden(this.painter.transform.zoom))return!1;const h=a.type,m=this.painter,y=this._renderableLayerIds[this._renderableLayerIds.length-1]===a.id;if(Hs[h]&&(this._prevType&&Hs[this._prevType]||this._stacks.push([]),this._prevType=h,this._stacks[this._stacks.length-1].push(a.id),!y))return!0;if(Hs[this._prevType]||Hs[h]&&y){this._prevType=h;const w=this._stacks.length-1,S=this._stacks[w]||[];for(const T of this._renderableTiles){if(this.pool.isFull()&&(ld(this.painter,this.terrain,this._rttTiles),this._rttTiles=[],this.pool.freeAllObjects()),this._rttTiles.push(T),T.rtt[w]){const R=this.pool.getObjectForId(T.rtt[w].id);if(R.stamp===T.rtt[w].stamp){this.pool.useObject(R);continue}}const k=this.pool.getOrCreateFreeObject();this.pool.useObject(k),this.pool.stampObject(k),T.rtt[w]={id:k.id,stamp:k.stamp},m.context.bindFramebuffer.set(k.fbo.framebuffer),m.context.clear({color:b.Color.transparent});for(let R=0;R{g.touchstart=g.dragStart,g.touchmoveWindow=g.dragMove,g.touchend=g.dragEnd},vd={showCompass:!0,showZoom:!0,visualizePitch:!1};class Gf{constructor(a,h,m=!1){this._clickTolerance=10;const y=a.dragRotate._mouseRotate.getClickTolerance(),w=a.dragRotate._mousePitch.getClickTolerance();this.element=h,this.mouseRotate=hd({clickTolerance:y,enable:!0}),this.touchRotate=(({enable:S,clickTolerance:T,bearingDegreesPerPixelMoved:k=.8})=>{const R=new cr;return new Gl({clickTolerance:T,move:(z,L)=>({bearingDelta:(L.x-z.x)*k}),moveStateManager:R,enable:S,assignEvents:_d})})({clickTolerance:y,enable:!0}),this.map=a,m&&(this.mousePitch=Xu({clickTolerance:w,enable:!0}),this.touchPitch=(({enable:S,clickTolerance:T,pitchDegreesPerPixelMoved:k=-.5})=>{const R=new cr;return new Gl({clickTolerance:T,move:(z,L)=>({pitchDelta:(L.y-z.y)*k}),moveStateManager:R,enable:S,assignEvents:_d})})({clickTolerance:w,enable:!0})),b.bindAll(["mousedown","mousemove","mouseup","touchstart","touchmove","touchend","reset"],this),Te.addEventListener(h,"mousedown",this.mousedown),Te.addEventListener(h,"touchstart",this.touchstart,{passive:!1}),Te.addEventListener(h,"touchcancel",this.reset)}startMouse(a,h){this.mouseRotate.dragStart(a,h),this.mousePitch&&this.mousePitch.dragStart(a,h),Te.disableDrag()}startTouch(a,h){this.touchRotate.dragStart(a,h),this.touchPitch&&this.touchPitch.dragStart(a,h),Te.disableDrag()}moveMouse(a,h){const m=this.map,{bearingDelta:y}=this.mouseRotate.dragMove(a,h)||{};if(y&&m.setBearing(m.getBearing()+y),this.mousePitch){const{pitchDelta:w}=this.mousePitch.dragMove(a,h)||{};w&&m.setPitch(m.getPitch()+w)}}moveTouch(a,h){const m=this.map,{bearingDelta:y}=this.touchRotate.dragMove(a,h)||{};if(y&&m.setBearing(m.getBearing()+y),this.touchPitch){const{pitchDelta:w}=this.touchPitch.dragMove(a,h)||{};w&&m.setPitch(m.getPitch()+w)}}off(){const a=this.element;Te.removeEventListener(a,"mousedown",this.mousedown),Te.removeEventListener(a,"touchstart",this.touchstart,{passive:!1}),Te.removeEventListener(window,"touchmove",this.touchmove,{passive:!1}),Te.removeEventListener(window,"touchend",this.touchend),Te.removeEventListener(a,"touchcancel",this.reset),this.offTemp()}offTemp(){Te.enableDrag(),Te.removeEventListener(window,"mousemove",this.mousemove),Te.removeEventListener(window,"mouseup",this.mouseup),Te.removeEventListener(window,"touchmove",this.touchmove,{passive:!1}),Te.removeEventListener(window,"touchend",this.touchend)}mousedown(a){this.startMouse(b.extend({},a,{ctrlKey:!0,preventDefault:()=>a.preventDefault()}),Te.mousePos(this.element,a)),Te.addEventListener(window,"mousemove",this.mousemove),Te.addEventListener(window,"mouseup",this.mouseup)}mousemove(a){this.moveMouse(a,Te.mousePos(this.element,a))}mouseup(a){this.mouseRotate.dragEnd(a),this.mousePitch&&this.mousePitch.dragEnd(a),this.offTemp()}touchstart(a){1!==a.targetTouches.length?this.reset():(this._startPos=this._lastPos=Te.touchPos(this.element,a.targetTouches)[0],this.startTouch(a,this._startPos),Te.addEventListener(window,"touchmove",this.touchmove,{passive:!1}),Te.addEventListener(window,"touchend",this.touchend))}touchmove(a){1!==a.targetTouches.length?this.reset():(this._lastPos=Te.touchPos(this.element,a.targetTouches)[0],this.moveTouch(a,this._lastPos))}touchend(a){0===a.targetTouches.length&&this._startPos&&this._lastPos&&this._startPos.dist(this._lastPos)180;){const m=h.locationPoint(g);if(m.x>=0&&m.y>=0&&m.x<=h.width&&m.y<=h.height)break;g.lng>h.center.lng?g.lng-=360:g.lng+=360}return g}const qc={center:"translate(-50%,-50%)",top:"translate(-50%,0)","top-left":"translate(0,0)","top-right":"translate(-100%,0)",bottom:"translate(-50%,-100%)","bottom-left":"translate(0,-100%)","bottom-right":"translate(-100%,-100%)",left:"translate(0,-50%)",right:"translate(-100%,-50%)"};function xd(g,a,h){const m=g.classList;for(const y in qc)m.remove(`maplibregl-${h}-anchor-${y}`);m.add(`maplibregl-${h}-anchor-${a}`)}class rh extends b.Evented{constructor(a,h){if(super(),(a instanceof HTMLElement||h)&&(a=b.extend({element:a},h)),b.bindAll(["_update","_onMove","_onUp","_addDragHandler","_onMapClick","_onKeyPress"],this),this._anchor=a&&a.anchor||"center",this._color=a&&a.color||"#3FB1CE",this._scale=a&&a.scale||1,this._draggable=a&&a.draggable||!1,this._clickTolerance=a&&a.clickTolerance||0,this._isDragging=!1,this._state="inactive",this._rotation=a&&a.rotation||0,this._rotationAlignment=a&&a.rotationAlignment||"auto",this._pitchAlignment=a&&a.pitchAlignment&&"auto"!==a.pitchAlignment?a.pitchAlignment:this._rotationAlignment,a&&a.element)this._element=a.element,this._offset=b.pointGeometry.convert(a&&a.offset||[0,0]);else{this._defaultMarker=!0,this._element=Te.create("div"),this._element.setAttribute("aria-label","Map marker");const m=Te.createNS("http://www.w3.org/2000/svg","svg"),y=41,w=27;m.setAttributeNS(null,"display","block"),m.setAttributeNS(null,"height",`${y}px`),m.setAttributeNS(null,"width",`${w}px`),m.setAttributeNS(null,"viewBox",`0 0 ${w} ${y}`);const S=Te.createNS("http://www.w3.org/2000/svg","g");S.setAttributeNS(null,"stroke","none"),S.setAttributeNS(null,"stroke-width","1"),S.setAttributeNS(null,"fill","none"),S.setAttributeNS(null,"fill-rule","evenodd");const T=Te.createNS("http://www.w3.org/2000/svg","g");T.setAttributeNS(null,"fill-rule","nonzero");const k=Te.createNS("http://www.w3.org/2000/svg","g");k.setAttributeNS(null,"transform","translate(3.0, 29.0)"),k.setAttributeNS(null,"fill","#000000");const R=[{rx:"10.5",ry:"5.25002273"},{rx:"10.5",ry:"5.25002273"},{rx:"9.5",ry:"4.77275007"},{rx:"8.5",ry:"4.29549936"},{rx:"7.5",ry:"3.81822308"},{rx:"6.5",ry:"3.34094679"},{rx:"5.5",ry:"2.86367051"},{rx:"4.5",ry:"2.38636864"}];for(const ye of R){const ie=Te.createNS("http://www.w3.org/2000/svg","ellipse");ie.setAttributeNS(null,"opacity","0.04"),ie.setAttributeNS(null,"cx","10.5"),ie.setAttributeNS(null,"cy","5.80029008"),ie.setAttributeNS(null,"rx",ye.rx),ie.setAttributeNS(null,"ry",ye.ry),k.appendChild(ie)}const z=Te.createNS("http://www.w3.org/2000/svg","g");z.setAttributeNS(null,"fill",this._color);const L=Te.createNS("http://www.w3.org/2000/svg","path");L.setAttributeNS(null,"d","M27,13.5 C27,19.074644 20.250001,27.000002 14.75,34.500002 C14.016665,35.500004 12.983335,35.500004 12.25,34.500002 C6.7499993,27.000002 0,19.222562 0,13.5 C0,6.0441559 6.0441559,0 13.5,0 C20.955844,0 27,6.0441559 27,13.5 Z"),z.appendChild(L);const j=Te.createNS("http://www.w3.org/2000/svg","g");j.setAttributeNS(null,"opacity","0.25"),j.setAttributeNS(null,"fill","#000000");const Q=Te.createNS("http://www.w3.org/2000/svg","path");Q.setAttributeNS(null,"d","M13.5,0 C6.0441559,0 0,6.0441559 0,13.5 C0,19.222562 6.7499993,27 12.25,34.5 C13,35.522727 14.016664,35.500004 14.75,34.5 C20.250001,27 27,19.074644 27,13.5 C27,6.0441559 20.955844,0 13.5,0 Z M13.5,1 C20.415404,1 26,6.584596 26,13.5 C26,15.898657 24.495584,19.181431 22.220703,22.738281 C19.945823,26.295132 16.705119,30.142167 13.943359,33.908203 C13.743445,34.180814 13.612715,34.322738 13.5,34.441406 C13.387285,34.322738 13.256555,34.180814 13.056641,33.908203 C10.284481,30.127985 7.4148684,26.314159 5.015625,22.773438 C2.6163816,19.232715 1,15.953538 1,13.5 C1,6.584596 6.584596,1 13.5,1 Z"),j.appendChild(Q);const ee=Te.createNS("http://www.w3.org/2000/svg","g");ee.setAttributeNS(null,"transform","translate(6.0, 7.0)"),ee.setAttributeNS(null,"fill","#FFFFFF");const Y=Te.createNS("http://www.w3.org/2000/svg","g");Y.setAttributeNS(null,"transform","translate(8.0, 8.0)");const ae=Te.createNS("http://www.w3.org/2000/svg","circle");ae.setAttributeNS(null,"fill","#000000"),ae.setAttributeNS(null,"opacity","0.25"),ae.setAttributeNS(null,"cx","5.5"),ae.setAttributeNS(null,"cy","5.5"),ae.setAttributeNS(null,"r","5.4999962");const _e=Te.createNS("http://www.w3.org/2000/svg","circle");_e.setAttributeNS(null,"fill","#FFFFFF"),_e.setAttributeNS(null,"cx","5.5"),_e.setAttributeNS(null,"cy","5.5"),_e.setAttributeNS(null,"r","5.4999962"),Y.appendChild(ae),Y.appendChild(_e),T.appendChild(k),T.appendChild(z),T.appendChild(j),T.appendChild(ee),T.appendChild(Y),m.appendChild(T),m.setAttributeNS(null,"height",y*this._scale+"px"),m.setAttributeNS(null,"width",w*this._scale+"px"),this._element.appendChild(m),this._offset=b.pointGeometry.convert(a&&a.offset||[0,-14])}this._element.classList.add("maplibregl-marker"),this._element.addEventListener("dragstart",m=>{m.preventDefault()}),this._element.addEventListener("mousedown",m=>{m.preventDefault()}),xd(this._element,this._anchor,"marker"),this._popup=null}addTo(a){return this.remove(),this._map=a,a.getCanvasContainer().appendChild(this._element),a.on("move",this._update),a.on("moveend",this._update),this.setDraggable(this._draggable),this._update(),this._map.on("click",this._onMapClick),this}remove(){return this._opacityTimeout&&(clearTimeout(this._opacityTimeout),delete this._opacityTimeout),this._map&&(this._map.off("click",this._onMapClick),this._map.off("move",this._update),this._map.off("moveend",this._update),this._map.off("mousedown",this._addDragHandler),this._map.off("touchstart",this._addDragHandler),this._map.off("mouseup",this._onUp),this._map.off("touchend",this._onUp),this._map.off("mousemove",this._onMove),this._map.off("touchmove",this._onMove),delete this._map),Te.remove(this._element),this._popup&&this._popup.remove(),this}getLngLat(){return this._lngLat}setLngLat(a){return this._lngLat=b.LngLat.convert(a),this._pos=null,this._popup&&this._popup.setLngLat(this._lngLat),this._update(),this}getElement(){return this._element}setPopup(a){if(this._popup&&(this._popup.remove(),this._popup=null,this._element.removeEventListener("keypress",this._onKeyPress),this._originalTabIndex||this._element.removeAttribute("tabindex")),a){if(!("offset"in a.options)){const y=Math.sqrt(Math.pow(13.5,2)/2);a.options.offset=this._defaultMarker?{top:[0,0],"top-left":[0,0],"top-right":[0,0],bottom:[0,-38.1],"bottom-left":[y,-1*(24.6+y)],"bottom-right":[-y,-1*(24.6+y)],left:[13.5,-24.6],right:[-13.5,-24.6]}:this._offset}this._popup=a,this._lngLat&&this._popup.setLngLat(this._lngLat),this._originalTabIndex=this._element.getAttribute("tabindex"),this._originalTabIndex||this._element.setAttribute("tabindex","0"),this._element.addEventListener("keypress",this._onKeyPress)}return this}_onKeyPress(a){const h=a.code,m=a.charCode||a.keyCode;"Space"!==h&&"Enter"!==h&&32!==m&&13!==m||this.togglePopup()}_onMapClick(a){const h=a.originalEvent.target,m=this._element;this._popup&&(h===m||m.contains(h))&&this.togglePopup()}getPopup(){return this._popup}togglePopup(){const a=this._popup;return a?(a.isOpen()?a.remove():a.addTo(this._map),this):this}_update(a){if(!this._map)return;this._map.transform.renderWorldCopies&&(this._lngLat=bd(this._lngLat,this._pos,this._map.transform)),this._pos=this._map.project(this._lngLat)._add(this._offset);let h="";"viewport"===this._rotationAlignment||"auto"===this._rotationAlignment?h=`rotateZ(${this._rotation}deg)`:"map"===this._rotationAlignment&&(h=`rotateZ(${this._rotation-this._map.getBearing()}deg)`);let m="";"viewport"===this._pitchAlignment||"auto"===this._pitchAlignment?m="rotateX(0deg)":"map"===this._pitchAlignment&&(m=`rotateX(${this._map.getPitch()}deg)`),a&&"moveend"!==a.type||(this._pos=this._pos.round()),Te.setTransform(this._element,`${qc[this._anchor]} translate(${this._pos.x}px, ${this._pos.y}px) ${m} ${h}`),this._map.terrain&&!this._opacityTimeout&&(this._opacityTimeout=setTimeout(()=>{const y=this._map.unproject(this._pos),w=40075016.686*Math.abs(Math.cos(this._lngLat.lat*Math.PI/180))/Math.pow(2,this._map.transform.tileZoom+8);this._element.style.opacity=y.distanceTo(this._lngLat)>20*w?"0.2":"1.0",this._opacityTimeout=null},100))}getOffset(){return this._offset}setOffset(a){return this._offset=b.pointGeometry.convert(a),this._update(),this}_onMove(a){if(!this._isDragging){const h=this._clickTolerance||this._map._clickTolerance;this._isDragging=a.point.dist(this._pointerdownPos)>=h}this._isDragging&&(this._pos=a.point.sub(this._positionDelta),this._lngLat=this._map.unproject(this._pos),this.setLngLat(this._lngLat),this._element.style.pointerEvents="none","pending"===this._state&&(this._state="active",this.fire(new b.Event("dragstart"))),this.fire(new b.Event("drag")))}_onUp(){this._element.style.pointerEvents="auto",this._positionDelta=null,this._pointerdownPos=null,this._isDragging=!1,this._map.off("mousemove",this._onMove),this._map.off("touchmove",this._onMove),"active"===this._state&&this.fire(new b.Event("dragend")),this._state="inactive"}_addDragHandler(a){this._element.contains(a.originalEvent.target)&&(a.preventDefault(),this._positionDelta=a.point.sub(this._pos).add(this._offset),this._pointerdownPos=a.point,this._state="pending",this._map.on("mousemove",this._onMove),this._map.on("touchmove",this._onMove),this._map.once("mouseup",this._onUp),this._map.once("touchend",this._onUp))}setDraggable(a){return this._draggable=!!a,this._map&&(a?(this._map.on("mousedown",this._addDragHandler),this._map.on("touchstart",this._addDragHandler)):(this._map.off("mousedown",this._addDragHandler),this._map.off("touchstart",this._addDragHandler))),this}isDraggable(){return this._draggable}setRotation(a){return this._rotation=a||0,this._update(),this}getRotation(){return this._rotation}setRotationAlignment(a){return this._rotationAlignment=a||"auto",this._update(),this}getRotationAlignment(){return this._rotationAlignment}setPitchAlignment(a){return this._pitchAlignment=a&&"auto"!==a?a:this._rotationAlignment,this._update(),this}getPitchAlignment(){return this._pitchAlignment}}const He={positionOptions:{enableHighAccuracy:!1,maximumAge:0,timeout:6e3},fitBoundsOptions:{maxZoom:15},trackUserLocation:!1,showAccuracyCircle:!0,showUserLocation:!0};let en,ma=0,Gs=!1;const Pr={maxWidth:100,unit:"metric"};function ih(g,a,h){const m=h&&h.maxWidth||100,y=g._container.clientHeight/2,w=g.unproject([0,y]),S=g.unproject([m,y]),T=w.distanceTo(S);if(h&&"imperial"===h.unit){const k=3.2808*T;k>5280?qs(a,m,k/5280,g._getUIString("ScaleControl.Miles")):qs(a,m,k,g._getUIString("ScaleControl.Feet"))}else h&&"nautical"===h.unit?qs(a,m,T/1852,g._getUIString("ScaleControl.NauticalMiles")):T>=1e3?qs(a,m,T/1e3,g._getUIString("ScaleControl.Kilometers")):qs(a,m,T,g._getUIString("ScaleControl.Meters"))}function qs(g,a,h,m){const y=function(w){const S=Math.pow(10,`${Math.floor(w)}`.length-1);let T=w/S;return T=T>=10?10:T>=5?5:T>=3?3:T>=2?2:T>=1?1:function(k){const R=Math.pow(10,Math.ceil(-Math.log(k)/Math.LN10));return Math.round(k*R)/R}(T),S*T}(h);g.style.width=a*(y/h)+"px",g.innerHTML=`${y} ${m}`}const bs={closeButton:!0,closeOnClick:!0,focusAfterOpen:!0,className:"",maxWidth:"240px"},wd=["a[href]","[tabindex]:not([tabindex='-1'])","[contenteditable]:not([contenteditable='false'])","button:not([disabled])","input:not([disabled])","select:not([disabled])","textarea:not([disabled])"].join(", ");function oh(g){if(g){if("number"==typeof g){const a=Math.round(Math.sqrt(.5*Math.pow(g,2)));return{center:new b.pointGeometry(0,0),top:new b.pointGeometry(0,g),"top-left":new b.pointGeometry(a,a),"top-right":new b.pointGeometry(-a,a),bottom:new b.pointGeometry(0,-g),"bottom-left":new b.pointGeometry(a,-a),"bottom-right":new b.pointGeometry(-a,-a),left:new b.pointGeometry(g,0),right:new b.pointGeometry(-g,0)}}if(g instanceof b.pointGeometry||Array.isArray(g)){const a=b.pointGeometry.convert(g);return{center:a,top:a,"top-left":a,"top-right":a,bottom:a,"bottom-left":a,"bottom-right":a,left:a,right:a}}return{center:b.pointGeometry.convert(g.center||[0,0]),top:b.pointGeometry.convert(g.top||[0,0]),"top-left":b.pointGeometry.convert(g["top-left"]||[0,0]),"top-right":b.pointGeometry.convert(g["top-right"]||[0,0]),bottom:b.pointGeometry.convert(g.bottom||[0,0]),"bottom-left":b.pointGeometry.convert(g["bottom-left"]||[0,0]),"bottom-right":b.pointGeometry.convert(g["bottom-right"]||[0,0]),left:b.pointGeometry.convert(g.left||[0,0]),right:b.pointGeometry.convert(g.right||[0,0])}}return oh(new b.pointGeometry(0,0))}const ga={supported:_r,setRTLTextPlugin:b.setRTLTextPlugin,getRTLTextPluginStatus:b.getRTLTextPluginStatus,Map:class extends Si{constructor(g){var a;if(b.PerformanceUtils.mark(b.PerformanceMarkers.create),null!=(g=b.extend({},nh,g)).minZoom&&null!=g.maxZoom&&g.minZoom>g.maxZoom)throw new Error("maxZoom must be greater than or equal to minZoom");if(null!=g.minPitch&&null!=g.maxPitch&&g.minPitch>g.maxPitch)throw new Error("maxPitch must be greater than or equal to minPitch");if(null!=g.minPitch&&g.minPitch<0)throw new Error("minPitch must be greater than or equal to 0");if(null!=g.maxPitch&&g.maxPitch>85)throw new Error("maxPitch must be less than or equal to 85");if(super(new Er(g.minZoom,g.maxZoom,g.minPitch,g.maxPitch,g.renderWorldCopies),{bearingSnap:g.bearingSnap}),this._interactive=g.interactive,this._cooperativeGestures=g.cooperativeGestures,this._maxTileCacheSize=g.maxTileCacheSize,this._failIfMajorPerformanceCaveat=g.failIfMajorPerformanceCaveat,this._preserveDrawingBuffer=g.preserveDrawingBuffer,this._antialias=g.antialias,this._trackResize=g.trackResize,this._bearingSnap=g.bearingSnap,this._refreshExpiredTiles=g.refreshExpiredTiles,this._fadeDuration=g.fadeDuration,this._crossSourceCollisions=g.crossSourceCollisions,this._crossFadingFactor=1,this._collectResourceTiming=g.collectResourceTiming,this._renderTaskQueue=new pa,this._controls=[],this._mapId=b.uniqueId(),this._locale=b.extend({},Mi,g.locale),this._clickTolerance=g.clickTolerance,this._pixelRatio=null!==(a=g.pixelRatio)&&void 0!==a?a:devicePixelRatio,this._imageQueueHandle=ii.addThrottleControl(()=>this.isMoving()),this._requestManager=new kc(g.transformRequest),"string"==typeof g.container){if(this._container=document.getElementById(g.container),!this._container)throw new Error(`Container '${g.container}' not found.`)}else{if(!(g.container instanceof HTMLElement))throw new Error("Invalid type: 'container' must be a String or HTMLElement.");this._container=g.container}g.maxBounds&&this.setMaxBounds(g.maxBounds),b.bindAll(["_onWindowOnline","_onWindowResize","_onMapScroll","_contextLost","_contextRestored"],this),this._setupContainer(),this._setupPainter(),this.on("move",()=>this._update(!1)),this.on("moveend",()=>this._update(!1)),this.on("zoom",()=>this._update(!0)),this.on("terrain",()=>{this.painter.terrainFacilitator.dirty=!0,this._update(!0)}),typeof window<"u"&&(addEventListener("online",this._onWindowOnline,!1),addEventListener("resize",this._onWindowResize,!1),addEventListener("orientationchange",this._onWindowResize,!1)),this.handlers=new Qu(this,g),this._cooperativeGestures&&this._setupCooperativeGestures(),this._hash=g.hash&&new Bf("string"==typeof g.hash&&g.hash||void 0).addTo(this),this._hash&&this._hash._onHashChange()||(this.jumpTo({center:g.center,zoom:g.zoom,bearing:g.bearing,pitch:g.pitch}),g.bounds&&(this.resize(),this.fitBounds(g.bounds,b.extend({},g.fitBoundsOptions,{duration:0})))),this.resize(),this._localIdeographFontFamily=g.localIdeographFontFamily,g.style&&this.setStyle(g.style,{localIdeographFontFamily:g.localIdeographFontFamily}),g.attributionControl&&this.addControl(new eh({customAttribution:g.customAttribution})),g.maplibreLogo&&this.addControl(new Zl,g.logoPosition),this.on("style.load",()=>{this.transform.unmodified&&this.jumpTo(this.style.stylesheet)}),this.on("data",h=>{this._update("style"===h.dataType),this.fire(new b.Event(`${h.dataType}data`,h))}),this.on("dataloading",h=>{this.fire(new b.Event(`${h.dataType}dataloading`,h))}),this.on("dataabort",h=>{this.fire(new b.Event("sourcedataabort",h))})}_getMapId(){return this._mapId}addControl(g,a){if(void 0===a&&(a=g.getDefaultPosition?g.getDefaultPosition():"top-right"),!g||!g.onAdd)return this.fire(new b.ErrorEvent(new Error("Invalid argument to map.addControl(). Argument must be a control with onAdd and onRemove methods.")));const h=g.onAdd(this);this._controls.push(g);const m=this._controlPositions[a];return-1!==a.indexOf("bottom")?m.insertBefore(h,m.firstChild):m.appendChild(h),this}removeControl(g){if(!g||!g.onRemove)return this.fire(new b.ErrorEvent(new Error("Invalid argument to map.removeControl(). Argument must be a control with onAdd and onRemove methods.")));const a=this._controls.indexOf(g);return a>-1&&this._controls.splice(a,1),g.onRemove(this),this}hasControl(g){return this._controls.indexOf(g)>-1}calculateCameraOptionsFromTo(g,a,h,m){return null==m&&this.terrain&&(m=this.transform.getElevation(h,this.terrain)),super.calculateCameraOptionsFromTo(g,a,h,m)}resize(g){const a=this._containerDimensions(),h=a[0],m=a[1];this._resizeCanvas(h,m,this.getPixelRatio()),this.transform.resize(h,m),this.painter.resize(h,m,this.getPixelRatio());const y=!this._moving;return y&&(this.stop(),this.fire(new b.Event("movestart",g)).fire(new b.Event("move",g))),this.fire(new b.Event("resize",g)),y&&this.fire(new b.Event("moveend",g)),this}getPixelRatio(){return this._pixelRatio}setPixelRatio(g){const[a,h]=this._containerDimensions();this._pixelRatio=g,this._resizeCanvas(a,h,g),this.painter.resize(a,h,g)}getBounds(){return this.transform.getBounds()}getMaxBounds(){return this.transform.getMaxBounds()}setMaxBounds(g){return this.transform.setMaxBounds(b.LngLatBounds.convert(g)),this._update()}setMinZoom(g){if((g=g??-2)>=-2&&g<=this.transform.maxZoom)return this.transform.minZoom=g,this._update(),this.getZoom()=this.transform.minZoom)return this.transform.maxZoom=g,this._update(),this.getZoom()>g&&this.setZoom(g),this;throw new Error("maxZoom must be greater than the current minZoom")}getMaxZoom(){return this.transform.maxZoom}setMinPitch(g){if((g=g??0)<0)throw new Error("minPitch must be greater than or equal to 0");if(g>=0&&g<=this.transform.maxPitch)return this.transform.minPitch=g,this._update(),this.getPitch()85)throw new Error("maxPitch must be less than or equal to 85");if(g>=this.transform.minPitch)return this.transform.maxPitch=g,this._update(),this.getPitch()>g&&this.setPitch(g),this;throw new Error("maxPitch must be greater than the current minPitch")}getMaxPitch(){return this.transform.maxPitch}getRenderWorldCopies(){return this.transform.renderWorldCopies}setRenderWorldCopies(g){return this.transform.renderWorldCopies=g,this._update()}project(g){return this.transform.locationPoint(b.LngLat.convert(g),this.style&&this.terrain)}unproject(g){return this.transform.pointLocation(b.pointGeometry.convert(g),this.terrain)}isMoving(){var g;return this._moving||(null===(g=this.handlers)||void 0===g?void 0:g.isMoving())}isZooming(){var g;return this._zooming||(null===(g=this.handlers)||void 0===g?void 0:g.isZooming())}isRotating(){var g;return this._rotating||(null===(g=this.handlers)||void 0===g?void 0:g.isRotating())}_createDelegatedListener(g,a,h){if("mouseenter"===g||"mouseover"===g){let m=!1;return{layer:a,listener:h,delegates:{mousemove:w=>{const S=this.getLayer(a)?this.queryRenderedFeatures(w.point,{layers:[a]}):[];S.length?m||(m=!0,h.call(this,new Po(g,this,w.originalEvent,{features:S}))):m=!1},mouseout:()=>{m=!1}}}}if("mouseleave"===g||"mouseout"===g){let m=!1;return{layer:a,listener:h,delegates:{mousemove:S=>{(this.getLayer(a)?this.queryRenderedFeatures(S.point,{layers:[a]}):[]).length?m=!0:m&&(m=!1,h.call(this,new Po(g,this,S.originalEvent)))},mouseout:S=>{m&&(m=!1,h.call(this,new Po(g,this,S.originalEvent)))}}}}{const m=y=>{const w=this.getLayer(a)?this.queryRenderedFeatures(y.point,{layers:[a]}):[];w.length&&(y.features=w,h.call(this,y),delete y.features)};return{layer:a,listener:h,delegates:{[g]:m}}}}on(g,a,h){if(void 0===h)return super.on(g,a);const m=this._createDelegatedListener(g,a,h);this._delegatedListeners=this._delegatedListeners||{},this._delegatedListeners[g]=this._delegatedListeners[g]||[],this._delegatedListeners[g].push(m);for(const y in m.delegates)this.on(y,m.delegates[y]);return this}once(g,a,h){if(void 0===h)return super.once(g,a);const m=this._createDelegatedListener(g,a,h);for(const y in m.delegates)this.once(y,m.delegates[y]);return this}off(g,a,h){return void 0===h?super.off(g,a):(this._delegatedListeners&&this._delegatedListeners[g]&&(m=>{const y=this._delegatedListeners[g];for(let w=0;wthis._updateStyle(g,a));const h=this.style&&a.transformStyle?this.style.serialize():void 0;return this.style&&(this.style.setEventedParent(null),this.style._remove(!g)),g?(this.style=new Mt(this,a||{}),this.style.setEventedParent(this,{style:this.style}),"string"==typeof g?this.style.loadURL(g,a,h):this.style.loadJSON(g,a,h),this):(delete this.style,this)}_lazyInitEmptyStyle(){this.style||(this.style=new Mt(this,{}),this.style.setEventedParent(this,{style:this.style}),this.style.loadEmpty())}_diffStyle(g,a){if("string"==typeof g){const h=this._requestManager.transformRequest(g,pn.Style);b.getJSON(h,(m,y)=>{m?this.fire(new b.ErrorEvent(m)):y&&this._updateDiff(y,a)})}else"object"==typeof g&&this._updateDiff(g,a)}_updateDiff(g,a){try{this.style.setState(g,a)&&this._update(!0)}catch(h){b.warnOnce(`Unable to perform style diff: ${h.message||h.error||h}. Rebuilding the style from scratch.`),this._updateStyle(g,a)}}getStyle(){if(this.style)return this.style.serialize()}isStyleLoaded(){return this.style?this.style.loaded():b.warnOnce("There is no style added to the map.")}addSource(g,a){return this._lazyInitEmptyStyle(),this.style.addSource(g,a),this._update(!0)}isSourceLoaded(g){const a=this.style&&this.style.sourceCaches[g];if(void 0!==a)return a.loaded();this.fire(new b.ErrorEvent(new Error(`There is no source with ID '${g}'`)))}setTerrain(g){if(this.style._checkLoaded(),this._terrainDataCallback&&this.style.off("data",this._terrainDataCallback),g){const a=this.style.sourceCaches[g.source];if(!a)throw new Error(`cannot load terrain, because there exists no source with ID: ${g.source}`);this.terrain=new th(this.painter,a,g),this.painter.renderToTexture=new Xl(this.painter,this.terrain),this.transform.updateElevation(this.terrain),this._terrainDataCallback=h=>{"style"===h.dataType?this.terrain.sourceCache.freeRtt():"source"===h.dataType&&h.tile&&(h.sourceId===g.source&&this.transform.updateElevation(this.terrain),this.terrain.sourceCache.freeRtt(h.tile.tileID))},this.style.on("data",this._terrainDataCallback)}else this.terrain&&this.terrain.sourceCache.destruct(),this.terrain=null,this.painter.renderToTexture&&this.painter.renderToTexture.destruct(),this.painter.renderToTexture=null,this.transform.updateElevation(this.terrain);return this.fire(new b.Event("terrain",{terrain:g})),this}getTerrain(){return this.terrain&&this.terrain.options}areTilesLoaded(){const g=this.style&&this.style.sourceCaches;for(const a in g){const h=g[a]._tiles;for(const m in h){const y=h[m];if("loaded"!==y.state&&"errored"!==y.state)return!1}}return!0}addSourceType(g,a,h){return this._lazyInitEmptyStyle(),this.style.addSourceType(g,a,h)}removeSource(g){return this.style.removeSource(g),this._update(!0)}getSource(g){return this.style.getSource(g)}addImage(g,a,{pixelRatio:h=1,sdf:m=!1,stretchX:y,stretchY:w,content:S}={}){if(this._lazyInitEmptyStyle(),a instanceof HTMLImageElement||b.isImageBitmap(a)){const{width:T,height:k,data:R}=b.exported.getImageData(a);this.style.addImage(g,{data:new b.RGBAImage({width:T,height:k},R),pixelRatio:h,stretchX:y,stretchY:w,content:S,sdf:m,version:0})}else{if(void 0===a.width||void 0===a.height)return this.fire(new b.ErrorEvent(new Error("Invalid arguments to map.addImage(). The second argument must be an `HTMLImageElement`, `ImageData`, `ImageBitmap`, or object with `width`, `height`, and `data` properties with the same format as `ImageData`")));{const{width:T,height:k,data:R}=a,z=a;this.style.addImage(g,{data:new b.RGBAImage({width:T,height:k},new Uint8Array(R)),pixelRatio:h,stretchX:y,stretchY:w,content:S,sdf:m,version:0,userImage:z}),z.onAdd&&z.onAdd(this,g)}}}updateImage(g,a){const h=this.style.getImage(g);if(!h)return this.fire(new b.ErrorEvent(new Error("The map has no image with that id. If you are adding a new image use `map.addImage(...)` instead.")));const m=a instanceof HTMLImageElement||b.isImageBitmap(a)?b.exported.getImageData(a):a,{width:y,height:w,data:S}=m;if(void 0===y||void 0===w)return this.fire(new b.ErrorEvent(new Error("Invalid arguments to map.updateImage(). The second argument must be an `HTMLImageElement`, `ImageData`, `ImageBitmap`, or object with `width`, `height`, and `data` properties with the same format as `ImageData`")));if(y!==h.data.width||w!==h.data.height)return this.fire(new b.ErrorEvent(new Error("The width and height of the updated image must be that same as the previous version of the image")));const T=!(a instanceof HTMLImageElement||b.isImageBitmap(a));h.data.replace(S,T),this.style.updateImage(g,h)}hasImage(g){return g?!!this.style.getImage(g):(this.fire(new b.ErrorEvent(new Error("Missing required image id"))),!1)}removeImage(g){this.style.removeImage(g)}loadImage(g,a){ii.getImage(this._requestManager.transformRequest(g,pn.Image),a)}listImages(){return this.style.listImages()}addLayer(g,a){return this._lazyInitEmptyStyle(),this.style.addLayer(g,a),this._update(!0)}moveLayer(g,a){return this.style.moveLayer(g,a),this._update(!0)}removeLayer(g){return this.style.removeLayer(g),this._update(!0)}getLayer(g){return this.style.getLayer(g)}setLayerZoomRange(g,a,h){return this.style.setLayerZoomRange(g,a,h),this._update(!0)}setFilter(g,a,h={}){return this.style.setFilter(g,a,h),this._update(!0)}getFilter(g){return this.style.getFilter(g)}setPaintProperty(g,a,h,m={}){return this.style.setPaintProperty(g,a,h,m),this._update(!0)}getPaintProperty(g,a){return this.style.getPaintProperty(g,a)}setLayoutProperty(g,a,h,m={}){return this.style.setLayoutProperty(g,a,h,m),this._update(!0)}getLayoutProperty(g,a){return this.style.getLayoutProperty(g,a)}setGlyphs(g,a={}){return this._lazyInitEmptyStyle(),this.style.setGlyphs(g,a),this._update(!0)}getGlyphs(){return this.style.getGlyphsUrl()}addSprite(g,a,h={}){return this._lazyInitEmptyStyle(),this.style.addSprite(g,a,h,m=>{m||this._update(!0)}),this}removeSprite(g){return this._lazyInitEmptyStyle(),this.style.removeSprite(g),this._update(!0)}getSprite(){return this.style.getSprite()}setSprite(g,a={}){return this._lazyInitEmptyStyle(),this.style.setSprite(g,a,h=>{h||this._update(!0)}),this}setLight(g,a={}){return this._lazyInitEmptyStyle(),this.style.setLight(g,a),this._update(!0)}getLight(){return this.style.getLight()}setFeatureState(g,a){return this.style.setFeatureState(g,a),this._update()}removeFeatureState(g,a){return this.style.removeFeatureState(g,a),this._update()}getFeatureState(g){return this.style.getFeatureState(g)}getContainer(){return this._container}getCanvasContainer(){return this._canvasContainer}getCanvas(){return this._canvas}_containerDimensions(){let g=0,a=0;return this._container&&(g=this._container.clientWidth||400,a=this._container.clientHeight||300),[g,a]}_setupContainer(){const g=this._container;g.classList.add("maplibregl-map");const a=this._canvasContainer=Te.create("div","maplibregl-canvas-container",g);this._interactive&&a.classList.add("maplibregl-interactive"),this._canvas=Te.create("canvas","maplibregl-canvas",a),this._canvas.addEventListener("webglcontextlost",this._contextLost,!1),this._canvas.addEventListener("webglcontextrestored",this._contextRestored,!1),this._canvas.setAttribute("tabindex","0"),this._canvas.setAttribute("aria-label","Map"),this._canvas.setAttribute("role","region");const h=this._containerDimensions();this._resizeCanvas(h[0],h[1],this.getPixelRatio());const m=this._controlContainer=Te.create("div","maplibregl-control-container",g),y=this._controlPositions={};["top-left","top-right","bottom-left","bottom-right"].forEach(w=>{y[w]=Te.create("div",`maplibregl-ctrl-${w} `,m)}),this._container.addEventListener("scroll",this._onMapScroll,!1)}_setupCooperativeGestures(){const g=this._container;this._metaPress=!1,this._cooperativeGesturesScreen=Te.create("div","maplibregl-cooperative-gesture-screen",g);let a="Control",h="boolean"!=typeof this._cooperativeGestures&&this._cooperativeGestures.windowsHelpText?this._cooperativeGestures.windowsHelpText:"Use Ctrl + scroll to zoom the map";0===navigator.platform.indexOf("Mac")&&(h="boolean"!=typeof this._cooperativeGestures&&this._cooperativeGestures.macHelpText?this._cooperativeGestures.macHelpText:"Use \u2318 + scroll to zoom the map",a="Meta"),this._cooperativeGesturesScreen.innerHTML=`\n
${h}
\n
${"boolean"!=typeof this._cooperativeGestures&&this._cooperativeGestures.mobileHelpText?this._cooperativeGestures.mobileHelpText:"Use two fingers to move the map"}
\n `,document.addEventListener("keydown",m=>{m.key===a&&(this._metaPress=!0)}),document.addEventListener("keyup",m=>{m.key===a&&(this._metaPress=!1)}),this._canvasContainer.addEventListener("wheel",m=>{this._onCooperativeGesture(m,this._metaPress,1)},!1),this._canvasContainer.classList.remove("maplibregl-touch-drag-pan")}_resizeCanvas(g,a,h){this._canvas.width=h*g,this._canvas.height=h*a,this._canvas.style.width=`${g}px`,this._canvas.style.height=`${a}px`}_setupPainter(){const g=b.extend({},_r.webGLContextAttributes,{failIfMajorPerformanceCaveat:this._failIfMajorPerformanceCaveat,preserveDrawingBuffer:this._preserveDrawingBuffer,antialias:this._antialias||!1});let a=null;this._canvas.addEventListener("webglcontextcreationerror",m=>{a={requestedAttributes:g},m&&(a.statusMessage=m.statusMessage,a.type=m.type)},{once:!0});const h=this._canvas.getContext("webgl",g)||this._canvas.getContext("experimental-webgl",g);if(!h){const m="Failed to initialize WebGL";throw a?(a.message=m,new Error(JSON.stringify(a))):new Error(m)}this.painter=new gs(h,this.transform),Ni.testSupport(h)}_contextLost(g){g.preventDefault(),this._frame&&(this._frame.cancel(),this._frame=null),this.fire(new b.Event("webglcontextlost",{originalEvent:g}))}_contextRestored(g){this._setupPainter(),this.resize(),this._update(),this.fire(new b.Event("webglcontextrestored",{originalEvent:g}))}_onMapScroll(g){if(g.target===this._container)return this._container.scrollTop=0,this._container.scrollLeft=0,!1}_onCooperativeGesture(g,a,h){return!a&&h<2&&(this._cooperativeGesturesScreen.classList.add("maplibregl-show"),setTimeout(()=>{this._cooperativeGesturesScreen.classList.remove("maplibregl-show")},100)),!1}loaded(){return!this._styleDirty&&!this._sourcesDirty&&!!this.style&&this.style.loaded()}_update(g){return this.style?(this._styleDirty=this._styleDirty||g,this._sourcesDirty=!0,this.triggerRepaint(),this):this}_requestRenderFrame(g){return this._update(),this._renderTaskQueue.add(g)}_cancelRenderFrame(g){this._renderTaskQueue.remove(g)}_render(g){let a,h=0;const m=this.painter.context.extTimerQuery;if(this.listens("gpu-timing-frame")&&(a=m.createQueryEXT(),m.beginQueryEXT(m.TIME_ELAPSED_EXT,a),h=b.exported.now()),this.painter.context.setDirty(),this.painter.setBaseState(),this._renderTaskQueue.run(g),this._removed)return;let y=!1;if(this.style&&this._styleDirty){this._styleDirty=!1;const S=this.transform.zoom,T=b.exported.now();this.style.zoomHistory.update(S,T);const k=new b.EvaluationParameters(S,{now:T,fadeDuration:this._fadeDuration,zoomHistory:this.style.zoomHistory,transition:this.style.getTransition()}),R=k.crossFadingFactor();1===R&&R===this._crossFadingFactor||(y=!0,this._crossFadingFactor=R),this.style.update(k)}if(this.style&&this._sourcesDirty&&(this._sourcesDirty=!1,this.style._updateSources(this.transform)),this.terrain&&this.terrain.sourceCache.update(this.transform,this.terrain),this.transform.updateElevation(this.terrain),this._imageQueueDirty=ii.processQueue()>0,this._placementDirty=this.style&&this.style._updatePlacement(this.painter.transform,this.showCollisionBoxes,this._fadeDuration,this._crossSourceCollisions),this.painter.render(this.style,{showTileBoundaries:this.showTileBoundaries,showOverdrawInspector:this._showOverdrawInspector,rotating:this.isRotating(),zooming:this.isZooming(),moving:this.isMoving(),fadeDuration:this._fadeDuration,showPadding:this.showPadding,gpuTiming:!!this.listens("gpu-timing-layer")}),this.fire(new b.Event("render")),this.loaded()&&!this._loaded&&(this._loaded=!0,b.PerformanceUtils.mark(b.PerformanceMarkers.load),this.fire(new b.Event("load"))),this.style&&(this.style.hasTransitions()||y)&&(this._styleDirty=!0),this.style&&!this._placementDirty&&this.style._releaseSymbolFadeTiles(),this.listens("gpu-timing-frame")){const S=b.exported.now()-h;m.endQueryEXT(m.TIME_ELAPSED_EXT,a),setTimeout(()=>{const T=m.getQueryObjectEXT(a,m.QUERY_RESULT_EXT)/1e6;m.deleteQueryEXT(a),this.fire(new b.Event("gpu-timing-frame",{cpuTime:S,gpuTime:T}))},50)}if(this.listens("gpu-timing-layer")){const S=this.painter.collectGpuTimers();setTimeout(()=>{const T=this.painter.queryGpuTimers(S);this.fire(new b.Event("gpu-timing-layer",{layerTimes:T}))},50)}const w=this._sourcesDirty||this._styleDirty||this._placementDirty||this._imageQueueDirty;return w||this._repaint?this.triggerRepaint():!this.isMoving()&&this.loaded()&&this.fire(new b.Event("idle")),!this._loaded||this._fullyLoaded||w||(this._fullyLoaded=!0,b.PerformanceUtils.mark(b.PerformanceMarkers.fullLoad)),this}redraw(){return this.style&&(this._frame&&(this._frame.cancel(),this._frame=null),this._render(0)),this}remove(){this._hash&&this._hash.remove();for(const a of this._controls)a.onRemove(this);this._controls=[],this._frame&&(this._frame.cancel(),this._frame=null),this._renderTaskQueue.clear(),this.painter.destroy(),this.handlers.destroy(),delete this.handlers,this.setStyle(null),typeof window<"u"&&(removeEventListener("resize",this._onWindowResize,!1),removeEventListener("orientationchange",this._onWindowResize,!1),removeEventListener("online",this._onWindowOnline,!1)),ii.removeThrottleControl(this._imageQueueHandle);const g=this.painter.context.gl.getExtension("WEBGL_lose_context");g&&g.loseContext(),this._canvas.removeEventListener("webglcontextrestored",this._contextRestored,!1),this._canvas.removeEventListener("webglcontextlost",this._contextLost,!1),Te.remove(this._canvasContainer),Te.remove(this._controlContainer),this._cooperativeGestures&&Te.remove(this._cooperativeGesturesScreen),this._container.classList.remove("maplibregl-map"),b.PerformanceUtils.clearMetrics(),this._removed=!0,this.fire(new b.Event("remove"))}triggerRepaint(){this.style&&!this._frame&&(this._frame=b.exported.frame(g=>{b.PerformanceUtils.frame(g),this._frame=null,this._render(g)}))}_onWindowOnline(){this._update()}_onWindowResize(g){this._trackResize&&this.resize({originalEvent:g})._update()}get showTileBoundaries(){return!!this._showTileBoundaries}set showTileBoundaries(g){this._showTileBoundaries!==g&&(this._showTileBoundaries=g,this._update())}get showPadding(){return!!this._showPadding}set showPadding(g){this._showPadding!==g&&(this._showPadding=g,this._update())}get showCollisionBoxes(){return!!this._showCollisionBoxes}set showCollisionBoxes(g){this._showCollisionBoxes!==g&&(this._showCollisionBoxes=g,g?this.style._generateCollisionBoxes():this._update())}get showOverdrawInspector(){return!!this._showOverdrawInspector}set showOverdrawInspector(g){this._showOverdrawInspector!==g&&(this._showOverdrawInspector=g,this._update())}get repaint(){return!!this._repaint}set repaint(g){this._repaint!==g&&(this._repaint=g,this.triggerRepaint())}get vertices(){return!!this._vertices}set vertices(g){this._vertices=g,this._update()}get version(){return"3.0.0-pre.4"}getCameraTargetElevation(){return this.transform.elevation}},NavigationControl:class{constructor(g){this.options=b.extend({},vd,g),this._container=Te.create("div","maplibregl-ctrl maplibregl-ctrl-group"),this._container.addEventListener("contextmenu",a=>a.preventDefault()),this.options.showZoom&&(b.bindAll(["_setButtonTitle","_updateZoomButtons"],this),this._zoomInButton=this._createButton("maplibregl-ctrl-zoom-in",a=>this._map.zoomIn({},{originalEvent:a})),Te.create("span","maplibregl-ctrl-icon",this._zoomInButton).setAttribute("aria-hidden","true"),this._zoomOutButton=this._createButton("maplibregl-ctrl-zoom-out",a=>this._map.zoomOut({},{originalEvent:a})),Te.create("span","maplibregl-ctrl-icon",this._zoomOutButton).setAttribute("aria-hidden","true")),this.options.showCompass&&(b.bindAll(["_rotateCompassArrow"],this),this._compass=this._createButton("maplibregl-ctrl-compass",a=>{this.options.visualizePitch?this._map.resetNorthPitch({},{originalEvent:a}):this._map.resetNorth({},{originalEvent:a})}),this._compassIcon=Te.create("span","maplibregl-ctrl-icon",this._compass),this._compassIcon.setAttribute("aria-hidden","true"))}_updateZoomButtons(){const g=this._map.getZoom(),a=g===this._map.getMaxZoom(),h=g===this._map.getMinZoom();this._zoomInButton.disabled=a,this._zoomOutButton.disabled=h,this._zoomInButton.setAttribute("aria-disabled",a.toString()),this._zoomOutButton.setAttribute("aria-disabled",h.toString())}_rotateCompassArrow(){const g=this.options.visualizePitch?`scale(${1/Math.pow(Math.cos(this._map.transform.pitch*(Math.PI/180)),.5)}) rotateX(${this._map.transform.pitch}deg) rotateZ(${this._map.transform.angle*(180/Math.PI)}deg)`:`rotate(${this._map.transform.angle*(180/Math.PI)}deg)`;this._compassIcon.style.transform=g}onAdd(g){return this._map=g,this.options.showZoom&&(this._setButtonTitle(this._zoomInButton,"ZoomIn"),this._setButtonTitle(this._zoomOutButton,"ZoomOut"),this._map.on("zoom",this._updateZoomButtons),this._updateZoomButtons()),this.options.showCompass&&(this._setButtonTitle(this._compass,"ResetBearing"),this.options.visualizePitch&&this._map.on("pitch",this._rotateCompassArrow),this._map.on("rotate",this._rotateCompassArrow),this._rotateCompassArrow(),this._handler=new Gf(this._map,this._compass,this.options.visualizePitch)),this._container}onRemove(){Te.remove(this._container),this.options.showZoom&&this._map.off("zoom",this._updateZoomButtons),this.options.showCompass&&(this.options.visualizePitch&&this._map.off("pitch",this._rotateCompassArrow),this._map.off("rotate",this._rotateCompassArrow),this._handler.off(),delete this._handler),delete this._map}_createButton(g,a){const h=Te.create("button",g,this._container);return h.type="button",h.addEventListener("click",a),h}_setButtonTitle(g,a){const h=this._map._getUIString(`NavigationControl.${a}`);g.title=h,g.setAttribute("aria-label",h)}},GeolocateControl:class extends b.Evented{constructor(g){super(),this.options=b.extend({},He,g),b.bindAll(["_onSuccess","_onError","_onZoom","_finish","_setupUI","_updateCamera","_updateMarker"],this)}onAdd(g){var a;return this._map=g,this._container=Te.create("div","maplibregl-ctrl maplibregl-ctrl-group"),a=this._setupUI,void 0!==en?a(en):void 0!==window.navigator.permissions?window.navigator.permissions.query({name:"geolocation"}).then(h=>{en="denied"!==h.state,a(en)}):(en=!!window.navigator.geolocation,a(en)),this._container}onRemove(){void 0!==this._geolocationWatchID&&(window.navigator.geolocation.clearWatch(this._geolocationWatchID),this._geolocationWatchID=void 0),this.options.showUserLocation&&this._userLocationDotMarker&&this._userLocationDotMarker.remove(),this.options.showAccuracyCircle&&this._accuracyCircleMarker&&this._accuracyCircleMarker.remove(),Te.remove(this._container),this._map.off("zoom",this._onZoom),this._map=void 0,ma=0,Gs=!1}_isOutOfMapMaxBounds(g){const a=this._map.getMaxBounds(),h=g.coords;return a&&(h.longitudea.getEast()||h.latitudea.getNorth())}_setErrorState(){switch(this._watchState){case"WAITING_ACTIVE":this._watchState="ACTIVE_ERROR",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-active-error");break;case"ACTIVE_LOCK":this._watchState="ACTIVE_ERROR",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-active-error"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-waiting");break;case"BACKGROUND":this._watchState="BACKGROUND_ERROR",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-background-error"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-waiting");break;case"ACTIVE_ERROR":break;default:throw new Error(`Unexpected watchState ${this._watchState}`)}}_onSuccess(g){if(this._map){if(this._isOutOfMapMaxBounds(g))return this._setErrorState(),this.fire(new b.Event("outofmaxbounds",g)),this._updateMarker(),void this._finish();if(this.options.trackUserLocation)switch(this._lastKnownPosition=g,this._watchState){case"WAITING_ACTIVE":case"ACTIVE_LOCK":case"ACTIVE_ERROR":this._watchState="ACTIVE_LOCK",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active-error"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-active");break;case"BACKGROUND":case"BACKGROUND_ERROR":this._watchState="BACKGROUND",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background-error"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-background");break;default:throw new Error(`Unexpected watchState ${this._watchState}`)}this.options.showUserLocation&&"OFF"!==this._watchState&&this._updateMarker(g),this.options.trackUserLocation&&"ACTIVE_LOCK"!==this._watchState||this._updateCamera(g),this.options.showUserLocation&&this._dotElement.classList.remove("maplibregl-user-location-dot-stale"),this.fire(new b.Event("geolocate",g)),this._finish()}}_updateCamera(g){const a=new b.LngLat(g.coords.longitude,g.coords.latitude),h=g.coords.accuracy,m=this._map.getBearing(),y=b.extend({bearing:m},this.options.fitBoundsOptions);this._map.fitBounds(a.toBounds(h),y,{geolocateSource:!0})}_updateMarker(g){if(g){const a=new b.LngLat(g.coords.longitude,g.coords.latitude);this._accuracyCircleMarker.setLngLat(a).addTo(this._map),this._userLocationDotMarker.setLngLat(a).addTo(this._map),this._accuracy=g.coords.accuracy,this.options.showUserLocation&&this.options.showAccuracyCircle&&this._updateCircleRadius()}else this._userLocationDotMarker.remove(),this._accuracyCircleMarker.remove()}_updateCircleRadius(){const g=this._map._container.clientHeight/2,a=this._map.unproject([0,g]),h=this._map.unproject([1,g]),m=a.distanceTo(h),y=Math.ceil(2*this._accuracy/m);this._circleElement.style.width=`${y}px`,this._circleElement.style.height=`${y}px`}_onZoom(){this.options.showUserLocation&&this.options.showAccuracyCircle&&this._updateCircleRadius()}_onError(g){if(this._map){if(this.options.trackUserLocation)if(1===g.code){this._watchState="OFF",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active-error"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background-error"),this._geolocateButton.disabled=!0;const a=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.title=a,this._geolocateButton.setAttribute("aria-label",a),void 0!==this._geolocationWatchID&&this._clearWatch()}else{if(3===g.code&&Gs)return;this._setErrorState()}"OFF"!==this._watchState&&this.options.showUserLocation&&this._dotElement.classList.add("maplibregl-user-location-dot-stale"),this.fire(new b.Event("error",g)),this._finish()}}_finish(){this._timeoutId&&clearTimeout(this._timeoutId),this._timeoutId=void 0}_setupUI(g){if(this._container.addEventListener("contextmenu",a=>a.preventDefault()),this._geolocateButton=Te.create("button","maplibregl-ctrl-geolocate",this._container),Te.create("span","maplibregl-ctrl-icon",this._geolocateButton).setAttribute("aria-hidden","true"),this._geolocateButton.type="button",!1===g){b.warnOnce("Geolocation support is not available so the GeolocateControl will be disabled.");const a=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.disabled=!0,this._geolocateButton.title=a,this._geolocateButton.setAttribute("aria-label",a)}else{const a=this._map._getUIString("GeolocateControl.FindMyLocation");this._geolocateButton.title=a,this._geolocateButton.setAttribute("aria-label",a)}this.options.trackUserLocation&&(this._geolocateButton.setAttribute("aria-pressed","false"),this._watchState="OFF"),this.options.showUserLocation&&(this._dotElement=Te.create("div","maplibregl-user-location-dot"),this._userLocationDotMarker=new rh(this._dotElement),this._circleElement=Te.create("div","maplibregl-user-location-accuracy-circle"),this._accuracyCircleMarker=new rh({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",a=>{a.geolocateSource||"ACTIVE_LOCK"!==this._watchState||a.originalEvent&&"resize"===a.originalEvent.type||(this._watchState="BACKGROUND",this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active"),this.fire(new b.Event("trackuserlocationend")))})}trigger(){if(!this._setup)return b.warnOnce("Geolocate control triggered before added to a map"),!1;if(this.options.trackUserLocation){switch(this._watchState){case"OFF":this._watchState="WAITING_ACTIVE",this.fire(new b.Event("trackuserlocationstart"));break;case"WAITING_ACTIVE":case"ACTIVE_LOCK":case"ACTIVE_ERROR":case"BACKGROUND_ERROR":ma--,Gs=!1,this._watchState="OFF",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active-error"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background-error"),this.fire(new b.Event("trackuserlocationend"));break;case"BACKGROUND":this._watchState="ACTIVE_LOCK",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background"),this._lastKnownPosition&&this._updateCamera(this._lastKnownPosition),this.fire(new b.Event("trackuserlocationstart"));break;default:throw new Error(`Unexpected watchState ${this._watchState}`)}switch(this._watchState){case"WAITING_ACTIVE":this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-active");break;case"ACTIVE_LOCK":this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-active");break;case"OFF":break;default:throw new Error(`Unexpected watchState ${this._watchState}`)}if("OFF"===this._watchState&&void 0!==this._geolocationWatchID)this._clearWatch();else if(void 0===this._geolocationWatchID){let g;this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.setAttribute("aria-pressed","true"),ma++,ma>1?(g={maximumAge:6e5,timeout:0},Gs=!0):(g=this.options.positionOptions,Gs=!1),this._geolocationWatchID=window.navigator.geolocation.watchPosition(this._onSuccess,this._onError,g)}}else window.navigator.geolocation.getCurrentPosition(this._onSuccess,this._onError,this.options.positionOptions),this._timeoutId=setTimeout(this._finish,1e4);return!0}_clearWatch(){window.navigator.geolocation.clearWatch(this._geolocationWatchID),this._geolocationWatchID=void 0,this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.setAttribute("aria-pressed","false"),this.options.showUserLocation&&this._updateMarker(null)}},AttributionControl:eh,LogoControl:Zl,ScaleControl:class{constructor(g){this.options=b.extend({},Pr,g),b.bindAll(["_onMove","setUnit"],this)}getDefaultPosition(){return"bottom-left"}_onMove(){ih(this._map,this._container,this.options)}onAdd(g){return this._map=g,this._container=Te.create("div","maplibregl-ctrl maplibregl-ctrl-scale",g.getContainer()),this._map.on("move",this._onMove),this._onMove(),this._container}onRemove(){Te.remove(this._container),this._map.off("move",this._onMove),this._map=void 0}setUnit(g){this.options.unit=g,ih(this._map,this._container,this.options)}},FullscreenControl:class extends b.Evented{constructor(g={}){super(),this._onFullscreenChange=()=>{(window.document.fullscreenElement||window.document.mozFullScreenElement||window.document.webkitFullscreenElement||window.document.msFullscreenElement)===this._container!==this._fullscreen&&this._handleFullscreenChange()},this._onClickFullscreen=()=>{this._isFullscreen()?this._exitFullscreen():this._requestFullscreen()},this._fullscreen=!1,g&&g.container&&(g.container instanceof HTMLElement?this._container=g.container:b.warnOnce("Full screen control 'container' must be a DOM element.")),"onfullscreenchange"in document?this._fullscreenchange="fullscreenchange":"onmozfullscreenchange"in document?this._fullscreenchange="mozfullscreenchange":"onwebkitfullscreenchange"in document?this._fullscreenchange="webkitfullscreenchange":"onmsfullscreenchange"in document&&(this._fullscreenchange="MSFullscreenChange")}onAdd(g){return this._map=g,this._container||(this._container=this._map.getContainer()),this._controlContainer=Te.create("div","maplibregl-ctrl maplibregl-ctrl-group"),this._setupUI(),this._controlContainer}onRemove(){Te.remove(this._controlContainer),this._map=null,window.document.removeEventListener(this._fullscreenchange,this._onFullscreenChange)}_setupUI(){const g=this._fullscreenButton=Te.create("button","maplibregl-ctrl-fullscreen",this._controlContainer);Te.create("span","maplibregl-ctrl-icon",g).setAttribute("aria-hidden","true"),g.type="button",this._updateTitle(),this._fullscreenButton.addEventListener("click",this._onClickFullscreen),window.document.addEventListener(this._fullscreenchange,this._onFullscreenChange)}_updateTitle(){const g=this._getTitle();this._fullscreenButton.setAttribute("aria-label",g),this._fullscreenButton.title=g}_getTitle(){return this._map._getUIString(this._isFullscreen()?"FullscreenControl.Exit":"FullscreenControl.Enter")}_isFullscreen(){return this._fullscreen}_handleFullscreenChange(){this._fullscreen=!this._fullscreen,this._fullscreenButton.classList.toggle("maplibregl-ctrl-shrink"),this._fullscreenButton.classList.toggle("maplibregl-ctrl-fullscreen"),this._updateTitle(),this.fire(new b.Event(this._fullscreen?"fullscreenstart":"fullscreenend"))}_exitFullscreen(){window.document.exitFullscreen?window.document.exitFullscreen():window.document.mozCancelFullScreen?window.document.mozCancelFullScreen():window.document.msExitFullscreen?window.document.msExitFullscreen():window.document.webkitCancelFullScreen?window.document.webkitCancelFullScreen():this._togglePseudoFullScreen()}_requestFullscreen(){this._container.requestFullscreen?this._container.requestFullscreen():this._container.mozRequestFullScreen?this._container.mozRequestFullScreen():this._container.msRequestFullscreen?this._container.msRequestFullscreen():this._container.webkitRequestFullscreen?this._container.webkitRequestFullscreen():this._togglePseudoFullScreen()}_togglePseudoFullScreen(){this._container.classList.toggle("maplibregl-pseudo-fullscreen"),this._handleFullscreenChange(),this._map.resize()}},TerrainControl:class{constructor(g){this.options=g,b.bindAll(["_toggleTerrain","_updateTerrainIcon"],this)}onAdd(g){return this._map=g,this._container=Te.create("div","maplibregl-ctrl maplibregl-ctrl-group"),this._terrainButton=Te.create("button","maplibregl-ctrl-terrain",this._container),Te.create("span","maplibregl-ctrl-icon",this._terrainButton).setAttribute("aria-hidden","true"),this._terrainButton.type="button",this._terrainButton.addEventListener("click",this._toggleTerrain),this._updateTerrainIcon(),this._map.on("terrain",this._updateTerrainIcon),this._container}onRemove(){Te.remove(this._container),this._map.off("terrain",this._updateTerrainIcon),this._map=void 0}_toggleTerrain(){this._map.getTerrain()?this._map.setTerrain(null):this._map.setTerrain(this.options),this._updateTerrainIcon()}_updateTerrainIcon(){this._terrainButton.classList.remove("maplibregl-ctrl-terrain"),this._terrainButton.classList.remove("maplibregl-ctrl-terrain-enabled"),this._map.terrain?(this._terrainButton.classList.add("maplibregl-ctrl-terrain-enabled"),this._terrainButton.title=this._map._getUIString("TerrainControl.disableTerrain")):(this._terrainButton.classList.add("maplibregl-ctrl-terrain"),this._terrainButton.title=this._map._getUIString("TerrainControl.enableTerrain"))}},Popup:class extends b.Evented{constructor(g){super(),this.options=b.extend(Object.create(bs),g),b.bindAll(["_update","_onClose","remove","_onMouseMove","_onMouseUp","_onDrag"],this)}addTo(g){return this._map&&this.remove(),this._map=g,this.options.closeOnClick&&this._map.on("click",this._onClose),this.options.closeOnMove&&this._map.on("move",this._onClose),this._map.on("remove",this.remove),this._update(),this._focusFirstElement(),this._trackPointer?(this._map.on("mousemove",this._onMouseMove),this._map.on("mouseup",this._onMouseUp),this._container&&this._container.classList.add("maplibregl-popup-track-pointer"),this._map._canvasContainer.classList.add("maplibregl-track-pointer")):this._map.on("move",this._update),this.fire(new b.Event("open")),this}isOpen(){return!!this._map}remove(){return this._content&&Te.remove(this._content),this._container&&(Te.remove(this._container),delete this._container),this._map&&(this._map.off("move",this._update),this._map.off("move",this._onClose),this._map.off("click",this._onClose),this._map.off("remove",this.remove),this._map.off("mousemove",this._onMouseMove),this._map.off("mouseup",this._onMouseUp),this._map.off("drag",this._onDrag),delete this._map),this.fire(new b.Event("close")),this}getLngLat(){return this._lngLat}setLngLat(g){return this._lngLat=b.LngLat.convert(g),this._pos=null,this._trackPointer=!1,this._update(),this._map&&(this._map.on("move",this._update),this._map.off("mousemove",this._onMouseMove),this._container&&this._container.classList.remove("maplibregl-popup-track-pointer"),this._map._canvasContainer.classList.remove("maplibregl-track-pointer")),this}trackPointer(){return this._trackPointer=!0,this._pos=null,this._update(),this._map&&(this._map.off("move",this._update),this._map.on("mousemove",this._onMouseMove),this._map.on("drag",this._onDrag),this._container&&this._container.classList.add("maplibregl-popup-track-pointer"),this._map._canvasContainer.classList.add("maplibregl-track-pointer")),this}getElement(){return this._container}setText(g){return this.setDOMContent(document.createTextNode(g))}setHTML(g){const a=document.createDocumentFragment(),h=document.createElement("body");let m;for(h.innerHTML=g;m=h.firstChild,m;)a.appendChild(m);return this.setDOMContent(a)}getMaxWidth(){return this._container&&this._container.style.maxWidth}setMaxWidth(g){return this.options.maxWidth=g,this._update(),this}setDOMContent(g){if(this._content)for(;this._content.hasChildNodes();)this._content.firstChild&&this._content.removeChild(this._content.firstChild);else this._content=Te.create("div","maplibregl-popup-content",this._container);return this._content.appendChild(g),this._createCloseButton(),this._update(),this._focusFirstElement(),this}addClassName(g){this._container&&this._container.classList.add(g)}removeClassName(g){this._container&&this._container.classList.remove(g)}setOffset(g){return this.options.offset=g,this._update(),this}toggleClassName(g){if(this._container)return this._container.classList.toggle(g)}_createCloseButton(){this.options.closeButton&&(this._closeButton=Te.create("button","maplibregl-popup-close-button",this._content),this._closeButton.type="button",this._closeButton.setAttribute("aria-label","Close popup"),this._closeButton.innerHTML="×",this._closeButton.addEventListener("click",this._onClose))}_onMouseUp(g){this._update(g.point)}_onMouseMove(g){this._update(g.point)}_onDrag(g){this._update(g.point)}_update(g){if(!this._map||!this._lngLat&&!this._trackPointer||!this._content||(this._container||(this._container=Te.create("div","maplibregl-popup",this._map.getContainer()),this._tip=Te.create("div","maplibregl-popup-tip",this._container),this._container.appendChild(this._content),this.options.className&&this.options.className.split(" ").forEach(w=>this._container.classList.add(w)),this._trackPointer&&this._container.classList.add("maplibregl-popup-track-pointer")),this.options.maxWidth&&this._container.style.maxWidth!==this.options.maxWidth&&(this._container.style.maxWidth=this.options.maxWidth),this._map.transform.renderWorldCopies&&!this._trackPointer&&(this._lngLat=bd(this._lngLat,this._pos,this._map.transform)),this._trackPointer&&!g))return;const a=this._pos=this._trackPointer&&g?g:this._map.project(this._lngLat);let h=this.options.anchor;const m=oh(this.options.offset);if(!h){const w=this._container.offsetWidth,S=this._container.offsetHeight;let T;T=a.y+m.bottom.ythis._map.transform.height-S?["bottom"]:[],a.xthis._map.transform.width-w/2&&T.push("right"),h=0===T.length?"bottom":T.join("-")}const y=a.add(m[h]).round();Te.setTransform(this._container,`${qc[h]} translate(${y.x}px,${y.y}px)`),xd(this._container,h,"popup")}_focusFirstElement(){if(!this.options.focusAfterOpen||!this._container)return;const g=this._container.querySelector(wd);g&&g.focus()}_onClose(){this.remove()}},Marker:rh,Style:Mt,LngLat:b.LngLat,LngLatBounds:b.LngLatBounds,Point:b.pointGeometry,MercatorCoordinate:b.MercatorCoordinate,Evented:b.Evented,AJAXError:b.AJAXError,config:b.config,CanvasSource:Bi,GeoJSONSource:za,ImageSource:Vn,RasterDEMTileSource:Pe,RasterTileSource:Qn,VectorTileSource:mr,VideoSource:ds,prewarm:function(){Fc().acquire(ia)},clearPrewarmedResources:function(){const g=zn;g&&(g.isPreloaded()&&1===g.numActive()?(g.release(ia),zn=null):console.warn("Could not clear WebWorkers since there are active Map instances that still reference it. The pre-warmed WebWorker pool can only be cleared when all map instances have been removed with map.remove()"))},get version(){return"3.0.0-pre.4"},get workerCount(){return oo.workerCount},set workerCount(g){oo.workerCount=g},get maxParallelImageRequests(){return b.config.MAX_PARALLEL_IMAGE_REQUESTS},set maxParallelImageRequests(g){b.config.MAX_PARALLEL_IMAGE_REQUESTS=g},workerUrl:"",addProtocol(g,a){b.config.REGISTERED_PROTOCOLS[g]=a},removeProtocol(g){delete b.config.REGISTERED_PROTOCOLS[g]}};return ql.extend(ga,{isSafari:b.isSafari,getPerformanceMetrics:b.PerformanceUtils.getPerformanceMetrics}),ga}),or}()}},zm=>{zm(zm.s=418)}]); \ No newline at end of file diff --git a/frontend/package-lock.json b/frontend/package-lock.json index c1c1a75..8e9f707 100644 --- a/frontend/package-lock.json +++ b/frontend/package-lock.json @@ -12913,4 +12913,4 @@ } } } -} \ No newline at end of file +} diff --git a/frontend/src/app/device-view/device-view.component.css b/frontend/src/app/device-view/device-view.component.css index a5277ca..10c5715 100644 --- a/frontend/src/app/device-view/device-view.component.css +++ b/frontend/src/app/device-view/device-view.component.css @@ -49,4 +49,28 @@ .chart { padding: 1em; width: 80vw; +} + +.wifi-metric { + background-color: salmon; +} + +.ble-metric { + background-color: darkblue; +} + +.sample-metric { + background-color: #aaaaaa; +} + +.density-high { + background-color: red; +} + +.density-norm { + background-color: #aaaaaa; +} + +.density-low { + background-color: green; } \ No newline at end of file diff --git a/frontend/src/app/device-view/device-view.component.html b/frontend/src/app/device-view/device-view.component.html index c0515f0..2547772 100644 --- a/frontend/src/app/device-view/device-view.component.html +++ b/frontend/src/app/device-view/device-view.component.html @@ -5,21 +5,25 @@

{{ device.name }}

Sist oppdatert {{ samples.lastDataUpdate |date:'YYYY-MM-dd HH:mm'}}
-
+
{{ metricBLE }}
Maks antall bluetooth-enheter
-
+
{{ metricWifi }}
Maks antall WiFi-enheter
-
-
{{ metricSampleCount }}
+
+
{{ metricSampleCount }}
Målinger i perioden
-
-
{{ metricDensity }}
-
Folketetthet ({{ metricDensityPercent }}% av maks)
+
+
{{ metricDensityPercent }}%
+
Folketetthet av maks
diff --git a/frontend/src/app/device-view/device-view.component.ts b/frontend/src/app/device-view/device-view.component.ts index 2d0fe46..05de7d4 100644 --- a/frontend/src/app/device-view/device-view.component.ts +++ b/frontend/src/app/device-view/device-view.component.ts @@ -19,7 +19,6 @@ export class DeviceViewComponent implements OnInit, AfterViewInit, OnChanges { @Input("device") device: V1Device = {}; @ViewChild("chart") chartRef?: ElementRef; - metricDensity: string = ""; metricDensityPercent: number = 0; metricSampleCount: number = 0; metricWifi: number = 0; @@ -102,7 +101,7 @@ export class DeviceViewComponent implements OnInit, AfterViewInit, OnChanges { Plot.dot(this.data, { x: d => d.time, y: "ble", - stroke: "blue", + stroke: "darkblue", opacity: 0.2, }), Plot.line( @@ -112,7 +111,7 @@ export class DeviceViewComponent implements OnInit, AfterViewInit, OnChanges { { x: "time", y: "ble", - stroke: "blue", + stroke: "darkblue", strokeWidth: 2, opacity: 0.8, } @@ -121,7 +120,7 @@ export class DeviceViewComponent implements OnInit, AfterViewInit, OnChanges { Plot.dot(this.data, { x: "time", y: "wifi", - stroke: "red", + stroke: "salmon", opacity: 0.3, }), Plot.line( @@ -131,7 +130,7 @@ export class DeviceViewComponent implements OnInit, AfterViewInit, OnChanges { { x: "time", y: "wifi", - stroke: "red", + stroke: "salmon", strokeWidth: 2, opacity: 0.9, } @@ -141,8 +140,8 @@ export class DeviceViewComponent implements OnInit, AfterViewInit, OnChanges { ], color: { legend: false, - domain: ["wifi", "ble"], - range: ["red", "blue"] + domain: ["wifi", "salmon"], + range: ["red", "darkblue"] }, style: { fontFamily: 'sans-serif', @@ -162,25 +161,9 @@ export class DeviceViewComponent implements OnInit, AfterViewInit, OnChanges { let current = this.data[i].ble + this.data[i].wifi; let percent: number = Math.round(current * 100 / (maxBle + maxWifi)); - if (percent >= 80) { - busyIndicator = "Svært høy" - } - if (percent >= 60 && percent < 80) { - busyIndicator = "Høy"; - } - if (percent >= 40 && percent < 60) { - busyIndicator = "Normal"; - } - if (percent >= 25 && percent < 40) { - busyIndicator = "Lav"; - } - if (percent < 25) { - busyIndicator = "Svært Lav"; - } this.metricBLE = maxBle; this.metricWifi = maxWifi; this.metricSampleCount = this.data.length; - this.metricDensity = busyIndicator; this.metricDensityPercent = percent; } }